From cc6b9269f9bb5f8f8b2aea44e8e61a09f31fbcd4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 25 Jan 2020 11:50:16 +0100 Subject: [PATCH] Fix look and feel v11 --- htdocs/cron/class/cronjob.class.php | 14 ++++++++++---- htdocs/cron/list.php | 3 ++- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/eldy/theme_vars.inc.php | 2 +- htdocs/theme/md/theme_vars.inc.php | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index b70707f1464..5cde792bbb5 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1287,12 +1287,12 @@ class Cronjob extends CommonObject /** * Return label of status of user (active, inactive) * - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label of status */ public function getLibStatut($mode = 0) { - return $this->LibStatut($this->status, $mode, $this->processing); + return $this->LibStatut($this->status, $mode, $this->processing, $this->lastresult); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -1300,13 +1300,17 @@ class Cronjob extends CommonObject * Renvoi le libelle d'un statut donne * * @param int $status Id statut - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @param int $processing 0=Not running, 1=Running + * @param int $lastresult Value of last result (0=no error, error otherwise) * @return string Label of status */ - public function LibStatut($status, $mode = 0, $processing = 0) + public function LibStatut($status, $mode = 0, $processing = 0, $lastresult = 0) { // phpcs:enable + $this->labelStatus = array(); // Force reset o array because label depends on other fields + $this->labelStatusShort = array(); + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; @@ -1314,6 +1318,7 @@ class Cronjob extends CommonObject $moretext = ''; if ($processing) $moretext = ' ('.$langs->trans("Running").')'; + elseif ($lastresult) $moretext .= ' ('.$langs->trans("Error").')'; $this->labelStatus[self::STATUS_DISABLED] = $langs->trans('Draft').$moretext; $this->labelStatus[self::STATUS_ENABLED] = $langs->trans('Enabled').$moretext; @@ -1324,6 +1329,7 @@ class Cronjob extends CommonObject $statusType = 'status4'; if ($status == 1 && $processing) $statusType = 'status1'; if ($status == 0) $statusType = 'status5'; + if ($this->lastresult) $statusType = 'status8'; return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index dd70d6d6913..ac9f178b163 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -425,6 +425,7 @@ if ($num > 0) $object->status = $obj->status; $object->priority = $obj->priority; $object->processing = $obj->processing; + $object->lastresult = $obj->lastresult; $datelastrun = $db->jdate($obj->datelastrun); $datelastresult = $db->jdate($obj->datelastresult); @@ -541,7 +542,7 @@ if ($num > 0) // Status print ''; - print $object->getLibStatut(3); + print $object->getLibStatut(5); print ''; print ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index bc00125301e..0f96bb15d62 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3499,7 +3499,7 @@ img.boxhandle, img.boxclose { .ok { color: #114466; } .warning { color: #887711 !important; } -.error { color: #550000 !important; font-weight: bold; } +.error { color: #660000 !important; font-weight: bold; } .green { color: #118822; } div.ok { diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index ccaac4471a9..e80347e9895 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -112,7 +112,7 @@ $badgeStatus4 = '#55a580'; // Color ok $badgeStatus5 = '#cad2d2'; $badgeStatus6 = '#cad2d2'; $badgeStatus7 = '#baa32b'; -$badgeStatus8 = '#be3013'; +$badgeStatus8 = '#993013'; $badgeStatus9 = '#e7f0f0'; // status color ajustement for color blind diff --git a/htdocs/theme/md/theme_vars.inc.php b/htdocs/theme/md/theme_vars.inc.php index 5f0d1868481..106a4b5b854 100644 --- a/htdocs/theme/md/theme_vars.inc.php +++ b/htdocs/theme/md/theme_vars.inc.php @@ -99,5 +99,5 @@ $badgeStatus4 = '#277d1e'; $badgeStatus5 = '#cad2d2'; $badgeStatus6 = '#cad2d2'; $badgeStatus7 = '#baa32b'; -$badgeStatus8 = '#be3013'; +$badgeStatus8 = '#993013'; $badgeStatus9 = '#e7f0f0';