@@ -180,10 +180,10 @@ public function rawSearchOptions() {
180180 public static function findAllToNotify ($ params = []) {
181181 global $ DB ;
182182
183- $ p ['show_only_login_alerts ' ] = false ;
184- $ p ['show_hidden_alerts ' ] = false ;
185- $ p ['show_helpdesk_alerts ' ] = false ;
186- $ p ['entities_id ' ] = false ;
183+ $ p ['show_only_login_alerts ' ] = false ;
184+ $ p ['show_hidden_alerts ' ] = false ;
185+ $ p ['show_only_helpdesk_alerts ' ] = false ;
186+ $ p ['entities_id ' ] = false ;
187187 foreach ($ params as $ key => $ value ) {
188188 $ p [$ key ] = $ value ;
189189 }
@@ -236,7 +236,7 @@ public static function findAllToNotify($params = []) {
236236
237237 //If the alert must be displayed on helpdesk form : filter by ticket's entity
238238 //and not the current entity
239- if ($ p ['show_helpdesk_alerts ' ]) {
239+ if ($ p ['show_only_helpdesk_alerts ' ]) {
240240 $ show_helpdesk_sql = " AND ` $ table`.`is_displayed_onhelpdesk`='1' " ;
241241 }
242242 if (!$ p ['show_only_login_alerts ' ]) {
@@ -416,7 +416,7 @@ public function showForm($ID, $options = []) {
416416
417417 static function displayOnCentral () {
418418 echo "<tr><th colspan='2'> " ;
419- self ::displayAlerts (['show_only_login_alerts ' => false ]);
419+ self ::displayAlerts (['show_only_helpdesk_alerts ' => Session:: getCurrentInterface () == ' helpdesk ' ]);
420420 echo "</th></tr> " ;
421421 }
422422
@@ -430,10 +430,10 @@ static function displayOnLogin() {
430430 static function displayAlerts ($ params = []) {
431431 global $ CFG_GLPI ;
432432
433- $ p ['show_only_login_alerts ' ] = false ;
434- $ p ['show_hidden_alerts ' ] = false ;
435- $ p ['show_helpdesk_alerts ' ] = false ;
436- $ p ['entities_id ' ] = false ;
433+ $ p ['show_only_login_alerts ' ] = false ;
434+ $ p ['show_hidden_alerts ' ] = false ;
435+ $ p ['show_only_helpdesk_alerts ' ] = false ;
436+ $ p ['entities_id ' ] = false ;
437437 foreach ($ params as $ key => $ value ) {
438438 $ p [$ key ] = $ value ;
439439 }
@@ -502,9 +502,9 @@ static function preItemForm($params = []) {
502502 $ entities_id = isset ($ params ['item ' ]->fields ['entities_id ' ])
503503 ? $ params ['item ' ]->fields ['entities_id ' ]
504504 : false ; // false to use current entity
505- self ::displayAlerts (['show_helpdesk_alerts ' => true ,
506- 'show_hidden_alerts ' => false ,
507- 'entities_id ' => $ entities_id
505+ self ::displayAlerts (['show_only_helpdesk_alerts ' => true ,
506+ 'show_hidden_alerts ' => false ,
507+ 'entities_id ' => $ entities_id
508508 ]);
509509 echo "</br> " ;
510510 }
0 commit comments