Skip to content

Commit

Permalink
feat(core): add options to display ITIL Category question
Browse files Browse the repository at this point in the history
  • Loading branch information
stonebuzz authored and btry committed Oct 29, 2018
1 parent d7b6dc8 commit f20acbf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 9 additions & 0 deletions inc/fields/dropdownfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ public function displayField($canEdit = true) {
case 'incident':
$dparams['condition'] .= " AND `is_incident` = '1'";
break;
case 'both':
$dparams['condition'] .= " AND `is_incident` = '1' OR `is_request` = '1' ";
break;
case 'change':
$dparams['condition'] .= " AND `is_change` = '1'";
break;
case 'all':
$dparams['condition'] .= " AND `is_change` = '1' OR `is_incident` = '1' OR `is_request` = '1'";
break;
}
if (isset($decodedValues['show_ticket_categories_depth'])
&& $decodedValues['show_ticket_categories_depth'] > 0) {
Expand Down
8 changes: 5 additions & 3 deletions inc/question.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -934,9 +934,11 @@ function plugin_formcreator_hideAllParameters() {
echo '</td>';
echo '<td>';
$ticketCategoriesOptions = [
'request' => __('Request categories', 'formcreator'),
'incident' => __('Incident categories', 'formcreator'),
'both' => __('Both', 'formcreator'),
'request' => __('Request categories', 'formcreator'),
'incident' => __('Incident categories', 'formcreator'),
'both' => __('Request categories', 'formcreator'). " + ".__('Incident categories', 'formcreator'),
'change' => __('Change'),
'all' => __('All'),
];
dropdown::showFromArray('show_ticket_categories', $ticketCategoriesOptions, [
'rand' => $rand,
Expand Down

0 comments on commit f20acbf

Please sign in to comment.