本文整理汇总了PHP中Ticket::getLink方法的典型用法代码示例。如果您正苦于以下问题:PHP Ticket::getLink方法的具体用法?PHP Ticket::getLink怎么用?PHP Ticket::getLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ticket
的用法示例。
在下文中一共展示了Ticket::getLink方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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>';
}
}
}
示例2: 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>';
}
}
}
示例3: showForObject
/**
* Print the item costs
*
* @param $item CommonITILObject object or Project
* @param $withtemplate boolean Template or basic item (default '')
*
* @return total cost
**/
static function showForObject($item, $withtemplate = '')
{
global $DB, $CFG_GLPI;
$forproject = false;
if (Toolbox::is_a($item, 'Project')) {
$forproject = true;
}
$ID = $item->fields['id'];
if (!$item->getFromDB($ID) || !$item->canViewItem() || !static::canView()) {
return false;
}
$canedit = false;
if (!$forproject) {
$canedit = $item->canUpdateItem();
}
echo "<div class='center'>";
$condition = "= '{$ID}'";
if ($forproject) {
$condition = " IN ('" . implode("','", ProjectTask::getAllTicketsForProject($ID)) . "')";
}
$query = "SELECT *\n FROM `" . static::getTable() . "`\n WHERE `" . static::$items_id . "` {$condition}\n ORDER BY `begin_date`";
$rand = mt_rand();
if ($canedit) {
echo "<div id='viewcost" . $ID . "_{$rand}'></div>\n";
echo "<script type='text/javascript' >\n";
echo "function viewAddCost" . $ID . "_{$rand}() {\n";
$params = array('type' => static::getType(), 'parenttype' => static::$itemtype, static::$items_id => $ID, 'id' => -1);
Ajax::updateItemJsCode("viewcost" . $ID . "_{$rand}", $CFG_GLPI["root_doc"] . "/ajax/viewsubitem.php", $params);
echo "};";
echo "</script>\n";
if (static::canCreate()) {
echo "<div class='center firstbloc'>" . "<a class='vsubmit' href='javascript:viewAddCost" . $ID . "_{$rand}();'>";
echo __('Add a new cost') . "</a></div>\n";
}
}
$total = 0;
$total_time = 0;
$total_costtime = 0;
$total_fixed = 0;
$total_material = 0;
if ($result = $DB->query($query)) {
echo "<table class='tab_cadre_fixehov'>";
echo "<tr class='noHover'>";
if ($forproject) {
echo "<th colspan='10'>" . _n('Ticket cost', 'Ticket costs', $DB->numrows($result)) . "</th>";
} else {
echo "<th colspan='7'>" . self::getTypeName($DB->numrows($result)) . "</th>";
echo "<th>" . __('Item duration') . "</th>";
echo "<th>" . CommonITILObject::getActionTime($item->fields['actiontime']) . "</th>";
}
echo "</tr>";
if ($DB->numrows($result)) {
echo "<tr>";
if ($forproject) {
echo "<th>" . __('Ticket') . "</th>";
$ticket = new Ticket();
}
echo "<th>" . __('Name') . "</th>";
echo "<th>" . __('Begin date') . "</th>";
echo "<th>" . __('End date') . "</th>";
echo "<th>" . __('Budget') . "</th>";
echo "<th>" . __('Duration') . "</th>";
echo "<th>" . __('Time cost') . "</th>";
echo "<th>" . __('Fixed cost') . "</th>";
echo "<th>" . __('Material cost') . "</th>";
echo "<th>" . __('Total cost') . "</th>";
echo "</tr>";
Session::initNavigateListItems(static::getType(), sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName()));
while ($data = $DB->fetch_assoc($result)) {
echo "<tr class='tab_bg_2' " . ($canedit ? "style='cursor:pointer' onClick=\"viewEditCost" . $data[static::$items_id] . "_" . $data['id'] . "_{$rand}();\"" : '') . ">";
$name = empty($data['name']) ? sprintf(__('%1$s (%2$s)'), $data['name'], $data['id']) : $data['name'];
if ($forproject) {
$ticket->getFromDB($data['tickets_id']);
echo "<td>" . $ticket->getLink() . "</td>";
}
echo "<td>";
printf(__('%1$s %2$s'), $name, Html::showToolTip($data['comment'], array('display' => false)));
if ($canedit) {
echo "\n<script type='text/javascript' >\n";
echo "function viewEditCost" . $data[static::$items_id] . "_" . $data["id"] . "_{$rand}() {\n";
$params = array('type' => static::getType(), 'parenttype' => static::$itemtype, static::$items_id => $data[static::$items_id], 'id' => $data["id"]);
Ajax::updateItemJsCode("viewcost" . $ID . "_{$rand}", $CFG_GLPI["root_doc"] . "/ajax/viewsubitem.php", $params);
echo "};";
echo "</script>\n";
}
echo "</td>";
echo "<td>" . Html::convDate($data['begin_date']) . "</td>";
echo "<td>" . Html::convDate($data['end_date']) . "</td>";
echo "<td>" . Dropdown::getDropdownName('glpi_budgets', $data['budgets_id']) . "</td>";
echo "<td>" . CommonITILObject::getActionTime($data['actiontime']) . "</td>";
$total_time += $data['actiontime'];
echo "<td class='numeric'>" . Html::formatNumber($data['cost_time']) . "</td>";
//.........这里部分代码省略.........
示例4: foreach
}
}
}
$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);
}
echo Search::showItem($output_type, Dropdown::getDropdownName('glpi_slas', $data["slas_id"]), $num, $row_num);
$time = 0;
if (!empty($mylevels)) {
foreach ($mylevels as $key => $val) {
if (array_key_exists($key, $timelevels)) {
$time = $timelevels[$key];
} else {