50 $this->family =
"base";
52 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
53 $this->
description =
"Enable the Dolibarr cron service";
55 $this->version =
'dolibarr';
57 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
59 $this->picto =
'cron';
62 $this->dirs = array();
66 $this->config_page_url = array(
"cron.php@cron");
70 $this->hidden = !empty($conf->global->MODULE_CRON_DISABLED);
71 $this->depends = array();
72 $this->requiredby = array();
73 $this->conflictwith = array();
74 $this->langfiles = array(
"cron");
91 $this->tabs = array();
96 0 => array(
'file' =>
'box_scheduled_jobs.php',
'enabledbydefaulton' =>
'Home')
100 $this->cronjobs = array(
101 0=>array(
'entity'=>0,
'label'=>
'PurgeDeleteTemporaryFilesShort',
'jobtype'=>
'method',
'class'=>
'core/class/utils.class.php',
'objectname'=>
'Utils',
'method'=>
'purgeFiles',
'parameters'=>
'tempfilesold+logfiles',
'comment'=>
'PurgeDeleteTemporaryFiles',
'frequency'=>2,
'unitfrequency'=>3600 * 24 * 7,
'priority'=>50,
'status'=>1,
'test'=>
true),
102 1=>array(
'entity'=>0,
'label'=>
'MakeLocalDatabaseDumpShort',
'jobtype'=>
'method',
'class'=>
'core/class/utils.class.php',
'objectname'=>
'Utils',
'method'=>
'dumpDatabase',
'parameters'=>
'none,auto,1,auto,10,0,0',
'comment'=>
'MakeLocalDatabaseDump',
'frequency'=>1,
'unitfrequency'=>3600 * 24 * 7,
'priority'=>90,
'status'=>0,
'test'=>
'in_array($conf->db->type, array(\'mysql\', \'mysqli\'))'),
103 2=>array(
'entity'=>0,
'label'=>
'MakeSendLocalDatabaseDumpShort',
'jobtype'=>
'method',
'class'=>
'core/class/utils.class.php',
'objectname'=>
'Utils',
'method'=>
'sendBackup',
'parameters'=>
',,,,,sql',
'comment'=>
'MakeSendLocalDatabaseDump',
'frequency'=>1,
'unitfrequency'=>604800,
'priority'=>91,
'status'=>0,
'test'=>
'!empty($conf->global->MAIN_ALLOW_BACKUP_BY_EMAIL) && in_array($conf->db->type, array(\'mysql\', \'mysqli\'))'),
104 3=>array(
'entity'=>0,
'label'=>
'CleanUnfinishedCronjobShort',
'jobtype'=>
'method',
'class'=>
'core/class/utils.class.php',
'objectname'=>
'Utils',
'method'=>
'cleanUnfinishedCronjob',
'parameters'=>
'',
'comment'=>
'CleanUnfinishedCronjob',
'frequency'=>5,
'unitfrequency'=>60,
'priority'=>10,
'status'=>0,
'test'=>
'getDolGlobalInt("MAIN_FEATURES_LEVEL") >= 2'),
109 $this->rights = array();
110 $this->rights_class =
'cron';
113 $this->rights[$r][0] = 23001;
114 $this->rights[$r][1] =
'Read cron jobs';
115 $this->rights[$r][3] = 0;
116 $this->rights[$r][4] =
'read';
119 $this->rights[$r][0] = 23002;
120 $this->rights[$r][1] =
'Create cron Jobs';
121 $this->rights[$r][3] = 0;
122 $this->rights[$r][4] =
'create';
125 $this->rights[$r][0] = 23003;
126 $this->rights[$r][1] =
'Delete cron Jobs';
127 $this->rights[$r][3] = 0;
128 $this->rights[$r][4] =
'delete';
131 $this->rights[$r][0] = 23004;
132 $this->rights[$r][1] =
'Execute cron Jobs';
133 $this->rights[$r][3] = 0;
134 $this->rights[$r][4] =
'execute';
139 $this->menu[$r] = array(
'fk_menu'=>
'fk_mainmenu=home,fk_leftmenu=admintools',
142 'url'=>
'/cron/list.php?leftmenu=admintools',
145 'enabled'=>
'$conf->cron->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)',
146 'perms'=>
'$user->rights->cron->read',