当前位置: 首页>>代码示例>>PHP>>正文


PHP ProjectTasks::find方法代码示例

本文整理汇总了PHP中ProjectTasks::find方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectTasks::find方法的具体用法?PHP ProjectTasks::find怎么用?PHP ProjectTasks::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProjectTasks的用法示例。


在下文中一共展示了ProjectTasks::find方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAllTaskTemplates

	/**
	 * Returns all task templates
	 *
	 */
	static function getAllTaskTemplates($only_parent_task_templates = false, $archived = false) {
		if ($archived)
			$archived_cond = "AND `archived_on` <> 0";
		else
			$archived_cond = "AND `archived_on` = 0";
		
		$conditions = " `is_template` = true $archived_cond";
		if ($only_parent_task_templates)
			$conditions .= "  and `parent_id` = 0  ";
		$order_by = "`title` ASC";
		$tasks = ProjectTasks::find ( array ('conditions' => $conditions, 'order' => $order_by ) );
		if (! is_array ( $tasks ))
			$tasks = array ();
		return $tasks;
	}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:19,代码来源:ProjectTasks.class.php

示例2: getProjectTasks

 static function getProjectTasks($project = null, $order = null, $orderdir = 'ASC', $parent_id = null, $milestone_id = null, $tag = null, $assigned_to_company = null, $assigned_to_user = null, $assigned_by_user = null, $pending = false, $priority = "all", $is_template = false, $is_today = false, $is_late = false, $limit = null, $archived = false)
 {
     if ($order == self::ORDER_BY_STARTDATE) {
         $order_by = '`start_date` ' . $orderdir;
     } else {
         if ($order == self::ORDER_BY_DUEDATE) {
             $order_by = '`due_date` ' . $orderdir;
         } else {
             // default
             $order_by = '`order` ' . $orderdir;
         }
     }
     // if
     if ($project instanceof Project) {
         $pids = $project->getAllSubWorkspacesQuery(!$archived);
         $projectstr = " AND " . self::getWorkspaceString($pids);
     } else {
         $projectstr = "";
     }
     if ($parent_id === null) {
         $parentstr = "";
     } else {
         $parentstr = " AND `parent_id` = " . DB::escape($parent_id) . " ";
     }
     if ($milestone_id === null) {
         $milestonestr = "";
     } else {
         $milestonestr = " AND `milestone_id` = " . DB::escape($milestone_id) . " ";
     }
     if ($tag == '' || $tag == null) {
         $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 ";
     }
     $assignedToStr = "";
     if ($assigned_to_company) {
         if ($assigned_to_company == -1) {
             $assigned_to_company = 0;
         }
         $assignedToStr .= " AND `assigned_to_company_id` = " . DB::escape($assigned_to_company) . " ";
     }
     if ($assigned_to_user) {
         if ($assigned_to_user == -1) {
             $assigned_to_user = 0;
         }
         $assignedToStr .= " AND `assigned_to_user_id` = " . DB::escape($assigned_to_user) . " ";
     }
     $assignedByStr = "";
     if ($assigned_by_user) {
         $assignedByStr .= " AND (`created_by_id` = " . DB::escape($assigned_by_user) . " OR `updated_by_id` = " . DB::escape($assigned_by_user) . ") ";
     }
     if ($pending) {
         $pendingstr = " AND `completed_on` = " . DB::escape(EMPTY_DATETIME) . " ";
     } else {
         $pendingstr = "";
     }
     if (is_numeric($priority)) {
         $priostr = " AND `priority` = " . DB::escape($priority);
     } else {
         $priostr = "";
     }
     if ($archived) {
         $archived_cond = " AND `archived_by_id` <> 0";
     } else {
         $archived_cond = " AND `archived_by_id` = 0";
     }
     $permissionstr = ' AND ( ' . permissions_sql_for_listings(ProjectTasks::instance(), ACCESS_LEVEL_READ, logged_user()) . ') ';
     $otherConditions = $milestonestr . $parentstr . $projectstr . $tagstr . $assignedToStr . $assignedByStr . $pendingstr . $priostr . $permissionstr . $archived_cond;
     $conditions = array(' `is_template` = ' . DB::escape($is_template) . $otherConditions);
     $tasks = ProjectTasks::find(array('conditions' => $conditions, 'order' => $order_by, 'limit' => $limit));
     if (!is_array($tasks)) {
         $tasks = array();
     }
     return $tasks;
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:75,代码来源:ProjectTasks.class.php


注:本文中的ProjectTasks::find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。