本文整理汇总了PHP中ProjectMilestones::getProjectMilestones方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectMilestones::getProjectMilestones方法的具体用法?PHP ProjectMilestones::getProjectMilestones怎么用?PHP ProjectMilestones::getProjectMilestones使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectMilestones
的用法示例。
在下文中一共展示了ProjectMilestones::getProjectMilestones方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view_milestones
function view_milestones()
{
ajx_current("empty");
$project = active_project();
$tag = active_tag();
$assigned_by = array_var($_GET, 'assigned_by', '');
$assigned_to = array_var($_GET, 'assigned_to', '');
$status = array_var($_GET, 'status', "pending");
// $assigned_to = explode(':', $assigned_to);
$to_company = array_var($assigned_to, 0, null);
$to_user = array_var($assigned_to, 1, null);
$assigned_by = explode(':', $assigned_by);
$by_company = array_var($assigned_by, 0, null);
$by_user = array_var($assigned_by, 1, null);
$milestones = ProjectMilestones::getProjectMilestones($project, null, 'ASC', $tag, $to_company, $to_user, $by_user, $status == 'pending');
$milestones_bottom_complete = array();
$ms = array();
foreach ($milestones as $milestone) {
if (!$milestone->isCompleted()) {
$milestones_bottom_complete[] = $milestone;
$ms[] = $this->milestone_item($milestone);
}
}
foreach ($milestones as $milestone) {
if ($milestone->isCompleted()) {
$milestones_bottom_complete[] = $milestone;
$ms[] = $this->milestone_item($milestone);
}
}
ajx_extra_data(array("milestones" => $ms));
tpl_assign('milestones', $milestones_bottom_complete);
tpl_assign('project', $project);
}
示例2: new_list_tasks
//.........这里部分代码省略.........
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) {
foreach ($externalMilestonesTemp as $em) {
$found = false;