From 88f6c71e884ebd48f74e7568b6f674b0372ff361 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jun 2020 16:05:04 +0200 Subject: [PATCH 01/69] Add tuto for live streaming --- live-streaming/README.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 live-streaming/README.txt diff --git a/live-streaming/README.txt b/live-streaming/README.txt new file mode 100644 index 00000000000..fdd0d8d25a9 --- /dev/null +++ b/live-streaming/README.txt @@ -0,0 +1,24 @@ +Tutorial to make streaming for the Dolibarr foundation with both +Powerpoint + Screen capture + Camera on speaker + +Prerequisites: +- Having 2 screens on Ubuntu desktop station. + +1) Install OBS Studio and launch OBS studio on the second screen +2) Create Scene - Camera only + micro +3) Create Scene - Screen + Camera in thumb (so 2 sources) + micro +4) Create Scene - Screen only + micro +5) Activer le mode "Toujours au dessus" (menu Fichier) et le "Mode Studio" + +6) Always on second screen, launch a brwoser to create a live stream on a platform (Exemple: Youtube) and +get the Stream key (For example by clicking on "View in Live Dashboard") + +7) On first screen, launch Chrome browser with 2 tabs only: Dolibarr web app and the Slides in Drive. +Open tab with the Web app and Click F11 to switch in screen mode +Then switch to second tab with CTRL+TAB +Click on start presentation then Click on the Cross "Exit full screen" (you leave the Fullscreen mode of Google slide but keep the full mode of browser). +You can now switch with CTRL+TAB between web application and slides without loosing the full screen. + +9) Sur OBS, Activer le "Mode Studio" Launch Start streaming. +10) Click on Scene + transition to switch between Camera and screen +11) Stop recording From eb7dd74026711f9ec2e79f014782992bbc136c63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jun 2020 16:05:40 +0200 Subject: [PATCH 02/69] Revert error --- live-streaming/README.txt | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 live-streaming/README.txt diff --git a/live-streaming/README.txt b/live-streaming/README.txt deleted file mode 100644 index fdd0d8d25a9..00000000000 --- a/live-streaming/README.txt +++ /dev/null @@ -1,24 +0,0 @@ -Tutorial to make streaming for the Dolibarr foundation with both -Powerpoint + Screen capture + Camera on speaker - -Prerequisites: -- Having 2 screens on Ubuntu desktop station. - -1) Install OBS Studio and launch OBS studio on the second screen -2) Create Scene - Camera only + micro -3) Create Scene - Screen + Camera in thumb (so 2 sources) + micro -4) Create Scene - Screen only + micro -5) Activer le mode "Toujours au dessus" (menu Fichier) et le "Mode Studio" - -6) Always on second screen, launch a brwoser to create a live stream on a platform (Exemple: Youtube) and -get the Stream key (For example by clicking on "View in Live Dashboard") - -7) On first screen, launch Chrome browser with 2 tabs only: Dolibarr web app and the Slides in Drive. -Open tab with the Web app and Click F11 to switch in screen mode -Then switch to second tab with CTRL+TAB -Click on start presentation then Click on the Cross "Exit full screen" (you leave the Fullscreen mode of Google slide but keep the full mode of browser). -You can now switch with CTRL+TAB between web application and slides without loosing the full screen. - -9) Sur OBS, Activer le "Mode Studio" Launch Start streaming. -10) Click on Scene + transition to switch between Camera and screen -11) Stop recording From 8c1af0fdb8c9216ff2dbb873830dc500a801d815 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 24 Jun 2020 12:24:47 +0200 Subject: [PATCH 03/69] fix enbtoty on supplier order --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 538af54fe23..4b42665199f 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -273,7 +273,7 @@ class CommandeFournisseur extends CommonOrder $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON c.fk_mode_reglement = p.id"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid'; - $sql.= " WHERE c.entity = ".$conf->entity; + $sql.= " WHERE c.entity IN (".getEntity('order_invoice').")"; if ($ref) $sql.= " AND c.ref='".$this->db->escape($ref)."'"; else $sql.= " AND c.rowid=".$id; From 77868ad2a366b2d46cb01ab372e89ac02df788d1 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 24 Jun 2020 12:42:41 +0200 Subject: [PATCH 04/69] fix entity on supplier order --- htdocs/fourn/class/fournisseur.commande.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 2ad30a60b80..cc394804823 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -273,7 +273,7 @@ class CommandeFournisseur extends CommonOrder $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON c.fk_mode_reglement = p.id"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid'; - $sql.= " WHERE c.entity IN (".getEntity('order_invoice').")"; + $sql.= " WHERE c.entity IN (".getEntity('supplier_order').")"; if ($ref) $sql.= " AND c.ref='".$this->db->escape($ref)."'"; else $sql.= " AND c.rowid=".$id; @@ -528,6 +528,7 @@ class CommandeFournisseur extends CommonOrder $sql.= " fk_user_valid = ".$user->id; $sql.= " WHERE rowid = ".$this->id; $sql.= " AND fk_statut = ".self::STATUS_DRAFT; + $sql.= " AND entity IN (".getEntity('supplier_order').")"; $resql=$this->db->query($sql); if (! $resql) @@ -844,6 +845,7 @@ class CommandeFournisseur extends CommonOrder $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande_fournisseur SET billed = 1'; $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT; + $sql .= " AND entity IN (".getEntity('supplier_order').")"; if ($this->db->query($sql)) { if (! $error) From dfb7c3e194092f493d0b47d9debad29ffbfa5549 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Jun 2020 21:14:49 +0200 Subject: [PATCH 05/69] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index cc394804823..dd8cb1fe722 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -528,7 +528,6 @@ class CommandeFournisseur extends CommonOrder $sql.= " fk_user_valid = ".$user->id; $sql.= " WHERE rowid = ".$this->id; $sql.= " AND fk_statut = ".self::STATUS_DRAFT; - $sql.= " AND entity IN (".getEntity('supplier_order').")"; $resql=$this->db->query($sql); if (! $resql) From 960512acd9176be205b18dd0cbda9bd92f4caf5c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Jun 2020 21:21:35 +0200 Subject: [PATCH 06/69] Update fournisseur.commande.class.php Action with filter on rowid does not need to have test on entity --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index dd8cb1fe722..ef8d4b4d93f 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -844,7 +844,7 @@ class CommandeFournisseur extends CommonOrder $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande_fournisseur SET billed = 1'; $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT; - $sql .= " AND entity IN (".getEntity('supplier_order').")"; + if ($this->db->query($sql)) { if (! $error) From 6553c40bea8f467b58d79945e0b1b3bde74181d3 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 30 Jun 2020 11:23:55 +0200 Subject: [PATCH 07/69] FIX : create a deposit with amount using comma didn't work --- htdocs/compta/facture/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ff7a1714757..a65d7f6ed81 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1255,7 +1255,8 @@ if (empty($reshook)) if ($_POST['type'] == Facture::TYPE_DEPOSIT) { $typeamount = GETPOST('typedeposit', 'alpha'); - $valuedeposit = GETPOST('valuedeposit', 'int'); + $valuedeposit = GETPOST('valuedeposit'); + $valuedeposit = price2num($valuedeposit, 'MU'); $amountdeposit = array(); if (!empty($conf->global->MAIN_DEPOSIT_MULTI_TVA)) From 918e669c98755e896326380e3cfc5a3e45dbf03d Mon Sep 17 00:00:00 2001 From: lvessiller Date: Tue, 30 Jun 2020 16:33:18 +0200 Subject: [PATCH 08/69] FIX change selected fields on company card --- htdocs/societe/card.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index d277632c348..d2f27419e76 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -846,6 +846,11 @@ if (empty($reshook)) $id=$socid; $object->fetch($socid); + // Selection of new fields + if (!empty($conf->global->MAIN_DUPLICATE_CONTACTS_TAB_ON_MAIN_CARD) && (empty($conf->global->SOCIETE_DISABLE_CONTACTS) || !empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT))) { + include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; + } + // Actions to send emails $trigger_name='COMPANY_SENTBYMAIL'; $paramname='socid'; From d3c23428d5cf773172ebeb573c234c1f10a12cc1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Jul 2020 17:00:52 +0200 Subject: [PATCH 09/69] FIX Use of office365 TLS with SMTPs method. Conflicts: htdocs/core/class/smtps.class.php --- htdocs/core/class/smtps.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index f978fd47fba..bce175b3872 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -428,7 +428,7 @@ class SMTPs $host=preg_replace('@ssl://@i', '', $host); // Remove prefix $host=preg_replace('@tls://@i', '', $host); // Remove prefix - if ($usetls) $host='tls://'.$host; + if ($usetls && ! empty($conf->global->MAIN_SMTPS_ADD_TLS_TO_HOST_FOR_HELO)) $host = 'tls://'.$host; $hosth = $host; @@ -555,6 +555,8 @@ class SMTPs $host=preg_replace('@ssl://@i', '', $host); // Remove prefix $host=preg_replace('@tls://@i', '', $host); // Remove prefix + if ($usetls && ! empty($conf->global->MAIN_SMTPS_ADD_TLS_TO_HOST_FOR_HELO)) $host = 'tls://'.$host; + $hosth = $host; if (! empty($conf->global->MAIL_SMTP_USE_FROM_FOR_HELO)) From 642e75c3dd29b03d7eaf71f21678f05d2f5521d1 Mon Sep 17 00:00:00 2001 From: quentin Date: Thu, 2 Jul 2020 11:34:59 +0200 Subject: [PATCH 10/69] FIX wrong origin --- htdocs/commande/class/commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 54506a4a816..c92de067c8e 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1014,7 +1014,7 @@ class Commande extends CommonOrder // Complete vat rate with code $vatrate = $line->tva_tx; if ($line->vat_src_code && !preg_match('/\(.*\)/', $vatrate)) $vatrate .= ' ('.$line->vat_src_code.')'; - + $origin = !empty($line->origin) ? $line->origin : $this->element; $result = $this->addline( $line->desc, $line->subprice, @@ -1039,7 +1039,7 @@ class Commande extends CommonOrder $line->label, $line->array_options, $line->fk_unit, - $this->element, + $origin, $line->id ); if ($result < 0) From 6c01cc16f8fc46667d55c5b5a7af619f48caa0a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 3 Jul 2020 00:14:22 +0200 Subject: [PATCH 11/69] Update commande.class.php --- htdocs/commande/class/commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index c92de067c8e..e356a4d5936 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1014,7 +1014,7 @@ class Commande extends CommonOrder // Complete vat rate with code $vatrate = $line->tva_tx; if ($line->vat_src_code && !preg_match('/\(.*\)/', $vatrate)) $vatrate .= ' ('.$line->vat_src_code.')'; - $origin = !empty($line->origin) ? $line->origin : $this->element; + $origin = (!empty($line->origin) ? $line->origin : $this->element); $result = $this->addline( $line->desc, $line->subprice, From 18fa4c41058a446ff57ec0c5a8cfcc10b083f1be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 3 Jul 2020 00:38:31 +0200 Subject: [PATCH 12/69] Update card.php --- htdocs/compta/facture/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index a65d7f6ed81..336b39224f1 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1255,8 +1255,7 @@ if (empty($reshook)) if ($_POST['type'] == Facture::TYPE_DEPOSIT) { $typeamount = GETPOST('typedeposit', 'alpha'); - $valuedeposit = GETPOST('valuedeposit'); - $valuedeposit = price2num($valuedeposit, 'MU'); + $valuedeposit = price2num(GETPOST('valuedeposit', 'alpha'), 'MU'); $amountdeposit = array(); if (!empty($conf->global->MAIN_DEPOSIT_MULTI_TVA)) From 466b7e84efbee9cebed5445e9aa58699bbde2a75 Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 6 Jul 2020 09:58:44 +0200 Subject: [PATCH 13/69] FIX : soc filter doesn't work on task list --- htdocs/projet/tasks/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index b97710ba7b6..36c06cd97f2 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -58,6 +58,7 @@ $search_task_label=GETPOST('search_task_label'); $search_task_description=GETPOST('search_task_description'); $search_project_user=GETPOST('search_project_user'); $search_task_user=GETPOST('search_task_user'); +$search_societe=GETPOST('search_societe'); $mine = $_REQUEST['mode']=='mine' ? 1 : 0; if ($mine) { $search_task_user = $user->id; $mine = 0; } From 053a1a2230c2e90b01b58dd673fafe1a4839f865 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jul 2020 11:22:30 +0200 Subject: [PATCH 14/69] Fix duplicate code --- htdocs/compta/resultat/index.php | 67 +------------------------------- 1 file changed, 2 insertions(+), 65 deletions(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 887412bc6a4..8c223e3615a 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -499,7 +499,7 @@ elseif ($modecompta=="BOOKKEEPING") } /* - * Charges sociales non deductibles + * Social contributions */ $subtotal_ht = 0; @@ -524,7 +524,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; $sql.= " WHERE p.fk_charge = cs.rowid"; $sql.= " AND cs.fk_type = c.id"; - $sql.= " AND c.deductible = 0"; if (! empty($date_start) && ! empty($date_end)) $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; } @@ -560,68 +559,6 @@ elseif ($modecompta=="BOOKKEEPING") } -/* - * Charges sociales deductibles - */ - -$subtotal_ht = 0; -$subtotal_ttc = 0; -if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) -{ - if ($modecompta == 'CREANCES-DETTES') - { - $sql = "SELECT c.libelle as nom, date_format(cs.date_ech,'%Y-%m') as dm, sum(cs.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= " WHERE cs.fk_type = c.id"; - $sql.= " AND c.deductible = 1"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; - } - elseif ($modecompta=="RECETTES-DEPENSES") - { - $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; - $sql.= " WHERE p.fk_charge = cs.rowid"; - $sql.= " AND cs.fk_type = c.id"; - $sql.= " AND c.deductible = 1"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; - } - - $sql.= " AND cs.entity = ".$conf->entity; - $sql.= " GROUP BY c.libelle, dm"; - - dol_syslog("get social contributions paid deductible=1", LOG_DEBUG); - $result=$db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; - $decaiss[$obj->dm] += $obj->amount; - - if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; - $decaiss_ttc[$obj->dm] += $obj->amount; - - $i++; - } - } - } else { - dol_print_error($db); - } -} -elseif ($modecompta=="BOOKKEEPING") -{ - // Nothing from this table -} - - /* * Salaries */ @@ -734,7 +671,7 @@ elseif ($modecompta == 'BOOKKEEPING') { /* - * Donation get dunning paiement + * Donation get dunning payments */ if (! empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) From 2629a98851bc0405e74de669fba17bc38effcb87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jul 2020 11:31:05 +0200 Subject: [PATCH 15/69] Fix regression --- htdocs/compta/resultat/index.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 8c223e3615a..48ededa29bc 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -512,7 +512,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " WHERE cs.fk_type = c.id"; - $sql.= " AND c.deductible = 0"; if (! empty($date_start) && ! empty($date_end)) $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; } @@ -531,7 +530,7 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco $sql.= " AND cs.entity = ".$conf->entity; $sql.= " GROUP BY c.libelle, dm"; - dol_syslog("get social contributions deductible=0 ", LOG_DEBUG); + dol_syslog("get social contributions", LOG_DEBUG); $result=$db->query($sql); if ($result) { $num = $db->num_rows($result); From 25509e74d3b443ee8751fa66606cdaff2e0f143a Mon Sep 17 00:00:00 2001 From: gauthier Date: Thu, 9 Jul 2020 17:27:14 +0200 Subject: [PATCH 16/69] FIX : order by amount ht uses wrong column --- htdocs/product/stats/facture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index 109332a1f98..2c38f74c03c 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -225,7 +225,7 @@ if ($id > 0 || ! empty($ref)) print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", "", $option, '', $sortfield, $sortorder); print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", $option, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "d.qty", "", $option, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "f.total", "", $option, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "d.total_ht", "", $option, 'align="right"', $sortfield, $sortorder); print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "f.paye,f.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder); print "\n"; From fd955519404f0488df23e1f28b8ce2beb28ebd20 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Jun 2020 18:07:51 +0200 Subject: [PATCH 17/69] Fix upload of file in import module Conflicts: htdocs/core/lib/security.lib.php --- htdocs/core/lib/security.lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 7c4a10f3a18..225dab1332c 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -309,6 +309,10 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f elseif ($feature == 'cheque') { if (!$user->rights->banque->cheque) { $createok = 0; $nbko++; } + } elseif ($feature == 'import') { + if (!$user->rights->import->run) { $createok = 0; $nbko++; } + } elseif ($feature == 'ecm') { + if (!$user->rights->ecm->upload) { $createok = 0; $nbko++; } } elseif (!empty($feature2)) // This is for permissions on one level { From 79a6246666567034845ce09afb6405cb0cc0b4c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Jul 2020 05:13:24 +0200 Subject: [PATCH 18/69] FIX Fails to retraive accounting code of social contribution sometimes Conflicts: htdocs/accountancy/journal/bankjournal.php --- htdocs/accountancy/journal/bankjournal.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index d849496d965..699bbf1eebc 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -254,7 +254,9 @@ if ($result) { } else { $tabpay[$obj->rowid]["lib"] = dol_trunc($obj->label, 60); } - $links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) + + // Load of url links to the line into llx_bank + $links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) //var_dump($i); //var_dump($tabpay); @@ -319,7 +321,8 @@ if ($result) { $chargestatic->id = $links[$key]['url_id']; $chargestatic->ref = $links[$key]['url_id']; - $tabpay[$obj->rowid]["lib"] .= ' ' . $chargestatic->getNomUrl(2); + $tabpay[$obj->rowid]["lib"] .= ' '.$chargestatic->getNomUrl(2); + $reg = array(); if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) { if ($reg[1] == 'socialcontribution') $reg[1] = 'SocialContribution'; @@ -331,12 +334,14 @@ if ($result) { $tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30); $tabpay[$obj->rowid]["paymentscid"] = $chargestatic->id; + // Retreive the accounting code of the social contribution of the payment from link of payment. + // Note: We have the social contribution id, it can be faster to get accounting code from social contribution id. $sqlmid = 'SELECT cchgsoc.accountancy_code'; - $sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc "; - $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id"; - $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid"; - $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid"; - $sqlmid .= " WHERE bkurl.fk_bank=" . $obj->rowid; + $sqlmid .= " FROM ".MAIN_DB_PREFIX."c_chargesociales cchgsoc"; + $sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id"; + $sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid"; + $sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."bank_url as bkurl ON bkurl.url_id=paycharg.rowid AND bkurl.type = 'payment_sc'"; + $sqlmid .= " WHERE bkurl.fk_bank=".$obj->rowid; dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); $resultmid = $db->query($sqlmid); From 071b909d38a626c9e3b28cfb24473789eae6933c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Jul 2020 05:13:24 +0200 Subject: [PATCH 19/69] FIX Fails to retraive accounting code of social contribution sometimes Conflicts: htdocs/accountancy/journal/bankjournal.php --- htdocs/accountancy/journal/bankjournal.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index d2ad7a0503e..070e58f5c0d 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -255,7 +255,9 @@ if ($result) { } else { $tabpay[$obj->rowid]["lib"] = dol_trunc($obj->label, 60); } - $links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) + + // Load of url links to the line into llx_bank + $links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) //var_dump($i); //var_dump($tabpay); @@ -322,7 +324,8 @@ if ($result) { $chargestatic->id = $links[$key]['url_id']; $chargestatic->ref = $links[$key]['url_id']; - $tabpay[$obj->rowid]["lib"] .= ' ' . $chargestatic->getNomUrl(2); + $tabpay[$obj->rowid]["lib"] .= ' '.$chargestatic->getNomUrl(2); + $reg = array(); if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) { if ($reg[1] == 'socialcontribution') $reg[1] = 'SocialContribution'; @@ -334,12 +337,14 @@ if ($result) { $tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30); $tabpay[$obj->rowid]["paymentscid"] = $chargestatic->id; + // Retreive the accounting code of the social contribution of the payment from link of payment. + // Note: We have the social contribution id, it can be faster to get accounting code from social contribution id. $sqlmid = 'SELECT cchgsoc.accountancy_code'; - $sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc "; - $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id"; - $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid"; - $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid"; - $sqlmid .= " WHERE bkurl.fk_bank=" . $obj->rowid; + $sqlmid .= " FROM ".MAIN_DB_PREFIX."c_chargesociales cchgsoc"; + $sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id"; + $sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid"; + $sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."bank_url as bkurl ON bkurl.url_id=paycharg.rowid AND bkurl.type = 'payment_sc'"; + $sqlmid .= " WHERE bkurl.fk_bank=".$obj->rowid; dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); $resultmid = $db->query($sqlmid); From 2f8968478d9260f9385ec1f866edd3a6447ed33b Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sun, 12 Jul 2020 10:06:04 +0200 Subject: [PATCH 20/69] fix missing entity into fetch wahrehouse --- htdocs/product/stock/class/entrepot.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 0b259018cfc..39fad14c544 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -441,6 +441,7 @@ class Entrepot extends CommonObject } $sql = "SELECT rowid, fk_parent, ref as label, description, statut, lieu, address, zip, town, fk_pays as country_id"; + $sql .= " , entity"; $sql .= " FROM ".MAIN_DB_PREFIX."entrepot"; if ($id) { @@ -460,6 +461,7 @@ class Entrepot extends CommonObject $obj=$this->db->fetch_object($result); $this->id = $obj->rowid; + $this->entity = $obj->entity; $this->fk_parent = $obj->fk_parent; $this->ref = $obj->label; $this->label = $obj->label; From 7b5072a21b49fd4816f8cae72924e29743ae5dfd Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sun, 12 Jul 2020 10:10:46 +0200 Subject: [PATCH 21/69] fix missing entity --- htdocs/product/stock/class/entrepot.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 39fad14c544..f5500812290 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -104,6 +104,7 @@ class Entrepot extends CommonObject */ public $fields=array( 'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>10), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>15), 'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>25), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>30), 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-2, 'position'=>35), From 32e4635e84203596db9ebcef85ef78863644e88a Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sun, 12 Jul 2020 21:34:13 +0200 Subject: [PATCH 22/69] fix missing entity into fetch wharehouse --- htdocs/product/stock/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 057735c49cc..9baaeebf90e 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -209,7 +209,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as ccount ON ccount.rowid = t.fk $sql .= " WHERE t.entity IN (".getEntity('stock').")"; foreach ($search as $key => $val) { - if ($key == 'status' && $search[$key] == -1) continue; + if (($key == 'status' && $search[$key] == -1) || $key=='entity') continue; $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if (strpos($object->fields[$key]['type'], 'integer:') === 0) { if ($search[$key] == '-1') $search[$key] = ''; From f4074428f8b8a6bdd2cf8a3b97a9aae6a1918e68 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 14 Jul 2020 09:38:52 +0200 Subject: [PATCH 23/69] fix filter wharehouse list on ref --- htdocs/product/stock/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 057735c49cc..8ccc887641f 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -215,7 +215,7 @@ foreach ($search as $key => $val) if ($search[$key] == '-1') $search[$key] = ''; $mode_search = 2; } - if ($search[$key] != '') $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + if ($search[$key] != '') $sql .= natural_search((($key == 'ref') ? 't.ref' : $key), $search[$key], (($key == 'status') ? 2 : $mode_search)); } if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all); // Add where from extra fields From 1bc1fd4cb4323fc7d658dd7e989d73fe72e26eb9 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 15 Jul 2020 11:24:11 +0200 Subject: [PATCH 24/69] Fix date in supplier price log tooltip. --- htdocs/fourn/class/fournisseur.product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index f9dcdbeee6a..994b2e662d8 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1008,7 +1008,7 @@ class ProductFournisseur extends Product //$out .= ''.$langs->trans("QtyMin").''; $out .= ''.$langs->trans("User").''; foreach ($productFournLogList as $productFournLog) { - $out .= ''.dol_print_date($this->db->jdate($productFournLog['datec']), 'dayhour', 'tzuser').''; + $out .= ''.dol_print_date($this->db->idate($productFournLog['datec']), 'dayhour', 'tzuser').''; $out .= ''.price($productFournLog['price']).''; //$out.= ''.$productFournLog['quantity'].''; $out .= ''.$productFournLog['lastname'].''; From 3148a181e7a0a1f8d499f8eb5e237d995e50f607 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 15 Jul 2020 17:45:34 +0200 Subject: [PATCH 25/69] fix display Commerce top menu if user only suppler order and MAIN_MENU_HIDE_UNAUTHORIZED=1 --- htdocs/core/menus/standard/eldy.lib.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 17edca45676..cf6b2233114 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -224,6 +224,15 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = ); // Commercial + + $onlysupplierorder = ! empty($user->rights->fournisseur->commande->lire) && + empty($user->rights->propal->lire) && + empty($user->rights->commande->lire) && + empty($user->rights->supplier_order->lire) && + empty($user->rights->supplier_proposal->lire) && + empty($user->rights->contrat->lire) && + empty($user->rights->ficheinter->lire); + $tmpentry = array( 'enabled'=>(!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || @@ -239,19 +248,12 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = !empty($user->rights->supplier_proposal->lire) || !empty($user->rights->supplier_order->lire) || !empty($user->rights->contrat->lire) || - !empty($user->rights->ficheinter->lire) + !empty($user->rights->ficheinter->lire || + $onlysupplierorder) ), 'module'=>'propal|commande|supplier_proposal|supplier_order|contrat|ficheinter' ); - $onlysupplierorder = ! empty($user->rights->fournisseur->commande->lire) && - empty($user->rights->propal->lire) && - empty($user->rights->commande->lire) && - empty($user->rights->supplier_order->lire) && - empty($user->rights->supplier_proposal->lire) && - empty($user->rights->contrat->lire) && - empty($user->rights->ficheinter->lire); - $menu_arr[] = array( 'name' => 'Commercial', 'link' => ($onlysupplierorder ? '/fourn/commande/index.php?mainmenu=commercial&leftmenu=' : '/comm/index.php?mainmenu=commercial&leftmenu='), @@ -270,6 +272,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'loadLangs' => array("commercial"), 'submenus' => array(), ); + var_dump($onlysupplierorder,$showmode); // Billing - Financial $tmpentry = array( From d2e528d8c1a8d8a592c571aa6082f6a293c7563e Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 15 Jul 2020 17:45:45 +0200 Subject: [PATCH 26/69] fix display Commerce top menu if user only suppler order and MAIN_MENU_HIDE_UNAUTHORIZED=1 --- htdocs/core/menus/standard/eldy.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index cf6b2233114..019b4e85fc8 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -272,7 +272,6 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'loadLangs' => array("commercial"), 'submenus' => array(), ); - var_dump($onlysupplierorder,$showmode); // Billing - Financial $tmpentry = array( From c2030a7db56204eb27aec367ea4d46f32c287c11 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Sun, 19 Jul 2020 09:43:15 +0200 Subject: [PATCH 27/69] jdate already in function listProductFournisseurPriceLog So no conversion needed. --- htdocs/fourn/class/fournisseur.product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 994b2e662d8..d6da85cf2ae 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1008,7 +1008,7 @@ class ProductFournisseur extends Product //$out .= ''.$langs->trans("QtyMin").''; $out .= ''.$langs->trans("User").''; foreach ($productFournLogList as $productFournLog) { - $out .= ''.dol_print_date($this->db->idate($productFournLog['datec']), 'dayhour', 'tzuser').''; + $out .= ''.dol_print_date($productFournLog['datec'], 'dayhour', 'tzuser').''; $out .= ''.price($productFournLog['price']).''; //$out.= ''.$productFournLog['quantity'].''; $out .= ''.$productFournLog['lastname'].''; From 2c5e96bb28c7647b80c90cfc69586cac1e4910d9 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 20 Jul 2020 09:01:21 +0200 Subject: [PATCH 28/69] better fix --- htdocs/core/menus/standard/eldy.lib.php | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 019b4e85fc8..f6d8aa401a5 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -224,15 +224,6 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = ); // Commercial - - $onlysupplierorder = ! empty($user->rights->fournisseur->commande->lire) && - empty($user->rights->propal->lire) && - empty($user->rights->commande->lire) && - empty($user->rights->supplier_order->lire) && - empty($user->rights->supplier_proposal->lire) && - empty($user->rights->contrat->lire) && - empty($user->rights->ficheinter->lire); - $tmpentry = array( 'enabled'=>(!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || @@ -243,17 +234,26 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = !empty($conf->ficheinter->enabled) ) ? 1 : 0, 'perms'=>(!empty($user->rights->propal->lire) || - !empty($user->rights->commande->lire) || - !empty($user->rights->fournisseur->lire) || - !empty($user->rights->supplier_proposal->lire) || - !empty($user->rights->supplier_order->lire) || - !empty($user->rights->contrat->lire) || - !empty($user->rights->ficheinter->lire || - $onlysupplierorder) + !empty($user->rights->commande->lire) || + !empty($user->rights->fournisseur->lire) || + !empty($user->rights->supplier_proposal->lire) || + !empty($user->rights->supplier_order->lire) || + !empty($user->rights->contrat->lire) || + !empty($user->rights->ficheinter->lire) || + !empty($user->rights->supplier_order->lire) || + !empty($user->rights->fournisseur->commande->lire) ), 'module'=>'propal|commande|supplier_proposal|supplier_order|contrat|ficheinter' ); + $onlysupplierorder = ! empty($user->rights->fournisseur->commande->lire) && + empty($user->rights->propal->lire) && + empty($user->rights->commande->lire) && + empty($user->rights->supplier_order->lire) && + empty($user->rights->supplier_proposal->lire) && + empty($user->rights->contrat->lire) && + empty($user->rights->ficheinter->lire); + $menu_arr[] = array( 'name' => 'Commercial', 'link' => ($onlysupplierorder ? '/fourn/commande/index.php?mainmenu=commercial&leftmenu=' : '/comm/index.php?mainmenu=commercial&leftmenu='), From 55298317e389bb7e87796c608d64666b4197203c Mon Sep 17 00:00:00 2001 From: VERDOL Gauthier Date: Mon, 20 Jul 2020 16:22:48 +0200 Subject: [PATCH 29/69] FIX : wrong link to third invoice templates --- htdocs/comm/card.php | 2 +- htdocs/compta/facture/invoicetemplate_list.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 9130efabeeb..37c19525afa 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1065,7 +1065,7 @@ if ($object->id > 0) print ''; print ''; - print '
'; + print ''; print ''; } diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 661f9604500..c030d0d5464 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -53,6 +53,8 @@ $cancel = GETPOST('cancel', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'invoicetemplatelist'; // To manage different context of search +$socid = GETPOST('socid', 'int'); + // Security check $id=(GETPOST('facid', 'int')?GETPOST('facid', 'int'):GETPOST('id', 'int')); $lineid=GETPOST('lineid', 'int'); @@ -141,6 +143,11 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab } } +if ($socid > 0) { + $tmpthirdparty = new Societe($db); + $res = $tmpthirdparty->fetch($socid); + if ($res > 0) $search_societe = $tmpthirdparty->name; +} /* * Actions From e2592d90490b46ac251b767197a65ed5cc95971f Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Wed, 22 Jul 2020 11:44:26 +0200 Subject: [PATCH 30/69] Update card_presend.tpl.php Add hidden options for specific sender email-adress for Invoices, Shipments and Order-confirmations --- htdocs/core/tpl/card_presend.tpl.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index a8594ec1b62..aac72ce774f 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -131,6 +131,21 @@ if ($action == 'presend') { $formmail->fromid = $user->id; } + if ($object->element === 'facture' && !empty($conf->global->INVOICE_EMAIL_SENDER)) { + $formmail->frommail = $conf->global->INVOICE_EMAIL_SENDER; + $formmail->fromname = ''; + $formmail->fromtype = 'special'; + } + if ($object->element === 'shipping' && !empty($conf->global->SHIPPING_EMAIL_SENDER)) { + $formmail->frommail = $conf->global->SHIPPING_EMAIL_SENDER; + $formmail->fromname = ''; + $formmail->fromtype = 'special'; + } + if ($object->element === 'commande' && !empty($conf->global->COMMANDE_EMAIL_SENDER)) { + $formmail->frommail = $conf->global->COMMANDE_EMAIL_SENDER; + $formmail->fromname = ''; + $formmail->fromtype = 'special'; + } $formmail->trackid=$trackid; if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set { From 255bd6b26c62923401e07cfb8de6db1e36a32692 Mon Sep 17 00:00:00 2001 From: quentin Date: Wed, 22 Jul 2020 11:52:25 +0200 Subject: [PATCH 31/69] FIX null required --- htdocs/core/class/commonobject.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e104b82642d..9d71fa663cd 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7543,7 +7543,6 @@ abstract class CommonObject $now = dol_now(); $fieldvalues = $this->setSaveQuery(); - if (array_key_exists('date_creation', $fieldvalues) && empty($fieldvalues['date_creation'])) $fieldvalues['date_creation'] = $this->db->idate($now); if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) $fieldvalues['fk_user_creat'] = $user->id; unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert. @@ -7564,8 +7563,7 @@ abstract class CommonObject if (preg_match('/^integer:/i', $this->fields[$key]['type']) && $values[$key] == '-1') $values[$key] = ''; if (!empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key] = ''; - //var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1)); - if (isset($this->fields[$key]['notnull']) && $this->fields[$key]['notnull'] == 1 && !isset($values[$key]) && is_null($this->fields[$key]['default'])) + if (isset($this->fields[$key]['notnull']) && $this->fields[$key]['notnull'] == 1 && (!isset($values[$key]) || $values[$key] === 'NULL') && is_null($this->fields[$key]['default'])) { $error++; $this->errors[] = $langs->trans("ErrorFieldRequired", $this->fields[$key]['label']); From 7bc683b23409fd9eee014975822454f7229d3db7 Mon Sep 17 00:00:00 2001 From: quentin Date: Wed, 22 Jul 2020 15:07:55 +0200 Subject: [PATCH 32/69] FIX warning --- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 0d2949b4e24..85dd111bf55 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -60,7 +60,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e // we keep position for the first line $totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield']; } - $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey; + if(is_numeric($obj->$tmpkey)) $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey; } if (!empty($val['isameasure'])) { From fc1de5b4f37cf521f39f5cc7c0e84aa7b864fe0e Mon Sep 17 00:00:00 2001 From: John Botella Date: Thu, 23 Jul 2020 11:10:18 +0200 Subject: [PATCH 33/69] Fix multicurecy option not applied --- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/fourn/class/fournisseur.commande.class.php | 6 +++++- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- htdocs/supplier_proposal/class/supplier_proposal.class.php | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index d3c9ae19721..a9267201858 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -416,7 +416,7 @@ class Facture extends CommonInvoice $this->brouillon = 1; // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate) - if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code); + if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); if (empty($this->fk_multicurrency)) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index bc975a9267a..cd35e1d34de 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1271,11 +1271,15 @@ class CommandeFournisseur extends CommonOrder $error = 0; $now = dol_now(); + // $date_commande is deprecated + $date = ($this->date_commande ? $this->date_commande : $this->date); // in case of date is set + if(empty($date)) $date = $now; + // Clean parameters if (empty($this->source)) $this->source = 0; // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate) - if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code); + if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); if (empty($this->fk_multicurrency)) { diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 9cbcec32a9a..46c2c032786 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -359,7 +359,7 @@ class FactureFournisseur extends CommonInvoice $remise = $this->remise; // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate) - if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code); + if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); if (empty($this->fk_multicurrency)) { diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index d292ebe13bf..1801bf16d71 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -891,7 +891,7 @@ class SupplierProposal extends CommonObject } // Multicurrency - if (!empty($this->multicurrency_code)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code); + if (!empty($this->multicurrency_code)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $now); if (empty($this->fk_multicurrency)) { $this->multicurrency_code = $conf->currency; From 55e65bbabf46919368a3dde1eeaefdca93bec316 Mon Sep 17 00:00:00 2001 From: John Botella Date: Thu, 23 Jul 2020 11:12:04 +0200 Subject: [PATCH 34/69] Fix variable init --- htdocs/multicurrency/class/multicurrency.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index 3c6b7044486..50288459a7d 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -530,7 +530,7 @@ class MultiCurrency extends CommonObject $sql1.= " AND m.entity IN (".getEntity('multicurrency').")"; $sql2= ''; if (!empty($conf->global->MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE) && !empty($date_document)) $sql2.= ' AND DATE_FORMAT(mc.date_sync, "%Y-%m-%d") = "'.date('Y-m-d', $date_document).'"'; - $sql3.= ' ORDER BY mc.date_sync DESC LIMIT 1'; + $sql3 = ' ORDER BY mc.date_sync DESC LIMIT 1'; dol_syslog(__METHOD__, LOG_DEBUG); $resql = $db->query($sql1.$sql2.$sql3); From 921e904acca2c8c0103c11165c196b69df95b9f7 Mon Sep 17 00:00:00 2001 From: ATM john Date: Thu, 23 Jul 2020 20:34:11 +0200 Subject: [PATCH 35/69] Fix MySQL rank usage for column --- htdocs/install/mysql/migration/10.0.0-11.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 7ebec468457..7055898ada6 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -98,7 +98,7 @@ ALTER TABLE llx_bom_bomline ADD COLUMN position integer NOT NULL DEFAULT 0; ALTER TABLE llx_bom_bomline ADD COLUMN qty_frozen smallint DEFAULT 0; ALTER TABLE llx_bom_bomline ADD COLUMN disable_stock_change smallint DEFAULT 0; -ALTER TABLE llx_bom_bomline DROP COLUMN rank; +ALTER TABLE llx_bom_bomline DROP COLUMN `rank`; create table llx_categorie_warehouse ( From 99935ce11fd6019814504f32dab96630c5aa1527 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 01:30:34 +0200 Subject: [PATCH 36/69] FIX Should not be able to edit qty on shipment when no stock available --- htdocs/expedition/card.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index c362bcfb8ac..a14258e6419 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1524,8 +1524,11 @@ if ($action == 'create') } if ($subj == 0) // Line not shown yet, we show it { - print ''; - print '\n"; From 8ee5b16e895f39b3126a553a61ace03cbe29b14b Mon Sep 17 00:00:00 2001 From: lvessiller Date: Wed, 29 Jul 2020 12:00:22 +0200 Subject: [PATCH 48/69] FIX redirect on contact card from main search --- htdocs/contact/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index b0db8b0affb..b8f9d3d14a4 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -389,8 +389,8 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $sql.= $db->plimit($limit+1, $offset); -$result = $db->query($sql); -if (! $result) +$resql = $db->query($sql); +if (! $resql) { dol_print_error($db); exit; @@ -763,7 +763,7 @@ $i = 0; $totalarray=array(); while ($i < min($num, $limit)) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($resql); print ''; @@ -980,7 +980,7 @@ while ($i < min($num, $limit)) $i++; } -$db->free($result); +$db->free($resql); $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook=$hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook From d9191c74d8f3212d20125e47c4faed056d6e4214 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Jul 2020 12:59:59 +0200 Subject: [PATCH 49/69] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index fc76a158cab..dd34555dd79 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -331,7 +331,7 @@ class CommandeFournisseur extends CommonOrder $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid'; - if(empty($id)) $sql .= " WHERE c.entity IN (".getEntity('supplier_order').")"; + if (empty($id)) $sql .= " WHERE c.entity IN (".getEntity('supplier_order').")"; else $sql .= " WHERE c.rowid=".$id; if ($ref) $sql .= " AND c.ref='".$this->db->escape($ref)."'"; From 6bd450dcd022b33ad5cf2a75cad42ab50ea8d4d5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Jul 2020 13:10:31 +0200 Subject: [PATCH 50/69] Doc --- dev/dolibarr_changes.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 48c6bf342a9..169fa27b5bd 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -8,6 +8,7 @@ ALL: Check "@CHANGE" + PrestaShopWebservice: --------------------- Replace @@ -27,6 +28,19 @@ With +DEBUGBAR: +--------- + +Move + this.options = { + bodyMarginBottom: true, + bodyMarginBottomHeight: parseInt($('body').css('margin-bottom')), + }; +few line lower in the + initialize: function() { + + + ESCPOS: ------- Replace From 4a291f181fadca23d9843e1043ec15112d5dbf38 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Jul 2020 13:47:04 +0200 Subject: [PATCH 51/69] Fix regression --- htdocs/contact/list.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index bb8f9497969..dbdc9388404 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -365,8 +365,8 @@ else $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 { $page = 0; @@ -376,18 +376,18 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $sql.= $db->plimit($limit+1, $offset); -$result = $db->query($sql); -if (! $result) +$resql = $db->query($sql); +if (! $resql) { dol_print_error($db); exit; } -$num = $db->num_rows($result); +$num = $db->num_rows($resql); $arrayofselected=is_array($toselect)?$toselect:array(); -if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($sall != '' || $seearch_cti != '')) +if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($sall != '' || $search_cti != '')) { $obj = $db->fetch_object($resql); $id = $obj->rowid; @@ -715,7 +715,7 @@ $i = 0; $totalarray=array(); while ($i < min($num,$limit)) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($resql); print ''; @@ -914,7 +914,7 @@ while ($i < min($num,$limit)) $i++; } -$db->free($result); +$db->free($resql); $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook From 3d79950c27369c1f049863f6eae8233f0b3a4bbf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Jul 2020 14:13:29 +0200 Subject: [PATCH 52/69] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9d71fa663cd..4786b5817fe 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7549,11 +7549,11 @@ abstract class CommonObject if (array_key_exists('ref', $fieldvalues)) $fieldvalues['ref'] = dol_string_nospecial($fieldvalues['ref']); // If field is a ref, we sanitize data $keys = array(); - $values = array(); + $values = array(); // Array to store string forged for SQL syntax foreach ($fieldvalues as $k => $v) { $keys[$k] = $k; $value = $this->fields[$k]; - $values[$k] = $this->quote($v, $value); + $values[$k] = $this->quote($v, $value); // May return string 'NULL' if $value is null } // Clean and check mandatory From 9a9eef428be2ec9081e88010e4db4b4332e43022 Mon Sep 17 00:00:00 2001 From: altairis Date: Fri, 31 Jul 2020 12:22:21 +0200 Subject: [PATCH 53/69] fix duration fields size with firefox --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 627e5ee8a2b..d1a76c712e5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5649,7 +5649,7 @@ class Form } elseif ($typehour=='text' || $typehour=='textselect') { - $retstring.=''; + $retstring.=''; } else return 'BadValueForParameterTypeHour'; @@ -5673,7 +5673,7 @@ class Form } elseif ($typehour=='text' ) { - $retstring.=''; + $retstring.=''; } if ($typehour!='text') $retstring.=' '.$langs->trans('MinuteShort'); From b026896a98b6be72835c6410f7214423b80fb2b5 Mon Sep 17 00:00:00 2001 From: quentin Date: Mon, 3 Aug 2020 10:33:48 +0200 Subject: [PATCH 54/69] FIX product label and desc were never updated when modifying trans --- htdocs/product/traduction.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index 59d30923f87..25c6eeb4caf 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -78,6 +78,7 @@ $cancel != $langs->trans("Cancel") && $object->label = $_POST["libelle"]; $object->description = dol_htmlcleanlastbr($_POST["desc"]); $object->other = dol_htmlcleanlastbr($_POST["other"]); + $object->update($object->id, $user); } else { From 72b2fb442b95fe107c05279bfb0ec606f86318f1 Mon Sep 17 00:00:00 2001 From: quentin Date: Mon, 3 Aug 2020 11:17:39 +0200 Subject: [PATCH 55/69] fix test libelle --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index abff8486cc0..ade9c5f6101 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1215,7 +1215,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, global $db, $conf, $langs; $idprod=(! empty($object->lines[$i]->fk_product)?$object->lines[$i]->fk_product:false); - $label=(! empty($object->lines[$i]->label)?$object->lines[$i]->label:(! empty($object->lines[$i]->product_label)?$object->lines[$i]->product_label:'')); + $label=(!empty($object->lines[$i]->label) ? $object->lines[$i]->label : (!empty($object->lines[$i]->libelle) ? $object->lines[$i]->libelle : (!empty($object->lines[$i]->product_label) ? $object->lines[$i]->product_label : ''))); $desc=(! empty($object->lines[$i]->desc)?$object->lines[$i]->desc:(! empty($object->lines[$i]->description)?$object->lines[$i]->description:'')); $ref_supplier=(! empty($object->lines[$i]->ref_supplier)?$object->lines[$i]->ref_supplier:(! empty($object->lines[$i]->ref_fourn)?$object->lines[$i]->ref_fourn:'')); // TODO Not yet saved for supplier invoices, only supplier orders $note=(! empty($object->lines[$i]->note)?$object->lines[$i]->note:''); From bbfca90260576890d2b1e77833caa7ec782c77d7 Mon Sep 17 00:00:00 2001 From: quentin Date: Mon, 3 Aug 2020 11:54:26 +0200 Subject: [PATCH 56/69] FIX Missing PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE conf in supplier order --- htdocs/fourn/commande/card.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 43964b38431..0b7eb338b69 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -460,11 +460,26 @@ if (empty($reshook)) if ($idprod > 0) { $label = $productsupplier->label; - + // Define output language + if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + $outputlangs = $langs; + $newlang = ''; + if (empty($newlang) && GETPOST('lang_id', 'aZ09')) + $newlang = GETPOST('lang_id', 'aZ09'); + if (empty($newlang)) + $newlang = $object->thirdparty->default_lang; + if (!empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + $desc = (!empty($productsupplier->multilangs [$outputlangs->defaultlang] ["description"])) ? $productsupplier->multilangs [$outputlangs->defaultlang] ["description"] : $productsupplier->description; + } else { + $desc = $productsupplier->description; + } // if we use supplier description of the products if (!empty($productsupplier->desc_supplier) && !empty($conf->global->PRODUIT_FOURN_TEXTS)) { $desc = $productsupplier->desc_supplier; - } else $desc = $productsupplier->description; + } if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION)); From 2d192431bc7ec9c52089a561c83ddbdb887b8a09 Mon Sep 17 00:00:00 2001 From: VERDOL Gauthier Date: Mon, 3 Aug 2020 14:59:51 +0200 Subject: [PATCH 57/69] FIX : wrong element var for fetch_name_optionals_label function with expeditions --- htdocs/core/class/commondocgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 4a8e097fd6d..9f5dac2a0c3 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -513,7 +513,7 @@ abstract class CommonDocGenerator // Retrieve extrafields if (is_array($object->array_options) && count($object->array_options)) { - $extrafieldkey = $object->element; + $extrafieldkey = $object->table_element; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); From 11f14b8fe5c155dbb706a54e21a4933d8d02000c Mon Sep 17 00:00:00 2001 From: John Botella Date: Tue, 4 Aug 2020 14:13:52 +0200 Subject: [PATCH 58/69] Fix bad usage of moreparam --- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/lib/ajax.lib.php | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1e1bbdf58d2..718b9fecdfc 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5953,7 +5953,7 @@ class Form $urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php'; // No immediate load of all database - $urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter).($moreparams ? $moreparams : ''); + $urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter); // Activate the auto complete using ajax call. $out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array()); $out .= ''; diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index a430a1612af..72bdc413795 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -25,25 +25,26 @@ /** - * Generic function that return javascript to add to a page to transform a common input field into an autocomplete field by calling an Ajax page (ex: /societe/ajaxcompanies.php). + * Generic function that return javascript to add to a page to transform a common input field into an autocomplete field by calling an Ajax page (ex: /societe/ajaxcompanies.php). * The HTML field must be an input text with id=search_$htmlname. * This use the jQuery "autocomplete" function. If we want to use the select2, we must also convert the input into select on funcntions that call this method. * - * @param string $selected Preselected value - * @param string $htmlname HTML name of input field - * @param string $url Ajax Url to call for request: /path/page.php. Must return a json array ('key'=>id, 'value'=>String shown into input field once selected, 'label'=>String shown into combo list) - * @param string $urloption More parameters on URL request - * @param int $minLength Minimum number of chars to trigger that Ajax search - * @param int $autoselect Automatic selection if just one value - * @param array $ajaxoptions Multiple options array + * @param string $selected Preselected value + * @param string $htmlname HTML name of input field + * @param string $url Ajax Url to call for request: /path/page.php. Must return a json array ('key'=>id, 'value'=>String shown into input field once selected, 'label'=>String shown into combo list) + * @param string $urloption More parameters on URL request + * @param int $minLength Minimum number of chars to trigger that Ajax search + * @param int $autoselect Automatic selection if just one value + * @param array $ajaxoptions Multiple options array * - Ex: array('update'=>array('field1','field2'...)) will reset field1 and field2 once select done * - Ex: array('disabled'=> ) * - Ex: array('show'=> ) * - Ex: array('update_textarea'=> ) * - Ex: array('option_disabled'=> id to disable and warning to show if we select a disabled value (this is possible when using autocomplete ajax) - * @return string Script + * @param string $moreparams More params provided to ajax call + * @return string Script */ -function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLength = 2, $autoselect = 0, $ajaxoptions = array()) +function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLength = 2, $autoselect = 0, $ajaxoptions = array(), $moreparams = '') { if (empty($minLength)) $minLength=1; @@ -55,7 +56,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen // Input search_htmlname is original field // Input htmlname is a second input field used when using ajax autocomplete. - $script = ''; + $script = ''; $script.= ''."\n"; $script.= '
'.$langs->trans("LatestCustomerTemplateInvoices", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllCustomerTemplateInvoices").' '.$num.''; print '
'.$langs->trans("LatestCustomerTemplateInvoices", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllCustomerTemplateInvoices").' '.$num.'
'; + $warehouse_selected_id = GETPOST('entrepot_id', 'int'); + + print ''; + print '
'; + if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $disabled = ''; @@ -1533,6 +1536,9 @@ if ($action == 'create') { $disabled = 'disabled="disabled"'; } + if ($warehouse_selected_id <= 0) { // We did not force a given warehouse, so we won't have no warehouse to change qty. + $disabled = 'disabled="disabled"'; + } print ' '; } else @@ -1544,7 +1550,6 @@ if ($action == 'create') print ''; if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - $warehouse_selected_id = GETPOST('entrepot_id', 'int'); if ($warehouse_selected_id > 0) { $warehouseObject = new Entrepot($db); From 94498b191bb7c584be3df5a5adb0a827a35f877c Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Fri, 24 Jul 2020 10:37:19 +0200 Subject: [PATCH 37/69] Update card_presend.tpl.php --- htdocs/core/tpl/card_presend.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index aac72ce774f..67de56e16fa 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -139,7 +139,7 @@ if ($action == 'presend') if ($object->element === 'shipping' && !empty($conf->global->SHIPPING_EMAIL_SENDER)) { $formmail->frommail = $conf->global->SHIPPING_EMAIL_SENDER; $formmail->fromname = ''; - $formmail->fromtype = 'special'; + $formmail->fromtype = 'special'; } if ($object->element === 'commande' && !empty($conf->global->COMMANDE_EMAIL_SENDER)) { $formmail->frommail = $conf->global->COMMANDE_EMAIL_SENDER; From 8273dbcd4948b79baac12f2d5d0f9adc95a8bf33 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 24 Jul 2020 08:39:09 +0000 Subject: [PATCH 38/69] Fixing style errors. --- htdocs/core/tpl/card_presend.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 67de56e16fa..aac72ce774f 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -139,7 +139,7 @@ if ($action == 'presend') if ($object->element === 'shipping' && !empty($conf->global->SHIPPING_EMAIL_SENDER)) { $formmail->frommail = $conf->global->SHIPPING_EMAIL_SENDER; $formmail->fromname = ''; - $formmail->fromtype = 'special'; + $formmail->fromtype = 'special'; } if ($object->element === 'commande' && !empty($conf->global->COMMANDE_EMAIL_SENDER)) { $formmail->frommail = $conf->global->COMMANDE_EMAIL_SENDER; From 6261fa191fbdb3efbd178120d75dab057db88895 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 12:47:29 +0200 Subject: [PATCH 39/69] Prepare compatibilty with mysql 8 --- test/phpunit/CodingSqlTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php index b62b9befcc7..207f2db0d47 100644 --- a/test/phpunit/CodingSqlTest.php +++ b/test/phpunit/CodingSqlTest.php @@ -156,7 +156,10 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase continue; print 'Check sql file '.$file."\n"; - $filecontent=file_get_contents($dir.'/'.$file); + $filecontent = file_get_contents($dir.'/'.$file); + + // Allow ` for 'rank' column name + $filecontent = str_replace('`rank`', '_rank_', $filecontent); $result=strpos($filecontent, '`'); print __METHOD__." Result for checking we don't have back quote = ".$result."\n"; From 943e7c988f1ead77e506d5b093b76a88bd24a4e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 12:55:12 +0200 Subject: [PATCH 40/69] Update extrafields_list_print_fields.tpl.php --- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 85dd111bf55..817d1aadfc9 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -60,7 +60,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e // we keep position for the first line $totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield']; } - if(is_numeric($obj->$tmpkey)) $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey; + if (is_numeric($obj->$tmpkey)) $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey; } if (!empty($val['isameasure'])) { From 93348630bfd9d57f2bd0cb492d770234ec5d4c78 Mon Sep 17 00:00:00 2001 From: FlorianMortgat <5845502+FlorianMortgat@users.noreply.github.com> Date: Sat, 25 Jul 2020 11:05:05 +0200 Subject: [PATCH 41/69] FIX 11.0: computation of the bottom margin of returns NaN because body is not loaded yet --- htdocs/includes/DebugBar/Resources/debugbar.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/includes/DebugBar/Resources/debugbar.js b/htdocs/includes/DebugBar/Resources/debugbar.js index faf567e37c1..1dcbec2146f 100644 --- a/htdocs/includes/DebugBar/Resources/debugbar.js +++ b/htdocs/includes/DebugBar/Resources/debugbar.js @@ -409,12 +409,11 @@ if (typeof(PhpDebugBar) == 'undefined') { className: "phpdebugbar " + csscls('minimized'), - options: { - bodyMarginBottom: true, - bodyMarginBottomHeight: parseInt($('body').css('margin-bottom')) - }, - initialize: function() { + this.options = { + bodyMarginBottom: true, + bodyMarginBottomHeight: parseInt($('body').css('margin-bottom')), + }; this.controls = {}; this.dataMap = {}; this.datasets = {}; From 25994e61bce5d8d165dd5fd91fcd9d5113b8b6da Mon Sep 17 00:00:00 2001 From: VERDOL Gauthier Date: Mon, 27 Jul 2020 16:04:21 +0200 Subject: [PATCH 42/69] FIX : We need to see unit line on PDF even though it's an option --- htdocs/core/lib/pdf.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index af1da161dc7..1d9d218f7af 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1826,7 +1826,6 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanag } if (empty($reshook)) { - if ($object->lines[$i]->special_code == 3) return ''; if (empty($hidedetails) || $hidedetails > 1) $result.=$langs->transnoentitiesnoconv($object->lines[$i]->getLabelOfUnit('short')); } return $result; From ee55b82a8d7449b53f649417102ffb43e2e9e5cb Mon Sep 17 00:00:00 2001 From: Marc DLL <68746600@users.noreply.github.com> Date: Mon, 27 Jul 2020 23:27:44 +0200 Subject: [PATCH 43/69] FIX: shipping creation: checks not done on weight and sizes --- htdocs/expedition/class/expedition.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index b623ea9c629..8417ddb9bfb 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -321,10 +321,10 @@ class Expedition extends CommonObject $sql.= ", ".($this->fk_delivery_address>0?$this->fk_delivery_address:"null"); $sql.= ", ".($this->shipping_method_id>0?$this->shipping_method_id:"null"); $sql.= ", '".$this->db->escape($this->tracking_number)."'"; - $sql.= ", ".$this->weight; - $sql.= ", ".$this->sizeS; // TODO Should use this->trueDepth - $sql.= ", ".$this->sizeW; // TODO Should use this->trueWidth - $sql.= ", ".$this->sizeH; // TODO Should use this->trueHeight + $sql.= ", ".(is_numeric($this->weight)?$this->weight:'NULL'); + $sql.= ", ".(is_numeric($this->sizeS)?$this->sizeS:'NULL'); // TODO Should use this->trueDepth + $sql.= ", ".(is_numeric($this->sizeW)?$this->sizeW:'NULL'); // TODO Should use this->trueWidth + $sql.= ", ".(is_numeric($this->sizeH)?$this->sizeH:'NULL'); // TODO Should use this->trueHeight $sql.= ", ".($this->weight_units != '' ? (int) $this->weight_units : 'NULL'); $sql.= ", ".($this->size_units != '' ? (int) $this->size_units : 'NULL'); $sql.= ", ".(!empty($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null"); From d46d34915eebd58a0a81768b65c857ffff54f560 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Jul 2020 10:23:09 +0200 Subject: [PATCH 44/69] FIX Checkbox "drop table" was not checked when using php method for dump --- htdocs/admin/tools/dolibarr_export.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 6bbaeb7c6c8..e168f5fbdc0 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -302,7 +302,7 @@ if (in_array($type, array('mysql', 'mysqli'))) { print '
'; print '
'.$langs->trans('ExportStructure').''; - print ''; + print ''; print ''; print '
'; print '
'; From 9f0c3b0db1a665a3daeb3d099fc357363f382933 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 28 Jul 2020 15:13:56 +0200 Subject: [PATCH 45/69] fetch() command fourn : Same management as commande.class.php of entity --- htdocs/fourn/class/fournisseur.commande.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index cd35e1d34de..c6c06a8d9b7 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -331,8 +331,11 @@ class CommandeFournisseur extends CommonOrder $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid'; $sql .= " WHERE c.entity IN (".getEntity('supplier_order').")"; + + if(empty($id)) $sql .= " WHERE c.entity IN (".getEntity('supplier_order').")"; + else $sql .= " WHERE c.rowid=".$id; + if ($ref) $sql .= " AND c.ref='".$this->db->escape($ref)."'"; - else $sql .= " AND c.rowid=".$id; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql = $this->db->query($sql); From b480fb2dfcf73c3331a66b9cbb0bc33c1cd5e3c9 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 28 Jul 2020 15:32:58 +0200 Subject: [PATCH 46/69] Delete double line --- htdocs/fourn/class/fournisseur.commande.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index c6c06a8d9b7..fc76a158cab 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -330,7 +330,6 @@ class CommandeFournisseur extends CommonOrder $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON c.fk_mode_reglement = p.id"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid'; - $sql .= " WHERE c.entity IN (".getEntity('supplier_order').")"; if(empty($id)) $sql .= " WHERE c.entity IN (".getEntity('supplier_order').")"; else $sql .= " WHERE c.rowid=".$id; From d214dbb5fd4f99216466265254d84e6c1148965a Mon Sep 17 00:00:00 2001 From: VERDOL Gauthier Date: Tue, 28 Jul 2020 15:42:54 +0200 Subject: [PATCH 47/69] FIX : Order by amount in product propal stats must be done on d.total_ht and not p.total --- htdocs/product/stats/propal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 208ff49e158..52f0510cb80 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -208,7 +208,7 @@ if ($id > 0 || ! empty($ref)) print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", $option, '', $sortfield, $sortorder); print_liste_field_titre("DatePropal", $_SERVER["PHP_SELF"], "p.datep", "", $option, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "d.qty", "", $option, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "p.total", "", $option, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "d.total_ht", "", $option, 'align="right"', $sortfield, $sortorder); print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "p.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder); print "