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


PHP Ticket::getStatusIconURL方法代码示例

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


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

示例1: giveItem


//.........这里部分代码省略.........
                     } else {
                         if ($less_warn < $less_warn_limit) {
                             $color = $_SESSION['glpiduedatewarning_color'];
                         }
                     }
                     //Calculate bar progress
                     $out .= "<div class='center' style='background-color: #ffffff; width: 100%;\n                            border: 1px solid #9BA563; position: relative;' >";
                     $out .= "<div style='position:absolute;'>&nbsp;" . $percentage_text . "%</div>";
                     $out .= "<div class='center' style='background-color: " . $color . ";\n                            width: " . $percentage . "%; height: 12px' ></div>";
                     $out .= "</div>";
                     return $out;
                 }
                 break;
             case "glpi_softwarelicenses.number":
                 if ($data[$num][0]['min'] == -1) {
                     return __('Unlimited');
                 }
                 if (empty($data[$num][0]['name'])) {
                     return 0;
                 }
                 return $data[$num][0]['name'];
             case "glpi_auth_tables.name":
                 return Auth::getMethodName($data[$num][0]['name'], $data[$num][0]['auths_id'], 1, $data[$num][0]['ldapname'] . $data[$num][0]['mailname']);
             case "glpi_reservationitems.comment":
                 if (empty($data[$num][0]['name'])) {
                     return "<a title=\"" . __s('Modify the comment') . "\"\n                           href='" . $CFG_GLPI["root_doc"] . "/front/reservationitem.form.php?id=" . $data["refID"] . "' >" . __('None') . "</a>";
                 }
                 return "<a title=\"" . __s('Modify the comment') . "\"\n                        href='" . $CFG_GLPI["root_doc"] . "/front/reservationitem.form.php?id=" . $data['refID'] . "' >" . Html::resume_text($data[$num][0]['name']) . "</a>";
             case 'glpi_crontasks.description':
                 $tmp = new CronTask();
                 return $tmp->getDescription($data[$num][0]['name']);
             case 'glpi_changes.status':
                 $status = Change::getStatus($data[$num][0]['name']);
                 return "<img src=\"" . Change::getStatusIconURL($data[$num][0]['name']) . "\"\n                        alt=\"{$status}\" title=\"{$status}\">&nbsp;{$status}";
             case 'glpi_problems.status':
                 $status = Problem::getStatus($data[$num][0]['name']);
                 return "<img src=\"" . Problem::getStatusIconURL($data[$num][0]['name']) . "\"\n                        alt=\"{$status}\" title=\"{$status}\">&nbsp;{$status}";
             case 'glpi_tickets.status':
                 $status = Ticket::getStatus($data[$num][0]['name']);
                 return "<img src=\"" . Ticket::getStatusIconURL($data[$num][0]['name']) . "\"\n                        alt=\"{$status}\" title=\"{$status}\">&nbsp;{$status}";
             case 'glpi_projectstates.name':
                 $out = '';
                 $query = "SELECT `color`\n                         FROM `glpi_projectstates`\n                         WHERE `name` = '" . $data[$num][0]['name'] . "'";
                 foreach ($DB->request($query) as $color) {
                     $color = $color['color'];
                     $out = "<div style=\"background-color:" . $color . ";\">";
                     $name = $data[$num][0]['name'];
                     if (isset($data[$num][0]['trans'])) {
                         $name = $data[$num][0]['trans'];
                     }
                     if ($itemtype == 'ProjectState') {
                         $out .= "<a href='" . $CFG_GLPI["root_doc"] . "/front/projectstate.form.php?id=" . $data[$num][0]["id"] . "'>" . $name . "</a></div>";
                     } else {
                         $out .= $name . "</div>";
                     }
                 }
                 return $out;
             case 'glpi_items_tickets.items_id':
             case 'glpi_items_problems.items_id':
                 if (!empty($data[$num])) {
                     $items = array();
                     foreach ($data[$num] as $key => $val) {
                         if (is_numeric($key)) {
                             if (!empty($val['itemtype']) && ($item = getItemForItemtype($val['itemtype']))) {
                                 if ($item->getFromDB($val['name'])) {
                                     $items[] = $item->getLink(array('comments' => true));
开发者ID:jose-martins,项目名称:glpi,代码行数:67,代码来源:search.class.php

示例2: getSplittedSubmitButtonHtml

 /**
  * @since version 0.90
  *
  * @param $tickets_id
  * @param $action         (default 'add')
  **/
 static function getSplittedSubmitButtonHtml($tickets_id, $action = "add")
 {
     $locale = _sx('button', 'Add');
     if ($action == 'update') {
         $locale = _x('button', 'Save');
     }
     $ticket = new self();
     $ticket->getFromDB($tickets_id);
     $all_status = Ticket::getAllowedStatusArray($ticket->fields['status']);
     $rand = mt_rand();
     $html = "<div class='x-split-button' id='x-split-button'>\n               <input type='submit' value='{$locale}' name='{$action}' class='x-button x-button-main'>\n               <span class='x-button x-button-drop'>&nbsp;</span>\n               <ul class='x-button-drop-menu'>";
     foreach ($all_status as $status_key => $status_label) {
         $checked = "";
         if ($status_key == $ticket->fields['status']) {
             $checked = "checked='checked'";
         }
         $html .= "<li>";
         $html .= "<input type='radio' id='status_radio_{$status_key}{$rand}' name='_status'\n                    {$checked} value='{$status_key}'>";
         $html .= "<label for='status_radio_{$status_key}{$rand}'>";
         $html .= "<img src='" . Ticket::getStatusIconURL($status_key) . "' />&nbsp;";
         $html .= $status_label;
         $html .= "</label>";
         $html .= "</li>";
     }
     $html .= "</ul></div>";
     $html .= "<script type='text/javascript'>split_button();</script>";
     return $html;
 }
开发者ID:glpi-project,项目名称:glpi,代码行数:34,代码来源:ticket.class.php

示例3: giveItem


//.........这里部分代码省略.........
             return Auth::getMethodName($data[$NAME . $num], $data[$NAME . $num . "_2"], 1, $data[$NAME . $num . "_3"] . $data[$NAME . $num . "_4"]);
         case "glpi_reservationitems.comment":
             if (empty($data[$NAME . $num])) {
                 return "<a title=\"" . __s('Modify the comment') . "\"\n                        href='" . $CFG_GLPI["root_doc"] . "/front/reservationitem.form.php?id=" . $data["refID"] . "' >" . __('None') . "</a>";
             }
             return "<a title=\"" . __s('Modify the comment') . "\"\n                     href='" . $CFG_GLPI["root_doc"] . "/front/reservationitem.form.php?id=" . $data['refID'] . "' >" . Html::resume_text($data[$NAME . $num]) . "</a>";
         case 'glpi_notifications.mode':
             return Notification::getMode($data[$NAME . $num]);
         case 'glpi_notifications.event':
             $item = NotificationTarget::getInstanceByType($data['itemtype']);
             if ($item) {
                 $events = $item->getAllEvents();
                 if (isset($events[$data[$NAME . $num]])) {
                     return $events[$data[$NAME . $num]];
                 }
             }
             return '';
         case 'glpi_reminders.state':
             return Planning::getState($data[$NAME . $num]);
         case 'glpi_crontasks.description':
             $tmp = new CronTask();
             return $tmp->getDescription($data['id']);
         case 'glpi_crontasks.state':
             return CronTask::getStateName($data[$NAME . $num]);
         case 'glpi_crontasks.mode':
             return CronTask::getModeName($data[$NAME . $num]);
         case 'glpi_crontasks.itemtype':
             if ($plug = isPluginItemType($data[$NAME . $num])) {
                 return $plug['plugin'];
             }
             return '';
         case 'glpi_changes.status':
             $status = Change::getStatus($data[$NAME . $num]);
             return "<img src=\"" . Change::getStatusIconURL($data[$NAME . $num]) . "\"\n                     alt=\"{$status}\" title=\"{$status}\">&nbsp;{$status}";
         case 'glpi_problems.status':
             $status = Problem::getStatus($data[$NAME . $num]);
             return "<img src=\"" . Problem::getStatusIconURL($data[$NAME . $num]) . "\"\n                     alt=\"{$status}\" title=\"{$status}\">&nbsp;{$status}";
         case 'glpi_tickets.status':
             $status = Ticket::getStatus($data[$NAME . $num]);
             return "<img src=\"" . Ticket::getStatusIconURL($data[$NAME . $num]) . "\"\n                     alt=\"{$status}\" title=\"{$status}\">&nbsp;{$status}";
         case 'glpi_tickets.items_id':
             if (!empty($data[$NAME . $num . "_2"]) && ($item = getItemForItemtype($data[$NAME . $num . "_2"]))) {
                 if ($item->getFromDB($data[$NAME . $num])) {
                     return $item->getLink(array('comments' => true));
                 }
             }
             return '&nbsp;';
         case 'glpi_tickets.name':
             if (isset($searchopt[$ID]['forcegroupby']) && $searchopt[$ID]['forcegroupby']) {
                 $split = explode("\$\$\$\$", $data[$NAME . $num]);
                 $out = '';
                 $link = Toolbox::getItemTypeFormURL('Ticket');
                 foreach ($split as $val) {
                     if (!empty($val)) {
                         $split2 = self::explodeWithID("\$\$", $val);
                         $out .= "<a id='ticket" . $split2[1] . "' href=\"" . $link;
                         $out .= strstr($link, '?') ? '&amp;' : '?';
                         $out .= 'id=' . $split2[1];
                         $out .= "\">";
                         $name = $split2[0];
                         if ($_SESSION["glpiis_ids_visible"] || empty($split2[0])) {
                             $name = sprintf(__('%1$s (%2$s)'), $name, $split2[1]);
                         }
                         $out .= $name . "</a><br>";
                     }
                 }
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:67,代码来源:searcha.class.php

示例4: displayLinkedTicketsTo

 /**
  * Display linked tickets to a ticket
  *
  * @param $ID ID of the ticket id
  *
  * @return nothing display
  **/
 static function displayLinkedTicketsTo($ID)
 {
     global $DB, $CFG_GLPI;
     $tickets = self::getLinkedTicketsTo($ID);
     $canupdate = Session::haveRight('ticket', UPDATE);
     $ticket = new Ticket();
     if (is_array($tickets) && count($tickets)) {
         foreach ($tickets as $linkID => $data) {
             if ($ticket->getFromDB($data['tickets_id'])) {
                 $icons = "<img src='" . Ticket::getStatusIconURL($ticket->fields["status"]) . "' alt=\"" . Ticket::getStatus($ticket->fields["status"]) . "\"\n                             title=\"" . Ticket::getStatus($ticket->fields["status"]) . "\">";
                 if ($canupdate) {
                     $icons .= '&nbsp;' . Html::getSimpleForm(static::getFormURL(), 'purge', _x('button', 'Delete permanently'), array('id' => $linkID, 'tickets_id' => $ID), $CFG_GLPI["root_doc"] . "/pics/delete.png");
                 }
                 $text = sprintf(__('%1$s %2$s'), self::getLinkName($data['link']), $ticket->getLink(array('forceid' => true)));
                 printf(__('%1$s %2$s'), $text, $icons);
             }
             echo '<br>';
         }
     }
 }
开发者ID:stweil,项目名称:glpi,代码行数:27,代码来源:ticket_ticket.class.php

示例5: getSplittedSubmitButtonHtml

 static function getSplittedSubmitButtonHtml($tickets_id, $action = "add")
 {
     $locale = _sx('button', 'Add');
     $ticket = new Ticket();
     $ticket->getFromDB($tickets_id);
     $ticket_users = self::prepareTicketUser($ticket);
     $actor_type = $ticket_users[Session::getLoginUserID()];
     $all_status = Ticket::getAllowedStatusArray($ticket->fields['status']);
     if ($actor_type == CommonITILActor::REQUESTER) {
         $ticket->fields['status'] = CommonITILObject::ASSIGNED;
     }
     $html = "<div class='x-split-button' id='x-split-button'>\n      <input type='submit' value='{$locale}' name='{$action}' class='x-button x-button-main'>\n         <span class='x-button x-button-drop'>&nbsp;</span>\n         <ul class='x-button-drop-menu'>";
     foreach ($all_status as $status_key => $status_label) {
         $checked = "";
         if ($status_key == $ticket->fields['status']) {
             $checked = "checked='checked'";
         }
         $html .= "<li><input type='radio' id='status_radio_{$status_key}' name='status' {$checked} value='{$status_key}'>";
         $html .= "<label for='status_radio_{$status_key}'>";
         $html .= "<img src='" . Ticket::getStatusIconURL($status_key) . "' />&nbsp;";
         $html .= $status_label;
         $html .= "</label>";
         $html .= "</li>";
     }
     $html .= "</ul>\n      </div>";
     $html .= "<script type='text/javascript'>split_button();</script>";
     return $html;
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:28,代码来源:ticket.class.php


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