diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php
index 9c5418ac19d..1283c5698d3 100644
--- a/htdocs/admin/mails.php
+++ b/htdocs/admin/mails.php
@@ -829,23 +829,23 @@ if ($action == 'edit') {
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') {
if (!empty($conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD)) {
// List of string to add in SPF if the setup use the mail method. Example 'include:sendgrid.net include:spf.mydomain.com'
- $text .= ($text ? ' ' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD);
+ $text .= ($text ? ' ' : '').''.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD);
} else {
// MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is list of IPs where email is sent from. Example: '1.2.3.4, [aaaa:bbbb:cccc:dddd]'.
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS)) {
// List of IP show as record to add in SPF if we use the mail method
- $text .= ($text ? ' ' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
+ $text .= ($text ? ' ' : '').''.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
}
}
} else {
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS)) {
// List of IP show as record to add as allowed IP if we use the smtp method. Value is '1.2.3.4, [aaaa:bbbb:cccc:dddd]'
// TODO Add a key to allow to show the IP/name of server detected dynamically
- $text .= ($text ? ' ' : '').$langs->trans("WarningPHPMail2", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
+ $text .= ($text ? ' ' : '').''.$langs->trans("WarningPHPMail2", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
}
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD)) { // Should be required only if you have preset the Dolibarr to use your own SMTP and you want to warn users to update their domain name to match your SMTP server.
// List of string to add in SPF if we use the smtp method. Example 'include:spf.mydomain.com'
- $text .= ($text ? ' ' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD);
+ $text .= ($text ? ' ' : '').''.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD);
}
}
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 4f9ec52dd8d..0478b4e215f 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -691,9 +691,9 @@ class FormMail extends Form
$out .= '
';
$out .= $langs->trans("GroupEmails");
$out .= ' ';
- $out .= ' withoptiononeemailperrecipient > 0 ? ' checked="checked"' : '').'> ';
- $out .= $langs->trans("OneEmailPerRecipient");
- $out .= '';
+ $out .= ' withoptiononeemailperrecipient > 0 ? ' checked="checked"' : '').'> ';
+ $out .= ''.$langs->trans("OneEmailPerRecipient").' ';
+ $out .= '';
$out .= ' - ';
$out .= $langs->trans("WarningIfYouCheckOneRecipientPerEmail");
$out .= ' ';
@@ -773,12 +773,11 @@ class FormMail extends Form
if (!empty($this->withmaindocfile)) {
if ($this->withmaindocfile == 1) {
- $out .= ' ';
+ $out .= ' ';
+ } elseif ($this->withmaindocfile == -1) {
+ $out .= ' ';
}
- if ($this->withmaindocfile == -1) {
- $out .= ' ';
- }
- $out .= ' '.$langs->trans("JoinMainDoc").'. ';
+ $out .= ' '.$langs->trans("JoinMainDoc").'. ';
}
if (is_numeric($this->withfile)) {
diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php
index 184c99a95e7..9eeb76cc3cf 100644
--- a/htdocs/core/modules/import/import_csv.modules.php
+++ b/htdocs/core/modules/import/import_csv.modules.php
@@ -586,18 +586,22 @@ class ImportCsv extends ModeleImports
$arrayrecord[($key - 1)]['type'] = -1; // If we get empty value, we will use "null"
}
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'getrefifauto') {
- $defaultref = '';
- // TODO provide the $modTask (module of generation of ref) as parameter of import_insert function
- $obj = empty($conf->global->PROJECT_TASK_ADDON) ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON;
- if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php")) {
- require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.'.php';
- $modTask = new $obj;
- $defaultref = $modTask->getNextValue(null, null);
- }
- if (is_numeric($defaultref) && $defaultref <= 0) {
+ if (strtolower($newval) == 'auto') {
$defaultref = '';
+
+ $classModForNumber = $objimport->array_import_convertvalue[0][$val]['class'];
+ $pathModForNumber = $objimport->array_import_convertvalue[0][$val]['path'];
+
+ if (!empty($classModForNumber) && !empty($pathModForNumber) && is_readable(DOL_DOCUMENT_ROOT.$pathModForNumber)) {
+ require_once DOL_DOCUMENT_ROOT.$pathModForNumber;
+ $modForNumber = new $classModForNumber;
+ $defaultref = $modForNumber->getNextValue(null, null);
+ }
+ if (is_numeric($defaultref) && $defaultref <= 0) {
+ $defaultref = '';
+ }
+ $newval = $defaultref;
}
- $newval = $defaultref;
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'compute') {
$file = (empty($objimport->array_import_convertvalue[0][$val]['classfile']) ? $objimport->array_import_convertvalue[0][$val]['file'] : $objimport->array_import_convertvalue[0][$val]['classfile']);
$class = $objimport->array_import_convertvalue[0][$val]['class'];
diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php
index aaca0d3bd77..0171eb83ea9 100644
--- a/htdocs/core/modules/import/import_xlsx.modules.php
+++ b/htdocs/core/modules/import/import_xlsx.modules.php
@@ -627,18 +627,22 @@ class ImportXlsx extends ModeleImports
$arrayrecord[($key)]['type'] = -1; // If we get empty value, we will use "null"
}
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'getrefifauto') {
- $defaultref = '';
- // TODO provide the $modTask (module of generation of ref) as parameter of import_insert function
- $obj = empty($conf->global->PROJECT_TASK_ADDON) ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON;
- if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . $conf->global->PROJECT_TASK_ADDON . ".php")) {
- require_once DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . $conf->global->PROJECT_TASK_ADDON . '.php';
- $modTask = new $obj;
- $defaultref = $modTask->getNextValue(null, null);
- }
- if (is_numeric($defaultref) && $defaultref <= 0) {
+ if (strtolower($newval) == 'auto') {
$defaultref = '';
+
+ $classModForNumber = $objimport->array_import_convertvalue[0][$val]['class'];
+ $pathModForNumber = $objimport->array_import_convertvalue[0][$val]['path'];
+
+ if (!empty($classModForNumber) && !empty($pathModForNumber) && is_readable(DOL_DOCUMENT_ROOT.$pathModForNumber)) {
+ require_once DOL_DOCUMENT_ROOT.$pathModForNumber;
+ $modForNumber = new $classModForNumber;
+ $defaultref = $modForNumber->getNextValue(null, null);
+ }
+ if (is_numeric($defaultref) && $defaultref <= 0) {
+ $defaultref = '';
+ }
+ $newval = $defaultref;
}
- $newval = $defaultref;
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'compute') {
$file = (empty($objimport->array_import_convertvalue[0][$val]['classfile']) ? $objimport->array_import_convertvalue[0][$val]['file'] : $objimport->array_import_convertvalue[0][$val]['classfile']);
$class = $objimport->array_import_convertvalue[0][$val]['class'];
diff --git a/htdocs/core/modules/member/mod_member_simple.php b/htdocs/core/modules/member/mod_member_simple.php
new file mode 100644
index 00000000000..50eccd0f244
--- /dev/null
+++ b/htdocs/core/modules/member/mod_member_simple.php
@@ -0,0 +1,183 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ * or see https://www.gnu.org/
+ */
+
+/**
+ * \file htdocs/core/modules/member/mod_member_simple.php
+ * \ingroup member
+ * \brief File with class to manage the numbering module Simple for member references
+ */
+
+require_once DOL_DOCUMENT_ROOT.'/core/modules/member/modules_member.class.php';
+
+
+/**
+ * Class to manage the numbering module Simple for member references
+ */
+class mod_member_simple extends ModeleNumRefMembers
+{
+ /**
+ * Dolibarr version of the loaded document
+ * @var string
+ */
+ public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
+
+ public $prefix = 'MEM';
+
+ /**
+ * @var string Error code (or message)
+ */
+ public $error = '';
+
+ /**
+ * @var string Nom du modele
+ * @deprecated
+ * @see $name
+ */
+ public $nom = 'Simple';
+
+ /**
+ * @var string model name
+ */
+ public $name = 'Simple';
+
+
+ /**
+ * Return description of numbering module
+ *
+ * @return string Text with description
+ */
+ public function info()
+ {
+ global $langs;
+ return $langs->trans("SimpleNumRefModelDesc", $this->prefix);
+ }
+
+
+ /**
+ * Return an example of numbering module values
+ *
+ * @return string Example
+ */
+ public function getExample()
+ {
+ return $this->prefix."0501-0001";
+ }
+
+
+ /**
+ * Checks if the numbers already in the database do not
+ * cause conflicts that would prevent this numbering working.
+ *
+ * @return boolean false if conflict, true if ok
+ */
+ public function canBeActivated()
+ {
+ global $conf, $langs, $db;
+
+ $coyymm = '';
+ $max = '';
+
+ $posindice = strlen($this->prefix) + 6;
+ $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
+ $sql .= " FROM ".MAIN_DB_PREFIX."adherent";
+ $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
+ $sql .= " AND entity = ".$conf->entity;
+ $resql = $db->query($sql);
+ if ($resql) {
+ $row = $db->fetch_row($resql);
+ if ($row) {
+ $coyymm = substr($row[0], 0, 6);
+ $max = $row[0];
+ }
+ }
+ if (!$coyymm || preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm)) {
+ return true;
+ } else {
+ $langs->load("errors");
+ $this->error = $langs->trans('ErrorNumRefModel', $max);
+ return false;
+ }
+ }
+
+
+ /**
+ * Return next value
+ *
+ * @param Societe $objsoc Object third party
+ * @param Object $object Object we need next value for
+ * @return string Value if OK, 0 if KO
+ */
+ public function getNextValue($objsoc, $object)
+ {
+ global $db, $conf;
+
+ /*
+ // First, we get the max value
+ $posindice = strlen($this->prefix) + 6;
+ $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
+ $sql .= " FROM ".MAIN_DB_PREFIX."adherent";
+ $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
+ $sql .= " AND entity = ".$conf->entity;
+
+ $resql = $db->query($sql);
+ if ($resql) {
+ $obj = $db->fetch_object($resql);
+ if ($obj) {
+ $max = intval($obj->max);
+ } else {
+ $max = 0;
+ }
+ } else {
+ dol_syslog("mod_member_simple::getNextValue", LOG_DEBUG);
+ return -1;
+ }
+
+ $date = empty($object->date_c) ? dol_now() : $object->date_c;
+
+ //$yymm = strftime("%y%m",time());
+ $yymm = strftime("%y%m", $date);
+
+ if ($max >= (pow(10, 4) - 1)) {
+ $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
+ } else {
+ $num = sprintf("%04s", $max + 1);
+ }
+
+ dol_syslog("mod_member_simple::getNextValue return ".$this->prefix.$yymm."-".$num);
+ return $this->prefix.$yymm."-".$num;
+ */
+
+ // For the moment, the ref of a member is the rowid
+ $sql = "SELECT MAX(rowid) as max";
+ $sql .= " FROM ".MAIN_DB_PREFIX."adherent";
+
+ $resql = $db->query($sql);
+ if ($resql) {
+ $obj = $db->fetch_object($resql);
+ if ($obj) {
+ $max = intval($obj->max);
+ } else {
+ $max = 0;
+ }
+ } else {
+ dol_syslog("mod_member_simple::getNextValue", LOG_DEBUG);
+ return -1;
+ }
+ return ($max + 1);
+ }
+}
diff --git a/htdocs/core/modules/member/modules_member.class.php b/htdocs/core/modules/member/modules_member.class.php
index 3a1b4edcc1d..cdc37231901 100644
--- a/htdocs/core/modules/member/modules_member.class.php
+++ b/htdocs/core/modules/member/modules_member.class.php
@@ -60,3 +60,97 @@ abstract class ModelePDFMember extends CommonDocGenerator
return $list;
}
}
+
+
+
+/**
+ * Classe mere des modeles de numerotation des references de members
+ */
+abstract class ModeleNumRefMembers
+{
+ /**
+ * @var string Error code (or message)
+ */
+ public $error = '';
+
+ /**
+ * Return if a module can be used or not
+ *
+ * @return boolean true if module can be used
+ */
+ public function isEnabled()
+ {
+ return true;
+ }
+
+ /**
+ * Renvoi la description par defaut du modele de numerotation
+ *
+ * @return string Texte descripif
+ */
+ public function info()
+ {
+ global $langs;
+ $langs->load("members");
+ return $langs->trans("NoDescription");
+ }
+
+ /**
+ * Return an example of numbering
+ *
+ * @return string Example
+ */
+ public function getExample()
+ {
+ global $langs;
+ $langs->load("members");
+ return $langs->trans("NoExample");
+ }
+
+ /**
+ * Checks if the numbers already in the database do not
+ * cause conflicts that would prevent this numbering working.
+ *
+ * @return boolean false if conflict, true if ok
+ */
+ public function canBeActivated()
+ {
+ return true;
+ }
+
+ /**
+ * Renvoi prochaine valeur attribuee
+ *
+ * @param Societe $objsoc Object third party
+ * @param Object $object Object we need next value for
+ * @return string Valeur
+ */
+ public function getNextValue($objsoc, $object)
+ {
+ global $langs;
+ return $langs->trans("NotAvailable");
+ }
+
+ /**
+ * Renvoi version du module numerotation
+ *
+ * @return string Valeur
+ */
+ public function getVersion()
+ {
+ global $langs;
+ $langs->load("admin");
+
+ if ($this->version == 'development') {
+ return $langs->trans("VersionDevelopment");
+ } elseif ($this->version == 'experimental') {
+ return $langs->trans("VersionExperimental");
+ } elseif ($this->version == 'dolibarr') {
+ return DOL_VERSION;
+ } elseif ($this->version) {
+ return $this->version;
+ } else {
+ return $langs->trans("NotAvailable");
+ }
+ }
+}
diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php
index c354a11440e..47edfcc9ca2 100644
--- a/htdocs/core/modules/modAdherent.class.php
+++ b/htdocs/core/modules/modAdherent.class.php
@@ -286,7 +286,7 @@ class modAdherent extends DolibarrModules
$this->export_label[$r] = 'MembersAndSubscriptions';
$this->export_permission[$r] = array(array("adherent", "export"));
$this->export_fields_array[$r] = array(
- 'a.rowid'=>'Id', 'a.civility'=>"UserTitle", 'a.lastname'=>"Lastname", 'a.firstname'=>"Firstname", 'a.login'=>"Login", 'a.gender'=>"Gender", 'a.morphy'=>'Nature',
+ 'a.rowid'=>'Id', 'a.civility'=>"UserTitle", 'a.lastname'=>"Lastname", 'a.firstname'=>"Firstname", 'a.login'=>"Login", 'a.gender'=>"Gender", 'a.morphy'=>'MemberNature',
'a.societe'=>'Company', 'a.address'=>"Address", 'a.zip'=>"Zip", 'a.town'=>"Town", 'd.nom'=>"State", 'co.code'=>"CountryCode", 'co.label'=>"Country",
'a.phone'=>"PhonePro", 'a.phone_perso'=>"PhonePerso", 'a.phone_mobile'=>"PhoneMobile", 'a.email'=>"Email", 'a.birth'=>"Birthday", 'a.statut'=>"Status",
'a.photo'=>"Photo", 'a.note_public'=>"NotePublic", 'a.note_private'=>"NotePrivate", 'a.datec'=>'DateCreation', 'a.datevalid'=>'DateValidation',
@@ -338,8 +338,9 @@ class modAdherent extends DolibarrModules
$this->import_tables_array[$r] = array('a'=>MAIN_DB_PREFIX.'adherent', 'extra'=>MAIN_DB_PREFIX.'adherent_extrafields');
$this->import_tables_creator_array[$r] = array('a'=>'fk_user_author'); // Fields to store import user id
$this->import_fields_array[$r] = array(
+ 'a.ref' => 'Member Ref*',
'a.civility'=>"UserTitle", 'a.lastname'=>"Lastname*", 'a.firstname'=>"Firstname", 'a.gender'=>"Gender", 'a.login'=>"Login*", "a.pass"=>"Password",
- "a.fk_adherent_type"=>"MemberType*", 'a.morphy'=>'Nature*', 'a.societe'=>'Company', 'a.address'=>"Address", 'a.zip'=>"Zip", 'a.town'=>"Town",
+ "a.fk_adherent_type"=>"MemberType*", 'a.morphy'=>'MemberNature*', 'a.societe'=>'Company', 'a.address'=>"Address", 'a.zip'=>"Zip", 'a.town'=>"Town",
'a.state_id'=>'StateId', 'a.country'=>"CountryId", 'a.phone'=>"PhonePro", 'a.phone_perso'=>"PhonePerso", 'a.phone_mobile'=>"PhoneMobile",
'a.email'=>"Email", 'a.birth'=>"Birthday", 'a.statut'=>"Status*", 'a.photo'=>"Photo", 'a.note_public'=>"NotePublic", 'a.note_private'=>"NotePrivate",
'a.datec'=>'DateCreation', 'a.datefin'=>'DateEndSubscription'
@@ -358,7 +359,27 @@ class modAdherent extends DolibarrModules
}
}
// End add extra fields
- $this->import_convertvalue_array[$r] = array();
+ $this->import_convertvalue_array[$r] = array(
+ 'a.ref'=>array(
+ 'rule'=>'getrefifauto',
+ 'class'=>(empty($conf->global->MEMBER_ADDON) ? 'mod_member_simple' : $conf->global->MEMBER_ADDON),
+ 'path'=>"/core/modules/member/".(empty($conf->global->MEMBER_ADDON) ? 'mod_member_simple' : $conf->global->MEMBER_ADDON).'.php'
+ ),
+ 'a.state_id' => array(
+ 'rule' => 'fetchidfromcodeid',
+ 'classfile' => '/core/class/cstate.class.php',
+ 'class' => 'Cstate',
+ 'method' => 'fetch',
+ 'dict' => 'DictionaryStateCode'
+ ),
+ 'a.country' => array(
+ 'rule' => 'fetchidfromcodeid',
+ 'classfile' => '/core/class/ccountry.class.php',
+ 'class' => 'Ccountry',
+ 'method' => 'fetch',
+ 'dict' => 'DictionaryCountry'
+ )
+ );
if (!empty($conf->societe->enabled)) {
$this->import_convertvalue_array[$r]['a.fk_soc'] = array('rule'=>'fetchidfromref', 'classfile'=>'/societe/class/societe.class.php', 'class'=>'Societe', 'method'=>'fetch', 'element'=>'ThirdParty');
}
@@ -367,6 +388,7 @@ class modAdherent extends DolibarrModules
'a.civility'=>'code@'.MAIN_DB_PREFIX.'c_civility', 'a.fk_adherent_type'=>'rowid@'.MAIN_DB_PREFIX.'adherent_type', 'a.morphy'=>'(phy|mor)',
'a.statut'=>'^[0|1]', 'a.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$', 'a.datefin'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
$this->import_examplevalues_array[$r] = array(
+ 'a.ref'=>"auto or MEM2010-1234",
'a.civility'=>"MR", 'a.lastname'=>'Smith', 'a.firstname'=>'John', 'a.gender'=>'man or woman', 'a.login'=>'jsmith', 'a.pass'=>'passofjsmith', 'a.fk_adherent_type'=>'1',
'a.morphy'=>'"mor" or "phy"', 'a.societe'=>'JS company', 'a.address'=>'21 jump street', 'a.zip'=>'55000', 'a.town'=>'New York', 'a.country'=>'1',
'a.email'=>'jsmith@example.com', 'a.birth'=>'1972-10-10', 'a.statut'=>"0 or 1", 'a.note_public'=>"This is a public comment on member",
@@ -375,7 +397,7 @@ class modAdherent extends DolibarrModules
if (!empty($conf->societe->enabled)) {
$this->import_examplevalues_array[$r]['a.fk_soc'] = "rowid or name";
}
- $this->import_updatekeys_array[$r] = array('a.login'=>'Login');
+ $this->import_updatekeys_array[$r] = array('a.ref'=>'Member Ref', 'a.login'=>'Login');
// Cronjobs
$arraydate = dol_getdate(dol_now());
diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php
index deefea6c2e8..2d89baa07a3 100644
--- a/htdocs/core/modules/modProjet.class.php
+++ b/htdocs/core/modules/modProjet.class.php
@@ -309,7 +309,7 @@ class modProjet extends DolibarrModules
$this->import_fieldshidden_array[$r] = array('t.fk_user_creat'=>'user->id', 'extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'projet_task'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
$this->import_convertvalue_array[$r] = array(
't.fk_projet'=>array('rule'=>'fetchidfromref', 'classfile'=>'/projet/class/project.class.php', 'class'=>'Project', 'method'=>'fetch', 'element'=>'Project'),
- 't.ref'=>array('rule'=>'getrefifauto')
+ 't.ref'=>array('rule'=>'getrefifauto', 'class'=>(empty($conf->global->PROJECT_TASK_ADDON) ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON), 'path'=>"/core/modules/project/task/".(empty($conf->global->PROJECT_TASK_ADDON) ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON).'.php')
);
//$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
$this->import_regex_array[$r] = array('t.dateo'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$', 't.datee'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$', 't.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$');
diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php
index d0cfa64c884..00e5a7859c0 100644
--- a/htdocs/core/modules/modStock.class.php
+++ b/htdocs/core/modules/modStock.class.php
@@ -414,7 +414,7 @@ class modStock extends DolibarrModules
);
$this->import_updatekeys_array[$r] = array('ps.fk_product'=>'Product', 'ps.fk_entrepot'=>"Warehouse");
$this->import_run_sql_after_array[$r] = array( // Because we may change data that are denormalized, we must update dernormalized data after.
- 'UPDATE '.MAIN_DB_PREFIX.'product p SET p.stock= (SELECT SUM(ps.reel) FROM '.MAIN_DB_PREFIX.'product_stock ps WHERE ps.fk_product = p.rowid);'
+ 'UPDATE '.MAIN_DB_PREFIX.'product as p SET p.stock = (SELECT SUM(ps.reel) FROM '.MAIN_DB_PREFIX.'product_stock ps WHERE ps.fk_product = p.rowid);'
);
}
diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php
index 4f92f5d9af0..e1f56974483 100644
--- a/htdocs/core/tpl/massactions_pre.tpl.php
+++ b/htdocs/core/tpl/massactions_pre.tpl.php
@@ -147,7 +147,7 @@ if ($massaction == 'presend') {
// $formmail->withfile = 2; Not yet supported in mass action
$formmail->withmaindocfile = 1; // Add a checkbox "Attach also main document"
if ($objecttmp->element != 'societe') {
- $formmail->withfile = ''.$langs->trans("OnlyPDFattachmentSupported").' ';
+ $formmail->withfile = ''.$langs->trans("OnlyPDFattachmentSupported").' ';
$formmail->withmaindocfile = - 1; // Add a checkbox "Attach also main document" but not checked by default
}
$formmail->withbody = 1;
diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php
index 22a73fee4e2..4227aed6afa 100644
--- a/htdocs/imports/import.php
+++ b/htdocs/imports/import.php
@@ -706,12 +706,12 @@ if ($step == 3 && $datatoimport) {
print $out;
print '';
- print ''; // You can use div-table-responsive-no-min if you dont need reserved height for your table
- print '
';
-
// Search available imports
$filearray = dol_dir_list($conf->import->dir_temp, 'files', 0, '', '', 'name', SORT_DESC);
if (count($filearray) > 0) {
+ print ''; // You can use div-table-responsive-no-min if you dont need reserved height for your table
+ print '
';
+
$dir = $conf->import->dir_temp;
// Search available files to import
@@ -752,10 +752,10 @@ if ($step == 3 && $datatoimport) {
print '';
print '';
}
- }
- print '
';
- print '
';
+ print '
';
+ print '
';
+ }
print '';
}
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 1c8fd23ddb3..d9099f567fa 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -500,7 +500,7 @@ WarningPHPMailB=- Some Email Service Providers (like Yahoo) do not allow you to
WarningPHPMailC=- Using the SMTP server of your own Email Service Provider to send emails is also interesting so all emails sent from application will also be saved into your "Sent" directory of your mailbox.
WarningPHPMailD=Also, it is therefore recommended to change the sending method of e-mails to the value "SMTP". If you really want to keep the default "PHP" method to send emails, just ignore this warning, or remove it by setting the MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP constant to 1 in Home - Setup - Other.
WarningPHPMail2=If your email SMTP provider need to restrict email client to some IP addresses (very rare), this is the IP address of the mail user agent (MUA) for your ERP CRM application: %s .
-WarningPHPMailSPF=If the domain name in your sender email address is protected by a SPF record (ask you domain name registar), you must add the following IPs in the SPF record of the DNS of your domain: %s .
+WarningPHPMailSPF=If the domain name in your sender email address is protected by a SPF record (ask your domain name registar), you must add the following IPs in the SPF record of the DNS of your domain: %s .
ClickToShowDescription=Click to show description
DependsOn=This module needs the module(s)
RequiredBy=This module is required by module(s)
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index d071e8f9921..ed836de658d 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -1007,12 +1007,12 @@ print '';
if (!empty($arrayfields['s.rowid']['checked'])) {
- print '';
+ print ' ';
print ' ';
print ' ';
}
if (!empty($arrayfields['s.nom']['checked'])) {
- print '';
+ print ' ';
if (!empty($search_nom_only) && empty($search_nom)) {
$search_nom = $search_nom_only;
}
@@ -1243,10 +1243,10 @@ print ' ';
print "\n";
print '';
if (!empty($arrayfields['s.rowid']['checked'])) {
- print_liste_field_titre($arrayfields['s.rowid']['label'], $_SERVER["PHP_SELF"], "s.rowid", "", $param, "", $sortfield, $sortorder);
+ print_liste_field_titre($arrayfields['s.rowid']['label'], $_SERVER["PHP_SELF"], "s.rowid", "", $param, ' data-key="id"', $sortfield, $sortorder);
}
if (!empty($arrayfields['s.nom']['checked'])) {
- print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder);
+ print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, ' data-key="ref"', $sortfield, $sortorder);
}
if (!empty($arrayfields['s.name_alias']['checked'])) {
print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], "s.name_alias", "", $param, "", $sortfield, $sortorder);
@@ -1394,7 +1394,7 @@ while ($i < min($num, $limit)) {
}
print '>';
if (!empty($arrayfields['s.rowid']['checked'])) {
- print '';
+ print ' ';
print $obj->rowid;
print " \n";
if (!$i) {
@@ -1406,7 +1406,7 @@ while ($i < min($num, $limit)) {
if (!empty($arrayfields['s.name_alias']['checked'])) {
$companystatic->name_alias = '';
}
- print 'global->MAIN_SOCIETE_SHOW_COMPLETE_NAME) ? ' class="tdoverflowmax200"' : '').'>';
+ print ' global->MAIN_SOCIETE_SHOW_COMPLETE_NAME) ? ' class="tdoverflowmax200"' : '').' data-key="ref">';
if ($contextpage == 'poslist') {
print $obj->name;
} else {