From 9093be2f0a796885ccc571472b423f628abb6969 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Jun 2019 11:23:49 +0200 Subject: [PATCH 1/7] FIX Add missing end date of subscription in export --- htdocs/core/modules/modAdherent.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index bc01990d659..b1dd10ebe17 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -278,9 +278,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.civility'=>"UserTitle",'a.lastname'=>"Lastname",'a.firstname'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature','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','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.subscription'=>'Amount'); - $this->export_TypeFields_array[$r]=array('a.civility'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",'a.zip'=>"Text",'a.town'=>"Text",'d.nom'=>"Text",'co.code'=>'Text','co.label'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note_public'=>"Text",'a.note_private'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:adherent_type:libelle','ta.libelle'=>'Text','c.rowid'=>'Numeric','c.dateadh'=>'Date','c.subscription'=>'Numeric'); - $this->export_entities_array[$r]=array('a.rowid'=>'member','a.civility'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.address'=>"member",'a.zip'=>"member",'a.town'=>"member",'d.nom'=>"member",'co.code'=>"member",'co.label'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.birth'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note_public'=>"member",'a.note_private'=>"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.subscription'=>'subscription'); + $this->export_fields_array[$r]=array('a.rowid'=>'Id','a.civility'=>"UserTitle",'a.lastname'=>"Lastname",'a.firstname'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature','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','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.datef'=>'DateEndSubscription','c.subscription'=>'Amount'); + $this->export_TypeFields_array[$r]=array('a.civility'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",'a.zip'=>"Text",'a.town'=>"Text",'d.nom'=>"Text",'co.code'=>'Text','co.label'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note_public'=>"Text",'a.note_private'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:adherent_type:libelle','ta.libelle'=>'Text','c.rowid'=>'Numeric','c.dateadh'=>'Date','c.datef'=>'Date','c.subscription'=>'Numeric'); + $this->export_entities_array[$r]=array('a.rowid'=>'member','a.civility'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.address'=>"member",'a.zip'=>"member",'a.town'=>"member",'d.nom'=>"member",'co.code'=>"member",'co.label'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.birth'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note_public'=>"member",'a.note_private'=>"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.datef'=>'subscription','c.subscription'=>'subscription'); // Add extra fields $keyforselect='adherent'; $keyforelement='member'; $keyforaliasextra='extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; From f9095408b67320c0b6527e0875b695cde60f0474 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Jun 2019 13:25:40 +0200 Subject: [PATCH 2/7] Fix sort order of export profiles Add missing pos information into export of invoice Add missing label of project in export of invoice --- htdocs/core/modules/modCommande.class.php | 2 +- .../core/modules/modDynamicPrices.class.php | 1 + .../core/modules/modExpenseReport.class.php | 2 +- htdocs/core/modules/modFacture.class.php | 36 ++++++++++++++----- htdocs/core/modules/modFicheinter.class.php | 2 +- htdocs/core/modules/modFournisseur.class.php | 2 +- htdocs/core/modules/modHoliday.class.php | 2 +- htdocs/core/modules/modProduct.class.php | 2 +- htdocs/core/modules/modProjet.class.php | 2 +- htdocs/core/modules/modPropale.class.php | 2 +- htdocs/core/modules/modReception.class.php | 4 +-- htdocs/core/modules/modResource.class.php | 2 +- htdocs/core/modules/modService.class.php | 2 +- htdocs/core/modules/modSociete.class.php | 2 +- .../modules/modSupplierProposal.class.php | 1 + htdocs/core/modules/modSyslog.class.php | 2 +- htdocs/core/modules/modUser.class.php | 2 +- htdocs/exports/export.php | 16 ++++----- 18 files changed, 53 insertions(+), 31 deletions(-) diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 025bbf0a50c..ea70a9f4103 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -51,7 +51,7 @@ class modCommande extends DolibarrModules $this->numero = 25; $this->family = "crm"; - $this->module_position = '30'; + $this->module_position = '23'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "Gestion des commandes clients"; diff --git a/htdocs/core/modules/modDynamicPrices.class.php b/htdocs/core/modules/modDynamicPrices.class.php index 708f0fb86a7..92b79f3ffb8 100644 --- a/htdocs/core/modules/modDynamicPrices.class.php +++ b/htdocs/core/modules/modDynamicPrices.class.php @@ -42,6 +42,7 @@ class modDynamicPrices extends DolibarrModules $this->numero = 2200; $this->family = "products"; + $this->module_position = '85'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "Enable the usage of math expressions for prices"; diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index 6a2ba294b7e..0d8fa008c6b 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -44,7 +44,7 @@ class modExpenseReport extends DolibarrModules $this->numero = 770; $this->family = "hr"; - $this->module_position = '40'; + $this->module_position = '42'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 106de48e96d..88343d8df49 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -218,7 +218,7 @@ class modFacture extends DolibarrModules 'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT", 'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LocalTax1', 'f.localtax2'=>'LocalTax2', 'none.rest'=>'Rest', 'f.paye'=>"InvoicePaid", 'f.fk_statut'=>'InvoiceStatus', 'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin', - 'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription", + 'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'pj.title'=>'ProjectLabel', 'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription", 'fd.subprice'=>"LineUnitPrice", 'fd.tva_tx'=>"LineVATRate", 'fd.qty'=>"LineQty", 'fd.total_ht'=>"LineTotalHT", 'fd.total_tva'=>"LineTotalVAT", 'fd.total_ttc'=>"LineTotalTTC", 'fd.date_start'=>"DateStart", 'fd.date_end'=>"DateEnd", 'fd.special_code'=>'SpecialCode', 'fd.product_type'=>"TypeOfLineServiceOrProduct", 'fd.fk_product'=>'ProductId', 'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel', @@ -232,21 +232,31 @@ class modFacture extends DolibarrModules $this->export_fields_array[$r]['f.multicurrency_total_tva'] = 'MulticurrencyAmountVAT'; $this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC'; } + if (! empty($conf->cashdesk->enabled) || ! empty($conf->takepos->enabled) || ! empty($conf->global->INVOICE_SHOW_POS_IN_EXPORT)) + { + $this->export_fields_array[$r]['f.module_source']='POSModule'; + $this->export_fields_array[$r]['f.pos_source']='POSTerminal'; + } $this->export_TypeFields_array[$r] = array( 's.rowid'=>'Numeric', 's.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 'cd.nom'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text', 'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date", 'f.total'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.tva'=>"Numeric", 'f.localtax1'=>'Numeric', 'f.localtax2'=>'Numeric', 'none.rest'=>"NumericCompute", 'f.paye'=>"Boolean", 'f.fk_statut'=>'Numeric', 'f.note_private'=>"Text", 'f.note_public'=>"Text", 'f.fk_user_author'=>'Numeric', 'uc.login'=>'Text', 'f.fk_user_valid'=>'Numeric', 'uv.login'=>'Text', - 'pj.ref'=>'Text', 'fd.rowid'=>'Numeric', 'fd.label'=>'Text', 'fd.description'=>"Text", 'fd.subprice'=>"Numeric", 'fd.tva_tx'=>"Numeric", + 'pj.ref'=>'Text', 'pj.title'=>'Text', 'fd.rowid'=>'Numeric', 'fd.label'=>'Text', 'fd.description'=>"Text", 'fd.subprice'=>"Numeric", 'fd.tva_tx'=>"Numeric", 'fd.qty'=>"Numeric", 'fd.total_ht'=>"Numeric", 'fd.total_tva'=>"Numeric", 'fd.total_ttc'=>"Numeric", 'fd.date_start'=>"Date", 'fd.date_end'=>"Date", 'fd.special_code'=>'Numeric', 'fd.product_type'=>"Numeric", 'fd.fk_product'=>'List:product:label', 'p.ref'=>'Text', 'p.label'=>'Text', 'p.accountancy_code_sell'=>'Text' ); + if (! empty($conf->cashdesk->enabled) || ! empty($conf->takepos->enabled) || ! empty($conf->global->INVOICE_SHOW_POS_IN_EXPORT)) + { + $this->export_TypeFields_array[$r]['f.module_source']='Text'; + $this->export_TypeFields_array[$r]['f.pos_source']='Text'; + } $this->export_entities_array[$r] = array( - 's.rowid'=>"company", 's.nom'=>'company', 's.code_client'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 's.phone'=>'company', + 's.rowid'=>"company", 's.nom'=>'company', 's.code_client'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 'cd.nom'=>'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', - 's.tva_intra'=>'company', 'pj.ref'=>'project', 'fd.rowid'=>'invoice_line', 'fd.label'=>"invoice_line", 'fd.description'=>"invoice_line", + 's.tva_intra'=>'company', 'pj.ref'=>'project', 'pj.title'=>'project', 'fd.rowid'=>'invoice_line', 'fd.label'=>"invoice_line", 'fd.description'=>"invoice_line", 'fd.subprice'=>"invoice_line", 'fd.total_ht'=>"invoice_line", 'fd.total_tva'=>"invoice_line", 'fd.total_ttc'=>"invoice_line", 'fd.tva_tx'=>"invoice_line", 'fd.qty'=>"invoice_line", 'fd.date_start'=>"invoice_line", 'fd.date_end'=>"invoice_line", 'fd.special_code'=>'invoice_line', 'fd.product_type'=>'invoice_line', 'fd.fk_product'=>'product', 'p.ref'=>'product', 'p.label'=>'product', 'p.accountancy_code_sell'=>'product', @@ -292,7 +302,7 @@ class modFacture extends DolibarrModules 'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT", 'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LocalTax1', 'f.localtax2'=>'LocalTax2', 'none.rest'=>'Rest', 'f.paye'=>"InvoicePaid", 'f.fk_statut'=>'InvoiceStatus', 'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin', - 'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'p.rowid'=>'PaymentId', 'p.ref'=>'PaymentRef', + 'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'pj.title'=>'ProjectLabel', 'p.rowid'=>'PaymentId', 'p.ref'=>'PaymentRef', 'p.amount'=>'AmountPayment', 'pf.amount'=>'AmountPaymentDistributedOnInvoice', 'p.datep'=>'DatePayment', 'p.num_paiement'=>'PaymentNumber', 'pt.code'=>'CodePaymentMode', 'pt.libelle'=>'LabelPaymentMode', 'p.note'=>'PaymentNote', 'p.fk_bank'=>'IdTransaction', 'ba.ref'=>'AccountRef' ); @@ -304,19 +314,29 @@ class modFacture extends DolibarrModules $this->export_fields_array[$r]['f.multicurrency_total_tva'] = 'MulticurrencyAmountVAT'; $this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC'; } + if (! empty($conf->cashdesk->enabled) || ! empty($conf->takepos->enabled) || ! empty($conf->global->INVOICE_SHOW_POS_IN_EXPORT)) + { + $this->export_fields_array[$r]['f.module_source']='POSModule'; + $this->export_fields_array[$r]['f.pos_source']='POSTerminal'; + } $this->export_TypeFields_array[$r] = array( 's.rowid'=>'Numeric', 's.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 'cd.nom'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text', 'f.rowid'=>"Numeric", 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date", 'f.total'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.tva'=>"Numeric", 'f.localtax1'=>'Numeric', 'f.localtax2'=>'Numeric', 'none.rest'=>'NumericCompute', 'f.paye'=>"Boolean", 'f.fk_statut'=>'Status', 'f.note_private'=>"Text", 'f.note_public'=>"Text", 'f.fk_user_author'=>'Numeric', 'uc.login'=>'Text', 'f.fk_user_valid'=>'Numeric', 'uv.login'=>'Text', - 'pj.ref'=>'Text', 'p.amount'=>'Numeric', 'pf.amount'=>'Numeric', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 'p.datep'=>'Date', 'p.num_paiement'=>'Numeric', + 'pj.ref'=>'Text', 'p.amount'=>'Numeric', 'pf.amount'=>'Numeric', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 'p.title'=>'Text', 'p.datep'=>'Date', 'p.num_paiement'=>'Numeric', 'p.fk_bank'=>'Numeric', 'p.note'=>'Text', 'pt.code'=>'Text', 'pt.libelle'=>'text', 'ba.ref'=>'Text' ); + if (! empty($conf->cashdesk->enabled) || ! empty($conf->takepos->enabled) || ! empty($conf->global->INVOICE_SHOW_POS_IN_EXPORT)) + { + $this->export_fields_array[$r]['f.module_source']='POSModule'; + $this->export_fields_array[$r]['f.pos_source']='POSTerminal'; + } $this->export_entities_array[$r] = array( - 's.rowid'=>"company", 's.nom'=>'company', 's.code_client'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 's.phone'=>'company', + 's.rowid'=>"company", 's.nom'=>'company', 's.code_client'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 'cd.nom'=>'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', - 's.tva_intra'=>'company', 'pj.ref'=>'project', 'p.rowid'=>'payment', 'p.ref'=>'payment', 'p.amount'=>'payment', 'pf.amount'=>'payment', 'p.datep'=>'payment', + 's.tva_intra'=>'company', 'pj.ref'=>'project', 'p.title'=>'project', 'p.rowid'=>'payment', 'p.ref'=>'payment', 'p.amount'=>'payment', 'pf.amount'=>'payment', 'p.datep'=>'payment', 'p.num_paiement'=>'payment', 'pt.code'=>'payment', 'pt.libelle'=>'payment', 'p.note'=>'payment', 'f.fk_user_author'=>'user', 'uc.login'=>'user', 'f.fk_user_valid'=>'user', 'uv.login'=>'user', 'p.fk_bank'=>'account', 'ba.ref'=>'account' ); diff --git a/htdocs/core/modules/modFicheinter.class.php b/htdocs/core/modules/modFicheinter.class.php index 8267000297b..5ebba6ff6ee 100644 --- a/htdocs/core/modules/modFicheinter.class.php +++ b/htdocs/core/modules/modFicheinter.class.php @@ -50,7 +50,7 @@ class modFicheinter extends DolibarrModules $this->numero = 70; $this->family = "crm"; - $this->module_position = '45'; + $this->module_position = '41'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "Gestion des fiches d'intervention"; diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 12193b630c8..a545ce1378b 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -49,7 +49,7 @@ class modFournisseur extends DolibarrModules // Family can be 'crm','financial','hr','projects','product','ecm','technic','other' // It is used to group modules in module setup page $this->family = "srm"; - $this->module_position = '10'; + $this->module_position = '12'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "Gestion des fournisseurs"; diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index 09a30e16914..8bb34a338e5 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -54,7 +54,7 @@ class modHoliday extends DolibarrModules // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // It is used to group modules in module setup page $this->family = "hr"; - $this->module_position = '30'; + $this->module_position = '42'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 3a18749bcde..d425b07d01a 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -50,7 +50,7 @@ class modProduct extends DolibarrModules $this->numero = 50; $this->family = "products"; - $this->module_position = '20'; + $this->module_position = '25'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "Product management"; diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 106517c638a..deb5192efc6 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -49,7 +49,7 @@ class modProjet extends DolibarrModules $this->numero = 400; $this->family = "projects"; - $this->module_position = '10'; + $this->module_position = '14'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "Gestion des projets"; diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index b28477f3719..745fec8ef96 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -49,7 +49,7 @@ class modPropale extends DolibarrModules $this->numero = 20; $this->family = "crm"; - $this->module_position = '20'; + $this->module_position = '22'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "Gestion des propositions commerciales"; diff --git a/htdocs/core/modules/modReception.class.php b/htdocs/core/modules/modReception.class.php index 9fc82dc9ad6..6594d7bb04a 100644 --- a/htdocs/core/modules/modReception.class.php +++ b/htdocs/core/modules/modReception.class.php @@ -41,10 +41,10 @@ class modReception extends DolibarrModules global $conf, $user; $this->db = $db; - $this->numero = 104160; + $this->numero = 94160; $this->family = "srm"; - $this->module_position = 40; + $this->module_position = '40'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "Gestion des réceptions fournisseurs"; diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index 5925998a2b2..cceacf3263c 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -55,7 +55,7 @@ class modResource extends DolibarrModules // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // It is used to group modules in module setup page $this->family = "projects"; - $this->module_position = '20'; + $this->module_position = '16'; // Module label (no space allowed) // used if translation string 'ModuleXXXName' not found // (where XXX is value of numeric property 'numero' of module) diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 9db733e4bb2..605c48f0e6b 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -48,7 +48,7 @@ class modService extends DolibarrModules $this->numero = 53; $this->family = "products"; - $this->module_position = '30'; + $this->module_position = '29'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "Service management"; diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index cb01019cc1b..e41e96c5add 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -49,7 +49,7 @@ class modSociete extends DolibarrModules $this->numero = 1; $this->family = "crm"; - $this->module_position = '10'; + $this->module_position = '09'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "Gestion des sociétés et contacts"; diff --git a/htdocs/core/modules/modSupplierProposal.class.php b/htdocs/core/modules/modSupplierProposal.class.php index 882b02b5fb4..18cddf2a143 100644 --- a/htdocs/core/modules/modSupplierProposal.class.php +++ b/htdocs/core/modules/modSupplierProposal.class.php @@ -50,6 +50,7 @@ class modSupplierProposal extends DolibarrModules $this->numero = 1120; $this->family = "srm"; + $this->module_position = '35'; $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "supplier_proposalDESC"; diff --git a/htdocs/core/modules/modSyslog.class.php b/htdocs/core/modules/modSyslog.class.php index 1ac6ead1087..b754eae2765 100644 --- a/htdocs/core/modules/modSyslog.class.php +++ b/htdocs/core/modules/modSyslog.class.php @@ -46,7 +46,7 @@ class modSyslog extends DolibarrModules // It is used to group modules in module setup page $this->family = "base"; // Module position in the family on 2 digits ('01', '10', '20', ...) - $this->module_position = '50'; + $this->module_position = '75'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index bf7b0c49896..7e31400f1ab 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -46,7 +46,7 @@ class modUser extends DolibarrModules $this->numero = 0; $this->family = "hr"; // Family for module (or "base" if core module) - $this->module_position = '10'; + $this->module_position = '05'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "Gestion des utilisateurs (requis)"; diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index b6dfc23cf48..df298153062 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -361,7 +361,7 @@ if ($action == 'add_export_model') } } -// Reload an predefined export model +// Reload a predefined export model if ($step == 2 && $action == 'select_model') { $_SESSION["export_selected_fields"]=array(); @@ -448,13 +448,13 @@ if ($step == 1 || ! $datatoexport) print ''.$langs->trans("ExportableDatas").''; print ' '; print ''; - $val=true; - if (count($objexport->array_export_code)) + + if (count($objexport->array_export_module)) { - foreach ($objexport->array_export_code as $key => $value) + $sortedarrayofmodules = dol_sort_array($objexport->array_export_module, 'module_position', 'asc', 0, 0, 1); + foreach ($sortedarrayofmodules as $key => $value) { - $val=!$val; - print ''; + print ''; //print img_object($objexport->array_export_module[$key]->getName(),$export->array_export_module[$key]->picto).' '; print $objexport->array_export_module[$key]->getName(); print ''; @@ -466,7 +466,7 @@ if ($step == 1 || ! $datatoexport) print ''; if ($objexport->array_export_perms[$key]) { - print ''.img_picto($langs->trans("NewExport"), 'filenew').''; + print ''.img_picto($langs->trans("NewExport"), 'filenew').''; } else { @@ -477,7 +477,7 @@ if ($step == 1 || ! $datatoexport) } else { - print ''.$langs->trans("NoExportableData").''; + print ''.$langs->trans("NoExportableData").''; } print ''; print ''; From 4499447a89e085c7ef8686c4af206780d5c08caa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Jun 2019 14:27:38 +0200 Subject: [PATCH 3/7] Fix sort order of import profiles Fix picto in import profile for accounting --- htdocs/core/modules/modAccounting.class.php | 2 +- htdocs/imports/import.php | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index b7ef8950fe1..65638a1cab2 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -240,7 +240,7 @@ class modAccounting extends DolibarrModules $r++; $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]='Chartofaccounts'; - $this->export_icon[$r]='Accounting'; + $this->export_icon[$r]='accounting'; $this->export_permission[$r]=array(array("accounting","chartofaccount")); $this->export_fields_array[$r]=array('ac.rowid'=>'ChartofaccountsId','ac.pcg_version'=>'Chartofaccounts','aa.rowid'=>'Id','aa.account_number'=>"AccountAccounting",'aa.label'=>"Label",'aa.account_parent'=>"Accountparent",'aa.pcg_type'=>"Pcgtype",'aa.pcg_subtype'=>'Pcgsubtype','aa.active'=>'Status'); $this->export_TypeFields_array[$r]=array('ac.rowid'=>'List:accounting_system:pcg_version','aa.account_number'=>"Text",'aa.label'=>"Text",'aa.account_parent'=>"Text",'aa.pcg_type'=>'Text','aa.pcg_subtype'=>'Text','aa.active'=>'Status'); diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 9227998e4a0..7bcd69e3d0b 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -352,20 +352,19 @@ if ($step == 1 || ! $datatoimport) print ''.$langs->trans("ImportableDatas").''; print ' '; print ''; - $val=true; - if (count($objimport->array_import_code)) + + if (count($objimport->array_import_module)) { - foreach ($objimport->array_import_code as $key => $value) + $sortedarrayofmodules = dol_sort_array($objimport->array_import_module, 'module_position', 'asc', 0, 0, 1); + foreach ($sortedarrayofmodules as $key => $value) { //var_dump($objimport->array_import_code[$key]); - $val=!$val; - print ''; + print ''; $titleofmodule=$objimport->array_import_module[$key]->getName(); // Special cas for import common to module/services if (in_array($objimport->array_import_code[$key], array('produit_supplierprices','produit_multiprice','produit_languages'))) $titleofmodule=$langs->trans("ProductOrService"); print $titleofmodule; print ''; - //print $value; print img_object($objimport->array_import_module[$key]->getName(), $objimport->array_import_icon[$key]).' '; print $objimport->array_import_label[$key]; print ''; @@ -382,7 +381,7 @@ if ($step == 1 || ! $datatoimport) } else { - print ''.$langs->trans("NoImportableData").''; + print ''.$langs->trans("NoImportableData").''; } print ''; print ''; From c63b465d48eef28f0dbefde9dde133538a712895 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Jun 2019 14:34:04 +0200 Subject: [PATCH 4/7] Fix doxygen --- htdocs/core/class/dolgraph.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 5cec0232603..8b7bc4acf18 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -47,8 +47,16 @@ class DolGraph public $data; // Data of graph: array(array('abs1',valA1,valB1), array('abs2',valA2,valB2), ...) public $title; // Title of graph public $cssprefix=''; // To add into css styles + + /** + * @var int|string Width of graph. It can be a numeric for pixels or a string like '100%' + */ public $width=380; + /** + * @var int Height of graph + */ public $height=200; + public $MaxValue=0; public $MinValue=0; public $SetShading=0; From 0bc0f8ae943e5685357fa593fb55b59807699400 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Jun 2019 15:40:35 +0200 Subject: [PATCH 5/7] Fix translation of country --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index ce7617f003d..2ad9a3473a4 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1330,7 +1330,7 @@ class Societe extends CommonObject $this->country_id = $obj->country_id; $this->country_code = $obj->country_id?$obj->country_code:''; - $this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->transnoentities('Country'.$obj->country_code):$obj->country):''; + $this->country = $obj->country_id?($langs->transnoentities('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->transnoentities('Country'.$obj->country_code):$obj->country):''; $this->state_id = $obj->state_id; $this->state_code = $obj->state_code; From a7d7d44f87a148f1c0aa1c945f11c97b2e4b3147 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Jun 2019 19:58:28 +0200 Subject: [PATCH 6/7] FIX Management of vat info in stripe --- .../interface_80_modStripe_Stripe.class.php | 54 ++++++++++++++++--- htdocs/public/payment/newpayment.php | 21 +++++++- htdocs/stripe/class/stripe.class.php | 18 ++++++- 3 files changed, 82 insertions(+), 11 deletions(-) diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index f9d28a0b984..fb400ecb7be 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -147,7 +147,7 @@ class InterfaceStripe if ($customer) { $namecleaned = $object->name ? $object->name : null; - $vatcleaned = $object->tva_intra ? $object->tva_intra : null; + $vatcleaned = $object->tva_intra ? $object->tva_intra : null; // Example of valid numbers are 'FR12345678901' or 'FR12345678902' $desccleaned = $object->name_alias ? $object->name_alias : null; $taxexemptcleaned = $object->tva_assuj ? 'none' : 'exempt'; $langcleaned = $object->default_lang ? array(substr($object->default_lang, 0, 2)) : null; @@ -173,10 +173,10 @@ class InterfaceStripe if ($desccleaned != $customer->description) $changerequested++; if (($customer->tax_exempt == 'exempt' && ! $object->tva_assuj) || (! $customer->tax_exempt == 'exempt' && empty($object->tva_assuj))) $changerequested++; if (! isset($customer->tax_ids['data']) && ! is_null($vatcleaned)) $changerequested++; - elseif (isset($customer->tax_ids['data']) && is_null($vatcleaned)) $changerequested++; - elseif (isset($customer->tax_ids['data']) && ! is_null($vatcleaned)) + elseif (isset($customer->tax_ids['data'])) { $taxinfo = reset($customer->tax_ids['data']); + if (empty($taxinfo) && ! empty($vatcleaned)) $changerequested++; if (isset($taxinfo->value) && $vatcleaned != $taxinfo->value) $changerequested++; } @@ -190,10 +190,42 @@ class InterfaceStripe $customer->description = $desccleaned; $customer->preferred_locales = $langcleaned; $customer->tax_exempt = $taxexemptcleaned; - if (! empty($vatcleaned)) $customer->tax_ids = array('object'=>'list', 'data'=>array('value'=>$vatcleaned)); - else $customer->tax_ids = null; - $customer->save(); + try { + // Update Tax info on Stripe + if (! empty($conf->global->STRIPE_SAVE_TAX_IDS)) // We setup to save Tax info on Stripe side. Warning: This may result in error when saving customer + { + if (! empty($vatcleaned)) + { + $isineec=isInEEC($object); + if ($object->country_code && $isineec) + { + //$taxids = $customer->allTaxIds($customer->id); + $customer->createTaxId($customer->id, array('type'=>'eu_vat', 'value'=>$vatcleaned)); + } + } + else + { + $taxids = $customer->allTaxIds($customer->id); + if (is_array($taxids->data)) + { + foreach($taxids->data as $taxidobj) + { + $customer->deleteTaxId($customer->id, $taxidobj->id); + } + } + } + } + + // Update Customer on Stripe + $customer->save(); + } + catch(Exception $e) + { + //var_dump(\Stripe\Stripe::getApiVersion()); + $this->errors[] = $e->getMessage(); + $ok = -1; + } } } } @@ -206,7 +238,13 @@ class InterfaceStripe $customer = $stripe->customerStripe($object, $stripeacc, $servicestatus); if ($customer) { - $customer->delete(); + try { + $customer->delete(); + } + catch(Exception $e) + { + dol_syslog("Failed to delete Stripe customer ".$e->getMessage(), LOG_WARNING); + } } $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account"; @@ -242,7 +280,7 @@ class InterfaceStripe if ($card) { $card->metadata=array('dol_id'=>$object->id, 'dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>(empty($_SERVER['REMOTE_ADDR'])?'':$_SERVER['REMOTE_ADDR'])); try { - $card->save($dataforcard); + $card->save(); } catch(Exception $e) { diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 90646ef9b41..5d04b6335c7 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -430,6 +430,7 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled)) 'dol_version' => DOL_VERSION, 'dol_entity' => $conf->entity, 'dol_company' => $mysoc->name, // Usefull when using multicompany + 'dol_tax_num' => $taxinfo, 'ipaddress'=> getUserRemoteIP() ); @@ -501,24 +502,40 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled)) { $vatcleaned = $vatnumber ? $vatnumber : null; - $taxinfo = array('type'=>'vat'); + /*$taxinfo = array('type'=>'vat'); if ($vatcleaned) { $taxinfo["tax_id"] = $vatcleaned; } // We force data to "null" if not defined as expected by Stripe if (empty($vatcleaned)) $taxinfo=null; + */ dol_syslog("Create anonymous customer card profile", LOG_DEBUG, 0, '_stripe'); + $customer = \Stripe\Customer::create(array( 'email' => $email, 'description' => ($email?'Anonymous customer for '.$email:'Anonymous customer'), 'metadata' => $metadata, - 'tax_info' => $taxinfo, 'source' => $stripeToken // source can be a token OR array('object'=>'card', 'exp_month'=>xx, 'exp_year'=>xxxx, 'number'=>xxxxxxx, 'cvc'=>xxx, 'name'=>'Cardholder's full name', zip ?) )); // Return $customer = array('id'=>'cus_XXXX', ...) + // Create the VAT record in Stripe + /* We don't know country of customer, so we can't create tax + if (! empty($conf->global->STRIPE_SAVE_TAX_IDS)) // We setup to save Tax info on Stripe side. Warning: This may result in error when saving customer + { + if (! empty($vatcleaned)) + { + $isineec=isInEEC($object); + if ($object->country_code && $isineec) + { + //$taxids = $customer->allTaxIds($customer->id); + $customer->createTaxId($customer->id, array('type'=>'eu_vat', 'value'=>$vatcleaned)); + } + } + }*/ + if (! empty($FULLTAG)) $metadata["FULLTAG"] = $FULLTAG; if (! empty($dol_id)) $metadata["dol_id"] = $dol_id; if (! empty($dol_type)) $metadata["dol_type"] = $dol_type; diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 27346a15f5e..d8d0c656dab 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -192,6 +192,7 @@ class Stripe extends CommonObject $vatcleaned = $object->tva_intra ? $object->tva_intra : null; + /* $taxinfo = array('type'=>'vat'); if ($vatcleaned) { @@ -199,8 +200,8 @@ class Stripe extends CommonObject } // We force data to "null" if not defined as expected by Stripe if (empty($vatcleaned)) $taxinfo=null; - $dataforcustomer["tax_info"] = $taxinfo; + */ //$a = \Stripe\Stripe::getApiKey(); //var_dump($a);var_dump($key);exit; @@ -215,6 +216,21 @@ class Stripe extends CommonObject $customer = \Stripe\Customer::create($dataforcustomer, array("stripe_account" => $key)); } + // Create the VAT record in Stripe + if (! empty($conf->global->STRIPE_SAVE_TAX_IDS)) // We setup to save Tax info on Stripe side. Warning: This may result in error when saving customer + { + if (! empty($vatcleaned)) + { + $isineec=isInEEC($object); + if ($object->country_code && $isineec) + { + //$taxids = $customer->allTaxIds($customer->id); + $customer->createTaxId($customer->id, array('type'=>'eu_vat', 'value'=>$vatcleaned)); + } + } + } + + // Create customer in Dolibarr $sql = "INSERT INTO " . MAIN_DB_PREFIX . "societe_account (fk_soc, login, key_account, site, status, entity, date_creation, fk_user_creat)"; $sql .= " VALUES (".$object->id.", '', '".$this->db->escape($customer->id)."', 'stripe', " . $status . ", " . $conf->entity . ", '".$this->db->idate(dol_now())."', ".$user->id.")"; $resql = $this->db->query($sql); From 18348fea939e71aa6684dbbe9035ca5dbff52e39 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Jun 2019 11:34:16 +0200 Subject: [PATCH 7/7] Fix sort on date on agenda list --- htdocs/comm/action/list.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 28670604b9e..8a578eec735 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -97,15 +97,13 @@ if ($page == -1 || $page == null) { $page = 0 ; } $offset = $limit * $page ; if (! $sortorder) { - $sortorder="DESC"; - if ($status == 'todo') $sortorder="DESC"; - //if ($status == 'done') $sortorder="DESC"; + $sortorder="DESC,DESC"; + if ($status == 'todo') $sortorder="DESC,DESC"; } if (! $sortfield) { - $sortfield="a.datep"; - if ($status == 'todo') $sortfield="a.datep"; - //if ($status == 'done') $sortfield="a.datep2"; + $sortfield="a.datep,a.id"; + if ($status == 'todo') $sortfield="a.datep,a.id"; } // Security check @@ -500,7 +498,7 @@ if ($resql) if (! empty($arrayfields['a.label']['checked'])) print_liste_field_titre($arrayfields['a.label']['label'], $_SERVER["PHP_SELF"], "a.label", $param, "", "", $sortfield, $sortorder); if (! empty($arrayfields['a.note']['checked'])) print_liste_field_titre($arrayfields['a.note']['label'], $_SERVER["PHP_SELF"], "a.note", $param, "", "", $sortfield, $sortorder); //if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) - if (! empty($arrayfields['a.datep']['checked'])) print_liste_field_titre($arrayfields['a.datep']['label'], $_SERVER["PHP_SELF"], "a.datep", $param, '', 'align="center"', $sortfield, $sortorder); + if (! empty($arrayfields['a.datep']['checked'])) print_liste_field_titre($arrayfields['a.datep']['label'], $_SERVER["PHP_SELF"], "a.datep,a.id", $param, '', 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['a.datep2']['checked'])) print_liste_field_titre($arrayfields['a.datep2']['label'], $_SERVER["PHP_SELF"], "a.datep2", $param, '', 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", $param, "", "", $sortfield, $sortorder); if (! empty($arrayfields['a.fk_contact']['checked'])) print_liste_field_titre($arrayfields['a.fk_contact']['label'], $_SERVER["PHP_SELF"], "a.fk_contact", $param, "", "", $sortfield, $sortorder);