';
@@ -2258,7 +2274,12 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
}
if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) {
- print 'getVersion(1).'">';
+ $versionTitle = $langs->trans("Version").' '.$this->getVersion(1);
+ if ($this->needUpdate) {
+ $versionTitle.= '
'.$langs->trans('ModuleUpdateAvailable').' : '.$this->lastVersion;
+ }
+
+ print '';
print $this->getVersion(1);
print '';
}
@@ -2287,4 +2308,33 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
';
}
+
+ /**
+ * check for module update
+ * TODO : store results for $this->url_last_version and $this->needUpdate
+ * Add a cron task to monitor for updates
+ *
+ * @return int <0 if Error, 0 == no update needed, >0 if need update
+ */
+ public function checkForUpdate()
+ {
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
+ if (!empty($this->url_last_version)) {
+ $lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only
+ if (isset($lastVersion['content']) && strlen($lastVersion['content']) < 30) {
+ // Security warning : be careful with remote data content, the module editor could be hacked (or evil) so limit to a-z A-Z 0-9 _ . -
+ $this->lastVersion = preg_replace("/[^a-zA-Z0-9_\.\-]+/", "", $lastVersion['content']);
+ if (version_compare($this->lastVersion, $this->version) > 0) {
+ $this->needUpdate = true;
+ return 1;
+ } else {
+ $this->needUpdate = false;
+ return 0;
+ }
+ } else {
+ return -1;
+ }
+ }
+ return 0;
+ }
}
diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php
index 691828cd9d2..7a593740590 100644
--- a/htdocs/core/modules/modAgenda.class.php
+++ b/htdocs/core/modules/modAgenda.class.php
@@ -415,7 +415,7 @@ class modAgenda extends DolibarrModules
'langs' => 'agenda',
'position' => 170,
'perms' => '$user->rights->agenda->allactions->read',
- 'enabled' => '$conf->categorie->enabled&&$conf->categorie->enabled',
+ 'enabled' => '$conf->categorie->enabled',
'target' => '',
'user' => 2
);
@@ -456,8 +456,12 @@ class modAgenda extends DolibarrModules
'p.ref' => 'project',
);
+ $keyforselect = 'actioncomm'; $keyforelement = 'action'; $keyforaliasextra = 'extra';
+ include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
+
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'actioncomm as ac';
+ $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_extrafields as extra ON ac.id = extra.fk_object';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_actioncomm as cac on ac.fk_action = cac.id';
if (!empty($user) && empty($user->rights->agenda->allactions->read)) {
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_resources acr on ac.id = acr.fk_actioncomm';
diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php
index d1ad993af68..8e9d242a6e3 100644
--- a/htdocs/core/modules/modFacture.class.php
+++ b/htdocs/core/modules/modFacture.class.php
@@ -121,6 +121,7 @@ class modFacture extends DolibarrModules
$datestart = dol_mktime(23, 0, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']);
$this->cronjobs = array(
0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>1, 'test'=>'$conf->facture->enabled', 'datestart'=>$datestart),
+ 1=>array('label'=>'SendEmailsRemindersOnDueDate', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture.class.php', 'objectname'=>'Facture', 'method'=>'sendEmailsReminderOnDueDate', 'parameters'=>"10,all,EmailTemplateCode", 'comment'=>'Send an emails when the unpaid invoices reach a due date + n days (an email template with EmailTemplateCode must exists. the version in the language of the thirdparty will be used in priority)', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>0, 'test'=>'$conf->facture->enabled', 'datestart'=>$datestart),
);
// Permissions
diff --git a/htdocs/core/tpl/bloc_comment.tpl.php b/htdocs/core/tpl/bloc_comment.tpl.php
index bf148c2124f..f30bb0c5c61 100644
--- a/htdocs/core/tpl/bloc_comment.tpl.php
+++ b/htdocs/core/tpl/bloc_comment.tpl.php
@@ -80,9 +80,9 @@ if (!empty($object->comments)) {
print '
'; + print Form::showphoto('userphoto', $userstatic, 80, 0, 0, '', 'small', 0, 1).'
'; } - print $langs->trans('User').' : '.$userstatic->getNomUrl().'
'; + print $langs->trans('User').' : '.$userstatic->getNomUrl().'
'; print $langs->trans('Date').' : '.dol_print_date($comment->datec, 'dayhoursec'); print '