Fix status of crons

This commit is contained in:
Laurent Destailleur 2019-05-13 10:26:30 +02:00
parent 39c9efbc51
commit f0cdaff936
5 changed files with 6 additions and 8 deletions

View File

@ -134,7 +134,7 @@ class modCron extends DolibarrModules
$this->menu[$r] = array('fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode $this->menu[$r] = array('fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'left', // This is a Left menu entry 'type'=>'left', // This is a Left menu entry
'titre'=>'CronList', 'titre'=>'CronList',
'url'=>'/cron/list.php?status=-2&leftmenu=admintools', 'url'=>'/cron/list.php?leftmenu=admintools',
'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>200, 'position'=>200,
'enabled'=>'$conf->cron->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. 'enabled'=>'$conf->cron->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.

View File

@ -75,7 +75,7 @@ if (!empty($cancel))
} }
else else
{ {
header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-2'); header("Location: ".DOL_URL_ROOT.'/cron/list.php');
exit; exit;
} }
} }
@ -93,7 +93,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->del
} }
else else
{ {
Header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-2'); Header("Location: ".DOL_URL_ROOT.'/cron/list.php');
exit; exit;
} }
} }
@ -557,7 +557,7 @@ else
dol_fiche_head($head, 'card', $langs->trans("CronTask"), -1, 'cron'); dol_fiche_head($head, 'card', $langs->trans("CronTask"), -1, 'cron');
$linkback = '<a href="' . DOL_URL_ROOT . '/cron/list.php?status=-2&restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; $linkback = '<a href="' . DOL_URL_ROOT . '/cron/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
$morehtmlref='<div class="refidno">'; $morehtmlref='<div class="refidno">';
$morehtmlref.='</div>'; $morehtmlref.='</div>';

View File

@ -50,7 +50,7 @@ $head = cron_prepare_head($object);
dol_fiche_head($head, 'info', $langs->trans("CronTask"), -1, 'cron'); dol_fiche_head($head, 'info', $langs->trans("CronTask"), -1, 'cron');
$linkback = '<a href="' . DOL_URL_ROOT . '/cron/list.php?status=-2&restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; $linkback = '<a href="' . DOL_URL_ROOT . '/cron/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
$morehtmlref='<div class="refidno">'; $morehtmlref='<div class="refidno">';
$morehtmlref.='</div>'; $morehtmlref.='</div>';

View File

@ -56,7 +56,6 @@ if (! $sortfield) $sortfield='t.status,t.priority';
if (! $sortorder) $sortorder='DESC,ASC'; if (! $sortorder) $sortorder='DESC,ASC';
$search_status=GETPOST('search_status', 'int')?GETPOST('search_status', 'int'):GETPOST('status', 'int'); $search_status=GETPOST('search_status', 'int')?GETPOST('search_status', 'int'):GETPOST('status', 'int');
if ($search_status == '') $search_status=-2;
//Search criteria //Search criteria
$search_label=GETPOST("search_label", 'alpha'); $search_label=GETPOST("search_label", 'alpha');
@ -253,7 +252,6 @@ $sql.= " t.test";
$sql.= " FROM ".MAIN_DB_PREFIX."cronjob as t"; $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as t";
$sql.= " WHERE entity IN (0,".$conf->entity.")"; $sql.= " WHERE entity IN (0,".$conf->entity.")";
if ($search_status >= 0 && $search_status < 2) $sql.= " AND t.status = ".(empty($search_status)?'0':'1'); if ($search_status >= 0 && $search_status < 2) $sql.= " AND t.status = ".(empty($search_status)?'0':'1');
if ($search_status == 2) $sql.= " AND t.status = 2";
//Manage filter //Manage filter
if (is_array($filter) && count($filter)>0) { if (is_array($filter) && count($filter)>0) {
foreach($filter as $key => $value) { foreach($filter as $key => $value) {

View File

@ -2737,7 +2737,7 @@ elseif (! empty($module))
if ($action != 'editfile' || empty($file)) if ($action != 'editfile' || empty($file))
{ {
print '<span class="opacitymedium">'.$langs->trans("CronJobDefDesc", '<a href="'.DOL_URL_ROOT.'/cron/list.php?status=-2">'.$langs->transnoentities('CronList').'</a>').'</span><br>'; print '<span class="opacitymedium">'.$langs->trans("CronJobDefDesc", '<a href="'.DOL_URL_ROOT.'/cron/list.php">'.$langs->transnoentities('CronList').'</a>').'</span><br>';
print '<br>'; print '<br>';
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>'; print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';