From 92b89437d1e334ebdc0475b4394e099dc34f669a Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 9 Jun 2020 16:02:41 +0200 Subject: [PATCH 01/18] FIX : percent must be displayed on one line --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index ed99a04fcc2..d3ffe96d4f5 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -593,7 +593,7 @@ class pdf_crabe extends ModelePDFFactures { $progress = pdf_getlineprogress($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxprogress, $curY); - $pdf->MultiCell($this->postotalht-$this->posxprogress-1, 3, $progress, 0, 'R'); + $pdf->MultiCell($this->postotalht-$this->posxprogress+1, 3, $progress, 0, 'R'); } // Total HT line From e82d71c949cc022db888cd263508955f09494d5e Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 18 Jun 2020 19:42:23 +0200 Subject: [PATCH 02/18] fix: same feature on invoice as on orders --- htdocs/compta/facture/card.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 67d9f523f05..eccbea76aa9 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3540,6 +3540,15 @@ if ($action == 'create') $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { + if (!empty($conf->global->THIRDPARTY_PROPAGATE_EXTRAFIELDS_TO_INVOICE)) { + // copy from thirdparty + $tpExtrafields = new Extrafields($db); + $tpExtrafieldLabels = $tpExtrafields->fetch_name_optionals_label($soc->table_element); + if ($soc->fetch_optionals() > 0) { + $object->array_options = array_merge($object->array_options, $soc->array_options); + } + }; + print $object->showOptionals($extrafields, 'edit', $parameters); } From a705cc41ae9d6ae32019c3de0164d920ac02a8e4 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 18 Jun 2020 19:44:24 +0200 Subject: [PATCH 03/18] fix: same feature on invoice as on orders --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index eccbea76aa9..b5a8d723876 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3536,7 +3536,7 @@ if ($action == 'create') } // Other attributes - $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="2"', 'cols' => '2'); + $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="2"', 'cols' => '2', 'socid'=>$socid); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { From 7fef9a813e5d9a0403b3de310df1e75b324e73b4 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 18 Jun 2020 20:03:03 +0200 Subject: [PATCH 04/18] fix warning and clean old code about multiselect category --- .../html.formadvtargetemailing.class.php | 68 -------- htdocs/core/tpl/advtarget.tpl.php | 148 ++++++++++-------- 2 files changed, 79 insertions(+), 137 deletions(-) diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php index b9782515735..06962600edf 100644 --- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php +++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php @@ -341,74 +341,6 @@ class FormAdvTargetEmailing extends Form return $return; } - /** - * Return combo list with customer categories - * - * @param string $htmlname Name of categorie - * @param array $selected_array value selected - * @return string HTML combo - */ - public function multiselectCustomerCategories($htmlname = 'cust_cat', $selected_array = array()) - { - return $this->multiselectCategories($htmlname, $selected_array, 2); - } - - /** - * Return combo list with customer contact - * - * @param string $htmlname Name of categorie - * @param array $selected_array value selected - * @return string HTML combo - */ - public function multiselectContactCategories($htmlname = 'contact_cat', $selected_array = array()) - { - return $this->multiselectCategories($htmlname, $selected_array, 4); - } - - /** - * Return combo list of categories - * - * @param string $htmlname Name of categorie - * @param array $selected_array Value selected - * @param int $type Type - * @return string HTML combo - */ - public function multiselectCategories($htmlname = '', $selected_array = array(), $type = 0) - { - global $conf, $langs, $user; - $langs->load("dict"); - - $options_array = array(); - - $sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."categorie"; - $sql .= " WHERE type=".$type; - - dol_syslog(__METHOD__, LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i = 0; - if ($num) - { - while ($i < $num) - { - $obj = $this->db->fetch_object($resql); - - $options_array[$obj->rowid] = $obj->label; - - $i++; - } - } - } - else - { - dol_print_error($this->db); - } - - return $this->advMultiselectarray($htmlname, $options_array, $selected_array); - } - /** * Return a combo list to select emailing target selector * diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index 23727e4ad97..245cd4f7f00 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -15,6 +15,10 @@ * along with this program. If not, see . */ +if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +} + print '