From db5292e647f40166355854b9fe350a2542697b85 Mon Sep 17 00:00:00 2001 From: bahfir abbes Date: Thu, 15 Oct 2020 01:15:45 +0100 Subject: [PATCH 01/44] new:handle new type reference in add and update actions --- htdocs/core/actions_addupdatedelete.inc.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 219d35e46fb..6d6edc1b360 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -74,7 +74,9 @@ if ($action == 'add' && !empty($permissiontoadd)) } elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) { $value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup } elseif ($object->fields[$key]['type'] == 'boolean') { - $value = ((GETPOST($key) == '1' || GETPOST($key) == 'on') ? 1 : 0); + $value = (GETPOST($key) == '1' ? 1 : 0); + } elseif ($object->fields[$key]['type'] == 'reference') { + $value = array_keys($object->param_list)[GETPOST($key)].','.GETPOST($key.'2'); } else { $value = GETPOST($key, 'alphanohtml'); } @@ -161,7 +163,9 @@ if ($action == 'update' && !empty($permissiontoadd)) } elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) { $value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup } elseif ($object->fields[$key]['type'] == 'boolean') { - $value = ((GETPOST($key, 'aZ09') == 'on' || GETPOST($key, 'aZ09') == '1') ? 1 : 0); + $value = (GETPOST($key) == '1' ? 1 : 0); + } elseif ($object->fields[$key]['type'] == 'reference') { + $value = array_keys($object->param_list)[GETPOST($key)].','.GETPOST($key.'2'); } else { $value = GETPOST($key, 'alpha'); } From 8fd41018768c8c203edc86cb3bc4d49dd609ff51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 17 Oct 2020 20:43:34 +0200 Subject: [PATCH 02/44] Fix upload photo --- htdocs/contact/perso.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 1710b4dda6a..45fd513d1a3 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2020 Frédéric France * * 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 @@ -66,9 +66,9 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->societe->contact- if ($file_OK) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; if (GETPOST('deletephoto')) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $fileimg = $conf->societe->dir_output.'/contact/'.get_exdir($object->id, 0, 0, 1, $object, 'contact').'/photos/'.$object->photo; $dirthumbs = $conf->societe->dir_output.'/contact/'.get_exdir($object->id, 0, 0, 1, $object, 'contact').'/photos/thumbs'; dol_delete_file($fileimg); @@ -134,7 +134,7 @@ if ($action == 'edit') * Fiche en mode edition */ - print '
'; + print ''; print ''; print ''; print ''; From 1283c6e095d98497c7bfc68331b1ab98d24be416 Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Sun, 18 Oct 2020 09:29:33 +0200 Subject: [PATCH 03/44] TakePOS connector compatibility with templates --- htdocs/core/class/dolreceiptprinter.class.php | 7 ++- htdocs/takepos/admin/terminal.php | 44 ++++++++++--------- htdocs/takepos/ajax/ajax.php | 2 +- 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 6cab6580a5a..ba636ac2569 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -815,7 +815,7 @@ class dolReceiptPrinter extends Printer } } // If is DummyPrintConnector send to log to debugging - if ($this->printer->connector instanceof DummyPrintConnector) + if ($this->printer->connector instanceof DummyPrintConnector || $conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { $data = $this->printer->connector->getData(); if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") echo base64_encode($data); @@ -868,6 +868,11 @@ class dolReceiptPrinter extends Printer public function initPrinter($printerid) { global $conf; + if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector"){ + $this->connector = new DummyPrintConnector(); + $this->printer = new Printer($this->connector, $this->profile); + return; + } $error = 0; $sql = 'SELECT rowid, name, fk_type, fk_profile, parameter'; $sql .= ' FROM '.MAIN_DB_PREFIX.'printer_receipt'; diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 108fdea0b64..d87e15d9ffe 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -221,32 +221,34 @@ if (!empty($conf->stock->enabled)) } } -if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { +if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" || $conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { // Select printer to use with terminal require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php'; $printer = new dolReceiptPrinter($db); - $printer->listprinters(); - $printers = array(); - foreach ($printer->listprinters as $key => $value) { - $printers[$value['rowid']] = $value['name']; - } - print ''.$langs->trans("MainPrinterToUse").''; - print ''; - print $form->selectarray('TAKEPOS_PRINTER_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}), 1); - print ''; - if ($conf->global->TAKEPOS_ORDER_PRINTERS) { - print ''.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 1'; + if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { + $printer->listprinters(); + $printers = array(); + foreach ($printer->listprinters as $key => $value) { + $printers[$value['rowid']] = $value['name']; + } + print ''.$langs->trans("MainPrinterToUse").''; print ''; - print $form->selectarray('TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal}), 1); - print ''; - print ''.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 2'; - print ''; - print $form->selectarray('TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal}), 1); - print ''; - print ''.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 3'; - print ''; - print $form->selectarray('TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal}), 1); + print $form->selectarray('TAKEPOS_PRINTER_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}), 1); print ''; + if ($conf->global->TAKEPOS_ORDER_PRINTERS) { + print ''.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 1'; + print ''; + print $form->selectarray('TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal}), 1); + print ''; + print ''.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 2'; + print ''; + print $form->selectarray('TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal}), 1); + print ''; + print ''.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 3'; + print ''; + print $form->selectarray('TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal}), 1); + print ''; + } } $printer->listPrintersTemplates(); $templates = array(); diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index 531598668a7..1d49f985578 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -144,7 +144,7 @@ if ($action == 'getProducts') { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $printer = new dolReceiptPrinter($db); // check printer for terminal - if ($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$term} > 0 && $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$term} > 0) { + if (($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$term} > 0 || $conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") && $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$term} > 0) { $object = new Facture($db); $object->fetch($id); $ret = $printer->sendToPrinter($object, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$term}, $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$term}); From 7e8891bef986eccd3b81b7db4bf925072553625b Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 18 Oct 2020 12:40:10 +0200 Subject: [PATCH 04/44] NEW display date range if exist in takepos usefull for membership via POS (ie use in adherentsplus before pushing in core) --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index fc0fd749242..3a67c81d4ba 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1110,7 +1110,7 @@ if ($placeid > 0) $moreinfo .= '
'.$langs->transcountry("TotalLT2", $mysoc->country_code).': '.price($line->total_localtax2); $moreinfo .= '
'.$langs->transcountry("TotalTTC", $mysoc->country_code).': '.price($line->total_ttc); //$moreinfo .= $langs->trans("TotalHT").': '.$line->total_ht; - + if ($line->date_start || $line->date_end) $htmlforlines .= '
'.get_date_range($line->date_start, $line->date_end, $format).'
'; $htmlforlines .= ''; $htmlforlines .= ''.vatrate($line->remise_percent, true).''; $htmlforlines .= ''; From e1a7de32e1de44875c3078c3c6579ef9c06143c4 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 18 Oct 2020 15:36:04 +0200 Subject: [PATCH 05/44] NEW add alert before change thirdparty in takepos With some prices rules, change thirdparty should only done before add products to draft invoice. We can't block it but display an alert can be done for users --- htdocs/societe/list.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index b1cd367f258..fde106d91bb 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -610,6 +610,10 @@ if (!empty($type)) if ($type == 'f') $label = 'NewSupplier'; } +if ($contextpage = 'poslist' && ( !empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { +print get_htmloutput_mesg(img_warning('default') . ' ' . $langs->trans("BecarefullChangeThirdpartyBeforeAddProductToInvoice"), '', 'warning', 1); +} + // Show the new button only when this page is not opend from the Extended POS (pop-up window) // but allow it too, when a user has the rights to create a new customer if ($contextpage != 'poslist') From 18b71e2fa6ebaf25c2c6212411d0c6d6ca075646 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 18 Oct 2020 13:38:00 +0000 Subject: [PATCH 06/44] Fixing style errors. --- htdocs/societe/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index fde106d91bb..4007851ccb2 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -611,7 +611,7 @@ if (!empty($type)) } if ($contextpage = 'poslist' && ( !empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { -print get_htmloutput_mesg(img_warning('default') . ' ' . $langs->trans("BecarefullChangeThirdpartyBeforeAddProductToInvoice"), '', 'warning', 1); + print get_htmloutput_mesg(img_warning('default') . ' ' . $langs->trans("BecarefullChangeThirdpartyBeforeAddProductToInvoice"), '', 'warning', 1); } // Show the new button only when this page is not opend from the Extended POS (pop-up window) From 78bc3ecbfd8ccc732df8142f201251d872e832a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 19 Oct 2020 14:10:48 +0200 Subject: [PATCH 07/44] Add ref instead id in bank check remittance --- htdocs/compta/paiement/cheque/card.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index de672af203b..72c5bf3e825 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2011-2016 Juanjo Menent * Copyright (C) 2013 Philippe Grand * Copyright (C) 2015-2016 Alexandre Spangaro - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2020 Frédéric France * * 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 @@ -385,7 +385,7 @@ if ($action == 'new') $sql = "SELECT ba.rowid as bid, b.datec as datec, b.dateo as date, b.rowid as transactionid, "; $sql .= " b.amount, ba.label, b.emetteur, b.num_chq, b.banque,"; - $sql .= " p.rowid as paymentid"; + $sql .= " p.rowid as paymentid, p.ref as paymentref"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement as p ON p.fk_bank = b.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON (b.fk_account = ba.rowid)"; @@ -411,6 +411,7 @@ if ($action == 'new') $lines[$obj->bid][$i]["banque"] = $obj->banque; $lines[$obj->bid][$i]["id"] = $obj->transactionid; $lines[$obj->bid][$i]["paymentid"] = $obj->paymentid; + $lines[$obj->bid][$i]["paymentref"] = $obj->paymentref; $i++; } @@ -482,7 +483,7 @@ if ($action == 'new') // Link to payment print ''; $paymentstatic->id = $value["paymentid"]; - $paymentstatic->ref = $value["paymentid"]; + $paymentstatic->ref = $value["paymentref"]; if ($paymentstatic->id) { print $paymentstatic->getNomUrl(1); @@ -616,7 +617,7 @@ if ($action == 'new') // List of bank checks $sql = "SELECT b.rowid, b.amount, b.num_chq, b.emetteur,"; $sql .= " b.dateo as date, b.datec as datec, b.banque,"; - $sql .= " p.rowid as pid, ba.rowid as bid, p.statut"; + $sql .= " p.rowid as pid, p.ref as pref, ba.rowid as bid, p.statut"; $sql .= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON (b.fk_account = ba.rowid)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement as p ON p.fk_bank = b.rowid"; @@ -662,9 +663,8 @@ if ($action == 'new') // Link to payment print ''; $paymentstatic->id = $objp->pid; - $paymentstatic->ref = $objp->pid; - if ($paymentstatic->id) - { + $paymentstatic->ref = $objp->pref; + if ($paymentstatic->id) { print $paymentstatic->getNomUrl(1); } else { print ' '; @@ -673,8 +673,7 @@ if ($action == 'new') // Link to bank transaction print ''; $accountlinestatic->rowid = $objp->rowid; - if ($accountlinestatic->rowid) - { + if ($accountlinestatic->rowid) { print $accountlinestatic->getNomUrl(1); } else { print ' '; From 5233c6064fc50a5d1802f2e64a2e53ed99cbe6e8 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 19 Oct 2020 16:30:12 +0200 Subject: [PATCH 08/44] fix : Warning: A non-numeric value encountered in /home/httpd/vhosts/.../domains/httpdocs/core/lib/functions.lib.php on line 4379 --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 00f1f537ac2..92554e4b282 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4390,7 +4390,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', // Right print ''; - print ''; + print ''; if ($sortfield) $options .= "&sortfield=".urlencode($sortfield); if ($sortorder) $options .= "&sortorder=".urlencode($sortorder); // Show navigation bar From c0981128ff10cfc62350299605412ba8a0a960c2 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 19 Oct 2020 17:10:38 +0200 Subject: [PATCH 09/44] FIX wrong object name --- htdocs/core/boxes/box_services_contracts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index f87fbd7b282..5a1ef8df7b9 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -125,7 +125,7 @@ class box_services_contracts extends ModeleBoxes $contractlinestatic->type = $objp->type; $contractlinestatic->product_id = $objp->product_id; $contractlinestatic->product_ref = $objp->product_ref; - $contratlignestatic->product_type = $objp->product_type; + $contractlinestatic->product_type = $objp->product_type; $contractlinestatic->statut = $objp->contractline_status; From 85513318d0cfa6f6d29492a4676b07ac81b20296 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 20 Oct 2020 09:30:41 +0200 Subject: [PATCH 10/44] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 92554e4b282..54cd54dccbe 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4390,7 +4390,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', // Right print ''; - print ''; + print ''; if ($sortfield) $options .= "&sortfield=".urlencode($sortfield); if ($sortorder) $options .= "&sortorder=".urlencode($sortorder); // Show navigation bar From f377456132e272ab4f0cb734c557fd84740a7311 Mon Sep 17 00:00:00 2001 From: Louis Carrese Date: Tue, 20 Oct 2020 14:19:37 +0200 Subject: [PATCH 11/44] CLOSE #15065 Put the product label in bold in the PDF templates if configured The global configuration variable PDF_BOLD_PRODUCT_LABEL is checked to put the product label in bold in the PDF templates. This modification is based on the same behaviour for the product reference, found at line 1373 of the same file. The products table of the invoices / commercial propositions is produced in the PDF library, hence we have to modify this library to style the invoices. Producing a new template would mean duplicating code from the library with the maintenace implications. --- htdocs/core/lib/pdf.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 4156b89a2ab..ad285d4e420 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1278,8 +1278,12 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, // Description short of product line $libelleproduitservice = $label; + if (!empty($libelleproduitservice) && !empty($conf->global->PDF_BOLD_PRODUCT_LABEL)) + { + $libelleproduitservice = ''.$libelleproduitservice.''; + } - // Description long of product line + // Description long of product line if (!empty($desc) && ($desc != $label)) { if ($libelleproduitservice && empty($hidedesc)) From 693e345cab901e9b26e4d64802ed8e513a862bc4 Mon Sep 17 00:00:00 2001 From: Louis Carrese Date: Tue, 20 Oct 2020 14:34:17 +0200 Subject: [PATCH 12/44] CLOSE #15065 Fix formatting Had spaces instead of tabs... --- htdocs/core/lib/pdf.lib.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index ad285d4e420..0ff40659daa 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1278,12 +1278,11 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, // Description short of product line $libelleproduitservice = $label; - if (!empty($libelleproduitservice) && !empty($conf->global->PDF_BOLD_PRODUCT_LABEL)) - { - $libelleproduitservice = ''.$libelleproduitservice.''; - } + if (!empty($libelleproduitservice) && !empty($conf->global->PDF_BOLD_PRODUCT_LABEL)) { + $libelleproduitservice = '' . $libelleproduitservice . ''; + } - // Description long of product line + // Description long of product line if (!empty($desc) && ($desc != $label)) { if ($libelleproduitservice && empty($hidedesc)) From 134994882c893a3ad6e9e5ac702b888d3d0f9fef Mon Sep 17 00:00:00 2001 From: kamel Date: Tue, 20 Oct 2020 15:52:29 +0200 Subject: [PATCH 13/44] NEW : Calculate the virtual stock in transverse mode ( not on getEntity('commande'), ... but on getEntity('stock') ) --- htdocs/product/class/product.class.php | 10 +++++----- htdocs/product/stock/replenish.php | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 2aa9b3330e3..2427ac74714 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2627,7 +2627,7 @@ class Product extends CommonObject } $sql .= " WHERE c.rowid = cd.fk_commande"; $sql .= " AND c.fk_soc = s.rowid"; - $sql .= " AND c.entity IN (".getEntity('commande').")"; + $sql .= " AND c.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'commande').")"; $sql .= " AND cd.fk_product = ".$this->id; if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) { $sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -2727,7 +2727,7 @@ class Product extends CommonObject } $sql .= " WHERE c.rowid = cd.fk_commande"; $sql .= " AND c.fk_soc = s.rowid"; - $sql .= " AND c.entity IN (".getEntity('supplier_order').")"; + $sql .= " AND c.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'supplier_order').")"; $sql .= " AND cd.fk_product = ".$this->id; if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) { $sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -2786,7 +2786,7 @@ class Product extends CommonObject $sql .= " WHERE e.rowid = ed.fk_expedition"; $sql .= " AND c.rowid = cd.fk_commande"; $sql .= " AND e.fk_soc = s.rowid"; - $sql .= " AND e.entity IN (".getEntity('expedition').")"; + $sql .= " AND e.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'expedition').")"; $sql .= " AND ed.fk_origin_line = cd.rowid"; $sql .= " AND cd.fk_product = ".$this->id; if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) { @@ -2863,7 +2863,7 @@ class Product extends CommonObject } $sql .= " WHERE cf.rowid = fd.fk_commande"; $sql .= " AND cf.fk_soc = s.rowid"; - $sql .= " AND cf.entity IN (".getEntity('supplier_order').")"; + $sql .= " AND cf.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'supplier_order').")"; $sql .= " AND fd.fk_product = ".$this->id; if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) { $sql .= " AND cf.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } @@ -2914,7 +2914,7 @@ class Product extends CommonObject $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE m.rowid = mp.fk_mo"; - $sql .= " AND m.entity IN (".getEntity('mrp').")"; + $sql .= " AND m.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'mrp').")"; $sql .= " AND mp.fk_product = ".$this->id; if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) { $sql .= " AND m.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 2518f0ee17d..a5fd94236ad 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -366,7 +366,7 @@ if ($usevirtualstock) if (!empty($conf->commande->enabled)) { $sqlCommandesCli = "(SELECT ".$db->ifsql("SUM(cd1.qty) IS NULL", "0", "SUM(cd1.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL $sqlCommandesCli .= " FROM ".MAIN_DB_PREFIX."commandedet as cd1, ".MAIN_DB_PREFIX."commande as c1"; - $sqlCommandesCli .= " WHERE c1.rowid = cd1.fk_commande AND c1.entity IN (".getEntity('commande').")"; + $sqlCommandesCli .= " WHERE c1.rowid = cd1.fk_commande AND c1.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'commande').")"; $sqlCommandesCli .= " AND cd1.fk_product = p.rowid"; $sqlCommandesCli .= " AND c1.fk_statut IN (1,2))"; } else { @@ -379,7 +379,7 @@ if ($usevirtualstock) $sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."expeditiondet as ed2,"; $sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."commande as c2,"; $sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."commandedet as cd2"; - $sqlExpeditionsCli .= " WHERE ed2.fk_expedition = e2.rowid AND cd2.rowid = ed2.fk_origin_line AND e2.entity IN (".getEntity('expedition').")"; + $sqlExpeditionsCli .= " WHERE ed2.fk_expedition = e2.rowid AND cd2.rowid = ed2.fk_origin_line AND e2.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'expedition').")"; $sqlExpeditionsCli .= " AND cd2.fk_commande = c2.rowid"; $sqlExpeditionsCli .= " AND c2.fk_statut IN (1,2)"; $sqlExpeditionsCli .= " AND cd2.fk_product = p.rowid"; @@ -393,14 +393,14 @@ if ($usevirtualstock) $sqlCommandesFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd3,"; $sqlCommandesFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur as c3"; $sqlCommandesFourn .= " WHERE c3.rowid = cd3.fk_commande"; - $sqlCommandesFourn .= " AND c3.entity IN (".getEntity('supplier_order').")"; + $sqlCommandesFourn .= " AND c3.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'supplier_order').")"; $sqlCommandesFourn .= " AND cd3.fk_product = p.rowid"; $sqlCommandesFourn .= " AND c3.fk_statut IN (3,4))"; $sqlReceptionFourn = "(SELECT ".$db->ifsql("SUM(fd4.qty) IS NULL", "0", "SUM(fd4.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL $sqlReceptionFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf4,"; $sqlReceptionFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as fd4"; - $sqlReceptionFourn .= " WHERE fd4.fk_commande = cf4.rowid AND cf4.entity IN (".getEntity('supplier_order').")"; + $sqlReceptionFourn .= " WHERE fd4.fk_commande = cf4.rowid AND cf4.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'supplier_order').")"; $sqlReceptionFourn .= " AND fd4.fk_product = p.rowid"; $sqlReceptionFourn .= " AND cf4.fk_statut IN (3,4))"; } else { @@ -412,7 +412,7 @@ if ($usevirtualstock) $sqlProductionToConsume = "(SELECT GREATEST(0, ".$db->ifsql("SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').") IS NULL", "0", "SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').")").") as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL $sqlProductionToConsume .= " FROM ".MAIN_DB_PREFIX."mrp_mo as mm5,"; $sqlProductionToConsume .= " ".MAIN_DB_PREFIX."mrp_production as mp5"; - $sqlProductionToConsume .= " WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity('mo').")"; + $sqlProductionToConsume .= " WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'mo').")"; $sqlProductionToConsume .= " AND mp5.fk_product = p.rowid"; $sqlProductionToConsume .= " AND mp5.role IN ('toconsume', 'consummed')"; $sqlProductionToConsume .= " AND mm5.status IN (1,2))"; @@ -420,7 +420,7 @@ if ($usevirtualstock) $sqlProductionToProduce = "(SELECT GREATEST(0, ".$db->ifsql("SUM(".$db->ifsql("mp5.role = 'toproduce'", 'mp5.qty', '- mp5.qty').") IS NULL", "0", "SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').")").") as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL $sqlProductionToProduce .= " FROM ".MAIN_DB_PREFIX."mrp_mo as mm5,"; $sqlProductionToProduce .= " ".MAIN_DB_PREFIX."mrp_production as mp5"; - $sqlProductionToProduce .= " WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity('mo').")"; + $sqlProductionToProduce .= " WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'mo').")"; $sqlProductionToProduce .= " AND mp5.fk_product = p.rowid"; $sqlProductionToProduce .= " AND mp5.role IN ('toproduce', 'produced')"; $sqlProductionToProduce .= " AND mm5.status IN (1,2))"; From e51dd2919eafcddcabefe4f3132b9d0a11761204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Tue, 20 Oct 2020 17:15:03 +0200 Subject: [PATCH 14/44] Add customer country information in popup Add customer country information in popup of draft invoices. In other boxes it's ok. --- htdocs/compta/index.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 0591d75d5a3..98e6a64fd7a 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -8,6 +8,7 @@ * Copyright (C) 2016 Marcos García * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2020 Tobias Sekan + * Copyright (C) 2020 Josep Lluís Amador * * 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 @@ -143,8 +144,9 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) $sql .= ", s.nom as name"; $sql .= ", s.rowid as socid, s.email"; $sql .= ", s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur"; + $sql .= ", cc.rowid as country_id, cc.code as country_code"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; - $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE s.rowid = f.fk_soc AND f.fk_statut = ".Facture::STATUS_DRAFT; $sql .= " AND f.entity IN (".getEntity('invoice').")"; @@ -161,7 +163,8 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) $sql .= " GROUP BY f.rowid, f.ref, f.datef, f.total, f.tva, f.total_ttc, f.ref_client, f.type, "; $sql .= "s.email, s.nom, s.rowid, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur"; - + $sql .= ", cc.rowid as country_id, cc.code as country_code"; + // Add Group from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListGroupByCustomerDraft', $parameters); @@ -207,6 +210,8 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) $companystatic->id = $obj->socid; $companystatic->name = $obj->name; $companystatic->email = $obj->email; + $companystatic->country_id = $obj->country_id; + $companystatic->country_code = $obj->country_code; $companystatic->client = 1; $companystatic->code_client = $obj->code_client; $companystatic->code_fournisseur = $obj->code_fournisseur; From ff02bba5bfdd738e7ee8cbb78c7568e9b2918090 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 20 Oct 2020 15:18:29 +0000 Subject: [PATCH 15/44] Fixing style errors. --- htdocs/compta/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 98e6a64fd7a..cdf5a0e62c4 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -164,7 +164,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) $sql .= " GROUP BY f.rowid, f.ref, f.datef, f.total, f.tva, f.total_ttc, f.ref_client, f.type, "; $sql .= "s.email, s.nom, s.rowid, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur"; $sql .= ", cc.rowid as country_id, cc.code as country_code"; - + // Add Group from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListGroupByCustomerDraft', $parameters); From d347af385b11be83a3e0d4f1e8e28153bcdb8882 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 21 Oct 2020 13:47:40 +0200 Subject: [PATCH 16/44] new: add PDFInvoiceSituation translation key for PDF title --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 4 ++-- htdocs/langs/en_US/bills.lang | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 2af8fcc9bfb..a75d437ab21 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1656,7 +1656,7 @@ class pdf_crabe extends ModelePDFFactures if ($object->type == 2) $title = $outputlangs->transnoentities("InvoiceAvoir"); if ($object->type == 3) $title = $outputlangs->transnoentities("InvoiceDeposit"); if ($object->type == 4) $title = $outputlangs->transnoentities("InvoiceProForma"); - if ($this->situationinvoice) $title = $outputlangs->transnoentities("InvoiceSituation"); + if ($this->situationinvoice) $title = $outputlangs->transnoentities("PDFInvoiceSituation"); $pdf->MultiCell($w, 3, $title, '', 'R'); $pdf->SetFont('', 'B', $default_font_size); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 7e730fabbc5..61e5007e6c8 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1899,11 +1899,11 @@ class pdf_sponge extends ModelePDFFactures if ($object->type == 2) $title = $outputlangs->transnoentities("InvoiceAvoir"); if ($object->type == 3) $title = $outputlangs->transnoentities("InvoiceDeposit"); if ($object->type == 4) $title = $outputlangs->transnoentities("InvoiceProForma"); - if ($this->situationinvoice) $title = $outputlangs->transnoentities("InvoiceSituation"); + if ($this->situationinvoice) $title = $outputlangs->transnoentities("PDFInvoiceSituation"); if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) { $title .= ' - '; if ($object->type == 0) { - if ($this->situationinvoice) $title .= $outputlangsbis->transnoentities("InvoiceSituation"); + if ($this->situationinvoice) $title .= $outputlangsbis->transnoentities("PDFInvoiceSituation"); $title .= $outputlangsbis->transnoentities("PdfInvoiceTitle"); } elseif ($object->type == 1) $title .= $outputlangsbis->transnoentities("InvoiceReplacement"); elseif ($object->type == 2) $title .= $outputlangsbis->transnoentities("InvoiceAvoir"); diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 9c918bd0a15..7336f2b1e57 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -531,6 +531,7 @@ TypeContact_invoice_supplier_external_SERVICE=Vendor service contact InvoiceFirstSituationAsk=First situation invoice InvoiceFirstSituationDesc=The situation invoices are tied to situations related to a progression, for example the progression of a construction. Each situation is tied to an invoice. InvoiceSituation=Situation invoice +PDFInvoiceSituation=Situation invoice InvoiceSituationAsk=Invoice following the situation InvoiceSituationDesc=Create a new situation following an already existing one SituationAmount=Situation invoice amount(net) From 81f6a7abb67cbdd4c3631914148cf5ce521469c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Oct 2020 20:18:06 +0200 Subject: [PATCH 17/44] can add a driver for printing in module --- .../modules/printing/modules_printing.php | 15 ++++-- .../modules/printing/printgcp.modules.php | 1 + .../modules/printing/printipp.modules.php | 2 + .../core/modules/modMyModule.class.php | 2 + htdocs/printing/admin/printing.php | 47 +++++++++++++------ 5 files changed, 47 insertions(+), 20 deletions(-) diff --git a/htdocs/core/modules/printing/modules_printing.php b/htdocs/core/modules/printing/modules_printing.php index e7e16dc7979..a368a7265df 100644 --- a/htdocs/core/modules/printing/modules_printing.php +++ b/htdocs/core/modules/printing/modules_printing.php @@ -66,12 +66,17 @@ class PrintingDriver $type = 'printing'; $list = array(); - $moduledir = DOL_DOCUMENT_ROOT."/core/modules/printing/"; - $tmpfiles = dol_dir_list($moduledir, 'all', 0, '\modules.php', '', 'name', SORT_ASC, 0); - foreach ($tmpfiles as $record) { + $listoffiles = array(); + $dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']); + foreach ($dirmodels as $dir) { + $tmpfiles = dol_dir_list(dol_buildpath($dir, 0), 'all', 0, '\modules.php', '', 'name', SORT_ASC, 0); + if (!empty($tmpfiles)) { + $listoffiles = array_merge($listoffiles, $tmpfiles); + } + } + foreach ($listoffiles as $record) { $list[$record['fullname']] = str_replace('.modules.php', '', $record['name']); - } - + } return $list; } diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index e1f765110a8..387f13ee332 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -68,6 +68,7 @@ class printing_printgcp extends PrintingDriver const PRINTERS_SEARCH_URL = 'https://www.google.com/cloudprint/search'; const PRINTERS_GET_JOBS = 'https://www.google.com/cloudprint/jobs'; const PRINT_URL = 'https://www.google.com/cloudprint/submit'; + const LANGFILE = 'printgcp'; /** * Constructor diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index 6b0e528aa1e..bf9f2fbd61b 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -60,6 +60,8 @@ class printing_printipp extends PrintingDriver */ public $db; + const LANGFILE = 'printipp'; + /** * Constructor diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 46943c6c9ab..8922bc00eb5 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -90,6 +90,8 @@ class modMyModule extends DolibarrModules 'barcode' => 0, // Set this to 1 if module has its own models directory (core/modules/xxx) 'models' => 0, + // Set this to 1 if module has its own printing directory (core/modules/printing) + 'printing' => 0, // Set this to 1 if module has its own theme directory (theme) 'theme' => 0, // Set this to relative path of css file if module has its own css file diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php index 2f906c68382..b810be417ae 100644 --- a/htdocs/printing/admin/printing.php +++ b/htdocs/printing/admin/printing.php @@ -69,8 +69,7 @@ if ($action == 'setconst' && $user->admin) if (!$result > 0) $error++; } - if (!$error) - { + if (!$error) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null); } else { @@ -87,8 +86,7 @@ if ($action == 'setvalue' && $user->admin) $result = dolibarr_set_const($db, $varname, $value, 'chaine', 0, '', $conf->entity); if (!$result > 0) $error++; - if (!$error) - { + if (!$error) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null); } else { @@ -131,10 +129,17 @@ if ($mode == 'setup' && $user->admin) $submit_enabled = 0; if (!empty($driver)) { - require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php'; + $dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']); + foreach ($dirmodels as $dir) { + if (file_exists(dol_buildpath($dir, 0).$driver.'.modules.php')) { + $classfile = dol_buildpath($dir, 0).$driver.'.modules.php'; + break; + } + } + require_once $classfile; $classname = 'printing_'.$driver; - $langs->load($driver); $printer = new $classname($db); + $langs->load($printer::LANGFILE); $i = 0; $submit_enabled = 0; @@ -246,22 +251,27 @@ if ($mode == 'config' && $user->admin) $object = new PrintingDriver($db); $result = $object->listDrivers($db, 10); + $dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']); foreach ($result as $driver) { - require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php'; + foreach ($dirmodels as $dir) { + if (file_exists(dol_buildpath($dir, 0).$driver.'.modules.php')) { + $classfile = dol_buildpath($dir, 0).$driver.'.modules.php'; + break; + } + } + require_once $classfile; $classname = 'printing_'.$driver; - $langs->load($driver); $printer = new $classname($db); + $langs->load($printer::LANGFILE); //print '
'.print_r($printer, true).'
'; print ''; print ''.img_picto('', $printer->picto).' '.$langs->trans($printer->desc).''; print ''; - if (!empty($conf->use_javascript_ajax)) - { + if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff($printer->active); } else { - if (empty($conf->global->{$printer->conf})) - { + if (empty($conf->global->{$printer->conf})) { print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { print ''.img_picto($langs->trans("Enabled"), 'on').''; @@ -284,12 +294,19 @@ if ($mode == 'test' && $user->admin) print $langs->trans('PrintTestDesc'.$driver)."

\n"; print ''; - if (!empty($driver)) - { - require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php'; + if (!empty($driver)) { + $dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']); + foreach ($dirmodels as $dir) { + if (file_exists(dol_buildpath($dir, 0).$driver.'.modules.php')) { + $classfile = dol_buildpath($dir, 0).$driver.'.modules.php'; + break; + } + } + require_once $classfile; $classname = 'printing_'.$driver; $langs->load($driver); $printer = new $classname($db); + $langs->load($printer::LANGFILE); //print '
'.print_r($printer, true).'
'; if (count($printer->getlistAvailablePrinters())) { if ($printer->listAvailablePrinters() == 0) { From 06325f94226fb235969c415ab43a8d2366f970d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Oct 2020 21:00:50 +0200 Subject: [PATCH 18/44] doxygen --- .../modules/printing/printipp.modules.php | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index bf9f2fbd61b..873382ceae2 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -30,19 +30,54 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/printing/modules_printing.php'; */ class printing_printipp extends PrintingDriver { + /** + * @var string module name + */ public $name = 'printipp'; + + /** + * @var string module description + */ public $desc = 'PrintIPPDesc'; /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ public $picto = 'printer'; + + /** + * @var string Constant name + */ public $active = 'PRINTING_PRINTIPP'; + + /** + * @var array array of setup value + */ public $conf = array(); + + /** + * @var string host + */ public $host; + + /** + * @var string port + */ public $port; - public $userid; /* user login */ + + /** + * @var string username + */ + public $userid; + + /** + * @var string login for printer host + */ public $user; + + /** + * @var string password for printer host + */ public $password; /** @@ -115,7 +150,7 @@ class printing_printipp extends PrintingDriver $obj = $this->db->fetch_object($result); if ($obj) { - dol_syslog("Found a default printer for user ".$user->id." = ".$obj->printer_id); + dol_syslog("Found a default printer for user ".$user->id." = ".$obj->printer_id); $ipp->setPrinterURI($obj->printer_id); } else { if (!empty($conf->global->PRINTIPP_URI_DEFAULT)) From 4873794dc0223493b36b446d71cccdc2d3b763b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Oct 2020 21:08:33 +0200 Subject: [PATCH 19/44] doxygen --- .../modules/printing/printgcp.modules.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index 387f13ee332..154fd025ded 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -35,16 +35,39 @@ use OAuth\OAuth2\Service\Google; */ class printing_printgcp extends PrintingDriver { + /** + * @var string module name + */ public $name = 'printgcp'; + + /** + * @var string module description + */ public $desc = 'PrintGCPDesc'; /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ public $picto = 'printer'; + + /** + * @var string module description + */ public $active = 'PRINTING_PRINTGCP'; + + /** + * @var array module parameters + */ public $conf = array(); + + /** + * @var string google id + */ public $google_id = ''; + + /** + * @var string google secret + */ public $google_secret = ''; /** From f500076247ab37a5b7884aedfb7df8fa18aaab79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Oct 2020 21:21:30 +0200 Subject: [PATCH 20/44] remove warning --- htdocs/core/modules/printing/printgcp.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index 154fd025ded..096c633036a 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -304,7 +304,7 @@ class printing_printgcp extends PrintingDriver $responsedata = json_decode($response, true); $printers = $responsedata['printers']; // Check if we have printers? - if (count($printers) == 0) { + if (is_array($printers) && count($printers) == 0) { // We dont have printers so return blank array $ret['available'] = array(); } else { From f54164bd10015fdfb5ed25697a3461f463e84748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Oct 2020 21:33:23 +0200 Subject: [PATCH 21/44] modify action --- htdocs/core/actions_printing.inc.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/core/actions_printing.inc.php b/htdocs/core/actions_printing.inc.php index e88fc937e38..3137c93a9c5 100644 --- a/htdocs/core/actions_printing.inc.php +++ b/htdocs/core/actions_printing.inc.php @@ -33,18 +33,24 @@ if ($action == 'print_file' && $user->rights->printing->read) { require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/modules_printing.php'; $objectprint = new PrintingDriver($db); $list = $objectprint->listDrivers($db, 10); + $dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']); if (!empty($list)) { $errorprint = 0; $printerfound = 0; foreach ($list as $driver) { - require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php'; - $langs->load($driver); + foreach ($dirmodels as $dir) { + if (file_exists(dol_buildpath($dir, 0).$driver.'.modules.php')) { + $classfile = dol_buildpath($dir, 0).$driver.'.modules.php'; + break; + } + } + require_once $classfile; $classname = 'printing_'.$driver; $printer = new $classname($db); + $langs->load($printer::LANGFILE); //print '
'.print_r($printer, true).'
'; - if (!empty($conf->global->{$printer->active})) - { + if (!empty($conf->global->{$printer->active})) { $printerfound++; $subdir = ''; From b8cb080f0d5d46a5ba5d74f22cddd741e3197e25 Mon Sep 17 00:00:00 2001 From: Pierre Penelon Date: Thu, 22 Oct 2020 09:26:46 +0200 Subject: [PATCH 22/44] ADD Retrieve discount from invoice from API As I was unable to retrieve discount ID of created discount from invoice with API. This commit add a route to get discount from a specific invoice ID. --- .../facture/class/api_invoices.class.php | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 0ab4974ce7f..07c8a1569c0 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -981,6 +981,45 @@ class Invoices extends DolibarrApi return $this->_cleanObjectDatas($this->invoice); } + /** + * Get discount from invoice + * + * @param int $id Id of invoice + * + * @url GET {id}/discount + * + * @return mixed + */ + public function getDiscount($id) + { + require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; + + if (!DolibarrApiAccess::$user->rights->facture->lire) { + throw new RestException(401); + } + + $result = $this->invoice->fetch($id); + if (!$result) { + throw new RestException(404, 'Invoice not found'); + } + + if (!DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + $discountcheck = new DiscountAbsolute($this->db); + $result = $discountcheck->fetch(0, $this->invoice->id); + + if($result == 0){ + throw new RestException(404, 'Discount not found'); + } + else if($result < 0){ + throw new RestException(500, $discountcheck->error); + } + + return parent::_cleanObjectDatas($discountcheck); + } + /** * Create a discount (credit available) for a credit note or a deposit. * From 1d218b3260cf63da119eabf7f70689324d650752 Mon Sep 17 00:00:00 2001 From: Pierre Penelon Date: Thu, 22 Oct 2020 09:56:13 +0200 Subject: [PATCH 23/44] Linting api_invoices.class.php --- htdocs/compta/facture/class/api_invoices.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 07c8a1569c0..85ad01ab7a6 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -1006,14 +1006,14 @@ class Invoices extends DolibarrApi if (!DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $discountcheck = new DiscountAbsolute($this->db); $result = $discountcheck->fetch(0, $this->invoice->id); - if($result == 0){ + if ($result == 0){ throw new RestException(404, 'Discount not found'); } - else if($result < 0){ + if ($result < 0){ throw new RestException(500, $discountcheck->error); } From b13ef348043494cba65d587e634d1f9af48094b0 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Thu, 22 Oct 2020 14:56:53 +0200 Subject: [PATCH 24/44] NEW add rights on margin info on invoice list --- htdocs/compta/facture/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 4f795274ad2..ba902c4b773 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -206,10 +206,10 @@ $arrayfields = array( 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>200), 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>210), 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>220), // Not enabled by default because slow - 'total_pa' => array('label' => ($conf->global->MARGIN_TYPE == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled)?0:1)), - 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled)?0:1)), - 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || empty($conf->global->DISPLAY_MARGIN_RATES)?0:1)), - 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || empty($conf->global->DISPLAY_MARK_RATES)?0:1)), + 'total_pa' => array('label' => ($conf->global->MARGIN_TYPE == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous?0:1)), + 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous?0:1)), + 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES)?0:1)), + 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES)?0:1)), 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))), From 1221cc854d8208b3689e9fd80815bf5d71622479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Thu, 22 Oct 2020 15:23:45 +0200 Subject: [PATCH 25/44] FIX input name in MRP mask const input name in MRP mask const was wrong --- htdocs/core/modules/mrp/mod_mo_advanced.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/mrp/mod_mo_advanced.php b/htdocs/core/modules/mrp/mod_mo_advanced.php index 186caca619a..6f8dfe92073 100644 --- a/htdocs/core/modules/mrp/mod_mo_advanced.php +++ b/htdocs/core/modules/mrp/mod_mo_advanced.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2019 Frédéric France + * Copyright (C) 2020 Josep Lluís Amador * * 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 @@ -68,7 +69,7 @@ class mod_mo_advanced extends ModeleNumRefMos $texte .= ''; $texte .= ''; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
'; $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Mo"), $langs->transnoentities("Mo")); From 12a599d1c76e26cb5cd762a54cbdb973427db899 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 22 Oct 2020 15:53:55 +0200 Subject: [PATCH 26/44] Allow "demand reason" field update though API --- htdocs/comm/propal/class/propal.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index a09844da014..78c5a263ce1 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1634,6 +1634,7 @@ class Propal extends CommonObject $sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").","; $sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").","; $sql .= " fk_mode_reglement=".(isset($this->mode_reglement_id) ? $this->mode_reglement_id : "null").","; + $sql .= " fk_input_reason=".(isset($this->demand_reason_id) ? $this->demand_reason_id : "null").","; $sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").","; $sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").","; $sql .= " model_pdf=".(isset($this->modelpdf) ? "'".$this->db->escape($this->modelpdf)."'" : "null").","; From b88a9fc94d4161c253cf5ab2423f2edddc7152f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Oct 2020 16:15:11 +0200 Subject: [PATCH 27/44] Update actions_addupdatedelete.inc.php --- htdocs/core/actions_addupdatedelete.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 6d6edc1b360..4671c20301e 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -76,7 +76,8 @@ if ($action == 'add' && !empty($permissiontoadd)) } elseif ($object->fields[$key]['type'] == 'boolean') { $value = (GETPOST($key) == '1' ? 1 : 0); } elseif ($object->fields[$key]['type'] == 'reference') { - $value = array_keys($object->param_list)[GETPOST($key)].','.GETPOST($key.'2'); + $tmparraykey = array_keys($object->param_list); + $value = $tmparraykey[GETPOST($key)].','.GETPOST($key.'2'); } else { $value = GETPOST($key, 'alphanohtml'); } From 0c3f8d2daaeb4de44c264442b5ae89d815c03baf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Oct 2020 16:16:14 +0200 Subject: [PATCH 28/44] Update actions_addupdatedelete.inc.php --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 4671c20301e..548fcb21b79 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -74,7 +74,7 @@ if ($action == 'add' && !empty($permissiontoadd)) } elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) { $value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup } elseif ($object->fields[$key]['type'] == 'boolean') { - $value = (GETPOST($key) == '1' ? 1 : 0); + $value = ((GETPOST($key) == '1' || GETPOST($key) == 'on') ? 1 : 0); } elseif ($object->fields[$key]['type'] == 'reference') { $tmparraykey = array_keys($object->param_list); $value = $tmparraykey[GETPOST($key)].','.GETPOST($key.'2'); From 81bfbbac2667b37972af32d0e58a0440e2124881 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Oct 2020 16:16:37 +0200 Subject: [PATCH 29/44] Update actions_addupdatedelete.inc.php --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 548fcb21b79..45f0fb8613e 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -164,7 +164,7 @@ if ($action == 'update' && !empty($permissiontoadd)) } elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) { $value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup } elseif ($object->fields[$key]['type'] == 'boolean') { - $value = (GETPOST($key) == '1' ? 1 : 0); + $value = ((GETPOST($key, 'aZ09') == 'on' || GETPOST($key, 'aZ09') == '1') ? 1 : 0); } elseif ($object->fields[$key]['type'] == 'reference') { $value = array_keys($object->param_list)[GETPOST($key)].','.GETPOST($key.'2'); } else { From fae572d43aba8146dfee295fbdb752db0b8739c7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 22 Oct 2020 16:29:17 +0200 Subject: [PATCH 30/44] fix : deprecated --- htdocs/compta/facture/note.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 249d2dd9b8c..76c6833c07b 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -81,7 +81,7 @@ if ($id > 0 || !empty($ref)) $totalpaye = $object->getSommePaiement(); - dol_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), -1, 'bill'); + print dol_get_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), -1, 'bill'); // Invoice content From 1ca6068a4142048d175b5590ecb86be65cf6fec7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 22 Oct 2020 16:34:12 +0200 Subject: [PATCH 31/44] fix : deprecated --- htdocs/accountancy/admin/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 29ed90bb7be..25f72918f6f 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -210,7 +210,7 @@ if ($action == 'create') { print ''; print ''; - dol_fiche_head(); + print dol_get_fiche_head(); print '
'; @@ -327,7 +327,7 @@ if ($action == 'create') { // View mode $linkback = ''.$langs->trans("BackToList").''; - dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), -1, 'billr'); + print dol_get_fiche_head($head, 'card', $langs->trans('AccountAccounting'), -1, 'billr'); dol_banner_tab($object, 'ref', $linkback, 1, 'account_number', 'ref'); From 1319765a4fd2ee95711d952f79b6966b70d59870 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 22 Oct 2020 16:35:47 +0200 Subject: [PATCH 32/44] fix : deprecated --- htdocs/accountancy/admin/categories.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index f68fbc18905..db17be68e1e 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -102,7 +102,7 @@ print ''."\n"; print ''; print ''; -dol_fiche_head(); +print dol_get_fiche_head(); print '
'; From 9260eed12a4c4ee9673cac3810abe626f1a044d7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 22 Oct 2020 16:37:06 +0200 Subject: [PATCH 33/44] fix : deprecated --- htdocs/accountancy/admin/fiscalyear_card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index a4227a761a4..97b92bdd172 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -159,7 +159,7 @@ if ($action == 'create') print ''; print ''; - dol_fiche_head(); + print dol_get_fiche_head(); print '
'; @@ -202,7 +202,7 @@ if ($action == 'create') $head = fiscalyear_prepare_head($object); if ($action == 'edit') { - dol_fiche_head($head, 'card', $langs->trans("Fiscalyear"), 0, 'cron'); + print dol_get_fiche_head($head, 'card', $langs->trans("Fiscalyear"), 0, 'cron'); print ''."\n"; print ''; @@ -257,7 +257,7 @@ if ($action == 'create') print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("DeleteFiscalYear"), $langs->trans("ConfirmDeleteFiscalYear"), "confirm_delete"); } - dol_fiche_head($head, 'card', $langs->trans("Fiscalyear"), 0, 'cron'); + print dol_get_fiche_head($head, 'card', $langs->trans("Fiscalyear"), 0, 'cron'); print '
'; From 52b602b1ce1e22dfeeb41b0e700af5fc19d709fa Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 22 Oct 2020 16:38:02 +0200 Subject: [PATCH 34/44] fix : deprecated --- htdocs/accountancy/bookkeeping/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 8ca880de25f..6a9fdcbffff 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -351,7 +351,7 @@ if ($action == 'create') print ''."\n"; print ''."\n"; - dol_fiche_head(); + print dol_get_fiche_head(); print '
'; @@ -415,7 +415,7 @@ if ($action == 'create') $head[$h][2] = 'transaction'; $h++; - dol_fiche_head($head, 'transaction', '', -1); + print dol_get_fiche_head($head, 'transaction', '', -1); //dol_banner_tab($object, '', $backlink); From 9dc93b0e2964bc4e3b9f60fcb1d63dc88f203b0a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 22 Oct 2020 16:38:43 +0200 Subject: [PATCH 35/44] fix : deprecated --- htdocs/accountancy/admin/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 25f72918f6f..fdbb86d1a62 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -272,7 +272,7 @@ if ($action == 'create') { // Edit mode if ($action == 'update') { - dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr'); + print dol_get_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr'); print ''."\n"; print ''; From 3854808d21c6098981f529894c44a37375065899 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 22 Oct 2020 16:39:21 +0200 Subject: [PATCH 36/44] fix : deprecated --- htdocs/accountancy/admin/fiscalyear_info.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/fiscalyear_info.php b/htdocs/accountancy/admin/fiscalyear_info.php index f293c9b450b..2971e2eb114 100644 --- a/htdocs/accountancy/admin/fiscalyear_info.php +++ b/htdocs/accountancy/admin/fiscalyear_info.php @@ -49,7 +49,7 @@ if ($id) { $head = fiscalyear_prepare_head($object); - dol_fiche_head($head, 'info', $langs->trans("Fiscalyear"), 0, 'cron'); + print dol_get_fiche_head($head, 'info', $langs->trans("Fiscalyear"), 0, 'cron'); print '
'; dol_print_object_info($object); From d5e456fd364473862d7484f2a53da80475182dfa Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 22 Oct 2020 16:40:03 +0200 Subject: [PATCH 37/44] fix : deprecated --- .../accountancy/bookkeeping/thirdparty_lettering_customer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 321ef282dff..9e21a712e7e 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -135,7 +135,7 @@ $head = societe_prepare_head($object); dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error'); -dol_fiche_head($head, 'lettering_customer', $langs->trans("ThirdParty"), 0, 'company'); +print dol_get_fiche_head($head, 'lettering_customer', $langs->trans("ThirdParty"), 0, 'company'); $linkback = ''.$langs->trans("BackToList").''; From a8b25e32f0f404e5e6197cc64e349580107739c4 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 22 Oct 2020 16:40:58 +0200 Subject: [PATCH 38/44] fix : deprecated --- .../accountancy/bookkeeping/thirdparty_lettering_supplier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index 144c2595d25..a0f930e50d7 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -134,7 +134,7 @@ $head = societe_prepare_head($object); dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error'); -dol_fiche_head($head, 'lettering_supplier', $langs->trans("ThirdParty"), 0, 'company'); +print dol_get_fiche_head($head, 'lettering_supplier', $langs->trans("ThirdParty"), 0, 'company'); $linkback = ''.$langs->trans("BackToList").''; From 3ee7cfc1b78abbf9cd64034d17f7e98165e4b7ba Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 22 Oct 2020 16:42:32 +0200 Subject: [PATCH 39/44] fix : deprecated --- htdocs/accountancy/customer/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index ed8f347a177..4343946a85e 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -119,7 +119,7 @@ if (!empty($id)) { print load_fiche_titre($langs->trans('CustomersVentilation'), '', 'title_accountancy'); - dol_fiche_head(); + print dol_get_fiche_head(); print ''; From 0fc054a624e0eeea1638b9ef8fedc7eb11474846 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 22 Oct 2020 16:43:02 +0200 Subject: [PATCH 40/44] fix : deprecated --- htdocs/accountancy/expensereport/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/expensereport/card.php b/htdocs/accountancy/expensereport/card.php index ab02592f6b8..153717d05e4 100644 --- a/htdocs/accountancy/expensereport/card.php +++ b/htdocs/accountancy/expensereport/card.php @@ -121,7 +121,7 @@ if (!empty($id)) { print load_fiche_titre($langs->trans('ExpenseReportsVentilation'), '', 'title_accountancy'); - dol_fiche_head(); + print dol_get_fiche_head(); print '
'; From e0639209a71c6010d5b3d761c0486b92aefb7dae Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 22 Oct 2020 16:43:35 +0200 Subject: [PATCH 41/44] fix : deprecated --- htdocs/accountancy/supplier/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index 4a4747cfaf4..bee34f291f5 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -121,7 +121,7 @@ if (!empty($id)) { print load_fiche_titre($langs->trans('SuppliersVentilation'), '', 'title_accountancy'); - dol_fiche_head(); + print dol_get_fiche_head(); print '
'; From 74fc38395ce74de9a200758df0f0909f27553f20 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 22 Oct 2020 16:44:26 +0200 Subject: [PATCH 42/44] fix : deprecated --- htdocs/adherents/agenda.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index a7e7a6f3634..c0b5998f035 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -118,7 +118,7 @@ if ($object->id > 0) { if (!empty($conf->notification->enabled)) $langs->load("mails"); $head = member_prepare_head($object); - dol_fiche_head($head, 'agenda', $langs->trans("Member"), -1, 'user'); + print dol_get_fiche_head($head, 'agenda', $langs->trans("Member"), -1, 'user'); $linkback = ''.$langs->trans("BackToList").''; From dc0d9e46b858a0274249894e688597aede094f70 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 22 Oct 2020 16:46:45 +0200 Subject: [PATCH 43/44] fix : deprecated --- htdocs/adherents/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index cd432aa12d6..128b915ef0f 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2012 Marcos García - * Copyright (C) 2012-2018 Philippe Grand + * Copyright (C) 2012-2020 Philippe Grand * Copyright (C) 2015-2018 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * @@ -833,7 +833,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; if ($backtopage) print ''; - dol_fiche_head(''); + print dol_get_fiche_head(''); print '
'; print ''; @@ -1058,7 +1058,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; if ($backtopage) print ''; - dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user'); + print dol_get_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user'); print '
'; @@ -1268,7 +1268,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { */ $head = member_prepare_head($object); - dol_fiche_head($head, 'general', $langs->trans("Member"), -1, 'user'); + print dol_get_fiche_head($head, 'general', $langs->trans("Member"), -1, 'user'); // Confirm create user if ($action == 'create_user') { From a2b3dbd8f886975cccb9e5696febc9122a26c627 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 22 Oct 2020 16:47:35 +0200 Subject: [PATCH 44/44] fix : deprecated --- htdocs/adherents/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 32630b9e478..0f6e6250796 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -100,7 +100,7 @@ if ($id > 0) { $head = member_prepare_head($object); - dol_fiche_head($head, 'document', $langs->trans("Member"), -1, 'user'); + print dol_get_fiche_head($head, 'document', $langs->trans("Member"), -1, 'user'); $linkback = ''.$langs->trans("BackToList").'';