From 8772c53723ed13e655deba058aceb9f7fa1a531a Mon Sep 17 00:00:00 2001 From: atm-arnaud Date: Wed, 30 Jun 2021 12:37:21 +0200 Subject: [PATCH 01/17] FIX deposit can create credit note in payment conf --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 31c42e5ba9e..e15b2722800 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5260,7 +5260,7 @@ elseif ($id > 0 || !empty($ref)) } // Create a credit note - if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut > 0 && $usercancreate) + if (($object->type == Facture::TYPE_STANDARD || ($object->type == Facture::TYPE_DEPOSIT && empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) ) || $object->type == Facture::TYPE_PROFORMA) && $object->statut > 0 && $usercancreate) { if (!$objectidnext) { From bf7f8f7c459c6988d41db1d9ba21aa1204969175 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Jun 2021 17:28:23 +0200 Subject: [PATCH 02/17] Fix phpcs --- htdocs/core/lib/functions.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 33a073920ff..28c553d747c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10321,7 +10321,8 @@ function showValueWithClipboardCPButton($valuetocopy, $showonlyonhover = 1, $tex /** * Decode an encode string. The string can be encoded in json format (recommended) or with serialize (avoid this) * - * @param string $stringtodecode String to decode (json or serialize coded) + * @param string $stringtodecode String to decode (json or serialize coded) + * @return mixed The decoded object. */ function jsonOrUnserialize($stringtodecode) { From 4cff865c6b09c994d13d3d759c59e9abc6666dab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Jun 2021 18:22:40 +0200 Subject: [PATCH 03/17] Trans --- htdocs/admin/clicktodial.php | 11 ++++++++--- htdocs/core/modules/modClickToDial.class.php | 5 +++-- htdocs/langs/en_US/admin.lang | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 7b1c94de1ec..25ada4d2d89 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2020 Laurent Destailleur + * Copyright (C) 2005-2021 Laurent Destailleur * Copyright (C) 2011-2013 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -20,7 +20,7 @@ /** * \file htdocs/admin/clicktodial.php * \ingroup clicktodial - * \brief Page to setup module clicktodial + * \brief Page to setup module ClickToDial */ require '../main.inc.php'; @@ -99,7 +99,12 @@ print ''; -print $langs->trans("Example").':
http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__'; +print '
'; +print ''; +print $langs->trans("Example").':
'; +print 'http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__
'; +print 'sip:__PHONETO__@my.sip.server'; +print '
'; //if (! empty($user->clicktodial_url)) //{ diff --git a/htdocs/core/modules/modClickToDial.class.php b/htdocs/core/modules/modClickToDial.class.php index f28659bbd5d..18f1e6befeb 100644 --- a/htdocs/core/modules/modClickToDial.class.php +++ b/htdocs/core/modules/modClickToDial.class.php @@ -18,7 +18,7 @@ /** * \defgroup clicktodial Module clicktodial - * \brief Module pour gerer l'appel automatique + * \brief Module to manage a ClickToDial system * \file htdocs/core/modules/modClickToDial.class.php * \ingroup clicktodial * \brief Description and activation file for the module Click to Dial @@ -46,7 +46,8 @@ class modClickToDial extends DolibarrModules $this->family = "interface"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); - $this->description = "Gestion du Click To Dial"; + $this->description = "Integration of a ClickToDial system (Asterisk, ...)"; + $this->descriptionlong = "Support a Click To Dial feature with a SIP system. When clicking on a phone number, your phone system automatically call the callee."; $this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a05c9e7ea97..0fef25c033a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1778,7 +1778,7 @@ ClickToDialSetup=Click To Dial module setup ClickToDialUrlDesc=Url called when a click on phone picto is done. In URL, you can use tags
__PHONETO__ that will be replaced with the phone number of person to call
__PHONEFROM__ that will be replaced with phone number of calling person (yours)
__LOGIN__ that will be replaced with clicktodial login (defined on user card)
__PASS__ that will be replaced with clicktodial password (defined on user card). ClickToDialDesc=This module change phone numbers, when using a desktop computer, into clickable links. A click will call the number. This can be used to start the phone call when using a soft phone on your desktop or when using a CTI system based on SIP protocol for example. Note: When using a smartphone, phone numbers are always clickable. ClickToDialUseTelLink=Use just a link "tel:" on phone numbers -ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface, installed on the same computer as the browser, and called when you click on a link starting with "tel:" in your browser. If you need link that start with "sip:" or a full server solution (no need of local software installation), you must set this to "No" and fill next field. ##### Point Of Sale (CashDesk) ##### CashDesk=Point of Sale CashDeskSetup=Point of Sales module setup From 1de165a6cdea46a4d4765252e657d3f9c2d828d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Jun 2021 18:34:04 +0200 Subject: [PATCH 04/17] css --- htdocs/projet/element.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index a6e3af11979..7fcfe3bc92b 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -1030,7 +1030,7 @@ foreach ($listofreferent as $key => $value) { $addform .= ''; $addform .= ''; $addform .= ''; - $addform .= ''; + $addform .= ''; $addform .= '
'.$langs->trans("SelectElement").''.$selectList.'
'; $addform .= ''; $addform .= ''; @@ -1039,7 +1039,7 @@ foreach ($listofreferent as $key => $value) { if (empty($conf->global->PROJECT_CREATE_ON_OVERVIEW_DISABLED) && $urlnew) { $addform .= '
'; if ($testnew) { - $addform .= ''.($buttonnew ? $langs->trans($buttonnew) : $langs->trans("Create")).''; + $addform .= ''.($buttonnew ? $langs->trans($buttonnew) : $langs->trans("Create")).''; } elseif (empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { $addform .= ''.($buttonnew ? $langs->trans($buttonnew) : $langs->trans("Create")).''; } From 5b34ea6c228210fd613d5f813d94e32f2030ebce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Jul 2021 03:06:40 +0200 Subject: [PATCH 05/17] FIX permission to close a proposal when using advanced permissions --- htdocs/comm/propal/card.php | 11 ++++++++--- htdocs/comm/propal/list.php | 6 +++++- htdocs/core/modules/modPropale.class.php | 3 ++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 175486dcca0..c220e1f320d 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2520,9 +2520,14 @@ if ($action == 'create') } // Close as accepted/refused - if ($object->statut == Propal::STATUS_VALIDATED && $usercanclose) { - print 'global->MAIN_JUMP_TAG) ? '' : '#close').'"'; - print '>'.$langs->trans('SetAcceptedRefused').''; + if ($object->statut == Propal::STATUS_VALIDATED) { + if ($usercanclose) { + print 'global->MAIN_JUMP_TAG) ? '' : '#close').'"'; + print '>'.$langs->trans('SetAcceptedRefused').''; + } else { + print ''.$langs->trans('SetAcceptedRefused').''; + } } // Clone diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index fcd8f067e01..e5700fca445 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -114,7 +114,11 @@ if (!$sortorder) $sortorder = 'DESC'; $permissiontoread = $user->rights->propal->lire; $permissiontoadd = $user->rights->propal->write; $permissiontodelete = $user->rights->propal->supprimer; -$permissiontoclose = $user->rights->propal->cloturer; +if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { + $permissiontoclose = $user->rights->propale->propal_advance->close; +} else { + $permissiontoclose = $user->rights->propal->creer; +} // Security check $module = 'propal'; diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index c0ffa6f0811..9b40a236511 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -157,7 +157,8 @@ class modPropale extends DolibarrModules $this->rights[$r][1] = 'Close commercial proposals'; // libelle de la permission $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut - $this->rights[$r][4] = 'cloturer'; + $this->rights[$r][4] = 'propal_advance'; + $this->rights[$r][5] = 'close'; $r++; $this->rights[$r][0] = 27; // id de la permission From 9392624e54d301fc0b36690ef201c292677410f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Jul 2021 13:36:04 +0200 Subject: [PATCH 06/17] Fix deletion of line on replacement invoice --- htdocs/core/tpl/objectline_view.tpl.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 428fac31789..3463de14240 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -315,6 +315,15 @@ if ($outputalsopricetotalwithtax) { } if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') { + + $situationinvoicelinewithparent = 0; + if ($line->fk_prev_id != null && in_array($object->element, array('facture', 'facturedet'))) { + if ($object->type == $object::TYPE_SITUATION) { // The constant TYPE_SITUATION exists only for object invoice + // Set constant to disallow editing during a situation cycle + $situationinvoicelinewithparent = 1; + } + } + print ''; $coldisplay++; if (($line->info_bits & 2) == 2 || !empty($disableedit)) { @@ -326,7 +335,7 @@ if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') { print ''; $coldisplay++; - if (($line->fk_prev_id == null) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation + if (!$situationinvoicelinewithparent && empty($disableremove)) { // For situation invoice, deletion is not possible if there is a parent company. print 'id.'">'; print img_delete(); print ''; From 3aa24cccffd35d1a087be7f909023c9389e93df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 1 Jul 2021 15:15:35 +0200 Subject: [PATCH 07/17] fix can't remove extrafield date or datetime value --- htdocs/core/class/commonobject.class.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 91c09f1226a..417cb3042b7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5739,10 +5739,12 @@ abstract class CommonObject $this->array_options["options_".$key] = price2num($this->array_options["options_".$key]); break; case 'date': - $this->array_options["options_".$key] = $this->db->idate($this->array_options["options_".$key]); - break; case 'datetime': - $this->array_options["options_".$key] = $this->db->idate($this->array_options["options_".$key]); + if (empty($this->array_options["options_".$key])) { + $this->array_options["options_".$key] = null; + } else { + $this->array_options["options_".$key] = $this->db->idate($this->array_options["options_".$key]); + } break; /* case 'link': @@ -5790,7 +5792,11 @@ abstract class CommonObject } if ($linealreadyfound) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = '".$this->db->escape($this->array_options["options_".$key])."'"; + if ($this->array_options["options_".$key] === null) { + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = null"; + } else { + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = '".$this->db->escape($this->array_options["options_".$key])."'"; + } $sql .= " WHERE fk_object = ".$this->id; } else { $result = $this->insertExtraFields('', $user); From 664af6ad1f10d9e6200acfb40fbabb531787c126 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Jul 2021 18:22:33 +0200 Subject: [PATCH 08/17] Fix trans --- htdocs/langs/en_US/salaries.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/salaries.lang b/htdocs/langs/en_US/salaries.lang index 6b4fdc94163..cc28f87d883 100644 --- a/htdocs/langs/en_US/salaries.lang +++ b/htdocs/langs/en_US/salaries.lang @@ -20,5 +20,5 @@ TJMDescription=This value is currently for information only and is not used for LastSalaries=Latest %s salary payments AllSalaries=All salary payments SalariesStatistics=Salary statistics -# Export SalariesAndPayments=Salaries and payments +ConfirmDeleteSalaryPayment=Do you want to delete this payment of salary ? \ No newline at end of file From 414da8345649384f5a959b99f7a7afd42760414b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Jul 2021 18:45:07 +0200 Subject: [PATCH 09/17] Fix colspan --- htdocs/salaries/payments.php | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index bfc795ebcef..c2805cfbd93 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -124,6 +124,22 @@ foreach ($object->fields as $key => $val) { } } +// Definition of array of fields for columns +$arrayfields = array(); +foreach ($object->fields as $key => $val) { + // If $val['visible']==0, then we never show the field + if (!empty($val['visible'])) { + $visible = (int) dol_eval($val['visible'], 1); + $arrayfields['t.'.$key] = array( + 'label'=>$val['label'], + 'checked'=>(($visible < 0) ? 0 : 1), + 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'position'=>$val['position'], + 'help'=>$val['help'] + ); + } +} + $permissiontoread = $user->rights->salaries->read; $permissiontoadd = $user->rights->salaries->write; $permissiontodelete = $user->rights->salaries->delete; @@ -666,11 +682,13 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; // If no record found if ($num == 0) { - $colspan = 1; - foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) { + /*$colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { $colspan++; - } - } + } + }*/ + $colspan = 12; print ''.$langs->trans("NoRecordFound").''; } From 0dce34f52776141f69e534becc05c9fcc98faec1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Jul 2021 19:06:16 +0200 Subject: [PATCH 10/17] Fix trans --- htdocs/langs/en_US/salaries.lang | 6 +++--- htdocs/salaries/class/salary.class.php | 3 +++ htdocs/user/bank.php | 29 ++++++++++++-------------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/langs/en_US/salaries.lang b/htdocs/langs/en_US/salaries.lang index cc28f87d883..504f0fbcc16 100644 --- a/htdocs/langs/en_US/salaries.lang +++ b/htdocs/langs/en_US/salaries.lang @@ -17,8 +17,8 @@ TJM=Average daily rate CurrentSalary=Current salary THMDescription=This value may be used to calculate the cost of time consumed on a project entered by users if module project is used TJMDescription=This value is currently for information only and is not used for any calculation -LastSalaries=Latest %s salary payments -AllSalaries=All salary payments +LastSalaries=Latest %s salaries +AllSalaries=All salaries SalariesStatistics=Salary statistics SalariesAndPayments=Salaries and payments -ConfirmDeleteSalaryPayment=Do you want to delete this payment of salary ? \ No newline at end of file +ConfirmDeleteSalaryPayment=Do you want to delete this salary payment ? \ No newline at end of file diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index 2f87fdd99d2..35ceb8a1931 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -502,6 +502,9 @@ class Salary extends CommonObject if ($this->datesp && $this->dateep) { $label .= '
'.$langs->trans('Period').': '.dol_print_date($this->datesp, 'day').' - '.dol_print_date($this->dateep, 'day'); } + if (isset($this->amount)) { + $label .= '
'.$langs->trans('Amount').': '.price($this->amount); + } $url = DOL_URL_ROOT.'/salaries/card.php?id='.$this->id; diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 0b179653487..fc9002e13fb 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -366,12 +366,12 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac $payment_salary = new PaymentSalary($db); $salary = new Salary($db); - $sql = "SELECT s.rowid as sid, s.ref as sref, s.label, s.datesp, s.dateep, s.paye, SUM(ps.amount) as alreadypaid"; + $sql = "SELECT s.rowid as sid, s.ref as sref, s.label, s.datesp, s.dateep, s.paye, s.amount, SUM(ps.amount) as alreadypaid"; $sql .= " FROM ".MAIN_DB_PREFIX."salary as s"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."payment_salary as ps ON (s.rowid = ps.fk_salary)"; $sql .= " WHERE s.fk_user = ".$object->id; $sql .= " AND s.entity IN (".getEntity('salary').")"; - $sql .= " GROUP BY s.rowid, s.ref, s.label, s.datesp, s.dateep, s.paye"; + $sql .= " GROUP BY s.rowid, s.ref, s.label, s.datesp, s.dateep, s.paye, s.amount"; $sql .= " ORDER BY s.dateep DESC"; $resql = $db->query($sql); @@ -381,7 +381,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print ''; print ''; - print '\n"; - print ''; + print ''; print ''; $i++; } From 3c5bc3fef421b34feb50a1d30b148dc4f0b1e015 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 2 Jul 2021 11:53:32 +0200 Subject: [PATCH 11/17] fix division by zero on of create --- htdocs/mrp/class/mo.class.php | 2 +- htdocs/mrp/tpl/originproductline.tpl.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index f8ff5751221..1369741e07d 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -649,7 +649,7 @@ class Mo extends CommonObject if ($line->qty_frozen) { $moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce } else { - $moline->qty = price2num(($line->qty / $bom->qty) * $this->qty / $line->efficiency, 'MS'); // Calculate with Qty to produce and more presition + $moline->qty = price2num(($line->qty / ( ! empty($bom->qty) ? $bom->qty : 1 ) ) * $this->qty / ( ! empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and more presition } if ($moline->qty <= 0) { $error++; diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index 6f3b63f6d4e..f149a75589f 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -25,7 +25,7 @@ if (empty($conf) || !is_object($conf)) if (!is_object($form)) $form = new Form($db); -$qtytoconsumeforline = $this->tpl['qty'] / $this->tpl['efficiency']; +$qtytoconsumeforline = $this->tpl['qty'] / ( ! empty($this->tpl['efficiency']) ? $this->tpl['efficiency'] : 1 ); /*if ((empty($this->tpl['qty_frozen']) && $this->tpl['qty_bom'] > 1)) { $qtytoconsumeforline = $qtytoconsumeforline / $this->tpl['qty_bom']; }*/ From 903adadcc45df890e1b01abf1734df63e74ba928 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 2 Jul 2021 10:47:57 +0200 Subject: [PATCH 12/17] Fix Error type ent in fourn/commande/list.php --- htdocs/fourn/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index bf8e53e8b82..d1946cc9b4c 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1407,7 +1407,7 @@ if ($resql) { // Type ent if (!empty($arrayfields['typent.code']['checked'])) { print '\n"; @@ -222,8 +223,11 @@ if ($resql) { print ''; } print ''; - print ''; + print ''; print ''; + print ''; print ''; print "\n"; $i++; From bb0daa4f0d953cdc42e40755561ec81bdeaf5303 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jul 2021 18:11:01 +0200 Subject: [PATCH 16/17] Prepare v14 --- 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 777fde21885..8aa64da85f1 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '14.0.0-beta'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '14.0.0'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From 8a3b92a32dcdbe6ba3526cb8b13d388d0b1ba1a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jul 2021 18:30:58 +0200 Subject: [PATCH 17/17] Fix filter --- htdocs/holiday/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index c62185d5f2a..ece1f9c9ec7 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -117,7 +117,7 @@ $search_month_end = GETPOST('search_month_end', 'int'); $search_year_end = GETPOST('search_year_end', 'int'); $search_employee = GETPOST('search_employee', 'int'); $search_valideur = GETPOST('search_valideur', 'int'); -$search_status = GETPOST('search_status', 'int'); +$search_status = GETPOSTISSET('search_status') ? GETPOST('search_status', 'int') : GETPOST('search_statut', 'int'); $search_type = GETPOST('search_type', 'int'); // Initialize technical objects
'; + print ''; print ''; @@ -389,16 +389,17 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); - $payment_salary->id = $objp->rowid; - $payment_salary->ref = $objp->ref; - $payment_salary->datep = $db->jdate($objp->datep); - $salary->id = $objp->sid; $salary->ref = $objp->sref ? $objp->sref : $objp->sid; $salary->label = $objp->label; $salary->datesp = $db->jdate($objp->datesp); $salary->dateep = $db->jdate($objp->dateep); $salary->paye = $objp->paye; + $salary->amount = $objp->amount; + + $payment_salary->id = $objp->rowid; + $payment_salary->ref = $objp->ref; + $payment_salary->datep = $db->jdate($objp->datep); print ''; print '\n"; print '\n"; - //print ''; + print ''; print ''; print ''; @@ -416,7 +417,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac $db->free($resql); if ($num <= 0) { - print '
'.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllSalaries").''.$num.''; print '
'.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllSalaries").''.$num.'
'; @@ -407,7 +408,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print ''.dol_print_date($db->jdate($objp->datesp), 'day')."'.dol_print_date($db->jdate($objp->dateep), 'day')."'.price($objp->amount).''.price($objp->amount).''.$salary->getLibStatut(5, $objp->alreadypaid).'
'.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print "
"; } else { @@ -424,9 +425,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } } - /* - * Last holidays - */ + // Latest leave requests if (!empty($conf->holiday->enabled) && ($user->rights->holiday->readall || ($user->rights->holiday->read && $object->id == $user->id)) ) { @@ -478,9 +477,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } } - /* - * Last expense report - */ + // Latest expense report if (!empty($conf->expensereport->enabled) && ($user->rights->expensereport->readall || ($user->rights->expensereport->lire && $object->id == $user->id)) ) { @@ -516,7 +513,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print '
'; print $exp->getNomUrl(1); print ''.dol_print_date($db->jdate($objp->date_debut), 'day')."'.price($objp->total_ttc).''.price($objp->total_ttc).''.$exp->LibStatut($objp->status, 5).'
'; - if (count($typenArray) == 0) { + if (empty($typenArray)) { $typenArray = $formcompany->typent_array(1); } print $typenArray[$obj->typent_code]; From 2a30c699acf30879342fc73774f0b4eaa944f65e Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 2 Jul 2021 12:47:42 +0200 Subject: [PATCH 13/17] Fix #18063 : search filter status lost "Back to list" --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index daa943ffee9..f315661b90c 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3017,13 +3017,13 @@ class CommandeFournisseur extends CommonOrder $response->warning_delay = $conf->commande->fournisseur->warning_delay / 60 / 60 / 24; $response->label = $langs->trans("SuppliersOrdersToProcess"); $response->labelShort = $langs->trans("Opened"); - $response->url = DOL_URL_ROOT.'/fourn/commande/list.php?statut=1,2&mainmenu=commercial&leftmenu=orders_suppliers'; + $response->url = DOL_URL_ROOT.'/fourn/commande/list.php?search_status=1,2&mainmenu=commercial&leftmenu=orders_suppliers'; $response->img = img_object('', "order"); if ($mode === 'awaiting') { $response->label = $langs->trans("SuppliersOrdersAwaitingReception"); $response->labelShort = $langs->trans("AwaitingReception"); - $response->url = DOL_URL_ROOT.'/fourn/commande/list.php?statut=3,4&mainmenu=commercial&leftmenu=orders_suppliers'; + $response->url = DOL_URL_ROOT.'/fourn/commande/list.php?search_status=3,4&mainmenu=commercial&leftmenu=orders_suppliers'; } while ($obj = $this->db->fetch_object($resql)) { From e35ecdf58d4280c528eb236c629325824293b091 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jul 2021 17:58:37 +0200 Subject: [PATCH 14/17] Fix trans --- htdocs/langs/en_US/users.lang | 4 ++-- htdocs/user/group/card.php | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index a14db3882b0..841ee0f3daf 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -97,8 +97,8 @@ LoginToCreate=Login to create NameToCreate=Name of third party to create YourRole=Your roles YourQuotaOfUsersIsReached=Your quota of active users is reached ! -NbOfUsers=No. of users -NbOfPermissions=No. of permissions +NbOfUsers=Number of users +NbOfPermissions=Number of permissions DontDowngradeSuperAdmin=Only a superadmin can downgrade a superadmin HierarchicalResponsible=Supervisor HierarchicView=Hierarchical view diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 0e60e70e42a..5c1e16e4a0c 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -428,6 +428,7 @@ if ($action == 'create') { * Group members */ + print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; print ''; print ''; @@ -440,7 +441,7 @@ if ($action == 'create') { if (!empty($object->members)) { foreach ($object->members as $useringroup) { print ''; - print ''; } print "
'.$langs->trans("Login").'
'; + print ''; print $useringroup->getNomUrl(-1, '', 0, 0, 24, 0, 'login'); if ($useringroup->admin && !$useringroup->entity) { print img_picto($langs->trans("SuperAdministrator"), 'redstar'); @@ -465,6 +466,7 @@ if ($action == 'create') { print '
'.$langs->trans("None").'
"; + print '
'; } print "
"; From 7fb094602228edef5b08713a6533df36fbbb8b72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jul 2021 18:09:48 +0200 Subject: [PATCH 15/17] Fix link --- htdocs/user/class/usergroup.class.php | 10 +++++++--- htdocs/user/group/list.php | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 083b1bcc18c..1f0bb2891c6 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -711,7 +711,7 @@ class UserGroup extends CommonObject * Use this->id,this->lastname, this->firstname * * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small) - * @param string $option On what the link point to ('nolink', ) + * @param string $option On what the link point to ('nolink', 'permissions') * @param integer $notooltip 1=Disable tooltip on picto and name * @param string $morecss Add more css on link * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking @@ -730,12 +730,16 @@ class UserGroup extends CommonObject $result = ''; $label = ''; $label .= '
'; - $label .= ''.$langs->trans("Group").'
'; + $label .= img_picto('', 'group').' '.$langs->trans("Group").'
'; $label .= ''.$langs->trans('Name').': '.$this->name; $label .= '
'.$langs->trans("Description").': '.$this->note; $label .= '
'; - $url = DOL_URL_ROOT.'/user/group/card.php?id='.$this->id; + if ($option == 'permissions') { + $url = DOL_URL_ROOT.'/user/group/perms.php?id='.$this->id; + } else { + $url = DOL_URL_ROOT.'/user/group/card.php?id='.$this->id; + } if ($option != 'nolink') { // Add param to save lastsearch_values or not diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 302d697c563..493383076b0 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -122,7 +122,7 @@ if (empty($reshook)) { llxHeader(); -$sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec, COUNT(DISTINCT ugu.fk_user) as nb, COUNT(DISTINCT ugr.fk_id) as nbpermissions"; +$sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec, g.tms as datem, COUNT(DISTINCT ugu.fk_user) as nb, COUNT(DISTINCT ugr.fk_id) as nbpermissions"; $sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_usergroup = g.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_rights as ugr ON ugr.fk_usergroup = g.rowid"; @@ -137,7 +137,7 @@ if (!empty($search_group)) { if ($sall) { $sql .= natural_search(array("g.nom", "g.note"), $sall); } -$sql .= " GROUP BY g.rowid, g.nom, g.note, g.entity, g.datec"; +$sql .= " GROUP BY g.rowid, g.nom, g.note, g.entity, g.datec, g.tms"; $sql .= $db->order($sortfield, $sortorder); $resql = $db->query($sql); @@ -197,6 +197,7 @@ if ($resql) { print_liste_field_titre("NbOfUsers", $_SERVER["PHP_SELF"], "nb", $param, "", '', $sortfield, $sortorder, 'center '); print_liste_field_titre("NbOfPermissions", $_SERVER["PHP_SELF"], "nbpermissions", $param, "", '', $sortfield, $sortorder, 'center '); print_liste_field_titre("DateCreationShort", $_SERVER["PHP_SELF"], "g.datec", $param, "", '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("DateLastModification", $_SERVER["PHP_SELF"], "g.tms", $param, "", '', $sortfield, $sortorder, 'center '); print_liste_field_titre("", $_SERVER["PHP_SELF"]); print "
'.$mc->label.''.$obj->nb.''.$obj->nbpermissions.''; + print ''.$obj->nbpermissions.''; + print ''.dol_print_date($db->jdate($obj->datec), "dayhour").''.dol_print_date($db->jdate($obj->datem), "dayhour").'