From b979cd210c8462fb13dc21bd263dab56547b8385 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 4 Apr 2018 09:13:59 +0200 Subject: [PATCH] Added panel for no notifications in Ampelsystem the panel is shown only when there are no currently notifications for the user --- cis/private/tools/ampelverwaltung.php | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/cis/private/tools/ampelverwaltung.php b/cis/private/tools/ampelverwaltung.php index 833afc2f3..1321e3934 100644 --- a/cis/private/tools/ampelverwaltung.php +++ b/cis/private/tools/ampelverwaltung.php @@ -346,7 +346,7 @@ $(document).ready(function(){ ' . $p->t('tools/ampelsystem') . ''; + echo '

' . $p->t('tools/ampelsystem') . '

'; //title in popup for mandatory ampeln if ($is_popup) @@ -402,10 +402,33 @@ $(document).ready(function(){ $cnt = 1; //counter to set iterative id's $cnt_inactive = 1; //counter to set only one heading line for inactive ampeln + $cnt_active = 0; + + //show panel "no actual ampeln" if there are no active ampeln + foreach ($user_ampel_arr as $user_ampel) + { + if ($user_ampel['active'] == true) + $cnt_active++; + } + + if ($cnt_active == 0) + { + echo ' +
+
+ +
+
'; + + } //fill panel with ampeln foreach ($user_ampel_arr as $user_ampel) { + //use only ampeln that are not overdue if ($user_ampel['show_ampel'] == true) { @@ -465,7 +488,7 @@ $(document).ready(function(){
- +