From ca53d3b60285de53d38d3fc7eb1f27cbb363b38d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 18 May 2015 10:43:54 +0200 Subject: [PATCH 01/22] NEW : add date value filter on account records list --- htdocs/compta/bank/account.php | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 1aea3e27c1b..36b3ada162b 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -7,6 +7,7 @@ * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2012-2014 Marcos García * Copyright (C) 2011-2015 Alexandre Spangaro + * Copyright (C) 2015 Florian Henry * * 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 @@ -67,6 +68,8 @@ $thirdparty=GETPOST("thirdparty",'',3); $req_desc=GETPOST("req_desc",'',3); $req_debit=GETPOST("req_debit",'',3); $req_credit=GETPOST("req_credit",'',3); +$req_month = GETPOST('req_month', 'aplha'); +$req_year = GETPOST('req_year', 'int'); $vline=GETPOST("vline"); $page=GETPOST('page','int'); @@ -87,6 +90,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $req_desc=""; $req_debit=""; $req_credit=""; + $req_month=""; + $req_year=""; } /* @@ -253,6 +258,18 @@ if ($id > 0 || ! empty($ref)) $param.='&paiementtype='.urlencode($paiementtype); $mode_search = 1; } + if ($req_month) + { + $sql_rech.=" AND MONTH(b.datev) IN (".$db->escape($req_month).")"; + $param.='&req_month='.urlencode($req_month); + $mode_search = 1; + } + if ($req_year) + { + $sql_rech.=" AND YEAR(b.datev) = '".$db->escape($req_year)."'"; + $param.='&req_year='.urlencode($req_year); + $mode_search = 1; + } $sql = "SELECT count(*) as total"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; @@ -398,6 +415,8 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; + print ''; + print ''; $navig ='
'; if ($limitsql > $viewline) $navig.=''.img_previous().''; @@ -489,9 +508,12 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; + $period_filter .= $langs->trans('Month') . ':'; + $period_filter .= $langs->trans('Year') . ':' . $formother->selectyear($req_year ? $req_year : - 1, 'req_year', 1, 20, 5); + print ''; print ' '; - print ' '; + print ''.$period_filter.''; print ''; //$filtertype=array('TIP'=>'TIP','PRE'=>'PRE',...) $filtertype=''; From a6c5a247cd0b81c11f18f8f91239c81565fb9d69 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 18 May 2015 11:08:27 +0200 Subject: [PATCH 02/22] add total and title in page records banck account --- htdocs/compta/bank/account.php | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 36b3ada162b..899099d348f 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -7,7 +7,7 @@ * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2012-2014 Marcos García * Copyright (C) 2011-2015 Alexandre Spangaro - * Copyright (C) 2015 Florian Henry + * Copyright (C) 2015 Florian Henry * * 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 @@ -163,7 +163,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->m * View */ -llxHeader(); +llxHeader('',$langs->trans("FinancialAccount").'-'.$langs->trans("Transactions")); $societestatic=new Societe($db); $userstatic=new User($db); @@ -598,7 +598,7 @@ if ($id > 0 || ! empty($ref)) $var=true; $num = $db->num_rows($result); - $i = 0; $total = 0; $sep = -1; + $i = 0; $total = 0; $sep = -1; $total_deb=0; $total_cred=0; while ($i < $num) { @@ -833,10 +833,12 @@ if ($id > 0 || ! empty($ref)) if ($objp->amount < 0) { print ''.price($objp->amount * -1).' '."\n"; + $total_deb +=$objp->amount; } else { print '  '.price($objp->amount).''."\n"; + $total_cred +=$objp->amount; } // Balance @@ -905,14 +907,26 @@ if ($id > 0 || ! empty($ref)) $i++; } - // Show total + // Show total if ($page == 0 && ! $mode_search) { + //Real account situation print ''; if ($sep > 0) print ' '; // If we had at least one line in future else print $langs->trans("CurrentBalance"); print ' '.$object->currency_code.''; - print ''.price($total, 0, $langs, 0, 0, -1, $object->currency_code).''; + print ''.price($solde, 0, $langs, 0, 0, -1, $object->currency_code).''; + print ' '; + print ''; + } else { + // Only total according row displays + print ''; + if ($sep > 0) print ' '; // If we had at least one line in future + else print $langs->trans("Total"); + print ' '.$object->currency_code.''; + print ''.price($total_deb*-1, 0, $langs, 0, 0, -1, $object->currency_code).''; + print ''.price($total_cred, 0, $langs, 0, 0, -1, $object->currency_code).''; + print ''.price($total_cred-($total_deb*-1), 0, $langs, 0, 0, -1, $object->currency_code).''; print ' '; print ''; } From 23eac58cc86b23875818621f1c3bb75d35c8178f Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 18 May 2015 13:13:50 +0200 Subject: [PATCH 03/22] fix bug on new feature checkbox list form table --- htdocs/core/class/extrafields.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 1c132502b78..e2313d157d5 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -923,7 +923,12 @@ class ExtraFields } elseif ($type == 'chkbxlst') { - $value_arr = explode(',', $value); + if (is_array($value)) { + $value_arr = $value; + } + else { + $value_arr = explode(',', $value); + } if (is_array($param['options'])) { $param_list = array_keys($param['options']); From ee1aa3268ca3590efd2310e8efa3ced8250ae6ea Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 19 May 2015 11:55:45 +0200 Subject: [PATCH 04/22] working account --- htdocs/compta/bank/account.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 899099d348f..0d5e8e06198 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -258,16 +258,10 @@ if ($id > 0 || ! empty($ref)) $param.='&paiementtype='.urlencode($paiementtype); $mode_search = 1; } - if ($req_month) + if ($req_dtstart || $req_dtend) { - $sql_rech.=" AND MONTH(b.datev) IN (".$db->escape($req_month).")"; - $param.='&req_month='.urlencode($req_month); - $mode_search = 1; - } - if ($req_year) - { - $sql_rech.=" AND YEAR(b.datev) = '".$db->escape($req_year)."'"; - $param.='&req_year='.urlencode($req_year); + $sql_rech.=" AND (b.datev BETWEN '".$db->escape($req_dtstart)."' AND '".$db->escape($req_dtend)."')"; + $param.='&req_dtstart='.urlencode($req_month); $mode_search = 1; } From 6e6b66e416110590527d55a42a2db62901a5479e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 20 May 2015 11:24:23 +0200 Subject: [PATCH 05/22] apply recommandation from https://github.com/FHenry/dolibarr/commit/ca53d3b60285de53d38d3fc7eb1f27cbb363b38d#commitcomment-11245627 --- htdocs/compta/bank/account.php | 58 ++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 0d5e8e06198..f8034f2a543 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -20,7 +20,7 @@ * 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 . + * along withthis program. If not, see . */ /** @@ -68,8 +68,15 @@ $thirdparty=GETPOST("thirdparty",'',3); $req_desc=GETPOST("req_desc",'',3); $req_debit=GETPOST("req_debit",'',3); $req_credit=GETPOST("req_credit",'',3); -$req_month = GETPOST('req_month', 'aplha'); -$req_year = GETPOST('req_year', 'int'); + +$req_stdtmonth=GETPOST('req_stdtmonth', 'int'); +$req_stdtday=GETPOST('req_stdtday', 'int'); +$req_stdtyear=GETPOST('req_stdtyear', 'int'); +$req_stdt = dol_mktime(0, 0, 0, $req_stdtmonth, $req_stdtday, $req_stdtyear); +$req_enddtmonth=GETPOST('req_enddtmonth', 'int'); +$req_enddtday=GETPOST('req_enddtday', 'int'); +$req_enddtyear=GETPOST('req_enddtyear', 'int'); +$req_enddt = dol_mktime(23, 59, 59, $req_enddtmonth, $req_enddtday, $req_enddtyear); $vline=GETPOST("vline"); $page=GETPOST('page','int'); @@ -90,8 +97,14 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $req_desc=""; $req_debit=""; $req_credit=""; - $req_month=""; - $req_year=""; + $req_stdtmonth=""; + $req_stdtday=""; + $req_stdtyear=""; + $req_stdt = ""; + $req_enddtmonth=""; + $req_enddtday=""; + $req_enddtyear=""; + $req_enddt = ""; } /* @@ -258,12 +271,27 @@ if ($id > 0 || ! empty($ref)) $param.='&paiementtype='.urlencode($paiementtype); $mode_search = 1; } - if ($req_dtstart || $req_dtend) + + if ($req_stdt && $req_enddt) { - $sql_rech.=" AND (b.datev BETWEN '".$db->escape($req_dtstart)."' AND '".$db->escape($req_dtend)."')"; - $param.='&req_dtstart='.urlencode($req_month); + $sql_rech.=" AND (b.datev BETWEEN '".$db->escape($db->idate($req_stdt))."' AND '".$db->escape($db->idate($req_enddt))."')"; + $param.='&req_stdtmonth='.$req_stdtmonth.'&req_stdtyear='.$req_stdtyear.'&req_stdtday='.$req_stdtday; + $param.='&req_enddtmonth='.$req_enddtmonth.'&req_enddtday='.$req_enddtday.'&req_enddtyear='.$req_enddtyear; $mode_search = 1; + } + elseif ($req_stdt) + { + $sql_rech.=" AND b.datev >= '".$db->escape($db->idate($req_stdt))."'"; + $param.='&req_stdtmonth='.$req_stdtmonth.'&req_stdtyear='.$req_stdtyear.'&req_stdtday='.$req_stdtday; + $mode_search = 1; } + elseif ($req_enddt) + { + $sql_rech.=" AND b.datev <= '".$db->escape($db->idate($req_enddt))."'"; + $param.='&req_enddtmonth='.$req_enddtmonth.'&req_enddtday='.$req_enddtday.'&req_enddtyear='.$req_enddtyear; + $mode_search = 1; + } + $sql = "SELECT count(*) as total"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; @@ -409,9 +437,13 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - print ''; - print ''; - + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $navig ='
'; if ($limitsql > $viewline) $navig.=''.img_previous().''; $navig.= ' "; // ' Page '; @@ -502,8 +534,8 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; - $period_filter .= $langs->trans('Month') . ':'; - $period_filter .= $langs->trans('Year') . ':' . $formother->selectyear($req_year ? $req_year : - 1, 'req_year', 1, 20, 5); + $period_filter .= $langs->trans('From').' '.$form->select_date($req_stdt,'req_stdt',0,0,1,null,1,1,1); + $period_filter .= '
'. $langs->trans('to').' '.$form->select_date($req_enddt,'req_enddt',0,0,1,null,1,1,1); print ''; print ' '; From df4ee9562ff8bd1bb69595453a9096f9bdc8c171 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 20 May 2015 11:29:35 +0200 Subject: [PATCH 06/22] fix spell --- htdocs/compta/bank/account.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index f8034f2a543..4b920aab45b 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -20,7 +20,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along withthis program. If not, see . + * along with this program. If not, see . */ /** From 0331ddc2de91761b3195cd32de260e2fb6546ad1 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 20 May 2015 11:30:27 +0200 Subject: [PATCH 07/22] fix spacing --- htdocs/compta/bank/account.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 4b920aab45b..7dffc753bc4 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -933,7 +933,7 @@ if ($id > 0 || ! empty($ref)) $i++; } - // Show total + // Show total if ($page == 0 && ! $mode_search) { //Real account situation From e23459d53b411e2627124f61b2c171e5bbf349a3 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Wed, 20 May 2015 21:50:38 +0200 Subject: [PATCH 08/22] NEW Forms are using the tab look, even in creation mode --- htdocs/comm/action/card.php | 7 ++++++- htdocs/compta/paiement/cheque/card.php | 11 ++++++++--- htdocs/ecm/docdir.php | 6 +++++- htdocs/opensurvey/wizard/create_survey.php | 5 +++++ 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index eb88215fa20..aa34c83523c 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -6,6 +6,7 @@ * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Cedric GROSS + * Copyright (C) 2015 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 @@ -609,6 +610,8 @@ if ($action == 'create') if (GETPOST("actioncode") == 'AC_RDV') print_fiche_titre($langs->trans("AddActionRendezVous")); else print_fiche_titre($langs->trans("AddAnAction")); + dol_fiche_head(); + print ''; // Type of event @@ -784,7 +787,9 @@ if ($action == 'create') print '
'; - print '
'; + dol_fiche_end(); + + print '
'; print ''; print '     '; print ''; diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 49af748c115..e2422bffa70 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -4,6 +4,7 @@ * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2015 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 @@ -347,7 +348,9 @@ if ($action == 'new') print '
'; print ''; - //print '
aaa'; + + dol_fiche_head(); + print ''; //print ''; // Filter @@ -358,6 +361,9 @@ if ($action == 'new') $form->select_comptes($filteraccountid,'accountid',0,'courant <> 2',1); print ''; print '
'.$langs->trans('Date').''.dol_print_date($now,'day').'
'; + + dol_fiche_end(); + print '
'; print ''; if ($filterdate || $filteraccountid > 0) @@ -366,8 +372,7 @@ if ($action == 'new') print ''; } print '
'; - //print '
'; - print '
'; + print ''; print '
'; $sql = "SELECT ba.rowid as bid, b.datec as datec, b.dateo as date, b.rowid as chqid, "; diff --git a/htdocs/ecm/docdir.php b/htdocs/ecm/docdir.php index b1f09ffcb22..226987c0c44 100644 --- a/htdocs/ecm/docdir.php +++ b/htdocs/ecm/docdir.php @@ -1,6 +1,7 @@ * Copyright (C) 2008-2012 Regis Houssin + * Copyright (C) 2015 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 @@ -20,7 +21,6 @@ * \file htdocs/ecm/docdir.php * \ingroup ecm * \brief Main page for ECM section area - * \author Laurent Destailleur */ require '../main.inc.php'; @@ -154,6 +154,8 @@ if ($action == 'create') $title=$langs->trans("ECMNewSection"); print_fiche_titre($title); + + dol_fiche_head(); print ''; @@ -174,6 +176,8 @@ if ($action == 'create') print ''."\n"; print '

'; + + dol_fiche_end(); print '
'; print ''; diff --git a/htdocs/opensurvey/wizard/create_survey.php b/htdocs/opensurvey/wizard/create_survey.php index 7443fbdfba0..9c5d27d070e 100644 --- a/htdocs/opensurvey/wizard/create_survey.php +++ b/htdocs/opensurvey/wizard/create_survey.php @@ -1,6 +1,7 @@ * Copyright (C) 2014 Marcos García + * Copyright (C) 2015 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 @@ -135,6 +136,8 @@ print_fiche_titre($langs->trans("CreatePoll").' (1 / 2)'); //debut du formulaire print '
'."\n"; +dol_fiche_head(); + //Affichage des différents champs textes a remplir print ''."\n"; @@ -158,6 +161,8 @@ print $form->select_date($champdatefin?$champdatefin:-1,'champdatefin','','','', print ''."\n"; print '
'."\n"; +dol_fiche_end(); + //focus javascript sur le premier champ print '