本文整理汇总了PHP中Tasks::getDefaultFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP Tasks::getDefaultFilter方法的具体用法?PHP Tasks::getDefaultFilter怎么用?PHP Tasks::getDefaultFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tasks
的用法示例。
在下文中一共展示了Tasks::getDefaultFilter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeIndex
public function executeIndex(sfWebRequest $request)
{
app::setPageTitle('Gantt Chart', $this->getResponse());
if ($request->hasParameter('projects_id')) {
$this->forward404Unless($this->projects = Doctrine_Core::getTable('Projects')->createQuery()->addWhere('id=?', $request->getParameter('projects_id'))->fetchOne(), sprintf('Object projects does not exist (%s).', $request->getParameter('projects_id')));
$this->checkProjectsAccess($this->projects);
$this->checkTasksAccess('view', false, $this->projects);
} else {
$this->checkTasksAccess('view');
}
if (!$this->getUser()->hasAttribute('gantt_filter' . $this->get_pid($request))) {
$this->getUser()->setAttribute('gantt_filter' . $this->get_pid($request), Tasks::getDefaultFilter($request, $this->getUser(), 'ganttChart'));
}
$this->filter_by = $this->getUser()->getAttribute('gantt_filter' . $this->get_pid($request));
if ($fb = $request->getParameter('filter_by')) {
$this->filter_by[key($fb)] = current($fb);
$this->getUser()->setAttribute('gantt_filter' . $this->get_pid($request), $this->filter_by);
$this->redirect('ganttChart/index' . $this->add_pid($request));
}
if ($request->hasParameter('remove_filter')) {
unset($this->filter_by[$request->getParameter('remove_filter')]);
$this->getUser()->setAttribute('gantt_filter' . $this->get_pid($request), $this->filter_by);
$this->redirect('ganttChart/index' . $this->add_pid($request));
}
$this->tasks_tree = array();
$this->tasks_list = $this->getTasks($request, $this->tasks_tree);
}
示例2: executeMyTimeReport
public function executeMyTimeReport(sfWebRequest $request)
{
if (!$this->getUser()->hasCredential('reports_access_time_personal')) {
$this->redirect('accessForbidden/index');
}
$this->checkTasksAccess('view');
if (!$this->getUser()->hasAttribute('my_time_report_filter')) {
$this->getUser()->setAttribute('my_time_report_filter', Tasks::getDefaultFilter($request, $this->getUser(), 'timeReport'));
}
$this->filter_by = $this->getUser()->getAttribute('my_time_report_filter');
if ($fb = $request->getParameter('filter_by')) {
foreach ($fb as $k => $v) {
$this->filter_by[$k] = $v;
}
$this->getUser()->setAttribute('my_time_report_filter', $this->filter_by);
$this->redirect('timeReport/myTimeReport');
}
if ($request->hasParameter('remove_filter')) {
unset($this->filter_by[$request->getParameter('remove_filter')]);
$this->getUser()->setAttribute('my_time_report_filter', $this->filter_by);
$this->redirect('timeReport/myTimeReport');
}
$this->filter_by['CommentCreatedBy'] = $this->getUser()->getAttribute('id');
$this->getUser()->setAttribute('my_time_report_filter', $this->filter_by);
app::setPageTitle('My Time Report', $this->getResponse());
$this->tasks_comments = $this->getTasksComments($request, 'my_time_report_filter');
$this->setTemplate('index');
}
示例3: executeIndex
public function executeIndex(sfWebRequest $request)
{
$this->forward404Unless($this->projects = Doctrine_Core::getTable('Projects')->createQuery()->addWhere('id=?', $request->getParameter('projects_id'))->fetchOne(), sprintf('Object projects does not exist (%s).', $request->getParameter('projects_id')));
$this->forward404Unless($this->tasks = Doctrine_Core::getTable('Tasks')->createQuery()->addWhere('id=?', $request->getParameter('tasks_id'))->addWhere('projects_id=?', $request->getParameter('projects_id'))->fetchOne(), sprintf('Object tasks does not exist (%s).', $request->getParameter('id')));
$this->checkProjectsAccess($this->projects);
$this->checkTasksAccess('view', $this->tasks, $this->projects);
if (!$this->getUser()->hasAttribute('tasks_filter' . $request->getParameter('projects_id'))) {
$this->getUser()->setAttribute('tasks_filter' . $request->getParameter('projects_id'), Tasks::getDefaultFilter($request, $this->getUser()));
}
$this->tasks_comments = Doctrine_Core::getTable('TasksComments')->createQuery('tc')->leftJoin('tc.Users u')->addWhere('tc.tasks_id=?', $request->getParameter('tasks_id'))->orderBy('tc.created_at desc')->fetchArray();
$this->more_actions = $this->getMoreActions($request);
app::setPageTitle(t::__('Task') . ' | ' . ($this->tasks->getTasksLabelId() > 0 ? $this->tasks->getTasksLabels()->getName() . ': ' : '') . $this->tasks->getName(), $this->getResponse());
}
示例4: set_fitlers
protected function set_fitlers($request)
{
if (!$this->getUser()->hasAttribute('tasks_filter' . $this->get_pid($request))) {
$this->getUser()->setAttribute('tasks_filter' . $this->get_pid($request), Tasks::getDefaultFilter($request, $this->getUser()));
}
}