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


PHP Whups::getOwnerCriteria方法代碼示例

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


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

示例1: _content

 /**
  */
 protected function _content()
 {
     $queue_ids = array_keys(Whups::permissionsFilter($GLOBALS['whups_driver']->getQueues(), 'queue', Horde_Perms::READ));
     $info = array('owner' => Whups::getOwnerCriteria($GLOBALS['registry']->getAuth()), 'nores' => true, 'queue' => $queue_ids);
     $assigned = $GLOBALS['whups_driver']->getTicketsByProperties($info);
     if (!$assigned) {
         return '<p class="horde-content"><em>' . _("No tickets are assigned to you.") . '</em></p>';
     }
     return $this->_table($assigned);
 }
開發者ID:jubinpatel,項目名稱:horde,代碼行數:12,代碼來源:Mytickets.php

示例2: listTimeObjects

 /**
  * Lists tickets with due dates as time objects.
  *
  * @param array $categories  The time categories (from listTimeObjectCategories) to list.
  * @param mixed $start       The start date of the period.
  * @param mixed $end         The end date of the period.
  */
 public function listTimeObjects($categories, $start, $end)
 {
     global $whups_driver;
     $start = new Horde_Date($start);
     $start_ts = $start->timestamp();
     $end = new Horde_Date($end);
     $end_ts = $end->timestamp();
     $criteria['owner'] = Whups::getOwnerCriteria($GLOBALS['registry']->getAuth());
     /* @TODO Use $categories */
     $category = 'due';
     switch ($category) {
         case 'assigned':
             $label = _("Assigned");
             $criteria['ass'] = true;
             break;
         case 'created':
             $label = _("Created");
             break;
         case 'due':
             $label = _("Due");
             $criteria['nores'] = true;
             break;
         case 'resolved':
             $label = _("Resolved");
             $criteria['res'] = true;
             break;
     }
     try {
         $tickets = $whups_driver->getTicketsByProperties($criteria);
     } catch (Whups_Exception $e) {
         return array();
     }
     $objects = array();
     foreach ($tickets as $ticket) {
         switch ($category) {
             case 'assigned':
                 $t_start = $ticket['date_assigned'];
                 break;
             case 'created':
                 $t_start = $ticket['timestamp'];
                 break;
             case 'due':
                 if (empty($ticket['due'])) {
                     continue 2;
                 }
                 $t_start = $ticket['due'];
                 break;
             case 'resolved':
                 $t_start = $ticket['date_resolved'];
                 break;
         }
         if ($t_start + 1 < $start_ts || $t_start > $end_ts) {
             continue;
         }
         $t = new Whups_Ticket($ticket['id'], $ticket);
         $objects[$ticket['id']] = array('title' => sprintf('%s: [#%s] %s', $label, $ticket['id'], $ticket['summary']), 'description' => $t->toString(), 'id' => $ticket['id'], 'start' => date('Y-m-d\\TH:i:s', $t_start), 'end' => date('Y-m-d\\TH:i:s', $t_start + 1), 'params' => array('id' => $ticket['id']), 'link' => Whups::urlFor('ticket', $ticket['id'], true));
     }
     return $objects;
 }
開發者ID:raz0rsdge,項目名稱:horde,代碼行數:66,代碼來源:Api.php


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