From 30c40afeb3f4a94b4f7b146c8f23b838b15be023 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Aug 2021 04:28:16 +0200 Subject: [PATCH] Debug notification setup --- htdocs/admin/notification.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index ffed6b948bc..4c1df0fa938 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -169,14 +169,14 @@ llxHeader('', $langs->trans("NotificationSetup")); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("NotificationSetup"), $linkback, 'title_setup'); -print '
'; +print ''; print $langs->trans("NotificationsDesc").'
'; print $langs->trans("NotificationsDescUser").'
'; if (!empty($conf->societe->enabled)) { print $langs->trans("NotificationsDescContact").'
'; } print $langs->trans("NotificationsDescGlobal").'
'; -print '
'; +print ''; print '
'; print '
'; @@ -342,6 +342,7 @@ print '

'; print ''; print ''; print ''; +print ''; print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', ''); @@ -383,6 +384,12 @@ foreach ($listofnotifiedevents as $notifiedevent) { $elementLabel = $langs->trans('ExpenseReport'); } + $labelfortrigger = 'AmountHT'; + $codehasnotrigger = 0; + if (preg_match('/^HOLIDAY/', $notifiedevent['code'])) { + $codehasnotrigger++; + } + print ''; print ''; print img_picto('', $elementPicto, 'class="pictofixedwidth"'); @@ -419,14 +426,13 @@ foreach ($listofnotifiedevents as $notifiedevent) { $inputfieldalreadyshown++; } // New entry input fields - if (empty($inputfieldalreadyshown) || !preg_match('/^HOLIDAY/', $notifiedevent['code'])) { + if (empty($inputfieldalreadyshown) || !$codehasnotrigger) { $s = ''; // Do not use type="email" here, we must be able to enter a list of email with , separator. print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'
'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2); } print ''; print ''; - $labelfortrigger = 'AmountHT'; // Notification with threshold $inputfieldalreadyshown = 0; foreach ($conf->global as $key => $val) { @@ -434,7 +440,7 @@ foreach ($listofnotifiedevents as $notifiedevent) { continue; } - if (!preg_match('/^HOLIDAY/', $notifiedevent['code'])) { + if (!$codehasnotrigger) { print $langs->trans($labelfortrigger).' >= '; print '
'; @@ -442,7 +448,7 @@ foreach ($listofnotifiedevents as $notifiedevent) { } } // New entry input fields - if (!preg_match('/^HOLIDAY/', $notifiedevent['code'])) { + if (!$codehasnotrigger) { print $langs->trans($labelfortrigger).' >= '; } print ''; @@ -457,7 +463,7 @@ print ''; print '
'; -print '
'; +print '
'; print '
';