本文整理汇总了PHP中ProjectMilestones::populateData方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectMilestones::populateData方法的具体用法?PHP ProjectMilestones::populateData怎么用?PHP ProjectMilestones::populateData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectMilestones
的用法示例。
在下文中一共展示了ProjectMilestones::populateData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: new_list_tasks
//.........这里部分代码省略.........
$now = date('Y-m-j 00:00:00');
$task_status_condition = " AND `completed_on` = " . DB::escape(EMPTY_DATETIME) . " AND `due_date` <= '{$now}'";
break;
case 20:
// Actives task by current user
$now = date('Y-m-j 00:00:00');
$task_status_condition = " AND `completed_on` = " . DB::escape(EMPTY_DATETIME) . " AND `start_date` <= '{$now}' AND `assigned_to_user_id` = " . logged_user()->getId();
break;
case 21:
// Subscribed tasks by current user
$res20 = DB::execute("SELECT object_id FROM " . TABLE_PREFIX . "object_subscriptions WHERE `object_manager` LIKE 'ProjectTasks' AND `user_id` = " . logged_user()->getId());
$subs_rows = $res20->fetchAll($res20);
foreach ($subs_rows as $row) {
$subs[] = $row['object_id'];
}
unset($res20, $subs_rows, $row);
$now = date('Y-m-j 00:00:00');
$task_status_condition = " AND `completed_on` = " . DB::escape(EMPTY_DATETIME) . " AND `id` IN(" . implode(',', $subs) . ")";
break;
case 2:
// All tasks
break;
default:
throw new Exception('Task status "' . $status . '" not recognised');
}
if (!$tag) {
$tagstr = "";
} else {
$tagstr = " AND (select count(*) from " . TABLE_PREFIX . "tags where " . TABLE_PREFIX . "project_tasks.id = " . TABLE_PREFIX . "tags.rel_object_id and " . TABLE_PREFIX . "tags.tag = " . DB::escape($tag) . " and " . TABLE_PREFIX . "tags.rel_object_manager ='ProjectTasks' ) > 0 ";
}
$conditions = $template_condition . $task_filter_condition . $task_status_condition . $permissions . $tagstr . $projectstr . " AND `trashed_by_id` = 0 AND `archived_by_id` = 0";
//Now get the tasks
$tasks = ProjectTasks::findAll(array('conditions' => $conditions, 'order' => 'created_on DESC', 'limit' => user_config_option('task_display_limit') > 0 ? user_config_option('task_display_limit') + 1 : null));
ProjectTasks::populateData($tasks);
//Find all internal milestones for these tasks
$internalMilestones = ProjectMilestones::getProjectMilestones(active_or_personal_project(), null, 'DESC', "", null, null, null, $status == 0, false);
ProjectMilestones::populateData($internalMilestones);
//Find all external milestones for these tasks
$milestone_ids = array();
if ($tasks) {
foreach ($tasks as $task) {
if ($task->getMilestoneId() != 0) {
$milestone_ids[$task->getMilestoneId()] = $task->getMilestoneId();
}
}
}
$milestone_ids_condition = '';
if (count($milestone_ids) > 0) {
$milestone_ids_condition = ' OR id in (' . implode(',', $milestone_ids) . ')';
}
if ($status == 0) {
$pendingstr = " AND `completed_on` = " . DB::escape(EMPTY_DATETIME) . " ";
} else {
$pendingstr = "";
}
if (!$tag) {
$tagstr = "";
} else {
$tagstr = " AND (select count(*) from " . TABLE_PREFIX . "tags where " . TABLE_PREFIX . "project_milestones.id = " . TABLE_PREFIX . "tags.rel_object_id and " . TABLE_PREFIX . "tags.tag = " . DB::escape($tag) . " and " . TABLE_PREFIX . "tags.rel_object_manager ='ProjectMilestones' ) > 0 ";
}
$projectstr = " AND (" . ProjectMilestones::getWorkspaceString($pids) . $milestone_ids_condition . ")";
$archivedstr = " AND `archived_by_id` = 0 ";
$milestone_conditions = " `is_template` = false " . $archivedstr . $projectstr . $pendingstr;
$externalMilestonesTemp = ProjectMilestones::findAll(array('conditions' => $milestone_conditions));
$externalMilestones = array();
if ($externalMilestonesTemp) {