當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ProjectMilestones::find方法代碼示例

本文整理匯總了PHP中ProjectMilestones::find方法的典型用法代碼示例。如果您正苦於以下問題:PHP ProjectMilestones::find方法的具體用法?PHP ProjectMilestones::find怎麽用?PHP ProjectMilestones::find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ProjectMilestones的用法示例。


在下文中一共展示了ProjectMilestones::find方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getProjectMilestones

 static function getProjectMilestones($project = null, $order = null, $orderdir = 'DESC', $tag = null, $assigned_to_company = null, $assigned_to_user = null, $assigned_by_user = null, $pending = false, $is_template = false, $archived = false)
 {
     // default
     $order_by = '`due_date` ASC';
     if ($project instanceof Project) {
         $pids = $project->getAllSubWorkspacesQuery(!$archived);
         $projectstr = " AND " . self::getWorkspaceString($pids);
     } else {
         $projectstr = "";
     }
     if ($tag == '' || $tag == null) {
         $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 ";
     }
     $assignedToStr = "";
     if ($assigned_to_company) {
         $assignedToStr .= " AND `assigned_to_company_id` = " . DB::escape($assigned_to_company) . " ";
     }
     if ($assigned_to_user) {
         $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 ($pending) {
         $pendingstr = " AND `completed_on` = " . DB::escape(EMPTY_DATETIME) . " ";
     } else {
         $pendingstr = "";
     }
     if ($archived) {
         $archived_cond = " AND `archived_by_id` <> 0";
     } else {
         $archived_cond = " AND `archived_by_id` = 0";
     }
     $permissionstr = ' AND ( ' . permissions_sql_for_listings(ProjectMilestones::instance(), ACCESS_LEVEL_READ, logged_user()) . ') ';
     $otherConditions = $projectstr . $tagstr . $assignedToStr . $assignedByStr . $permissionstr . $pendingstr . $archived_cond;
     $conditions = array(' `is_template` = ' . DB::escape($is_template) . $otherConditions);
     $milestones = ProjectMilestones::find(array('conditions' => $conditions, 'order' => $order_by));
     if (!is_array($milestones)) {
         $milestones = array();
     }
     return $milestones;
 }
開發者ID:pnagaraju25,項目名稱:fengoffice,代碼行數:50,代碼來源:ProjectMilestones.class.php


注:本文中的ProjectMilestones::find方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。