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

Transfer _actors input into historical input keys #11957

Merged
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
26386d4
Transfer _actors input into historical input keys
cedric-anne Jun 21, 2022
483966e
WIP
cedric-anne Jun 21, 2022
8f693c6
WIP
cedric-anne Jun 21, 2022
d3dd398
mutualize code
cedric-anne Jun 22, 2022
04c43e6
WIP
cedric-anne Jun 22, 2022
b51783d
Remove dead code
cedric-anne Jun 22, 2022
d340ee3
fixes
cedric-anne Jun 22, 2022
6ebf462
Fix check on notification settings
cedric-anne Jun 22, 2022
7fc2191
fix a test
cedric-anne Jun 22, 2022
b509df6
Check rights on _actors handling
cedric-anne Jun 22, 2022
e24ab54
Prevent notification settings input invalidation by CommonDBTM::filte…
cedric-anne Jun 22, 2022
d73565a
Fix checks
cedric-anne Jun 22, 2022
feac3eb
Fix web tests
cedric-anne Jun 22, 2022
3021266
Remove duplicated line
cedric-anne Jun 22, 2022
d621802
cs
cedric-anne Jun 23, 2022
2991323
Identifiy deleted actors prior to rules execution
cedric-anne Jun 23, 2022
0ff97e6
Fix handling of multiple 'email' actors; fixes #11686
cedric-anne Jun 24, 2022
6f036d1
Fix tests
cedric-anne Jun 24, 2022
76c2697
fix test + fix notification settings format
cedric-anne Jun 24, 2022
756168b
fix duplicate email actor
cedric-anne Jun 24, 2022
18c2056
Expand testCreateTicketWithActors test
cedric-anne Jun 24, 2022
b37da50
Add testUpdateTicketWithActors test
cedric-anne Jun 24, 2022
82c2d1e
Expand tests to use new _actors key
cedric-anne Jun 24, 2022
6c2f7b2
simplify test
cedric-anne Jun 24, 2022
4d6c4cd
Groups have no notification settigns
cedric-anne Jun 24, 2022
f8e8154
Test groups and suppliers
cedric-anne Jun 24, 2022
6b53209
input can contains both unique value or array; test assign rule with …
cedric-anne Jun 24, 2022
ec23da6
Handle empty strings and add warning on invalid actors ids
cedric-anne Jun 24, 2022
d561764
Handle empty values from formcreator
cedric-anne Jun 27, 2022
2ac6de8
Remove warning
cedric-anne Jun 27, 2022
93e8850
Fix deletion of email actors
cedric-anne Jun 27, 2022
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
Prev Previous commit
Next Next commit
WIP
cedric-anne committed Jun 21, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 483966e8ac15f344c0579302f81f48f0009edc71
17 changes: 14 additions & 3 deletions src/CommonITILObject.php
Original file line number Diff line number Diff line change
@@ -590,8 +590,10 @@ protected function setPredefinedFields(ITILTemplate $tt, array &$options, array
public function getEntitiesForRequesters(array $params = [])
{
$requesters = [];
if ($params["_users_id_requester"]) {
$requesters = [$params["_users_id_requester"]];
if (array_key_exists('_users_id_requester', $params) && !empty($params["_users_id_requester"])) {
$requesters = !is_array($params["_users_id_requester"])
? [$params["_users_id_requester"]]
: $params["_users_id_requester"];
}
if (isset($params['_actors']['requester'])) {
foreach ($params['_actors']['requester'] as $actor) {
@@ -1463,6 +1465,7 @@ public function prepareInputForUpdate($input)
$do_not_compute_takeintoaccount = $this->isTakeIntoAccountComputationBlocked($input);

if (isset($input['_itil_requester'])) {
// FIXME Deprecate this input key in GLPI 10.1.
if (isset($input['_itil_requester']['_type'])) {
$input['_itil_requester'] = [
'type' => CommonITILActor::REQUESTER,
@@ -1533,6 +1536,7 @@ public function prepareInputForUpdate($input)
}

if (isset($input['_itil_observer'])) {
// FIXME Deprecate this input key in GLPI 10.1.
if (isset($input['_itil_observer']['_type'])) {
$input['_itil_observer'] = [
'type' => CommonITILActor::OBSERVER,
@@ -1602,6 +1606,7 @@ public function prepareInputForUpdate($input)
}

if (isset($input['_itil_assign'])) {
// FIXME Deprecate this input key in GLPI 10.1.
if (isset($input['_itil_assign']['_type'])) {
$input['_itil_assign'] = [
'type' => CommonITILActor::ASSIGN,
@@ -9256,7 +9261,13 @@ protected function transformActorsInput(array $input): array
continue;
}

$input[$input_key][] = $actor['items_id'];
$value_key = sprintf('_actors_%s', $actor['items_id']);

$input[$input_key][$value_key] = $actor['items_id'];
$input[sprintf('%s_notif', $input_key)][$value_key] = [
'use_notification' => $actor['use_notification'],
'alternative_email' => $actor['alternative_email'],
];
}
}
}