diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php
index 913da57ac39..e00ac9dcc71 100644
--- a/htdocs/cron/list.php
+++ b/htdocs/cron/list.php
@@ -18,7 +18,7 @@
*/
/**
- * \file htdocs/cron/cron/list.php
+ * \file htdocs/cron/list.php
* \ingroup cron
* \brief Lists Jobs
*/
@@ -356,11 +356,7 @@ if ($num > 0)
if (! verifCond($obj->test)) continue; // Discard line with test = false
- // title profil
- if ($style=='pair') {$style='impair';}
- else {$style='pair';}
-
- print '
';
print '';
print '';
diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang
index 8eb03114c64..0186ffd1317 100644
--- a/htdocs/langs/en_US/cron.lang
+++ b/htdocs/langs/en_US/cron.lang
@@ -14,6 +14,8 @@ FileToLaunchCronJobs=Command line to launch cron jobs
CronExplainHowToRunUnix=On Unix environment you should use the following crontab entry to run the command line each 5 minutes
CronExplainHowToRunWin=On Microsoft(tm) Windows environement you can use Scheduled task tools to run the command line each 5 minutes
CronMethodDoesNotExists=Class %s does not contains any method %s
+CronJobDefDesc=Cron job profiles are defined into the module descriptor file. When module is activated, they are loaded and available so you can administer the jobs from the admin tools menu %s.
+CronJobProfiles=List of predefined cron job profiles
# Menu
EnabledAndDisabled=Enabled and disabled
# Page list
@@ -53,6 +55,7 @@ CronSaveSucess=Save successfully
CronNote=Comment
CronFieldMandatory=Fields %s is mandatory
CronErrEndDateStartDt=End date cannot be before start date
+StatusAtInstall=Status at installation
CronStatusActiveBtn=Enable
CronStatusInactiveBtn=Disable
CronTaskInactive=This job is disabled
diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php
index 4298505a18b..9b804e03cab 100644
--- a/htdocs/modulebuilder/index.php
+++ b/htdocs/modulebuilder/index.php
@@ -690,43 +690,24 @@ print load_fiche_titre($text, '', 'title_setup');
$listofmodules=array();
-/*
-if (!empty($conf->modulebuilder->enabled) && $mainmenu == 'modulebuilder') // Entry for Module builder
-{
- global $dolibarr_main_document_root_alt;
- if (! empty($dolibarr_main_document_root_alt) && is_array($dolibarr_main_document_root_alt))
- {
- foreach ($dolibarr_main_document_root_alt as $diralt)
- {*/
- $dirsincustom=dol_dir_list($dirins, 'directories');
-
- if (is_array($dirsincustom) && count($dirsincustom) > 0)
- {
- foreach ($dirsincustom as $dircustomcursor)
- {
- $fullname = $dircustomcursor['fullname'];
- if (dol_is_file($fullname.'/'.$FILEFLAG))
- {
- // Get real name of module (MyModule instead of mymodule)
- $descriptorfiles = dol_dir_list($fullname.'/core/modules/', 'files', 0, 'mod.*\.class\.php$');
- $modulenamewithcase='';
- foreach($descriptorfiles as $descriptorcursor)
- {
- $modulenamewithcase=preg_replace('/^mod/', '', $descriptorcursor['name']);
- $modulenamewithcase=preg_replace('/\.class\.php$/', '', $modulenamewithcase);
- }
- if ($modulenamewithcase) $listofmodules[$dircustomcursor['name']]=$modulenamewithcase;
- //var_dump($listofmodules);
- }
- }
- }
-/* }
- }
- else
- {
- $newmenu->add('', 'NoGeneratedModuleFound', 0, 0);
- }*/
-
+$dirsincustom=dol_dir_list($dirins, 'directories');
+if (is_array($dirsincustom) && count($dirsincustom) > 0) {
+ foreach ($dirsincustom as $dircustomcursor) {
+ $fullname = $dircustomcursor['fullname'];
+ if (dol_is_file($fullname . '/' . $FILEFLAG)) {
+ // Get real name of module (MyModule instead of mymodule)
+ $descriptorfiles = dol_dir_list($fullname . '/core/modules/', 'files', 0, 'mod.*\.class\.php$');
+ $modulenamewithcase = '';
+ foreach ($descriptorfiles as $descriptorcursor) {
+ $modulenamewithcase = preg_replace('/^mod/', '', $descriptorcursor['name']);
+ $modulenamewithcase = preg_replace('/\.class\.php$/', '', $modulenamewithcase);
+ }
+ if ($modulenamewithcase)
+ $listofmodules[$dircustomcursor['name']] = $modulenamewithcase;
+ // var_dump($listofmodules);
+ }
+ }
+}
// Show description of content
$newdircustom=$dirins;
@@ -764,7 +745,6 @@ if ($message)
}
print $langs->trans("ModuleBuilderDesc3", count($listofmodules), $FILEFLAG).' ';
-//print ' ';
// Load module descriptor
@@ -930,6 +910,11 @@ elseif (! empty($module))
$head2[$h][2] = 'widgets';
$h++;
+ $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=cron&module='.$module;
+ $head2[$h][1] = $langs->trans("CronList");
+ $head2[$h][2] = 'cron';
+ $h++;
+
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=buildpackage&module='.$module;
$head2[$h][1] = $langs->trans("BuildPackage");
$head2[$h][2] = 'buildpackage';
@@ -1560,6 +1545,119 @@ elseif (! empty($module))
}
}
+ if ($tab == 'cron')
+ {
+ $pathtofile = $modulelowercase.'/core/modules/mod'.$module.'.class.php';
+
+ $cronjobs = $moduleobj->cronjobs;
+
+ if ($action != 'editfile' || empty($file))
+ {
+ print $langs->trans("CronJobDefDesc", ''.$langs->trans('CronList').'').' ';
+ print ' ';
+
+ print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.'';
+ print ' '.img_picto($langs->trans("Edit"), 'edit').'';
+ print ' ';
+
+ print ' ';
+ print load_fiche_titre($langs->trans("CronJobProfiles"), '', '');
+
+ print '';
+ }
+ }
+
if ($tab == 'buildpackage')
{
if (! class_exists('ZipArchive') && ! defined('ODTPHP_PATHTOPCLZIP'))
|