diff --git a/ChangeLog b/ChangeLog index b6de1a1d94f..d685811b926 100644 --- a/ChangeLog +++ b/ChangeLog @@ -56,6 +56,7 @@ For users: - New: [ task #1060 ] Register fields localtax(1|2)_type into details tables. - New: [ task #923 ] Localtax support for ODT templates. - New: [ task #90 ] Barcode search. +- New: Can send an email from thirdparty card. For translators: - Qual: Normalized sort order of all languages files with english reference files. diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/adherent_extrafields.php index 34420ee0121..25139697955 100644 --- a/htdocs/adherents/admin/adherent_extrafields.php +++ b/htdocs/adherents/admin/adherent_extrafields.php @@ -50,7 +50,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php index ce2787752a7..5fdd9ff2a39 100644 --- a/htdocs/adherents/admin/adherent_type_extrafields.php +++ b/htdocs/adherents/admin/adherent_type_extrafields.php @@ -51,7 +51,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index e3bbe5b55a9..2648a8ae721 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -691,7 +691,7 @@ else /* */ /* ************************************************************************** */ $object->canvas=$canvas; - $object->state_id = GETPOST('departement_id', 'int'); + $object->state_id = GETPOST('state_id', 'int'); // We set country_id, country_code and country for the selected country $object->country_id=GETPOST('country_id','int')?GETPOST('country_id','int'):$mysoc->country_id; diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php index a7763893bb5..64f793cc761 100644 --- a/htdocs/admin/agenda_extrafields.php +++ b/htdocs/admin/agenda_extrafields.php @@ -56,7 +56,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/admin/order_extrafields.php b/htdocs/admin/order_extrafields.php index 7e748cdbc4a..88e3705c4e7 100644 --- a/htdocs/admin/order_extrafields.php +++ b/htdocs/admin/order_extrafields.php @@ -57,7 +57,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/admin/orderdet_extrafields.php b/htdocs/admin/orderdet_extrafields.php index 64eeb2f4b52..23e6166d1a4 100644 --- a/htdocs/admin/orderdet_extrafields.php +++ b/htdocs/admin/orderdet_extrafields.php @@ -58,7 +58,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php index 8f9865981f5..02bedad307d 100644 --- a/htdocs/admin/supplierinvoice_extrafields.php +++ b/htdocs/admin/supplierinvoice_extrafields.php @@ -58,7 +58,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php index 9aa7770f820..fea9656f146 100644 --- a/htdocs/admin/supplierorder_extrafields.php +++ b/htdocs/admin/supplierorder_extrafields.php @@ -57,7 +57,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php index 28534e08140..75e994d281a 100644 --- a/htdocs/comm/admin/propal_extrafields.php +++ b/htdocs/comm/admin/propal_extrafields.php @@ -51,7 +51,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php index 79509cc6593..f4a5226e1f0 100644 --- a/htdocs/comm/admin/propaldet_extrafields.php +++ b/htdocs/comm/admin/propaldet_extrafields.php @@ -59,7 +59,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index e2da54015cc..31c69d93295 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1588,6 +1588,15 @@ else if ($action == 'down' && $user->rights->facture->creer) exit; } +// Link invoice to order +if (GETPOST('linkedOrder')) +{ + $object->fetch($id); + $object->fetch_thirdparty(); + $result=$object->add_object_linked('commande',GETPOST('linkedOrder')); +} + + /* * Add file in email form */ @@ -1960,6 +1969,16 @@ $now=dol_now(); llxHeader('',$langs->trans('Bill'),'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes'); +print ' + +'; + /********************************************************************* * @@ -3727,74 +3746,64 @@ else if ($id > 0 || ! empty($ref)) // Linked object block $somethingshown=$object->showLinkedObjectBlock(); - if (empty($somethingshown) && $object->statut > 0) { + print '
'.$langs->trans('LinkedOrder').''; - print ''.$langs->trans('LinkedOrder').''; - - print ''; - } + // Link for paypal payment if (! empty($conf->paypal->enabled) && $object->statut != 0) { @@ -3946,20 +3955,4 @@ dol_htmloutput_mesg('',$mesgs); llxFooter(); $db->close(); -?> - - +?> \ No newline at end of file diff --git a/htdocs/compta/facture/admin/facture_cust_extrafields.php b/htdocs/compta/facture/admin/facture_cust_extrafields.php index 8d6fb63cf80..a44d67d87a9 100644 --- a/htdocs/compta/facture/admin/facture_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_cust_extrafields.php @@ -52,7 +52,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php index 6ec01f0ed6d..a0c560d52cb 100644 --- a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php @@ -53,7 +53,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index f86970afc0a..cd9169e1b2c 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -285,10 +285,10 @@ abstract class ActionsContactCardCommon } // Zip - $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6); + $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); // Town - $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','departement_id')); + $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','state_id')); if (dol_strlen(trim($this->object->country_id)) == 0) $this->object->country_id = $objsoc->country_id; @@ -432,9 +432,9 @@ abstract class ActionsContactCardCommon $this->object->address = $_POST["address"]; $this->object->zip = $_POST["zipcode"]; $this->object->town = $_POST["town"]; - $this->object->fk_departement = $_POST["departement_id"]; + $this->object->fk_departement = $_POST["state_id"]; $this->object->country_id = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id; - $this->object->state_id = $_POST["departement_id"]; + $this->object->state_id = $_POST["state_id"]; $this->object->phone_pro = $_POST["phone_pro"]; $this->object->phone_perso = $_POST["phone_perso"]; $this->object->phone_mobile = $_POST["phone_mobile"]; diff --git a/htdocs/contrat/admin/contract_extrafields.php b/htdocs/contrat/admin/contract_extrafields.php index 22b07448462..c50872beee4 100644 --- a/htdocs/contrat/admin/contract_extrafields.php +++ b/htdocs/contrat/admin/contract_extrafields.php @@ -54,7 +54,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/core/admin_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php similarity index 99% rename from htdocs/core/admin_extrafields.inc.php rename to htdocs/core/actions_extrafields.inc.php index 0b608a1e736..4861ee6b856 100644 --- a/htdocs/core/admin_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/core/admin_extrafields.inc.php + * \file htdocs/core/actions_extrafields.inc.php * \brief Code for actions on extrafields admin pages */ @@ -306,4 +306,4 @@ if ($action == 'delete') } } -?> +?> \ No newline at end of file diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php new file mode 100644 index 00000000000..2b34e1e4b18 --- /dev/null +++ b/htdocs/core/actions_sendmails.inc.php @@ -0,0 +1,240 @@ + + * + * 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 http://www.gnu.org/ + */ + +/** + * \file htdocs/core/actions_sendmails.inc.php + * \brief Code for actions on sending mails from object page + */ + + +// TODO Include this include file into all class objects + +// $id must be defined +// $actiontypecode must be defined + + +/* + * Add file in email form + */ +if (GETPOST('addfile')) +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + // Set tmp user directory + $vardir=$conf->user->dir_output."/".$user->id; + $upload_dir_tmp = $vardir.'/temp'; + + dol_add_file_process($upload_dir_tmp,0,0); + $action='presend'; +} + +/* + * Remove file in email form + */ +if (! empty($_POST['removedfile'])) +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + // Set tmp user directory + $vardir=$conf->user->dir_output."/".$user->id; + $upload_dir_tmp = $vardir.'/temp'; + + // TODO Delete only files that was uploaded from email form + dol_remove_file_process($_POST['removedfile'],0); + $action='presend'; +} + +/* + * Send mail + */ +if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_POST['cancel']) +{ + $langs->load('mails'); + + $subject='';$actionmsg='';$actionmsg2=''; + + $result=$object->fetch($id); + + if (method_exists($object,"fetch_thirdparty") && $object->element != 'societe') + { + $result=$object->fetch_thirdparty(); + $thirdparty=$object->thirdparty; + } + else if ($object->element == 'societe') + { + $thirdparty=$object; + } + else dol_print_error('','Use actions_sendmails.in.php for a type that is not supported'); + + if ($result > 0) + { + if ($_POST['sendto']) + { + // Recipient is provided into free text + $sendto = $_POST['sendto']; + $sendtoid = 0; + } + elseif ($_POST['receiver'] != '-1') + { + // Recipient was provided from combo list + if ($_POST['receiver'] == 'thirdparty') // Id of third party + { + $sendto = $thirdparty->email; + $sendtoid = 0; + } + else // Id du contact + { + $sendto = $thirdparty->contact_get_property($_POST['receiver'],'email'); + $sendtoid = $_POST['receiver']; + } + } + + if (dol_strlen($sendto)) + { + $langs->load("commercial"); + + $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>'; + $replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>'; + $message = $_POST['message']; + $sendtocc = $_POST['sendtocc']; + $deliveryreceipt = $_POST['deliveryreceipt']; + + if ($action == 'send') + { + if (dol_strlen($_POST['subject'])) $subject = $_POST['subject']; + $actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + if ($message) + { + $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; + $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; + $actionmsg.=$message; + } + //$actionmsg2=$langs->transnoentities('Action'.$actiontypecode); + } + if ($action == 'relance') + { + if (dol_strlen($_POST['subject'])) $subject = $_POST['subject']; + $actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + if ($message) { + $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; + $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; + $actionmsg.=$message; + } + //$actionmsg2=$langs->transnoentities('Action'.$actiontypecode); + } + + // Create form object + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + + $attachedfiles=$formmail->get_attached_files(); + $filepath = $attachedfiles['paths']; + $filename = $attachedfiles['names']; + $mimetype = $attachedfiles['mimes']; + + // Send mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1); + if ($mailfile->error) + { + $mesgs[]='
'.$mailfile->error.'
'; + } + else + { + $result=$mailfile->sendfile(); + if ($result) + { + $error=0; + + // Initialisation donnees + $object->sendtoid = $sendtoid; + $object->actiontypecode = $actiontypecode; + $object->actionmsg = $actionmsg; // Long text + $object->actionmsg2 = $actionmsg2; // Short text + $object->fk_element = $object->id; + $object->elementtype = $object->element; + + // Appel des triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('THIRDPARTY_EMAILSENT',$object,$user,$langs,$conf); + if ($result < 0) { + $error++; $this->errors=$interface->errors; + } + // Fin appel triggers + + if ($error) + { + dol_print_error($db); + } + else + { + // Redirect here + // This avoid sending mail twice if going out and then back to page + $mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); + setEventMessage($mesg); + header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id); + exit; + } + } + else + { + $langs->load("other"); + $mesg='
'; + if ($mailfile->error) + { + $mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto); + $mesg.='
'.$mailfile->error; + } + else + { + $mesg.='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; + } + $mesg.='
'; + + setEventMessage($mesg,'warnings'); + $action = 'presend'; + } + } + /* } + else + { + $langs->load("other"); + $mesgs[]='
'.$langs->trans('ErrorMailRecipientIsEmpty').'
'; + dol_syslog('Recipient email is empty'); + }*/ + } + else + { + $langs->load("errors"); + setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("MailTo")),'warnings'); + dol_syslog('Try to send email with no recipiend defined', LOG_WARNING); + $action = 'presend'; + } + } + else + { + $langs->load("other"); + setEventMessage($langs->trans('ErrorFailedToReadEntity',$object->element),'errors'); + dol_syslog('Failed to read data of object id='.$object->id.' element='.$object->element); + $action = 'presend'; + } + +} + +?> \ No newline at end of file diff --git a/htdocs/core/ajax/ziptown.php b/htdocs/core/ajax/ziptown.php index 1f4b6acb6fb..294458d2352 100644 --- a/htdocs/core/ajax/ziptown.php +++ b/htdocs/core/ajax/ziptown.php @@ -116,7 +116,6 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) $row_array['value'] = $row['town']; $row_array['zipcode'] = $row['zip']; } - $row_array['departement_id'] = $row['fk_county']; // deprecated $row_array['selectcountry_id'] = $row['fk_country']; $row_array['state_id'] = $row['fk_county']; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 01052d7f642..97a0c9e9f26 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -191,7 +191,7 @@ class FormCompany * @param string $htmlname Id of department * @return void */ - function select_departement($selected='',$country_codeid=0, $htmlname='departement_id') + function select_departement($selected='',$country_codeid=0, $htmlname='state_id') { print $this->select_state($selected,$country_codeid, $htmlname); } @@ -208,7 +208,7 @@ class FormCompany * @param string $htmlname Id of department * @return string String with HTML select */ - function select_state($selected='',$country_codeid=0, $htmlname='departement_id') + function select_state($selected='',$country_codeid=0, $htmlname='state_id') { global $conf,$langs,$user; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 802cb61ba53..e5dc008fc2e 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -46,8 +46,8 @@ class FormMail var $withsubstit; // Show substitution array var $withfrom; - var $withto; - var $withtofree; + var $withto; // Show recipient emails + var $withtofree; // Show free text for recipient emails var $withtocc; var $withtoccc; var $withtopic; @@ -493,7 +493,7 @@ class FormMail } else { - $out.= 'withtopic) .'" />'; + $out.= 'withtopic)?'':$this->withtopic)) .'" />'; } $out.= "\n"; } diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 1ee016c6ee7..aec3884ac15 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1091,6 +1091,7 @@ class FormOther * @param string $dictionnarytable Dictionnary table * @param string $keyfield Field for key * @param string $labelfield Label field + * @param string $selected Selected value * @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. * @return void */ diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 5045283abe3..cf47c22d1fa 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -210,7 +210,7 @@ function ajax_multiautocompleter($htmlname,$fields,$url,$option='',$minLength=2, jQuery("#'.$htmlname.'").val(item.value); // TODO move this to specific request if (item.states) { - jQuery("#departement_id").html(item.states); + jQuery("#state_id").html(item.states); } for (i=0;i 0) // Do not erase state if unknown { diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 7b9ec52aef6..584a8e3494f 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -176,27 +176,34 @@ class modProjet extends DolibarrModules $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]='ProjectsAndTasksLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("projet","export")); + $this->export_dependencies_array[$r]=array('task_time'=>'ppt.rowid'); + $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country', - 's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode', - 'p.rowid'=>"ProjectId",'p.ref'=>"ProjectRef",'p.datec'=>"DateCreation",'p.dateo'=>"DateDebutProjet",'p.datee'=>"DateFinProjet",'p.fk_statut'=>'ProjectStatus','p.description'=>"projectNote", - 'pt.rowid'=>'RefTask','pt.dateo'=>"TaskDateo",'pt.datee'=>"TaskDatee",'pt.duration_effective'=>"DurationEffective",'pt.planned_workload'=>"DurationPlanned",'pt.progress'=>"Progress",'pt.description'=>"TaskDesc"); + 's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode', + 'p.rowid'=>"ProjectId",'p.ref'=>"ProjectRef",'p.datec'=>"DateCreation",'p.dateo'=>"DateDebutProjet",'p.datee'=>"DateFinProjet",'p.fk_statut'=>'ProjectStatus','p.description'=>"projectNote", + 'pt.rowid'=>'RefTask','pt.dateo'=>"TaskDateo",'pt.datee'=>"TaskDatee",'pt.duration_effective'=>"DurationEffective",'pt.planned_workload'=>"DurationPlanned",'pt.progress'=>"Progress",'pt.description'=>"TaskDesc", + 'ptt.task_date'=>'TaskTimeDate','ptt.task_duration'=>"TimesSpent",'ptt.fk_user'=>"TaskTimeUser",'ptt.note'=>"TaskTimeNote"); - //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle', - $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle', - 's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text', - 'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text", - 'pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.planned_workload'=>"Duree",'pt.progress'=>"Number",'pt.description'=>"Text"); - - $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company', - 's.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company', - 'f.rowid'=>"project",'f.ref'=>"project",'f.datec'=>"project",'f.duree'=>"project",'f.fk_statut'=>"project",'f.description'=>"project", - 'pt.rowid'=>'task','pt.dateo'=>"task",'pt.datee'=>"task",'pt.duration_effective'=>"task",'pt.planned_workload'=>"task",'pt.progress'=>"task",'pt.description'=>"task"); + $this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle', + 's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text', + 'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text", + 'pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.planned_workload'=>"Number",'pt.progress'=>"Number",'pt.description'=>"Text", + 'ptt.task_date'=>'Date','ptt.task_duration'=>"Duree",'ptt.fk_user'=>"List:user:Name",'ptt.note'=>"Text"); + $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company', + 's.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company', + 'f.rowid'=>"project",'f.ref'=>"project",'f.datec'=>"project",'f.duree'=>"project",'f.fk_statut'=>"project",'f.description'=>"project", + 'pt.rowid'=>'task','pt.dateo'=>"task",'pt.datee'=>"task",'pt.duration_effective'=>"task",'pt.planned_workload'=>"task",'pt.progress'=>"task",'pt.description'=>"task", + 'ptt.task_date'=>'task_time','ptt.task_duration'=>"task_time",'ptt.fk_user'=>"task_time",'ptt.note'=>"task_time"); + + $this->export_sql_start[$r]='SELECT DISTINCT '; - $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'projet as p, '.MAIN_DB_PREFIX.'projet_task as pt, '.MAIN_DB_PREFIX.'societe as s)'; - $this->export_sql_end[$r] .=' WHERE p.fk_soc = s.rowid AND p.rowid = pt.fk_projet '; + $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'projet as p, '.MAIN_DB_PREFIX.'societe as s)'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task as pt ON (p.rowid = pt.fk_projet)"; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON (pt.rowid = ptt.fk_task)"; + $this->export_sql_end[$r] .=' WHERE p.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' AND p.entity = '.$conf->entity; - $r++; + } diff --git a/htdocs/fichinter/admin/fichinter_extrafields.php b/htdocs/fichinter/admin/fichinter_extrafields.php index c094e97666a..f503e9a184e 100644 --- a/htdocs/fichinter/admin/fichinter_extrafields.php +++ b/htdocs/fichinter/admin/fichinter_extrafields.php @@ -53,7 +53,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/langs/fr_FR/mails.lang b/htdocs/langs/fr_FR/mails.lang index c92b0de4148..78f3a35875b 100644 --- a/htdocs/langs/fr_FR/mails.lang +++ b/htdocs/langs/fr_FR/mails.lang @@ -105,7 +105,7 @@ NbOfCompaniesContacts=Contacts/adresses uniques MailNoChangePossible=Destinataires d'un emailing validé non modifiables SearchAMailing=Rechercher un emailing SendMailing=Envoi emailing -SendMail=Envoi email +SendMail=Envoyer email SentBy=Envoyé par MailingNeedCommand=Pour des raisons de sécurité, il est recommandé de faire les envois d'un mailing de masse depuis la ligne de commande. Si en avez, demandez à votre administrateur de serveurs de lancer la commande suivante pour envoyer le mailing à tous les destinataires : MailingNeedCommand2=Vous pouvez toutefois quand même les envoyer par l'interface écran en ajoutant le paramètre MAILING_LIMIT_SENDBYWEB avec la valeur du nombre max de mails envoyés par session d'envoi. Pour cela, aller dans Accueil - Configuration - Divers. diff --git a/htdocs/product/admin/product_extrafields.php b/htdocs/product/admin/product_extrafields.php index 98b85746051..3f4ff84655e 100644 --- a/htdocs/product/admin/product_extrafields.php +++ b/htdocs/product/admin/product_extrafields.php @@ -52,7 +52,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php index c98c6c23e96..1d0a9c08e04 100644 --- a/htdocs/product/stock/fiche.php +++ b/htdocs/product/stock/fiche.php @@ -191,9 +191,9 @@ if ($action == 'create') // Zip / Town print ''.$langs->trans('Zip').''; - print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6); + print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); print ''.$langs->trans('Town').''; - print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','departement_id')); + print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id')); print ''; // Country @@ -510,9 +510,9 @@ else // Zip / Town print ''.$langs->trans('Zip').''; - print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6); + print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); print ''.$langs->trans('Town').''; - print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','departement_id')); + print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id')); print ''; // Country diff --git a/htdocs/projet/admin/project_extrafields.php b/htdocs/projet/admin/project_extrafields.php index a23da939757..8f4b6a6ce36 100644 --- a/htdocs/projet/admin/project_extrafields.php +++ b/htdocs/projet/admin/project_extrafields.php @@ -51,7 +51,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/projet/admin/project_task_extrafields.php b/htdocs/projet/admin/project_task_extrafields.php index f212c1acfd4..782ae78d787 100644 --- a/htdocs/projet/admin/project_task_extrafields.php +++ b/htdocs/projet/admin/project_task_extrafields.php @@ -51,7 +51,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/societe/admin/contact_extrafields.php b/htdocs/societe/admin/contact_extrafields.php index 36adc4f38b2..6cb54ee1449 100644 --- a/htdocs/societe/admin/contact_extrafields.php +++ b/htdocs/societe/admin/contact_extrafields.php @@ -50,7 +50,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/societe/admin/societe_extrafields.php b/htdocs/societe/admin/societe_extrafields.php index 15ccdac8ef7..11a284dabef 100644 --- a/htdocs/societe/admin/societe_extrafields.php +++ b/htdocs/societe/admin/societe_extrafields.php @@ -51,7 +51,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 6d30e8e760c..c1d9609a6c4 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -133,7 +133,7 @@ abstract class ActionsCardCommon $this->object->zip = $_POST["zipcode"]; $this->object->town = $_POST["town"]; $this->object->country_id = $_POST["country_id"]; - $this->object->state_id = $_POST["departement_id"]; + $this->object->state_id = $_POST["state_id"]; $this->object->tel = $_POST["tel"]; $this->object->fax = $_POST["fax"]; $this->object->email = trim($_POST["email"]); @@ -483,10 +483,10 @@ abstract class ActionsCardCommon } // Zip - $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6); + $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); // Town - $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','departement_id')); + $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','state_id')); // Country $this->object->country_id = ($this->object->country_id ? $this->object->country_id : $mysoc->country_id); @@ -670,7 +670,7 @@ abstract class ActionsCardCommon $this->object->zip = $_POST["zipcode"]; $this->object->town = $_POST["town"]; $this->object->country_id = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id; - $this->object->state_id = $_POST["departement_id"]; + $this->object->state_id = $_POST["state_id"]; $this->object->tel = $_POST["tel"]; $this->object->fax = $_POST["fax"]; $this->object->email = $_POST["email"]; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index dd9ab8f1abf..861ad5c9ef8 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -54,10 +54,9 @@ class Societe extends CommonObject var $town; var $status; // 0=activity ceased, 1= in activity - var $state_id; + var $state_id; // Id of department var $state_code; var $state; - var $departement_id; // deprecated var $departement_code; // deprecated var $departement; // deprecated diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 8682058091d..837cb98d579 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -129,7 +129,7 @@ if (empty($reshook)) $object->zip = GETPOST('zipcode'); $object->town = GETPOST('town'); $object->country_id = GETPOST('country_id'); - $object->state_id = GETPOST('departement_id'); + $object->state_id = GETPOST('state_id'); $object->phone = GETPOST('phone'); $object->fax = GETPOST('fax'); $object->email = GETPOST('email'); @@ -450,6 +450,13 @@ if (empty($reshook)) $result = $object->set_parent(GETPOST('editparentcompany','int')); } + + // Actions to send emails + $id=$socid; + $actiontypecode='AC_OTH_AUTO'; + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; + + /* * Generate document */ @@ -588,7 +595,7 @@ else $object->address = GETPOST('address'); $object->zip = GETPOST('zipcode'); $object->town = GETPOST('town'); - $object->state_id = GETPOST('departement_id'); + $object->state_id = GETPOST('state_id'); $object->phone = GETPOST('phone'); $object->fax = GETPOST('fax'); $object->email = GETPOST('email'); @@ -812,9 +819,9 @@ else // Zip / Town print ''.$langs->trans('Zip').''; - print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6); + print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); print ''.$langs->trans('Town').''; - print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','departement_id')); + print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id')); print ''; // Country @@ -827,7 +834,7 @@ else if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print ''.$langs->trans('State').''; - if ($object->country_id) print $formcompany->select_state($object->state_id,$object->country_code,'departement_id'); + if ($object->country_id) print $formcompany->select_state($object->state_id,$object->country_code,'state_id'); else print $countrynotdefined; print ''; } @@ -1069,7 +1076,7 @@ else $object->zip = GETPOST('zipcode'); $object->town = GETPOST('town'); $object->country_id = GETPOST('country_id')?GETPOST('country_id'):$mysoc->country_id; - $object->state_id = GETPOST('departement_id'); + $object->state_id = GETPOST('state_id'); $object->phone = GETPOST('phone'); $object->fax = GETPOST('fax'); $object->email = GETPOST('email'); @@ -1230,9 +1237,9 @@ else // Zip / Town print ''.$langs->trans('Zip').''; - print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6); + print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); print ''.$langs->trans('Town').''; - print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','departement_id')); + print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id')); print ''; // Country @@ -1771,6 +1778,8 @@ else */ print '
'."\n"; + print ''; + if ($user->rights->societe->creer) { print ''."\n"; @@ -1790,51 +1799,138 @@ else print '
'."\n"; - if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC)) - { - print '
'; - //print '
'; - print ''; // ancre + + if ($action == 'presend') + { + /* + * Affiche formulaire mail + */ - /* - * Documents generes - */ - $filedir=$conf->societe->multidir_output[$object->entity].'/'.$object->id; - $urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id; - $genallowed=$user->rights->societe->creer; - $delallowed=$user->rights->societe->supprimer; + // By default if $action=='presend' + $titreform='SendMail'; + $topicmail=''; + $action='send'; + $modelmail='thirdparty'; - $var=true; + print '
'; + print_titre($langs->trans($titreform)); - $somethingshown=$formfile->show_documents('company',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang); + // Cree l'objet formulaire mail + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + $formmail->fromtype = 'user'; + $formmail->fromid = $user->id; + $formmail->fromname = $user->getFullName($langs); + $formmail->frommail = $user->email; + $formmail->withfrom=1; + $formmail->withtopic=1; + $liste=array(); + foreach ($object->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; + $formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$liste; + $formmail->withtofree=0; + $formmail->withtocc=$liste; + $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; + $formmail->withfile=2; + $formmail->withbody=1; + $formmail->withdeliveryreceipt=1; + $formmail->withcancel=1; + // Tableau des substitutions + $formmail->substit['__SIGNATURE__']=$user->signature; + $formmail->substit['__PERSONALIZED__']=''; + $formmail->substit['__CONTACTCIVNAME__']=''; - print '
'; + //Find the good contact adress + /* + $custcontact=''; + $contactarr=array(); + $contactarr=$object->liste_contact(-1,'external'); + + if (is_array($contactarr) && count($contactarr)>0) + { + foreach($contactarr as $contact) + { + if ($contact['libelle']==$langs->trans('TypeContact_facture_external_BILLING')) { + + require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; + + $contactstatic=new Contact($db); + $contactstatic->fetch($contact['id']); + $custcontact=$contactstatic->getFullName($langs,1); + } + } + + if (!empty($custcontact)) { + $formmail->substit['__CONTACTCIVNAME__']=$custcontact; + } + }*/ - print '
'; + // Tableau des parametres complementaires du post + $formmail->param['action']=$action; + $formmail->param['models']=$modelmail; + $formmail->param['socid']=$object->id; + $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?socid='.$object->id; - print '
'; - } + // Init list of files + if (GETPOST("mode")=='init') + { + $formmail->clear_attached_files(); + $formmail->add_attached_files($file,basename($file),dol_mimetype($file)); + } - print '

'; + $formmail->show_form(); - // Subsidiaries list - $result=show_subsidiaries($conf,$langs,$db,$object); - - // Contacts list - if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) - { - $result=show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); - } - - // Addresses list - if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)) - { - $result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); - } - - // Projects list - $result=show_projects($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); + print '
'; + } + else + { + + if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC)) + { + print '
'; + //print ' - +
'; + print ''; // ancre + + /* + * Documents generes + */ + $filedir=$conf->societe->multidir_output[$object->entity].'/'.$object->id; + $urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id; + $genallowed=$user->rights->societe->creer; + $delallowed=$user->rights->societe->supprimer; + + $var=true; + + $somethingshown=$formfile->show_documents('company',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang); + + print '
'; + + + print '
'; + + print '
'; + } + + print '

'; + + // Subsidiaries list + $result=show_subsidiaries($conf,$langs,$db,$object); + + // Contacts list + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) + { + $result=show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); + } + + // Addresses list + if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)) + { + $result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); + } + + // Projects list + $result=show_projects($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); + } } } diff --git a/htdocs/societe/societe.php b/htdocs/societe/societe.php index 7840f5e7d9e..28a3c5c2885 100644 --- a/htdocs/societe/societe.php +++ b/htdocs/societe/societe.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García * Copyright (C) 2013 Raphaël Doursenaud @@ -22,7 +22,7 @@ /** * \file htdocs/societe/societe.php * \ingroup societe - * \brief Page to show a third party + * \brief Page to show list of third parties */ require_once '../main.inc.php'; diff --git a/htdocs/user/admin/user_extrafields.php b/htdocs/user/admin/user_extrafields.php index 83878126858..ce372d25d4b 100644 --- a/htdocs/user/admin/user_extrafields.php +++ b/htdocs/user/admin/user_extrafields.php @@ -50,7 +50,7 @@ if (!$user->admin) accessforbidden(); * Actions */ -require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; diff --git a/test/selenium/test_thirdparty.xml b/test/selenium/test_thirdparty.xml index 704796cd4c2..47a9b8091a9 100644 --- a/test/selenium/test_thirdparty.xml +++ b/test/selenium/test_thirdparty.xml @@ -38,7 +38,7 @@
selectdepartement_idstate_id label=01 - Ain