本文整理汇总了PHP中TicketValidation::getAllStatusArray方法的典型用法代码示例。如果您正苦于以下问题:PHP TicketValidation::getAllStatusArray方法的具体用法?PHP TicketValidation::getAllStatusArray怎么用?PHP TicketValidation::getAllStatusArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TicketValidation
的用法示例。
在下文中一共展示了TicketValidation::getAllStatusArray方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTags
function getTags()
{
parent::getTags();
//Locales
$tags = array('ticket.type' => __('Type'), 'ticket.sla' => __('SLA'), 'ticket.requesttype' => __('Request source'), 'ticket.itemtype' => __('Item type'), 'ticket.item.name' => __('Associated item'), 'ticket.item.serial' => __('Serial number'), 'ticket.item.otherserial' => __('Inventory number'), 'ticket.item.location' => sprintf(__('%1$s: %2$s'), _n('Associated element', 'Associated elements', 2), __('Location')), 'ticket.item.model' => __('Model'), 'ticket.item.contact' => __('Alternate username'), 'ticket.item.contactnumber' => __('Alternate username number'), 'ticket.item.user' => __('User'), 'ticket.item.group' => __('Group'), 'ticket.isdeleted' => __('Deleted'), 'followup.date' => __('Opening date'), 'followup.isprivate' => __('Private'), 'followup.author' => __('Writer'), 'followup.description' => __('Description'), 'followup.requesttype' => __('Request source'), 'ticket.numberoffollowups' => _x('quantity', 'Number of followups'), 'ticket.numberoflinkedtickets' => _x('quantity', 'Number of linked tickets'), 'ticket.numberofproblems' => _x('quantity', 'Number of problems'), 'ticket.numberofchanges' => _x('quantity', 'Number of changes'), 'ticket.numberofitems' => _x('quantity', 'Number of items'), 'ticket.autoclose' => __('Automatic closing of solved tickets after'), 'ticket.location' => __('Location'), 'ticket.globalvalidation' => __('Global approval status'), 'ticket.solution.approval.description' => __('Solution rejection comment'), 'ticket.solution.approval.date' => __('Solution rejection date'), 'ticket.solution.approval.author' => __('Approver'));
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' => __('Requester'), 'validation.status' => __('Status of the approval request'), 'validation.submissiondate' => sprintf(__('%1$s: %2$s'), __('Request'), __('Date')), 'validation.commentsubmission' => sprintf(__('%1$s: %2$s'), __('Request'), __('Comments')), 'validation.validationdate' => sprintf(__('%1$s: %2$s'), __('Validation'), __('Date')), 'validation.validator' => __('Decision-maker'), 'validation.commentvalidation' => sprintf(__('%1$s: %2$s'), __('Validation'), __('Comments')));
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'events' => array('validation', 'validation_answer')));
}
//Tags without lang for validation
$tags = array('validation.submission.title' => __('A validation request has been submitted'), 'validation.answer.title' => __('An answer to a validation request was produced'));
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => false, 'events' => array('validation', 'validation_answer')));
}
// Events for ticket satisfaction
$tags = array('satisfaction.datebegin' => __('Creation date of the satisfaction survey'), 'satisfaction.dateanswered' => __('Response date to the satisfaction survey'), 'satisfaction.satisfaction' => __('Satisfaction'), 'satisfaction.description' => __('Comments to the satisfaction survey'));
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'events' => array('satisfaction')));
}
$tags = array('satisfaction.type' => __('Survey type'));
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => false, 'events' => array('satisfaction')));
}
$tags = array('satisfaction.text' => __('Invitation to fill out the survey'));
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' => _n('Followup', 'Followups', Session::getPluralNumber()), 'validations' => _n('Validation', 'Validations', Session::getPluralNumber()), 'linkedtickets' => _n('Linked ticket', 'Linked tickets', Session::getPluralNumber()), 'problems' => _n('Problem', 'Problems', Session::getPluralNumber()), 'changes' => _n('Change', 'Changes', Session::getPluralNumber()), 'items' => _n('Associated item', 'Associated items', Session::getPluralNumber()), 'documents' => _n('Document', 'Documents', Session::getPluralNumber()));
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'foreach' => true));
}
//Tags with just lang
$tags = array('ticket.linkedtickets' => _n('Linked ticket', 'Linked tickets', Session::getPluralNumber()), 'ticket.problems' => _n('Problem', 'Problems', Session::getPluralNumber()), 'ticket.changes' => _n('Change', 'Changes', Session::getPluralNumber()), 'ticket.autoclosewarning' => sprintf(_n('Without a reply, the ticket will be automatically closed after %s day', 'Without a reply, the ticket will be automatically closed after %s days', 2), '?'));
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' => __('Not solved tickets'), 'value' => false, 'foreach' => true, 'events' => array('alertnotclosed')));
//Tags without lang
$tags = array('ticket.urlvalidation' => sprintf(__('%1$s: %2$s'), __('Validation request'), __('URL')), 'ticket.urlsatisfaction' => sprintf(__('%1$s: %2$s'), __('Satisfaction'), __('URL')), 'linkedticket.id' => sprintf(__('%1$s: %2$s'), _n('Linked ticket', 'Linked tickets', 1), __('ID')), 'linkedticket.link' => sprintf(__('%1$s: %2$s'), _n('Linked ticket', 'Linked tickets', 1), __('Link')), 'linkedticket.url' => sprintf(__('%1$s: %2$s'), _n('Linked ticket', 'Linked tickets', 1), __('URL')), 'linkedticket.title' => sprintf(__('%1$s: %2$s'), _n('Linked ticket', 'Linked tickets', 1), __('Title')), 'linkedticket.content' => sprintf(__('%1$s: %2$s'), _n('Linked ticket', 'Linked tickets', 1), __('Description')), 'problem.id' => sprintf(__('%1$s: %2$s'), __('Problem'), __('ID')), 'problem.date' => sprintf(__('%1$s: %2$s'), __('Problem'), __('Date')), 'problem.url' => sprintf(__('%1$s: %2$s'), __('Problem'), 'URL'), 'problem.title' => sprintf(__('%1$s: %2$s'), __('Problem'), __('Title')), 'problem.content' => sprintf(__('%1$s: %2$s'), __('Problem'), __('Description')), 'change.id' => sprintf(__('%1$s: %2$s'), __('Change'), __('ID')), 'change.date' => sprintf(__('%1$s: %2$s'), __('Change'), __('Date')), 'change.url' => sprintf(__('%1$s: %2$s'), __('Change'), 'URL'), 'change.title' => sprintf(__('%1$s: %2$s'), __('Change'), __('Title')), 'change.content' => sprintf(__('%1$s: %2$s'), __('Change'), __('Description')));
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => false));
}
//Tickets with a fixed set of values
$allowed_validation = array();
$status = TicketValidation::getAllStatusArray(false, true);
foreach ($status as $key => $value) {
$allowed_validation[] = $key;
}
$tags = array('validation.validationstatus' => array('text' => __('Status value in database'), '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);
}
示例2: 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;
示例3: 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;
}
示例4: 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);
}