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


PHP Ticket::countUsers方法代码示例

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


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

示例1: Ticket

 function post_deleteFromDB()
 {
     global $CFG_GLPI;
     $donotif = $CFG_GLPI["use_mailing"];
     if (isset($this->input["_no_notif"]) && $this->input["_no_notif"]) {
         $donotif = false;
     }
     $t = new Ticket();
     if ($t->getFromDB($this->fields['tickets_id'])) {
         if ($t->fields["suppliers_id_assign"] == 0 && $t->countUsers(Ticket::ASSIGN) == 0 && $t->countGroups(Ticket::ASSIGN) == 0) {
             $t->update(array('id' => $this->fields['tickets_id'], 'status' => 'new'));
         } else {
             $t->updateDateMod($this->fields['tickets_id']);
             if ($donotif) {
                 NotificationEvent::raiseEvent("update", $t);
             }
         }
     }
     parent::post_deleteFromDB();
 }
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:20,代码来源:group_ticket.class.php

示例2: showTitle

 showTitle($output_type, $num, __('SLA'), 'slas_id', true);
 if (!empty($mylevels)) {
     foreach ($mylevels as $key => $val) {
         showTitle($output_type, $num, $key, '', false);
         showTitle($output_type, $num, __('Duration by', 'timelineticket') . " " . $key, '', false);
     }
 }
 showTitle($output_type, $num, __('Total duration of ticket', 'timelineticket'), 'TOTAL', false);
 echo Search::showEndLine($output_type);
 $row_num = 1;
 while ($data = $DB->fetch_assoc($res)) {
     //Requesters
     $userdata = '';
     $ticket = new Ticket();
     $ticket->getFromDB($data['id']);
     if ($ticket->countUsers(CommonITILActor::REQUESTER)) {
         foreach ($ticket->getUsers(CommonITILActor::REQUESTER) as $d) {
             $k = $d['users_id'];
             if ($k) {
                 $userdata .= getUserName($k);
             }
             if ($ticket->countUsers(CommonITILActor::REQUESTER) > 1) {
                 $userdata .= "<br>";
             }
         }
     }
     //Time by level group
     $timegroups = array();
     $ticketgroups = array();
     $restrict = " `tickets_id` = " . $data["id"] . " ORDER BY date";
     $groups = getAllDatasFromTable("glpi_plugin_timelineticket_assigngroups", $restrict);
开发者ID:pluginsGLPI,项目名称:timelineticket,代码行数:31,代码来源:statSpentTimeByGroup.php

示例3: checkAssignUser

 static function checkAssignUser(Ticket $ticket)
 {
     global $DB;
     $ok = 0;
     $ptConfig = new PluginTimelineticketConfig();
     $ptConfig->getFromDB(1);
     if ($ptConfig->fields["add_waiting"] == 0) {
         $ok = 1;
     }
     if ($ok && in_array("status", $ticket->updates) && isset($ticket->oldvalues["status"]) && $ticket->oldvalues["status"] == Ticket::WAITING) {
         if ($ticket->countUsers(CommonITILActor::ASSIGN)) {
             foreach ($ticket->getUsers(CommonITILActor::ASSIGN) as $d) {
                 $ptAssignUser = new PluginTimelineticketAssignUser();
                 $calendar = new Calendar();
                 $calendars_id = Entity::getUsedConfig('calendars_id', $ticket->fields['entities_id']);
                 $datedebut = $ticket->fields['date'];
                 if ($calendars_id > 0 && $calendar->getFromDB($calendars_id)) {
                     $delay = $calendar->getActiveTimeBetween($datedebut, $_SESSION["glpi_currenttime"]);
                 } else {
                     // cas 24/24 - 7/7
                     $delay = strtotime($_SESSION["glpi_currenttime"]) - strtotime($datedebut);
                 }
                 $input = array();
                 $input['tickets_id'] = $ticket->getID();
                 $input['users_id'] = $d["users_id"];
                 $input['date'] = $_SESSION["glpi_currenttime"];
                 $input['begin'] = $delay;
                 $ptAssignUser->add($input);
             }
         }
     } else {
         if ($ok && in_array("status", $ticket->updates) && isset($ticket->fields["status"]) && $ticket->fields["status"] == Ticket::WAITING) {
             if ($ticket->countUsers(CommonITILActor::ASSIGN)) {
                 foreach ($ticket->getUsers(CommonITILActor::ASSIGN) as $d) {
                     $calendar = new Calendar();
                     $calendars_id = Entity::getUsedConfig('calendars_id', $ticket->fields['entities_id']);
                     $ptAssignUser = new PluginTimelineticketAssignUser();
                     $query = "SELECT MAX(`date`) AS datedebut, id\n                         FROM `" . $ptAssignUser->getTable() . "`\n                         WHERE `tickets_id` = '" . $ticket->getID() . "'\n                           AND `users_id`='" . $d["users_id"] . "'\n                           AND `delay` IS NULL";
                     $result = $DB->query($query);
                     $datedebut = '';
                     $input = array();
                     if ($result && $DB->numrows($result)) {
                         $datedebut = $DB->result($result, 0, 'datedebut');
                         $input['id'] = $DB->result($result, 0, 'id');
                     } else {
                         return;
                     }
                     if (!$datedebut) {
                         $delay = 0;
                         // Utilisation calendrier
                     } else {
                         if ($calendars_id > 0 && $calendar->getFromDB($calendars_id)) {
                             $delay = $calendar->getActiveTimeBetween($datedebut, $_SESSION["glpi_currenttime"]);
                         } else {
                             // cas 24/24 - 7/7
                             $delay = strtotime($_SESSION["glpi_currenttime"]) - strtotime($datedebut);
                         }
                     }
                     $input['delay'] = $delay;
                     $ptAssignUser->update($input);
                 }
             }
         } else {
             if (in_array("status", $ticket->updates) && isset($ticket->input["status"]) && ($ticket->input["status"] == Ticket::SOLVED || $ticket->input["status"] == Ticket::CLOSED)) {
                 if ($ticket->countUsers(CommonITILActor::ASSIGN)) {
                     foreach ($ticket->getUsers(CommonITILActor::ASSIGN) as $d) {
                         $calendar = new Calendar();
                         $calendars_id = Entity::getUsedConfig('calendars_id', $ticket->fields['entities_id']);
                         $ptAssignUser = new PluginTimelineticketAssignUser();
                         $query = "SELECT MAX(`date`) AS datedebut, id\n                         FROM `" . $ptAssignUser->getTable() . "`\n                         WHERE `tickets_id` = '" . $ticket->getID() . "'\n                           AND `users_id`='" . $d["users_id"] . "'\n                           AND `delay` IS NULL";
                         $result = $DB->query($query);
                         $datedebut = '';
                         $input = array();
                         if ($result && $DB->numrows($result)) {
                             $datedebut = $DB->result($result, 0, 'datedebut');
                             $input['id'] = $DB->result($result, 0, 'id');
                         } else {
                             return;
                         }
                         if (!$datedebut) {
                             $delay = 0;
                             // Utilisation calendrier
                         } else {
                             if ($calendars_id > 0 && $calendar->getFromDB($calendars_id)) {
                                 $delay = $calendar->getActiveTimeBetween($datedebut, $_SESSION["glpi_currenttime"]);
                             } else {
                                 // cas 24/24 - 7/7
                                 $delay = strtotime($_SESSION["glpi_currenttime"]) - strtotime($datedebut);
                             }
                         }
                         $input['delay'] = $delay;
                         $ptAssignUser->update($input);
                     }
                 }
             }
         }
     }
 }
开发者ID:pluginsGLPI,项目名称:timelineticket,代码行数:98,代码来源:assignuser.class.php

示例4: getDatasForTemplate

 /**
  * Get all data needed for template processing
  **/
 function getDatasForTemplate($event, $options = array())
 {
     global $LANG, $CFG_GLPI;
     //----------- Ticket infos -------------- //
     if ($event != 'alertnotclosed') {
         $fields = array('ticket.title' => 'name', 'ticket.content' => 'content', 'ticket.description' => 'content', 'ticket.costfixed' => 'cost_fixed', 'ticket.costmaterial' => 'cost_material');
         foreach ($fields as $tag => $table_field) {
             $this->datas['##' . $tag . '##'] = $this->obj->getField($table_field);
         }
         $this->datas['##ticket.id##'] = sprintf("%07d", $this->obj->getField("id"));
         $this->datas['##ticket.url##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=ticket_" . $this->obj->getField("id"));
         $this->datas['##ticket.urlapprove##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=ticket_" . $this->obj->getField("id") . "_4");
         $this->datas['##ticket.urlvalidation##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=ticket_" . $this->obj->getField("id") . "_7");
         $this->datas['##ticket.entity##'] = Dropdown::getDropdownName('glpi_entities', $this->getEntity());
         $events = $this->getAllEvents();
         if ($event == 'validation' && isset($options['validation_status'])) {
             $this->datas['##ticket.action##'] = $LANG['validation'][0] . ' - ' . TicketValidation::getStatus($options['validation_status']);
         } else {
             $this->datas['##ticket.action##'] = $events[$event];
         }
         $this->datas['##ticket.storestatus##'] = $this->obj->getField('status');
         $this->datas['##ticket.status##'] = Ticket::getStatus($this->obj->getField('status'));
         $this->datas['##ticket.globalvalidation##'] = TicketValidation::getStatus($this->obj->getField('global_validation'));
         $this->datas['##ticket.type##'] = Ticket::getTicketTypeName($this->obj->getField('type'));
         $this->datas['##ticket.requesttype##'] = Dropdown::getDropdownName('glpi_requesttypes', $this->obj->getField('requesttypes_id'));
         $this->datas['##ticket.urgency##'] = Ticket::getUrgencyName($this->obj->getField('urgency'));
         $this->datas['##ticket.impact##'] = Ticket::getImpactName($this->obj->getField('impact'));
         $this->datas['##ticket.priority##'] = Ticket::getPriorityName($this->obj->getField('priority'));
         $this->datas['##ticket.time##'] = Ticket::getActionTime($this->obj->getField('actiontime'));
         $this->datas['##ticket.costtime##'] = $this->obj->getField('cost_time');
         $this->datas['##ticket.creationdate##'] = convDateTime($this->obj->getField('date'));
         $this->datas['##ticket.closedate##'] = convDateTime($this->obj->getField('closedate'));
         $this->datas['##ticket.solvedate##'] = convDateTime($this->obj->getField('solvedate'));
         $this->datas['##ticket.duedate##'] = convDateTime($this->obj->getField('due_date'));
         $entitydata = new EntityData();
         $autoclose_value = $CFG_GLPI['autoclose_delay'];
         if ($entitydata->getFromDB($this->getEntity())) {
             $autoclose_value = $entitydata->getField('autoclose_delay');
             // Set global config value
             if ($autoclose_value == -1) {
                 $autoclose_value = $CFG_GLPI['autoclose_delay'];
             }
         }
         if ($autoclose_value > 0) {
             $this->datas['##ticket.autoclose##'] = $autoclose_value;
             $this->datas['##lang.ticket.autoclosewarning##'] = $LANG['job'][54] . " " . $autoclose_value . " " . $LANG['stats'][31];
         } else {
             $this->datas['##ticket.autoclose##'] = $LANG['setup'][307];
             $this->datas['##lang.ticket.autoclosewarning##'] = "";
         }
         if ($this->obj->getField('ticketcategories_id')) {
             $this->datas['##ticket.category##'] = Dropdown::getDropdownName('glpi_ticketcategories', $this->obj->getField('ticketcategories_id'));
         } else {
             $this->datas['##ticket.category##'] = '';
         }
         if ($this->obj->getField('slas_id')) {
             $this->datas['##ticket.sla##'] = Dropdown::getDropdownName('glpi_slas', $this->obj->getField('slas_id'));
         } else {
             $this->datas['##ticket.sla##'] = '';
         }
         if ($this->obj->countUsers(Ticket::REQUESTER)) {
             $users = array();
             foreach ($this->obj->getUsers(Ticket::REQUESTER) as $uid => $tmp) {
                 $user_tmp = new User();
                 $user_tmp->getFromDB($uid);
                 $users[$uid] = $user_tmp->getName();
                 $tmp = array();
                 $tmp['##author.id##'] = $uid;
                 $tmp['##author.name##'] = $user_tmp->getName();
                 if ($user_tmp->getField('locations_id')) {
                     $tmp['##author.location##'] = Dropdown::getDropdownName('glpi_locations', $user_tmp->getField('locations_id'));
                 } else {
                     $tmp['##author.location##'] = '';
                 }
                 $tmp['##author.phone##'] = $user_tmp->getField('phone');
                 $tmp['##author.phone2##'] = $user_tmp->getField('phone2');
                 $this->datas['authors'][] = $tmp;
             }
             $this->datas['##ticket.authors##'] = implode(', ', $users);
         } else {
             $this->datas['##ticket.authors##'] = '';
         }
         if ($this->obj->getField('users_id_recipient')) {
             $user_tmp = new User();
             $user_tmp->getFromDB($this->obj->getField('users_id_recipient'));
             $this->datas['##ticket.openbyuser##'] = $user_tmp->getName();
         } else {
             $this->datas['##ticket.openbyuser##'] = '';
         }
         if ($this->obj->countUsers(Ticket::ASSIGN)) {
             $users = array();
             foreach ($this->obj->getUsers(Ticket::ASSIGN) as $uid => $tmp) {
                 $user_tmp = new User();
                 $user_tmp->getFromDB($uid);
                 $users[$uid] = $user_tmp->getName();
             }
             $this->datas['##ticket.assigntousers##'] = implode(', ', $users);
//.........这里部分代码省略.........
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:101,代码来源:notificationtargetticket.class.php


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