Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/core/modules/modAdherent.class.php
This commit is contained in:
commit
d1794d7948
@ -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 ? '<br><br>' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD);
|
||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD -->'.$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 ? '<br><br>' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
|
||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS -->'.$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 ? '<br><br>' : '').$langs->trans("WarningPHPMail2", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
|
||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS -->'.$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 ? '<br><br>' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD);
|
||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD -->'.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -691,9 +691,9 @@ class FormMail extends Form
|
||||
$out .= '<tr><td class="minwidth200">';
|
||||
$out .= $langs->trans("GroupEmails");
|
||||
$out .= '</td><td>';
|
||||
$out .= ' <input type="checkbox" name="oneemailperrecipient"'.($this->withoptiononeemailperrecipient > 0 ? ' checked="checked"' : '').'> ';
|
||||
$out .= $langs->trans("OneEmailPerRecipient");
|
||||
$out .= '<span class="hideonsmartphone">';
|
||||
$out .= ' <input type="checkbox" id="oneemailperrecipient" name="oneemailperrecipient"'.($this->withoptiononeemailperrecipient > 0 ? ' checked="checked"' : '').'> ';
|
||||
$out .= '<label for="oneemailperrecipient">'.$langs->trans("OneEmailPerRecipient").'</label>';
|
||||
$out .= '<span class="hideonsmartphone opacitymedium">';
|
||||
$out .= ' - ';
|
||||
$out .= $langs->trans("WarningIfYouCheckOneRecipientPerEmail");
|
||||
$out .= '</span>';
|
||||
@ -773,12 +773,11 @@ class FormMail extends Form
|
||||
|
||||
if (!empty($this->withmaindocfile)) {
|
||||
if ($this->withmaindocfile == 1) {
|
||||
$out .= '<input type="checkbox" name="addmaindocfile" value="1" />';
|
||||
$out .= '<input type="checkbox" id="addmaindocfile" name="addmaindocfile" value="1" />';
|
||||
} elseif ($this->withmaindocfile == -1) {
|
||||
$out .= '<input type="checkbox" id="addmaindocfile" name="addmaindocfile" value="1" checked="checked" />';
|
||||
}
|
||||
if ($this->withmaindocfile == -1) {
|
||||
$out .= '<input type="checkbox" name="addmaindocfile" value="1" checked="checked" />';
|
||||
}
|
||||
$out .= ' '.$langs->trans("JoinMainDoc").'.<br>';
|
||||
$out .= ' <label for="addmaindocfile">'.$langs->trans("JoinMainDoc").'.</label><br>';
|
||||
}
|
||||
|
||||
if (is_numeric($this->withfile)) {
|
||||
|
||||
@ -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'];
|
||||
|
||||
@ -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'];
|
||||
|
||||
183
htdocs/core/modules/member/mod_member_simple.php
Normal file
183
htdocs/core/modules/member/mod_member_simple.php
Normal file
@ -0,0 +1,183 @@
|
||||
<?php
|
||||
/* Copyright (C) 2021 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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());
|
||||
|
||||
@ -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])?$');
|
||||
|
||||
@ -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);'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -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 = '<span class="hideonsmartphone">'.$langs->trans("OnlyPDFattachmentSupported").'</span>';
|
||||
$formmail->withfile = '<span class="hideonsmartphone opacitymedium">'.$langs->trans("OnlyPDFattachmentSupported").'</span>';
|
||||
$formmail->withmaindocfile = - 1; // Add a checkbox "Attach also main document" but not checked by default
|
||||
}
|
||||
$formmail->withbody = 1;
|
||||
|
||||
@ -706,12 +706,12 @@ if ($step == 3 && $datatoimport) {
|
||||
print $out;
|
||||
print '</div>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="noborder centpercent" width="100%" cellpadding="4">';
|
||||
|
||||
// Search available imports
|
||||
$filearray = dol_dir_list($conf->import->dir_temp, 'files', 0, '', '', 'name', SORT_DESC);
|
||||
if (count($filearray) > 0) {
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="noborder centpercent" width="100%" cellpadding="4">';
|
||||
|
||||
$dir = $conf->import->dir_temp;
|
||||
|
||||
// Search available files to import
|
||||
@ -752,10 +752,10 @@ if ($step == 3 && $datatoimport) {
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
@ -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: <strong>%s</strong>.
|
||||
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: <strong>%s</strong>.
|
||||
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: <strong>%s</strong>.
|
||||
ClickToShowDescription=Click to show description
|
||||
DependsOn=This module needs the module(s)
|
||||
RequiredBy=This module is required by module(s)
|
||||
|
||||
@ -1007,12 +1007,12 @@ print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" :
|
||||
// Fields title search
|
||||
print '<tr class="liste_titre_filter">';
|
||||
if (!empty($arrayfields['s.rowid']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print '<td class="liste_titre" data-key="id">';
|
||||
print '<input class="flat searchstring" type="text" name="search_id" size="1" value="'.dol_escape_htmltag($search_id).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print '<td class="liste_titre" data-key="ref">';
|
||||
if (!empty($search_nom_only) && empty($search_nom)) {
|
||||
$search_nom = $search_nom_only;
|
||||
}
|
||||
@ -1243,10 +1243,10 @@ print '</td>';
|
||||
print "</tr>\n";
|
||||
print '<tr class="liste_titre">';
|
||||
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 '<td class="tdoverflowmax50">';
|
||||
print '<td class="tdoverflowmax50" data-key="id">';
|
||||
print $obj->rowid;
|
||||
print "</td>\n";
|
||||
if (!$i) {
|
||||
@ -1406,7 +1406,7 @@ while ($i < min($num, $limit)) {
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
$companystatic->name_alias = '';
|
||||
}
|
||||
print '<td'.(empty($conf->global->MAIN_SOCIETE_SHOW_COMPLETE_NAME) ? ' class="tdoverflowmax200"' : '').'>';
|
||||
print '<td'.(empty($conf->global->MAIN_SOCIETE_SHOW_COMPLETE_NAME) ? ' class="tdoverflowmax200"' : '').' data-key="ref">';
|
||||
if ($contextpage == 'poslist') {
|
||||
print $obj->name;
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user