Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX select on ticket list for fields group and severity (issue #31619) #32121

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions htdocs/core/class/html.formticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,12 @@
if ($public) {
$filter = '(public:=:1)';
}
$this->selectGroupTickets($category_code, 'category_code', $filter, 2, 1, 0, 0, 'minwidth200 maxwidth500');
$this->selectGroupTickets($category_code, 'category_code', $filter, 2, 0, 0, 0, 'minwidth200 maxwidth500');
print '</td></tr>';

// Severity => Priority
print '<tr><td><span class="fieldrequired"><label for="selectseverity_code">'.$langs->trans("TicketSeverity").'</span></label></td><td>';
$this->selectSeveritiesTickets($severity_code, 'severity_code', '', 2, 1, 0, 0, 'minwidth200 maxwidth500');
$this->selectSeveritiesTickets($severity_code, 'severity_code', '', 2, 0, 0, 0, 'minwidth200 maxwidth500');
print '</td></tr>';

if (isModEnabled('knowledgemanagement')) {
Expand Down Expand Up @@ -885,6 +885,8 @@
print '<select id="select'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
if ($empty) {
print '<option value="">&nbsp;</option>';
} else {
print '<option value="">--&nbsp;'.$langs->trans('TicketSelectGroup').'&nbsp;--</option>';

Check failure on line 889 in htdocs/core/class/html.formticket.class.php

View workflow job for this annotation

GitHub Actions / pre-commit / pre-commit

Missing translation; print '<option value="">--&nbsp;'.$langs->trans('TicketSelectGroup').'&nbsp;--</option>';
}

if (is_array($ticketstat->cache_category_tickets) && count($ticketstat->cache_category_tickets)) {
Expand Down Expand Up @@ -929,9 +931,9 @@
print ' selected="selected"';
} elseif (isset($selected) && $selected == $id) {
print ' selected="selected"';
} elseif ($arraycategories['use_default'] == "1" && empty($selected)) {
} elseif ($arraycategories['use_default'] == "1" && empty($selected) && !$empty) {
print ' selected="selected"';
} elseif (count($ticketstat->cache_category_tickets) == 1) { // If only 1 choice, we autoselect it
} elseif (count($ticketstat->cache_category_tickets) == 1 && !$empty) { // If only 1 choice, we autoselect it
print ' selected="selected"';
}

Expand Down Expand Up @@ -1238,6 +1240,8 @@
print '<select id="select'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
if ($empty) {
print '<option value="">&nbsp;</option>';
} else {
print '<option value="">--&nbsp;'.$langs->trans('TicketSelectGroup').'&nbsp;--</option>';

Check failure on line 1244 in htdocs/core/class/html.formticket.class.php

View workflow job for this annotation

GitHub Actions / pre-commit / pre-commit

Missing translation; print '<option value="">--&nbsp;'.$langs->trans('TicketSelectGroup').'&nbsp;--</option>';
}

if (is_array($conf->cache['severity_tickets']) && count($conf->cache['severity_tickets'])) {
Expand Down Expand Up @@ -1273,7 +1277,7 @@
print ' selected="selected"';
} elseif (isset($selected) && $selected == $id) {
print ' selected="selected"';
} elseif ($arrayseverities['use_default'] == "1" && empty($selected)) {
} elseif ($arrayseverities['use_default'] == "1" && empty($selected) && !$empty) {
print ' selected="selected"';
}

Expand Down
Loading