当前位置: 首页>>代码示例>>PHP>>正文


PHP Ticket::canAddFollowups方法代码示例

本文整理汇总了PHP中Ticket::canAddFollowups方法的典型用法代码示例。如果您正苦于以下问题:PHP Ticket::canAddFollowups方法的具体用法?PHP Ticket::canAddFollowups怎么用?PHP Ticket::canAddFollowups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ticket的用法示例。


在下文中一共展示了Ticket::canAddFollowups方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: canCreateItem

 function canCreateItem()
 {
     // From Ticket Document Tab => check right to add followup.
     if (isset($this->fields['tickets_id']) && $this->fields['tickets_id'] > 0) {
         $ticket = new Ticket();
         if ($ticket->getFromDB($this->fields['tickets_id'])) {
             return $ticket->canAddFollowups();
         }
     }
     if (Session::haveRight('document', 'w')) {
         return parent::canCreateItem();
     }
     return false;
 }
开发者ID:gaforeror,项目名称:glpi,代码行数:14,代码来源:document.class.php

示例2: canCreateItem

 function canCreateItem()
 {
     if (isset($this->input['itemtype']) && isset($this->input['items_id'])) {
         if ($item = getItemForItemtype($this->input['itemtype'])) {
             if ($item->canAddItem('Document')) {
                 return true;
             }
         }
     }
     // From Ticket Document Tab => check right to add followup.
     if (isset($this->fields['tickets_id']) && $this->fields['tickets_id'] > 0) {
         $ticket = new Ticket();
         if ($ticket->getFromDB($this->fields['tickets_id'])) {
             return $ticket->canAddFollowups();
         }
     }
     if (Session::haveRight('document', 'w')) {
         return parent::canCreateItem();
     }
     return false;
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:21,代码来源:document.class.php

示例3: canCreateItem

 /**
  * Is the current user have right to create the current followup ?
  *
  * @return boolean
  **/
 function canCreateItem()
 {
     $ticket = new Ticket();
     if (!$ticket->can($this->getField('tickets_id'), READ)) {
         return false;
     }
     return $ticket->canAddFollowups();
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:13,代码来源:ticketfollowup.class.php

示例4: methodAddTicketDocument

 /**
  * Add a document to a existing ticket
  * for an authenticated user
  *
  * @param $params array of options (ticket, uri, name, base64, comment)
  *        only one of uri and base64 must be set
  *        name is mandatory when base64 set, for extension check (filename)
  * @param $protocol     the communication protocol used
  *
  * @return array of hashtable
  **/
 static function methodAddTicketDocument($params, $protocol)
 {
     global $DB, $CFG_GLPI;
     if (isset($params['help'])) {
         return array('ticket' => 'integer,mandatory', 'uri' => 'string,optional', 'base64' => 'string,optional', 'content' => 'string,optional', 'close' => 'bool,optional', 'reopen' => 'bool,optional', 'source' => 'string,optional', 'private' => 'bool,optional', 'help' => 'bool,optional');
     }
     if (!Session::getLoginUserID()) {
         return self::Error($protocol, WEBSERVICES_ERROR_NOTAUTHENTICATED);
     }
     $ticket = new Ticket();
     if (!isset($params['ticket'])) {
         return self::Error($protocol, WEBSERVICES_ERROR_MISSINGPARAMETER, '', 'ticket');
     }
     if (!is_numeric($params['ticket'])) {
         return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'ticket');
     }
     if (!$ticket->can($params['ticket'], 'r')) {
         return self::Error($protocol, WEBSERVICES_ERROR_NOTFOUND);
     }
     if (in_array($ticket->fields["status"], $ticket->getClosedStatusArray())) {
         return self::Error($protocol, WEBSERVICES_ERROR_NOTALLOWED, '', 'closed ticket');
     }
     if (!$ticket->canAddFollowups()) {
         return self::Error($protocol, WEBSERVICES_ERROR_NOTALLOWED, '', 'access denied');
     }
     if (isset($params['name']) && !empty($params['name'])) {
         $document_name = addslashes($params['name']);
     } else {
         $document_name = addslashes(sprintf(__('%1$s %2$s'), _x('phone', 'Number'), $ticket->fields['id']));
     }
     $filename = tempnam(GLPI_DOC_DIR . '/_tmp', 'PWS');
     $response = parent::uploadDocument($params, $protocol, $filename, $document_name);
     //An error occured during document upload
     if (parent::isError($protocol, $response)) {
         return $response;
     }
     $doc = new Document();
     $documentitem = new Document_Item();
     $docid = $doc->getFromDBbyContent($ticket->fields["entities_id"], $filename);
     if ($docid) {
         $input = array('itemtype' => $ticket->getType(), 'items_id' => $ticket->getID(), 'documents_id' => $doc->getID());
         if ($DB->request('glpi_documents_items', $input)->numrows()) {
             return self::Error($protocol, WEBSERVICES_ERROR_FAILED, '', 'document already associated to this ticket');
         }
         $new = $documentitem->add($input);
     } else {
         $input = array('itemtype' => $ticket->getType(), 'items_id' => $ticket->getID(), 'tickets_id' => $ticket->getID(), 'entities_id' => $ticket->getEntityID(), 'is_recursive' => $ticket->isRecursive(), 'documentcategories_id' => $CFG_GLPI["documentcategories_id_forticket"]);
         $new = $doc->add($input);
     }
     // to not add it twice during followup
     unset($_FILES['filename']);
     if (!$new) {
         return self::Error($protocol, WEBSERVICES_ERROR_FAILED, '', self::getDisplayError());
     }
     if (isset($params['comment']) && !empty($params['comment'])) {
         $params['content'] = $params['comment'];
         unset($params['comment']);
     }
     if (isset($params['content']) && !empty($params['content'])) {
         return self::methodAddTicketFollowup($params, $protocol);
     }
     return self::methodGetTicket(array('ticket' => $params['ticket']), $protocol);
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:74,代码来源:methodhelpdesk.class.php

示例5: canCreateItem

 /**
  * Is the current user have right to create the current followup ?
  *
  * @return boolean
  **/
 function canCreateItem()
 {
     $ticket = new Ticket();
     if (!$ticket->can($this->getField('tickets_id'), READ) || in_array($ticket->fields['status'], $ticket->getClosedStatusArray())) {
         return false;
     }
     return $ticket->canAddFollowups();
 }
开发者ID:OlivierLM,项目名称:glpi,代码行数:13,代码来源:ticketfollowup.class.php


注:本文中的Ticket::canAddFollowups方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。