From 3423d4e6d3b94772b80fce9cccb13f84fa8e187a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2018 13:35:53 +0100 Subject: [PATCH 01/16] Fix balance is amount after, so i fix by adding amount before --- htdocs/compta/bank/bankentries_list.php | 80 +++++++++++++++++-------- htdocs/langs/en_US/compta.lang | 1 + 2 files changed, 56 insertions(+), 25 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 2cdf92a7863..baa3d9e3716 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -143,8 +143,9 @@ $arrayfields=array( 'ba.ref'=>array('label'=>$langs->trans("BankAccount"), 'checked'=>(($id > 0 || ! empty($ref))?0:1), 'position'=>1000), 'b.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1, 'position'=>600), 'b.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1, 'position'=>605), - 'balance'=>array('label'=>$langs->trans("Balance"), 'checked'=>1, 'position'=>1000), - 'b.num_releve'=>array('label'=>$langs->trans("AccountStatement"), 'checked'=>1, 'position'=>1010), + 'balancebefore'=>array('label'=>$langs->trans("BalanceBefore"), 'checked'=>0, 'position'=>1000), + 'balance'=>array('label'=>$langs->trans("Balance"), 'checked'=>1, 'position'=>1001), + 'b.num_releve'=>array('label'=>$langs->trans("AccountStatement"), 'checked'=>1, 'position'=>1010), 'b.conciliated'=>array('label'=>$langs->trans("Conciliated"), 'enabled'=> $object->rappro, 'checked'=>($action == 'reconcile'?1:0), 'position'=>1020), ); // Extra fields @@ -865,14 +866,21 @@ if ($resql) print ''; print ''; } + if (! empty($arrayfields['balancebefore']['checked'])) + { + print ''; + $htmltext=$langs->trans("BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv("DateValue")); + print $form->textwithpicto('', $htmltext, 1); + print ''; + } if (! empty($arrayfields['balance']['checked'])) { - print ''; - $htmltext=$langs->trans("BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv("DateValue")); - print $form->textwithpicto('', $htmltext, 1); - print ''; + print ''; + $htmltext=$langs->trans("BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv("DateValue")); + print $form->textwithpicto('', $htmltext, 1); + print ''; } - // Numero statement + // Numero statement if (! empty($arrayfields['b.num_releve']['checked'])) { print ''; @@ -904,6 +912,7 @@ if ($resql) if (! empty($arrayfields['ba.ref']['checked'])) print_liste_field_titre($arrayfields['ba.ref']['label'],$_SERVER['PHP_SELF'],'ba.ref','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['b.debit']['checked'])) print_liste_field_titre($arrayfields['b.debit']['label'],$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['b.credit']['checked'])) print_liste_field_titre($arrayfields['b.credit']['label'],$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['balancebefore']['checked'])) print_liste_field_titre($arrayfields['balancebefore']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['balance']['checked'])) print_liste_field_titre($arrayfields['balance']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['b.num_releve']['checked'])) print_liste_field_titre($arrayfields['b.num_releve']['label'],$_SERVER['PHP_SELF'],'b.num_releve','',$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['b.conciliated']['checked'])) print_liste_field_titre($arrayfields['b.conciliated']['label'],$_SERVER['PHP_SELF'],'b.rappro','',$param,'align="center"',$sortfield,$sortorder); @@ -929,7 +938,7 @@ if ($resql) $objp = $db->fetch_object($resql); // If we are in a situation where we need/can show balance, we calculate the start of balance - if (! $balancecalculated && ! empty($arrayfields['balance']['checked']) && $mode_balance_ok) + if (! $balancecalculated && (! empty($arrayfields['balancebefore']['checked']) || ! empty($arrayfields['balance']['checked'])) && $mode_balance_ok) { if (! $account) { @@ -970,7 +979,7 @@ if ($resql) $balancefieldfound=false; foreach($arrayfields as $key => $val) { - if ($key == 'balance') + if ($key == 'balancebefore' || $key == 'balance') { $balancefieldfound=true; continue; @@ -1284,25 +1293,46 @@ if ($resql) if (! $i) $totalarray['totalcredfield']=$totalarray['nbfield']; } + // Balance before + if (! empty($arrayfields['balancebefore']['checked'])) + { + if ($mode_balance_ok) + { + $balancebefore = price2num($balance - ($sign * $objp->amount),'MT'); + if ($balancebefore >= 0) + { + print ' '.price($balancebefore).''; + } + else + { + print ' '.price($balancebefore).''; + } + } + else + { + print '-'; + } + if (! $i) $totalarray['nbfield']++; + } // Balance if (! empty($arrayfields['balance']['checked'])) { - if ($mode_balance_ok) - { - if ($balance >= 0) - { - print ' '.price($balance).''; - } - else - { - print ' '.price($balance).''; - } - } - else - { - print '-'; - } - if (! $i) $totalarray['nbfield']++; + if ($mode_balance_ok) + { + if ($balance >= 0) + { + print ' '.price($balance).''; + } + else + { + print ' '.price($balance).''; + } + } + else + { + print '-'; + } + if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['b.num_releve']['checked'])) diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 8c402d53705..e54d613628e 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -24,6 +24,7 @@ PaymentsNotLinkedToInvoice=Payments not linked to any invoice, so not linked to PaymentsNotLinkedToUser=Payments not linked to any user Profit=Profit AccountingResult=Accounting result +BalanceBefore=Balance (before) Balance=Balance Debit=Debit Credit=Credit From 6c9d5984a227b318b6331aacae6bf48f340498e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2018 14:03:03 +0100 Subject: [PATCH 02/16] Fix trans key --- htdocs/core/tpl/objectline_create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 0641bdea8f3..e7ca2fc9ebb 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -76,7 +76,7 @@ if ($nolinesbefore) { if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines { ?> - trans('SupplierProposalRefFourn'); ?> + trans('SupplierRef'); ?> trans('VAT'); ?> trans('PriceUHT'); ?> From 50596a5214294e60c5f28351f5607d5986107069 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2018 14:06:48 +0100 Subject: [PATCH 03/16] Fix trans key --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 3a0d9f3c1b0..55abcee5699 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3524,7 +3524,7 @@ abstract class CommonObject if ($this->element == 'supplier_proposal' || $this->element == 'order_supplier' || $this->element == 'invoice_supplier') { - print ''.$langs->trans("SupplierProposalRefFourn").''; + print ''.$langs->trans("SupplierRef").''; } // VAT From 4f8a447d3041eb5bc6aa5816dd7772bef1bedf58 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2018 14:09:51 +0100 Subject: [PATCH 04/16] Fix alignement --- htdocs/core/tpl/objectline_create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index e7ca2fc9ebb..0b59204f488 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -285,7 +285,7 @@ else { if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines { ?> - "> + "> Date: Fri, 12 Jan 2018 14:41:57 +0100 Subject: [PATCH 05/16] Fix responsive --- htdocs/comm/mailing/cibles.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index cdfd3e526cd..7729c2737cc 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -443,6 +443,7 @@ if ($object->fetch($id) >= 0) if ($page) $param.= "&page=".$page; + print '
'; print ''; // Ligne des champs de filtres @@ -590,6 +591,7 @@ if ($object->fetch($id) >= 0) } } print "

"; + print '
'; print ''; From 28207ad4cb34ee9c381a1a471d07104e77d1ef35 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2018 14:57:02 +0100 Subject: [PATCH 06/16] Clean var --- htdocs/accountancy/bookkeeping/card.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 0767023eacf..593c71188e8 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -648,7 +648,10 @@ if ($action == 'create') print "\n"; } - if (price2num($total_debit) != price2num($total_credit)) + $total_debit = price2num($total_debit); + $total_credit = price2num($total_credit); + + if ($total_debit != $total_credit) { setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_credit, $total_debit)), 'warnings'); } From 7da9911db168967e8227f805c851f33a596a0d02 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2018 15:06:50 +0100 Subject: [PATCH 07/16] Fix message --- htdocs/install/repair.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 3f4fa2d2910..5db07cd1412 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -1036,11 +1036,11 @@ if ($ok && GETPOST('force_utf8_on_tables','alpha')) print ''; print $table; $sql='ALTER TABLE '.$table.' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci'; - print $sql; + print ''; if (GETPOST('force_utf8_on_tables','alpha') == 'confirmed') { $resql = $db->query($sql); - print ' - Done ('.$resql.')'; + print ' - Done ('.($resql?'OK':'KO').')'; } else print ' - Disabled'; print ''; From 63e824144e6790659d1e51bfeb1840b8fe1fa27b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2018 15:19:02 +0100 Subject: [PATCH 08/16] Fix scrutinizer bug --- htdocs/compta/bank/bankentries_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index baa3d9e3716..0493ffef3b0 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -663,7 +663,7 @@ if ($resql) print ''; print ''; print ''; - if ($options) { + if (is_array($options) && count($options)) { print '
'.$langs->trans("Rubrique").': '; print Form::selectarray('cat1', $options, GETPOST('cat1'), 1); } From 64ae70d106ac8aaac679a1c4af1b919631dbf5d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2018 15:19:02 +0100 Subject: [PATCH 09/16] Fix scrutinizer bug --- htdocs/adherents/class/subscription.class.php | 2 +- htdocs/compta/bank/bankentries_list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index ae8470e3eee..8d4b1884bab 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -88,7 +88,7 @@ class Subscription extends CommonObject $sql.= " '".$this->db->escape($this->note)."')"; $resql = $this->db->query($sql); - if ($res===false) { + if (! $resql) { $error++; $this->errors[] = $this->db->lasterror(); } diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index baa3d9e3716..0493ffef3b0 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -663,7 +663,7 @@ if ($resql) print ''; print ''; print ''; - if ($options) { + if (is_array($options) && count($options)) { print '
'.$langs->trans("Rubrique").': '; print Form::selectarray('cat1', $options, GETPOST('cat1'), 1); } From ac8a7f064a017238de3b6201bf206d4c51e50e9d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2018 15:23:56 +0100 Subject: [PATCH 10/16] More robust code --- htdocs/blockedlog/class/blockedlog.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 6ee02c111c4..5b802fc8e2c 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -398,6 +398,7 @@ class BlockedLog $totalamount += $amount; + $tmpobject = null; if ($this->element == 'payment_supplier') { include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; @@ -413,6 +414,10 @@ class BlockedLog include_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; $tmpobject = new Don($this->db); } + if (! is_object($tmpobject)) + { + continue; + } $result = $tmpobject->fetch($objid); if ($result <= 0) From 92f8fc8b85ea7e4f5314e04fbd67c3bb0daaab13 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2018 15:26:50 +0100 Subject: [PATCH 11/16] Fix scrutinizer --- htdocs/don/class/paymentdonation.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index 619f2532a04..1023bf68b7a 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -234,7 +234,7 @@ class PaymentDonation extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) + function update($user, $notrigger=0) { global $conf, $langs; $error=0; From ad4b59d2c83e0a02740b048466d034d14cd1f3c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2018 15:33:21 +0100 Subject: [PATCH 12/16] Fix scrutinizer --- 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 10a31b215f7..1a67e374e68 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1236,7 +1236,7 @@ class FormFile print ""; print ''; - if (! $editline && $nboflines > 1 && is_object($object)) { + if ($nboflines > 1 && is_object($object)) { if (! empty($conf->use_javascript_ajax) && $permtoeditline) { $table_element_line = 'ecm_files'; include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; From 8b972313ae6a10665097f2cb91c7962df7389884 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2018 15:38:53 +0100 Subject: [PATCH 13/16] Fix scrutinizer --- .../compta/facture/class/api_invoices.class.php | 2 +- htdocs/product/stock/class/productlot.class.php | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 9e24b68fde4..e691d497194 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -444,7 +444,7 @@ class Invoices extends DolibarrApi } if($this->invoice->update($id, DolibarrApiAccess::$user)) - return $this->get ($id); + return $this->get($id); return false; } diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index fe6731f10df..d7915512b2c 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -470,14 +470,15 @@ class Productlot extends CommonObject * Return a link to the a lot card (with optionaly the picto) * 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) - * @param string $option On what the link point to - * @param integer $notooltip 1=Disable tooltip - * @param int $maxlen Max length of visible user name - * @param string $morecss Add more css on link - * @return string String with URL + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to + * @param integer $notooltip 1=Disable tooltip + * @param int $maxlen Max length of visible user 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 + * @return string String with URL */ - function getNomUrl($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='') + function getNomUrl($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='', $save_lastsearch_value=-1) { global $langs, $conf, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; From 32a998e68dcf316dd934d23331d65ff3c4ac6d4d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2018 16:28:10 +0100 Subject: [PATCH 14/16] Fix preview link --- htdocs/core/class/html.formfile.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 1a67e374e68..4bff96700d5 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -944,6 +944,7 @@ class FormFile * @param int $disablemove 1=Disable move button, 0=Position move is possible. * @param int $addfilterfields Add line with filters * @return int <0 if KO, nb of files shown if OK + * @see list_of_autoecmfiles */ function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permonobject=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='', $showrelpart=0, $permtoeditline=-1,$upload_dir='',$sortfield='',$sortorder='ASC', $disablemove=1, $addfilterfields=0) { @@ -1115,7 +1116,7 @@ class FormFile // Preview link if (! $editline) print $this->showPreview($file, $modulepart, $filepath); // Public share link - if (! $editline && ! empty($filearray[$key]['hashp'])) print 'ee'; + //if (! $editline && ! empty($filearray[$key]['hashp'])) print pictowithlinktodirectdownload; print "\n"; @@ -1269,6 +1270,7 @@ class FormFile * @param string $url Full url to use for click links ('' = autodetect) * @param int $addfilterfields Add line with filters * @return int <0 if KO, nb of files shown if OK + * @see list_of_documents */ function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload=0, $relativepath='', $permtodelete=1, $useinecm=0, $textifempty='', $maxlength=0, $url='', $addfilterfields=0) { @@ -1475,7 +1477,8 @@ class FormFile print dol_trunc($file['name'],$maxlength,'middle'); print ''; - print $this->getDocumentsLink($modulepart, $modulesubdir, $filedir, '^'.preg_quote($file['name'],'/').'$'); + //print $this->getDocumentsLink($modulepart, $modulesubdir, $filedir, '^'.preg_quote($file['name'],'/').'$'); + print $this->showPreview($file, $modulepart, $file['relativename']); print "\n"; print ''.dol_print_size($file['size'],1,1).''; @@ -1677,7 +1680,7 @@ class FormFile /** * Show detail icon with link for preview * - * @param array $file File + * @param array $file Array with data of file. Example: array('name'=>...) * @param string $modulepart propal, facture, facture_fourn, ... * @param string $relativepath Relative path of docs * @param string $ruleforpicto Rule for picto: 0=Use the generic preview picto, 1=Use the picto of mime type of file) From 7bfcfd4574bef2c81f0f5b40b7f96d26eb4a8fe7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2018 17:12:38 +0100 Subject: [PATCH 15/16] Fix recursive path when dir is '0' --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index d357141fa4d..577d6356752 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -159,7 +159,7 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil // if we're in a directory and we want recursive behavior, call this function again if ($recursive) { - $file_list = array_merge($file_list, dol_dir_list($path."/".$file, $types, $recursive, $filter, $excludefilter, $sortcriteria, $sortorder, $mode, $nohook, ($relativename?$relativename.'/':'').$file)); + $file_list = array_merge($file_list, dol_dir_list($path."/".$file, $types, $recursive, $filter, $excludefilter, $sortcriteria, $sortorder, $mode, $nohook, ($relativename!=''?$relativename.'/':'').$file)); } } else if (! $isdir && (($types == "files") || ($types == "all"))) From d0680b429f9954afd75568ce8d763d5ae016efe6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2018 17:39:20 +0100 Subject: [PATCH 16/16] Fix name of file saved from tax document tab --- htdocs/compta/sociales/document.php | 1 + htdocs/core/tpl/document_actions_post_headers.tpl.php | 4 ++-- htdocs/fourn/facture/document.php | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index 048d35d73f1..0bf1e7f6f13 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -161,6 +161,7 @@ if ($object->id) $modulepart = 'tax'; $permission = $user->rights->tax->charges->creer; + $permtoedit = $user->rights->fournisseur->facture->creer; $param = '&id=' . $object->id; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; } diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index f50dc62fb9b..8380d5c23f5 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -62,7 +62,7 @@ $savingdocmask=''; if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX)) { //var_dump($modulepart); - if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','supplier_proposal','ficheinter','contract','project','project_task','expensereport'))) + if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','supplier_proposal','ficheinter','contract','project','project_task','expensereport','tax'))) { $savingdocmask=dol_sanitizeFileName($object->ref).'-__file__'; } @@ -87,7 +87,7 @@ $formfile->form_attach_new_file( ); $disablemove=1; -if (in_array($modulepart, array('product', 'produit', 'societe', 'user'))) $disablemove=0; // Drag and drop for up and down allowed on product +if (in_array($modulepart, array('product', 'produit', 'societe', 'user'))) $disablemove=0; // Drag and drop for up and down allowed on product, thirdparty, ... // List of document $formfile->list_of_documents( diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 113f262e2a9..5f8c5787773 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -244,6 +244,8 @@ if ($object->id > 0) print ''; print ''; + print '
'; + dol_fiche_end();