mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 00:53:00 +01:00
Merge pull request #660 from grandoc/develop
fix : doesn't work with a /
This commit is contained in:
@@ -1020,7 +1020,7 @@ class CMailFile
|
||||
/**
|
||||
* Return an address for SMTP protocol
|
||||
*
|
||||
* @param string $adresses Example: 'John Doe <john@doe.com>' or 'john@doe.com'
|
||||
* @param string $address Example: 'John Doe <john@doe.com>' or 'john@doe.com'
|
||||
* @param int $format 0=auto, 1=emails with <>, 2=emails without <>, 3=auto + label between "
|
||||
* @param int $encode 1=Encode name to RFC2822
|
||||
* @return string If format 0: '<john@doe.com>' or 'John Doe <john@doe.com>' or '=?UTF-8?B?Sm9obiBEb2U=?= <john@doe.com>'
|
||||
@@ -1028,13 +1028,13 @@ class CMailFile
|
||||
* If format 2: 'john@doe.com'
|
||||
* If format 3: '<john@doe.com>' or '"John Doe" <john@doe.com>' or '"=?UTF-8?B?Sm9obiBEb2U=?=" <john@doe.com>'
|
||||
*/
|
||||
function getValidAddress($adresses,$format,$encode='')
|
||||
function getValidAddress($address,$format,$encode='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$ret='';
|
||||
|
||||
$arrayaddress=explode(',',$adresses);
|
||||
$arrayaddress=explode(',',$address);
|
||||
|
||||
// Boucle sur chaque composant de l'adresse
|
||||
foreach($arrayaddress as $val)
|
||||
|
||||
@@ -964,7 +964,7 @@ abstract class CommonObject
|
||||
*/
|
||||
function setDeliveryAddress($id)
|
||||
{
|
||||
$fieldname = 'fk_adresse_livraison';
|
||||
$fieldname = 'fk_delivery_address';
|
||||
if ($this->element == 'delivery' || $this->element == 'shipping') $fieldname = 'fk_address';
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET ".$fieldname." = ".$id;
|
||||
@@ -1023,7 +1023,7 @@ abstract class CommonObject
|
||||
|
||||
/**
|
||||
* Save a new position (field rang) for details lines.
|
||||
* You can choose to ser position for lines with already a position or lines wihtout any position defined.
|
||||
* You can choose to set position for lines with already a position or lines without any position defined.
|
||||
* Call this function only for table that contains a field fk_parent_line.
|
||||
*
|
||||
* @param boolean $renum true to renum all already ordered lines, false to renum only not already ordered lines.
|
||||
@@ -1064,7 +1064,7 @@ abstract class CommonObject
|
||||
// counter that parents.
|
||||
$rows=array();
|
||||
|
||||
// We frist search all lines that are parent lines (for multilevel details lines)
|
||||
// We first search all lines that are parent lines (for multilevel details lines)
|
||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.$this->table_element_line;
|
||||
$sql.= ' WHERE '.$this->fk_element.' = '.$this->id;
|
||||
$sql.= ' AND fk_parent_line IS NULL';
|
||||
@@ -1080,10 +1080,10 @@ abstract class CommonObject
|
||||
{
|
||||
$row = $this->db->fetch_row($resql);
|
||||
$rows[] = $row[0]; // Add parent line into array rows
|
||||
$childrens = $this->getChildrensOfLine($row[0]);
|
||||
if (! empty($childrens))
|
||||
$childrens = $this->getChildrenOfLine($row[0]);
|
||||
if (! empty($children))
|
||||
{
|
||||
foreach($childrens as $child)
|
||||
foreach($children as $child)
|
||||
{
|
||||
array_push($rows, $child);
|
||||
}
|
||||
@@ -1108,12 +1108,12 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Get childrens of line
|
||||
* Get children of line
|
||||
*
|
||||
* @param int $id Id of parent line
|
||||
* @return array Array with list of child lines id
|
||||
* @return array Array with list of children lines id
|
||||
*/
|
||||
function getChildrensOfLine($id)
|
||||
function getChildrenOfLine($id)
|
||||
{
|
||||
$rows=array();
|
||||
|
||||
@@ -1122,7 +1122,7 @@ abstract class CommonObject
|
||||
$sql.= ' AND fk_parent_line = '.$id;
|
||||
$sql.= ' ORDER BY rang ASC';
|
||||
|
||||
dol_syslog(get_class($this)."::getChildrenOfLines search children lines for line ".$id." sql=".$sql, LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id." sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
||||
@@ -144,7 +144,7 @@ class html_cerfafr extends ModeleDon
|
||||
$form = str_replace('__MAIN_INFO_SOCIETE_CP__',$mysoc->zip,$form);
|
||||
$form = str_replace('__MAIN_INFO_SOCIETE_VILLE__',$mysoc->town,$form);
|
||||
$form = str_replace('__DONATOR_NAME__',$don->nom,$form);
|
||||
$form = str_replace('__DONATOR_ADDRESS__',$don->adresse,$form);
|
||||
$form = str_replace('__DONATOR_ADDRESS__',$don->address,$form);
|
||||
$form = str_replace('__DONATOR_ZIP__',$don->cp,$form);
|
||||
$form = str_replace('__DONATOR_TOWN__',$don->ville,$form);
|
||||
$form = str_replace('__PAYMENTMODE_LIB__ ', $paymentmode,$form);
|
||||
|
||||
@@ -172,9 +172,9 @@ class modAdherent extends DolibarrModules
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]='MembersAndSubscriptions';
|
||||
$this->export_permission[$r]=array(array("adherent","export"));
|
||||
$this->export_fields_array[$r]=array('a.rowid'=>'Id','a.civilite'=>"UserTitle",'a.nom'=>"Lastname",'a.prenom'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature','a.societe'=>'Company','a.adresse'=>"Address",'a.cp'=>"Zip",'a.ville'=>"Town",'a.pays'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.naiss'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.cotisation'=>'Amount');
|
||||
$this->export_TypeFields_array[$r]=array('a.civilite'=>"Text",'a.nom'=>"Text",'a.prenom'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.adresse'=>"Text",'a.cp'=>"Text",'a.ville'=>"Text",'a.pays'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.naiss'=>"Date",'a.statut'=>"Status",'a.note'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:fk_adherent_type:libelle','ta.libelle'=>'Text','c.dateadh'=>'Date','c.cotisation'=>'Number');
|
||||
$this->export_entities_array[$r]=array('a.rowid'=>'member','a.civilite'=>"member",'a.nom'=>"member",'a.prenom'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.adresse'=>"member",'a.cp'=>"member",'a.ville'=>"member",'a.pays'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.naiss'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.cotisation'=>'subscription');
|
||||
$this->export_fields_array[$r]=array('a.rowid'=>'Id','a.civilite'=>"UserTitle",'a.nom'=>"Lastname",'a.prenom'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature','a.societe'=>'Company','a.address'=>"Address",'a.cp'=>"Zip",'a.ville'=>"Town",'a.pays'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.naiss'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.cotisation'=>'Amount');
|
||||
$this->export_TypeFields_array[$r]=array('a.civilite'=>"Text",'a.nom'=>"Text",'a.prenom'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",'a.cp'=>"Text",'a.ville'=>"Text",'a.pays'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.naiss'=>"Date",'a.statut'=>"Status",'a.note'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:fk_adherent_type:libelle','ta.libelle'=>'Text','c.dateadh'=>'Date','c.cotisation'=>'Number');
|
||||
$this->export_entities_array[$r]=array('a.rowid'=>'member','a.civilite'=>"member",'a.nom'=>"member",'a.prenom'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.address'=>"member",'a.cp'=>"member",'a.ville'=>"member",'a.pays'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.naiss'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.cotisation'=>'subscription');
|
||||
// Add extra fields
|
||||
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'member'";
|
||||
$resql=$this->db->query($sql);
|
||||
@@ -207,7 +207,7 @@ class modAdherent extends DolibarrModules
|
||||
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
||||
$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.civilite'=>"UserTitle",'a.nom'=>"Lastname*",'a.prenom'=>"Firstname",'a.login'=>"Login*","a.pass"=>"Password","a.fk_adherent_type"=>"MemberType*",'a.morphy'=>'Nature*','a.societe'=>'Company','a.adresse'=>"Address",'a.cp'=>"Zip",'a.ville'=>"Town",'a.pays'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.naiss'=>"Birthday",'a.statut'=>"Status*",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datefin'=>'DateEndSubscription');
|
||||
$this->import_fields_array[$r]=array('a.civilite'=>"UserTitle",'a.nom'=>"Lastname*",'a.prenom'=>"Firstname",'a.login'=>"Login*","a.pass"=>"Password","a.fk_adherent_type"=>"MemberType*",'a.morphy'=>'Nature*','a.societe'=>'Company','a.address'=>"Address",'a.cp'=>"Zip",'a.ville'=>"Town",'a.pays'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.naiss'=>"Birthday",'a.statut'=>"Status*",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datefin'=>'DateEndSubscription');
|
||||
// Add extra fields
|
||||
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'member'";
|
||||
$resql=$this->db->query($sql);
|
||||
@@ -223,7 +223,7 @@ class modAdherent extends DolibarrModules
|
||||
// End add extra fields
|
||||
$this->import_fieldshidden_array[$r]=array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'adherent'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
|
||||
$this->import_regex_array[$r]=array('a.civilite'=>'code@'.MAIN_DB_PREFIX.'c_civilite','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.civilite'=>"MR",'a.nom'=>'Smith','a.prenom'=>'John','a.login'=>'jsmith','a.pass'=>'passofjsmith','a.fk_adherent_type'=>'1','a.morphy'=>'"mor" or "phy"','a.societe'=>'JS company','a.adresse'=>'21 jump street','a.cp'=>'55000','a.ville'=>'New York','a.pays'=>'1','a.email'=>'jsmith@example.com','a.naiss'=>'1972-10-10','a.statut'=>"0 or 1",'a.note'=>"This is a comment on member",'a.datec'=>dol_print_date($now,'%Y-%m-%d'),'a.datefin'=>dol_print_date(dol_time_plus_duree($now, 1, 'y'),'%Y-%m-%d'));
|
||||
$this->import_examplevalues_array[$r]=array('a.civilite'=>"MR",'a.nom'=>'Smith','a.prenom'=>'John','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.cp'=>'55000','a.ville'=>'New York','a.pays'=>'1','a.email'=>'jsmith@example.com','a.naiss'=>'1972-10-10','a.statut'=>"0 or 1",'a.note'=>"This is a comment on member",'a.datec'=>dol_print_date($now,'%Y-%m-%d'),'a.datefin'=>dol_print_date(dol_time_plus_duree($now, 1, 'y'),'%Y-%m-%d'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user