-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
18.0 fix select type on ticket list #32120
Conversation
1ff6074
to
a538388
Compare
i will try your fix on my dolibarr :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok for me
Sorry but I have changed my point of view and I revert my review. |
@@ -753,7 +755,7 @@ public function selectTypesTickets($selected = '', $htmlname = 'tickettype', $fi | |||
print ' selected="selected"'; | |||
} elseif (in_array($id, $selected)) { | |||
print ' selected="selected"'; | |||
} elseif ($arraytypes['use_default'] == "1" && empty($selected)) { | |||
} elseif ($arraytypes['use_default'] == "1" && empty($selected) && !$empty) { | |||
print ' selected="selected"'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the test !$empty should be replace with a specific list mode using multiselect
2f0d375
to
8565296
Compare
htdocs/ticket/card.php
Outdated
$object->type_code = GETPOST('update_value_type', 'aZ09'); | ||
$object->severity_code = GETPOST('update_value_severity', 'aZ09'); | ||
$object->category_code = GETPOST('update_value_category', 'aZ09'); | ||
if (!GETPOST("update_value_type", 'alpha')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry but I have changed my point of view and I revert my review. There still exist a problem when you edit the type field, you can reset the value if you select "-- Select type --" value. However this field must be mandatory.
This is due to the fact that these fields are not checked before updating.
The right way to fix this would be to use a function Ticket::validate() in create() and update(). But this function does not exist in DLB18 (I did not look after).
So I implemented a control in line with the code for ticket creation.
8565296
to
f5c715c
Compare
FIX Select type in ticket list
see issue #31619 (issue mentions 20.0 ; I confirm on 18.0 and develop)
We have a problem on ticket type selection :
The function selectTypesTickets deals with many cases when
$selected
is empty :To illustrate the problem on ticket list search field, when I load ticket/list.php (or do a search without setting the field for ticket type), the search field for type is set to default by DLB :
This means that I have to remove this field each time I do a new search.
This PR :
As a consequence :