Browse Source

Fix warnings

Laurent Destailleur 7 years ago
parent
commit
85180b117c
2 changed files with 12 additions and 8 deletions
  1. 6 5
      htdocs/cron/card.php
  2. 6 3
      htdocs/cron/list.php

+ 6 - 5
htdocs/cron/card.php

@@ -679,13 +679,14 @@ else
 	print $langs->trans('CronDtNextLaunch');
 	print ' ('.$langs->trans('CronFrom').')';
 	print "</td><td>";
-	//print '<strong>';
 	if (! $object->status) print $langs->trans("Disabled");
 	elseif (!empty($object->datenextrun)) { print img_picto('','object_calendarday').' '.dol_print_date($object->datenextrun,'dayhoursec');}
-	else {print $langs->trans('CronNone');}
-	//print '</strong>';
-	if ($object->maxrun && $object->nbrun >= $object->maxrun) print img_warning($langs->trans("MaxRunReached"));
-	elseif ($object->datenextrun && $object->datenextrun < $now) print img_warning($langs->trans("Late"));
+	else { print $langs->trans('CronNone'); }
+	if ($object->status == Cronjob::STATUS_ENABLED)
+	{
+		if ($object->maxrun && $object->nbrun >= $object->maxrun) print img_warning($langs->trans("MaxRunReached"));
+		elseif ($object->datenextrun && $object->datenextrun < $now) print img_warning($langs->trans("Late"));
+	}
 	print "</td></tr>";
 
 	print '</table>';

+ 6 - 3
htdocs/cron/list.php

@@ -523,9 +523,12 @@ if ($num > 0)
 		if (!empty($obj->datenextrun)) {
 			$datenextrun = $db->jdate($obj->datenextrun);
 			if (empty($obj->status)) print '<span class="opacitymedium">';
-			print dol_print_date($datenextrun,'dayhour');
-			if ($obj->maxrun && $obj->nbrun >= $obj->maxrun) print img_warning($langs->trans("MaxRunReached"));
-			elseif ($datenextrun && $datenextrun < $now) print img_warning($langs->trans("Late"));
+			print dol_print_date($datenextrun,'dayhoursec');
+			if ($obj->status == Cronjob::STATUS_ENABLED)
+			{
+				if ($obj->maxrun && $obj->nbrun >= $obj->maxrun) print img_warning($langs->trans("MaxRunReached"));
+				elseif ($datenextrun && $datenextrun < $now) print img_warning($langs->trans("Late"));
+			}
 			if (empty($obj->status)) print '</span>';
 		}
 		print '</td>';