From 16b12b33fc1b1e9bf4889e3bd0dd58a79c1f842a Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 18 Mar 2017 07:24:55 +0100 Subject: [PATCH 01/22] First step : remove BANK_DISABLE_DIRECT_INPUT --- htdocs/accountancy/admin/index.php | 27 ------- htdocs/compta/bank/bankentries.php | 71 +++---------------- htdocs/core/modules/modAccounting.class.php | 10 +-- .../install/mysql/migration/5.0.0-6.0.0.sql | 2 + 4 files changed, 13 insertions(+), 97 deletions(-) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 74479a9d39f..b92da48353f 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -141,19 +141,6 @@ if ($action == 'setmanagezero') { } } -if ($action == 'setdisabledirectinput') { - $setdisabledirectinput = GETPOST('value', 'int'); - $res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity); - if (! $res > 0) - $error ++; - if (! $error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'mesgs'); - } -} - - /* * View */ @@ -243,20 +230,6 @@ if (! empty($user->admin)) } print ''; - $var = ! $var; - print ""; - print '' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . ''; - if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; - } - print ''; - $var = ! $var; print ""; print '' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ''; diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php index ad3817f28cd..3fabed83d93 100644 --- a/htdocs/compta/bank/bankentries.php +++ b/htdocs/compta/bank/bankentries.php @@ -4,8 +4,9 @@ * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2012 Vinícius Nogueira * Copyright (C) 2014 Florian Henry - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Juanjo Menent + * Copyright (C) 2017 Alexandre Spangaro * * 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 @@ -405,28 +406,19 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); - - /* * Buttons actions */ - if ($action != 'addline' && $action != 'reconcile') + if ($action != 'reconcile') { print '
'; - - if ($action != 'addline') - { - if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) - { - if ($user->rights->banque->modifier) { - print ''.$langs->trans("AddBankRecord").''; - } else { - print ''.$langs->trans("AddBankRecord").''; - } - } else { - print ''.$langs->trans("AddBankRecord").''; - } - } + + if ($user->rights->banque->modifier) { + print ''.$langs->trans("AddBankRecord").''; + } else { + print ''.$langs->trans("AddBankRecord").''; + } + if ($object->canBeConciliated() > 0) { // If not cash account and can be reconciliate if ($user->rights->banque->consolidate) { @@ -636,49 +628,6 @@ if ($resql) // print ''; } - // Form to add a transaction with no invoice - if ($user->rights->banque->modifier && $action == 'addline') - { - print load_fiche_titre($langs->trans("AddBankRecordLong"),'',''); - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'.$langs->trans("Date").' '.$langs->trans("Type").''.$langs->trans("Numero").''.$langs->trans("Description").''.$langs->trans("Debit").''.$langs->trans("Credit").' 
'; - $form->select_date(empty($dateop)?-1:$dateop,'op',0,0,0,'transaction'); - print ''; - $form->select_types_paiements((GETPOST('operation')?GETPOST('operation'):($object->courant == Account::TYPE_CASH ? 'LIQ' : '')),'operation','1,2',2,1); - print ''; - print ''; - print ''; - if ($options) { - print '
'.$langs->trans("Rubrique").': '; - print Form::selectarray('cat1', $options, GETPOST('cat1'), 1); - } - print '
'; - print '
'; - print ''; - print '
'; - print '
'; - } - - /// ajax to adjust value date with plus and less picto print ' ' . "\n"; } + // Wrapper to manage document_preview + if (! empty($conf->use_javascript_ajax)) + { + print "\n\n"; + print '' . "\n"; + } + // Wrapper to manage dropdown if ($conf->use_javascript_ajax) { diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index f1db2d21835..42860abb98a 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -802,7 +802,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); - print '
'; + print '
'; print '
'; print ''; @@ -845,7 +845,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) } print '"; @@ -854,7 +854,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) print "\n"; print '"; From 2b1c29316fa3d348bd76a591626e1119313e89f5 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Fri, 24 Mar 2017 22:13:58 +0100 Subject: [PATCH 14/22] Display totalLine if one of total field are present --- htdocs/compta/facture/list.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index aad49656e2e..8ed52eddb97 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1210,7 +1210,12 @@ if ($resql) } // Show total line - if (isset($totalarray['totalhtfield'])) + if (isset($totalarray['totalhtfield']) + || isset($totalarray['totalvatfield']) + || isset($totalarray['totalttcfield']) + || isset($totalarray['totalamfield']) + || isset($totalarray['totalrtpfield']) + ) { print ''; $i=0; From 6b33a755ba4fb15adf8ba5c7649a771a0a724718 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Mar 2017 23:52:06 +0100 Subject: [PATCH 15/22] Add more log on tableDnD --- htdocs/core/tpl/ajaxrow.tpl.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/ajaxrow.tpl.php b/htdocs/core/tpl/ajaxrow.tpl.php index d0a7b45efea..61c27579b50 100644 --- a/htdocs/core/tpl/ajaxrow.tpl.php +++ b/htdocs/core/tpl/ajaxrow.tpl.php @@ -44,6 +44,7 @@ $(document).ready(function(){ $("#").tableDnD({ onDrop: function(table, row) { var reloadpage = ""; + console.log("tableDND onDrop"); console.log($("#").tableDnDSerialize()); var roworder = cleanSerialize($("#").tableDnDSerialize()); var table_element_line = ""; @@ -59,14 +60,15 @@ $(document).ready(function(){ filepath: filepath }, function() { + console.log("tableDND end of ajax call"); if (reloadpage == 1) { location.href = ''; } else { $("# .drag").each( function( intIndex ) { - $(this).removeClass("pair impair"); - if (intIndex % 2 == 0) $(this).addClass('impair'); - if (intIndex % 2 == 1) $(this).addClass('pair'); + // $(this).removeClass("pair impair"); + //if (intIndex % 2 == 0) $(this).addClass('impair'); + //if (intIndex % 2 == 1) $(this).addClass('pair'); }); } }); From 720a820ee4c116c5a298921da277ca947ed0a5e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 25 Mar 2017 00:04:21 +0100 Subject: [PATCH 16/22] border-bottom not required. --- htdocs/comm/propal/card.php | 2 +- htdocs/comm/propal/contact.php | 2 +- htdocs/comm/propal/document.php | 2 +- htdocs/comm/propal/info.php | 2 +- htdocs/comm/propal/note.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 810d6bd1abb..e1224ad0e72 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1675,7 +1675,7 @@ if ($action == 'create') $soc->fetch($object->socid); $head = propal_prepare_head($object); - dol_fiche_head($head, 'comm', $langs->trans('Proposal'), 0, 'propal'); + dol_fiche_head($head, 'comm', $langs->trans('Proposal'), -1, 'propal'); $formconfirm = ''; diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 8588bfc5749..3c3aa6aef88 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -151,7 +151,7 @@ $formother = new FormOther($db); if ($object->id > 0) { $head = propal_prepare_head($object); - dol_fiche_head($head, 'contact', $langs->trans("Proposal"), 0, 'propal'); + dol_fiche_head($head, 'contact', $langs->trans("Proposal"), -1, 'propal'); // Proposal card diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 9b875e434f7..82978daf2c1 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -89,7 +89,7 @@ if ($object->id > 0) $upload_dir = $conf->propal->dir_output.'/'.dol_sanitizeFileName($object->ref); $head = propal_prepare_head($object); - dol_fiche_head($head, 'document', $langs->trans('Proposal'), 0, 'propal'); + dol_fiche_head($head, 'document', $langs->trans('Proposal'), -1, 'propal'); // Construit liste des fichiers $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index 14a4911b80f..d8af8fb87a8 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -59,7 +59,7 @@ llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_c $object->fetch_thirdparty(); $head = propal_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans('Proposal'), 0, 'propal'); +dol_fiche_head($head, 'info', $langs->trans('Proposal'), -1, 'propal'); $object->info($object->id); diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 57181b83f6b..ec1dac31c24 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -74,7 +74,7 @@ if ($id > 0 || ! empty($ref)) if ($object->fetch_thirdparty() > 0) { $head = propal_prepare_head($object); - dol_fiche_head($head, 'note', $langs->trans('Proposal'), 0, 'propal'); + dol_fiche_head($head, 'note', $langs->trans('Proposal'), -1, 'propal'); $cssclass='titlefield'; //if ($action == 'editnote_public') $cssclass='titlefieldcreate'; From 2e6ab393df577388bc93571b425dbf232a371bb6 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 25 Mar 2017 10:45:01 +0100 Subject: [PATCH 17/22] add next_prev_filter for pagination --- htdocs/product/price.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index e6bde28d27e..8601ce9c05d 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -657,7 +657,7 @@ $picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product'); dol_fiche_head($head, 'price', $titre, 0, $picto); $linkback = ''.$langs->trans("BackToList").''; - +$object->next_prev_filter=" fk_product_type = ".$object->type; dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); From cf68039c364a84cc7c0b5379c08a784d19b45000 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 25 Mar 2017 10:47:42 +0100 Subject: [PATCH 18/22] Update document.php --- htdocs/product/document.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/document.php b/htdocs/product/document.php index ae2782cc4de..cedfec4abdc 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -210,8 +210,8 @@ if ($object->id) $linkback = ''.$langs->trans("BackToList").''; - - dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); + $object->next_prev_filter=" fk_product_type = ".$object->type; + dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); print '
'; From a1db02cc0853020fb1ae100e3ee331fbd44ddde4 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 25 Mar 2017 10:48:50 +0100 Subject: [PATCH 19/22] Update fournisseurs.php --- htdocs/product/fournisseurs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index ab74bc29485..ab959f479fd 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -308,7 +308,7 @@ if ($id > 0 || $ref) dol_fiche_head($head, 'suppliers', $titre, 0, $picto); $linkback = ''.$langs->trans("BackToList").''; - + $object->next_prev_filter=" fk_product_type = ".$object->type; dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); print '
'; From 656875acb5ab71702bcb7905f5b973dec158032d Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 25 Mar 2017 10:49:57 +0100 Subject: [PATCH 20/22] Update info.php --- htdocs/product/info.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/info.php b/htdocs/product/info.php index e29d1a168cb..af626cce5dd 100644 --- a/htdocs/product/info.php +++ b/htdocs/product/info.php @@ -94,7 +94,7 @@ if ($id > 0 || $ref) dol_fiche_head($head, 'info', $titre, 0, $picto); $linkback = ''.$langs->trans("BackToList").''; - + $object->next_prev_filter=" fk_product_type = ".$object->type; dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); $object->info($object->id); From ec3402a04b1045c9d4cdc91ec2207eb3d0cb6920 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 25 Mar 2017 10:52:03 +0100 Subject: [PATCH 21/22] Update note.php --- htdocs/product/note.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/note.php b/htdocs/product/note.php index 9a914527a83..c63d60229fb 100644 --- a/htdocs/product/note.php +++ b/htdocs/product/note.php @@ -94,7 +94,7 @@ if ($id > 0 || ! empty($ref)) dol_fiche_head($head, 'note', $titre, 0, $picto); $linkback = ''.$langs->trans("BackToList").''; - + $object->next_prev_filter=" fk_product_type = ".$object->type; dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); $cssclass='titlefield'; From 3c9d336148d831f542c9e89b1eb282e678ae797d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 25 Mar 2017 17:05:27 +0100 Subject: [PATCH 22/22] Fix error message --- build/generate_filelist_xml.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index ff580fad58c..1eeac5410b2 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -40,6 +40,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); * Main */ +$includecustom=0; $includeconstants=array(); if (empty($argv[1])) @@ -67,8 +68,6 @@ while ($i < $argc) if (empty($includecustom)) { - $includecustom=0; - if (DOL_VERSION != $release) { print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$release.')'."\n"; @@ -80,7 +79,7 @@ else { if (! preg_match('/'.preg_quote(DOL_VERSION,'/').'-/',$release)) { - print 'Error: When parameter "includecustom" is not set, version declared into ('.DOL_VERSION.') must be used with a suffix into "release" parmater (ex: '.DOL_VERSION.'-mydistrib).'."\n"; + print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parmater (ex: '.DOL_VERSION.'-mydistrib).'."\n"; print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n"; exit -1; }
'.$langs->trans("BankAccountDomiciliation").''; - print '
'.$langs->trans("BankAccountOwnerAddress").''; - print '