Fix import gender man/woman, not 0/1 + import of thirdparty for members

This commit is contained in:
Laurent Destailleur 2021-08-26 11:53:57 +02:00
parent 6c71c6f5e5
commit ac2fc9c57f
5 changed files with 17 additions and 7 deletions

View File

@ -344,6 +344,9 @@ class modAdherent extends DolibarrModules
'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'
);
if (!empty($conf->societe->enabled)) {
$this->import_fields_array[$r]['a.fk_soc'] = "ThirdParty";
}
// Add extra fields
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'adherent' AND entity IN (0,".$conf->entity.")";
$resql = $this->db->query($sql);
@ -355,16 +358,23 @@ class modAdherent extends DolibarrModules
}
}
// End add extra fields
$this->import_convertvalue_array[$r] = array();
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');
}
$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.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.civility'=>"MR", 'a.lastname'=>'Smith', 'a.firstname'=>'John', 'a.login'=>'jsmith', 'a.pass'=>'passofjsmith', 'a.fk_adherent_type'=>'1',
'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",
'a.note_private'=>"This is private 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')
);
if (!empty($conf->societe->enabled)) {
$this->import_examplevalues_array[$r]['a.fk_soc'] = "rowid or name";
}
// Cronjobs
$arraydate = dol_getdate(dol_now());

View File

@ -501,7 +501,7 @@ class modCategorie extends DolibarrModules
'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'),
'cs.fk_soc'=>array('rule'=>'fetchidfromref', 'classfile'=>'/societe/class/societe.class.php', 'class'=>'Societe', 'method'=>'fetch', 'element'=>'ThirdParty')
);
$this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_soc'=>"rowid or ref");
$this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_soc'=>"rowid or name");
}
// 2 Customers
@ -522,7 +522,7 @@ class modCategorie extends DolibarrModules
'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'),
'cs.fk_soc'=>array('rule'=>'fetchidfromref', 'classfile'=>'/societe/class/societe.class.php', 'class'=>'Societe', 'method'=>'fetch', 'element'=>'ThirdParty')
);
$this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_soc'=>"rowid or ref");
$this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_soc'=>"rowid or name");
}
// 3 Members

View File

@ -322,7 +322,7 @@ class modUser extends DolibarrModules
'u.birth'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'
);
$this->import_examplevalues_array[$r] = array(
'u.lastname'=>"Doe", 'u.firstname'=>'John', 'u.login'=>'jdoe', 'u.employee'=>'0 or 1', 'u.job'=>'CTO', 'u.gender'=>'0 or 1',
'u.lastname'=>"Doe", 'u.firstname'=>'John', 'u.login'=>'jdoe', 'u.employee'=>'0 or 1', 'u.job'=>'CTO', 'u.gender'=>'man or woman',
'u.pass_crypted'=>'Encrypted password',
'u.fk_soc'=>'0 (internal user) or company name (external user)', 'u.datec'=>dol_print_date(dol_now(), '%Y-%m-%d'), 'u.address'=>"61 jump street",
'u.zip'=>"123456", 'u.town'=>"Big town", 'u.fk_country'=>'US, FR, DE...', 'u.office_phone'=>"0101010101", 'u.office_fax'=>"0101010102",

View File

@ -570,7 +570,7 @@ ToCreateARecurringInvoiceGene=To generate future invoices regularly and manually
ToCreateARecurringInvoiceGeneAuto=If you need to have such invoices generated automatically, ask your administrator to enable and setup module <strong>%s</strong>. Note that both methods (manual and automatic) can be used together with no risk of duplication.
DeleteRepeatableInvoice=Delete template invoice
ConfirmDeleteRepeatableInvoice=Are your sure you want to delete the template invoice?
CreateOneBillByThird=Create one invoice per third party (otherwise, one invoice per order)
CreateOneBillByThird=Create one invoice per third party (otherwise, one invoice per selected object)
BillCreated=%s invoice(s) generated
BillXCreated=Invoice %s generated
StatusOfGeneratedDocuments=Status of document generation

View File

@ -96,8 +96,8 @@ DataComeFromFileFieldNb=Value to insert comes from field number <b>%s</b> in sou
DataComeFromIdFoundFromRef=Value that comes from field number <b>%s</b> of source file will be used to find the id of the parent object to use (so the object <b>%s</b> that has the ref. from source file must exist in the database).
DataComeFromIdFoundFromCodeId=Code that comes from field number <b>%s</b> of source file will be used to find the id of the parent object to use (so the code from source file must exist in the dictionary <b>%s</b>). Note that if you know the id, you can also use it in the source file instead of the code. Import should work in both cases.
DataIsInsertedInto=Data coming from source file will be inserted into the following field:
DataIDSourceIsInsertedInto=The id of parent object was found using the data in the source file, will be inserted into the following field:
DataCodeIDSourceIsInsertedInto=The id of parent line found from code, will be inserted into following field:
DataIDSourceIsInsertedInto=The id of the parent object, that was found using the data in the source file, will be inserted into the following field:
DataCodeIDSourceIsInsertedInto=The id of the parent line, that was found from code, will be inserted into the following field:
SourceRequired=Data value is mandatory
SourceExample=Example of possible data value
ExampleAnyRefFoundIntoElement=Any ref found for element <b>%s</b>