本文整理汇总了PHP中CTask::updateAssigned方法的典型用法代码示例。如果您正苦于以下问题:PHP CTask::updateAssigned方法的具体用法?PHP CTask::updateAssigned怎么用?PHP CTask::updateAssigned使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTask
的用法示例。
在下文中一共展示了CTask::updateAssigned方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sizeof
$htasks_ar[] = $tid;
}
}
}
$sizeof = sizeof($htasks_ar);
for ($i = 0; $i <= $sizeof; $i++) {
$_POST['task_id'] = $htasks_ar[$i];
// verify that task_id is not NULL
if ($_POST['task_id'] > 0) {
$obj = new CTask();
if (!$obj->bind($_POST)) {
$AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
$AppUI->redirect();
}
if ($rm && $del) {
$overAssignment = $obj->updateAssigned($hassign, $hperc_assign_ar, true, true);
if ($overAssignment) {
$AppUI->setMsg('Some Users could not be unassigned from Task', UI_MSG_ERROR);
} else {
// Don't do anything because we might have other tasks to change
// $AppUI->setMsg('User(s) unassigned from Task', UI_MSG_OK);
// $AppUI->redirect();
}
} else {
if ($rm || $del) {
if ($msg = $obj->removeAssigned($user_id)) {
$AppUI->setMsg($msg, UI_MSG_ERROR);
} else {
$AppUI->setMsg('User unassigned from Task', UI_MSG_OK);
}
}
示例2: explode
$tmp_ar = explode(';', $bulk_task_hperc_assign);
$hperc_assign_ar = array();
for ($i = 0, $i_cmp = sizeof($tmp_ar); $i < $i_cmp; $i++) {
$tmp = explode('=', $tmp_ar[$i]);
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
示例3: CTask
$upd_task->store();
}
}
//Action: Modify Type
if (isset($_POST['bulk_task_type']) && $bulk_task_type != '') {
if ($upd_task->task_id) {
$upd_task->task_type = $bulk_task_type;
$upd_task->store();
}
}
//Action: Assign User
if (isset($_POST['bulk_task_assign']) && $bulk_task_assign != '') {
$upd_task = new CTask();
$upd_task->load($key);
if ($upd_task->task_id) {
$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: Other Actions
if (isset($_POST['bulk_task_other']) && $bulk_task_other != '') {
示例4: executePost
//.........这里部分代码省略.........
} elseif ($tmp[0] != '') {
$hperc_assign_ar[$tmp[0]] = 100;
}
}
// let's check if there are some assigned departments to task
$task->task_departments = implode(',', $this->getParam('dept_ids', self::TYPE_ARRAY));
// convert dates to SQL format first
if ($task->task_start_date) {
$date = new w2p_Utilities_Date($task->task_start_date);
$task->task_start_date = $date->format(FMT_DATETIME_MYSQL);
}
$end_date = null;
if ($task->task_end_date) {
if (strpos($task->task_end_date, '2400') !== false) {
$task->task_end_date = str_replace('2400', '2359', $task->task_end_date);
}
$end_date = new w2p_Utilities_Date($task->task_end_date);
$task->task_end_date = $end_date->format(FMT_DATETIME_MYSQL);
}
$error_array = $task->store($AppUI);
// Return all the validation messages
if ($error_array !== true) {
$error_message = '';
foreach ($error_array as $error) {
$error_message .= $error . '. ';
}
throw new Frapi_Error('SAVE_ERROR', $error_message);
}
$task_parent = $this->getParam('task_parent') ? $this->getParam('task_parent', SELF::TYPE_INT) : 0;
$old_task_parent = $this->getParam('old_task_parent') ? $this->getParam('old_task_parent', SELF::TYPE_INT) : 0;
if ($task_parent != $old_task_parent) {
$oldTask = new CTask();
$oldTask->load($old_task_parent);
$oldTask->updateDynamics(false);
}
// How to handle custom fields? Do we support it in api?
// Now add any task reminders
// If there wasn't a task, but there is one now, and
// that task date is set, we need to set a reminder.
if (empty($task_end_date) || !empty($end_date) && $task_end_date->dateDiff($end_date)) {
$task->addReminder();
}
if (isset($hassign)) {
$task->updateAssigned($hassign, $hperc_assign_ar);
}
if (isset($hdependencies)) {
// && !empty($hdependencies)) {
// there are dependencies set!
// backup initial start and end dates
$tsd = new w2p_Utilities_Date($task->task_start_date);
$ted = new w2p_Utilities_Date($task->task_end_date);
// updating the table recording the
// dependency relations with this task
$task->updateDependencies($hdependencies, $task_parent);
// we will reset the task's start date based upon dependencies
// and shift the end date appropriately
if ($adjustStartDate && !is_null($hdependencies)) {
// load already stored task data for this task
$tempTask = new CTask();
$tempTask->load($task->task_id);
// shift new start date to the last dependency end date
$nsd = new w2p_Utilities_Date($tempTask->get_deps_max_end_date($tempTask));
// prefer Wed 8:00 over Tue 16:00 as start date
$nsd = $nsd->next_working_day();
// prepare the creation of the end date
$ned = new w2p_Utilities_Date();
$ned->copy($nsd);
if (empty($task->task_start_date)) {
// appropriately calculated end date via start+duration
$ned->addDuration($task->task_duration, $task->task_duration_type);
} else {
// calc task time span start - end
$d = $tsd->calcDuration($ted);
// Re-add (keep) task time span for end date.
// This is independent from $obj->task_duration.
// The value returned by Date::Duration() is always in hours ('1')
$ned->addDuration($d, '1');
}
// prefer tue 16:00 over wed 8:00 as an end date
$ned = $ned->prev_working_day();
$task->task_start_date = $nsd->format(FMT_DATETIME_MYSQL);
$task->task_end_date = $ned->format(FMT_DATETIME_MYSQL);
$q = new w2p_Database_Query();
$q->addTable('tasks', 't');
$q->addUpdate('task_start_date', $task->task_start_date);
$q->addUpdate('task_end_date', $task->task_end_date);
$q->addWhere('task_id = ' . (int) $task->task_id);
$q->addWhere('task_dynamic <> 1');
$q->exec();
$q->clear();
}
$task->pushDependencies($task->task_id, $task->task_end_date);
}
//$task = (array)$task;
$task->load($task_id);
unset($task->_query, $task->_error, $task->_tbl_prefix, $task->_tbl, $task->_tbl_key, $task->_tbl_module);
$this->data['task'] = $task;
$this->data['success'] = true;
return $this->toArray();
}
示例5: CustomFields
$AppUI->redirect('', -1);
}
} else {
if ($msg = $obj->store()) {
$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);
}
}
示例6: elseif
$date = new w2p_Utilities_Date($elements['add_task_end_date_' . $on]);
$end_date = $date->format(FMT_DATETIME_MYSQL);
$end_date = $AppUI->convertToSystemTZ($end_date);
}
$tline->task_end_date = $end_date;
$tline->task_duration = $elements['add_task_duration_' . $on];
$tline->task_duration_type = $elements['add_task_durntype_' . $on];
$tline->task_priority = $elements['add_task_priority_' . $on];
$tline->task_type = $elements['add_task_type_' . $on];
$tline->task_access = $elements['add_task_access_' . $on];
$tline->task_description = $elements['add_task_description_' . $on] ? $elements['add_task_description_' . $on] : '';
$tline->task_owner = $AppUI->user_id;
$tline->task_dynamic = 31;
if ($elements['add_task_extra_' . $on] == '1') {
$tline->task_milestone = '1';
} elseif ($elements['add_task_extra_' . $on] == '2') {
$tline->task_dynamic = '1';
} elseif ($elements['add_task_extra_' . $on] == '3') {
$tline->task_status = '-1';
}
$result = $tline->store();
$tline->updateAssigned($AppUI->user_id, array($AppUI->user_id => 100));
if (count($tline->getError())) {
$taskErrors[] = $tline->getError();
}
}
}
if (count($taskErrors) > 0) {
$AppUI->setMsg($result, UI_MSG_ERROR);
}
$AppUI->redirect('m=projectdesigner&project_id=' . $project_id);