Fix dol_banner
This commit is contained in:
parent
b80ee49032
commit
277dde5d61
@ -109,9 +109,9 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
|
||||
else
|
||||
{
|
||||
$now = dol_now(); // Date we start
|
||||
|
||||
|
||||
$result=$object->run_jobs($user->login);
|
||||
|
||||
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
@ -155,7 +155,7 @@ if ($action=='add')
|
||||
$object->unitfrequency=GETPOST('unitfrequency','int');
|
||||
$object->frequency=GETPOST('nbfrequency','int');
|
||||
$object->maxrun=GETPOST('maxrun','int');
|
||||
|
||||
|
||||
// Add cron task
|
||||
$result = $object->create($user);
|
||||
|
||||
@ -191,7 +191,7 @@ if ($action=='update')
|
||||
$object->unitfrequency=GETPOST('unitfrequency','int');
|
||||
$object->frequency=GETPOST('nbfrequency','int');
|
||||
$object->maxrun=GETPOST('maxrun','int');
|
||||
|
||||
|
||||
// Add cron task
|
||||
$result = $object->update($user);
|
||||
|
||||
@ -353,7 +353,7 @@ if (($action=="create") || ($action=="edit"))
|
||||
|
||||
print '<tr class="blockmethod"><td>';
|
||||
print $langs->trans('CronClassFile')."</td><td>";
|
||||
print "<input type=\"text\" size=\"20\" name=\"classesname\" value=\"".$object->classesname."\" /> ";
|
||||
print '<input type="text" class="minwidth300" name="classesname" value="'.$object->classesname.'" /> ';
|
||||
print "</td>";
|
||||
print "<td>";
|
||||
print $form->textwithpicto('',$langs->trans("CronClassFileHelp"),1,'help');
|
||||
@ -371,7 +371,7 @@ if (($action=="create") || ($action=="edit"))
|
||||
|
||||
print '<tr class="blockmethod"><td>';
|
||||
print $langs->trans('CronMethod')."</td><td>";
|
||||
print "<input type=\"text\" size=\"20\" name=\"methodename\" value=\"".$object->methodename."\" /> ";
|
||||
print '<input type="text" class="minwidth300" name="methodename" value="'.$object->methodename.'" /> ';
|
||||
print "</td>";
|
||||
print "<td>";
|
||||
print $form->textwithpicto('',$langs->trans("CronMethodHelp"),1,'help');
|
||||
@ -431,7 +431,7 @@ if (($action=="create") || ($action=="edit"))
|
||||
}
|
||||
$input .= "<label for=\"frequency_minute\">".$langs->trans('Minutes')."</label>";
|
||||
print $input;
|
||||
|
||||
|
||||
$input = " <input type=\"radio\" name=\"unitfrequency\" value=\"3600\" id=\"frequency_heures\" ";
|
||||
if($object->unitfrequency=="3600"){
|
||||
$input .= ' checked />';
|
||||
@ -441,7 +441,7 @@ if (($action=="create") || ($action=="edit"))
|
||||
}
|
||||
$input .= "<label for=\"frequency_heures\">".$langs->trans('Hours')."</label>";
|
||||
print $input;
|
||||
|
||||
|
||||
$input = " <input type=\"radio\" name=\"unitfrequency\" value=\"86400\" id=\"frequency_jours\" ";
|
||||
if($object->unitfrequency=="86400"){
|
||||
$input .= ' checked />';
|
||||
@ -451,7 +451,7 @@ if (($action=="create") || ($action=="edit"))
|
||||
}
|
||||
$input .= "<label for=\"frequency_jours\">".$langs->trans('Days')."</label>";
|
||||
print $input;
|
||||
|
||||
|
||||
$input = " <input type=\"radio\" name=\"unitfrequency\" value=\"604800\" id=\"frequency_semaine\" ";
|
||||
if($object->unitfrequency=="604800"){
|
||||
$input .= ' checked />';
|
||||
@ -465,7 +465,7 @@ if (($action=="create") || ($action=="edit"))
|
||||
print "<td>";
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print "<tr><td>";
|
||||
print $langs->trans('CronDtStart')."</td><td>";
|
||||
if(!empty($object->datestart))
|
||||
@ -480,7 +480,7 @@ if (($action=="create") || ($action=="edit"))
|
||||
print "<td>";
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print "<tr><td>";
|
||||
print $langs->trans('CronDtEnd')."</td><td>";
|
||||
if(!empty($object->dateend)){
|
||||
@ -493,7 +493,7 @@ if (($action=="create") || ($action=="edit"))
|
||||
print "<td>";
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print "<tr><td>";
|
||||
print $langs->trans('CronPriority')."</td>";
|
||||
$priority=0;
|
||||
@ -505,7 +505,7 @@ if (($action=="create") || ($action=="edit"))
|
||||
print "<td>";
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print '<tr><td>';
|
||||
$maxrun='';
|
||||
if (!empty($object->maxrun)) {
|
||||
@ -517,7 +517,7 @@ if (($action=="create") || ($action=="edit"))
|
||||
print "<td>";
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print '<tr><td>';
|
||||
print $langs->trans('CronDtNextLaunch');
|
||||
print ' ('.$langs->trans('CronFrom').')';
|
||||
@ -529,14 +529,14 @@ if (($action=="create") || ($action=="edit"))
|
||||
else
|
||||
{
|
||||
$form->select_date(-1,'datenextrun',1,1,'',"cronform");
|
||||
}
|
||||
}
|
||||
print "</td>";
|
||||
print "<td>";
|
||||
print "</td>";
|
||||
print "</tr>";
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div align="center">';
|
||||
@ -554,24 +554,22 @@ else
|
||||
* view card
|
||||
*/
|
||||
$now = dol_now();
|
||||
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans("CronTask"), -1, 'cron');
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/cron/list.php?status=-2">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
// TODO Use dol_banner
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
|
||||
// box add_jobs_box
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans('CronId')."</td>";
|
||||
print "<td>".$form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'id', '', '', 0);
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td>';
|
||||
print $langs->trans('CronLabel')."</td>";
|
||||
print "<td>".$langs->trans($object->label);
|
||||
print "</td></tr>";
|
||||
@ -616,21 +614,16 @@ else
|
||||
print $langs->trans($object->note);
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
print $langs->trans('Active')."</td><td>";
|
||||
print $object->getLibStatut(4);
|
||||
print "</td></tr>";
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans('CronEvery')."</td>";
|
||||
print "<td>";
|
||||
@ -639,33 +632,33 @@ else
|
||||
if($object->unitfrequency == "86400") print $langs->trans('CronEach')." ".($object->frequency)." ".$langs->trans('Days');
|
||||
if($object->unitfrequency == "604800") print $langs->trans('CronEach')." ".($object->frequency)." ".$langs->trans('Weeks');
|
||||
print "</td></tr>";
|
||||
|
||||
|
||||
print '<tr><td>';
|
||||
print $langs->trans('CronDtStart')."</td><td>";
|
||||
if(!empty($object->datestart)) {print dol_print_date($object->datestart,'dayhoursec');}
|
||||
print "</td></tr>";
|
||||
|
||||
|
||||
print "<tr><td>";
|
||||
print $langs->trans('CronDtEnd')."</td><td>";
|
||||
if(!empty($object->dateend)) {print dol_print_date($object->dateend,'dayhoursec');}
|
||||
print "</td></tr>";
|
||||
|
||||
|
||||
print "<tr><td>";
|
||||
print $langs->trans('CronPriority')."</td>";
|
||||
print "<td>".$object->priority;
|
||||
print "</td></tr>";
|
||||
|
||||
|
||||
print "<tr><td>";
|
||||
print $langs->trans('CronMaxRun')."</td>";
|
||||
print "<td>";
|
||||
print $object->maxrun>0?$object->maxrun:'';
|
||||
print "</td></tr>";
|
||||
|
||||
|
||||
print "<tr><td>";
|
||||
print $langs->trans('CronNbRun')."</td>";
|
||||
print "<td>".$object->nbrun;
|
||||
print "</td></tr>";
|
||||
|
||||
|
||||
// Date next run (from)
|
||||
print '<tr><td>';
|
||||
print $langs->trans('CronDtNextLaunch');
|
||||
@ -673,18 +666,18 @@ else
|
||||
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');}
|
||||
elseif (!empty($object->datenextrun)) { print img_picto('','object_calendarday').' '.dol_print_date($object->datenextrun,'dayhoursec');}
|
||||
else {print $langs->trans('CronNone');}
|
||||
//print '</strong>';
|
||||
if ($object->maxnbrun && $object->nbrun >= $object->maxrun) print img_warning($langs->trans("Finished"));
|
||||
if ($object->datenextrun && $object->datenextrun < $now) print img_warning($langs->trans("Late"));
|
||||
print "</td></tr>";
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
@ -711,7 +704,7 @@ else
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
@ -733,7 +726,7 @@ else
|
||||
else {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=execute&id='.$object->id.(empty($conf->global->CRON_KEY)?'':'&securitykey='.$conf->global->CRON_KEY).'">'.$langs->trans("CronExecute").'</a>';
|
||||
}
|
||||
|
||||
|
||||
if (! $user->rights->cron->create) {
|
||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("CronStatusActiveBtn").'/'.$langs->trans("CronStatusInactiveBtn").'</a>';
|
||||
} else {
|
||||
@ -743,7 +736,7 @@ else
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=inactive&id='.$object->id.'">'.$langs->trans("CronStatusInactiveBtn").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $user->rights->cron->delete) {
|
||||
print '<a class="butActionDeleteRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("Delete").'</a>';
|
||||
} else {
|
||||
|
||||
@ -30,36 +30,37 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
|
||||
*/
|
||||
class Cronjob extends CommonObject
|
||||
{
|
||||
var $element='cronjob'; //!< Id that identify managed objects
|
||||
var $table_element='cronjob'; //!< Name of table without prefix where object is stored
|
||||
public $element='cronjob'; //!< Id that identify managed objects
|
||||
public $table_element='cronjob'; //!< Name of table without prefix where object is stored
|
||||
public $picto = 'cron';
|
||||
|
||||
var $jobtype;
|
||||
var $tms='';
|
||||
var $datec='';
|
||||
var $label;
|
||||
var $command;
|
||||
var $classesname;
|
||||
var $objectname;
|
||||
var $methodename;
|
||||
var $params;
|
||||
var $md5params;
|
||||
var $module_name;
|
||||
var $priority;
|
||||
var $datelastrun='';
|
||||
var $datenextrun='';
|
||||
var $dateend='';
|
||||
var $datestart='';
|
||||
var $datelastresult='';
|
||||
var $lastresult;
|
||||
var $lastoutput;
|
||||
var $unitfrequency;
|
||||
var $frequency;
|
||||
var $status;
|
||||
var $processing;
|
||||
var $fk_user_author;
|
||||
var $fk_user_mod;
|
||||
var $nbrun;
|
||||
var $libname;
|
||||
public $jobtype;
|
||||
public $tms='';
|
||||
public $datec='';
|
||||
public $label;
|
||||
public $command;
|
||||
public $classesname;
|
||||
public $objectname;
|
||||
public $methodename;
|
||||
public $params;
|
||||
public $md5params;
|
||||
public $module_name;
|
||||
public $priority;
|
||||
public $datelastrun='';
|
||||
public $datenextrun='';
|
||||
public $dateend='';
|
||||
public $datestart='';
|
||||
public $datelastresult='';
|
||||
public $lastresult;
|
||||
public $lastoutput;
|
||||
public $unitfrequency;
|
||||
public $frequency;
|
||||
public $status;
|
||||
public $processing;
|
||||
public $fk_user_author;
|
||||
public $fk_user_mod;
|
||||
public $nbrun;
|
||||
public $libname;
|
||||
|
||||
|
||||
/**
|
||||
@ -1265,35 +1266,35 @@ class Cronjob extends CommonObject
|
||||
class Cronjobline
|
||||
{
|
||||
|
||||
var $id;
|
||||
var $ref;
|
||||
public $id;
|
||||
public $ref;
|
||||
|
||||
var $tms='';
|
||||
var $datec='';
|
||||
var $label;
|
||||
var $jobtype;
|
||||
var $command;
|
||||
var $classesname;
|
||||
var $objectname;
|
||||
var $methodename;
|
||||
var $params;
|
||||
var $md5params;
|
||||
var $module_name;
|
||||
var $priority;
|
||||
var $datelastrun='';
|
||||
var $datenextrun='';
|
||||
var $dateend='';
|
||||
var $datestart='';
|
||||
var $lastresult='';
|
||||
var $lastoutput;
|
||||
var $unitfrequency;
|
||||
var $frequency;
|
||||
var $status;
|
||||
var $fk_user_author;
|
||||
var $fk_user_mod;
|
||||
var $note;
|
||||
var $nbrun;
|
||||
var $libname;
|
||||
public $tms='';
|
||||
public $datec='';
|
||||
public $label;
|
||||
public $jobtype;
|
||||
public $command;
|
||||
public $classesname;
|
||||
public $objectname;
|
||||
public $methodename;
|
||||
public $params;
|
||||
public $md5params;
|
||||
public $module_name;
|
||||
public $priority;
|
||||
public $datelastrun='';
|
||||
public $datenextrun='';
|
||||
public $dateend='';
|
||||
public $datestart='';
|
||||
public $lastresult='';
|
||||
public $lastoutput;
|
||||
public $unitfrequency;
|
||||
public $frequency;
|
||||
public $status;
|
||||
public $fk_user_author;
|
||||
public $fk_user_mod;
|
||||
public $note;
|
||||
public $nbrun;
|
||||
public $libname;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
@ -50,6 +50,17 @@ $head = cron_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'info', $langs->trans("CronTask"), -1, 'cron');
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/cron/list.php?status=-2">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table width="100%"><tr><td>';
|
||||
dol_print_object_info($object);
|
||||
print '</td></tr></table>';
|
||||
|
||||
@ -57,9 +57,9 @@ CronStatusActiveBtn=Enable
|
||||
CronStatusInactiveBtn=Disable
|
||||
CronTaskInactive=This job is disabled
|
||||
CronId=Id
|
||||
CronClassFile=Classes (filename.class.php)
|
||||
CronClassFile=Filename with class
|
||||
CronModuleHelp=Name of Dolibarr module directory (also work with external Dolibarr module). <BR> For exemple to call the fetch method of Dolibarr Product object /htdocs/<u>product</u>/class/product.class.php, the value for module is <i>product</i>
|
||||
CronClassFileHelp=The file name to load. <BR> For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/<u>product.class.php</u>, the value for class file name is <i>product.class.php</i>
|
||||
CronClassFileHelp=The relative path and file name to load (path is relative to web server root directory). <BR> For exemple to call the fetch method of Dolibarr Product object htdocs/product/class/<u>product.class.php</u>, the value for class file name is <i>product/class/product.class.php</i>
|
||||
CronObjectHelp=The object name to load. <BR> For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for class file name is <i>Product</i>
|
||||
CronMethodHelp=The object method to launch. <BR> For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for method is <i>fecth</i>
|
||||
CronArgsHelp=The method arguments. <BR> For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for paramters can be <i>0, ProductRef</i>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user