From d370571963497c988bb3ab89c2716cffd71b6298 Mon Sep 17 00:00:00 2001 From: GregM Date: Mon, 20 Jun 2022 14:59:13 +0200 Subject: [PATCH 1/7] FIX class center linkedObjectblock order date --- htdocs/commande/tpl/linkedobjectblock.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index 2a6140aaeed..9c6ed818957 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -53,7 +53,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { echo ''; echo ''.$objectlink->getNomUrl(1).''; echo ''.$objectlink->ref_client.''; - echo ''.dol_print_date($objectlink->date, 'day').''; + echo ''.dol_print_date($objectlink->date, 'day').''; echo ''; if ($user->rights->commande->lire) { $total = $total + $objectlink->total_ht; From 156ddb989649700448e608779417067c5b2ef01e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 22 Jun 2022 13:24:15 +0200 Subject: [PATCH 2/7] FIX: fiche inter url link into Commerce index --- htdocs/comm/index.php | 51 +++++++++++++++++++--- htdocs/fichinter/class/fichinter.class.php | 1 - 2 files changed, 44 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index aad02f2bd07..3b22c018eba 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -39,6 +39,9 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; +if (!empty($conf->ficheinter->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; +} // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager = new HookManager($db); @@ -100,6 +103,10 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $supplierorderstatic = new CommandeFournisseur($db); } +if (!empty($conf->ficheinter->enabled)) { + $fichinterstatic = new Fichinter($db); +} + llxHeader("", $langs->trans("CommercialArea")); print load_fiche_titre($langs->trans("CommercialArea"), '', 'commercial'); @@ -508,7 +515,12 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU * Draft interventionals */ if (!empty($conf->ficheinter->enabled)) { - $sql = "SELECT f.rowid, f.ref, s.nom as name, s.rowid as socid"; + $sql = "SELECT f.rowid, f.ref, s.nom as name, f.fk_statut"; + $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; + $sql .= ", s.code_client, s.code_compta, s.client"; + $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur"; + $sql .= ", s.logo, s.email, s.entity"; + $sql .= ", s.canvas"; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; if (empty($user->rights->societe->client->voir) && !$socid) { @@ -524,22 +536,47 @@ if (!empty($conf->ficheinter->enabled)) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } + $resql = $db->query($sql); if ($resql) { + + $num = $db->num_rows($resql); + $nbofloop = min($num, $maxofloop); + print '
'; print ''; print ''; print ''; - $langs->load("fichinter"); - $num = $db->num_rows($resql); + if ($num) { $i = 0; - while ($i < $num) { + while ($i < $nbofloop) { $obj = $db->fetch_object($resql); + + $fichinterstatic->id=$obj->rowid; + $fichinterstatic->ref=$obj->ref; + $fichinterstatic->statut=$obj->fk_statut; + + $companystatic->id = $obj->socid; + $companystatic->name = $obj->name; + $companystatic->name_alias = $obj->name_alias; + $companystatic->code_client = $obj->code_client; + $companystatic->code_compta = $obj->code_compta; + $companystatic->client = $obj->client; + $companystatic->code_fournisseur = $obj->code_fournisseur; + $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur; + $companystatic->fournisseur = $obj->fournisseur; + $companystatic->logo = $obj->logo; + $companystatic->email = $obj->email; + $companystatic->entity = $obj->entity; + $companystatic->canvas = $obj->canvas; print ''; - print '"; - print ''; + print '"; + print ''; $i++; } } diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 4bbf4e0327b..97812ca6e63 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -805,7 +805,6 @@ class Fichinter extends CommonObject $linkstart = ''; $linkend = ''; - $result .= $linkstart; if ($withpicto) { $result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); From 10c0d8381dd49fd7c61161c95c9fee229f70bad6 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 22 Jun 2022 13:25:06 +0200 Subject: [PATCH 3/7] FIX: fiche inter url link into Commerce index --- htdocs/fichinter/class/fichinter.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 97812ca6e63..4bbf4e0327b 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -805,6 +805,7 @@ class Fichinter extends CommonObject $linkstart = ''; $linkend = ''; + $result .= $linkstart; if ($withpicto) { $result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); From df585c21eec8bf9b9b9db141388bb49d7c2aea71 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 22 Jun 2022 11:31:47 +0000 Subject: [PATCH 4/7] Fixing style errors. --- htdocs/comm/index.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 3b22c018eba..fd820b2de6a 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -539,7 +539,6 @@ if (!empty($conf->ficheinter->enabled)) { $resql = $db->query($sql); if ($resql) { - $num = $db->num_rows($resql); $nbofloop = min($num, $maxofloop); From 9d20e602d1cbc56b5af5fe521b5692f7486b998a Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 22 Jun 2022 14:28:33 +0200 Subject: [PATCH 5/7] fix: remove warning GETPOST --- 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 1cdcfcdc54c..ffc88c157ff 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -682,7 +682,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null // - posted value not empty, or // - if posted value is empty and a default value exists that is not empty (it means we did a filter to an empty value when default was not). - if ($out != '') { // $out = '0' or 'abc', it is a search criteria to keep + if ($out != '' && isset($user)) {// $out = '0' or 'abc', it is a search criteria to keep $user->lastsearch_values_tmp[$relativepathstring][$paramname] = $out; } } From 98ee53c4b1d2fde6f4239bf2e2be969f8fa733be Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 22 Jun 2022 15:13:13 +0200 Subject: [PATCH 6/7] fix: massaction delete on actioncomm list do not call delete with good paramters --- htdocs/core/actions_massactions.inc.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 5e803ae3cdf..b98ce37d8f1 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1324,6 +1324,8 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' if (in_array($objecttmp->element, array('societe', 'member'))) { $result = $objecttmp->delete($objecttmp->id, $user, 1); + } elseif (in_array($objecttmp->element, array('action'))) { + $result = $objecttmp->delete(); } else { $result = $objecttmp->delete($user); } From 8075a40bd96738727abe2cf0739fb1d3c6eda474 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jun 2022 18:12:36 +0200 Subject: [PATCH 7/7] FIX #21323 --- htdocs/core/modules/action/rapport.pdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index 8b80492685d..0659c39d394 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -125,7 +125,7 @@ class CommActionRapport $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products")); $dir = $conf->agenda->dir_temp."/"; - $file = $dir."actions-".$this->month."-".$this->year.".pdf"; + $file = $dir."actions-".sprintf("%02d", $this->month)."-".sprintf("%04d", $this->year).".pdf"; if (!file_exists($dir)) { if (dol_mkdir($dir) < 0) {
'.$langs->trans("DraftFichinter").'
'; - print "rowid."\">".img_object($langs->trans("ShowFichinter"), "intervention").' '.$obj->ref."'.img_object($langs->trans("ShowCompany"), "company").' '.dol_trunc($obj->name, 24).'
'; + print $fichinterstatic->getNomUrl(1); + print "'; + print $companystatic->getNomUrl(1, 'customer'); + print '