From 5453e3b3b26b406377590f646b01e7bedb3fefc0 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Jul 2021 08:35:03 +0200 Subject: [PATCH 01/29] Security --- htdocs/expensereport/class/paymentexpensereport.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index a453b810e6a..6e3e8d34137 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -169,7 +169,7 @@ class PaymentExpenseReport extends CommonObject $sql .= " VALUES ($this->fk_expensereport, '".$this->db->idate($now)."',"; $sql .= " '".$this->db->idate($this->datepaid)."',"; $sql .= " ".price2num($totalamount).","; - $sql .= " ".$this->fk_typepayment.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', ".$user->id.","; + $sql .= " ".((int) $this->fk_typepayment).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', ".((int) $user->id).","; $sql .= " 0)"; dol_syslog(get_class($this)."::create", LOG_DEBUG); From 467ecb4a64e7568e5681e16c20fd5f5b79ecaa9c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Jul 2021 21:21:09 +0200 Subject: [PATCH 02/29] ChangeLog --- ChangeLog | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index f439186f5ca..5b296aa88e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,7 +7,7 @@ English Dolibarr ChangeLog For users: ---------- -NEW: Module Recruitement to follow application to job positions is now stable. +NEW: Module Recruitment to follow application to job positions is now stable. NEW: Feature to make Stock Inventories NEW: Several security issues after a second private bug hunting campaign. NEW: A lot of fix into english text after a small proofreading campaign (still not perfect, but really better) @@ -50,7 +50,7 @@ NEW: Make public bookmarks editable by admin users only NEW: If main logo not defined, can use the squarred logo on login page NEW: The manifest file can use the squared image if available NEW: Enhance the multicurrency rate editor -NEW: Normalyse Type company field with ajax combobox +NEW: Normalise Type company field with ajax combobox NEW: preload product description on selection for customer propal/order/invoice NEW: Search usergroups & resources NEW: Setup Page for module creation with module builder enhancement #FoundationFunding @@ -67,14 +67,15 @@ NEW: #16378 more E-Mail Contact substitution Values for better salutation NEW: option to keep the "Automatically create the payment" checkbox empty on the tax creation page Accountancy -NEW: Accountancy - Add FEC import -NEW: Accountancy - Add a confirmation form with options on export -NEW: Accountancy - Add select date from/to in already bind customer and supplier list -NEW: Accountancy - Format FEC - Add new field DateLimitReglmt -NEW: Accountancy - In ledger & journals, show link on bank transaction -NEW: Accountancy - Possibility to filter on journals in balance -NEW: Accountancy - Add a page to list subledger accounts -NEW: Multiselect ledger account code filter on book keeping list +NEW: Add FEC import +NEW: Add a confirmation form with options on export (for notified export and validate operations) +NEW: Add select date from/to in already bind customer and supplier list +NEW: FEC / FEC2 export - Add new field DateLimitReglmt +NEW: In ledger & journals, show link on bank transaction +NEW: Possibility to filter on journals in balance +NEW: Add a page to list subledger accounts +NEW: Multiselect journal code filter on journal / balance / ledger +NEW: Add first step to close fiscal year Agenda NEW: add support for Friday as a non working day @@ -93,7 +94,7 @@ NEW: can filter files in ECM/GED on status Shared / Not shared NEW: add a check to avoid an invoice date in the future NEW: add the total of margin in invoice list NEW: can set a percentage when creating an invoice from another object -NEW: Support down payment on supplier invoice (& somes ajustments) +NEW: Support down payment on supplier invoice (& some adjustments) Margin NEW: add the total of margin in invoice list @@ -162,7 +163,7 @@ NEW: Add a security center page with all information and advices related to the NEW: Add a performance center page with all information and advices related to the performance of your instance Modules -NEW: Module Recruitement is now stable +NEW: Module Recruitment is now stable NEW: start new experimental module Event Organization Management NEW: start new experimental module Partnership Management NEW: start new experimental module Knowledge Management @@ -171,11 +172,14 @@ NEW: Check update availability for externals modules using a button on module pa Module SimplePOS is deprecated - TakePOS is recommended for the future new Options -NEW: add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared -NEW: add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared -NEW: add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs -NEW: add option SOCIETE_DISABLE_WORKFORCE to hide staff field -NEW: add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug" +NEW: add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared +NEW: add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared +NEW: add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs +NEW: add option SOCIETE_DISABLE_WORKFORCE to hide staff field +NEW: add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug" +NEW: add constant ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY to manage binding with accountancy account declared on thirdparty card +NEW: add constant MAIN_PRODUCT_PERENTITY_SHARED to manage some informations (Accounting account) when product is shared on several entities +NEW: add constant MAIN_COMPANY_PERENTITY_SHARED to manage some informations (Accounting account) when company is shared on several entities For developers: @@ -209,7 +213,7 @@ NEW: hook printFieldListTitle for cabyprodserv.php NEW: hook to allow external modules to add their own shortlist of recent objects NEW: SQL-altering hooks in the turnover by product report NEW: add form confirm hook on company card -NEW: add hook addSectionECMAuto method to add custom diretory into ECM auto files +NEW: add hook addSectionECMAuto method to add custom directory into ECM auto files WARNING: @@ -224,7 +228,7 @@ Following changes may create regressions for some external modules, but were nec * If your database is PostgreSQL, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT) * If your database is MySQL or MariaDB, you need at least version 5.1 * Function set_price_level() has been renamed into setPriceLevel() to follow camelcase rules -* removed deprecated subtituion key __REFCLIENT__ (replaced with __REF_CLIENT__) +* removed deprecated substitution key __REFCLIENT__ (replaced with __REF_CLIENT__) * Removed constant MAIN_COUNTRIES_IN_EEC. You can now set if country is in Europe or not from the dictionary of countries. From 84e5773de855909a6df12eb7015c59ef8210d514 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Jul 2021 22:37:20 +0200 Subject: [PATCH 03/29] FIX: Accountancy - Search date on journal --- htdocs/accountancy/bookkeeping/list.php | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index a70bb710937..e329a7979f4 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -366,42 +366,42 @@ if (empty($reshook)) { if (!empty($search_date_creation_start)) { $filter['t.date_creation>='] = $search_date_creation_start; $tmp = dol_getdate($search_date_creation_start); - $param .= '&date_creation_startmonth='.urlencode($tmp['mon']).'&date_creation_startday='.urlencode($tmp['mday']).'&date_creation_startyear='.urlencode($tmp['year']); + $param .= '&search_date_creation_startmonth='.urlencode($tmp['mon']).'&search_date_creation_startday='.urlencode($tmp['mday']).'&search_date_creation_startyear='.urlencode($tmp['year']); } if (!empty($search_date_creation_end)) { $filter['t.date_creation<='] = $search_date_creation_end; $tmp = dol_getdate($search_date_creation_end); - $param .= '&date_creation_endmonth='.urlencode($tmp['mon']).'&date_creation_endday='.urlencode($tmp['mday']).'&date_creation_endyear='.urlencode($tmp['year']); + $param .= '&search_date_creation_endmonth='.urlencode($tmp['mon']).'&search_date_creation_endday='.urlencode($tmp['mday']).'&search_date_creation_endyear='.urlencode($tmp['year']); } if (!empty($search_date_modification_start)) { $filter['t.tms>='] = $search_date_modification_start; $tmp = dol_getdate($search_date_modification_start); - $param .= '&date_modification_startmonth='.urlencode($tmp['mon']).'&date_modification_startday='.urlencode($tmp['mday']).'&date_modification_startyear='.urlencode($tmp['year']); + $param .= '&search_date_modification_startmonth='.urlencode($tmp['mon']).'&search_date_modification_startday='.urlencode($tmp['mday']).'&search_date_modification_startyear='.urlencode($tmp['year']); } if (!empty($search_date_modification_end)) { $filter['t.tms<='] = $search_date_modification_end; $tmp = dol_getdate($search_date_modification_end); - $param .= '&date_modification_endmonth='.urlencode($tmp['mon']).'&date_modification_endday='.urlencode($tmp['mday']).'&date_modification_endyear='.urlencode($tmp['year']); + $param .= '&search_date_modification_endmonth='.urlencode($tmp['mon']).'&search_date_modification_endday='.urlencode($tmp['mday']).'&search_date_modification_endyear='.urlencode($tmp['year']); } if (!empty($search_date_export_start)) { $filter['t.date_export>='] = $search_date_export_start; $tmp = dol_getdate($search_date_export_start); - $param .= '&date_export_startmonth='.urlencode($tmp['mon']).'&date_export_startday='.urlencode($tmp['mday']).'&date_export_startyear='.urlencode($tmp['year']); + $param .= '&search_date_export_startmonth='.urlencode($tmp['mon']).'&search_date_export_startday='.urlencode($tmp['mday']).'&search_date_export_startyear='.urlencode($tmp['year']); } if (!empty($search_date_export_end)) { $filter['t.date_export<='] = $search_date_export_end; $tmp = dol_getdate($search_date_export_end); - $param .= '&date_export_endmonth='.urlencode($tmp['mon']).'&date_export_endday='.urlencode($tmp['mday']).'&date_export_endyear='.urlencode($tmp['year']); + $param .= '&search_date_export_endmonth='.urlencode($tmp['mon']).'&search_date_export_endday='.urlencode($tmp['mday']).'&search_date_export_endyear='.urlencode($tmp['year']); } if (!empty($search_date_validation_start)) { $filter['t.date_validated>='] = $search_date_validation_start; $tmp = dol_getdate($search_date_validation_start); - $param .= '&date_validation_startmonth='.urlencode($tmp['mon']).'&date_validation_startday='.urlencode($tmp['mday']).'&date_validation_startyear='.urlencode($tmp['year']); + $param .= '&search_date_validation_startmonth='.urlencode($tmp['mon']).'&search_date_validation_startday='.urlencode($tmp['mday']).'&search_date_validation_startyear='.urlencode($tmp['year']); } if (!empty($search_date_validation_end)) { $filter['t.date_validated<='] = $search_date_validation_end; $tmp = dol_getdate($search_date_validation_end); - $param .= '&date_validation_endmonth='.urlencode($tmp['mon']).'&date_validation_endday='.urlencode($tmp['mday']).'&date_validation_endyear='.urlencode($tmp['year']); + $param .= '&search_date_validation_endmonth='.urlencode($tmp['mon']).'&search_date_validation_endday='.urlencode($tmp['mday']).'&search_date_validation_endyear='.urlencode($tmp['year']); } if (!empty($search_debit)) { $filter['t.debit'] = $search_debit; @@ -904,10 +904,10 @@ print $hookmanager->resPrint; if (!empty($arrayfields['t.date_creation']['checked'])) { print ''; print '
'; - print $form->selectDate($search_date_creation_start, 'date_creation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print $form->selectDate($search_date_creation_start, 'search_date_creation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); print '
'; print '
'; - print $form->selectDate($search_date_creation_end, 'date_creation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print $form->selectDate($search_date_creation_end, 'search_date_creation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); print '
'; print ''; } @@ -915,10 +915,10 @@ if (!empty($arrayfields['t.date_creation']['checked'])) { if (!empty($arrayfields['t.tms']['checked'])) { print ''; print '
'; - print $form->selectDate($search_date_modification_start, 'date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print $form->selectDate($search_date_modification_start, 'search_date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); print '
'; print '
'; - print $form->selectDate($search_date_modification_end, 'date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); print '
'; print ''; } @@ -926,10 +926,10 @@ if (!empty($arrayfields['t.tms']['checked'])) { if (!empty($arrayfields['t.date_export']['checked'])) { print ''; print '
'; - print $form->selectDate($search_date_export_start, 'date_export_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print $form->selectDate($search_date_export_start, 'search_date_export_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); print '
'; print '
'; - print $form->selectDate($search_date_export_end, 'date_export_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print $form->selectDate($search_date_export_end, 'search_date_export_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); print '
'; print ''; } @@ -937,10 +937,10 @@ if (!empty($arrayfields['t.date_export']['checked'])) { if (!empty($arrayfields['t.date_validated']['checked'])) { print ''; print '
'; - print $form->selectDate($search_date_validation_start, 'date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print $form->selectDate($search_date_validation_start, 'search_date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); print '
'; print '
'; - print $form->selectDate($search_date_validation_end, 'date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print $form->selectDate($search_date_validation_end, 'search_date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); print '
'; print ''; } From 183d413b4529418a74920bb11f95077cf05f8750 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 26 Jul 2021 04:42:35 +0200 Subject: [PATCH 04/29] FIX: Accountancy - Rules to delete & modify transaction not applied in ledger & subledger --- htdocs/accountancy/bookkeeping/card.php | 4 ++-- htdocs/accountancy/bookkeeping/list.php | 2 +- htdocs/accountancy/bookkeeping/listbyaccount.php | 8 +++++--- htdocs/accountancy/bookkeeping/listbysubaccount.php | 8 +++++--- htdocs/accountancy/class/bookkeeping.class.php | 1 + 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 4c7194b2255..3e74cd0c212 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -683,7 +683,7 @@ if ($action == 'create') { print ''.price($line->debit).''; print ''.price($line->credit).''; - if (empty($line->date_export) || empty($line->date_validation)) { + if (empty($line->date_export) && empty($line->date_validation)) { print ''; print 'id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">'; print img_edit('', 0, 'class="marginrightonly"'); @@ -713,7 +713,7 @@ if ($action == 'create') { setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_debit, $total_credit)), 'warnings'); } - if (empty($object->date_export) || empty($object->date_validation)) { + if (empty($object->date_export) && empty($object->date_validation)) { if ($action == "" || $action == 'add') { print ''; print ''; diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index a70bb710937..ebc91ae54c7 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -1243,7 +1243,7 @@ while ($i < min($num, $limit)) { // Action column print ''; - if (empty($line->date_export) || empty($line->date_validation)) { + if (empty($line->date_export) && empty($line->date_validation)) { if ($user->rights->accounting->mouvements->creer) { print '' . img_edit() . ''; } diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 98c3f14191b..63ecc2d420b 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -852,12 +852,14 @@ while ($i < min($num, $limit)) { // Action column print ''; - if (empty($line->date_export)) { + if (empty($line->date_export) && empty($line->date_validation)) { if ($user->rights->accounting->mouvements->creer) { - print ''.img_edit().''; + print '' . img_edit() . ''; } + } + if (empty($line->date_validation)) { if ($user->rights->accounting->mouvements->supprimer) { - print '   '.img_delete().''; + print ''.img_delete().''; } } print ''; diff --git a/htdocs/accountancy/bookkeeping/listbysubaccount.php b/htdocs/accountancy/bookkeeping/listbysubaccount.php index 20899c693c6..434867112f9 100644 --- a/htdocs/accountancy/bookkeeping/listbysubaccount.php +++ b/htdocs/accountancy/bookkeeping/listbysubaccount.php @@ -866,12 +866,14 @@ while ($i < min($num, $limit)) { // Action column print ''; - if (empty($line->date_export)) { + if (empty($line->date_export) && empty($line->date_validation)) { if ($user->rights->accounting->mouvements->creer) { - print ''.img_edit().''; + print '' . img_edit() . ''; } + } + if (empty($line->date_validation)) { if ($user->rights->accounting->mouvements->supprimer) { - print '   '.img_delete().''; + print ''.img_delete().''; } } print ''; diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 6bd39f4e227..aeaa42154d8 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1506,6 +1506,7 @@ class BookKeeping extends CommonObject $sql = "DELETE"; $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql .= " WHERE piece_num = ".(int) $piecenum; + $sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion $sql .= " AND entity IN (".getEntity('accountancy').")"; $resql = $this->db->query($sql); From 35862cebfa10256e29b70255048ad164e908d4a4 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 26 Jul 2021 04:49:56 +0200 Subject: [PATCH 05/29] Fix card presentation --- htdocs/accountancy/bookkeeping/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 3e74cd0c212..c156a388735 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -637,6 +637,8 @@ if ($action == 'create') { print_liste_field_titre("Credit", "", "", "", "", 'class="right"'); if (empty($object->date_validation)) { print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"'); + } else { + print_liste_field_titre(""); } print "\n"; @@ -683,8 +685,8 @@ if ($action == 'create') { print ''.price($line->debit).''; print ''.price($line->credit).''; + print ''; if (empty($line->date_export) && empty($line->date_validation)) { - print ''; print 'id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">'; print img_edit('', 0, 'class="marginrightonly"'); print '  '; From a08b63d5616ed86ea6c584d2e7eb034d64941a64 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 26 Jul 2021 14:29:42 +0200 Subject: [PATCH 06/29] Fix for php 8 --- htdocs/adherents/type_translation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index 7435fc440ed..6c8f273ae77 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -157,7 +157,7 @@ $form = new Form($db); $formadmin = new FormAdmin($db); $head = member_type_prepare_head($object); -$titre = $langs->trans("MemberType".$object->type); +$titre = $langs->trans("MemberType".$object->id); // Calculate $cnt_trans $cnt_trans = 0; From cfdcad0077950e85cad569a104e09e9bfb34bf4d Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 26 Jul 2021 14:30:38 +0200 Subject: [PATCH 07/29] Update type.php --- htdocs/adherents/type.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 033592a9afc..526bb6cfa8a 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -43,6 +43,8 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); +$sall = GETPOST("filter", "alpha"); +$filter = GETPOST("sall", 'alpha'); $search_lastname = GETPOST('search_lastname', 'alpha'); $search_login = GETPOST('search_login', 'alpha'); $search_email = GETPOST('search_email', 'alpha'); From a181469ff86beba460c9b64f5275562dae3c289b Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 26 Jul 2021 14:34:45 +0200 Subject: [PATCH 08/29] Update type.php --- htdocs/adherents/type.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 526bb6cfa8a..10560d38648 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -43,8 +43,8 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$sall = GETPOST("filter", "alpha"); -$filter = GETPOST("sall", 'alpha'); +$sall = GETPOST("sall", "alpha"); +$filter = GETPOST("filter", 'alpha'); $search_lastname = GETPOST('search_lastname', 'alpha'); $search_login = GETPOST('search_login', 'alpha'); $search_email = GETPOST('search_email', 'alpha'); From d4434859391558b3d5955b6cc6e29967a35027fc Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 26 Jul 2021 14:52:24 +0200 Subject: [PATCH 09/29] Update extrafields_edit.tpl.php --- htdocs/core/tpl/extrafields_edit.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_edit.tpl.php b/htdocs/core/tpl/extrafields_edit.tpl.php index 5915fb8a633..573c81d8daa 100644 --- a/htdocs/core/tpl/extrafields_edit.tpl.php +++ b/htdocs/core/tpl/extrafields_edit.tpl.php @@ -43,7 +43,7 @@ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, print $hookmanager->resPrint; if (empty($reshook)) { $params = array(); - $params['cols'] = $parameters['colspanvalue']; + $params['cols'] =isset($parameters[ 'colspanvalue' ]) ? $parameters[ 'colspanvalue' ] : null; print $object->showOptionals($extrafields, 'edit', $params); } From 026e61f1eccc35b36e78a2ff94748c327f66c1f8 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 26 Jul 2021 14:53:06 +0200 Subject: [PATCH 10/29] Update extrafields_edit.tpl.php --- htdocs/core/tpl/extrafields_edit.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_edit.tpl.php b/htdocs/core/tpl/extrafields_edit.tpl.php index 573c81d8daa..4f35aa86bca 100644 --- a/htdocs/core/tpl/extrafields_edit.tpl.php +++ b/htdocs/core/tpl/extrafields_edit.tpl.php @@ -43,7 +43,7 @@ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, print $hookmanager->resPrint; if (empty($reshook)) { $params = array(); - $params['cols'] =isset($parameters[ 'colspanvalue' ]) ? $parameters[ 'colspanvalue' ] : null; + $params['cols'] =isset($parameters['colspanvalue']) ? $parameters['colspanvalue'] : null; print $object->showOptionals($extrafields, 'edit', $params); } From b0e2ef4a6ca30572e8d90c6117c2e1778b59da27 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 26 Jul 2021 14:53:18 +0200 Subject: [PATCH 11/29] Update extrafields_edit.tpl.php --- htdocs/core/tpl/extrafields_edit.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_edit.tpl.php b/htdocs/core/tpl/extrafields_edit.tpl.php index 4f35aa86bca..6d6b6aa8836 100644 --- a/htdocs/core/tpl/extrafields_edit.tpl.php +++ b/htdocs/core/tpl/extrafields_edit.tpl.php @@ -43,7 +43,7 @@ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, print $hookmanager->resPrint; if (empty($reshook)) { $params = array(); - $params['cols'] =isset($parameters['colspanvalue']) ? $parameters['colspanvalue'] : null; + $params['cols'] = isset($parameters['colspanvalue']) ? $parameters['colspanvalue'] : null; print $object->showOptionals($extrafields, 'edit', $params); } From 4fa72f7dfe733cbc746070f6c70cebb37d6eb7b6 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 26 Jul 2021 15:04:43 +0200 Subject: [PATCH 12/29] fix for php8 --- htdocs/societe/index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index f5a4392a0c0..cd7c1613857 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -250,7 +250,9 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA $thirdpartycateggraph .= ''; $thirdpartycateggraph .= ''; $thirdpartycateggraph .= ''; -} +} else { +$thirdpartycateggraph = ''; +} /* From 986dc9c8578680d65253564b5e3756833544709d Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 26 Jul 2021 13:06:42 +0000 Subject: [PATCH 13/29] Fixing style errors. --- htdocs/societe/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index cd7c1613857..e7d3ba09db8 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -251,8 +251,8 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA $thirdpartycateggraph .= ''; $thirdpartycateggraph .= ''; } else { -$thirdpartycateggraph = ''; -} + $thirdpartycateggraph = ''; +} /* From 36ba5c6a71ee9c3e85a4c97fc77f57416272744a Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 26 Jul 2021 15:22:50 +0200 Subject: [PATCH 14/29] Fix for php8 --- htdocs/core/actions_massactions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index cd8a3817602..cf412223838 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1473,7 +1473,7 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd $parameters['toselect'] = $toselect; $parameters['uploaddir'] = $uploaddir; $parameters['massaction'] = $massaction; -$parameters['diroutputmassaction'] = $diroutputmassaction; +$parameters['diroutputmassaction'] = isset($diroutputmassaction) ? $diroutputmassaction : null; $reshook = $hookmanager->executeHooks('doMassActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { From f83f02e4e226330b43b72ca2816bc2bda3a36c0f Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 26 Jul 2021 15:24:58 +0200 Subject: [PATCH 15/29] Fix for php8 --- htdocs/adherents/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index d669270b565..f7c4d5e4d36 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -175,7 +175,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array('socid'=>$socid); +$parameters = array('socid'=>isset($socid) ? $socid : null); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 76f0bac703cdb843c07dab05d813a9b66083e74d Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 26 Jul 2021 15:29:46 +0200 Subject: [PATCH 16/29] Fix subscription list --- htdocs/adherents/subscription/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index d3d84cb3624..5c422b4df89 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -496,7 +496,7 @@ while ($i < min($num, $limit)) { $adherent->gender = $obj->gender; $adherent->morphy = $obj->morphy; $adherent->email = $obj->email; - $adherent->typeid = $obj->type; + $adherent->typeid = $obj->fk_type; $adherent->datefin = $db->jdate($obj->datef); $typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid); From 3cb56d3ec6b593062fdea14e686a6ffe1d1b06ef Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 26 Jul 2021 15:35:31 +0200 Subject: [PATCH 17/29] Fix for php8 --- htdocs/core/tpl/massactions_pre.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 4b8680e11bb..f9c74dd7085 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -197,7 +197,7 @@ if ($massaction == 'presend') { // Allow Pre-Mass-Action hook (eg for confirmation dialog) $parameters = array( 'toselect' => $toselect, - 'uploaddir' => $uploaddir + 'uploaddir' => isset($uploaddir) ? $uploaddir : null ); $reshook = $hookmanager->executeHooks('doPreMassActions', $parameters, $object, $action); From 053d72c30693c31d93784d8ff66f301450f26cb1 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 26 Jul 2021 15:37:36 +0200 Subject: [PATCH 18/29] fix for php8 --- htdocs/adherents/subscription/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index d3d84cb3624..70b63e9d938 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -115,7 +115,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array('socid'=>$socid); +$parameters = array('socid'=>isset($socid) ? $socid : null); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 54c151916ddaca133200a593a9879aef7943f4d9 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 26 Jul 2021 15:42:43 +0200 Subject: [PATCH 19/29] Fix for php 8 --- htdocs/core/menus/standard/eldy.lib.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index c192d5e6ac6..2f36290c8d4 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1732,11 +1732,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $titleboth = $langs->trans("LeadsOrProjects"); $titlenew = $langs->trans("NewLeadOrProject"); // Leads and opportunities by default - if ($conf->global->PROJECT_USE_OPPORTUNITIES == 0) { + if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 0) { $titleboth = $langs->trans("Projects"); $titlenew = $langs->trans("NewProject"); } - if ($conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only + if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only $titleboth = $langs->trans("Leads"); $titlenew = $langs->trans("NewLead"); } @@ -1745,13 +1745,13 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->rights->projet->lire, '', $mainmenu, 'projects', 0, '', '', '', img_picto('', 'project', 'class="pictofixedwidth"')); $newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->rights->projet->creer); - if ($conf->global->PROJECT_USE_OPPORTUNITIES == 0) { + if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 0) { $newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : '').'&search_status=99', $langs->trans("List"), 1, $showmode, '', 'project', 'list'); - } elseif ($conf->global->PROJECT_USE_OPPORTUNITIES == 1) { + } elseif (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 1) { $newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $showmode, '', 'project', 'list'); $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99&search_opp_status=openedopp&contextpage=lead', $langs->trans("ListOpenLeads"), 2, $showmode); $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=notopenedopp&search_status=99&contextpage=project', $langs->trans("ListOpenProjects"), 2, $showmode); - } elseif ($conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only + } elseif (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99', $langs->trans("List"), 2, $showmode); } From 3e3751e16185c30b73ea20fc012813a524954a14 Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Tue, 27 Jul 2021 22:13:19 +0200 Subject: [PATCH 20/29] Add url field #18212 --- htdocs/install/mysql/tables/llx_adherent.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/tables/llx_adherent.sql b/htdocs/install/mysql/tables/llx_adherent.sql index 787a2b15bd7..1d3a784dd74 100644 --- a/htdocs/install/mysql/tables/llx_adherent.sql +++ b/htdocs/install/mysql/tables/llx_adherent.sql @@ -48,6 +48,7 @@ create table llx_adherent state_id integer, country integer, email varchar(255), + url varchar(255) NULL, socialnetworks text DEFAULT NULL, -- json with socialnetworks skype varchar(255), -- deprecated From 67cc58079763f6792673b70868ee5e3041199883 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 28 Jul 2021 10:45:47 +0200 Subject: [PATCH 21/29] Fix: Bad rights on inventory module --- htdocs/core/modules/modStock.class.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index c9379fb25d6..3494cb684dc 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2021 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -148,19 +149,19 @@ class modStock extends DolibarrModules $this->rights[4][4] = 'mouvement'; $this->rights[4][5] = 'creer'; + $this->rights[5][0] = 1011; + $this->rights[5][1] = 'inventoryReadPermission'; // Permission label + $this->rights[5][3] = 0; // Permission by default for new user (0/1) + $this->rights[5][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + + $this->rights[6][0] = 1012; + $this->rights[6][1] = 'inventoryCreatePermission'; // Permission label + $this->rights[6][3] = 0; // Permission by default for new user (0/1) + $this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[6][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - $this->rights[5][0] = 1011; - $this->rights[5][1] = 'inventoryReadPermission'; // Permission label - $this->rights[5][3] = 0; // Permission by default for new user (0/1) - $this->rights[5][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - - $this->rights[6][0] = 1012; - $this->rights[6][1] = 'inventoryCreatePermission'; // Permission label - $this->rights[6][3] = 0; // Permission by default for new user (0/1) - $this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[6][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[8][0] = 1014; $this->rights[8][1] = 'inventoryValidatePermission'; // Permission label $this->rights[8][3] = 0; // Permission by default for new user (0/1) From 84d221988f777bced8372e3f486d6217e79658d8 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 28 Jul 2021 11:17:07 +0200 Subject: [PATCH 22/29] fix: add hook addMoreActionButton product price --- htdocs/product/price.php | 45 +++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index aad0311502d..bb46839e588 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1108,34 +1108,41 @@ print dol_get_fiche_end(); /* * Action bar */ + + if (!$action || $action == 'delete' || $action == 'showlog_customer_price' || $action == 'showlog_default_price' || $action == 'add_customer_price' || $action == 'activate_price_by_qty' || $action == 'disable_price_by_qty') { print "\n".'
'."\n"; - if ($object->isVariant()) { - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; - } - } else { - if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; - } - } - if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been + if (empty($reshook)) { + if ($object->isVariant()) { if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + print ''; } - } - - if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + } else { + if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } } - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + } + + if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } } } } From 2980cd9ab2e9cf1e2fa68b78fdf22ea5784d340d Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 28 Jul 2021 11:19:21 +0200 Subject: [PATCH 23/29] Fix: Price level on company list not filtering --- htdocs/societe/list.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 5935ac43b70..85da1594179 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -94,7 +94,7 @@ $search_categ_cus = trim(GETPOST("search_categ_cus", 'int')); $search_categ_sup = trim(GETPOST("search_categ_sup", 'int')); $search_country = GETPOST("search_country", 'intcomma'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); -$search_price_level = GETPOST('search_prive_level', 'int'); +$search_price_level = GETPOST('search_price_level', 'int'); $search_staff = GETPOST("search_staff", 'int'); $search_status = GETPOST("search_status", 'int'); $search_type = GETPOST('search_type', 'alpha'); @@ -356,7 +356,7 @@ if (empty($reshook)) { $search_idprof6 = ''; $search_vat = ''; $search_type = ''; - $search_prive_level = ''; + $search_price_level = ''; $search_type_thirdparty = ''; $search_staff = ''; $search_status = -1; @@ -639,8 +639,8 @@ if ($search_status != '' && $search_status >= 0) { if (!empty($conf->barcode->enabled) && $search_barcode) { $sql .= natural_search("s.barcode", $search_barcode); } -if ($search_prive_level && $search_prive_level != '-1') { - $sql .= natural_search("s.price_level", $search_prive_level, 2); +if ($search_price_level && $search_price_level != '-1') { + $sql .= natural_search("s.price_level", $search_price_level, 2); } if ($search_type_thirdparty && $search_type_thirdparty > 0) { $sql .= natural_search("s.fk_typent", $search_type_thirdparty, 2); @@ -813,8 +813,8 @@ if ($search_idprof6 != '') { if ($search_vat != '') { $param .= '&search_vat='.urlencode($search_vat); } -if ($search_prive_level != '') { - $param .= '&search_prive_level='.urlencode($search_prive_level); +if ($search_price_level != '') { + $param .= '&search_price_level='.urlencode($search_price_level); } if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); @@ -1094,7 +1094,7 @@ if (!empty($arrayfields['typent.code']['checked'])) { // Multiprice level if (!empty($arrayfields['s.price_level']['checked'])) { print ''; - print ''; + print ''; print ''; } // Staff From aae64eee1e1dda07a69f7efb6aa5f0ca74c37971 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 28 Jul 2021 11:48:38 +0200 Subject: [PATCH 24/29] Fix: Not correct redirect link on lots --- htdocs/product/stock/productlot_list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 58e5bd055f1..78a18ca960b 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018-2021 Ferran Marcet * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -299,7 +299,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; - header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$id); + header("Location: ".DOL_URL_ROOT.'/product/stock/productlot_card.php?id='.$id); exit; } From 95ecbb89407e07b8469cdef34cbd45bbce575ccc Mon Sep 17 00:00:00 2001 From: kamel Date: Wed, 28 Jul 2021 12:05:46 +0200 Subject: [PATCH 25/29] FIX: add include missing file '/core/actions_dellink.inc.php' in project card --- htdocs/projet/card.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 3c2d5b02829..00c5bb781b2 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -89,6 +89,8 @@ $socid = GETPOST('socid', 'int'); //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. restrictedArea($user, 'projet', $object->id, 'projet&project'); +$permissiondellink = $user->rights->projet->creer; // Used by the include of actions_dellink.inc.php + /* * Actions @@ -121,6 +123,8 @@ if (empty($reshook)) { $action = ''; } + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + if ($action == 'add' && $user->rights->projet->creer) { $error = 0; if (!GETPOST('ref')) { From 2054cca6e5606e00869f06c12f76b6890a6215fd Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Wed, 28 Jul 2021 15:14:18 +0200 Subject: [PATCH 26/29] FIX #18267 --- htdocs/bom/bom_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 76f16c838be..2cd7492395d 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -297,7 +297,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.' ' : ''); } } // Add fields from hooks From df8f09985797a38747e939545012ec1e13ab7fc7 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 28 Jul 2021 15:57:12 +0200 Subject: [PATCH 27/29] Fix a bug in ecm for v14 --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 110d80b45d1..2b8a2d15aff 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1182,7 +1182,7 @@ class FormFile ); $reshook = $hookmanager->executeHooks('showFilesList', $parameters, $object); - if (isset($reshook) && $reshook != '') { // null or '' for bypass + if (!empty($reshook)) { // null or '' for bypass return $reshook; } else { if (!is_object($form)) { From f8563ace0d9bb81ebb89f7302f88450bc242777a Mon Sep 17 00:00:00 2001 From: laurantines Date: Wed, 28 Jul 2021 16:14:38 +0200 Subject: [PATCH 28/29] Fix opp statusbrequires even if PROJECT_USE_OPPORTUNITIES off If I modify a project and do not have PROJECT_USE_OPPORTUNITIES enabled, I cannot change the project budget. I get the error message that ErrorOppStatusRequiredIfAmount. However, I do not have the opportunities enabled and it does not make sense for that message to appear when I have not added any opportunities. --- htdocs/projet/card.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 00c5bb781b2..4ee23fd632b 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -136,9 +136,11 @@ if (empty($reshook)) { $error++; } - if (GETPOST('opp_amount') != '' && !(GETPOST('opp_status') > 0)) { - $error++; - setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors'); + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + if (GETPOST('opp_amount') != '' && !(GETPOST('opp_status') > 0)) { + $error++; + setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors'); + } } // Create with status validated immediatly @@ -274,9 +276,11 @@ if (empty($reshook)) { } } - if ($object->opp_amount && ($object->opp_status <= 0)) { - $error++; - setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors'); + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + if ($object->opp_amount && ($object->opp_status <= 0)) { + $error++; + setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors'); + } } if (!$error) { From f6d03fe28ef943906d824b3aaf8db11abf2af9d2 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 28 Jul 2021 21:45:11 +0200 Subject: [PATCH 29/29] Fix update product lot --- htdocs/product/stock/class/productlot.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 52322cf4697..360978ac736 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -402,7 +402,7 @@ class Productlot extends CommonObject $sql .= ' sellby = '.(!isset($this->sellby) || dol_strlen($this->sellby) != 0 ? "'".$this->db->idate($this->sellby)."'" : 'null').','; $sql .= ' eol_date = '.(!isset($this->eol_date) || dol_strlen($this->eol_date) != 0 ? "'".$this->db->idate($this->eol_date)."'" : 'null').','; $sql .= ' manufacturing_date = '.(!isset($this->manufacturing_date) || dol_strlen($this->manufacturing_date) != 0 ? "'".$this->db->idate($this->manufacturing_date)."'" : 'null').','; - $sql .= ' scrapping_date = '.(!isset($this->destruction_date) || dol_strlen($this->destruction_date) != 0 ? "'".$this->db->idate($this->destruction_date)."'" : 'null').','; + $sql .= ' scrapping_date = '.(!isset($this->scrapping_date) || dol_strlen($this->scrapping_date) != 0 ? "'".$this->db->idate($this->scrapping_date)."'" : 'null').','; //$sql .= ' commissionning_date = '.(!isset($this->first_use_date) || dol_strlen($this->first_use_date) != 0 ? "'".$this->db->idate($this->first_use_date)."'" : 'null').','; //$sql .= ' qc_frequency = '.(!isset($this->qc_frequency) || dol_strlen($this->qc_frequency) != 0 ? "'".$this->db->escape($this->qc_frequency)."'" : 'null').','; $sql .= ' datec = '.(!isset($this->datec) || dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').',';