本文整理汇总了PHP中Ticket::getAllStatusArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Ticket::getAllStatusArray方法的具体用法?PHP Ticket::getAllStatusArray怎么用?PHP Ticket::getAllStatusArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ticket
的用法示例。
在下文中一共展示了Ticket::getAllStatusArray方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: __construct
function __construct($name, $title, $map = array(), $options = array())
{
parent::__construct($name, $title, $options);
if (count($map)) {
$this->map = $map;
} else {
switch ($name) {
case 'status':
$this->map = Ticket::getAllStatusArray();
break;
case 'impact':
$this->map = getImpactLabelsArray();
break;
case 'urgency':
$this->map = getUrgencyLabelsArray();
break;
case 'priority':
$this->map = getPriorityLabelsArray();
break;
default:
$this->map = array();
}
}
}
示例3: displayLifeCycleMatrixTicketHelpdesk
/**
* Display the matrix of the elements lifecycle of the elements
*
* @since version 0.85
*
* @param $title the kind of lifecycle
* @param $html_field field that is sent to _POST
* @param $db_field field inside the DB (to get current state)
* @param $canedit can we edit the elements ?
*
* @return nothing
**/
function displayLifeCycleMatrixTicketHelpdesk($title, $html_field, $db_field, $canedit)
{
$columns = array();
$rows = array();
$statuses = array();
$allstatuses = Ticket::getAllStatusArray();
foreach (array(Ticket::INCOMING, Ticket::SOLVED, Ticket::CLOSED) as $val) {
$statuses[$val] = $allstatuses[$val];
}
$alwaysok = array(Ticket::INCOMING => array(), Ticket::SOLVED => array(Ticket::INCOMING), Ticket::CLOSED => array());
$allowactions = array(Ticket::INCOMING => array(), Ticket::SOLVED => array(Ticket::CLOSED), Ticket::CLOSED => array(Ticket::CLOSED, Ticket::INCOMING));
foreach ($statuses as $index_1 => $status_1) {
$columns[$index_1] = $status_1;
$row = array('label' => $status_1, 'columns' => array());
foreach ($statuses as $index_2 => $status_2) {
$content = array('checked' => true);
if (isset($this->fields[$db_field][$index_1][$index_2])) {
$content['checked'] = $this->fields[$db_field][$index_1][$index_2];
}
if (in_array($index_2, $alwaysok[$index_1])) {
$content['checked'] = true;
}
if ($index_1 == $index_2 || !$canedit || !in_array($index_2, $allowactions[$index_1])) {
$content['readonly'] = true;
}
$row['columns'][$index_2] = $content;
}
$rows[$html_field . "[{$index_1}]"] = $row;
}
Html::showCheckboxMatrix($columns, $rows, array('title' => $title, 'first_cell' => '<b>' . __("From \\ To") . '</b>'));
}
示例4: ShowDetail
/**
* Used to display each status time used for each group/user
*
*
* @param Ticket $ticket
*/
static function ShowDetail(Ticket $ticket, $type)
{
$ptState = new PluginTimelineticketState();
if ($type == 'group') {
$ptItem = new PluginTimelineticketAssignGroup();
} else {
if ($type == 'user') {
$ptItem = new PluginTimelineticketAssignUser();
}
}
$a_states = $ptState->find("`tickets_id`='" . $ticket->getField('id') . "'", "`date`");
$a_state_delays = array();
$a_state_num = array();
$delay = 0;
$list_status = Ticket::getAllStatusArray();
$status = "new";
foreach ($a_states as $array) {
$delay += $array['delay'];
$a_state_delays[$delay] = $array['old_status'];
$a_state_num[] = $delay;
}
$a_state_num[] = $delay;
$last_delay = $delay;
$a_groups = $ptItem->find("`tickets_id`='" . $ticket->getField('id') . "'", "`date`");
echo "<table class='tab_cadre_fixe' width='100%'>";
echo "<tr class='tab_bg_1'>";
echo "<th colspan='" . (count($list_status) + 1) . "'>";
_e('Result details');
if ($type == 'group') {
echo " (" . __('Groups in charge of the ticket', 'timelineticket') . ")";
} else {
if ($type == 'user') {
echo " (" . __('Technicians in charge of the ticket', 'timelineticket') . ")";
}
}
echo "</th>";
echo "</tr>";
echo "</tr>";
echo "<th>";
echo "</th>";
foreach ($list_status as $name) {
echo "<th>";
echo $name;
echo "</th>";
}
echo "</tr>";
if ($type == 'group') {
$a_details = PluginTimelineticketToolbox::getDetails($ticket, 'group', false);
} else {
if ($type == 'user') {
$a_details = PluginTimelineticketToolbox::getDetails($ticket, 'user', false);
}
}
foreach ($a_details as $items_id => $a_detail) {
$a_status = array();
foreach ($a_detail as $data) {
if (!isset($a_status[$data['Status']])) {
$a_status[$data['Status']] = 0;
}
$a_status[$data['Status']] += $data['End'] - $data['Start'];
}
echo "<tr class='tab_bg_1'>";
if ($type == 'group') {
echo "<td>" . Dropdown::getDropdownName("glpi_groups", $items_id) . "</td>";
} else {
if ($type == 'user') {
echo "<td>" . Dropdown::getDropdownName("glpi_users", $items_id) . "</td>";
}
}
foreach ($list_status as $status => $name) {
echo "<td>";
if (isset($a_status[$status])) {
echo Html::timestampToString($a_status[$status], true);
}
echo "</td>";
}
echo "</tr>";
}
echo "</table>";
}
示例5: listSpecialDropdown
/**
* return the content of hardcoded dropdown
*
* @param $name of the dropdown
*
* @return array (or false if unknown name)
**/
private static function listSpecialDropdown($name = '')
{
global $CFG_GLPI;
$resp = array();
switch (strtolower($name)) {
case 'ticketstatus':
$tab = Ticket::getAllStatusArray();
foreach ($tab as $id => $label) {
$resp[] = array('id' => $id, 'name' => $label);
}
break;
case 'ticketurgency':
for ($i = 1; $i <= 5; $i++) {
if ($i == 3 || $CFG_GLPI['urgency_mask'] & 1 << $i) {
$resp[] = array('id' => $i, 'name' => Ticket::getUrgencyName($i));
}
}
break;
case 'ticketimpact':
for ($i = 1; $i <= 5; $i++) {
if ($i == 3 || $CFG_GLPI['impact_mask'] & 1 << $i) {
$resp[] = array('id' => $i, 'name' => Ticket::getImpactName($i));
}
}
break;
case 'tickettype':
foreach (array(Ticket::INCIDENT_TYPE, Ticket::DEMAND_TYPE) as $type) {
$resp[] = array('id' => $type, 'name' => Ticket::getTicketTypeName($type));
}
break;
case 'ticketpriority':
for ($i = 1; $i <= 5; $i++) {
$resp[] = array('id' => $i, 'name' => Ticket::getPriorityName($i));
}
break;
case 'ticketglobalvalidation':
$tab = TicketValidation::getAllStatusArray(false, true);
foreach ($tab as $id => $label) {
$resp[] = array('id' => $id, 'name' => $label);
}
break;
case 'ticketvalidationstatus':
$tab = TicketValidation::getAllStatusArray();
foreach ($tab as $id => $label) {
$resp[] = array('id' => $id, 'name' => $label);
}
break;
default:
$resp = false;
}
return $resp;
}
示例6: methodListTickets
//.........这里部分代码省略.........
}
// restrict to recipient parameter
$where = " AND `users_id_recipient`='" . $params['recipient'] . "'";
}
// Mine (user or recipient for the ticket)
if (isset($params['mine'])) {
$where = " AND (`glpi_tickets_users_request`.`users_id` = '" . Session::getLoginUserID() . "'\n OR `users_id_recipient` = '" . Session::getLoginUserID() . "')";
}
// Mygroups
if (isset($param['mygroups'])) {
$where = " AND `glpi_groups_tickets`.`groups_id`\n IN (" . implode(',', $_SESSION['glpigroups']) . ")";
}
// Entity
if (isset($params['entity'])) {
if (!Session::haveAccessToEntity($params['entity'])) {
return self::Error($protocol, WEBSERVICES_ERROR_NOTALLOWED, '', 'entity');
}
$where = getEntitiesRestrictRequest("WHERE", "glpi_tickets", '', $params['entity']) . $where;
} else {
$where = getEntitiesRestrictRequest("WHERE", "glpi_tickets") . $where;
}
// Category
if (isset($params['category'])) {
if (!is_numeric($params['category']) || $params['category'] <= 0) {
return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'category');
}
$where .= " AND " . getRealQueryForTreeItem("glpi_itilcategories", $params['category'], "glpi_tickets.itilcategories_id");
}
if (isset($params['approval']) || isset($params['approver'])) {
$join .= "INNER JOIN `glpi_ticketvalidations`\n ON (`glpi_tickets`.`id` = `glpi_ticketvalidations`.`tickets_id` ) ";
if (isset($params['approver']) && is_numeric($params['approver'])) {
$where .= " AND `glpi_ticketvalidations`.`users_id_validate`=" . $params['approver'];
}
$tabstatus = TicketValidation::getAllStatusArray();
if (isset($params['approval']) && isset($tabstatus[$params['approval']])) {
$where .= " AND `glpi_ticketvalidations`.`status`='" . $params['approval'] . "'";
}
}
if (isset($params['satisfaction'])) {
$join .= "INNER JOIN `glpi_ticketsatisfactions`\n ON (`glpi_tickets`.`id` = `glpi_ticketsatisfactions`.`tickets_id` ) ";
switch ($params['satisfaction']) {
case 1:
$where .= " AND `glpi_ticketsatisfactions`.`date_answered` IS NULL";
break;
case 2:
$where .= " AND `glpi_ticketsatisfactions`.`date_answered` IS NOT NULL";
break;
default:
// survey exists (by Inner Join)
}
$params['status'] = Ticket::CLOSED;
}
// Status
if (isset($params['status'])) {
if (!in_array($params['status'], Ticket::getAllowedStatusArray(true))) {
return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'status');
}
switch ($params['status']) {
case 'all':
// No restriction
break;
case 'notclosed':
$status = Ticket::getAllStatusArray();
unset($status[CLOSED]);
$where .= " AND `glpi_tickets`.`status` IN ('" . implode("','", $status) . "') ";
break;
示例7: getTags
function getTags()
{
global $LANG;
//Locales
$tags = array('ticket.id' => $LANG['common'][2], 'ticket.title' => $LANG['common'][16], 'ticket.url' => $LANG['common'][94], 'ticket.entity' => $LANG['entity'][0], 'ticket.category' => $LANG['common'][36], 'ticket.content' => $LANG['joblist'][6], 'ticket.description' => $LANG['mailing'][5], 'ticket.status' => $LANG['joblist'][0], 'ticket.type' => $LANG['common'][17], 'ticket.creationdate' => $LANG['reports'][60], 'ticket.closedate' => $LANG['reports'][61], 'ticket.solvedate' => $LANG['reports'][64], 'ticket.sla' => $LANG['sla'][1], 'ticket.duedate' => $LANG['sla'][5], 'ticket.requesttype' => $LANG['job'][44], 'ticket.authors' => $LANG['job'][18], 'author.id' => $LANG['common'][2] . ' ' . $LANG['job'][4], 'author.name' => $LANG['job'][4], 'author.location' => $LANG['common'][15], 'author.phone' => $LANG['help'][35], 'author.phone2' => $LANG['help'][35] . ' 2', 'ticket.openbyuser' => $LANG['common'][37], 'ticket.groups' => $LANG['common'][53] . " : " . $LANG['common'][35], 'ticket.assigntousers' => $LANG['job'][5] . " - " . $LANG['job'][3], 'ticket.assigntogroups' => $LANG['job'][5] . " - " . $LANG['Menu'][36], 'ticket.assigntosupplier' => $LANG['job'][5] . " - " . $LANG['financial'][26], 'ticket.observergroups' => $LANG['common'][104] . " - " . $LANG['Menu'][36], 'ticket.observerusers' => $LANG['common'][104] . " - " . $LANG['Menu'][14], 'ticket.itemtype' => $LANG['reports'][12], 'ticket.item.name' => $LANG['financial'][104], 'ticket.item.serial' => $LANG['common'][19], 'ticket.item.otherserial' => $LANG['common'][20], 'ticket.item.location' => $LANG['common'][15], 'ticket.item.model' => $LANG['common'][22], 'ticket.item.contact' => $LANG['common'][18], 'ticket.item.contactnumber' => $LANG['common'][21], 'ticket.item.user' => $LANG['common'][34], 'ticket.item.group' => $LANG['common'][35], 'ticket.urgency' => $LANG['joblist'][29], 'ticket.impact' => $LANG['joblist'][30], 'ticket.priority' => $LANG['joblist'][2], 'ticket.time' => $LANG['job'][20], 'ticket.costtime' => $LANG['job'][40], 'ticket.costfixed' => $LANG['job'][41], 'ticket.costmaterial' => $LANG['job'][42], 'ticket.solution.type' => $LANG['job'][48], 'ticket.solution.description' => $LANG['jobresolution'][1], 'task.author' => $LANG['common'][37], 'task.isprivate' => $LANG['common'][77], 'task.date' => $LANG['reports'][60], 'task.description' => $LANG['joblist'][6], 'task.category' => $LANG['common'][36], 'task.time' => $LANG['job'][20], 'task.planning.user' => $LANG['common'][95], 'task.planning.begin' => $LANG['search'][8], 'task.planning.end' => $LANG['search'][9], 'task.planning.status' => $LANG['joblist'][0], 'followup.date' => $LANG['reports'][60], 'followup.isprivate' => $LANG['common'][77], 'followup.author' => $LANG['common'][37], 'followup.description' => $LANG['joblist'][6], 'followup.requesttype' => $LANG['job'][44], 'ticket.numberoffollowups' => $LANG['mailing'][4], 'ticket.numberoftasks' => $LANG['mailing'][122], 'ticket.numberoflinkedtickets' => $LANG['job'][55] . " - " . $LANG['tracking'][29], 'ticket.action' => $LANG['mailing'][119], 'ticket.autoclose' => $LANG['entity'][18], 'ticket.globalvalidation' => $LANG['validation'][25]);
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'events' => NotificationTarget::TAG_FOR_ALL_EVENTS));
}
//Events specific for validation
$tags = array('validation.author' => $LANG['job'][4], 'validation.status' => $LANG['validation'][28], 'validation.submissiondate' => $LANG['validation'][3], 'validation.commentsubmission' => $LANG['validation'][5], 'validation.validationdate' => $LANG['validation'][4], 'validation.validator' => $LANG['validation'][21], 'validation.commentvalidation' => $LANG['validation'][6]);
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'events' => array('validation')));
}
//Tags without lang for validation
$tags = array('validation.submission.title' => $LANG['validation'][27], 'validation.answer.title' => $LANG['validation'][32]);
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => false, 'events' => array('validation')));
}
// Events for ticket satisfaction
$tags = array('satisfaction.datebegin' => $LANG['satisfaction'][6], 'satisfaction.dateanswered' => $LANG['satisfaction'][4], 'satisfaction.satisfactionlevel' => $LANG['satisfaction'][7], 'satisfaction.satisfactioncomment' => $LANG['satisfaction'][8]);
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'events' => array('satisfaction')));
}
$tags = array('satisfaction.type' => $LANG['satisfaction'][9] . " - " . $LANG['satisfaction'][10]);
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => false, 'events' => array('satisfaction')));
}
$tags = array('satisfaction.text' => $LANG['satisfaction'][12]);
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'lang' => true, 'events' => array('satisfaction')));
}
//Foreach global tags
$tags = array('followups' => $LANG['mailing'][141], 'tasks' => $LANG['mailing'][142], 'log' => $LANG['mailing'][144], 'validations' => $LANG['mailing'][143], 'linkedtickets' => $LANG['job'][55], 'authors' => $LANG['job'][18]);
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'foreach' => true));
}
//Tags with just lang
$tags = array('ticket.days' => $LANG['stats'][31], 'ticket.linkedtickets' => $LANG['job'][55], 'ticket.autoclosewarning' => $LANG['job'][54] . " ? " . $LANG['stats'][31], 'ticket.attribution' => $LANG['job'][5], 'ticket.nocategoryassigned' => $LANG['mailing'][100]);
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'lang' => true));
}
//Foreach tag for alertnotclosed
$this->addTagToList(array('tag' => 'tickets', 'label' => $LANG['crontask'][15], 'value' => false, 'foreach' => true, 'events' => array('alertnotclosed')));
//Tags without lang
$tags = array('ticket.log.date' => $LANG['mailing'][144] . ' : ' . $LANG['common'][26], 'ticket.log.user' => $LANG['mailing'][144] . ' : ' . $LANG['common'][34], 'ticket.log.field' => $LANG['mailing'][144] . ' : ' . $LANG['event'][18], 'ticket.log.content' => $LANG['mailing'][144] . ' : ' . $LANG['event'][19], 'ticket.urlapprove' => $LANG['document'][33] . ' ' . $LANG['job'][51], 'ticket.urlvalidation' => $LANG['document'][33] . ' ' . $LANG['validation'][26], 'ticket.urlsatisfaction' => $LANG['document'][33] . ' ' . $LANG['satisfaction'][0], 'linkedticket.id' => $LANG['job'][55] . " - " . $LANG['common'][2], 'linkedticket.link' => $LANG['job'][55] . " - " . $LANG['setup'][620], 'linkedticket.url' => $LANG['job'][55] . " - " . $LANG['common'][94], 'linkedticket.title' => $LANG['job'][55] . " - " . $LANG['common'][16], 'linkedticket.content' => $LANG['job'][55] . " - " . $LANG['joblist'][6]);
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => false));
}
//Tickets with a fixed set of values
$status = Ticket::getAllStatusArray(false);
$allowed_ticket = $allowed_validation = array();
foreach ($status as $key => $value) {
$allowed_ticket[] = $key;
}
$status = TicketValidation::getAllStatusArray(false, true);
foreach ($status as $key => $value) {
$allowed_validation[] = $key;
}
$tags = array('ticket.storestatus' => array('text' => $LANG['joblist'][36], 'allowed_values' => $allowed_ticket), 'validation.validationstatus' => array('text' => $LANG['joblist'][36], 'allowed_values' => $allowed_validation));
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label['text'], 'value' => true, 'lang' => false, 'allowed_values' => $label['allowed_values']));
}
asort($this->tag_descriptions);
}
示例8: showFormLifeCycle
/**
* Print the Life Cycles form for the current profile
*
* @param $openform boolean open the form (true by default)
* @param $closeform boolean close the form (true by default)
**/
function showFormLifeCycle($openform = true, $closeform = true)
{
if (!Session::haveRight("profile", "r")) {
return false;
}
if (($canedit = Session::haveRight("profile", "w")) && $openform) {
echo "<form method='post' action='" . $this->getFormURL() . "'>";
}
echo "<div class='spaced'>";
echo "<table class='tab_cadre_fixe'>";
$tabstatus = Ticket::getAllStatusArray();
echo "<th colspan='" . (count($tabstatus) + 1) . "'>" . __('Life cycle of tickets') . "</th>";
//TRANS: \ to split row heading (From) and colums headin (To) for life cycles
echo "<tr class='tab_bg_1'><td class='b center'>" . __("From \\ To");
echo "<input type='hidden' name='_cycles_ticket' value='1'</td>";
foreach ($tabstatus as $label) {
echo "<td class='center'>{$label}</td>";
}
echo "</tr>\n";
foreach ($tabstatus as $from => $label) {
echo "<tr class='tab_bg_2'><td class='tab_bg_1'>{$label}</td>";
foreach ($tabstatus as $dest => $label) {
echo "<td class='center'>";
if ($dest == $from) {
echo Dropdown::getYesNo(1);
} else {
Dropdown::showYesNo("_cycle_ticket[{$from}][{$dest}]", !isset($this->fields['ticket_status'][$from][$dest]) || $this->fields['ticket_status'][$from][$dest]);
}
echo "</td>";
}
echo "</tr>\n";
}
echo "</table>";
echo "<table class='tab_cadre_fixe'>";
$tabstatus = Problem::getAllStatusArray();
echo "<th colspan='" . (count($tabstatus) + 1) . "'>" . __('Life cycle of problems') . "</th>";
echo "<tr class='tab_bg_1'><td class='b center'>" . __('From \\ To');
echo "<input type='hidden' name='_cycles_problem' value='1'</td>";
foreach ($tabstatus as $label) {
echo "<td class='center'>{$label}</td>";
}
echo "</tr>\n";
foreach ($tabstatus as $from => $label) {
echo "<tr class='tab_bg_2'><td class='tab_bg_1'>{$label}</td>";
foreach ($tabstatus as $dest => $label) {
echo "<td class='center'>";
if ($dest == $from) {
echo Dropdown::getYesNo(1);
} else {
Dropdown::showYesNo("_cycle_problem[{$from}][{$dest}]", !isset($this->fields['problem_status'][$from][$dest]) || $this->fields['problem_status'][$from][$dest]);
}
echo "</td>";
}
echo "</tr>\n";
}
echo "</table>";
echo "<table class='tab_cadre_fixe'>";
$tabstatus = Change::getAllStatusArray();
// echo "<th colspan='".(count($tabstatus)+1)."'>".__('Life cycle of changes')."</th>";
// echo "<tr class='tab_bg_1'><td class='b center'>".__('From \ To');
// echo "<input type='hidden' name='_cycles_change' value='1'</td>";
// foreach ($tabstatus as $label) {
// echo "<td class='center'>$label</td>";
// }
// echo "</tr>\n";
//
// foreach ($tabstatus as $from => $label) {
// echo "<tr class='tab_bg_2'><td class='tab_bg_1'>$label</td>";
// foreach ($tabstatus as $dest => $label) {
// echo "<td class='center'>";
// if ($dest == $from) {
// echo Dropdown::getYesNo(1);
// } else {
// Dropdown::showYesNo("_cycle_change[$from][$dest]",
// (!isset($this->fields['change_status'][$from][$dest])
// || $this->fields['change_status'][$from][$dest]));
// }
// echo "</td>";
// }
// echo "</tr>\n";
// }
if ($canedit && $closeform) {
echo "<tr class='tab_bg_1'>";
echo "<td colspan='" . (count($tabstatus) + 1) . "' class='center'>";
echo "<input type='hidden' name='id' value='" . $this->fields['id'] . "'>";
echo "<input type='submit' name='update' value=\"" . _sx('button', 'Save') . "\" class='submit'>";
echo "</td></tr>\n";
echo "</table>\n";
Html::closeForm();
} else {
echo "</table>\n";
}
echo "</div>";
}
示例9: selectorAllstates
/**
* Show the selector for tickets status (new, open, solved, closed...)
*/
static function selectorAllstates()
{
global $LANG;
echo "<b>" . $LANG['plugin_mreporting']['selector']["status"] . " : </b><br />";
$default = array('1', '2', '3', '4');
foreach (Ticket::getAllStatusArray() as $value => $name) {
echo '<label>';
echo '<input type="hidden" name="status_' . $value . '" value="0" /> ';
echo '<input type="checkbox" name="status_' . $value . '" value="1"';
if (isset($_REQUEST['status_' . $value]) && $_REQUEST['status_' . $value] == '1' || !isset($_REQUEST['status_' . $value]) && in_array($value, $default)) {
echo ' checked="checked"';
}
echo ' /> ';
echo $name;
echo '</label>';
}
}
示例10: showFormTracking
//.........这里部分代码省略.........
Dropdown::showYesNo("steal_ticket", $this->fields["steal_ticket"]);
echo "</td>";
echo "<td>" . $LANG['profiles'][19] . " :</td><td>";
Dropdown::showYesNo("assign_ticket", $this->fields["assign_ticket"]);
echo "</td></tr>\n";
echo "<tr class='tab_bg_5'><th colspan='6'>" . $LANG['profiles'][42] . "</th>";
echo "</tr>\n";
echo "<tr class='tab_bg_2'>";
echo "<td>" . $LANG['profiles'][27] . " :</td><td>";
Dropdown::showYesNo("show_group_hardware", $this->fields["show_group_hardware"]);
echo "</td>";
echo "<td>" . $LANG['setup'][350] . " :</td>";
echo "\n<td><select name='helpdesk_hardware'>";
echo "<option value='0' " . ($this->fields["helpdesk_hardware"] == 0 ? "selected" : "") . " >" . DROPDOWN_EMPTY_VALUE . "</option>\n";
echo "<option value=\"" . pow(2, HELPDESK_MY_HARDWARE) . "\" " . ($this->fields["helpdesk_hardware"] == pow(2, HELPDESK_MY_HARDWARE) ? "selected" : "") . " >" . $LANG['tracking'][1] . "</option>\n";
echo "<option value=\"" . pow(2, HELPDESK_ALL_HARDWARE) . "\" " . ($this->fields["helpdesk_hardware"] == pow(2, HELPDESK_ALL_HARDWARE) ? "selected" : "") . " >" . $LANG['setup'][351] . "</option>\n";
echo "<option value=\"" . (pow(2, HELPDESK_MY_HARDWARE) + pow(2, HELPDESK_ALL_HARDWARE)) . "\" " . ($this->fields["helpdesk_hardware"] == pow(2, HELPDESK_MY_HARDWARE) + pow(2, HELPDESK_ALL_HARDWARE) ? "selected" : "") . " >" . $LANG['tracking'][1] . " + " . $LANG['setup'][351] . "</option>";
echo "</select></td>\n";
echo "<td>" . $LANG['setup'][352] . " :</td>";
echo "<td><input type='hidden' name='_helpdesk_item_types' value='1'>";
echo "<select name='helpdesk_item_type[]' multiple size='3'>";
foreach ($CFG_GLPI["ticket_types"] as $key => $itemtype) {
if (class_exists($itemtype)) {
if (!isPluginItemType($itemtype)) {
// No Plugin for the moment
$item = new $itemtype();
echo "<option value='" . $itemtype . "' " . (in_array($itemtype, $this->fields["helpdesk_item_type"]) ? " selected" : "") . ">" . $item->getTypeName() . "</option>\n";
}
} else {
unset($CFG_GLPI["ticket_types"][$key]);
}
}
echo "</select></td>";
echo "</tr>\n";
echo "<tr class='tab_bg_5'><th colspan='6'>" . $LANG['profiles'][38] . "</th>";
echo "</tr>\n";
echo "<tr class='tab_bg_2'>";
echo "<td>" . $LANG['profiles'][32] . " :</td><td>";
Dropdown::showYesNo("show_assign_ticket", $this->fields["show_assign_ticket"]);
echo "</td>";
echo "<td>" . $LANG['profiles'][26] . " :</td><td>";
Dropdown::showYesNo("show_group_ticket", $this->fields["show_group_ticket"]);
echo "</td>";
echo "<td>" . $LANG['profiles'][7] . " :</td><td>";
Dropdown::showYesNo("show_all_ticket", $this->fields["show_all_ticket"]);
echo "</td></tr>\n";
echo "<tr class='tab_bg_2'>";
echo "<td>" . $LANG['profiles'][9] . " :</td><td>";
Dropdown::showYesNo("observe_ticket", $this->fields["observe_ticket"]);
echo "</td>";
echo "<td>" . $LANG['profiles'][8] . " :</td><td>";
Dropdown::showYesNo("show_full_ticket", $this->fields["show_full_ticket"]);
echo "</td>";
echo "<td>" . $LANG['Menu'][13] . " :</td><td>";
Dropdown::showYesNo("statistic", $this->fields["statistic"]);
echo "</td></tr>\n";
echo "<tr class='tab_bg_2'>";
echo "<td>" . $LANG['profiles'][20] . " :</td><td>";
Dropdown::showYesNo("show_planning", $this->fields["show_planning"]);
echo "</td>";
echo "<td>" . $LANG['profiles'][36] . " :</td><td>";
Dropdown::showYesNo("show_group_planning", $this->fields["show_group_planning"]);
echo "</td>";
echo "<td>" . $LANG['profiles'][21] . " :</td><td>";
Dropdown::showYesNo("show_all_planning", $this->fields["show_all_planning"]);
echo "</td></tr>\n";
echo "</table><br><table class='tab_cadre_fixe'>";
$tabstatus = Ticket::getAllStatusArray();
echo "<th colspan='" . (count($tabstatus) + 1) . "'>" . $LANG['setup'][615] . "</th>";
echo "<tr class='tab_bg_1'><td class='b center'>" . $LANG['setup'][616];
echo "<input type='hidden' name='_cycles' value='1'</td>";
foreach ($tabstatus as $label) {
echo "<td class='center'>{$label}</td>";
}
echo "</tr>\n";
foreach ($tabstatus as $from => $label) {
echo "<tr class='tab_bg_2'><td class='tab_bg_1'>{$label}</td>";
foreach ($tabstatus as $dest => $label) {
echo "<td class='center'>";
if ($dest == $from) {
echo Dropdown::getYesNo(1);
} else {
Dropdown::showYesNo("_cycle[{$from}][{$dest}]", !isset($this->fields['helpdesk_status'][$from][$dest]) || $this->fields['helpdesk_status'][$from][$dest]);
}
echo "</td>";
}
echo "</tr>\n";
}
if ($canedit && $closeform) {
echo "<tr class='tab_bg_1'>";
echo "<td colspan='" . (count($tabstatus) + 1) . "' class='center'>";
echo "<input type='hidden' name='id' value={$ID}>";
echo "<input type='submit' name='update' value=\"" . $LANG['buttons'][7] . "\" class='submit'>";
echo "</td></tr>\n";
echo "</table></form>\n";
} else {
echo "</table>\n";
}
echo "</div>";
}