* Copyright 1999-2000, Tim Perdue/Sourceforge
* Copyright 2002, Tim Perdue/GForge, LLC
*
- * This file is part of FusionForge.
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
*
- * FusionForge is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2 of the License,
- * or (at your option) any later version.
- *
- * FusionForge is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with FusionForge; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
require_once $gfcommon.'pm/ProjectTaskFactory.class.php';
}
function &pm_import_tasks($group_project_id,&$tasks) {
+ $was_error = false;
+ $foo = "";
+
printr($tasks,'MSPCheckin::in-array');
printr(getenv('TZ'),'MSPCheckin::entry TZ');
$resrc = $tasks[$i]['resources'];
for ($j=0; $j<count($resrc); $j++) {
//validate user - see if they really exist as techs in this subproject
- if (!$tarr[strtolower($resrc[$j]['user_name'])]) {
+ if (!util_ifsetor($tarr[strtolower($resrc[$j]['user_name'])])) {
//create list of bogus names to send back
if (array_search(strtolower($resrc[$j]['user_name']),$invalid_names) === false) {
$invalid_names[]=$resrc[$j]['user_name'];
//
if (count($invalid_names)) {
$array['success']=false;
- $array['errormessage']='Invalid Resource Name';
+ $array['errormessage']='Invalid Resource Name:';
+ foreach ($invalid_names as $i) {
+ $array['errormessage'] .= ' ' . $i;
+ }
$array['resourcename']=$invalid_names;
for ($i=0; $i<$tcount; $i++) {
$array['usernames'][$techs[$i]->getID()]=$techs[$i]->getUnixName();
} else {
//update existing task
//create the task
- $pt = &projecttask_get_object($tasks[$i]['id']);
+ $pt = projecttask_get_object($tasks[$i]['id']);
if (!$pt || !is_object($pt)) {
printr($tasks[$i]['id'],'Could not get task');
// $array['success']=false;
//iterate the tasks
for ($i=0; $i<$count; $i++) {
$darr=$tasks[$i]['dependenton'];
-
+
$deps=array();
//iterate each dependency in a task
for ($dcount=0; $dcount<count($darr); $dcount++) {
$deps[$id]=$darr[$dcount]['link_type'];
}
printr($deps,'Deps for task id: '.$tasks[$i]['id']);
- if (is_object($tasks[$i]['obj'])) {
+ if (isset($tasks[$i]['obj']) && is_object($tasks[$i]['obj'])) {
printr($deps,'11 Done Setting deps for task id: '.$tasks[$i]['id']);
if (!$tasks[$i]['obj']->setDependentOn($deps)) {
$was_error=true;
//
printr($was_error,'Right before deleting unreferenced tasks');
if (!$was_error) {
- $ptf =& new ProjectTaskFactory($pg);
+ $ptf = new ProjectTaskFactory($pg);
$pt_arr=& $ptf->getTasks();
for ($i=0; $i<count($pt_arr); $i++) {
if (is_object($pt_arr[$i])) {
- if (!$completed[$pt_arr[$i]->getID()]) {
+ if (!util_ifsetor($completed[$pt_arr[$i]->getID()])) {
printr($pt_arr[$i]->getID(),'Deleting task');
if (!$pt_arr[$i]->delete(true)) {
echo $pt_arr[$i]->getErrorMessage();