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


PHP Ticket::getClosedStatusArray方法代码示例

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


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

示例1: getSqlCriteriasRestriction

 /**
  * Get SQL code associated with the criteria
  *
  * @see plugins/reports/inc/PluginReportsArrayCriteria::getSqlCriteriasRestriction()
  **/
 public function getSqlCriteriasRestriction($link = 'AND')
 {
     $status = $this->getParameterValue();
     switch ($status) {
         case "notold":
             $list = implode("','", Ticket::getNewStatusArray());
             $list .= implode("','", Ticket::getProcessStatusArray());
             $list .= "','" . Ticket::WAITING;
             break;
         case "old":
             $list = implode("','", Ticket::getClosedStatusArray());
             break;
         case "process":
             $list = implode("','", Ticket::getProcessStatusArray());
             break;
         case Ticket::INCOMING:
         case Ticket::ASSIGNED:
         case Ticket::PLANNED:
         case Ticket::WAITING:
         case Ticket::SOLVED:
         case Ticket::CLOSED:
             $list = $status;
             break;
         case "all":
         default:
             return '';
     }
     return $link . " " . $this->getSqlField() . " IN ('" . $list . "') ";
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:34,代码来源:ticketstatuscriteria.class.php

示例2: canCreateItem

 /**
  * @since version 0.85.5
  * @see CommonDBRelation::canCreateItem()
  **/
 function canCreateItem()
 {
     $ticket = new Ticket();
     // Not item linked for closed tickets
     if ($ticket->getFromDB($this->fields['tickets_id']) && in_array($ticket->fields['status'], $ticket->getClosedStatusArray())) {
         return false;
     }
     return parent::canCreateItem();
 }
开发者ID:korial29,项目名称:glpi,代码行数:13,代码来源:item_ticket.class.php

示例3: canCreateItem

 /**
  * @since version 0.85
  **/
 function canCreateItem()
 {
     if ($this->canChildItem('canViewItem', 'canView')) {
         $ticket = new Ticket();
         if ($ticket->getFromDB($this->fields['tickets_id'])) {
             // No validation for closed tickets
             if (in_array($ticket->fields['status'], $ticket->getClosedStatusArray())) {
                 return false;
             }
             if ($ticket->fields['type'] == Ticket::INCIDENT_TYPE) {
                 return Session::haveRight(self::$rightname, self::CREATEINCIDENT);
             }
             if ($ticket->fields['type'] == Ticket::DEMAND_TYPE) {
                 return Session::haveRight(self::$rightname, self::CREATEREQUEST);
             }
         }
     }
 }
开发者ID:btry,项目名称:glpi,代码行数:21,代码来源:ticketvalidation.class.php

示例4: showForProjectTask

 /**
  * Show tickets for a projecttask
  *
  * @param $projecttask ProjectTask object
  **/
 static function showForProjectTask(ProjectTask $projecttask)
 {
     global $DB, $CFG_GLPI;
     $ID = $projecttask->getField('id');
     if (!$projecttask->can($ID, READ)) {
         return false;
     }
     $canedit = $projecttask->canEdit($ID);
     $rand = mt_rand();
     $query = "SELECT DISTINCT `glpi_projecttasks_tickets`.`id` AS linkID,\n                                `glpi_tickets`.*\n                FROM `glpi_projecttasks_tickets`\n                LEFT JOIN `glpi_tickets`\n                     ON (`glpi_projecttasks_tickets`.`tickets_id` = `glpi_tickets`.`id`)\n                WHERE `glpi_projecttasks_tickets`.`projecttasks_id` = '{$ID}'\n                ORDER BY `glpi_tickets`.`name`";
     $result = $DB->query($query);
     $tickets = array();
     $used = array();
     if ($numrows = $DB->numrows($result)) {
         while ($data = $DB->fetch_assoc($result)) {
             $tickets[$data['id']] = $data;
             $used[$data['id']] = $data['id'];
         }
     }
     if ($canedit) {
         echo "<div class='firstbloc'>";
         echo "<form name='projecttaskticket_form{$rand}' id='projecttaskticket_form{$rand}'\n                method='post' action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
         echo "<table class='tab_cadre_fixe'>";
         echo "<tr class='tab_bg_2'><th colspan='3'>" . __('Add a ticket') . "</th></tr>";
         echo "<tr class='tab_bg_2'><td class='right'>";
         echo "<input type='hidden' name='projecttasks_id' value='{$ID}'>";
         $condition = "`glpi_tickets`.`status`\n                        NOT IN ('" . implode("', '", array_merge(Ticket::getSolvedStatusArray(), Ticket::getClosedStatusArray())) . "')";
         Ticket::dropdown(array('used' => $used, 'entity' => $projecttask->getEntityID(), 'entity_sons' => $projecttask->isRecursive(), 'condition' => $condition, 'displaywith' => array('id')));
         echo "</td><td width='20%'>";
         echo "<a href='" . Toolbox::getItemTypeFormURL('Ticket') . "?_projecttasks_id={$ID}'>";
         _e('Create a ticket from this task');
         echo "</a>";
         echo "</td><td class='center'>";
         echo "<input type='submit' name='add' value=\"" . _sx('button', 'Add') . "\" class='submit'>";
         echo "</td></tr>";
         echo "</table>";
         Html::closeForm();
         echo "</div>";
     }
     echo "<div class='spaced'>";
     if ($canedit && $numrows) {
         Html::openMassiveActionsForm('mass' . __CLASS__ . $rand);
         $massiveactionparams = array('num_displayed' => $numrows, 'container' => 'mass' . __CLASS__ . $rand);
         Html::showMassiveActions($massiveactionparams);
     }
     echo "<table class='tab_cadre_fixehov'>";
     echo "<tr><th colspan='12'>" . Ticket::getTypeName($numrows) . "</th>";
     echo "</tr>";
     if ($numrows) {
         Ticket::commonListHeader(Search::HTML_OUTPUT, 'mass' . __CLASS__ . $rand);
         Session::initNavigateListItems('Ticket', sprintf(__('%1$s = %2$s'), ProjectTask::getTypeName(1), $projecttask->fields["name"]));
         $i = 0;
         foreach ($tickets as $data) {
             Session::addToNavigateListItems('Ticket', $data["id"]);
             Ticket::showShort($data['id'], array('followups' => false, 'row_num' => $i, 'type_for_massiveaction' => __CLASS__, 'id_for_massiveaction' => $data['linkID']));
             $i++;
         }
     }
     echo "</table>";
     if ($canedit && $numrows) {
         $massiveactionparams['ontop'] = false;
         Html::showMassiveActions($massiveactionparams);
         Html::closeForm();
     }
     echo "</div>";
 }
开发者ID:kipman,项目名称:glpi,代码行数:71,代码来源:projecttask_ticket.class.php

示例5: pdfStat

 static function pdfStat(PluginPdfSimplePDF $pdf, Ticket $job)
 {
     $pdf->setColumnsSize(100);
     $pdf->displayTitle("<b>" . _n('Date', 'Dates', 2) . "</b>");
     $pdf->setColumnsSize(50, 50);
     $pdf->displayLine(sprintf(__('%1$s: %2$s'), __('Opening date'), Html::convDateTime($job->fields['date'])));
     $pdf->displayLine(sprintf(__('%1$s: %2$s'), __('Due date'), Html::convDateTime($job->fields['due_date'])));
     if (in_array($job->fields["status"], $job->getSolvedStatusArray()) || in_array($job->fields["status"], $job->getClosedStatusArray())) {
         $pdf->displayLine(sprintf(__('%1$s: %2$s'), __('Solution date'), Html::convDateTime($job->fields['solvedate'])));
     }
     if (in_array($job->fields["status"], $job->getClosedStatusArray())) {
         $pdf->displayLine(sprintf(__('%1$s: %2$s'), __('Closing date'), Html::convDateTime($job->fields['closedate'])));
     }
     $pdf->setColumnsSize(100);
     $pdf->displayTitle("<b>" . _n('Time', 'Times', 2) . "</b>");
     $pdf->setColumnsSize(50, 50);
     if ($job->fields['takeintoaccount_delay_stat'] > 0) {
         $pdf->displayLine(sprintf(__('%1$s: %2$s'), __('Take into account'), Html::clean(Html::timestampToString($job->fields['takeintoaccount_delay_stat'], 0))));
     }
     if (in_array($job->fields["status"], $job->getSolvedStatusArray()) || in_array($job->fields["status"], $job->getClosedStatusArray())) {
         if ($job->fields['solve_delay_stat'] > 0) {
             $pdf->displayLine(sprintf(__('%1$s: %2$s'), __('Solution'), Html::clean(Html::timestampToString($job->fields['solve_delay_stat'], 0))));
         }
     }
     if (in_array($job->fields["status"], $job->getClosedStatusArray())) {
         if ($job->fields['close_delay_stat'] > 0) {
             $pdf->displayLine(sprintf(__('%1$s: %2$s'), __('Closing'), Html::clean(Html::timestampToString($job->fields['close_delay_stat'], 0))));
         }
     }
     if ($job->fields['waiting_duration'] > 0) {
         $pdf->displayLine(sprintf(__('%1$s: %2$s'), __('Pending'), Html::clean(Html::timestampToString($job->fields['waiting_duration'], 0))));
     }
     $pdf->displaySpace();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:34,代码来源:ticket.class.php

示例6: getCentral


//.........这里部分代码省略.........
     // Only manage predefined values on ticket creation
     $predefined_fields = array();
     if (!$ID) {
         if (isset($tt->predefined) && count($tt->predefined)) {
             foreach ($tt->predefined as $predeffield => $predefvalue) {
                 if (isset($default_values[$predeffield])) {
                     // Is always default value : not set
                     // Set if already predefined field
                     // Set if ticket template change
                     if ($values[$predeffield] == $default_values[$predeffield] || isset($values['_predefined_fields'][$predeffield]) && $values[$predeffield] == $values['_predefined_fields'][$predeffield] || isset($values['_tickettemplates_id']) && $values['_tickettemplates_id'] != $tt->getID()) {
                         // Load template data
                         $values[$predeffield] = $predefvalue;
                         $ticket->fields[$predeffield] = $predefvalue;
                         $predefined_fields[$predeffield] = $predefvalue;
                     }
                 }
             }
         } else {
             // No template load : reset predefined values
             if (count($values['_predefined_fields'])) {
                 foreach ($values['_predefined_fields'] as $predeffield => $predefvalue) {
                     if ($values[$predeffield] == $predefvalue) {
                         $values[$predeffield] = $default_values[$predeffield];
                     }
                 }
             }
         }
     }
     // Put ticket template on $values for actors
     $values['_tickettemplate'] = $tt;
     $canupdate = Session::haveRight('update_ticket', '1');
     $canpriority = Session::haveRight('update_priority', '1');
     $canstatus = $canupdate;
     if (in_array($ticket->fields['status'], $ticket->getClosedStatusArray())) {
         $canupdate = false;
     }
     $showuserlink = 0;
     if (Session::haveRight('user', 'r')) {
         $showuserlink = 1;
     }
     if (!$options['template_preview']) {
         $ticket->showTabs($options);
     } else {
         // Add all values to fields of tickets for template preview
         foreach ($values as $key => $val) {
             if (!isset($ticket->fields[$key])) {
                 $ticket->fields[$key] = $val;
             }
         }
     }
     // In percent
     $colsize1 = '13';
     $colsize2 = '29';
     $colsize3 = '13';
     $colsize4 = '45';
     $canupdate_descr = $canupdate || $ticket->fields['status'] == Ticket::INCOMING && $ticket->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID()) && $ticket->numberOfFollowups() == 0 && $ticket->numberOfTasks() == 0;
     if (!$options['template_preview']) {
         echo "<form method='post' name='form_ticket' enctype='multipart/form-data' action='" . $CFG_GLPI["root_doc"] . "/front/ticket.form.php'>";
     }
     echo "<div class='spaced' id='tabsbody'>";
     echo "<table class='tab_cadre_fixe' id='mainformtable'>";
     // Optional line
     $ismultientities = Session::isMultiEntitiesMode();
     echo "<tr class='headerRow'>";
     echo "<th colspan='4'>";
     if ($ID) {
开发者ID:geldarr,项目名称:hack-space,代码行数:67,代码来源:survey.class.php

示例7: methodListTickets


//.........这里部分代码省略.........
         $join .= "INNER JOIN `glpi_ticketsatisfactions`\n                        ON (`glpi_tickets`.`id` = `glpi_ticketsatisfactions`.`tickets_id` ) ";
         switch ($params['satisfaction']) {
             case 1:
                 $where .= " AND `glpi_ticketsatisfactions`.`date_answered` IS NULL";
                 break;
             case 2:
                 $where .= " AND `glpi_ticketsatisfactions`.`date_answered` IS NOT NULL";
                 break;
             default:
                 // survey exists (by Inner Join)
         }
         $params['status'] = Ticket::CLOSED;
     }
     // Status
     if (isset($params['status'])) {
         if (!in_array($params['status'], Ticket::getAllowedStatusArray(true))) {
             return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'status');
         }
         switch ($params['status']) {
             case 'all':
                 // No restriction
                 break;
             case 'notclosed':
                 $status = Ticket::getAllStatusArray();
                 unset($status[CLOSED]);
                 $where .= " AND `glpi_tickets`.`status` IN ('" . implode("','", $status) . "') ";
                 break;
             case 'notold':
                 $status = Ticket::getAllStatusArray();
                 unset($status[SOLVED], $status[CLOSED]);
                 $where .= " AND `glpi_tickets`.`status` IN ('" . implode("','", $status) . "') ";
                 break;
             case 'old':
                 $status = array_merge(Ticket::getSolvedStatusArray(), Ticket::getClosedStatusArray());
                 $where .= " AND `glpi_tickets`.`status` IN ('" . implode("','", $status) . "') ";
                 break;
             case 'process':
                 $status = Ticket::getProcessStatusArray();
                 $where .= " AND `glpi_tickets`.`status` IN ('" . implode("','", $status) . "') ";
                 break;
             default:
                 $where .= " AND `glpi_tickets`.`status` = '" . $params['status'] . "' ";
         }
     }
     // Dates
     if (isset($params["startdate"])) {
         if (preg_match(WEBSERVICES_REGEX_DATETIME, $params["startdate"]) || preg_match(WEBSERVICES_REGEX_DATE, $params["startdate"])) {
             $where .= " AND `glpi_tickets`.`date` >= '" . $params['startdate'] . "' ";
         } else {
             return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'date');
         }
     }
     if (isset($params["enddate"])) {
         if (preg_match(WEBSERVICES_REGEX_DATETIME, $params["enddate"]) || preg_match(WEBSERVICES_REGEX_DATE, $params["enddate"])) {
             $where .= " AND `glpi_tickets`.`date` <= '" . $params['enddate'] . "' ";
         } else {
             return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'date');
         }
     }
     if (isset($params['itemtype'])) {
         if (!empty($params['itemtype']) && !class_exists($params['itemtype'])) {
             return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'itemtype');
         }
         $where .= " AND `glpi_tickets`.`itemtype`='" . $params['itemtype'] . "'";
     }
     if (isset($params['item'])) {
开发者ID:geldarr,项目名称:hack-space,代码行数:67,代码来源:methodhelpdesk.class.php

示例8: 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

示例9: 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']) && !in_array($ticket->fields['status'], $ticket->getClosedStatusArray())) {
         return Session::haveRight(self::$rightname, parent::ADDALLITEM) || $ticket->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || isset($_SESSION["glpigroups"]) && $ticket->haveAGroup(CommonITILActor::ASSIGN, $_SESSION['glpigroups']);
     }
     return false;
 }
开发者ID:btry,项目名称:glpi,代码行数:16,代码来源:tickettask.class.php


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