From cebd3f831cc54d3bb0d8c2da0623ad2d6ac8b04f Mon Sep 17 00:00:00 2001 From: Rikard Bosnjakovic Date: Fri, 20 Oct 2023 12:51:05 +0200 Subject: [PATCH 1/4] Update list.php (#26287) * Update list.php Add the Description column in the list of possible columns to select from when vieweing Products. * Update list.php Spaces -> tabs --- htdocs/product/list.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 2ecbc0ecd03..e10d02e3a3a 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -224,6 +224,7 @@ $arrayfields = array( 'p.ref'=>array('label'=>'ProductRef', 'checked'=>1, 'position'=>10), //'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(isModEnabled('barcode'))), 'thumbnail'=>array('label'=>'Photo', 'checked'=>0, 'position'=>10), + 'p.description'=>array('label'=>'Description', 'checked'=>0, 'position'=>10), 'p.label'=>array('label'=>"Label", 'checked'=>1, 'position'=>10), 'p.fk_product_type'=>array('label'=>"Type", 'checked'=>0, 'enabled'=>(isModEnabled("product") && isModEnabled("service")), 'position'=>11), 'p.barcode'=>array('label'=>"Gencod", 'checked'=>1, 'enabled'=>(isModEnabled('barcode')), 'position'=>12), @@ -992,6 +993,11 @@ if (!empty($arrayfields['p.fk_product_type']['checked'])) { print $form->selectarray('search_type', $array, $search_type); print ''; } +// Description +if (!empty($arrayfields['p.description']['checked'])) { + print ''; + print ''; +} // Barcode if (!empty($arrayfields['p.barcode']['checked'])) { print ''; @@ -1718,7 +1724,17 @@ while ($i < $imaxinloop) { $totalarray['nbfield']++; } } - + // Description + if (!empty($arrayfields['p.description']['checked'])) { + print ''; + // Since description can be very large (several pages of HTML- + // code) we limit to the first two rows + print dolGetFirstLineofText($product_static->description, 2); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } // Weight if (!empty($arrayfields['p.weight']['checked'])) { print ''; From bc528fed6746f97e9d36d6442f5145a9c7587521 Mon Sep 17 00:00:00 2001 From: AmazingBeu Date: Fri, 20 Oct 2023 12:52:36 +0200 Subject: [PATCH 2/4] fix SQL syntax error introduced in 9861b50 (#26289) --- htdocs/core/class/discount.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index dd5c4451b60..8f7f126f4ac 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -373,7 +373,7 @@ class DiscountAbsolute if ($this->fk_facture_source) { $sql = "UPDATE ".$this->db->prefix()."facture"; $sql .= " set paye=0, fk_statut=1"; - $sql .= " WHERE (type IN (".$this->db->sanitize(CommonInvoice::TYPE_CREDIT_NOTE.", ".CommonInvoice::TYPE_DEPOSIT).") AND rowid = ".((int) $this->fk_facture_source); + $sql .= " WHERE type IN (".$this->db->sanitize(CommonInvoice::TYPE_CREDIT_NOTE.", ".CommonInvoice::TYPE_DEPOSIT).") AND rowid = ".((int) $this->fk_facture_source); dol_syslog(get_class($this)."::delete Update credit note or deposit invoice statut", LOG_DEBUG); $result = $this->db->query($sql); @@ -388,7 +388,7 @@ class DiscountAbsolute } elseif ($this->fk_invoice_supplier_source) { $sql = "UPDATE ".$this->db->prefix()."facture_fourn"; $sql .= " set paye=0, fk_statut=1"; - $sql .= " WHERE (type IN (".$this->db->sanitize(CommonInvoice::TYPE_CREDIT_NOTE.", ".CommonInvoice::TYPE_DEPOSIT).") AND rowid = ".((int) $this->fk_invoice_supplier_source); + $sql .= " WHERE type IN (".$this->db->sanitize(CommonInvoice::TYPE_CREDIT_NOTE.", ".CommonInvoice::TYPE_DEPOSIT).") AND rowid = ".((int) $this->fk_invoice_supplier_source); dol_syslog(get_class($this)."::delete Update credit note or deposit invoice statut", LOG_DEBUG); $result = $this->db->query($sql); From 0628dd057d6d67372c37bd47e8677b24d15914b4 Mon Sep 17 00:00:00 2001 From: Pascal Hubrecht Date: Fri, 20 Oct 2023 12:53:03 +0200 Subject: [PATCH 3/4] FIX #26291 (#26292) --- htdocs/fourn/class/paiementfourn.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 4ee3a747bd7..fb36ef6bb9d 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -910,7 +910,7 @@ class PaiementFourn extends Paiement if (!empty($billsarray)) { $supplier_invoice = new FactureFournisseur($this->db); if ($supplier_invoice->fetch($billsarray[0]) > 0) { - $force_thirdparty_id = $supplier_invoice->fk_soc; + $force_thirdparty_id = $supplier_invoice->socid; } } } From b0a7332e8fc10a53db23244ce8947f949d52e8d1 Mon Sep 17 00:00:00 2001 From: William Mead Date: Fri, 20 Oct 2023 12:59:48 +0200 Subject: [PATCH 4/4] FIX intervention closed agenda action message (#26294) Co-authored-by: William Mead --- ...terface_50_modAgenda_ActionsAuto.class.php | 19 +++++++++++++++++++ htdocs/langs/en_US/interventions.lang | 1 + 2 files changed, 20 insertions(+) diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 67e3faf9675..790bd8eaffe 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -6,6 +6,7 @@ * Copyright (C) 2014 Marcos GarcĂ­a * Copyright (C) 2015 Bahfir Abbes * Copyright (C) 2022 Ferran Marcet + * Copyright (C) 2023 William Mead * * 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 @@ -584,6 +585,24 @@ class InterfaceActionsAuto extends DolibarrTriggers } $object->sendtoid = 0; + } elseif ($action == 'FICHINTER_CLOSE') { + // Load translation files required by the page + $langs->loadLangs(array("agenda", "other", "interventions")); + + if (empty($object->actionmsg2)) { + if (empty($object->context['actionmsg2'])) { + $object->actionmsg2 = $langs->transnoentities("InterventionClosedInDolibarr", $object->ref); + } else { + $object->actionmsg2 = $object->context['actionmsg2']; + } + } + if (empty($object->actionmsg)) { + $object->actionmsg = $langs->transnoentities("InterventionClosedInDolibarr", $object->ref); + } + + $object->sendtoid = 0; + $object->fk_element = 0; + $object->elementtype = ''; } elseif ($action == 'FICHINTER_DELETE') { // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "interventions")); diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 96948586bb2..ecaf9e21020 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -38,6 +38,7 @@ InterventionModifiedInDolibarr=Intervention %s modified InterventionClassifiedBilledInDolibarr=Intervention %s set as billed InterventionClassifiedUnbilledInDolibarr=Intervention %s set as unbilled InterventionSentByEMail=Intervention %s sent by email +InterventionClosedInDolibarr= Intervention %s closed InterventionDeletedInDolibarr=Intervention %s deleted InterventionsArea=Interventions area DraftFichinter=Draft interventions