From b1a3238c94f1c5b37a0c888819226d5ae326e35c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 21 Aug 2018 14:22:29 +0200 Subject: [PATCH 01/26] Build badge for 5.0 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 64faedeb8b6..46216642e49 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # DOLIBARR ERP & CRM -![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) +![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/5.0.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...). From 0334409d18c7126627cc5c342379f179821d47b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 22 Aug 2018 13:43:30 +0200 Subject: [PATCH 02/26] Update card.php --- htdocs/comm/action/card.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index eba1d77a03f..fc0d4877c7d 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1245,7 +1245,11 @@ if ($id > 0) if (! empty($object->fk_element) && ! empty($object->elementtype)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - print ''.$langs->trans("LinkedObject").''; + print ''; + print ''; + print ''; + print ''; + print ''.$langs->trans("LinkedObject").''; print ''.dolGetElementUrl($object->fk_element,$object->elementtype,1).''; } From 85ae8f39011be6b68a0ab82cdec155f61dc6b8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 24 Aug 2018 09:29:17 +0200 Subject: [PATCH 03/26] Update card.php --- htdocs/comm/action/card.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index fc0d4877c7d..df30dfc1fc6 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1245,12 +1245,14 @@ if ($id > 0) if (! empty($object->fk_element) && ! empty($object->elementtype)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - print ''; + print ''; + print ''.$langs->trans("LinkedObject").''; + print ''.dolGetElementUrl($object->fk_element,$object->elementtype,1).''; + print ''; print ''; print ''; print ''; - print ''.$langs->trans("LinkedObject").''; - print ''.dolGetElementUrl($object->fk_element,$object->elementtype,1).''; + print ''; } // Description From 7462a1ae1d39a22bbb9e95365601e287b879b71e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Aug 2018 02:27:56 +0200 Subject: [PATCH 04/26] Update card.php --- htdocs/comm/action/card.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index df30dfc1fc6..890996bddce 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1247,11 +1247,10 @@ if ($id > 0) include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; print ''; print ''.$langs->trans("LinkedObject").''; - print ''.dolGetElementUrl($object->fk_element,$object->elementtype,1).''; - print ''; - print ''; - print ''; - print ''; + print ''.dolGetElementUrl($object->fk_element,$object->elementtype,1); + print ''; + print ''; + print ''; print ''; } From 7df5993ee0b20e7d5d0c364cf4cc38b77df2ac43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Aug 2018 02:58:14 +0200 Subject: [PATCH 05/26] Fix logo in public survey page --- htdocs/opensurvey/fonctions.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index d2f401813a0..6f0d3da34ac 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -70,6 +70,8 @@ function opensurvey_prepare_head(Opensurveysondage $object) { */ function llxHeaderSurvey($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='') { + global $mysoc; + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers print ''; From b875abb27b63ae60d00101d5be3ea3a73f3944a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Aug 2018 03:03:05 +0200 Subject: [PATCH 06/26] Fix logo on public page of survey --- htdocs/opensurvey/fonctions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index 6f0d3da34ac..84b33297fbb 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -70,7 +70,7 @@ function opensurvey_prepare_head(Opensurveysondage $object) { */ function llxHeaderSurvey($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='') { - global $mysoc; + global $conf, $mysoc; top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers print ''; From 53e476483c0e47d37dbf3c1e55e8b119c3215695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 28 Aug 2018 09:38:24 +0200 Subject: [PATCH 07/26] Build Badge for 6.0 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fbbbdddf665..56ae0038be3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # DOLIBARR ERP & CRM -![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) +![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/6.0.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...). From 055b7392d09883649e024745febaafb8db5654ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 28 Aug 2018 10:07:09 +0200 Subject: [PATCH 08/26] Build Badge for 7.0 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3d9ba75f1f5..c0cc00b818e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # DOLIBARR ERP & CRM -![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) +![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/7.0.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…). From d25f8d8bbd301066a92e19771bba58b42b8356fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 28 Aug 2018 10:08:09 +0200 Subject: [PATCH 09/26] Build Badge for 8.0 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b68e8b65558..5feec47e56f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # DOLIBARR ERP & CRM -![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) +![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/8.0.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…). From bbc625592506b9acee488eaa0dfbe01a14fb312c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Aug 2018 13:07:48 +0200 Subject: [PATCH 10/26] Fix missing language --- htdocs/langs/en_US/other.lang | 1 + htdocs/langs/fr_FR/other.lang | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 53a2684a0d8..f6bb3e76e95 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -188,6 +188,7 @@ NumberOfUnitsSupplierInvoices=Number of units on supplier invoices EMailTextInterventionAddedContact=A newintervention %s has been assigned to you. EMailTextInterventionValidated=The intervention %s has been validated. EMailTextInvoiceValidated=The invoice %s has been validated. +EMailTextInvoicePayed=The invoice %s has been payed. EMailTextProposalValidated=The proposal %s has been validated. EMailTextProposalClosedSigned=The proposal %s has been closed signed. EMailTextOrderValidated=The order %s has been validated. diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index e0a6b7b82dd..78076213a15 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -188,6 +188,7 @@ NumberOfUnitsSupplierInvoices=Quantités présentes dans les factures fournisseu EMailTextInterventionAddedContact=Une nouvelle intervention %s vous a été assignée EMailTextInterventionValidated=La fiche intervention %s vous concernant a été validée. EMailTextInvoiceValidated=La facture %s vous concernant a été validée. +EMailTextInvoicePayed=La facture %s a été payée. EMailTextProposalValidated=La proposition commerciale %s vous concernant a été validée. EMailTextProposalClosedSigned=La proposition %s a été clôturée signée. EMailTextOrderValidated=La commande %s vous concernant a été validée. From 61a57e619f41a555d5a6af01ab6fc1f53b461855 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 28 Aug 2018 16:54:04 +0200 Subject: [PATCH 11/26] FIX : $fk_account is always empty, must be $soc->fk_account --- htdocs/comm/propal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 980121836ae..2fdaadd1d59 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1451,7 +1451,7 @@ if ($action == 'create') // Bank Account if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && ! empty($conf->banque->enabled)) { print '' . $langs->trans('BankAccount') . ''; - $form->select_comptes($fk_account, 'fk_account', 0, '', 1); + $form->select_comptes($soc->fk_account, 'fk_account', 0, '', 1); print ''; } From bc31fa7fbf9b8e3eff1106fc91f7a440cb44b337 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Aug 2018 18:18:04 +0200 Subject: [PATCH 12/26] Fix translation --- htdocs/langs/fr_FR/agenda.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index 4894e6c80d0..f64e93b7188 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -35,7 +35,7 @@ AgendaAutoActionDesc= Définissez ici les événements pour lesquels Dolibarr cr AgendaSetupOtherDesc= Cette page permet de configurer quelques options permettant d'exporter une vue de votre agenda Dolibarr vers un calendrier externe (Thunderbird, Google calendar, …) AgendaExtSitesDesc=Cette page permet d'ajouter des sources de calendriers externes pour les visualiser au sein de l'agenda Dolibarr. ActionsEvents=Événements pour lesquels Dolibarr doit insérer un évènement dans l'agenda en automatique. -EventRemindersByEmailNotEnabled=Les rappels d'événements par email n'ont pas été activés dans la configuration du module Agenda. +EventRemindersByEmailNotEnabled=Les rappels d'événements par email n'ont pas été activés dans la configuration du module %s. ##### Agenda event labels ##### NewCompanyToDolibarr=Tiers %s créé ContractValidatedInDolibarr=Contrat %s validé From d2d28ab10997744ef0f442374d5b05951e363f6c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Aug 2018 18:28:09 +0200 Subject: [PATCH 13/26] Fix trans --- htdocs/langs/en_US/ticket.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 6d50a1bf149..3a7cc9081b9 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -189,7 +189,7 @@ TicketGoIntoContactTab=Please go into "Contacts" tab to select them TicketMessageMailIntro=Introduction TicketMessageMailIntroHelp=This text is added only at the beginning of the email and will not be saved. TicketMessageMailIntroLabelAdmin=Introduction to the message when sending email -TicketMessageMailIntroText=

Hello A new response was sent on a ticket that you contact. Here is the message: +TicketMessageMailIntroText=Hello,
A new response was sent on a ticket that you contact. Here is the message:
TicketMessageMailIntroHelpAdmin=This text will be inserted before the text of the response to a ticket. TicketMessageMailSignature=Signature TicketMessageMailSignatureHelp=This text is added only at the end of the email and will not be saved. From b5c2383f65f2a59e5c71e060355d7cb5295d70ac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Aug 2018 18:34:53 +0200 Subject: [PATCH 14/26] Fix type of invoice encoded twice --- htdocs/compta/facture/card.php | 2 +- htdocs/fourn/facture/card.php | 2 +- htdocs/langs/en_US/ticket.lang | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index f33c41b4c86..20d279c5113 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3703,7 +3703,7 @@ else if ($id > 0 || ! empty($ref)) $discount = new DiscountAbsolute($db); $result = $discount->fetch(0, $object->id); if ($result > 0){ - print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(), $discount->getNomUrl(1, 'discount')).'
'; + print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount')).'
'; } } print ''; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 7032f80574c..9a184fe62a3 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2423,7 +2423,7 @@ else $discount = new DiscountAbsolute($db); $result = $discount->fetch(0, 0, $object->id); if ($result > 0){ - print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(), $discount->getNomUrl(1, 'discount')).'
'; + print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount')).'
'; } } print ''; diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 3a7cc9081b9..d8f1137b7af 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -193,7 +193,7 @@ TicketMessageMailIntroText=Hello,
A new response was sent on a ticket that yo TicketMessageMailIntroHelpAdmin=This text will be inserted before the text of the response to a ticket. TicketMessageMailSignature=Signature TicketMessageMailSignatureHelp=This text is added only at the end of the email and will not be saved. -TicketMessageMailSignatureText=

Cordialement,

--

+TicketMessageMailSignatureText=

Sincerely,

--

TicketMessageMailSignatureLabelAdmin=Signature of response email TicketMessageMailSignatureHelpAdmin=This text will be inserted after the response message. TicketMessageHelp=Only this text will be saved in the message list on ticket card. From 1b542d5be33aa134a24267ab018e20b82351ee79 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Aug 2018 18:36:46 +0200 Subject: [PATCH 15/26] Fix translation --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4b51e1c2f00..2ca70eda8ac 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1640,7 +1640,7 @@ ChequeReceiptsNumberingModule=Cheque Receipts Numbering module MultiCompanySetup=Multi-company module setup ##### Suppliers ##### SuppliersSetup=Supplier module setup -SuppliersCommandModel=Complete template of prchase order (logo...) +SuppliersCommandModel=Complete template of purchase order (logo...) SuppliersInvoiceModel=Complete template of vendor invoice (logo...) SuppliersInvoiceNumberingModel=Supplier invoices numbering models IfSetToYesDontForgetPermission=If set to yes, don't forget to provide permissions to groups or users allowed for the second approval From 24be0b7305800c776ce09770e6df81d95dd0d978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 29 Aug 2018 13:08:52 +0200 Subject: [PATCH 16/26] Update viewimage.php code may have rich content (qrcode, datamatrix,...) --- htdocs/viewimage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 3f7ddbcd1cb..1db05467a66 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -136,7 +136,7 @@ if (preg_match('/\.\./',$fullpath_original_file) || preg_match('/[<>|]/',$fullpa if ($modulepart == 'barcode') { $generator=GETPOST("generator","alpha"); - $code=GETPOST("code",'alpha'); + $code=GETPOST("code",'none'); $encoding=GETPOST("encoding","alpha"); $readable=GETPOST("readable",'alpha')?GETPOST("readable","alpha"):"Y"; From 74b3e3e814b11d795c610bd6452d3d27ec70c97b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Aug 2018 14:50:12 +0200 Subject: [PATCH 17/26] Fix for compatibility with lines with no prices (some external modules) --- htdocs/core/lib/price.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index de5379f46ec..0b9f3a3b246 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -163,6 +163,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt return array(); } } + if ($pu === '') $pu=0; // pu_devise calculation from pu if (empty($pu_devise) && !empty($multicurrency_tx)) { if (is_numeric($pu) && is_numeric($multicurrency_tx)) $pu_devise = $pu * $multicurrency_tx; From 7bf48b8d77ffd097a4b068309a7971e5c4ad405e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Aug 2018 17:03:18 +0200 Subject: [PATCH 18/26] Fix date_start and date_end not saved on supplier invoice Conflicts: htdocs/core/class/commonobject.class.php htdocs/fourn/class/fournisseur.facture.class.php htdocs/fourn/facture/card.php --- htdocs/core/class/commonobject.class.php | 40 ++++++++++++++++++- .../fourn/class/fournisseur.facture.class.php | 27 +++++++++---- 2 files changed, 58 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9ab28f6b2c0..dae9827e0e4 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -46,47 +46,58 @@ abstract class CommonObject * @var DoliDb Database handler (result of a new DoliDB) */ public $db; + /** * @var int The object identifier */ public $id; + /** * @var string Error string * @see errors */ public $error; + /** * @var string[] Array of error strings */ public $errors=array(); + /** * @var string */ public $element; + /** * @var string */ public $table_element; + /** * @var */ public $table_element_line; + /** * @var string Key value used to track if data is coming from import wizard */ public $import_key; + /** * @var mixed Contains data to manage extrafields */ public $array_options=array(); + /** * @var int[][] Array of linked objects ids. Loaded by ->fetchObjectLinked */ public $linkedObjectsIds; + /** * @var mixed Array of linked objects. Loaded by ->fetchObjectLinked */ public $linkedObjects; + /** * @var Object To store a cloned copy of object before to edit it and keep track of old properties */ @@ -116,11 +127,13 @@ abstract class CommonObject * @see fetch_projet() */ public $project; + /** * @var int The related project ID * @see setProject(), project */ public $fk_project; + /** * @deprecated * @see project @@ -132,6 +145,7 @@ abstract class CommonObject * @see fetch_contact() */ public $contact; + /** * @var int The related contact ID * @see fetch_contact() @@ -165,14 +179,17 @@ abstract class CommonObject * @var string The object's reference */ public $ref; + /** * @var string The object's previous reference */ public $ref_previous; + /** * @var string The object's next reference */ public $ref_next; + /** * @var string An external reference for the object */ @@ -189,36 +206,43 @@ abstract class CommonObject * @see getFullAddress() */ public $country; + /** * @var int * @see getFullAddress(), country */ public $country_id; + /** * @var string * @see getFullAddress(), isInEEC(), country */ public $country_code; + /** * @var string * @see getFullAddress() */ public $state; + /** * @var int * @see getFullAddress(), state */ public $state_id; + /** * @var string * @see getFullAddress(), state */ public $state_code; + /** * @var string * @see getFullAddress(), region */ public $region; + /** * @var string * @see getFullAddress(), region @@ -230,16 +254,19 @@ abstract class CommonObject * @see fetch_barcode() */ public $barcode_type; + /** * @var string * @see fetch_barcode(), barcode_type */ public $barcode_type_code; + /** * @var string * @see fetch_barcode(), barcode_type */ public $barcode_type_label; + /** * @var string * @see fetch_barcode(), barcode_type @@ -257,6 +284,7 @@ abstract class CommonObject * @see setPaymentTerms() */ public $cond_reglement_id; + /** * @var int Payment terms ID * @deprecated Kept for compatibility @@ -294,11 +322,13 @@ abstract class CommonObject * @see update_note() */ public $note_public; + /** * @var string Private note * @see update_note() */ public $note_private; + /** * @deprecated * @see note_public @@ -310,21 +340,25 @@ abstract class CommonObject * @see update_price() */ public $total_ht; + /** * @var float Total VAT amount * @see update_price() */ public $total_tva; + /** * @var float Total local tax 1 amount * @see update_price() */ public $total_localtax1; + /** * @var float Total local tax 2 amount * @see update_price() */ public $total_localtax2; + /** * @var float Total amount with taxes * @see update_price() @@ -347,11 +381,13 @@ abstract class CommonObject * @see setIncoterms() */ public $fk_incoterms; + /** * @var string * @see SetIncoterms() */ public $libelle_incoterms; + /** * @var string * @see display_incoterms() @@ -3721,7 +3757,7 @@ abstract class CommonObject $num = count($this->lines); - //Line extrafield + // Line extrafield require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafieldsline = new ExtraFields($this->db); $extralabelslines=$extrafieldsline->fetch_name_optionals_label($this->table_element_line); @@ -3730,6 +3766,7 @@ abstract class CommonObject $reshook = $hookmanager->executeHooks('printObjectLineTitle', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { + // Title line print "\n"; print ''; @@ -3821,7 +3858,6 @@ abstract class CommonObject //Line extrafield $line->fetch_optionals(); - //if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))) if (is_object($hookmanager)) // Old code is commented on preceding line. { diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 8ce8b796892..040bbb49bfa 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -100,7 +100,7 @@ class FactureFournisseur extends CommonInvoice public $total_localtax1=0; public $total_localtax2=0; public $total_ttc=0; - /** + /** * @deprecated * @see note_private, note_public */ @@ -663,7 +663,9 @@ class FactureFournisseur extends CommonInvoice */ function fetch_lines() { - $sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.vat_src_code, f.tva_tx'; + $this->lines = array(); + + $sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.date_start, f.date_end, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.vat_src_code, f.tva_tx'; $sql.= ', f.localtax1_tx, f.localtax2_tx, f.localtax1_type, f.localtax2_type, f.total_localtax1, f.total_localtax2, f.fk_facture_fourn '; $sql.= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit'; $sql.= ', p.rowid as product_id, p.ref as product_ref, p.label as label, p.description as product_desc'; @@ -673,7 +675,6 @@ class FactureFournisseur extends CommonInvoice $sql.= ' WHERE fk_facture_fourn='.$this->id; $sql.= ' ORDER BY f.rang, f.rowid'; - dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG); $resql_rows = $this->db->query($sql); if ($resql_rows) @@ -691,6 +692,9 @@ class FactureFournisseur extends CommonInvoice $line->id = $obj->rowid; $line->rowid = $obj->rowid; $line->description = $obj->description; + $line->date_start = $obj->date_start; + $line->date_end = $obj->date_end; + $line->product_ref = $obj->product_ref; $line->ref = $obj->product_ref; $line->ref_supplier = $obj->ref_supplier; @@ -1724,7 +1728,7 @@ class FactureFournisseur extends CommonInvoice public function updateline($id, $desc, $pu, $vatrate, $txlocaltax1=0, $txlocaltax2=0, $qty=1, $idproduct=0, $price_base_type='HT', $info_bits=0, $type=0, $remise_percent=0, $notrigger=false, $date_start='', $date_end='', $array_options=0, $fk_unit = null, $pu_ht_devise=0, $ref_supplier='') { global $mysoc; - dol_syslog(get_class($this)."::updateline $id,$desc,$pu,$vatrate,$qty,$idproduct,$price_base_type,$info_bits,$type,$remise_percent,$fk_unit,$pu_ht_devise,$ref_supplier", LOG_DEBUG); + dol_syslog(get_class($this)."::updateline $id,$desc,$pu,$vatrate,$qty,$idproduct,$price_base_type,$info_bits,$type,$remise_percent,$notrigger,$date_start,$date_end,$fk_unit,$pu_ht_devise,$ref_supplier", LOG_DEBUG); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; $pu = price2num($pu); @@ -1804,6 +1808,9 @@ class FactureFournisseur extends CommonInvoice $line->remise_percent = $remise_percent; $line->ref_supplier = $ref_supplier; + $line->date_start = $date_start; + $line->date_end = $date_end; + $line->vat_src_code=$vat_src_code; $line->tva_tx = $vatrate; $line->localtax1_tx = $txlocaltax1; @@ -2633,6 +2640,9 @@ class SupplierInvoiceLine extends CommonObjectLine */ public $description; + public $date_start; + public $date_end; + public $skip_update_total; // Skip update price total for special lines /** @@ -2690,7 +2700,7 @@ class SupplierInvoiceLine extends CommonObjectLine */ public function fetch($rowid) { - $sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.tva_tx'; + $sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.date_start, f.date_end, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.tva_tx'; $sql.= ', f.localtax1_type, f.localtax2_type, f.localtax1_tx, f.localtax2_tx, f.total_localtax1, f.total_localtax2 '; $sql.= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_facture_fourn, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit'; $sql.= ', p.rowid as product_id, p.ref as product_ref, p.label as label, p.description as product_desc'; @@ -2717,6 +2727,8 @@ class SupplierInvoiceLine extends CommonObjectLine $this->rowid = $obj->rowid; $this->fk_facture_fourn = $obj->fk_facture_fourn; $this->description = $obj->description; + $this->date_start = $obj->date_start; + $this->date_end = $obj->date_end; $this->product_ref = $obj->product_ref; $this->ref_supplier = $obj->ref_supplier; $this->libelle = $obj->label; @@ -2848,6 +2860,8 @@ class SupplierInvoiceLine extends CommonObjectLine $sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det SET"; $sql.= " description ='".$this->db->escape($this->description)."'"; $sql.= ", ref ='".$this->db->escape($this->ref_supplier ? $this->ref_supplier : $this->ref)."'"; + $sql.= ", date_start = ".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : "null"); + $sql.= ", date_end = ".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : "null"); $sql.= ", pu_ht = ".price2num($this->pu_ht); $sql.= ", pu_ttc = ".price2num($this->pu_ttc); $sql.= ", qty = ".price2num($this->qty); @@ -3022,12 +3036,11 @@ class SupplierInvoiceLine extends CommonObjectLine $sql.= ", ".price2num($this->multicurrency_total_ttc); $sql.= ')'; - dol_syslog(get_class($this)."::insert", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { $this->id=$this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element); - $this->rowid=$this->id; + $this->rowid=$this->id; // backward compatibility if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { From 4450a14c7519317dd1e6d6168fe5705f98d76370 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Aug 2018 17:40:19 +0200 Subject: [PATCH 19/26] Comment --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 98dcca4cf20..e30acd0068b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ # from Dolibarr GitHub repository. # For syntax, see http://about.travis-ci.org/docs/user/languages/php/ -# We use dist: precise to have php 5.3 available +# We use dist: trusty to have php 5.4+ available dist: trusty sudo: required From b9179f27a0d06efc852f531d7e1cc6cba30227ba Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 29 Aug 2018 12:26:31 +0200 Subject: [PATCH 20/26] Fix multicompany in ticket/list.php Conflicts: htdocs/ticket/class/ticket.class.php --- htdocs/ticket/class/ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 3dc0ab39756..76c9eb8856e 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -49,7 +49,7 @@ class Ticket extends CommonObject /** * @var int Does ticketcore support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ - public $ismultientitymanaged = 0; + public $ismultientitymanaged = 1; /** * @var int Does ticketcore support extrafields ? 0=No, 1=Yes */ From d8bd76b8ce61726d4b60f448381881694c8e51fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Aug 2018 18:27:39 +0200 Subject: [PATCH 21/26] FIX #9328 --- htdocs/user/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/document.php b/htdocs/user/document.php index a917a972ddc..ac6340001c0 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -90,7 +90,7 @@ if ($id > 0 || ! empty($ref)) $object->getrights(); $entitytouseforuserdir = $object->entity; if (empty($entitytouseforuserdir)) $entitytouseforuserdir=1; - $upload_dir = $conf->user->multidir_output[$entitytouseforuserdir] . "/" . $object->id ; + $upload_dir = (empty($conf->user->multidir_output[$entitytouseforuserdir]) ? $conf->user->dir_output : $conf->user->multidir_output[$entitytouseforuserdir]) . "/" . $object->id ; } // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context From 428354303c3fbd99524958fc57d4f1f573f85572 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Aug 2018 18:27:39 +0200 Subject: [PATCH 22/26] FIX #9328 --- htdocs/user/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/document.php b/htdocs/user/document.php index ff7fe9b5ab9..26ced2091a4 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -90,7 +90,7 @@ if ($id > 0 || ! empty($ref)) $object->getrights(); $entitytouseforuserdir = $object->entity; if (empty($entitytouseforuserdir)) $entitytouseforuserdir=1; - $upload_dir = $conf->user->multidir_output[$entitytouseforuserdir] . "/" . $object->id ; + $upload_dir = (empty($conf->user->multidir_output[$entitytouseforuserdir]) ? $conf->user->dir_output : $conf->user->multidir_output[$entitytouseforuserdir]) . "/" . $object->id ; } // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context From 4e7e290624bffc182b4a6d09659fb4713edd4092 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Aug 2018 18:38:58 +0200 Subject: [PATCH 23/26] FIX #9328 --- htdocs/user/document.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/user/document.php b/htdocs/user/document.php index ac6340001c0..8425c696382 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -88,9 +88,9 @@ if ($id > 0 || ! empty($ref)) { $result = $object->fetch($id, $ref, '', 1); $object->getrights(); - $entitytouseforuserdir = $object->entity; - if (empty($entitytouseforuserdir)) $entitytouseforuserdir=1; - $upload_dir = (empty($conf->user->multidir_output[$entitytouseforuserdir]) ? $conf->user->dir_output : $conf->user->multidir_output[$entitytouseforuserdir]) . "/" . $object->id ; + //$upload_dir = $conf->user->multidir_output[$object->entity] . "/" . $object->id ; + // For users, the upload_dir is always $conf->user->entity for the moment + $upload_dir = $conf->user->dir_output. "/" . $object->id ; } // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context From 34ceec706701f855fcf278dc1e2e8143ef236c79 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Aug 2018 18:38:58 +0200 Subject: [PATCH 24/26] FIX #9328 --- htdocs/user/document.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 26ced2091a4..63e026367ab 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -88,9 +88,9 @@ if ($id > 0 || ! empty($ref)) { $result = $object->fetch($id, $ref, '', 1); $object->getrights(); - $entitytouseforuserdir = $object->entity; - if (empty($entitytouseforuserdir)) $entitytouseforuserdir=1; - $upload_dir = (empty($conf->user->multidir_output[$entitytouseforuserdir]) ? $conf->user->dir_output : $conf->user->multidir_output[$entitytouseforuserdir]) . "/" . $object->id ; + //$upload_dir = $conf->user->multidir_output[$object->entity] . "/" . $object->id ; + // For users, the upload_dir is always $conf->user->entity for the moment + $upload_dir = $conf->user->dir_output. "/" . $object->id ; } // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context From 46fe19bed5e8d59fc778929dafe8781aab6cf422 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Aug 2018 18:56:57 +0200 Subject: [PATCH 25/26] Code comment --- htdocs/viewimage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 1db05467a66..7493ef6bee9 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -136,7 +136,7 @@ if (preg_match('/\.\./',$fullpath_original_file) || preg_match('/[<>|]/',$fullpa if ($modulepart == 'barcode') { $generator=GETPOST("generator","alpha"); - $code=GETPOST("code",'none'); + $code=GETPOST("code",'none'); // This can be rich content (qrcode, datamatrix, ...) $encoding=GETPOST("encoding","alpha"); $readable=GETPOST("readable",'alpha')?GETPOST("readable","alpha"):"Y"; From d40e1a0d0b9dc88c521ad57b4d1ce94aab414bb9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Aug 2018 20:12:38 +0200 Subject: [PATCH 26/26] FIX #9258 --- htdocs/product/fournisseurs.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index b2713d65304..0d4563c10c1 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -248,14 +248,20 @@ if (empty($reshook)) if (isset($_POST['ref_fourn_price_id'])) $object->fetch_product_fournisseur_price($_POST['ref_fourn_price_id']); - if ($conf->multicurrency->enabled) { - $ret = $object->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation, array(), '', $_POST["multicurrency_price"], $_POST["multicurrency_price_base_type"], $_POST["multicurrency_tx"], $_POST["multicurrency_code"]); + $newprice = price2num(GETPOST("price","alpha")); + + if ($conf->multicurrency->enabled) + { + $multicurrency_tx = price2num(GETPOST("multicurrency_tx",'alpha')); + $multicurrency_price = price2num(GETPOST("multicurrency_price",'alpha')); + $multicurrency_code = GETPOST("multicurrency_code",'alpha'); + + $ret = $object->update_buyprice($quantity, $newprice, $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation, array(), '', $multicurrency_price, $_POST["multicurrency_price_base_type"], $multicurrency_tx, $multicurrency_code); } else { - $ret = $object->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation); + $ret = $object->update_buyprice($quantity, $newprice, $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation); } if ($ret < 0) { - $error++; setEventMessages($object->error, $object->errors, 'errors'); } @@ -565,7 +571,7 @@ if ($id > 0 || $ref) // Currency price qty min print ''.$langs->trans("PriceQtyMinCurrency").''; $pricesupplierincurrencytouse=(GETPOST('multicurrency_price')?GETPOST('multicurrency_price'):(isset($object->fourn_multicurrency_price)?$object->fourn_multicurrency_price:'')); - print ''; + print ''; print ' '; print $form->selectPriceBaseType((GETPOST('multicurrency_price_base_type')?GETPOST('multicurrency_price_base_type'):'HT'), "multicurrency_price_base_type"); // We keep 'HT' here, multicurrency_price_base_type is not yet supported for supplier prices print '';