当前位置: 首页>>代码示例>>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;未经允许,请勿转载。