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


PHP Ticket::haveAGroup方法代碼示例

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


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

示例1: canUpdateItem

 /**
  * Is the current user have right to update the current satisfaction
  *
  * @return boolean
  **/
 function canUpdateItem()
 {
     $ticket = new Ticket();
     if (!$ticket->getFromDB($this->fields['tickets_id'])) {
         return false;
     }
     // you can't change if your answer > 12h
     if (!is_null($this->fields['date_answered']) && strtotime("now") - strtotime($this->fields['date_answered']) > 12 * HOUR_TIMESTAMP) {
         return false;
     }
     if ($ticket->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID()) || $ticket->fields["users_id_recipient"] === Session::getLoginUserID() || isset($_SESSION["glpigroups"]) && $ticket->haveAGroup(CommonITILActor::REQUESTER, $_SESSION["glpigroups"])) {
         return true;
     }
     return false;
 }
開發者ID:paisdelconocimiento,項目名稱:glpi-smartcities,代碼行數:20,代碼來源:ticketsatisfaction.class.php

示例2: canUpdateItem

 /**
  * Is the current user have right to update the current followup ?
  *
  * @return boolean
  **/
 function canUpdateItem()
 {
     if ($this->fields["users_id"] != Session::getLoginUserID() && !Session::haveRight(self::$rightname, self::UPDATEALL)) {
         return false;
     }
     $ticket = new Ticket();
     if (!$ticket->can($this->getField('tickets_id'), READ)) {
         return false;
     }
     if ($this->fields["users_id"] === Session::getLoginUserID() && Session::haveRight(self::$rightname, self::UPDATEMY)) {
         return true;
     }
     // Only the technician
     return Session::haveRight(self::$rightname, self::UPDATEALL) || $ticket->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || isset($_SESSION["glpigroups"]) && $ticket->haveAGroup(CommonITILActor::ASSIGN, $_SESSION['glpigroups']);
 }
開發者ID:paisdelconocimiento,項目名稱:glpi-smartcities,代碼行數:20,代碼來源:ticketfollowup.class.php

示例3: canCreateItem

 /**
  * Is the current user have right to create the current task ?
  *
  * @return boolean
  **/
 function canCreateItem()
 {
     if (!parent::canReadITILItem()) {
         return false;
     }
     $ticket = new Ticket();
     if ($ticket->getFromDB($this->fields['tickets_id'])) {
         return Session::haveRight(self::$rightname, self::ADDALLTICKET) || $ticket->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || isset($_SESSION["glpigroups"]) && $ticket->haveAGroup(CommonITILActor::ASSIGN, $_SESSION['glpigroups']);
     }
     return false;
 }
開發者ID:paisdelconocimiento,項目名稱:glpi-smartcities,代碼行數:16,代碼來源:tickettask.class.php

示例4: canUpdateItem

 /**
  * Is the current user have right to update the current followup ?
  *
  * @return boolean
  **/
 function canUpdateItem()
 {
     if ($this->fields["users_id"] != getLoginUserID() && !haveRight('update_followups', 1)) {
         return false;
     }
     $ticket = new Ticket();
     if (!$ticket->can($this->getField('tickets_id'), 'r')) {
         return false;
     }
     if ($this->fields["users_id"] === getLoginUserID() && haveRight('update_own_followups', 1)) {
         return true;
     }
     // Only the technician
     return haveRight("update_followups", "1") || $ticket->isUser(Ticket::ASSIGN, getLoginUserID()) || isset($_SESSION["glpigroups"]) && $ticket->haveAGroup(Ticket::ASSIGN, $_SESSION['glpigroups']);
 }
開發者ID:ryukansent,項目名稱:Thesis-SideB,代碼行數:20,代碼來源:ticketfollowup.class.php

示例5: checkApprobationSolution

 /**
  * check right for Approve ticket Solution
  * for an authenticated user and a particular user
  *
  * @param $users_id  user id used for check ticket right
  * @param $ticket    ticket object
  *
  * @return array of hashtable
  **/
 static function checkApprobationSolution($users_id, Ticket $ticket)
 {
     if (!self::checkUserRights(Session::getLoginUserID(), 'update_ticket', 1, $ticket->getField('entities_id'))) {
         return false;
     }
     if (!($ticket->fields["users_id_recipient"] === $users_id || $ticket->isUser(CommonITILActor::REQUESTER, $users_id) || sizeof(Group_User::getUserGroups($users_id) > 0) && $ticket->haveAGroup(CommonITILActor::REQUESTER, Group_User::getUserGroups($users_id)))) {
         return false;
     }
     return true;
 }
開發者ID:geldarr,項目名稱:hack-space,代碼行數:19,代碼來源:methodhelpdesk.class.php

示例6: canCreateItem

 /**
  * Is the current user have right to create the current task ?
  *
  * @return boolean
  **/
 function canCreateItem()
 {
     $ticket = new Ticket();
     if (!$ticket->can($this->getField('tickets_id'), 'r')) {
         return false;
     }
     return haveRight("global_add_tasks", "1") || $ticket->isUser(Ticket::ASSIGN, getLoginUserID()) || isset($_SESSION["glpigroups"]) && $ticket->haveAGroup(Ticket::ASSIGN, $_SESSION['glpigroups']);
 }
開發者ID:ryukansent,項目名稱:Thesis-SideB,代碼行數:13,代碼來源:tickettask.class.php

示例7: checkApprobationSolution

 /**
  * check right for Approve ticket Solution
  * for an authenticated user and a particular user
  *
  * @param $users_id  user id used for check ticket right
  * @param $ticket    ticket object
  *
  * @return array of hashtable
  **/
 static function checkApprobationSolution($users_id, Ticket $ticket)
 {
     if (!($ticket->fields["users_id_recipient"] === $users_id || $ticket->isUser(CommonITILActor::REQUESTER, $users_id) || sizeof(Group_User::getUserGroups($users_id) > 0) && $ticket->haveAGroup(CommonITILActor::REQUESTER, Group_User::getUserGroups($users_id)))) {
         return false;
     }
     return true;
 }
開發者ID:JULIO8,項目名稱:respaldo_glpi,代碼行數:16,代碼來源:methodhelpdesk.class.php


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