本文整理汇总了PHP中Ticket::getStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP Ticket::getStatus方法的具体用法?PHP Ticket::getStatus怎么用?PHP Ticket::getStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ticket
的用法示例。
在下文中一共展示了Ticket::getStatus方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param $report
* @param $name (default 'status')
* @param $label (default '')
* @param $option (default 1)
**/
function __construct($report, $name = 'status', $label = '', $option = 1)
{
if (is_array($option)) {
foreach ($option as $opt) {
$tab[$opt] = Ticket::getStatus($opt);
}
} else {
if ($option == 1) {
$tab = Ticket::getAllStatusArray(true);
} else {
$tab = Ticket::getAllStatusArray(false);
}
}
// Parent is PluginReportsArrayCriteria
parent::__construct($report, $name, $label ? $label : _n('Status', 'Statuses', 1), $tab);
}
示例2:
if (is_array($val) && in_array($group, $val)) {
if (isset($tasklevels[$key])) {
$tasklevels[$key] += $time;
} else {
$tasklevels[$key] = $time;
}
}
}
}
}
$row_num++;
$num = 1;
echo Search::showNewLine($output_type);
echo Search::showItem($output_type, $data['id'], $num, $row_num);
echo Search::showItem($output_type, Dropdown::getDropdownName('glpi_entities', $data['entities_id']), $num, $row_num);
echo Search::showItem($output_type, Ticket::getStatus($data["status"]), $num, $row_num);
echo Search::showItem($output_type, Html::convDateTime($data['date']), $num, $row_num);
echo Search::showItem($output_type, Html::convDateTime($data['date_mod']), $num, $row_num);
echo Search::showItem($output_type, Ticket::getPriorityName($data['priority']), $num, $row_num);
echo Search::showItem($output_type, $userdata, $num, $row_num);
echo Search::showItem($output_type, Ticket::getTicketTypeName($data['type']), $num, $row_num);
echo Search::showItem($output_type, Dropdown::getDropdownName("glpi_itilcategories", $data["itilcategories_id"]), $num, $row_num);
$out = $ticket->getLink();
echo Search::showItem($output_type, $out, $num, $row_num);
echo Search::showItem($output_type, Html::convDateTime($data['closedate']), $num, $row_num);
echo Search::showItem($output_type, Dropdown::getDropdownName('glpi_requesttypes', $data["requesttypes_id"]), $num, $row_num);
if ($output_type == Search::HTML_OUTPUT || $output_type == Search::PDF_OUTPUT_PORTRAIT || $output_type == Search::PDF_OUTPUT_LANDSCAPE) {
echo Search::showItem($output_type, Html::timestampToString($data["takeintoaccount_delay_stat"]), $num, $row_num);
} else {
echo Search::showItem($output_type, Html::formatNumber($data["takeintoaccount_delay_stat"] / 3600, false, 5), $num, $row_num);
}
示例3: substr
}
if ($status1 == "5") {
$status1 = "solved";
}
if ($status1 == "6") {
$status1 = "closed";
}
//requerente
$sql_user = "SELECT glpi_tickets.id AS id, glpi_users.firstname AS name, glpi_users.realname AS sname\n\t\t\tFROM `glpi_tickets_users` , glpi_tickets, glpi_users\n\t\t\tWHERE glpi_tickets.id = glpi_tickets_users.`tickets_id`\n\t\t\tAND glpi_tickets.id = " . $row['id'] . "\n\t\t\tAND glpi_tickets_users.`users_id` = glpi_users.id\n\t\t\tAND glpi_tickets_users.type = 1\n\t\t\t" . $entidade . " ";
$result_user = $DB->query($sql_user);
$row_user = $DB->fetch_assoc($result_user);
//tecnico
$sql_tec = "SELECT glpi_tickets.id AS id, glpi_users.firstname AS name, glpi_users.realname AS sname\n\t\t\tFROM `glpi_tickets_users` , glpi_tickets, glpi_users\n\t\t\tWHERE glpi_tickets.id = glpi_tickets_users.`tickets_id`\n\t\t\tAND glpi_tickets.id = " . $row['id'] . "\n\t\t\tAND glpi_tickets_users.`users_id` = glpi_users.id\n\t\t\tAND glpi_tickets_users.type = 2\n\t\t\t" . $entidade . " ";
$result_tec = $DB->query($sql_tec);
$row_tec = $DB->fetch_assoc($result_tec);
echo "\t\n\t\t\t<tr>\n\t\t\t<td style='vertical-align:middle; text-align:center;'><a href=" . $CFG_GLPI['url_base'] . "/front/ticket.form.php?id=" . $row['id'] . " target=_blank >" . $row['id'] . "</a></td>\n\t\t\t<td style='vertical-align:middle;'><img src=" . $CFG_GLPI['url_base'] . "/pics/" . $status1 . ".png title='" . Ticket::getStatus($row['status']) . "' style=' cursor: pointer; cursor: hand;'/> " . Ticket::getStatus($row['status']) . " </td>\n\t\t\t<td style='vertical-align:middle;'> " . substr($row['descr'], 0, 55) . " </td>\n\t\t\t<td style='vertical-align:middle;'> " . $row_user['name'] . " " . $row_user['sname'] . " </td>\n\t\t\t<td style='vertical-align:middle;'> " . $row_tec['name'] . " " . $row_tec['sname'] . " </td>\n\t\t\t<td style='vertical-align:middle;'> " . conv_data_hora($row['date']) . " </td>\n\t\t\t<td style='vertical-align:middle;'> " . conv_data_hora($row['solvedate']) . " </td>\n\t\t\t</tr>";
}
echo "</tbody>\n\t\t\t\t</table>\n\t\t\t\t</div>";
?>
<script type="text/javascript" charset="utf-8">
$('#data')
.removeClass( 'display' )
.addClass('table table-striped table-bordered');
$(document).ready(function() {
oTable = $('#data').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bFilter": false,
示例4: giveItem
//.........这里部分代码省略.........
$color = $_SESSION['glpiduedatecritical_color'];
} 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;'> " . $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}\"> {$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}\"> {$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}\"> {$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'])) {
示例5: getCentral
//.........这里部分代码省略.........
}
switch ($ticket->fields["type"]) {
case Ticket::INCIDENT_TYPE:
$opt['condition'] .= "`is_incident`='1'";
break;
case Ticket::DEMAND_TYPE:
$opt['condition'] .= "`is_request`='1'";
break;
default:
break;
}
echo "<span id='show_category_by_type'>";
ITILCategory::dropdown($opt);
echo "</span>";
} else {
echo Dropdown::getDropdownName("glpi_itilcategories", $ticket->fields["itilcategories_id"]);
}
echo "</td>";
echo "</tr>";
if (!$ID) {
echo "</table>";
$ticket->showActorsPartForm($ID, $values);
echo "<table class='tab_cadre_fixe' id='mainformtable3'>";
}
echo "<tr class='tab_bg_1'>";
echo "<th width='{$colsize1}%'>" . $tt->getBeginHiddenFieldText('status');
printf(__('%1$s%2$s'), __('Status'), $tt->getMandatoryMark('status'));
echo $tt->getEndHiddenFieldText('status') . "</th>";
echo "<td width='{$colsize2}%'>";
echo $tt->getBeginHiddenFieldValue('status');
if ($canstatus) {
Ticket::dropdownStatus(array('value' => $ticket->fields["status"], 'showtype' => 'allowed'));
} else {
echo Ticket::getStatus($ticket->fields["status"]);
}
echo $tt->getEndHiddenFieldValue('status', $ticket);
echo "</td>";
echo "<th width='{$colsize3}%'>" . $tt->getBeginHiddenFieldText('requesttypes_id');
printf(__('%1$s%2$s'), __('Request source'), $tt->getMandatoryMark('requesttypes_id'));
echo $tt->getEndHiddenFieldText('requesttypes_id') . "</th>";
echo "<td width='{$colsize4}%'>";
echo $tt->getBeginHiddenFieldValue('requesttypes_id');
if ($canupdate) {
RequestType::dropdown(array('value' => $ticket->fields["requesttypes_id"]));
} else {
echo Dropdown::getDropdownName('glpi_requesttypes', $ticket->fields["requesttypes_id"]);
}
echo $tt->getEndHiddenFieldValue('requesttypes_id', $ticket);
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<th>" . $tt->getBeginHiddenFieldText('urgency');
printf(__('%1$s%2$s'), __('Urgency'), $tt->getMandatoryMark('urgency'));
echo $tt->getEndHiddenFieldText('urgency') . "</th>";
echo "<td>";
if ($canupdate && $canpriority || !$ID || $canupdate_descr) {
// Only change during creation OR when allowed to change priority OR when user is the creator
echo $tt->getBeginHiddenFieldValue('urgency');
$idurgency = Ticket::dropdownUrgency(array('value' => $ticket->fields["urgency"]));
echo $tt->getEndHiddenFieldValue('urgency', $ticket);
} else {
$idurgency = "value_urgency" . mt_rand();
echo "<input id='{$idurgency}' type='hidden' name='urgency' value='" . $ticket->fields["urgency"] . "'>";
echo Ticket::getUrgencyName($ticket->fields["urgency"]);
}
echo "</td>";
示例6: createReply
/**
* create a new reply for a ticket.
* A reply will only be added if the content isn't empty and if the ticket isn't closed.
* The ticket creator will be notified by email that someone else replied on his ticket.
* @param $content the content of the reply
* @param $author the author of the reply
* @param $ticket_id the id of the ticket to which we want to add the reply.
* @param $hidden boolean that specifies if the reply should only be shown to mods/admins or all users.
*/
public static function createReply($content, $author, $ticket_id, $hidden)
{
//if not empty
if (!(Trim($content) === '')) {
$content = filter_var($content, FILTER_SANITIZE_STRING);
$ticket = new Ticket();
$ticket->load_With_TId($ticket_id);
//if status is not closed
if ($ticket->getStatus() != 3) {
Ticket_Reply::createReply($content, $author, $ticket_id, $hidden, $ticket->getAuthor());
//notify ticket author that a new reply is added!
if ($ticket->getAuthor() != $author) {
Mail_Handler::send_ticketing_mail($ticket->getAuthor(), $ticket, $content, "REPLY", $ticket->getForwardedGroupId());
}
} else {
//TODO: Show error message that ticket is closed
}
} else {
//TODO: Show error content is empty
}
}
示例7: 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 .= ' ' . 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>';
}
}
}
示例8: _x
$prio_name = _x('priority', 'Medium');
}
if ($priority == 4) {
$prio_name = _x('priority', 'High');
}
if ($priority == 5) {
$prio_name = _x('priority', 'Very high');
}
if ($priority == 6) {
$prio_name = _x('priority', 'Major');
}
//get Location
$sql_loc = "SELECT id, name\n\t\tFROM glpi_locations\n\t\tWHERE glpi_locations.id = " . $row['lid'] . " ";
$result_loc = $DB->query($sql_loc);
$row_loc = $DB->fetch_assoc($result_loc);
echo "\n\t\t<tr class='title'>\n\t\t\t<td style='text-align:center; vertical-align:middle;'> <a href=../../../../front/ticket.form.php?id=" . $row['id'] . " target=_blank > <span >" . $row['id'] . "</span> </a></td>\n\t\t\t<td style='vertical-align:middle;'><span style='color:#000099';><img src=../../../../pics/" . $status1 . ".png /> " . Ticket::getStatus($row['status']) . "</span ></td>\n\t\t\t<td style='vertical-align:middle;'><a href=../../../../front/ticket.form.php?id=" . $row['id'] . " target=_blank > <span >" . $row['descri'] . "</span> </a></td>\n\t\t\t<td style='vertical-align:middle;'><span >" . $row_tec['name'] . " " . $row_tec['sname'] . "</span> </td>\n\t\t\t<td style='vertical-align:middle;'><span >" . $row_req['name'] . " " . $row_req['sname'] . "</span> </td>";
if ($show_loc == 1) {
echo "<td style='vertical-align:middle; text-align:center; font-size:14pt;'>" . $row_loc['name'] . "</td>";
}
if ($show_due == 1) {
if ($count_due > 0) {
$now = date("Y-m-d H:i");
if ($row['duedate'] < $now) {
echo "<td style='vertical-align:middle; font-size:14pt; color:red;'><span>" . conv_data_hora($row['duedate']) . "</span> </td>";
} else {
echo "<td style='vertical-align:middle; font-size:14pt; color:green;'><span>" . conv_data_hora($row['duedate']) . "</span> </td>";
}
}
}
echo "\t\t\t\t\n\t\t\t<td style='vertical-align:middle; text-align:center; background-color:" . $row_prio['value'] . ";'>" . $prio_name . "</td>\n\t\t</tr>";
}
示例9: showEquals
public function showEquals($searchopt, $value, $edit = true)
{
$inputname = $searchopt['linkfield'];
switch ($searchopt['table'] . "." . $searchopt['linkfield']) {
case "glpi_tickets.status":
if ($edit) {
Ticket::dropdownStatus($inputname, $value, 1);
} else {
echo Ticket::getStatus($value);
}
break;
case "glpi_tickets.priority":
if ($edit) {
Ticket::dropdownPriority($inputname, $value, true, true);
} else {
echo Ticket::getPriorityName(trim($value));
}
break;
case "glpi_tickets.impact":
if ($edit) {
Ticket::dropdownImpact($inputname, $value, true);
} else {
echo Ticket::getImpactName($value);
}
break;
case "glpi_tickets.urgency":
if ($edit) {
Ticket::dropdownUrgency($inputname, $value, true);
} else {
echo Ticket::getUrgencyName($value);
}
break;
case "glpi_tickets.global_validation":
if ($edit) {
TicketValidation::dropdownStatus($inputname, array('value' => $value, 'all' => 1));
} else {
TicketValidation::getStatus($value);
}
break;
case "glpi_users.name":
if ($edit) {
User::dropdown(array('name' => $inputname, 'value' => $value, 'comments' => false, 'all' => -1, 'right' => 'all'));
} else {
echo getUserName($value);
}
break;
case "glpi_ticketvalidations.status":
if ($edit) {
TicketValidation::dropdownStatus($inputname, array('value' => $value, 'all' => 1));
} else {
echo TicketValidation::getStatus($value);
}
break;
}
}
示例10: constructHistory
/**
* Construct history for an item
*
* @param $item CommonDBTM object
* @param $oldvalues array of old values updated
* @param $values array of all values of the item
*
* @return boolean for success (at least 1 log entry added)
**/
static function constructHistory(CommonDBTM $item, &$oldvalues, &$values)
{
global $LANG;
if (!count($oldvalues)) {
return false;
}
// needed to have $SEARCHOPTION
if ($item->getType() == 'TicketSatisfaction') {
$real_type = 'Ticket';
$real_id = $item->fields['tickets_id'];
} else {
if ($item->getType() == 'Infocom') {
$real_type = $item->fields['itemtype'];
$real_id = $item->fields['items_id'];
} else {
$real_type = $item->getType();
$real_id = $item->fields['id'];
}
}
$searchopt = Search::getOptions($real_type);
if (!is_array($searchopt)) {
return false;
}
$result = 0;
foreach ($oldvalues as $key => $oldval) {
$changes = array();
if ($real_type == 'Infocom') {
// Parsing $SEARCHOPTION to find infocom
foreach ($searchopt as $key2 => $val2) {
if ($val2["field"] == $key && strpos($val2['table'], 'infocoms') || $key == 'budgets_id' && $val2['table'] == 'glpi_budgets' || $key == 'suppliers_id' && $val2['table'] == 'glpi_suppliers') {
$id_search_option = $key2;
// Give ID of the $SEARCHOPTION
if ($val2["table"] == "glpi_infocoms") {
// 1st case : text field -> keep datas
$changes = array($id_search_option, addslashes($oldval), $values[$key]);
} else {
if ($val2["table"] == "glpi_suppliers") {
// 2nd case ; link field -> get data from glpi_suppliers
$changes = array($id_search_option, addslashes(Dropdown::getDropdownName("glpi_suppliers", $oldval)), addslashes(Dropdown::getDropdownName("glpi_suppliers", $values[$key])));
} else {
// 3rd case ; link field -> get data from dropdown (budget)
$changes = array($id_search_option, addslashes(Dropdown::getDropdownName($val2["table"], $oldval)), addslashes(Dropdown::getDropdownName($val2["table"], $values[$key])));
}
}
break;
// foreach exit
}
}
} else {
// Not an Infocom
// Parsing $SEARCHOPTION to find changed field
foreach ($searchopt as $key2 => $val2) {
// Linkfield or standard field not massive action enable
if ($val2["linkfield"] == $key || $key == $val2["field"] && $val2["table"] == $item->getTable()) {
$id_search_option = $key2;
// Give ID of the $SEARCHOPTION
// 1st case : Ticket specific dropdown case (without table)
if ($real_type == 'Ticket' && in_array($key, array('status', 'urgency', 'impact', 'priority', 'global_validation'))) {
switch ($key) {
case 'global_validation':
$changes = array($id_search_option, addslashes(TicketValidation::getStatus($oldval)), addslashes(TicketValidation::getStatus($values[$key])));
break;
case 'status':
$changes = array($id_search_option, addslashes(Ticket::getStatus($oldval)), addslashes(Ticket::getStatus($values[$key])));
break;
case 'urgency':
$changes = array($id_search_option, addslashes(Ticket::getUrgencyName($oldval)), addslashes(Ticket::getUrgencyName($values[$key])));
break;
case 'impact':
$changes = array($id_search_option, addslashes(Ticket::getImpactName($oldval)), addslashes(Ticket::getImpactName($values[$key])));
break;
case 'priority':
$changes = array($id_search_option, addslashes(Ticket::getPriorityName($oldval)), addslashes(Ticket::getPriorityName($values[$key])));
break;
}
} else {
if ($val2["table"] == $item->getTable()) {
// 2nd case : text field -> keep datas
$changes = array($id_search_option, addslashes($oldval), $values[$key]);
} else {
// if ($val2['table'] == 'glpi_users_validation') {
// $val2['table'] = 'glpi_users';
// }
// other cases ; link field -> get data from dropdown
if ($val2["table"] != 'glpi_complete_entities') {
$changes = array($id_search_option, addslashes(Dropdown::getDropdownName($val2["table"], $oldval)), addslashes(Dropdown::getDropdownName($val2["table"], $values[$key])));
}
}
}
break;
}
//.........这里部分代码省略.........
示例11: switch
// Status
switch ($row['status']) {
case 'NOT VALID':
case 'NOT PROCESSED':
$ticket->setStatus('closed');
$ticket->setResolution('Bogus');
break;
case 'COMPLETED':
$ticket->setStatus('closed');
$ticket->setResolution('Resolved');
break;
default:
$ticket->setStatus('open');
}
// ReqPro was not very good at keeping it's status and completed_date in sync
if ($row['completed_date'] && $ticket->getStatus() == 'open') {
$ticket->setStatus('closed');
}
// Import the Person
if (isset($row['received_by']) && $row['received_by']) {
try {
$ticket->setEnteredByPerson($row['received_by']);
} catch (Exception $e) {
}
}
if (!$ticket->getEnteredByPerson()) {
$ticket->setEnteredByPerson('unknown');
}
if (isset($row['assigned_to']) && $row['assigned_to']) {
try {
list($username, $fullname) = explode(':', $row['assigned_to']);
示例12: giveItem
//.........这里部分代码省略.........
if (empty($data[$NAME . $num])) {
return 0;
}
return $data[$NAME . $num];
case "glpi_auth_tables.name":
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='" . $LANG['reservation'][22] . "'\n href='" . $CFG_GLPI["root_doc"] . "/front/reservationitem.form.php?id=" . $data["refID"] . "' data-back='false'>" . $LANG['common'][49] . "</a>";
}
return "<a title='" . $LANG['reservation'][22] . "'\n href='" . $CFG_GLPI["root_doc"] . "/front/reservationitem.form.php?id=" . $data['refID'] . "' data-back='false'>" . 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();
return $events[$data[$NAME . $num]];
}
return '';
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_tickets.status':
$status = Ticket::getStatus($data[$NAME . $num]);
// status Stevenes Donato
if ($data[$NAME . $num] == "1") {
$data[$NAME . $num] = "new";
}
if ($data[$NAME . $num] == "2") {
$data[$NAME . $num] = "assign";
}
if ($data[$NAME . $num] == "3") {
$data[$NAME . $num] = "plan";
}
if ($data[$NAME . $num] == "4") {
$data[$NAME . $num] = "waiting";
}
if ($data[$NAME . $num] == "5") {
$data[$NAME . $num] = "solved";
}
if ($data[$NAME . $num] == "6") {
$data[$NAME . $num] = "closed";
}
//
return "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/" . $data[$NAME . $num] . ".png\"\n alt='{$status}' title='{$status}'> {$status}";
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);
示例13: displayLinkedTicketsTo
/**
* Display linked tickets to a ticket
*
* @param $ID ID of the ticket id
*
* @return nothing display
**/
static function displayLinkedTicketsTo($ID)
{
global $DB, $LANG, $CFG_GLPI;
$tickets = self::getLinkedTicketsTo($ID);
$canupdate = haveRight('update_ticket', '1');
$ticket = new Ticket();
if (is_array($tickets) && count($tickets)) {
foreach ($tickets as $linkID => $data) {
echo self::getLinkName($data['link']) . " ";
if (!$_SESSION['glpiis_ids_visible']) {
echo $LANG['common'][2] . " " . $data['tickets_id'] . " : ";
}
if ($ticket->getFromDB($data['tickets_id'])) {
echo $ticket->getLink();
echo " <img src='" . $CFG_GLPI["root_doc"] . "/pics/" . $ticket->fields["status"] . ".png' alt=\"" . Ticket::getStatus($ticket->fields["status"]) . "\"\n title=\"" . Ticket::getStatus($ticket->fields["status"]) . "\">";
if ($canupdate) {
echo " <a href='" . $CFG_GLPI["root_doc"] . "/front/ticket.form.php?delete_link=delete_link&id={$linkID}" . "&tickets_id={$ID}' title=\"" . $LANG['reservation'][6] . "\">\n <img src='" . $CFG_GLPI["root_doc"] . "/pics/delete.png'\n alt=\"" . $LANG['buttons'][6] . "\" title=\"" . $LANG['buttons'][6] . "\"></a>";
}
}
echo '<br>';
}
}
}
示例14: getActionValue
/**
* Return a value associated with a pattern associated to a criteria
*
* @param $ID the given action
* @param $value the value
**/
function getActionValue($ID, $value)
{
global $LANG;
$action = $this->getAction($ID);
if (isset($action['type'])) {
switch ($action['type']) {
case "dropdown":
return Dropdown::getDropdownName($action["table"], $value);
case "dropdown_status":
return Ticket::getStatus($value);
case "dropdown_assign":
case "dropdown_users":
case "dropdown_users_validate":
return getUserName($value);
case "yesonly":
case "yesno":
if ($value) {
return $LANG['choice'][1];
}
return $LANG['choice'][0];
case "dropdown_urgency":
return Ticket::getUrgencyName($value);
case "dropdown_impact":
return Ticket::getImpactName($value);
case "dropdown_priority":
return Ticket::getPriorityName($value);
case "dropdown_management":
return Dropdown::getGlobalSwitch($value);
default:
return $this->displayAdditionRuleActionValue($value);
}
}
return $value;
}
示例15: giveItem
//.........这里部分代码省略.........
if (empty($data[$NAME . $num])) {
return 0;
}
return $data[$NAME . $num];
case "glpi_auth_tables.name":
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=\"" . $LANG['reservation'][22] . "\"\n href='" . $CFG_GLPI["root_doc"] . "/front/reservationitem.form.php?id=" . $data["refID"] . "' >" . $LANG['common'][49] . "</a>";
}
return "<a title=\"" . $LANG['reservation'][22] . "\"\n href='" . $CFG_GLPI["root_doc"] . "/front/reservationitem.form.php?id=" . $data['refID'] . "' >" . 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();
return $events[$data[$NAME . $num]];
}
return '';
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_tickets.status':
$status = Ticket::getStatus($data[$NAME . $num]);
return "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/" . $data[$NAME . $num] . ".png\"\n alt=\"{$status}\" title=\"{$status}\"> {$status}";
case 'glpi_tickets.type':
return Ticket::getTicketTypeName($data[$NAME . $num]);
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.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));