From 060df57cb1ae56a699c9c92ef2c70a1bc25aa9bb Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 3 Mar 2020 11:58:15 +0100 Subject: [PATCH 1/8] FIX: fk_type subscription list via api REST v10 to dev --- htdocs/adherents/class/adherent.class.php | 65 ++++++++++++----------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index d20fc34ec9d..3610780ca19 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1377,48 +1377,49 @@ class Adherent extends CommonObject require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; - $sql = "SELECT c.rowid, c.fk_adherent, c.subscription, c.note, c.fk_bank,"; - $sql.= " c.tms as datem,"; - $sql.= " c.datec as datec,"; - $sql.= " c.dateadh as dateh,"; - $sql.= " c.datef as datef"; - $sql.= " FROM ".MAIN_DB_PREFIX."subscription as c"; - $sql.= " WHERE c.fk_adherent = ".$this->id; - $sql.= " ORDER BY c.dateadh"; + $sql = "SELECT c.rowid, c.fk_adherent, c.fk_type, c.subscription, c.note, c.fk_bank,"; + $sql .= " c.tms as datem,"; + $sql .= " c.datec as datec,"; + $sql .= " c.dateadh as dateh,"; + $sql .= " c.datef as datef"; + $sql .= " FROM ".MAIN_DB_PREFIX."subscription as c"; + $sql .= " WHERE c.fk_adherent = ".$this->id; + $sql .= " ORDER BY c.dateadh"; dol_syslog(get_class($this)."::fetch_subscriptions", LOG_DEBUG); - $resql=$this->db->query($sql); + $resql = $this->db->query($sql); if ($resql) { - $this->subscriptions=array(); + $this->subscriptions = array(); - $i=0; + $i = 0; while ($obj = $this->db->fetch_object($resql)) { - if ($i==0) + if ($i == 0) { - $this->first_subscription_date=$this->db->jdate($obj->datec); - $this->first_subscription_date_start=$this->db->jdate($obj->dateh); - $this->first_subscription_date_end=$this->db->jdate($obj->datef); - $this->first_subscription_amount=$obj->subscription; + $this->first_subscription_date = $this->db->jdate($obj->datec); + $this->first_subscription_date_start = $this->db->jdate($obj->dateh); + $this->first_subscription_date_end = $this->db->jdate($obj->datef); + $this->first_subscription_amount = $obj->subscription; } - $this->last_subscription_date=$this->db->jdate($obj->datec); - $this->last_subscription_date_start=$this->db->jdate($obj->datef); - $this->last_subscription_date_end=$this->db->jdate($obj->datef); - $this->last_subscription_amount=$obj->subscription; + $this->last_subscription_date = $this->db->jdate($obj->datec); + $this->last_subscription_date_start = $this->db->jdate($obj->datef); + $this->last_subscription_date_end = $this->db->jdate($obj->datef); + $this->last_subscription_amount = $obj->subscription; - $subscription=new Subscription($this->db); - $subscription->id=$obj->rowid; - $subscription->fk_adherent=$obj->fk_adherent; - $subscription->amount=$obj->subscription; - $subscription->note=$obj->note; - $subscription->fk_bank=$obj->fk_bank; - $subscription->datem=$this->db->jdate($obj->datem); - $subscription->datec=$this->db->jdate($obj->datec); - $subscription->dateh=$this->db->jdate($obj->dateh); - $subscription->datef=$this->db->jdate($obj->datef); + $subscription = new Subscription($this->db); + $subscription->id = $obj->rowid; + $subscription->fk_adherent = $obj->fk_adherent; + $subscription->fk_type = $obj->fk_type; + $subscription->amount = $obj->subscription; + $subscription->note = $obj->note; + $subscription->fk_bank = $obj->fk_bank; + $subscription->datem = $this->db->jdate($obj->datem); + $subscription->datec = $this->db->jdate($obj->datec); + $subscription->dateh = $this->db->jdate($obj->dateh); + $subscription->datef = $this->db->jdate($obj->datef); - $this->subscriptions[]=$subscription; + $this->subscriptions[] = $subscription; $i++; } @@ -1426,7 +1427,7 @@ class Adherent extends CommonObject } else { - $this->error=$this->db->error().' sql='.$sql; + $this->error = $this->db->error().' sql='.$sql; return -1; } } From 945641a05b2eabd0d78ffdb21cfe0fdafdd1eadf Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 3 Mar 2020 16:26:57 +0100 Subject: [PATCH 2/8] FIX missing global $conf --- htdocs/expensereport/class/expensereport.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 03247161ff4..2dddac4dbab 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -969,6 +969,8 @@ class ExpenseReport extends CommonObject public function fetch_lines() { // phpcs:enable + global $conf; + $this->lines=array(); $sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date, de.rang,'; From f586c3b0c8db9478b112d373ed82c5b5a7e06fee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Mar 2020 10:13:55 +0100 Subject: [PATCH 3/8] Prepare 11.0.2 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 01245a466cc..e453ef34991 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION', '11.0.1'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION', '11.0.2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO', chr(128)); From de0234e7a8681bc2b34b35ca5d4faf6314c3b028 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Mar 2020 11:13:09 +0100 Subject: [PATCH 4/8] Update doc --- ChangeLog | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/ChangeLog b/ChangeLog index b11910d25c0..127f2925af8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,69 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 11.0.2 compared to 11.0.1 ***** +FIX: #10309 +FIX: #13110 +FIX: #13118 +FIX: #13124 +FIX: #13131 +FIX: #13135 +FIX: #13146 #13198 +FIX: #13175 +FIX: #13182 +FIX: #13183 +FIX: #13184 +FIX: #13263 +FIX: #13267 +FIX: an external user can not approve +FIX: API Get list of documents for supplier_invoice +FIX: API to push an expense report +FIX: API upload/download doc for expensereport +FIX: Avoid to download the export if we just press enter to refresh form +FIX: Bad link to template invoices +FIX: Bad sort link in accounting report +FIX: Bad translation for productlot EatBy and SellBy +FIX: better method to check user rights AND usergroup rights ! +FIX: CA by product list filter +FIX: CSS +FIX: Disable js if no javascript +FIX: duplicate class name into some log lines +FIX: etrafield with visibilty=5 were not in read only. +FIX: excess paid from situation invoices not counted when calculating remain to pay. +FIX: Force FEC export to txt format. +FIX: Free input for email no more visible. +FIX: Keep assigned users in session when loading projects and tasks +FIX: List of viewed projects too large in task widget. +FIX: Menu truncated. Add tooltip to have all content. +FIX: Missing field "billed" in export. +FIX: missing "statut" for getNomUrl() function +FIX: modFournisseur is required by modSupplierProposal +FIX: Multicompany compatibility +FIX: must be == and not = +FIX: option for topbar search and bookmarks +FIX: option MAIN_OPTIMIZEFORTEXTBROWSER +FIX: some responsive troubles +FIX: round MT in accountancy books +FIX: search with '0' +FIX: sort link +FIX: SQL Overload in default contact trigger. +FIX: SQl syntax error. +FIX: Submit of documents for supplier invoices. +FIX: timezone must be tzserver and not tzuser as on contract card +FIX: token in barcode tools page missing +FIX: Bad name of trigger PROPAL_SUPPLIER_TRIGGER, should be PROPOSAL_SUPPLIER_TRIGGER +FIX: Type of contact for event does not exists and not supported +FIX: Type of contact not saved when creating a contact +FIX: typo on ckeck method +FIX: undefined function measuringUnitString in product list +FIX: Usage of project not available in export. +FIX: wrong test +FIX: z-index for moretabsList with constant MAIN_MAXTABS_IN_CARD +FIX: Use GETPOST instead of POST +FIX: HTML Injection +FIX: Visualization rights correction on last modified contacts box. +FIX: Vulnerability in module from modulebuilder. +FIX: Vulnerability reported by code16 ***** ChangeLog for 11.0.1 compared to 11.0.0 ***** FIX: advanced target emailing sql and ergonomy. From 50d76ae0e84fee2888ebfbbca073410c53432171 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Mar 2020 11:48:43 +0100 Subject: [PATCH 5/8] FIX Bad permission to access menu Statistics on intervention. --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index f66768b7ffb..298b19c7147 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -984,7 +984,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201); $newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire, '', '', '', 202); if ($conf->global->MAIN_FEATURES_LEVEL >= 2) $newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ListOfTemplates"), 1, $user->rights->ficheinter->lire, '', '', '', 203); - $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); + $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->ficheinter->lire); } } From 834873ab15351c61ab08dea0b3cef5fa40fadaa5 Mon Sep 17 00:00:00 2001 From: atm-arnaud Date: Wed, 4 Mar 2020 11:58:42 +0100 Subject: [PATCH 6/8] FIX date order was -1D and desc with label repetition --- htdocs/core/actions_massactions.inc.php | 4 ++-- htdocs/core/lib/functions.lib.php | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 3a429bf1128..e5734547a95 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -658,11 +658,11 @@ if ($massaction == 'confirm_createbills') // Create bills from orders for ($i=0;$i<$num;$i++) { - $desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle); + $desc=($lines[$i]->desc?$lines[$i]->desc:''); // If we build one invoice for several order, we must put the invoice of order on the line if (! empty($createbills_onebythird)) { - $desc=dol_concatdesc($desc, $langs->trans("Order").' '.$cmd->ref.' - '.dol_print_date($cmd->date, 'day', $langs)); + $desc=dol_concatdesc($desc, $langs->trans("Order").' '.$cmd->ref.' - '.dol_print_date($cmd->date, 'day')); } if ($lines[$i]->subprice < 0) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8b2a31874ca..25a5ab85973 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1788,6 +1788,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang $format=str_replace('%A', '__A__', $format); } + // Analyze date $reg=array(); if (preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i', $time, $reg)) // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000 @@ -1821,6 +1822,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang $ret=adodb_strftime($format, $timetouse, $to_gmt); } else $ret='Bad value '.$time.' for date'; + + } if (preg_match('/__b__/i', $format)) From ddc0547eda2f3764f6eef1bb9d3b647c5f2ff369 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Mar 2020 13:31:19 +0100 Subject: [PATCH 7/8] Fix position of button --- htdocs/fourn/card.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 9056d1217ca..162a8363917 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -808,16 +808,6 @@ if ($object->id > 0) } } - if ($user->rights->fournisseur->facture->creer) - { - $langs->load("bills"); - if ($object->status == 1) { - print ''.$langs->trans("AddBill").''; - } else { - print ''.$langs->trans("AddBill").''; - } - } - if ($user->rights->fournisseur->facture->creer) { if (!empty($orders2invoice) && $orders2invoice > 0) @@ -835,6 +825,16 @@ if ($object->id > 0) else print ''; } + if ($user->rights->fournisseur->facture->creer) + { + $langs->load("bills"); + if ($object->status == 1) { + print ''.$langs->trans("AddBill").''; + } else { + print ''.$langs->trans("AddBill").''; + } + } + // Add action if (!empty($conf->agenda->enabled) && !empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status == 1) { From 55dc3d36acd0cd1551658e6c7bba24af94d2033e Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Wed, 4 Mar 2020 14:50:10 +0100 Subject: [PATCH 8/8] fix broken categories on "contacts" tab of project --- htdocs/projet/contact.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index cf94b1a5354..a724a88c7c4 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -19,7 +19,7 @@ /** * \file htdocs/projet/contact.php * \ingroup project - * \brief Onglet de gestion des contacts du projet + * \brief List of all contacts of a project */ require '../main.inc.php'; @@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +if ($conf->categorie->enabled) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } // Load translation files required by the page $langs->loadLangs(array('projects', 'companies'));