本文整理汇总了PHP中TicketValidation::getStatusColor方法的典型用法代码示例。如果您正苦于以下问题:PHP TicketValidation::getStatusColor方法的具体用法?PHP TicketValidation::getStatusColor怎么用?PHP TicketValidation::getStatusColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TicketValidation
的用法示例。
在下文中一共展示了TicketValidation::getStatusColor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: giveItem
//.........这里部分代码省略.........
}
}
return ' ';
case 'glpi_tickets.name':
case 'glpi_problems.name':
case 'glpi_changes.name':
if (isset($data[$num][0]['content']) && isset($data[$num][0]['id']) && isset($data[$num][0]['status'])) {
$link = Toolbox::getItemTypeFormURL($itemtype);
$out = "<a id='{$itemtype}" . $data[$num][0]['id'] . "' href=\"" . $link;
$out .= strstr($link, '?') ? '&' : '?';
$out .= 'id=' . $data[$num][0]['id'];
// Force solution tab if solved
if ($item = getItemForItemtype($itemtype)) {
if (in_array($data[$num][0]['status'], $item->getSolvedStatusArray())) {
$out .= "&forcetab={$itemtype}\$2";
}
}
$out .= "\">";
$name = $data[$num][0]['name'];
if ($_SESSION["glpiis_ids_visible"] || empty($data[$num][0]['name'])) {
$name = sprintf(__('%1$s (%2$s)'), $name, $data[$num][0]['id']);
}
$out .= $name . "</a>";
$hdecode = Html::entity_decode_deep($data[$num][0]['content']);
$content = Toolbox::unclean_cross_side_scripting_deep($hdecode);
$out = sprintf(__('%1$s %2$s'), $out, Html::showToolTip(nl2br(Html::Clean($content)), array('applyto' => $itemtype . $data[$num][0]['id'], 'display' => false)));
return $out;
}
case 'glpi_ticketvalidations.status':
$out = '';
for ($k = 0; $k < $data[$num]['count']; $k++) {
if ($data[$num][$k]['name']) {
$status = TicketValidation::getStatus($data[$num][$k]['name']);
$bgcolor = TicketValidation::getStatusColor($data[$num][$k]['name']);
$out .= (empty($out) ? '' : self::LBBR) . "<div style=\"background-color:" . $bgcolor . ";\">" . $status . '</div>';
}
}
return $out;
case 'glpi_ticketsatisfactions.satisfaction':
if (self::$output_type == self::HTML_OUTPUT) {
return TicketSatisfaction::displaySatisfaction($data[$num][0]['name']);
}
break;
case 'glpi_projects._virtual_planned_duration':
return Html::timestampToString(ProjectTask::getTotalPlannedDurationForProject($data["id"]), false);
case 'glpi_projects._virtual_effective_duration':
return Html::timestampToString(ProjectTask::getTotalEffectiveDurationForProject($data["id"]), false);
case 'glpi_cartridgeitems._virtual':
return Cartridge::getCount($data["id"], $data[$num][0]['alarm_threshold'], self::$output_type != self::HTML_OUTPUT);
case 'glpi_printers._virtual':
return Cartridge::getCountForPrinter($data["id"], self::$output_type != self::HTML_OUTPUT);
case 'glpi_consumableitems._virtual':
return Consumable::getCount($data["id"], $data[$num][0]['alarm_threshold'], self::$output_type != self::HTML_OUTPUT);
case 'glpi_links._virtual':
$out = '';
$link = new Link();
if (($item = getItemForItemtype($itemtype)) && $item->getFromDB($data['id']) && $link->getfromDB($data[$num][0]['id']) && $item->fields['entities_id'] == $link->fields['entities_id']) {
if (count($data[$num])) {
$count_display = 0;
foreach ($data[$num] as $val) {
if (is_array($val)) {
$links = Link::getAllLinksFor($item, $val);
foreach ($links as $link) {
if ($count_display) {
$out .= self::LBBR;
}
示例2: giveItem
//.........这里部分代码省略.........
case 'glpi_tickets.priority':
return Ticket::getPriorityName($data[$NAME . $num]);
case 'glpi_tickets.urgency':
return Ticket::getUrgencyName($data[$NAME . $num]);
case 'glpi_tickets.impact':
return Ticket::getImpactName($data[$NAME . $num]);
case 'glpi_tickets.items_id':
if (!empty($data[$NAME . $num . "_2"]) && class_exists($data[$NAME . $num . "_2"])) {
$item = new $data[$NAME . $num . "_2"]();
if ($item->getFromDB($data[$NAME . $num])) {
return $item->getLink(true);
}
}
return ' ';
case 'glpi_tickets.id':
$link = getItemTypeFormURLMobile('Ticket');
$out = "<a id='ticket" . $data[$NAME . $num . "_2"] . "' href=\"" . $link;
$out .= strstr($link, '?') ? '&' : '?';
$out .= 'id=' . $data[$NAME . $num];
//$out .= 'id='.$data[$NAME.$num."_2"];
$out .= "\" data-back='false'>" . $data[$NAME . $num];
if ($_SESSION["glpiis_ids_visible"] || empty($data[$NAME . $num])) {
//$out .= " (".$data[$NAME.$num."_2"].")";
$out .= $data[$NAME . $num . "_2"];
}
$out .= "</a>";
return $out;
case 'glpi_ticketvalidations.status':
case "glpi_tickets.global_validation":
$split = explode("\$\$\$\$", $data[$NAME . $num]);
$out = '';
foreach ($split as $val) {
$status = TicketValidation::getStatus($val);
$bgcolor = TicketValidation::getStatusColor($val);
$out .= (empty($out) ? '' : '<br>') . "<div style=\"background-color:" . $bgcolor . ";\">" . $status . '</div>';
}
return $out;
case 'glpi_notimportedemails.reason':
return NotImportedEmail::getReason($data[$NAME . $num]);
case 'glpi_notimportedemails.messageid':
$clean = array('<' => '', '>' => '');
return strtr($data[$NAME . $num], $clean);
}
//// Default case
// Link with plugin tables : need to know left join structure
if (preg_match("/^glpi_plugin_([a-z0-9]+)/", $table . '.' . $field, $matches)) {
if (count($matches) == 2) {
$plug = $matches[1];
$function = 'plugin_' . $plug . '_giveItem';
if (function_exists($function)) {
$out = $function($itemtype, $ID, $data, $num);
if (!empty($out)) {
return $out;
}
}
}
}
$unit = '';
if (isset($searchopt[$ID]['unit'])) {
$unit = $searchopt[$ID]['unit'];
}
// Preformat items
if (isset($searchopt[$ID]["datatype"])) {
switch ($searchopt[$ID]["datatype"]) {
case "itemlink":
if (!empty($data[$NAME . $num . "_2"])) {
示例3: giveItem
//.........这里部分代码省略.........
$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>";
}
}
return $out;
}
$link = Toolbox::getItemTypeFormURL('Ticket');
$out = "<a id='ticket" . $data[$NAME . $num . "_2"] . "' href=\"" . $link;
$out .= strstr($link, '?') ? '&' : '?';
$out .= 'id=' . $data[$NAME . $num . "_2"];
// Force solution tab if solved
if ($data[$NAME . $num . "_4"] == CommonITILObject::SOLVED) {
$out .= "&forcetab=Ticket\$2";
}
$out .= "\">";
$name = $data[$NAME . $num];
if ($_SESSION["glpiis_ids_visible"] || empty($data[$NAME . $num])) {
$name = sprintf(__('%1$s (%2$s)'), $name, $data[$NAME . $num . "_2"]);
}
$out .= $name . "</a>";
$out = sprintf(__('%1$s %2$s'), $out, Html::showToolTip(nl2br($data[$NAME . $num . "_3"]), array('applyto' => 'ticket' . $data[$NAME . $num . "_2"], 'display' => false)));
return $out;
case 'glpi_ticketvalidations.status':
$split = explode("\$\$\$\$", $data[$NAME . $num]);
$out = '';
foreach ($split as $val) {
if (!empty($val)) {
$split2 = self::explodeWithID("\$\$", $val);
$status = TicketValidation::getStatus($split2[0]);
$bgcolor = TicketValidation::getStatusColor($split2[0]);
$out .= (empty($out) ? '' : '<br>') . "<div style=\"background-color:" . $bgcolor . ";\">" . $status . '</div>';
}
}
return $out;
case 'glpi_ticketsatisfactions.type':
return TicketSatisfaction::getTypeInquestName($data[$NAME . $num]);
case 'glpi_ticketsatisfactions.satisfaction':
return TicketSatisfaction::displaySatisfaction($data[$NAME . $num]);
case 'glpi_notimportedemails.reason':
return NotImportedEmail::getReason($data[$NAME . $num]);
case 'glpi_notimportedemails.messageid':
$clean = array('<' => '', '>' => '');
return strtr($data[$NAME . $num], $clean);
}
//// Default case
// Link with plugin tables : need to know left join structure
if (preg_match("/^glpi_plugin_([a-z0-9]+)/", $table . '.' . $field, $matches)) {
if (count($matches) == 2) {
$plug = $matches[1];
$function = 'plugin_' . $plug . '_giveItem';
if (function_exists($function)) {
$out = $function($itemtype, $ID, $data, $num);
if (!empty($out)) {
return $out;
}
}
}
}
$unit = '';
if (isset($searchopt[$ID]['unit'])) {
$unit = $searchopt[$ID]['unit'];
}
示例4: giveItem
//.........这里部分代码省略.........
if ($item->getFromDB($data[$NAME . $num])) {
return $item->getLink(true);
}
}
return ' ';
case 'glpi_tickets.name':
$link = getItemTypeFormURL('Ticket');
$out = "<a id='ticket" . $data[$NAME . $num . "_2"] . "' href=\"" . $link;
$out .= strstr($link, '?') ? '&' : '?';
$out .= 'id=' . $data[$NAME . $num . "_2"];
// Force solution tab if solved
if ($data[$NAME . $num . "_4"] == 'solved') {
$out .= "&forcetab=4";
}
$out .= "\">" . $data[$NAME . $num];
if ($_SESSION["glpiis_ids_visible"] || empty($data[$NAME . $num])) {
$out .= " (" . $data[$NAME . $num . "_2"] . ")";
}
$out .= "</a>";
$out .= showToolTip(nl2br($data[$NAME . $num . "_3"]), array('applyto' => 'ticket' . $data[$NAME . $num . "_2"], 'display' => false));
return $out;
case "glpi_tickets.due_date":
// No due date in waiting status
if ($data[$NAME . $num . '_2'] == 'waiting') {
$data[$NAME . $num] = "";
}
break;
case 'glpi_ticketvalidations.status':
case "glpi_tickets.global_validation":
$split = explode("\$\$\$\$", $data[$NAME . $num]);
$out = '';
foreach ($split as $val) {
$status = TicketValidation::getStatus($val);
$bgcolor = TicketValidation::getStatusColor($val);
$out .= (empty($out) ? '' : '<br>') . "<div style=\"background-color:" . $bgcolor . ";\">" . $status . '</div>';
}
return $out;
case 'glpi_ticketsatisfactions.type':
return TicketSatisfaction::getTypeInquestName($data[$NAME . $num]);
case 'glpi_ticketsatisfactions.satisfaction':
return TicketSatisfaction::displaySatisfaction($data[$NAME . $num]);
case 'glpi_notimportedemails.reason':
return NotImportedEmail::getReason($data[$NAME . $num]);
case 'glpi_notimportedemails.messageid':
$clean = array('<' => '', '>' => '');
return strtr($data[$NAME . $num], $clean);
case 'glpi_fieldunicities.fields':
$values = explode(',', $data[$NAME . $num]);
$item = new $data['ITEMTYPE']();
$message = array();
foreach ($values as $field) {
$table = getTableNameForForeignKeyField($field);
if ($table != '') {
$searchOption = $item->getSearchOptionByField('field', 'name', $table);
} else {
$searchOption = $item->getSearchOptionByField('field', $field);
}
$message[] = $searchOption['name'];
}
return implode(',', $message);
}
//// Default case
// Link with plugin tables : need to know left join structure
if (preg_match("/^glpi_plugin_([a-z0-9]+)/", $table . '.' . $field, $matches)) {
if (count($matches) == 2) {
$plug = $matches[1];