@@ -232,18 +232,10 @@ private static function addGroupsForActorType(CommonDBTM $item, Config $moconfig
232232 $ criteria = [
233233 'groups_id ' => $ user ->fields ['groups_id ' ],
234234 $ idField => $ object ->fields ['id ' ],
235+ 'type ' => $ actorType ,
235236 ];
236237
237- // Add type for assigned technicians
238- if ($ actorType == \CommonITILActor::ASSIGN ) {
239- $ criteria ['type ' ] = \CommonITILActor::ASSIGN ;
240- }
241-
242238 if (!$ t_group ->getFromDBByCrit ($ criteria )) {
243- if ($ actorType == \CommonITILActor::ASSIGN ) {
244- $ criteria ['type ' ] = \CommonITILActor::ASSIGN ;
245- }
246-
247239 $ t_group ->add ($ criteria );
248240 }
249241 } else {
@@ -261,23 +253,16 @@ private static function addGroupsForActorType(CommonDBTM $item, Config $moconfig
261253 $ criteria = [
262254 'groups_id ' => $ ug ['groups_id ' ],
263255 $ idField => $ object ->fields ['id ' ],
256+ 'type ' => $ actorType ,
264257 ];
265258
266- // Add type for assigned technicians
267- if ($ actorType == \CommonITILActor::ASSIGN ) {
268- $ criteria ['type ' ] = \CommonITILActor::ASSIGN ;
269- }
270-
271259 if (!$ t_group ->getFromDBByCrit ($ criteria )) {
272260 $ groupData = [
273261 'groups_id ' => $ ug ['groups_id ' ],
274262 $ idField => $ object ->fields ['id ' ],
263+ 'type ' => $ actorType ,
275264 ];
276265
277- if ($ actorType == \CommonITILActor::ASSIGN ) {
278- $ groupData ['type ' ] = \CommonITILActor::ASSIGN ;
279- }
280-
281266 $ t_group ->add ($ groupData );
282267 }
283268 }
0 commit comments