card.php

Go to the documentation of this file.
00001 <?php
00002 /* Copyright (C) 2012      Nicolas Villa aka Boyquotes http://informetic.fr
00003  * Copyright (C) 2013      Florian Henry <florian.henry@open-concpt.pro>
00004  * Copyright (C) 2013      Laurent Destailleur <eldy@users.sourceforge.net>
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 3 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00018  */
00019 
00026 require '../main.inc.php';
00027 
00028 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
00029 
00030 // librairie jobs
00031 require_once DOL_DOCUMENT_ROOT."/cron/class/cronjob.class.php";
00032 require_once DOL_DOCUMENT_ROOT."/core/class/html.formcron.class.php";
00033 require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php';
00034 
00035 
00036 $langs->load("admin");
00037 $langs->load("cron");
00038 
00039 if (!$user->rights->cron->create) accessforbidden();
00040 
00041 $id=GETPOST('id','int');
00042 $action=GETPOST('action','alpha');
00043 $confirm=GETPOST('confirm','alpha');
00044 $cancel=GETPOST('cancel');
00045 
00046 $object = new Cronjob($db);
00047 if (!empty($id))
00048 {
00049   $result=$object->fetch($id);
00050   if ($result < 0)
00051   {
00052     setEventMessage($object->error,'errors');
00053   }
00054 }
00055 
00056 if(!empty($cancel))
00057 {
00058   if (!empty($id))
00059   {
00060     $action='';
00061   }
00062   else
00063   {
00064     Header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=1');
00065     exit;
00066   }
00067 }
00068 
00069 // Delete jobs
00070 if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->delete)
00071 {
00072   $result = $object->delete($user);
00073 
00074   if ($result < 0)
00075   {
00076     setEventMessage($object->error,'errors');
00077     $action='edit';
00078   }
00079   else
00080   {
00081     Header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=1');
00082     exit;
00083   }
00084 }
00085 
00086 // Execute jobs
00087 if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->execute)
00088 {
00089   $result=$object->run_jobs($user->login);
00090 
00091   if ($result < 0)
00092   {
00093     setEventMessage($object->error,'errors');
00094     $action='';
00095   }
00096   else
00097   {
00098     if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings');
00099     else setEventMessage($langs->trans("JobFinished"),'mesgs');
00100     $action='';
00101   }
00102 }
00103 
00104 
00105 if ($action=='add')
00106 {
00107   $object->jobtype=GETPOST('jobtype','alpha');
00108   $object->label=GETPOST('label','alpha');
00109   $object->command=GETPOST('command','alpha');
00110   $object->priority=GETPOST('priority','int');
00111   $object->classesname=GETPOST('classesname','alpha');
00112   $object->objectname=GETPOST('objectname','alpha');
00113   $object->methodename=GETPOST('methodename','alpha');
00114   $object->params=GETPOST('params');
00115   $object->md5params=GETPOST('md5params');
00116   $object->module_name=GETPOST('module_name','alpha');
00117   $object->note=GETPOST('note');
00118   $object->datestart=dol_mktime(GETPOST('datestarthour','int'), GETPOST('datestartmin','int'), 0, GETPOST('datestartmonth','int'), GETPOST('datestartday','int'), GETPOST('datestartyear','int'));
00119   $object->dateend=dol_mktime(GETPOST('dateendhour','int'), GETPOST('dateendmin','int'), 0, GETPOST('dateendmonth','int'), GETPOST('dateendday','int'), GETPOST('dateendyear','int'));
00120   $object->unitfrequency=GETPOST('unitfrequency','int');
00121   $object->frequency=$object->unitfrequency * GETPOST('nbfrequency','int');
00122 
00123   // Add cron task
00124   $result = $object->create($user);
00125 
00126   // test du Resultat de la requete
00127   if ($result < 0) {
00128     setEventMessage($object->error,'errors');
00129     $action='create';
00130   }
00131   else {
00132     setEventMessage($langs->trans('CronSaveSucess'),'mesgs');
00133     $action='';
00134   }
00135 }
00136 
00137 // Save parameters
00138 if ($action=='update')
00139 {
00140   $object->id=$id;
00141   $object->jobtype=GETPOST('jobtype');
00142   $object->label=GETPOST('label');
00143   $object->command=GETPOST('command');
00144   $object->classesname=GETPOST('classesname','alpha');
00145   $object->priority=GETPOST('priority','int');
00146   $object->objectname=GETPOST('objectname','alpha');
00147   $object->methodename=GETPOST('methodename','alpha');
00148   $object->params=GETPOST('params');
00149   $object->md5params=GETPOST('md5params');
00150   $object->module_name=GETPOST('module_name','alpha');
00151   $object->note=GETPOST('note');
00152   $object->datestart=dol_mktime(GETPOST('datestarthour','int'), GETPOST('datestartmin','int'), 0, GETPOST('datestartmonth','int'), GETPOST('datestartday','int'), GETPOST('datestartyear','int'));
00153   $object->dateend=dol_mktime(GETPOST('dateendhour','int'), GETPOST('dateendmin','int'), 0, GETPOST('dateendmonth','int'), GETPOST('dateendday','int'), GETPOST('dateendyear','int'));
00154   $object->unitfrequency=GETPOST('unitfrequency','int');
00155   $object->frequency=$object->unitfrequency * GETPOST('nbfrequency','int');
00156 
00157   // Add cron task
00158   $result = $object->update($user);
00159 
00160   // test du Resultat de la requete
00161   if ($result < 0) {
00162     setEventMessage($object->error,'errors');
00163     $action='edit';
00164   }
00165   else {
00166     setEventMessage($langs->trans('CronSaveSucess'),'mesgs');
00167     $action='';
00168   }
00169 }
00170 
00171 if ($action=='activate')
00172 {
00173   $object->status=1;
00174 
00175   // Add cron task
00176   $result = $object->update($user);
00177 
00178   // test du Resultat de la requete
00179   if ($result < 0) {
00180     setEventMessage($object->error,'errors');
00181     $action='edit';
00182   }
00183   else {
00184     setEventMessage($langs->trans('CronSaveSucess'),'mesgs');
00185     $action='';
00186   }
00187 }
00188 
00189 if ($action=='inactive')
00190 {
00191   $object->status=0;
00192 
00193   // Add cron task
00194   $result = $object->update($user);
00195 
00196   // test du Resultat de la requete
00197   if ($result < 0) {
00198     setEventMessage($object->error,'errors');
00199     $action='edit';
00200   }
00201   else {
00202     setEventMessage($langs->trans('CronSaveSucess'),'mesgs');
00203     $action='';
00204   }
00205 }
00206 
00207 
00208 
00209 /*
00210  * View
00211  */
00212 
00213 $form = new Form($db);
00214 $formCron = new FormCron($db);
00215 
00216 llxHeader('',$langs->trans("CronAdd"));
00217 
00218 if ($action=='edit' || empty($action) || $action=='delete' || $action=='execute')
00219 {
00220   $head=cron_prepare_head($object);
00221   print dol_get_fiche_head($head, 'card', $langs->trans("CronTask"), 0, 'bill');
00222 }
00223 elseif ($action=='create')
00224 {
00225   print_fiche_titre($langs->trans("CronTask"),'','setup');
00226 }
00227 
00228 if ($conf->use_javascript_ajax)
00229 {
00230   print "\n".'<script type="text/javascript" language="javascript">';
00231   print 'jQuery(document).ready(function () {
00232                     function initfields()
00233                     {
00234                         if ($("#jobtype option:selected").val()==\'method\') {
00235               $(".blockmethod").show();
00236               $(".blockcommand").hide();
00237             }
00238             if ($("#jobtype option:selected").val()==\'command\') {
00239               $(".blockmethod").hide();
00240               $(".blockcommand").show();
00241             }
00242                     }
00243                     initfields();
00244                     jQuery("#jobtype").change(function() {
00245                         initfields();
00246                     });
00247                })';
00248   print '</script>'."\n";
00249 }
00250 
00251 if ($action == 'delete')
00252 {
00253   print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1);
00254 
00255   $action='';
00256 }
00257 
00258 if ($action == 'execute'){
00259   print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1);
00260 
00261   $action='';
00262 }
00263 
00264 
00265 
00266 /*
00267  * Create Template
00268  */
00269 
00270 if (empty($object->status) && $action != 'create')
00271 {
00272   dol_htmloutput_mesg($langs->trans("CronTaskInactive"),'','warning',1);
00273 }
00274 
00275 if (($action=="create") || ($action=="edit"))
00276 {
00277   print '<form name="cronform" action="'.$_SERVER["PHP_SELF"].'" method="post">';
00278   print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n";
00279   if (!empty($object->id)) {
00280     print '<input type="hidden" name="action" value="update">'."\n";
00281     print '<input type="hidden" name="id" value="'.$object->id.'">'."\n";
00282   } else {
00283     print '<input type="hidden" name="action" value="add">'."\n";
00284   }
00285 
00286   print '<table class="border" width="100%">';
00287 
00288   print '<tr><td width="30%">';
00289   print $langs->trans('CronLabel')."</td>";
00290   print "<td><input type=\"text\" size=\"20\" name=\"label\" value=\"".$object->label."\" /> ";
00291   print "</td>";
00292   print "<td>";
00293   print "</td>";
00294   print "</tr>\n";
00295 
00296   print "<tr><td>";
00297   print $langs->trans('CronType')."</td><td>";
00298   print $formCron->select_typejob('jobtype',$object->jobtype);
00299   print "</td>";
00300   print "<td>";
00301   print "</td>";
00302   print "</tr>\n";
00303 
00304   print "<tr><td>";
00305   print $langs->trans('CronHourStart')."</td><td>";
00306   if(!empty($object->datestart))
00307   {
00308     $form->select_date($object->datestart,'datestart',1,1,'',"cronform");
00309   }
00310   else
00311   {
00312     $form->select_date('','datestart',1,1,'',"cronform");
00313   }
00314   print "</td>";
00315   print "<td>";
00316   print "</td>";
00317   print "</tr>\n";
00318 
00319   print "<tr><td>";
00320   print $langs->trans('CronDtEnd')."</td><td>";
00321   if(!empty($object->dateend)){
00322     $form->select_date($object->dateend,'dateend',1,1,'',"cronform");
00323   }
00324   else{
00325     $form->select_date('','dateend',1,1,1,"cronform");
00326   }
00327   print "</td>";
00328   print "<td>";
00329   print "</td>";
00330   print "</tr>\n";
00331 
00332   print "<tr><td>";
00333   print $langs->trans('CronPriority')."</td>";
00334   $priority=0;
00335   if (!empty($object->priority)) {
00336     $priority=$object->priority;
00337   }
00338   print "<td><input type=\"text\" size=\"2\" name=\"priority\" value=\"".$priority."\" /> ";
00339   print "</td>";
00340   print "<td>";
00341   print "</td>";
00342   print "</tr>\n";
00343 
00344   print "<tr><td>";
00345   print $langs->trans('CronEvery')."</td>";
00346   print "<td><select name=\"nbfrequency\">";
00347   for($i=1; $i<=60; $i++){
00348     if(($object->frequency/$object->unitfrequency) == $i){
00349       print "<option value='".$i."' selected='selected'>".$i."</option>";
00350     }
00351     else{
00352       print "<option value='".$i."'>".$i."</option>";
00353     }
00354   }
00355   $input = "<input type=\"radio\" name=\"unitfrequency\" value=\"60\" id=\"frequency_minute\" ";
00356   if($object->unitfrequency=="60"){
00357     $input .= ' checked="checked" />';
00358   }
00359   else{
00360     $input .= ' />';
00361   }
00362   $input .= "<label for=\"frequency_minute\">".$langs->trans('Minutes')."</label>";
00363   print $input;
00364 
00365   $input = "<input type=\"radio\" name=\"unitfrequency\" value=\"3600\" id=\"frequency_heures\" ";
00366   if($object->unitfrequency=="3600"){
00367     $input .= ' checked="checked" />';
00368   }
00369   else{
00370     $input .= ' />';
00371   }
00372   $input .= "<label for=\"frequency_heures\">".$langs->trans('Hours')."</label>";
00373   print $input;
00374 
00375   $input = "<input type=\"radio\" name=\"unitfrequency\" value=\"86400\" id=\"frequency_jours\" ";
00376   if($object->unitfrequency=="86400"){
00377     $input .= ' checked="checked" />';
00378   }
00379   else{
00380     $input .= ' />';
00381   }
00382   $input .= "<label for=\"frequency_jours\">".$langs->trans('Days')."</label>";
00383   print $input;
00384 
00385   $input = "<input type=\"radio\" name=\"unitfrequency\" value=\"604800\" id=\"frequency_semaine\" ";
00386   if($object->unitfrequency=="604800"){
00387     $input .= ' checked="checked" />';
00388   }
00389   else{
00390     $input .= ' />';
00391   }
00392   $input .= "<label for=\"frequency_semaine\">".$langs->trans('Weeks')."</label>";
00393   print $input;
00394   print "</td>";
00395   print "<td>";
00396   print "</td>";
00397   print "</tr>\n";
00398 
00399   print '<tr class="blockmethod"><td>';
00400   print $langs->trans('CronModule')."</td><td>";
00401   print "<input type=\"text\" size=\"20\" name=\"module_name\" value=\"".$object->module_name."\" /> ";
00402   print "</td>";
00403   print "<td>";
00404   print $form->textwithpicto('',$langs->trans("CronModuleHelp"),1,'help');
00405   print "</td>";
00406   print "</tr>\n";
00407 
00408   print '<tr class="blockmethod"><td>';
00409   print $langs->trans('CronClassFile')."</td><td>";
00410   print "<input type=\"text\" size=\"20\" name=\"classesname\" value=\"".$object->classesname."\" /> ";
00411   print "</td>";
00412   print "<td>";
00413   print $form->textwithpicto('',$langs->trans("CronClassFileHelp"),1,'help');
00414   print "</td>";
00415   print "</tr>\n";
00416 
00417   print '<tr class="blockmethod"><td>';
00418   print $langs->trans('CronObject')."</td><td>";
00419   print "<input type=\"text\" size=\"20\" name=\"objectname\" value=\"".$object->objectname."\" /> ";
00420   print "</td>";
00421   print "<td>";
00422   print $form->textwithpicto('',$langs->trans("CronObjectHelp"),1,'help');
00423   print "</td>";
00424   print "</tr>\n";
00425 
00426   print '<tr class="blockmethod"><td>';
00427   print $langs->trans('CronMethod')."</td><td>";
00428   print "<input type=\"text\" size=\"20\" name=\"methodename\" value=\"".$object->methodename."\" /> ";
00429   print "</td>";
00430   print "<td>";
00431   print $form->textwithpicto('',$langs->trans("CronMethodHelp"),1,'help');
00432   print "</td>";
00433   print "</tr>\n";
00434 
00435   print '<tr class="blockmethod"><td>';
00436   print $langs->trans('CronArgs')."</td><td>";
00437   print "<input type=\"text\" size=\"20\" name=\"params\" value=\"".$object->params."\" /> ";
00438   print "</td>";
00439   print "<td>";
00440   print $form->textwithpicto('',$langs->trans("CronArgsHelp"),1,'help');
00441   print "</td>";
00442   print "</tr>\n";
00443 
00444   print '<tr class="blockcommand"><td>';
00445   print $langs->trans('CronCommand')."</td><td>";
00446   print "<input type=\"text\" size=\"50\" name=\"command\" value=\"".$object->command."\" /> ";
00447   print "</td>";
00448   print "<td>";
00449   print $form->textwithpicto('',$langs->trans("CronCommandHelp"),1,'help');
00450   print "</td>";
00451   print "</tr>\n";
00452 
00453   print '<tr><td>';
00454   print $langs->trans('CronNote')."</td><td>";
00455   $doleditor = new DolEditor('note', $object->note, '', 160, 'dolibarr_notes', 'In', true, false, 0, 4, 90);
00456   $doleditor->Create();
00457   print "</td>";
00458   print "<td>";
00459   print "</td>";
00460   print "</tr>\n";
00461 
00462   print '</table>';
00463 
00464   print '<div align="center"><br>';
00465   print '<input type="submit" name="save" class="button" value="'.$langs->trans("Save").'">';
00466   print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
00467   print "</center>";
00468 
00469   print "</form>\n";
00470 
00471 }else {
00472 
00473   /*
00474    * view Template
00475    */
00476 
00477   // box add_jobs_box
00478   print '<table class="border" width="100%">';
00479 
00480   print '<tr><td width="30%">';
00481   print $langs->trans('CronId')."</td>";
00482   print "<td>".$form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'id');
00483   print "</td></tr>\n";
00484 
00485   print '<tr><td>';
00486   print $langs->trans('CronLabel')."</td>";
00487   print "<td>".$object->label;
00488   print "</td></tr>";
00489 
00490   print "<tr><td>";
00491   print $langs->trans('CronType')."</td><td>";
00492   print $formCron->select_typejob('jobtype',$object->jobtype,1);
00493   print "</td></tr>";
00494 
00495   print "<tr><td>";
00496   print $langs->trans('CronHourStart')."</td><td>";
00497   if(!empty($object->datestart)) {print dol_print_date($object->datestart,'dayhourtext');} else {print $langs->trans('CronNone');}
00498   print "</td></tr>";
00499 
00500   print "<tr><td>";
00501   print $langs->trans('CronDtEnd')."</td><td>";
00502   if(!empty($object->dateend)) {print dol_print_date($object->dateend,'dayhourtext');} else {print $langs->trans('CronNone');}
00503   print "</td></tr>";
00504 
00505   print "<tr><td>";
00506   print $langs->trans('CronPriority')."</td>";
00507   print "<td>".$object->priority;
00508   print "</td></tr>";
00509 
00510   print "<tr><td>";
00511   print $langs->trans('CronNbRun')."</td>";
00512   print "<td>".$object->nbrun;
00513   print "</td></tr>";
00514 
00515   print "<tr><td>";
00516   print $langs->trans('CronEvery')."</td>";
00517   print "<td>";
00518   if($object->unitfrequency == "60") print $langs->trans('CronEach')." ".($object->frequency/$object->unitfrequency)." ".$langs->trans('Minutes');
00519   if($object->unitfrequency == "3600") print $langs->trans('CronEach')." ".($object->frequency/$object->unitfrequency)." ".$langs->trans('Hours');
00520   if($object->unitfrequency == "86400") print $langs->trans('CronEach')." ".($object->frequency/$object->unitfrequency)." ".$langs->trans('Days');
00521   if($object->unitfrequency == "604800") print $langs->trans('CronEach')." ".($object->frequency/$object->unitfrequency)." ".$langs->trans('Weeks');
00522   print "</td></tr>";
00523 
00524 
00525   print '<tr class="blockmethod"><td>';
00526   print $langs->trans('CronModule')."</td><td>";
00527   print $object->module_name;
00528   print "</td></tr>";
00529 
00530   print '<tr class="blockmethod"><td>';
00531   print $langs->trans('CronClassFile')."</td><td>";
00532   print $object->classesname;
00533   print "</td></tr>";
00534 
00535   print '<tr class="blockmethod"><td>';
00536   print $langs->trans('CronObject')."</td><td>";
00537   print $object->objectname;
00538   print "</td></tr>";
00539 
00540   print '<tr class="blockmethod"><td>';
00541   print $langs->trans('CronMethod')."</td><td>";
00542   print $object->methodename;
00543   print "</td></tr>";
00544 
00545   print '<tr class="blockmethod"><td>';
00546   print $langs->trans('CronArgs')."</td><td>";
00547   print $object->params;
00548   print "</td></tr>";
00549 
00550   print '<tr class="blockcommand"><td>';
00551   print $langs->trans('CronCommand')."</td><td>";
00552   print $object->command;
00553   print "</td></tr>";
00554 
00555   print '<tr><td>';
00556   print $langs->trans('CronNote')."</td><td>";
00557   print $object->note;
00558   print "</td></tr>";
00559 
00560   print '<tr><td>';
00561   print $langs->trans('CronDtLastLaunch')."</td><td>";
00562   if(!empty($object->datelastrun)) {print dol_print_date($object->datelastrun,'dayhourtext');} else {print $langs->trans('CronNone');}
00563   print "</td></tr>";
00564 
00565   print '<tr><td>';
00566   print $langs->trans('CronDtNextLaunch')."</td><td>";
00567   if(!empty($object->datenextrun)) {print dol_print_date($object->datenextrun,'dayhourtext');} else {print $langs->trans('CronNone');}
00568   print "</td></tr>";
00569 
00570   print '<tr><td>';
00571   print $langs->trans('CronDtLastResult')."</td><td>";
00572   if(!empty($object->datelastresult)) {print dol_print_date($object->datelastresult,'dayhourtext');} else {print $langs->trans('CronNone');}
00573   print "</td></tr>";
00574 
00575   print '<tr><td>';
00576   print $langs->trans('CronLastResult')."</td><td>";
00577   print $object->lastresult;
00578   print "</td></tr>";
00579 
00580   print '<tr><td>';
00581   print $langs->trans('CronLastOutput')."</td><td>";
00582   print nl2br($object->lastoutput);
00583   print "</td></tr>";
00584 
00585   print '</table>';
00586 
00587 
00588   dol_fiche_end();
00589 
00590 
00591   print "\n\n<div class=\"tabsAction\">\n";
00592   if (! $user->rights->cron->create) {
00593     print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("Edit").'</a>';
00594   } else {
00595     print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&id='.$object->id.'">'.$langs->trans("Edit").'</a>';
00596   }
00597   if (! $user->rights->cron->delete) {
00598     print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("Delete").'</a>';
00599   } else {
00600     print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$object->id.'">'.$langs->trans("Delete").'</a>';
00601   }
00602   if (! $user->rights->cron->create) {
00603     print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("CronStatusActiveBtn").'/'.$langs->trans("CronStatusInactiveBtn").'</a>';
00604   } else {
00605     if (empty($object->status)) {
00606       print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=activate&id='.$object->id.'">'.$langs->trans("CronStatusActiveBtn").'</a>';
00607     } else {
00608       print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=inactive&id='.$object->id.'">'.$langs->trans("CronStatusInactiveBtn").'</a>';
00609     }
00610   }
00611   if ((empty($user->rights->cron->execute)))
00612   {
00613     print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("CronExecute").'</a>';
00614   }
00615   else if (empty($object->status))
00616   {
00617     print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("TaskDisabled")).'">'.$langs->trans("CronExecute").'</a>';
00618   }
00619   else {
00620     print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=execute&id='.$object->id.'">'.$langs->trans("CronExecute").'</a>';
00621   }
00622   print '<br><br></div>';
00623 }
00624 
00625 
00626 llxFooter();
00627 
00628 $db->close();
00629 ?>