Example #1
0
         if (count($tmp) > 1) {
             $hperc_assign_ar[$tmp[0]] = $tmp[1];
             $bulk_task_assign .= $tmp[0] . ',';
         } else {
             $hperc_assign_ar[$tmp[0]] = 100;
             $bulk_task_assign .= $tmp[0] . ',';
         }
     }
     $upd_task = new CTask();
     $upd_task->load($key);
     if ($upd_task->task_id) {
         $upd_task->updateAssigned($bulk_task_assign, $hperc_assign_ar, false, false);
     }
     //$upd_task->updateAssigned($bulk_task_assign,array($bulk_task_assign=>$bulk_task_assign_perc),false,false);
     if ($upd_task->task_project && $upd_task->task_id && $upd_task->task_notify) {
         $upd_task->notify();
     }
 }
 //Action: Unassign User
 if (isset($_POST['bulk_task_unassign']) && $bulk_task_unassign != '') {
     $upd_task = new CTask();
     $upd_task->load($key);
     if ($upd_task->task_id) {
         $upd_task->removeAssigned($bulk_task_unassign);
     }
 }
 // Action: Allow user to add task logs for others
 if (isset($_POST['bulk_task_allow_other_user_tasklogs']) && $bulk_task_allow_other_user_tasklogs != '') {
     $upd_task = new CTask();
     $upd_task->load($key);
     if ($upd_task->task_id) {
            $AppUI->setMsg($msg, UI_MSG_ERROR);
            $AppUI->redirect();
            // Store failed don't continue?
        } else {
            $custom_fields = new CustomFields($m, 'addedit', $obj->task_id, "edit");
            $custom_fields->bind($_POST);
            $sql = $custom_fields->store($obj->task_id);
            // Store Custom Fields
            $AppUI->setMsg($task_id ? 'Task updated' : 'Task added', UI_MSG_OK);
        }
        if (isset($hassign)) {
            $obj->updateAssigned($hassign, $hperc_assign_ar);
        }
        if (isset($hdependencies)) {
            $obj->updateDependencies($hdependencies);
        }
        // If there is a set of post_save functions, then we process them
        if (isset($post_save)) {
            foreach ($post_save as $post_save_function) {
                $post_save_function();
            }
        }
        if ($notify) {
            if ($msg = $obj->notify($comment)) {
                $AppUI->setMsg($msg, UI_MSG_ERROR);
            }
        }
        $AppUI->redirect();
    }
}
// end of if subform