-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add _do_not_compute_takeintoaccount in Common Task #18527
base: 10.0/bugfixes
Are you sure you want to change the base?
Conversation
Co-authored-by: Johan Cwiklinski <trasher@x-tnd.be>
That probably requires a test |
Co-authored-by: Stanislas <skita@teclib.com>
Co-authored-by: Stanislas <skita@teclib.com>
Can you ask the customer to test ? |
src/CommonITILObject.php
Outdated
@@ -5210,6 +5210,11 @@ public function updateDateMod($ID, $no_stat_computation = false, $users_id_lastu | |||
$update['users_id_lastupdater'] = $users_id_lastupdater; | |||
} | |||
|
|||
// set take into account delay stat | |||
if ($no_stat_computation && $this->getType() == Ticket::class) { | |||
$update['takeintoaccount_delay_stat'] = 0; |
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.
IMHO, we should not force the value here. takeintoaccount_delay_stat
may have already been defined by a previous action.
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.
Like that it's okay ?
if ($this->fields['takeintoaccount_delay_stat'] == 0) {
$update['takeintoaccount_delay_stat'] = 0;
}
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.
I am not sure to understand what you are trying to do. Also, the ticket specific case should probably be managed in the Ticker::updateDateMod()
override.
if ($this->fields['takeintoaccount_delay_stat'] == 0) { | ||
$update['takeintoaccount_delay_stat'] = 0; | ||
} |
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.
As explained in the internal chat, this code does not make sense to me. If $this->fields['takeintoaccount_delay_stat']
equals 0
, why should we update it to the same value ?
Also, $no_stat_computation
probably means that we should not change the value of the takeintoaccount_delay_stat
field, even if we set it to 0
.
@@ -650,7 +650,7 @@ public function post_addItem() | |||
} | |||
} | |||
|
|||
$this->input["_job"]->updateDateMod($this->input[$this->input["_job"]->getForeignKeyField()]); | |||
$this->input["_job"]->updateDateMod($this->input[$this->input["_job"]->getForeignKeyField()], $this->input['_do_not_compute_takeintoaccount'] ?? false); |
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.
This change should probably de done to all the calls to updateDateMod
. This same ability to not alter SLA/OLA stats will probably be usefull for other actions, like adding an actor, updating a task, adding an automatic followup, ...
Checklist before requesting a review
Please delete options that are not relevant.
Description
Added verification of the presence of the _do_not_compute_takeintoaccount field to the CommonITILTask class to enable the escalation task not to terminate the SLA / OLA TTO
Screenshots (if appropriate):