From 09dfcc601638c06a47a9d0f4c50af20705642105 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Fri, 3 Aug 2018 14:54:21 +0200 Subject: [PATCH 01/22] FIX exclude element of the select --- htdocs/projet/element.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index dd19ceeb263..5952be3264d 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -697,7 +697,9 @@ foreach ($listofreferent as $key => $value) $urlnew=$value['urlnew']; $buttonnew=$value['buttonnew']; $testnew=$value['testnew']; + $exclude_select_element=array('payment_various',$value['exclude_select_element']); + if ($qualified) { // If we want the project task array to have details of users @@ -717,7 +719,7 @@ foreach ($listofreferent as $key => $value) if (! empty($conf->global->PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS)) $idtofilterthirdparty.=','.$conf->global->PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS; } - if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty && !in_array($tablename, array('payment_various'))) + if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty && !in_array($tablename,$exclude_select_element)) { $selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300'); if (! $selectList || ($selectList<0)) From ec9eeb5201c9c7bc3dfbb85e82a57c2f85f15920 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Mon, 27 Aug 2018 10:17:18 +0200 Subject: [PATCH 02/22] FIX check !empty exclude select element --- htdocs/projet/element.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 5952be3264d..03a5bfc0880 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -697,9 +697,10 @@ foreach ($listofreferent as $key => $value) $urlnew=$value['urlnew']; $buttonnew=$value['buttonnew']; $testnew=$value['testnew']; - $exclude_select_element=array('payment_various',$value['exclude_select_element']); + $exclude_select_element = array('payment_various'); + if (!empty($value['exclude_select_element'])) $exclude_select_element[] = $value['exclude_select_element']; + - if ($qualified) { // If we want the project task array to have details of users From 85bed00474c8ade3b8663064540d9775386479e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Sep 2018 11:50:04 +0200 Subject: [PATCH 03/22] Fix default fields --- htdocs/accountancy/admin/account.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 82b02a847de..da05246b05b 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -63,9 +63,9 @@ if (! $sortorder) $sortorder = "ASC"; $arrayfields=array( 'aa.account_number'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1), 'aa.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1), - 'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>0), + 'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>1), 'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>1, 'help'=>'PcgtypeDesc'), - 'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>1, 'help'=>'PcgtypeDesc'), + 'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>0, 'help'=>'PcgtypeDesc'), 'aa.active'=>array('label'=>$langs->trans("Activated"), 'checked'=>1) ); From 4580ed0b09b5de51c7add0e91ff591fa2454ded1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Sep 2018 15:31:25 +0200 Subject: [PATCH 04/22] Fix bad link --- htdocs/core/class/html.formmail.class.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 8ec31ec77bf..117bfb13769 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -940,7 +940,7 @@ class FormMail extends Form if (count($validpaymentmethod) > 0 && $paymenturl) { $langs->load('other'); - $this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__']=str_replace('\n',"\n",$langs->transnoentities("PredefinedMailContentLink", $paymenturl)); + $this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__']=str_replace('\n', "\n", $langs->transnoentities("PredefinedMailContentLink", $paymenturl)); $this->substit['__ONLINE_PAYMENT_URL__']=$paymenturl; } else diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c67596fde09..af0d7219ddc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6073,7 +6073,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $paymenturl=$url; } - $substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__']=($paymenturl?$outputlangs->trans("PredefinedMailContentLink", $paymenturl):''); + $substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__']=($paymenturl?str_replace('\n', "\n", $outputlangs->trans("PredefinedMailContentLink", $paymenturl)):''); $substitutionarray['__ONLINE_PAYMENT_URL__']=$paymenturl; } } From 99d214abd562208fae060edab5b325f2d36f6b3e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Sep 2018 16:38:51 +0200 Subject: [PATCH 05/22] Fix family of module Payment of employee salaries --- htdocs/admin/modules.php | 2 ++ htdocs/core/modules/modSalaries.class.php | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 5ba261b619e..68f7c3a29a7 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -833,6 +833,8 @@ if ($mode == 'common') dol_fiche_end(); + print '
'; + // Show warning about external users print info_admin(showModulesExludedForExternal($modules))."\n"; diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index 2c93c45f9f6..52c417c0848 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -50,7 +50,9 @@ class modSalaries extends DolibarrModules $this->db = $db; $this->numero = 510; // Perms from 501..519 - $this->family = "compta"; + // Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...' + // It is used to group modules by family in module setup page + $this->family = "financial"; // 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)); // Module description used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) From 58e82008acec43fa6ab390ce6e2e7d8851f6c4eb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Sep 2018 16:45:08 +0200 Subject: [PATCH 06/22] Prepare 8.0.2 --- ChangeLog | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/ChangeLog b/ChangeLog index c379f2dfeff..0d1bbfbf379 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,41 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + +***** ChangeLog for 8.0.2 compared to 8.0.1 ***** +FIX: #8452 +FIX: #9043 +FIX: #9316 Error when listing invoices +FIX: #9317 +FIX: #9353 Bug: html error - div inside span on graphs +FIX: #9355 +FIX: #9393 inconsistency behaviour. option FACTURE_ENABLE_NEGATIVE_LINES +FIX: #9394 +FIX: #9396 +FIX: #9403 +FIX: #9412 +FIX: #9497 +FIX: Add paypal error message in alert email when online payment fails. +FIX: better compatibility with multicompany +FIX: capital must be empty and not 0 if undefined +FIX: character making error on bill list +FIX: Entering negative price on order. +FIX: Expedition not showing extrafields on creation. +FIX: Homepage links were using wrong topmenus +FIX: inconsistency behaviour on option FACTURE_ENABLE_NEGATIVE_LINES +FIX: invert mime type and name. +FIX: invoice popup hide localtax2 and 3 if not defined. +FIX: Lose filter on payment type or category after a sort on invoice list. +FIX: Maxi debug to allow to load chart of account with multicompany. +FIX: Missing translation in predefined email to membership renewal. +FIX: Mixing tickets of different thirdparties. +FIX: "Other ..." link so the "Back to" link works. +FIX: PDF address: handle when contact thirdparty is different from thirdparty of document +FIX: Problems with permissions of module to record payment of salaries +FIX: remove debug +FIX: Several fixes on the management of minimal amount for orders +FIX: wrong var name + ***** ChangeLog for 8.0.1 compared to 8.0.0 ***** FIX: #9258 FIX: #9328 From 014da6c22c0c4df136a345d8ed0cf7548c0795a1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Sep 2018 18:11:07 +0200 Subject: [PATCH 07/22] Fix translation --- htdocs/langs/en_US/main.lang | 2 +- htdocs/langs/fr_FR/main.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index dcc47afa3ee..7136b15dc59 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -328,7 +328,7 @@ Copy=Copy Paste=Paste Default=Default DefaultValue=Default value -DefaultValues=Default values +DefaultValues=Default values/filters/sorting Price=Price PriceCurrency=Price (currency) UnitPrice=Unit price diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 6fba0af2b64..b68102ef90d 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -327,7 +327,7 @@ Copy=Copier Paste=Coller Default=Défaut DefaultValue=Valeur par défaut -DefaultValues=Valeurs par défaut +DefaultValues=Valeurs/Filtres/Tri par défaut Price=Prix PriceCurrency=Prix ​​(devise) UnitPrice=Prix unitaire From 79b248fc67d7c33de207681da928b2586bdaf2f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Sep 2018 23:25:38 +0200 Subject: [PATCH 08/22] FIX warning picto when next run date passed --- htdocs/cron/card.php | 4 ++-- htdocs/cron/list.php | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 855620756a7..35935be009d 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -684,8 +684,8 @@ else elseif (!empty($object->datenextrun)) { print img_picto('','object_calendarday').' '.dol_print_date($object->datenextrun,'dayhoursec');} else {print $langs->trans('CronNone');} //print ''; - if ($object->maxnbrun && $object->nbrun >= $object->maxrun) print img_warning($langs->trans("Finished")); - if ($object->datenextrun && $object->datenextrun < $now) print img_warning($langs->trans("Late")); + if ($object->maxrun && $object->nbrun >= $object->maxrun) print img_warning($langs->trans("MaxRunReached")); + elseif ($object->datenextrun && $object->datenextrun < $now) print img_warning($langs->trans("Late")); print ""; print ''; diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index eb326673d25..a8f4ade8b4d 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -242,6 +242,7 @@ $sql.= " t.status,"; $sql.= " t.fk_user_author,"; $sql.= " t.fk_user_mod,"; $sql.= " t.note,"; +$sql.= " t.maxrun,"; $sql.= " t.nbrun,"; $sql.= " t.libname,"; $sql.= " t.test"; @@ -252,12 +253,12 @@ if ($search_status == 2) $sql.= " AND t.status = 2"; //Manage filter if (is_array($filter) && count($filter)>0) { foreach($filter as $key => $value) { - $sql.= ' AND '.$key.' LIKE \'%'.$value.'%\''; + $sql.= ' AND '.$key.' LIKE \'%'.$db->escape($value).'%\''; } } $sqlwhere = array(); if (!empty($module_name)) { - $sqlwhere[]='(t.module_name='.$module_name.')'; + $sqlwhere[]='(t.module_name='.$db->escape($module_name).')'; } if (count($sqlwhere)>0) { $sql.= " WHERE ".implode(' AND ',$sqlwhere); @@ -523,6 +524,8 @@ if ($num > 0) if (empty($obj->status)) print ''; print dol_print_date($db->jdate($obj->datenextrun),'dayhour'); if (empty($obj->status)) print ''; + if ($obj->maxrun && $obj->nbrun >= $obj->maxrun) print img_warning($langs->trans("MaxRunReached")); + elseif ($obj->datenextrun && $obj->datenextrun < $now) print img_warning($langs->trans("Late")); } print ''; From c56b02c1c497aa6510156303e7cd020778859d20 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Sep 2018 23:39:49 +0200 Subject: [PATCH 09/22] Fix warning --- htdocs/cron/list.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index a8f4ade8b4d..d556804e317 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -520,12 +520,13 @@ if ($num > 0) print ''; print ''; - if(!empty($obj->datenextrun)) { + if (!empty($obj->datenextrun)) { + $datenextrun = $db->jdate($obj->datenextrun); if (empty($obj->status)) print ''; - print dol_print_date($db->jdate($obj->datenextrun),'dayhour'); - if (empty($obj->status)) print ''; + print dol_print_date($datenextrun,'dayhour'); if ($obj->maxrun && $obj->nbrun >= $obj->maxrun) print img_warning($langs->trans("MaxRunReached")); - elseif ($obj->datenextrun && $obj->datenextrun < $now) print img_warning($langs->trans("Late")); + elseif ($datenextrun && $datenextrun < $now) print img_warning($langs->trans("Late")); + if (empty($obj->status)) print ''; } print ''; From 85180b117c86ca8a3a2639e5d484711d7c76b494 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Sep 2018 23:45:22 +0200 Subject: [PATCH 10/22] Fix warnings --- htdocs/cron/card.php | 11 ++++++----- htdocs/cron/list.php | 9 ++++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 35935be009d..bdbab5e30b0 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -679,13 +679,14 @@ else print $langs->trans('CronDtNextLaunch'); print ' ('.$langs->trans('CronFrom').')'; print ""; - //print ''; if (! $object->status) print $langs->trans("Disabled"); elseif (!empty($object->datenextrun)) { print img_picto('','object_calendarday').' '.dol_print_date($object->datenextrun,'dayhoursec');} - else {print $langs->trans('CronNone');} - //print ''; - if ($object->maxrun && $object->nbrun >= $object->maxrun) print img_warning($langs->trans("MaxRunReached")); - elseif ($object->datenextrun && $object->datenextrun < $now) print img_warning($langs->trans("Late")); + else { print $langs->trans('CronNone'); } + if ($object->status == Cronjob::STATUS_ENABLED) + { + if ($object->maxrun && $object->nbrun >= $object->maxrun) print img_warning($langs->trans("MaxRunReached")); + elseif ($object->datenextrun && $object->datenextrun < $now) print img_warning($langs->trans("Late")); + } print ""; print ''; diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index d556804e317..1f810132223 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -523,9 +523,12 @@ if ($num > 0) if (!empty($obj->datenextrun)) { $datenextrun = $db->jdate($obj->datenextrun); if (empty($obj->status)) print ''; - print dol_print_date($datenextrun,'dayhour'); - if ($obj->maxrun && $obj->nbrun >= $obj->maxrun) print img_warning($langs->trans("MaxRunReached")); - elseif ($datenextrun && $datenextrun < $now) print img_warning($langs->trans("Late")); + print dol_print_date($datenextrun,'dayhoursec'); + if ($obj->status == Cronjob::STATUS_ENABLED) + { + if ($obj->maxrun && $obj->nbrun >= $obj->maxrun) print img_warning($langs->trans("MaxRunReached")); + elseif ($datenextrun && $datenextrun < $now) print img_warning($langs->trans("Late")); + } if (empty($obj->status)) print ''; } print ''; From cdbb79a26c579fcf694965a54eb5f3dcb46022ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 19 Sep 2018 09:26:56 +0200 Subject: [PATCH 11/22] correct typo in multicurrency doc pdf --- .gitignore | 1 + htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 6 +++--- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 6 +++--- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 6 +++--- .../modules/supplier_invoice/pdf/pdf_canelle.modules.php | 6 +++--- .../modules/supplier_order/pdf/pdf_muscadet.modules.php | 6 +++--- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 1efe4f4bb82..a0fbe7489df 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ dolibarr_install.log upgrade.log doxygen_warnings.log /.project +/.vscode .DS_Store .idea *.iml diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 9fecdc277b5..9dc2b770222 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -7,6 +7,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2018 Frédéric France * * 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 @@ -856,7 +857,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0), 0, $outputlangs), 0, 'R', 1); @@ -1307,7 +1308,7 @@ class pdf_einstein extends ModelePDFCommandes { $top_shift = $pdf->getY() - $current_y; } - + if ($showaddress) { // Sender properties @@ -1421,4 +1422,3 @@ class pdf_einstein extends ModelePDFCommandes } } - diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 88a47095b8c..804eb8885db 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -8,6 +8,7 @@ * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2018 Frédéric France * * 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 @@ -1054,7 +1055,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1); @@ -1679,7 +1680,7 @@ class pdf_crabe extends ModelePDFFactures { $top_shift = $pdf->getY() - $current_y; } - + if ($showaddress) { // Sender properties @@ -1788,4 +1789,3 @@ class pdf_crabe extends ModelePDFFactures } } - diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 03d0db86d8f..17b99fb8b36 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -7,6 +7,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2018 Frédéric France * * 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 @@ -1004,7 +1005,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0), 0, $outputlangs), 0, 'R', 1); @@ -1493,7 +1494,7 @@ class pdf_azur extends ModelePDFPropales { $top_shift = $pdf->getY() - $current_y; } - + if ($showaddress) { // Sender properties @@ -1636,4 +1637,3 @@ class pdf_azur extends ModelePDFPropales return ($tab_hl*7); } } - diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 11951e90207..9cfc1be320b 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2010-2014 Laurent Destailleur * Copyright (C) 2015 Marcos García + * Copyright (C) 2018 Frédéric France * * 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 @@ -598,7 +599,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + $object->remise), 0, 'R', 1); @@ -1094,7 +1095,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $object->fetch_user($arrayidcontact[0]); $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n"; } - + $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty); // Show sender @@ -1192,4 +1193,3 @@ class pdf_canelle extends ModelePDFSuppliersInvoices } } - diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 196d1f0c6a2..23a06264778 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -5,6 +5,7 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2018 Frédéric France * * 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 @@ -695,7 +696,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0)), 0, 'R', 1); @@ -1144,7 +1145,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $object->fetch_user($arrayidcontact[0]); $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n"; } - + $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty); // Show sender @@ -1242,4 +1243,3 @@ class pdf_muscadet extends ModelePDFSuppliersOrders } } - From 1d43c6bc3a0b058ef65b27026c8aa8e9b56adf1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 19 Sep 2018 10:57:59 +0200 Subject: [PATCH 12/22] call to deprecated add_object_linked was present two times --- htdocs/comm/propal/class/propal.class.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index a9782d21dac..2b3ae7834e1 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -12,6 +12,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos García + * Copyright (C) 2018 Frédéric France * * 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 @@ -1018,6 +1019,7 @@ class Propal extends CommonObject // Add linked object (deprecated, use ->linkedObjectsIds instead) if (! $error && $this->origin && $this->origin_id) { + dol_syslog('Deprecated use of linked object, use ->linkedObjectsIds instead', LOG_WARNING); $ret = $this->add_object_linked(); if (! $ret) dol_print_error($this->db); } @@ -1090,13 +1092,6 @@ class Propal extends CommonObject } } - // Add linked object - if (! $error && $this->origin && $this->origin_id) - { - $ret = $this->add_object_linked(); - if (! $ret) dol_print_error($this->db); - } - // Set delivery address if (! $error && $this->fk_delivery_address) { From dc7c27b16225911f026012a65fc5eb3bf5f27993 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Sep 2018 14:53:39 +0200 Subject: [PATCH 13/22] Release 8.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 a13100038ac..24c0de121db 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','8.0.2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','8.0.3'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From 55e3d97842d9122f3adc3c6b0cb3cfa8005b2d6a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Sep 2018 17:56:51 +0200 Subject: [PATCH 14/22] Trans --- htdocs/langs/en_US/boxes.lang | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang index 22c9a4b069f..20cabb9e418 100644 --- a/htdocs/langs/en_US/boxes.lang +++ b/htdocs/langs/en_US/boxes.lang @@ -73,10 +73,10 @@ BoxProposalsPerMonth=Proposals per month NoTooLowStockProducts=No products are under the low stock limit BoxProductDistribution=Products/Services Distribution BoxProductDistributionFor=Distribution of %s by %s -BoxTitleLastModifiedSupplierBills=Supplier Invoices: last %s modified -BoxTitleLatestModifiedSupplierOrders=Supplier Orders: last %s modified -BoxTitleLastModifiedCustomerBills=Customer Invoices: last %s modified -BoxTitleLastModifiedCustomerOrders=Customer Orders: last %s modified +BoxTitleLastModifiedSupplierBills=Latest %s modified vendors invoices +BoxTitleLatestModifiedSupplierOrders=Last %s modified purchase orders +BoxTitleLastModifiedCustomerBills=Latest %s modified customers invoices +BoxTitleLastModifiedCustomerOrders=Latest %s modified customer orders BoxTitleLastModifiedPropals=Latest %s modified proposals ForCustomersInvoices=Customers invoices ForCustomersOrders=Customers orders From 75104999d3155af66ae5970f09303a5896f99a9b Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 20 Sep 2018 15:04:00 +0200 Subject: [PATCH 15/22] NEW PHPUnitTest on Loan class #3163 --- htdocs/loan/class/loan.class.php | 30 +++++ test/phpunit/LoanTest.php | 218 +++++++++++++++++++++++++++++++ 2 files changed, 248 insertions(+) create mode 100644 test/phpunit/LoanTest.php diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 7843694585f..a4518960839 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -445,6 +445,36 @@ class Loan extends CommonObject return $result; } + + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void + */ + function initAsSpecimen() + { + global $user, $langs, $conf; + + $now=dol_now(); + + // Initialise parameters + $this->id = 0; + $this->fk_bank = 1; + $this->label = 'SPECIMEN'; + $this->specimen = 1; + $this->socid = 1; + $this->account_capital = 16; + $this->account_insurance = 616; + $this->account_interest = 518; + $this->datestart = $now; + $this->dateend = $now + (3600 * 24 * 365); + $this->note_public = 'SPECIMEN'; + $this->capital = 20000; + $this->nbterm = 48; + $this->rate = 4.3; + } /** * Return amount of payments already done diff --git a/test/phpunit/LoanTest.php b/test/phpunit/LoanTest.php new file mode 100644 index 00000000000..8341f788ede --- /dev/null +++ b/test/phpunit/LoanTest.php @@ -0,0 +1,218 @@ + + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + +/** + * \file test/phpunit/LoanTest.php + * \ingroup test + * \brief PHPUnit test + * \remarks To run this script as CLI: phpunit filename.php + */ + +global $conf,$user,$langs,$db; +//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver +//require_once 'PHPUnit/Autoload.php'; +require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; +require_once dirname(__FILE__).'/../../htdocs/loan/class/loan.class.php'; + +if (empty($user->id)) +{ + print "Load permissions for admin user nb 1\n"; + $user->fetch(1); + $user->getrights(); +} +$conf->global->MAIN_DISABLE_ALL_MAILS=1; + + +/** + * Class for PHPUnit tests + * + * @backupGlobals disabled + * @backupStaticAttributes enabled + * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. + */ +class LoanTest extends PHPUnit_Framework_TestCase +{ + protected $savconf; + protected $savuser; + protected $savlangs; + protected $savdb; + + /** + * Constructor + * We save global variables into local variables + * + * @return LoanTest + */ + function __construct() + { + parent::__construct(); + + //$this->sharedFixture + global $conf,$user,$langs,$db; + $this->savconf=$conf; + $this->savuser=$user; + $this->savlangs=$langs; + $this->savdb=$db; + + print __METHOD__." db->type=".$db->type." user->id=".$user->id; + //print " - db ".$db->db; + print "\n"; + } + + // Static methods + public static function setUpBeforeClass() + { + global $conf,$user,$langs,$db; + $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. + + print __METHOD__."\n"; + } + + // tear down after class + public static function tearDownAfterClass() + { + global $conf,$user,$langs,$db; + $db->rollback(); + + print __METHOD__."\n"; + } + + /** + * Init phpunit tests + * + * @return void + */ + protected function setUp() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + print __METHOD__."\n"; + //print $db->getVersion()."\n"; + } + /** + * End phpunit tests + * + * @return void + */ + protected function tearDown() + { + print __METHOD__."\n"; + } + + /** + * testLoanCreate + * + * @return void + */ + public function testLoanCreate() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject=new Loan($this->savdb); + $localobject->initAsSpecimen(); + $result=$localobject->create($user); + + $this->assertLessThan($result, 0); + print __METHOD__." result=".$result."\n"; + return $result; + } + + /** + * testLoanFetch + * + * @param int $id Id of object + * @return void + * + * @depends testLoanCreate + * The depends says test is run only if previous is ok + */ + public function testLoanFetch($id) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject=new Loan($this->savdb); + $result=$localobject->fetch($id); + + $this->assertLessThan($result, 0); + print __METHOD__." id=".$id." result=".$result."\n"; + return $localobject; + } + + /** + * testLoanOther + * + * @param Loan $localobject Loan + * @return int + * + * @depends testLoanFetch + * The depends says test is run only if previous is ok + */ + public function testLoanOther($localobject) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $result=$localobject->set_paid($user); + + print __METHOD__." id=".$localobject->id." result=".$result."\n"; + $this->assertLessThan($result, 0); + return $localobject->id; + } + + /** + * testLoanDelete + * + * @param int $id Id of loan + * @return void + * + * @depends testLoanCreate + * The depends says test is run only if previous is ok + */ + public function testLoanDelete($id) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject=new Loan($this->savdb); + $result=$localobject->fetch($id); + $result=$localobject->delete($user); + + print __METHOD__." id=".$id." result=".$result."\n"; + $this->assertLessThan($result, 0); + return $result; + } + +} From e0dfab4c7125dcb3f5fddfb2ce34cad09219e906 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Sep 2018 16:21:08 +0200 Subject: [PATCH 16/22] FIX The max size for upload file was not corectly shown --- htdocs/core/class/html.formfile.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 117ec484c15..f80c6942d8c 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -122,11 +122,12 @@ class FormFile if (preg_match('/g$/i',$maxphp)) $maxphp=$maxphp*1024*1024; if (preg_match('/t$/i',$maxphp)) $maxphp=$maxphp*1024*1024*1024; // Now $max and $maxphp are in Kb - if ($maxphp > 0) $max=min($max,$maxphp); + $maxmin = $max; + if ($maxphp > 0) $maxmin=min($max,$maxphp); - if ($max > 0) + if ($maxmin > 0) { - $out .= ''; + $out .= ''; } $out .= ' Date: Thu, 20 Sep 2018 19:06:12 +0200 Subject: [PATCH 17/22] Include PHP unit of Loan class into Travis --- test/phpunit/AllTests.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/phpunit/AllTests.php b/test/phpunit/AllTests.php index 66636ad7619..6aacecc6a00 100644 --- a/test/phpunit/AllTests.php +++ b/test/phpunit/AllTests.php @@ -195,6 +195,8 @@ class AllTests $suite->addTestSuite('HolidayTest'); require_once dirname(__FILE__).'/ExpenseReportTest.php'; $suite->addTestSuite('ExpenseReportTest'); + require_once dirname(__FILE__).'/LoadnTest.php'; + $suite->addTestSuite('LoanTest'); require_once dirname(__FILE__).'/EntrepotTest.php'; $suite->addTestSuite('EntrepotTest'); From df395847d3922f55040d26e9a468c076494adf85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Sep 2018 19:14:32 +0200 Subject: [PATCH 18/22] FIX #9567 --- htdocs/core/lib/functions.lib.php | 6 +++--- htdocs/theme/eldy/style.css.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index af0d7219ddc..23bde56dff9 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4137,13 +4137,13 @@ function print_fiche_titre($title, $mesg='', $picto='title_generic.png', $pictoi * @param string $morehtmlright Added message to show on right * @param string $picto Icon to use before title (should be a 32x32 transparent png file) * @param int $pictoisfullpath 1=Icon name is a full absolute url of image - * @param int $id To force an id on html objects + * @param string $id To force an id on html objects * @param string $morecssontable More css on table * @param string $morehtmlcenter Added message to show on center * @return string * @see print_barre_liste */ -function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='', $morehtmlcenter='') +function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='') { global $conf; @@ -4153,7 +4153,7 @@ function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $return.= "\n"; $return.= ''; - if ($picto) $return.= ''; + if ($picto) $return.= ''; $return.= ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 21ca0e5e586..cc1da092523 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1369,7 +1369,7 @@ div.nopadding { margin : 0px auto; } -#pictotitle { +.pictotitle { margin-: 8px; margin-bottom: 4px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 58a34ce1873..f568d411335 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1363,7 +1363,7 @@ table.noborder tr.liste_titre td { margin : 0px auto; } -#pictotitle { +.pictotitle { margin-: 8px; margin-bottom: 4px; } From b421c29ea7a68238f2af4f149127083fc77018a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Sep 2018 19:20:15 +0200 Subject: [PATCH 19/22] FIX #9510 --- htdocs/admin/system/dolibarr.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 4b02e7941d2..b2000b65c5b 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -157,7 +157,8 @@ $i=0; foreach($_SESSION as $key => $val) { if ($i > 0) print ', '; - print $key.' => '.dol_escape_htmltag($val); + if (is_array($val)) print $key.' => array(...)'; + else print $key.' => '.dol_escape_htmltag($val); $i++; } print ''."\n"; From 4ba057528fa20a21d07d1c064cded2846a7b48e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Sep 2018 19:37:28 +0200 Subject: [PATCH 20/22] Fix permissionss --- htdocs/core/modules/modStripe.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modStripe.class.php b/htdocs/core/modules/modStripe.class.php index e5b481f4daa..ac11e53e733 100644 --- a/htdocs/core/modules/modStripe.class.php +++ b/htdocs/core/modules/modStripe.class.php @@ -101,7 +101,7 @@ class modStripe extends DolibarrModules 'langs'=>'stripe', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>500, 'enabled'=>'$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 2', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'$user->rights->banque->consolidate', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'perms'=>'$user->rights->banque->modifier', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'target'=>'', 'user'=>2 ); // 0=Menu for internal users, 1=external users, 2=both @@ -116,8 +116,8 @@ class modStripe extends DolibarrModules 'url' => '', 'langs' => 'stripe', 'position' => 100, - 'enabled' => '$conf->global->MAIN_FEATURES_LEVEL >= 1', - 'perms' => '$user->rights->banque->configurer', + 'enabled' => '$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1', + 'perms' => '$user->rights->banque->lire', 'target' => '', 'user' => 0 ); @@ -131,7 +131,7 @@ class modStripe extends DolibarrModules 'langs' => 'stripe', 'position' => 102, 'enabled' => '$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 2', - 'perms' => '$user->rights->banque->configurer', + 'perms' => '$user->rights->banque->lire', 'target' => '', 'user' => 0 ); @@ -145,7 +145,7 @@ class modStripe extends DolibarrModules 'langs' => 'stripe', 'position' => 102, 'enabled' => '$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 2', - 'perms' => '$user->rights->banque->configurer', + 'perms' => '$user->rights->banque->lire', 'target' => '', 'user' => 0 ); From eb80c5c338fdee4a1b37b5d416e28b79ca9e23de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Sep 2018 19:45:13 +0200 Subject: [PATCH 21/22] Fix translation not loaded and test on multicompany --- htdocs/comm/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index bc7ea0cd67d..f552382bcce 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -666,6 +666,8 @@ if ($object->id > 0) */ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { + $langs->load("propal"); + $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht"; $sql.= ", p.tva as total_tva"; $sql.= ", p.total as total_ttc"; @@ -674,7 +676,7 @@ if ($object->id > 0) $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c"; $sql.= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id"; $sql.= " AND s.rowid = ".$object->id; - $sql.= " AND p.entity = ".$conf->entity; + $sql.= " AND p.entity IN (".getEntity('propal').")"; $sql.= " ORDER BY p.datep DESC"; $resql=$db->query($sql); From 37dcb33661183c6e9dde6c385516d4d91a28c186 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Sep 2018 23:41:04 +0200 Subject: [PATCH 22/22] phpunit for Loan --- test/phpunit/AllTests.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/AllTests.php b/test/phpunit/AllTests.php index 6aacecc6a00..206d180f700 100644 --- a/test/phpunit/AllTests.php +++ b/test/phpunit/AllTests.php @@ -195,7 +195,7 @@ class AllTests $suite->addTestSuite('HolidayTest'); require_once dirname(__FILE__).'/ExpenseReportTest.php'; $suite->addTestSuite('ExpenseReportTest'); - require_once dirname(__FILE__).'/LoadnTest.php'; + require_once dirname(__FILE__).'/LoanTest.php'; $suite->addTestSuite('LoanTest'); require_once dirname(__FILE__).'/EntrepotTest.php';
'.img_picto('',$picto, 'class="valignmiddle widthpictotitle" id="pictotitle"', $pictoisfullpath).''.img_picto('',$picto, 'class="valignmiddle widthpictotitle pictotitle"', $pictoisfullpath).''; $return.= '
'.$titre.'
'; $return.= '