本文整理匯總了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;
}
示例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']);
}
示例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;
}
示例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']);
}
示例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;
}
示例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']);
}
示例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;
}