Fix: debug module cron
This commit is contained in:
parent
ec2e3db450
commit
871c3d9d07
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr
|
/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2013 Laurent Destailleur <eldy@users.srouceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -33,9 +34,11 @@ $langs->load("cron");
|
|||||||
|
|
||||||
if (!$user->rights->cron->read) accessforbidden();
|
if (!$user->rights->cron->read) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$action=GETPOST('action','alpha');
|
$action=GETPOST('action','alpha');
|
||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$id=GETPOST('id','int');
|
$id=GETPOST('id','int');
|
||||||
@ -51,7 +54,6 @@ $search_label=GETPOST("search_label",'alpha');
|
|||||||
if (empty($sortorder)) $sortorder="DESC";
|
if (empty($sortorder)) $sortorder="DESC";
|
||||||
if (empty($sortfield)) $sortfield="t.datenextrun";
|
if (empty($sortfield)) $sortfield="t.datenextrun";
|
||||||
if (empty($arch)) $arch = 0;
|
if (empty($arch)) $arch = 0;
|
||||||
|
|
||||||
if ($page == -1) {
|
if ($page == -1) {
|
||||||
$page = 0 ;
|
$page = 0 ;
|
||||||
}
|
}
|
||||||
@ -62,13 +64,15 @@ $pageprev = $page - 1;
|
|||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
|
|
||||||
// Do we click on purge search criteria ?
|
// Do we click on purge search criteria ?
|
||||||
if (GETPOST("button_removefilter_x"))
|
if (GETPOST("button_removefilter"))
|
||||||
{
|
{
|
||||||
$search_label='';
|
$search_label='';
|
||||||
|
$status=-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$filter=array();
|
$filter=array();
|
||||||
if (!empty($search_label)) {
|
if (!empty($search_label))
|
||||||
|
{
|
||||||
$filter['t.label']=$search_label;
|
$filter['t.label']=$search_label;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,8 +112,6 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
//if (! empty($status)) $pagetitle=$langs->trans("CronListActive");
|
|
||||||
//else $pagetitle=$langs->trans("CronListInactive");
|
|
||||||
$pagetitle=$langs->trans("CronList");
|
$pagetitle=$langs->trans("CronList");
|
||||||
|
|
||||||
llxHeader('',$pagetitle);
|
llxHeader('',$pagetitle);
|
||||||
@ -118,81 +120,79 @@ print_fiche_titre($pagetitle,'','setup');
|
|||||||
|
|
||||||
print $langs->trans('CronInfo');
|
print $langs->trans('CronInfo');
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1);
|
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1);
|
||||||
if ($ret == 'html') print '<br>';
|
if ($ret == 'html') print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'execute'){
|
if ($action == 'execute')
|
||||||
|
{
|
||||||
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1);
|
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1);
|
||||||
if ($ret == 'html') print '<br>';
|
if ($ret == 'html') print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// liste des jobs creer
|
// liste des jobs creer
|
||||||
$object = new Cronjob($db);
|
$object = new Cronjob($db);
|
||||||
$result=$object->fetch_all($sortorder, $sortfield, $limit, $offset, $status, $filter);
|
$result=$object->fetch_all($sortorder, $sortfield, $limit, $offset, $status, $filter);
|
||||||
if ($result < 0) {
|
if ($result < 0)
|
||||||
|
{
|
||||||
setEventMessage($object->error,'errors');
|
setEventMessage($object->error,'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print "<br><br>";
|
print "<br><br>";
|
||||||
|
|
||||||
if (count($object->lines)>0)
|
|
||||||
{
|
|
||||||
print '<table class="noborder">';
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
$arg_url='&page='.$page.'&status='.$status.'&search_label='.$search_label;
|
|
||||||
print_liste_field_titre($langs->trans("CronLabel"),$_SERVEUR['PHP_SELF'],"t.label","",$arg_url,'',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("CronTask"),'','',"",$arg_url,'',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("CronDtStart"),$_SERVEUR['PHP_SELF'],"t.datestart","",$arg_url,'',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("CronDtEnd"),$_SERVEUR['PHP_SELF'],"t.dateend","",$arg_url,'',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("CronDtLastLaunch"),$_SERVEUR['PHP_SELF'],"t.datelastrun","",$arg_url,'',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("CronDtNextLaunch"),$_SERVEUR['PHP_SELF'],"t.datenextrun","",$arg_url,'',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("CronFrequency"),'',"","",$arg_url,'',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("CronNbRun"),$_SERVEUR['PHP_SELF'],"t.nbrun","",$arg_url,'',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("CronLastResult"),$_SERVEUR['PHP_SELF'],"t.lastresult","",$arg_url,'',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("CronLastOutput"),$_SERVEUR['PHP_SELF'],"t.lastoutput","",$arg_url,'',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("Enabled"),$_SERVEUR['PHP_SELF'],"t.status","",$arg_url,'align="center"',$sortfield,$sortorder);
|
|
||||||
print '<td></td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
print '<form method="get" action="'.$url_form.'" name="search_form">'."\n";
|
print '<form method="GET" action="'.$url_form.'" name="search_form">'."\n";
|
||||||
print '<input type="hidden" name="status" value="'.$status.'" >';
|
print '<input type="hidden" name="status" value="'.$status.'" >';
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
|
print '<table class="noborder">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
$arg_url='&page='.$page.'&status='.$status.'&search_label='.$search_label;
|
||||||
|
print_liste_field_titre($langs->trans("CronLabel"),$_SERVEUR['PHP_SELF'],"t.label","",$arg_url,'',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("CronTask"),'','',"",$arg_url,'',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("CronDtStart"),$_SERVEUR['PHP_SELF'],"t.datestart","",$arg_url,'',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("CronDtEnd"),$_SERVEUR['PHP_SELF'],"t.dateend","",$arg_url,'',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("CronDtLastLaunch"),$_SERVEUR['PHP_SELF'],"t.datelastrun","",$arg_url,'',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("CronDtNextLaunch"),$_SERVEUR['PHP_SELF'],"t.datenextrun","",$arg_url,'',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("CronFrequency"),'',"","",$arg_url,'',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("CronNbRun"),$_SERVEUR['PHP_SELF'],"t.nbrun","",$arg_url,'',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("CronLastResult"),$_SERVEUR['PHP_SELF'],"t.lastresult","",$arg_url,'',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("CronLastOutput"),$_SERVEUR['PHP_SELF'],"t.lastoutput","",$arg_url,'',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Enabled"),$_SERVEUR['PHP_SELF'],"t.status","",$arg_url,'align="center"',$sortfield,$sortorder);
|
||||||
|
print '<td></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
print '<input type="text" class="flat" name="search_label" value="'.$search_label.'" size="10">';
|
||||||
|
print '</td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td class="liste_titre" align="center">';
|
||||||
|
print $form->selectarray('status', array('0'=>$langs->trans("No"),'1'=>$langs->trans("Yes")), $status, 1);
|
||||||
|
print '</td><td class="liste_titre" align="right">';
|
||||||
|
print ' ';
|
||||||
|
print '<input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||||
|
print ' ';
|
||||||
|
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
|
||||||
|
if (count($object->lines) > 0)
|
||||||
print '<td class="liste_titre">';
|
{
|
||||||
print '<input type="text" class="flat" name="search_label" value="'.$search_label.'" size="10">';
|
// Loop on each active job
|
||||||
print '</td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print '<td class="liste_titre" align="center">';
|
|
||||||
print $form->selectarray('status', array('0'=>$langs->trans("No"),'1'=>$langs->trans("Yes")), GETPOST('status'), 1);
|
|
||||||
print '</td><td class="liste_titre" align="right">';
|
|
||||||
print ' ';
|
|
||||||
print '<input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
print '</tr>';
|
|
||||||
print '</from>';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Boucler sur chaque job
|
|
||||||
$style='impair';
|
$style='impair';
|
||||||
foreach($object->lines as $line)
|
foreach($object->lines as $line)
|
||||||
{
|
{
|
||||||
@ -283,10 +283,17 @@ if (count($object->lines)>0)
|
|||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
|
||||||
} else {
|
|
||||||
print $langs->trans('CronNoJobs');
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<tr><td colspan="8">'.$langs->trans('CronNoJobs').'</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '</from>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print "\n<div class=\"tabsAction\">\n";
|
print "\n<div class=\"tabsAction\">\n";
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user