From f092be58c8fa7cb8ed76fb6d2932d747e685908e Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 5 May 2015 21:41:08 +0200 Subject: [PATCH 01/16] New: Add visual pagination for use on tablet --- htdocs/core/lib/functions.lib.php | 23 +++++----- htdocs/theme/eldy/style.css.php | 74 ++++++++++++++++++++++++++++++- 2 files changed, 86 insertions(+), 11 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7cf0e4ff91c..24984e9ee3f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2829,21 +2829,22 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so $nbpages=ceil($totalnboflines/$conf->liste_limit); $cpt=($page-$maxnbofpage); if ($cpt < 0) { $cpt=0; } - $pagelist.=$langs->trans('Page'); + $pagelist.=''; } } print_fleche_navigation($page,$file,$options,$nextpage,$pagelist); @@ -2881,17 +2882,19 @@ function print_fleche_navigation($page,$file,$options='',$nextpage=0,$betweenarr { global $conf, $langs; + print ''; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 5a490f5aef5..c8e0e46cf0e 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1546,7 +1546,7 @@ span.butAction, span.butActionDelete { cursor: pointer; } -/* Preapre for bootstrap look +/* Prepare for bootstrap look .butAction, .butActionDelete, .butActionRefused { border-color: #c5c5c5; border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); @@ -1807,6 +1807,78 @@ table.liste td { .tagtr, .table-border-row { display: table-row; } .tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; } +/* Pagination */ +div.pagination ul, div.pagination li +{ + list-style: none; + display: inline-block; + padding-left: 0px; +} + +div.pagination li { + display: inline; +} +.pagination { + display: inline-block; + padding-left: 0; + border-radius: 4px; +} + +div.pagination li a, +div.pagination li span { + position: relative; + float: left; + padding: 6px 12px; + margin-left: -1px; + line-height: 1.42857143; + color: #337ab7; + text-decoration: none; + background-color: #fff; + border: 1px solid #ddd; +} +div.pagination li:first-child a, +div.pagination li:first-child span { + margin-left: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; +} +div.pagination li:last-child a, +div.pagination li:last-child span { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} +div.pagination li a:hover, +div.pagination li span:hover, +div.pagination li a:focus, +div.pagination li span:focus { + color: #23527c; + background-color: #eee; + border-color: #ddd; +} +div.pagination li .active a, +div.pagination li .active span, +div.pagination li .active a:hover, +div.pagination li .active span:hover, +div.pagination li .active a:focus, +div.pagination li .active span:focus { + z-index: 2; + color: #fff; + cursor: default; + background-color: ; + border-color: #337ab7; +} +div.pagination .disabled span, +div.pagination .disabled span:hover, +div.pagination .disabled span:focus, +div.pagination .disabled a, +div.pagination .disabled a:hover, +div.pagination .disabled a:focus { + color: #777; + cursor: not-allowed; + background-color: #fff; + border-color: #ddd; +} + /* Prepare to remove class pair - impair .noborder > tbody > tr:nth-child(even) td { From 02d7c1cf01cb0931f6c12bd96dc8876332fb346a Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 12 May 2015 06:44:14 +0200 Subject: [PATCH 02/16] Deactivate Gradient into div.liste_titre --- htdocs/theme/md_exp/style.css.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/theme/md_exp/style.css.php b/htdocs/theme/md_exp/style.css.php index ee46a7f1aaa..1359290330c 100644 --- a/htdocs/theme/md_exp/style.css.php +++ b/htdocs/theme/md_exp/style.css.php @@ -4,6 +4,7 @@ * Copyright (C) 2007-2012 Regis Houssin * Copyright (C) 2011 Philippe Grand * Copyright (C) 2012 Juanjo Menent + * 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,8 +21,8 @@ */ /** - * \file htdocs/theme/eldy/style.css.php - * \brief File for CSS style sheet Eldy + * \file htdocs/theme/md_exp/style.css.php + * \brief File for CSS style sheet Md (Material Design) */ //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled because need to load personalized language @@ -1602,7 +1603,7 @@ span.butAction, span.butActionDelete { cursor: pointer; } -/* Preapre for bootstrap look +/* Prepare for bootstrap look .butAction, .butActionDelete, .butActionRefused { border-color: #c5c5c5; border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); @@ -1946,12 +1947,14 @@ div.liste_titre, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.list background: rgb(); background-repeat: repeat-x; + /* background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); background-image: -ms-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); background-image: linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); - font-weight: bold; + */ + font-weight: bold; color: #; font-family: ; From 304a6936a56c4876dfed4a166b05812415b24791 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 12 May 2015 06:58:29 +0200 Subject: [PATCH 03/16] Attenuate lines #ddd -> #f4f4f4 --- htdocs/theme/md_exp/style.css.php | 112 +++++++++++++++--------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/htdocs/theme/md_exp/style.css.php b/htdocs/theme/md_exp/style.css.php index 1359290330c..a0b62419971 100644 --- a/htdocs/theme/md_exp/style.css.php +++ b/htdocs/theme/md_exp/style.css.php @@ -273,7 +273,7 @@ select.flat, form.flat select { font-weight: normal; } input:disabled { - background:#ddd; + background:#f4f4f4; } input.liste_titre { @@ -284,7 +284,7 @@ input.removedfile { border: 0px !important; } textarea:disabled { - background:#ddd; + background:#f4f4f4; } input[type=checkbox] { background-color: transparent; border: none; box-shadow: none; } input[type=radio] { background-color: transparent; border: none; box-shadow: none; } @@ -303,7 +303,7 @@ input:-moz-placeholder { color:#ccc; } legend { margin-bottom: 8px; } -fieldset { border: 1px solid #AAAAAA !important; box-shadow: 2px 2px 3px #DDD; } +fieldset { border: 1px solid #AAAAAA !important; box-shadow: 2px 2px 3px #f4f4f4; } .button, sbmtConnexion { @@ -441,7 +441,7 @@ textarea.centpercent { .borderrightlight { - border-right: 1px solid #DDD; + border-right: 1px solid #f4f4f4; } #formuserfile_link { margin-left: 1px; @@ -959,7 +959,7 @@ table.login_table_securitycode tr td { min-width: 60px; } #img_securitycode { - border: 1px solid #DDDDDD; + border: 1px solid #f4f4f4; } #img_logo { max-width: 200px; @@ -1085,7 +1085,7 @@ div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks margin: 1px 0px 8px 0px; padding-bottom: 10px; - border-bottom: 1px solid #DDD; + border-bottom: 1px solid #f4f4f4; } div.blockvmenusearch @@ -1101,7 +1101,7 @@ div.blockvmenusearch margin: 1px 0px 8px 0px; padding-bottom: 10px; - border-bottom: 1px solid #DDD; + border-bottom: 1px solid #f4f4f4; } div.blockvmenuhelp @@ -1181,9 +1181,9 @@ td.photo { -moz-border-radius: 2px 2px 2px 2px !important; -webkit-border-radius: 2px 2px 2px 2px !important; border-radius: 2px 2px 2px 2px !important; - -moz-box-shadow: 2px 2px 4px #DDD; - -webkit-box-shadow: 2px 2px 4px #DDD; - box-shadow: 2px 2px 4px #DDD; + -moz-box-shadow: 2px 2px 4px #f4f4f4; + -webkit-box-shadow: 2px 2px 4px #f4f4f4; + box-shadow: 2px 2px 4px #f4f4f4; padding: 0 4px 0 4px !important; min-height: 32px; @@ -1246,7 +1246,7 @@ img.toolbarbutton { otherwise color shifts while dragging when bar can't keep up with mouse */ /*.ui-layout-resizer-open-hover ,*/ /* hover-color to 'resize' */ .ui-layout-resizer-dragging { /* resizer beging 'dragging' */ - background: #DDD; + background: #f4f4f4; width: dol_optimize_smallscreen)?'8':'24'); ?>px; } .ui-layout-resizer-dragging { /* CLONED resizer being dragged */ @@ -1258,7 +1258,7 @@ img.toolbarbutton { background: #E1A4A4; /* red */ } .ui-layout-resizer-closed { - background-color: #DDDDDD; + background-color: #f4f4f4; } .ui-layout-resizer-closed:hover { background-color: #EEDDDD; @@ -1287,7 +1287,7 @@ img.toolbarbutton { border-top: 1px solid #AAA; /* match pane-border */ border-right: 1px solid #AAA; /* match pane-border */ border-bottom: 1px solid #AAA; /* match pane-border */ - background-color: #DDD; + background-color: #f4f4f4; top: 5px !important; diplay: none; @@ -1427,9 +1427,9 @@ div.tabBar { background: rgb(); - -moz-box-shadow: 3px 3px 4px #DDD; - -webkit-box-shadow: 3px 3px 4px #DDD; - box-shadow: 3px 3px 4px #DDD; + -moz-box-shadow: 3px 3px 4px #f4f4f4; + -webkit-box-shadow: 3px 3px 4px #f4f4f4; + box-shadow: 3px 3px 4px #f4f4f4; } @@ -1472,7 +1472,7 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { border-bottom: none; border-right: 1px solid #CCCCCC; - border-left: 1px solid #D0D0D0; + border-left: 1px solid #f4f4f4; border-top: 1px solid #D8D8D8; */ @@ -1481,7 +1481,7 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { .tabactive, a.tab#active { border-right: 1px solid #CCCCCC; - border-left: 1px solid #D0D0D0; + border-left: 1px solid #f4f4f4; border-top: 1px solid #D8D8D8; -moz-border-radius:3px 3px 0px 0px; @@ -1556,9 +1556,9 @@ div.divButAction { margin-bottom: 1.4em; } -moz-border-radius:0px 2px 0px 2px; -webkit-border-radius:0px 2px 0px 2px; border-radius:0px 2px 0px 2px; - -moz-box-shadow: 2px 2px 3px #DDD; - -webkit-box-shadow: 2px 2px 3px #DDD; - box-shadow: 2px 2px 3px #DDD; + -moz-box-shadow: 2px 2px 3px #f4f4f4; + -webkit-box-shadow: 2px 2px 3px #f4f4f4; + box-shadow: 2px 2px 3px #f4f4f4; } .butAction:hover { @@ -1588,9 +1588,9 @@ div.divButAction { margin-bottom: 1.4em; } -moz-border-radius:0px 2px 0px 2px; -webkit-border-radius:0px 2px 0px 2px; border-radius:0px 2px 0px 2px; - -moz-box-shadow: 3px 3px 4px #DDD; - -webkit-box-shadow: 3px 3px 4px #DDD; - box-shadow: 3px 3px 4px #DDD; + -moz-box-shadow: 3px 3px 4px #f4f4f4; + -webkit-box-shadow: 3px 3px 4px #f4f4f4; + box-shadow: 3px 3px 4px #f4f4f4; } global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { ?> @@ -1727,7 +1727,7 @@ tr.nocellnopadd td.nobordernopadding, tr.nocellnopadd td.nocellnopadd table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col, div.border { - border: 1px solid #D0D0D0; + border: 1px solid #f4f4f4; border-collapse: collapse; padding: 1px 2px 1px 3px; /* t r b l */ } @@ -1741,7 +1741,7 @@ div.tabBar table.border tr { table.border td, div.border div div.tagtd { padding: 2px 2px 2px 2px; - border: 1px solid #D0D0D0; + border: 1px solid #f4f4f4; border-collapse: collapse; } @@ -1924,7 +1924,7 @@ table.dataTable td { } tr.even td, tr.pair td, tr.odd td, tr.impair td, form.odd div.tagtd, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd { padding: 5px 2px 5px 3px; - border-bottom: 1px solid #ddd; + border-bottom: 1px solid #f4f4f4; } tr.even td .nobordernopadding tr td, tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td, tr.odd td .nobordernopadding tr td { border-bottom: 0px !important; @@ -1999,7 +1999,7 @@ input.liste_titre { background: #F0F0F0; } .noborder tr.liste_total td, tr.liste_total td, form.liste_total div { - border-top: 1px solid #DDDDDD; + border-top: 1px solid #f4f4f4; color: #332266; font-weight: normal; white-space: nowrap; @@ -2021,15 +2021,15 @@ input.liste_titre { /* Disable shadows */ .noshadow { - -moz-box-shadow: 0px 0px 0px #DDD !important; - -webkit-box-shadow: 0px 0px 0px #DDD !important; - box-shadow: 0px 0px 0px #DDD !important; + -moz-box-shadow: 0px 0px 0px #f4f4f4 !important; + -webkit-box-shadow: 0px 0px 0px #f4f4f4 !important; + box-shadow: 0px 0px 0px #f4f4f4 !important; } div.tabBar .noborder { - -moz-box-shadow: 0px 0px 0px #DDD !important; - -webkit-box-shadow: 0px 0px 0px #DDD !important; - box-shadow: 0px 0px 0px #DDD !important; + -moz-box-shadow: 0px 0px 0px #f4f4f4 !important; + -webkit-box-shadow: 0px 0px 0px #f4f4f4 !important; + box-shadow: 0px 0px 0px #f4f4f4 !important; } @@ -2041,9 +2041,9 @@ div.tabBar .noborder { margin: 3px; padding: 3px; - /*-moz-box-shadow: 3px 3px 4px #DDD; - -webkit-box-shadow: 3px 3px 4px #DDD; - box-shadow: 3px 3px 4px #DDD; + /*-moz-box-shadow: 3px 3px 4px #f4f4f4; + -webkit-box-shadow: 3px 3px 4px #f4f4f4; + box-shadow: 3px 3px 4px #f4f4f4; margin-bottom: 8px !important;*/ border: 1px solid #AAA; text-align: center; @@ -2051,9 +2051,9 @@ div.tabBar .noborder { } .boxtable { - -moz-box-shadow: 3px 3px 4px #DDD; - -webkit-box-shadow: 3px 3px 4px #DDD; - box-shadow: 3px 3px 4px #DDD; + -moz-box-shadow: 3px 3px 4px #f4f4f4; + -webkit-box-shadow: 3px 3px 4px #f4f4f4; + box-shadow: 3px 3px 4px #f4f4f4; margin-bottom: 8px !important; } @@ -2103,7 +2103,7 @@ tr.box_pair { tr.box_pair td, tr.box_impair td { padding: 4px; - border-bottom: 1px solid #ddd; + border-bottom: 1px solid #f4f4f4; } .formboxfilter { @@ -2359,8 +2359,8 @@ img.datecallink { padding-left: 2px !important; padding-right: 2px !important; } table.dp { width: 180px; background-color: #FFFFFF; - border-top: solid 2px #DDDDDD; - border-: solid 2px #DDDDDD; + border-top: solid 2px #f4f4f4; + border-: solid 2px #f4f4f4; border-: solid 1px #222222; border-bottom: solid 1px #222222; padding: 0px; @@ -2392,14 +2392,14 @@ table.dp { .dpToday,.dpReg,.dpSelected{ cursor:pointer; } -.dpToday{font-weight:bold; color:black; background-color:#DDDDDD;} +.dpToday{font-weight:bold; color:black; background-color:#f4f4f4;} .dpReg:Hover,.dpToday:Hover{background-color:black;color:white} /* Jour courant */ .dpSelected{background-color:#0B63A2;color:white;font-weight:bold; } -.tpHour{border-top:1px solid #DDDDDD; border-right:1px solid #DDDDDD;} -.tpHour td {border-left:1px solid #DDDDDD; border-bottom:1px solid #DDDDDD; cursor:pointer;} +.tpHour{border-top:1px solid #f4f4f4; border-right:1px solid #f4f4f4;} +.tpHour td {border-left:1px solid #f4f4f4; border-bottom:1px solid #f4f4f4; cursor:pointer;} .tpHour td:Hover {background-color:black;color:white;} .tpMinute {margin-top:5px;} @@ -2732,9 +2732,9 @@ a.cke_dialog_ui_button -moz-border-radius:0px 2px 0px 2px !important; -webkit-border-radius:0px 2px 0px 2px !important; border-radius:0px 2px 0px 2px !important; - -moz-box-shadow: 3px 3px 4px #DDD !important; - -webkit-box-shadow: 3px 3px 4px #DDD !important; - box-shadow: 3px 3px 4px #DDD !important; + -moz-box-shadow: 3px 3px 4px #f4f4f4 !important; + -webkit-box-shadow: 3px 3px 4px #f4f4f4 !important; + box-shadow: 3px 3px 4px #f4f4f4 !important; } .cke_dialog_ui_hbox_last { @@ -2840,7 +2840,7 @@ ul.filedirelem li { text-align: center; display: block; float: ; - border: solid 1px #DDDDDD; + border: solid 1px #f4f4f4; } ui-layout-north { @@ -3193,12 +3193,12 @@ border-top-right-radius: 6px; text-shadow: 1px 0px 1px #; } .lilevel1 { - background-image: -webkit-gradient(linear,left top,left bottom,from( #ddd ),to( #d1d1d1 )) !important; - background-image: -webkit-linear-gradient( #ddd,#d1d1d1 ) !important; - background-image: -moz-linear-gradient( #ddd,#d1d1d1 ) !important; - background-image: -ms-linear-gradient( #ddd,#d1d1d1 ) !important; - background-image: -o-linear-gradient( #ddd,#d1d1d1 ) !important; - background-image: linear-gradient( #ddd,#d1d1d1 ) !important; + background-image: -webkit-gradient(linear,left top,left bottom,from( #f4f4f4 ),to( #d1d1d1 )) !important; + background-image: -webkit-linear-gradient( #f4f4f4,#d1d1d1 ) !important; + background-image: -moz-linear-gradient( #f4f4f4,#d1d1d1 ) !important; + background-image: -ms-linear-gradient( #f4f4f4,#d1d1d1 ) !important; + background-image: -o-linear-gradient( #f4f4f4,#d1d1d1 ) !important; + background-image: linear-gradient( #f4f4f4,#d1d1d1 ) !important; } .lilevel2 { From 95a2e65d8645066b82bf2b42e062a0381b8e033b Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Tue, 12 May 2015 09:01:15 +0100 Subject: [PATCH 04/16] Update list.php Fix forgotten last contributor information --- htdocs/fourn/facture/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 0ebd93a9ad8..887fa7c6fab 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -7,7 +7,8 @@ * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Marcos García * Copyright (C) 2015 juanjo Menent - * + * Copyright (C) 2015 Abbes Bahfir + * 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 From 83e7c8a065496544867bacc3453a395d7b800d22 Mon Sep 17 00:00:00 2001 From: Michael Fenton Date: Wed, 13 May 2015 11:20:06 +1000 Subject: [PATCH 05/16] Provide NotFound and Error return values Providing a Not Found Message when a Third Party entity is not found to match with details provided, and providing an Error Message when the SQL Lookup fails. This will help Asterisk Users determine whether the CallerID would be usable from Dolibarr or to reject and continue with existing CID from Asterisk --- htdocs/asterisk/cidlookup.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/asterisk/cidlookup.php b/htdocs/asterisk/cidlookup.php index 6b566e60f55..d1d965d99a7 100644 --- a/htdocs/asterisk/cidlookup.php +++ b/htdocs/asterisk/cidlookup.php @@ -32,7 +32,8 @@ include '../master.inc.php'; $phone = GETPOST('phone'); - +$notfound = "Not found"; +$error = "Error" // Security check if (empty($conf->clicktodial->enabled)) { @@ -64,13 +65,15 @@ if ($resql) if ($obj) { $found = $obj->name; + } else { + $found = $notfound; } $db->free($resql); } else { dol_print_error($db,'Error'); + $found = $error; } echo $found; - From 84935336eed4200c2e52d9eb43e40a64496ae3c8 Mon Sep 17 00:00:00 2001 From: tysauron Date: Wed, 13 May 2015 17:04:35 +0200 Subject: [PATCH 06/16] Update list.php Bug pagination du bas quand recherche --- htdocs/contact/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 21f48e58fb3..ec8004aa18a 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -437,7 +437,7 @@ if ($result) print ''; - if ($num > $limit) print_barre_liste('', $page, $_SERVER["PHP_SELF"], '&begin='.$begin.'&view='.$view.'&userid='.$userid, $sortfield, $sortorder, '', $num, $nbtotalofrecords, ''); + if ($num > $limit) print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, ''); $db->free($result); } From bba0349ab6feeed8a246d762ec4c11a67919c391 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 14 May 2015 07:36:48 +0200 Subject: [PATCH 07/16] ER: traduce code --- .../doc/pdf_standard.modules.php | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index d2cdb71e429..61d177086e3 100755 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; /** - * Classe permettant de generer les factures au modele Crabe + * Class to generate expense report based on standard model */ class pdf_standard extends ModeleExpenseReport { @@ -308,7 +308,7 @@ class pdf_standard extends ModeleExpenseReport $showpricebeforepagebreak=1; - // Piece comptable + // Accountancy piece $pdf->SetFont('','', $default_font_size - 1); $pdf->writeHTMLCell($this->posxcomment-$this->posxpiece-1, 3, $this->posxpiece-1, $curY, $piece_comptable, 0, 1); @@ -334,7 +334,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->SetXY($this->posxtype, $curY); $pdf->MultiCell($this->posxprojet-$this->posxtype-1, 3,$outputlangs->transnoentities($object->lines[$i]->type_fees_code), 0, 'C'); - // Projet + // Project $pdf->SetFont('','', $default_font_size - 1); $pdf->SetXY($this->posxprojet, $curY); $pdf->MultiCell($this->posxtva-$this->posxprojet-1, 3,$object->lines[$i]->projet_ref, 0, 'C'); @@ -344,7 +344,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->SetXY($this->posxtva, $curY); $pdf->MultiCell($this->posxup-$this->posxtva-1, 3,vatrate($object->lines[$i]->tva_taux,true), 0, 'R'); - // UP + // Unit price $pdf->SetFont('','', $default_font_size - 1); $pdf->SetXY($this->posxup, $curY); $pdf->MultiCell($this->posxqty-$this->posxup-1, 3,price($object->lines[$i]->value_unit), 0, 'R'); @@ -354,7 +354,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->SetXY($this->posxqty, $curY); $pdf->MultiCell($this->postotalttc-$this->posxqty, 3,$object->lines[$i]->qty, 0, 'C'); - // TotalTTC + // Total with all taxes $pdf->SetFont('','', $default_font_size - 1); $pdf->SetXY($this->postotalttc-2, $curY); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalttc, 3, price($object->lines[$i]->total_ttc), 0, 'R'); @@ -507,7 +507,7 @@ class pdf_standard extends ModeleExpenseReport pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); */ - // Filligrane brouillon + // Draft watermark if ($object->fk_statut==1 && ! empty($conf->global->EXPENSEREPORT_FREE_TEXT)) { pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->EXPENSEREPORT_FREE_TEXT); @@ -551,25 +551,25 @@ class pdf_standard extends ModeleExpenseReport $pdf->SetFont('','', $default_font_size -1); - // Réf complète + // Ref complete $posy+=8; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("Ref")." : " . $object->ref, '', 'L'); - // Date début période + // Date start period $posy+=5; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("DateStart")." : " . ($object->date_debut>0?dol_print_date($object->date_debut,"day",false,$outpulangs):''), '', 'L'); - // Date fin période + // Date end period $posy+=5; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("DateEnd")." : " . ($object->date_fin>0?dol_print_date($object->date_fin,"day",false,$outpulangs):''), '', 'L'); - // Statut NDF + // Status Expense Report $posy+=6; $pdf->SetXY($posx,$posy); $pdf->SetFont('','B',18); @@ -581,7 +581,7 @@ class pdf_standard extends ModeleExpenseReport $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($this->emetteur->address); $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($this->emetteur->zip).' '.$outputlangs->convToOutputCharset($this->emetteur->town); $carac_emetteur .= "\n"; - // Tel + // Phone if ($this->emetteur->phone) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Phone")." : ".$outputlangs->convToOutputCharset($this->emetteur->phone); // Fax if ($this->emetteur->fax) $carac_emetteur .= ($carac_emetteur ? ($this->emetteur->tel ? " - " : "\n") : '' ).$outputlangs->transnoentities("Fax")." : ".$outputlangs->convToOutputCharset($this->emetteur->fax); @@ -734,46 +734,46 @@ class pdf_standard extends ModeleExpenseReport $pdf->SetFont('','',8); - //Piece comptable + // Accountancy piece $pdf->SetXY($this->posxpiece-1, $tab_top+1); $pdf->MultiCell($this->posxdesc-$this->posxpiece-1,1,'','','R'); - //Comments + // Comments $pdf->line($this->posxdesc-1, $tab_top, $this->posxdesc-1, $tab_top + $tab_height); $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell($this->posxdate-$this->posxdesc-1,1,$outputlangs->transnoentities("Description"),'','L'); - //Date + // Date $pdf->line($this->posxdate-1, $tab_top, $this->posxdate-1, $tab_top + $tab_height); $pdf->SetXY($this->posxdate-1, $tab_top+1); $pdf->MultiCell($this->posxtype-$this->posxdate-1,2, $outputlangs->transnoentities("Date"),'','C'); - //Type + // Type $pdf->line($this->posxtype-1, $tab_top, $this->posxtype-1, $tab_top + $tab_height); $pdf->SetXY($this->posxtype-1, $tab_top+1); $pdf->MultiCell($this->posxprojet-$this->posxtype-1,2, $outputlangs->transnoentities("Type"),'','C'); - // Projet + // Project $pdf->line($this->posxprojet-1, $tab_top, $this->posxprojet-1, $tab_top + $tab_height); $pdf->SetXY($this->posxprojet-1, $tab_top+1); $pdf->MultiCell($this->posxtva-$this->posxprojet-1,2, $outputlangs->transnoentities("Project"),'','C'); - //TVA + // VAT $pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height); $pdf->SetXY($this->posxtva-1, $tab_top+1); $pdf->MultiCell($this->posxup-$this->posxtva-1,2, $outputlangs->transnoentities("VAT"),'','C'); - //PU + // Unit price $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height); $pdf->SetXY($this->posxup-1, $tab_top+1); $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("UP"),'','C'); - //QTY + // Quantity $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); $pdf->SetXY($this->posxqty-1, $tab_top+1); $pdf->MultiCell($this->postotalttc-$this->posxqty,2, $outputlangs->transnoentities("Qty"),'','R'); - //TOTALTTC + // Total with all taxes $pdf->line($this->postotalttc, $tab_top, $this->postotalttc, $tab_top + $tab_height); $pdf->SetXY($this->postotalttc-1, $tab_top+1); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalttc, 2, $outputlangs->transnoentities("TotalTTC"),'','R'); From 766c58724a450c8eb3c20ee10e68e2bc67c79224 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 14 May 2015 08:26:41 +0200 Subject: [PATCH 08/16] ER: Review & add a totalVAT in pdf --- .../doc/pdf_standard.modules.php | 21 ++++++--- htdocs/expensereport/card.php | 44 +++++++++---------- .../class/expensereport.class.php | 16 +++---- 3 files changed, 45 insertions(+), 36 deletions(-) diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 61d177086e3..900832600bf 100755 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -1,5 +1,6 @@ + * 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 @@ -23,9 +24,9 @@ */ require_once DOL_DOCUMENT_ROOT.'/core/modules/expensereport/modules_expensereport.php'; -require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"); -require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -252,7 +253,7 @@ class pdf_standard extends ModeleExpenseReport $tab_height = 110; $tab_height_newpage = 110; - // Affiche notes + // Show notes $notetoshow=empty($object->note_public)?'':$object->note_public; if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) { @@ -340,9 +341,10 @@ class pdf_standard extends ModeleExpenseReport $pdf->MultiCell($this->posxtva-$this->posxprojet-1, 3,$object->lines[$i]->projet_ref, 0, 'C'); // VAT Rate + $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); $pdf->SetFont('','', $default_font_size - 1); $pdf->SetXY($this->posxtva, $curY); - $pdf->MultiCell($this->posxup-$this->posxtva-1, 3,vatrate($object->lines[$i]->tva_taux,true), 0, 'R'); + $pdf->MultiCell($this->posxup-$this->posxtva-1, 3,$vat_rate, 0, 'R'); // Unit price $pdf->SetFont('','', $default_font_size - 1); @@ -438,6 +440,13 @@ class pdf_standard extends ModeleExpenseReport $pdf->SetXY(160, $posy); $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 160, 5, price($object->total_ht), 1, 'R'); $pdf->SetFillColor(248,248,248); + + $posy+=5; + $pdf->SetXY(100, $posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(60, 5, $outputlangs->transnoentities("TotalVAT"), 1,'L'); + $pdf->SetXY(160, $posy); + $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 160, 5, price($object->total_tva),1, 'R'); $posy+=5; $pdf->SetXY(100, $posy); @@ -766,7 +775,7 @@ class pdf_standard extends ModeleExpenseReport // Unit price $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height); $pdf->SetXY($this->posxup-1, $tab_top+1); - $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("UP"),'','C'); + $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceU"),'','C'); // Quantity $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 476a8862041..98099d305a7 100755 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -879,7 +879,7 @@ if ($action == "addline") $tmp = calcul_price_total($qty, $up, 0, $vatrate, 0, 0, 0, 'TTC', 0, $type); $object_ligne->total_ttc = $tmp[2]; - $object_ligne->tva_taux = GETPOST('vatrate'); + $object_ligne->tva_tx = GETPOST('vatrate'); $object_ligne->total_ht = $tmp[0]; $object_ligne->total_tva = $tmp[1]; @@ -1008,9 +1008,9 @@ if ($action == "updateligne" ) /* - * Generer ou regenerer le document PDF + * Generate or regenerate the PDF document */ -if ($action == 'builddoc') // En get ou en post +if ($action == 'builddoc') // GET or POST { $depl = new ExpenseReport($db, 0, $_GET['id']); $depl->fetch($id); @@ -1639,7 +1639,7 @@ else $formproject->select_projects(-1, $objp->fk_projet,'fk_projet', 0, 0, 0, 1); print ''; - // Sélect type + // Select type print ''; select_type_fees_id($objp->type_fees_code,'fk_c_type_fees'); print ''; @@ -1649,17 +1649,17 @@ else print ''; print ''; - // Sélection TVA + // Select VAT print ''; - print $form->load_tva('fk_c_tva', (isset($_POST["fk_c_tva"])?$_POST["fk_c_tva"]:$objp->tva_taux), $mysoc, ''); + print $form->load_tva('fk_c_tva', (isset($_POST["fk_c_tva"])?$_POST["fk_c_tva"]:$objp->tva_tx), $mysoc, ''); print ''; - // Prix unitaire + // Unit price print ''; print ''; print ''; - // Quantité + // Quantity print ''; print ''; print ''; @@ -1744,7 +1744,7 @@ else print ''; print ''; - // Prix unitaire + // Unit price print ''; print ''; print ''; @@ -1805,7 +1805,7 @@ if ($action != 'create' && $action != 'edit') { if ($object->fk_user_author == $user->id) { - // Modifier + // Modify print ''.$langs->trans('Modify').''; // Validate @@ -1816,7 +1816,7 @@ if ($action != 'create' && $action != 'edit') if ($user->rights->expensereport->supprimer) { - // Supprimer + // Delete print ''.$langs->trans('Delete').''; } } @@ -1831,7 +1831,7 @@ if ($action != 'create' && $action != 'edit') { if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) { - // Modifier + // Modify print ''.$langs->trans('Modify').''; // Brouillonner (le statut refusée est identique à brouillon) @@ -1841,7 +1841,7 @@ if ($action != 'create' && $action != 'edit') if ($user->rights->expensereport->supprimer) { - // Supprimer + // Delete print ''.$langs->trans('Delete').''; } } @@ -1874,9 +1874,9 @@ if ($action != 'create' && $action != 'edit') { //if($object->fk_user_validator==$user->id) //{ - // Valider + // Validate print ''.$langs->trans('Approve').''; - // Refuser + // Deny print ''.$langs->trans('Deny').''; //} @@ -1888,7 +1888,7 @@ if ($action != 'create' && $action != 'edit') if($user->rights->expensereport->supprimer) { - // Supprimer + // Delete print ''.$langs->trans('Delete').''; } } @@ -1899,7 +1899,7 @@ if ($action != 'create' && $action != 'edit') */ if ($user->rights->expensereport->to_paid && $object->fk_statut == 5) { - // Payer + // Pay print ''.$langs->trans('TO_PAID').''; // Cancel @@ -1910,7 +1910,7 @@ if ($action != 'create' && $action != 'edit') if($user->rights->expensereport->supprimer) { - // Supprimer + // Delete print ''.$langs->trans('Delete').''; } } @@ -1922,11 +1922,11 @@ if ($action != 'create' && $action != 'edit') */ if ($user->rights->expensereport->approve && $user->rights->expensereport->to_paid && $object->fk_statut==6) { - // Annuler + // Cancel print ''.$langs->trans('Cancel').''; if($user->rights->expensereport->supprimer) { - // Supprimer + // Delete print ''.$langs->trans('Delete').''; } } @@ -1944,7 +1944,7 @@ if ($action != 'create' && $action != 'edit') print ''.$langs->trans('ReOpen').''; } - // Supprimer + // Delete print ''.$langs->trans('Delete').''; } @@ -1959,7 +1959,7 @@ print ''; print '
'; /* - * Documents generes + * Generate documents */ if($user->rights->expensereport->export && $object->fk_statut>0 && $action != 'edit') { diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 63924d9c952..f65f0c814d5 100755 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -540,7 +540,7 @@ class ExpenseReport extends CommonObject $line->total_ttc=120; $line->qty=1; $line->fk_c_tva=20; - $line->tva_taux=20; + $line->tva_tx=20; $line->value_unit=120; $line->fk_expensereport=0; $line->type_fees_code='TRA'; @@ -761,7 +761,7 @@ class ExpenseReport extends CommonObject $deplig->type_fees_code = $objp->code_type_fees; $deplig->type_fees_libelle = $objp->libelle_type_fees; - $deplig->tva_taux = $objp->taux_tva; + $deplig->tva_tx = $objp->vatrate; $deplig->projet_ref = $objp->ref_projet; $deplig->projet_title = $objp->title_projet; @@ -1207,7 +1207,7 @@ class ExpenseReport extends CommonObject $this->db->begin(); // Select du taux de tva par rapport au code - $sql = "SELECT t.taux as taux_tva"; + $sql = "SELECT t.taux as vatrate"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t"; $sql.= " WHERE t.rowid = ".$c_tva; $result = $this->db->query($sql); @@ -1217,7 +1217,7 @@ class ExpenseReport extends CommonObject $total_ttc = $qty*$value_unit; $total_ttc = number_format($total_ttc,2,'.',''); - $tx_tva = $objp_tva->taux_tva/100; + $tx_tva = $objp_tva->vatrate/100; $tx_tva = $tx_tva + 1; $total_ht = $total_ttc/$tx_tva; $total_ht = number_format($total_ht,2,'.',''); @@ -1239,7 +1239,7 @@ class ExpenseReport extends CommonObject $ligne->total_ht = $total_ht; $ligne->total_tva = $total_tva; $ligne->total_ttc = $total_ttc; - $ligne->tva_taux = $objp_tva->taux_tva; + $ligne->tva_tx = $objp_tva->vatrate; $ligne->rowid = $rowid; // Select des infos sur le type fees @@ -1487,7 +1487,7 @@ class ExpenseReportLine var $projet_ref; var $projet_title; - var $tva_taux; + var $tva_tx; var $total_ht; var $total_tva; @@ -1512,7 +1512,7 @@ class ExpenseReportLine function fetch($rowid) { $sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_projet, fde.date,'; - $sql.= ' fde.fk_c_tva as tva_taux, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,'; + $sql.= ' fde.fk_c_tva as tva_tx, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,'; $sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,'; $sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref'; $sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde'; @@ -1539,7 +1539,7 @@ class ExpenseReportLine $this->type_fees_libelle = $objp->type_fees_libelle; $this->projet_ref = $objp->projet_ref; $this->projet_title = $objp->projet_title; - $this->tva_taux = $objp->tva_taux; + $this->tva_tx = $objp->tva_tx; $this->total_ht = $objp->total_ht; $this->total_tva = $objp->total_tva; $this->total_ttc = $objp->total_ttc; From 33b9d492e27d2c6ec4235329049cb2d4a064ec75 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2015 15:43:07 +0200 Subject: [PATCH 09/16] Clean code --- htdocs/core/class/html.form.class.php | 23 +++++++-------- htdocs/install/upgrade2.php | 40 +++++++++++++-------------- 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2b8912245d5..8b17eb7b996 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3842,10 +3842,10 @@ class Form /** * Output an HTML select vat rate * - * @param string $htmlname Nom champ html - * @param float $selectedrate Forcage du taux tva pre-selectionne. Mettre '' pour aucun forcage. - * @param Societe $societe_vendeuse Objet societe vendeuse - * @param Societe $societe_acheteuse Objet societe acheteuse + * @param string $htmlname Name of html select field + * @param float $selectedrate Force preselected vat rate. Use '' for no forcing. + * @param Societe $societe_vendeuse Thirdparty seller + * @param Societe $societe_acheteuse Thirdparty buyer * @param int $idprod Id product * @param int $info_bits Miscellaneous information on line (1 for NPR) * @param int $type ''=Unknown, 0=Product, 1=Service (Used if idprod not defined) @@ -3863,9 +3863,6 @@ class Form global $langs,$conf,$mysoc; $return=''; - $txtva=array(); - $libtva=array(); - $nprtva=array(); // Define defaultnpr and defaultttx $defaultnpr=($info_bits & 0x01); @@ -4425,7 +4422,7 @@ class Form static function selectArrayAjax($url, $htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0) { $out = ''; - + // Add code for jquery to use multiselect if ($addjscombo && empty($conf->dol_use_jmobile)) { @@ -4466,14 +4463,14 @@ class Form else { // TODO get values from ajax page to use a standard already completed array - + } - + $out.=self::selectarray('.'.$htmlname, $array, $id, $show_empty, $key_in_label, $value_as_key, '', $translate, $maxlen, $disabled, $sort, '', 0); - + return $out; } - + /** * Show a multiselect form from an array. * @@ -4568,7 +4565,7 @@ class Form } - + /** * Render list of categories linked to object with id $id and type $type * diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 091218513af..70ebd8550c5 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -1292,7 +1292,7 @@ function migrate_price_facture($db,$langs,$conf) print ''.$langs->trans('MigrationInvoice')."
\n"; // Liste des lignes facture non a jour - $sql = "SELECT fd.rowid, fd.qty, fd.subprice, fd.remise_percent, fd.tva_tx as tva_taux, fd.total_ttc, fd.info_bits,"; + $sql = "SELECT fd.rowid, fd.qty, fd.subprice, fd.remise_percent, fd.tva_tx as vatrate, fd.total_ttc, fd.info_bits,"; $sql.= " f.rowid as facid, f.remise_percent as remise_percent_global, f.total_ttc as total_ttc_f"; $sql.= " FROM ".MAIN_DB_PREFIX."facturedet as fd, ".MAIN_DB_PREFIX."facture as f"; $sql.= " WHERE fd.fk_facture = f.rowid"; @@ -1314,7 +1314,7 @@ function migrate_price_facture($db,$langs,$conf) $rowid = $obj->rowid; $qty = $obj->qty; $pu = $obj->subprice; - $txtva = $obj->tva_taux; + $vatrate = $obj->vatrate; $remise_percent = $obj->remise_percent; $remise_percent_global = $obj->remise_percent_global; $total_ttc_f = $obj->total_ttc_f; @@ -1324,7 +1324,7 @@ function migrate_price_facture($db,$langs,$conf) $facligne= new FactureLigne($db); $facligne->fetch($rowid); - $result=calcul_price_total($qty,$pu,$remise_percent,$txtva, 0, 0,$remise_percent_global,'HT',$info_bits,0); + $result=calcul_price_total($qty,$pu,$remise_percent,$vatrate, 0, 0,$remise_percent_global,'HT',$info_bits,0); $total_ht = $result[0]; $total_tva = $result[1]; $total_ttc = $result[2]; @@ -1333,7 +1333,7 @@ function migrate_price_facture($db,$langs,$conf) $facligne->total_tva = $total_tva; $facligne->total_ttc = $total_ttc; - dolibarr_install_syslog("upgrade2: Line $rowid: facid=$obj->facid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc"); + dolibarr_install_syslog("upgrade2: Line $rowid: facid=$obj->facid pu=$pu qty=$qty vatrate=$vatrate remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc"); print ". "; $facligne->update_total(); @@ -1406,7 +1406,7 @@ function migrate_price_propal($db,$langs,$conf) print ''.$langs->trans('MigrationProposal')."
\n"; // Liste des lignes propal non a jour - $sql = "SELECT pd.rowid, pd.qty, pd.subprice, pd.remise_percent, pd.tva_tx as tva_taux, pd.info_bits,"; + $sql = "SELECT pd.rowid, pd.qty, pd.subprice, pd.remise_percent, pd.tva_tx as vatrate, pd.info_bits,"; $sql.= " p.rowid as propalid, p.remise_percent as remise_percent_global"; $sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pd, ".MAIN_DB_PREFIX."propal as p"; $sql.= " WHERE pd.fk_propal = p.rowid"; @@ -1427,7 +1427,7 @@ function migrate_price_propal($db,$langs,$conf) $rowid = $obj->rowid; $qty = $obj->qty; $pu = $obj->subprice; - $txtva = $obj->tva_taux; + $vatrate = $obj->vatrate; $remise_percent = $obj->remise_percent; $remise_percent_global = $obj->remise_percent_global; $info_bits = $obj->info_bits; @@ -1436,7 +1436,7 @@ function migrate_price_propal($db,$langs,$conf) $propalligne= new PropaleLigne($db); $propalligne->fetch($rowid); - $result=calcul_price_total($qty,$pu,$remise_percent,$txtva,0,0,$remise_percent_global,'HT',$info_bits,0); + $result=calcul_price_total($qty,$pu,$remise_percent,$vatrate,0,0,$remise_percent_global,'HT',$info_bits,0); $total_ht = $result[0]; $total_tva = $result[1]; $total_ttc = $result[2]; @@ -1445,7 +1445,7 @@ function migrate_price_propal($db,$langs,$conf) $propalligne->total_tva = $total_tva; $propalligne->total_ttc = $total_ttc; - dolibarr_install_syslog("upgrade2: Line $rowid: propalid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc"); + dolibarr_install_syslog("upgrade2: Line $rowid: propalid=$obj->rowid pu=$pu qty=$qty vatrate=$vatrate remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc"); print ". "; $propalligne->update_total(); @@ -1515,7 +1515,7 @@ function migrate_price_contrat($db,$langs,$conf) print ''.$langs->trans('MigrationContract')."
\n"; // Liste des lignes contrat non a jour - $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as tva_taux, cd.info_bits,"; + $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as vatrate, cd.info_bits,"; $sql.= " c.rowid as contratid"; $sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c"; $sql.= " WHERE cd.fk_contrat = c.rowid"; @@ -1536,7 +1536,7 @@ function migrate_price_contrat($db,$langs,$conf) $rowid = $obj->rowid; $qty = $obj->qty; $pu = $obj->subprice; - $txtva = $obj->tva_taux; + $vatrate = $obj->vatrate; $remise_percent = $obj->remise_percent; $info_bits = $obj->info_bits; @@ -1545,7 +1545,7 @@ function migrate_price_contrat($db,$langs,$conf) //$contratligne->fetch($rowid); Non requis car le update_total ne met a jour que chp redefinis $contratligne->id=$rowid; - $result=calcul_price_total($qty,$pu,$remise_percent,$txtva,0,0,0,'HT',$info_bits,0,$tmpmysoc); + $result=calcul_price_total($qty,$pu,$remise_percent,$vatrate,0,0,0,'HT',$info_bits,0,$tmpmysoc); $total_ht = $result[0]; $total_tva = $result[1]; $total_ttc = $result[2]; @@ -1554,7 +1554,7 @@ function migrate_price_contrat($db,$langs,$conf) $contratligne->total_tva = $total_tva; $contratligne->total_ttc = $total_ttc; - dolibarr_install_syslog("upgrade2: Line $rowid: contratdetid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent -> $total_ht, $total_tva, $total_ttc"); + dolibarr_install_syslog("upgrade2: Line $rowid: contratdetid=$obj->rowid pu=$pu qty=$qty vatrate=$vatrate remise_percent=$remise_percent -> $total_ht, $total_tva, $total_ttc"); print ". "; $contratligne->update_total(); @@ -1600,7 +1600,7 @@ function migrate_price_commande($db,$langs,$conf) print ''.$langs->trans('MigrationOrder')."
\n"; // Liste des lignes commande non a jour - $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as tva_taux, cd.info_bits,"; + $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as vatrate, cd.info_bits,"; $sql.= " c.rowid as commandeid, c.remise_percent as remise_percent_global"; $sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd, ".MAIN_DB_PREFIX."commande as c"; $sql.= " WHERE cd.fk_commande = c.rowid"; @@ -1621,7 +1621,7 @@ function migrate_price_commande($db,$langs,$conf) $rowid = $obj->rowid; $qty = $obj->qty; $pu = $obj->subprice; - $txtva = $obj->tva_taux; + $vatrate = $obj->vatrate; $remise_percent = $obj->remise_percent; $remise_percent_global = $obj->remise_percent_global; $info_bits = $obj->info_bits; @@ -1630,7 +1630,7 @@ function migrate_price_commande($db,$langs,$conf) $commandeligne= new OrderLine($db); $commandeligne->fetch($rowid); - $result=calcul_price_total($qty,$pu,$remise_percent,$txtva,0,0,$remise_percent_global,'HT',$info_bits,0); + $result=calcul_price_total($qty,$pu,$remise_percent,$vatrate,0,0,$remise_percent_global,'HT',$info_bits,0); $total_ht = $result[0]; $total_tva = $result[1]; $total_ttc = $result[2]; @@ -1639,7 +1639,7 @@ function migrate_price_commande($db,$langs,$conf) $commandeligne->total_tva = $total_tva; $commandeligne->total_ttc = $total_ttc; - dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc"); + dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty vatrate=$vatrate remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc"); print ". "; $commandeligne->update_total(); @@ -1714,7 +1714,7 @@ function migrate_price_commande_fournisseur($db,$langs,$conf) print ''.$langs->trans('MigrationSupplierOrder')."
\n"; // Liste des lignes commande non a jour - $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as tva_taux, cd.info_bits,"; + $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as vatrate, cd.info_bits,"; $sql.= " c.rowid as commandeid, c.remise_percent as remise_percent_global"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd, ".MAIN_DB_PREFIX."commande_fournisseur as c"; $sql.= " WHERE cd.fk_commande = c.rowid"; @@ -1735,7 +1735,7 @@ function migrate_price_commande_fournisseur($db,$langs,$conf) $rowid = $obj->rowid; $qty = $obj->qty; $pu = $obj->subprice; - $txtva = $obj->tva_taux; + $vatrate = $obj->vatrate; $remise_percent = $obj->remise_percent; $remise_percent_global = $obj->remise_percent_global; $info_bits = $obj->info_bits; @@ -1744,7 +1744,7 @@ function migrate_price_commande_fournisseur($db,$langs,$conf) $commandeligne= new CommandeFournisseurLigne($db); $commandeligne->fetch($rowid); - $result=calcul_price_total($qty,$pu,$remise_percent,$txtva,0,0,$remise_percent_global,'HT',$info_bits,0); + $result=calcul_price_total($qty,$pu,$remise_percent,$vatrate,0,0,$remise_percent_global,'HT',$info_bits,0); $total_ht = $result[0]; $total_tva = $result[1]; $total_ttc = $result[2]; @@ -1753,7 +1753,7 @@ function migrate_price_commande_fournisseur($db,$langs,$conf) $commandeligne->total_tva = $total_tva; $commandeligne->total_ttc = $total_ttc; - dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc"); + dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty vatrate=$vatrate remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc"); print ". "; $commandeligne->update_total(); From 74607218eacf3cf6607ca3cc8323a9d9cc5883f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2015 15:59:09 +0200 Subject: [PATCH 10/16] Fight against key tva_taux. Removed completely. --- htdocs/core/class/html.form.class.php | 7 ------- .../expensereport/doc/pdf_standard.modules.php | 2 +- htdocs/expensereport/card.php | 10 +++++----- .../expensereport/class/expensereport.class.php | 15 +++++++-------- .../mysql/tables/llx_expensereport_det.sql | 2 +- htdocs/product/class/html.formproduct.class.php | 12 ++++-------- 6 files changed, 18 insertions(+), 30 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8b17eb7b996..406ad24db4b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -56,9 +56,6 @@ class Form var $cache_types_fees=array(); var $cache_vatrates=array(); - var $tva_taux_value; - var $tva_taux_libelle; - /** * Constructor @@ -3969,10 +3966,6 @@ class Form $return.= '>'.vatrate($rate['libtva']); $return.= $rate['nprtva'] ? ' *': ''; $return.= ''; - - $this->tva_taux_value[] = $rate['txtva']; - $this->tva_taux_libelle[] = $rate['libtva']; - $this->tva_taux_npr[] = $rate['nprtva']; } if (! $options_only) $return.= ''; diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index d2cdb71e429..b8547c687f6 100755 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -342,7 +342,7 @@ class pdf_standard extends ModeleExpenseReport // VAT Rate $pdf->SetFont('','', $default_font_size - 1); $pdf->SetXY($this->posxtva, $curY); - $pdf->MultiCell($this->posxup-$this->posxtva-1, 3,vatrate($object->lines[$i]->tva_taux,true), 0, 'R'); + $pdf->MultiCell($this->posxup-$this->posxtva-1, 3,vatrate($object->lines[$i]->vatrate,true), 0, 'R'); // UP $pdf->SetFont('','', $default_font_size - 1); diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 476a8862041..385e5b86037 100755 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -879,7 +879,7 @@ if ($action == "addline") $tmp = calcul_price_total($qty, $up, 0, $vatrate, 0, 0, 0, 'TTC', 0, $type); $object_ligne->total_ttc = $tmp[2]; - $object_ligne->tva_taux = GETPOST('vatrate'); + $object_ligne->vatrate = GETPOST('vatrate'); $object_ligne->total_ht = $tmp[0]; $object_ligne->total_tva = $tmp[1]; @@ -1649,17 +1649,17 @@ else print ''; print ''; - // Sélection TVA + // VAT print ''; - print $form->load_tva('fk_c_tva', (isset($_POST["fk_c_tva"])?$_POST["fk_c_tva"]:$objp->tva_taux), $mysoc, ''); + print $form->load_tva('fk_c_tva', (isset($_POST["fk_c_tva"])?$_POST["fk_c_tva"]:$objp->vatrate), $mysoc, ''); print ''; - // Prix unitaire + // Unit price print ''; print ''; print ''; - // Quantité + // Qty print ''; print ''; print ''; diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 63924d9c952..1a0a94f0266 100755 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -540,7 +540,7 @@ class ExpenseReport extends CommonObject $line->total_ttc=120; $line->qty=1; $line->fk_c_tva=20; - $line->tva_taux=20; + $line->vatrate=20; $line->value_unit=120; $line->fk_expensereport=0; $line->type_fees_code='TRA'; @@ -724,7 +724,7 @@ class ExpenseReport extends CommonObject $this->lines=array(); $sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date,'; - $sql.= ' de.'.$this->fk_element.', de.fk_c_type_fees, de.fk_projet, de.fk_c_tva,'; + $sql.= ' de.'.$this->fk_element.', de.fk_c_type_fees, de.fk_projet, de.fk_c_tva, de.tva_tx as vatrate,'; $sql.= ' de.total_ht, de.total_tva, de.total_ttc,'; $sql.= ' ctf.code as code_type_fees, ctf.label as libelle_type_fees,'; $sql.= ' p.ref as ref_projet, p.title as title_projet'; @@ -761,7 +761,7 @@ class ExpenseReport extends CommonObject $deplig->type_fees_code = $objp->code_type_fees; $deplig->type_fees_libelle = $objp->libelle_type_fees; - $deplig->tva_taux = $objp->taux_tva; + $deplig->vatrate = $objp->vatrate; $deplig->projet_ref = $objp->ref_projet; $deplig->projet_title = $objp->title_projet; @@ -1239,7 +1239,7 @@ class ExpenseReport extends CommonObject $ligne->total_ht = $total_ht; $ligne->total_tva = $total_tva; $ligne->total_ttc = $total_ttc; - $ligne->tva_taux = $objp_tva->taux_tva; + $ligne->vatrate = $objp_tva->vatrate; $ligne->rowid = $rowid; // Select des infos sur le type fees @@ -1487,8 +1487,7 @@ class ExpenseReportLine var $projet_ref; var $projet_title; - var $tva_taux; - + var $vatrate; var $total_ht; var $total_tva; var $total_ttc; @@ -1512,7 +1511,7 @@ class ExpenseReportLine function fetch($rowid) { $sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_projet, fde.date,'; - $sql.= ' fde.fk_c_tva as tva_taux, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,'; + $sql.= ' fde.fk_c_tva as fk_c_tva, fde.tva_tx as vatrate, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,'; $sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,'; $sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref'; $sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde'; @@ -1539,7 +1538,7 @@ class ExpenseReportLine $this->type_fees_libelle = $objp->type_fees_libelle; $this->projet_ref = $objp->projet_ref; $this->projet_title = $objp->projet_title; - $this->tva_taux = $objp->tva_taux; + $this->vatrate = $objp->vatrate; $this->total_ht = $objp->total_ht; $this->total_tva = $objp->total_tva; $this->total_ttc = $objp->total_ttc; diff --git a/htdocs/install/mysql/tables/llx_expensereport_det.sql b/htdocs/install/mysql/tables/llx_expensereport_det.sql index 418f1ce6cc5..ef9f03b9bbb 100644 --- a/htdocs/install/mysql/tables/llx_expensereport_det.sql +++ b/htdocs/install/mysql/tables/llx_expensereport_det.sql @@ -28,7 +28,7 @@ CREATE TABLE llx_expensereport_det qty real NOT NULL, value_unit real NOT NULL, remise_percent real, - tva_tx double(6,3), -- Vat rat + tva_tx double(6,3), -- Vat rate localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate localtax1_type varchar(10) NULL, -- localtax1 type localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 6fc649c272e..0215f20e3c6 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -22,9 +22,8 @@ /** - * \class FormProduct - * \brief Class with static methods for building HTML components related to products - * \remarks Only common components must be here. + * Class with static methods for building HTML components related to products + * Only components common to products and services must be here. */ class FormProduct { @@ -34,9 +33,6 @@ class FormProduct // Cache arrays var $cache_warehouses=array(); - var $tva_taux_value; - var $tva_taux_libelle; - /** * Constructor @@ -109,7 +105,7 @@ class FormProduct * @param int $empty 1=Can be empty, 0 if not * @param int $disabled 1=Select is disabled * @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0. - * @param string $empty_label Empty label if needed (only if $empty=1) + * @param string $empty_label Empty label if needed (only if $empty=1) * @return string HTML select */ function selectWarehouses($selected='',$htmlname='idwarehouse',$filtertype='',$empty=0,$disabled=0,$fk_product=0,$empty_label='') @@ -120,7 +116,7 @@ class FormProduct $this->loadWarehouses($fk_product); $nbofwarehouses=count($this->cache_warehouses); - + $out=''; print ''; + dol_fiche_head(''); + print ''; // Ref - print ''; + print ''; print ''; // Label - print ''; + print ''; print ''; // Type - print ''; + print ''; print ''; // Currency - print ''; + print ''; print ''; // Status - print ''; + print ''; print ''; @@ -307,7 +309,7 @@ if ($action == 'create') else if (empty($selectedcode)) $selectedcode=$mysoc->country_code; $account->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules - print ''; + print ''; print ''; // Web - print ''; + print ''; print ''; // Comment - print ''; + print ''; print ''; + print ''; print ''; // Label - print ''; + print ''; print ''; // Type - print ''; + print ''; print ''; // Currency - print ''; + print ''; print ''; // Status - print ''; + print ''; print ''; // Country @@ -579,7 +583,7 @@ else print ''; // Conciliate - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print '\n"; - print ''; + print ''; print ''; // Other attributes @@ -687,7 +691,7 @@ else if ($account->getCountryCode() == 'IN') $ibankey="IFSC"; if ($account->getCountryCode() == 'IN') $bickey="SWIFT"; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print '\n"; - print '\n"; - print '\n"; @@ -727,13 +731,13 @@ else print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").'ref).'" maxlength="12">
'.$langs->trans("LabelBankCashAccount").'
'.$langs->trans("LabelBankCashAccount").'
'.$langs->trans("AccountType").'
'.$langs->trans("AccountType").''; $formbank->select_type_comptes_financiers(isset($_POST["type"])?$_POST["type"]:1,"type"); print '
'.$langs->trans("Currency").'
'.$langs->trans("Currency").''; $selectedcode=$account->account_currency_code; if (! $selectedcode) $selectedcode=$conf->currency; @@ -293,7 +295,7 @@ if ($action == 'create') print '
'.$langs->trans("Status").'
'.$langs->trans("Status").''; print $form->selectarray("clos",array(0=>$account->status[0],1=>$account->status[1]),(isset($_POST["clos"])?$_POST["clos"]:$account->clos)); print '
'.$langs->trans("BankAccountCountry").'
'.$langs->trans("BankAccountCountry").''; print $form->select_country($selectedcode,'account_country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); @@ -326,11 +328,11 @@ if ($action == 'create') print '
'.$langs->trans("Web").'
'.$langs->trans("Web").'
'.$langs->trans("Comment").'
'.$langs->trans("Comment").''; // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -353,18 +355,18 @@ if ($action == 'create') print ''; // Sold - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print '
'.$langs->trans("InitialBankBalance").'
'.$langs->trans("InitialBankBalance").'solde)).'">
'.$langs->trans("Date").'
'.$langs->trans("Date").''; $form->select_date('', 're', 0, 0, 0, 'formsoc'); print '
'.$langs->trans("BalanceMinimalAllowed").'
'.$langs->trans("BalanceMinimalAllowed").'account_min_allowed).'">
'.$langs->trans("BalanceMinimalDesired").'
'.$langs->trans("BalanceMinimalDesired").'account_min_desired).'">
'; @@ -375,7 +377,7 @@ if ($action == 'create') print ''; // If bank account - print ''; + print ''; print ''; print ''; @@ -452,16 +454,16 @@ if ($action == 'create') print ''; print ''; - print '"; - print ''; + print ''; print ''; - print '"; @@ -474,25 +476,27 @@ if ($action == 'create') // Accountancy code if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) { - print ''; + print ''; print ''; } else { - print ''; + print ''; print ''; } // Accountancy journal if (! empty($conf->accounting->enabled)) { - print ''; + print ''; print ''; } print '
'.$langs->trans("BankName").'
'.$langs->trans("BankName").'
'.$langs->trans($bickey).'
'.$langs->trans("BankAccountDomiciliation").''; + print '
'.$langs->trans("BankAccountDomiciliation").''; print "
'.$langs->trans("BankAccountOwner").'
'.$langs->trans("BankAccountOwner").''; print '
'.$langs->trans("BankAccountOwnerAddress").''; + print '
'.$langs->trans("BankAccountOwnerAddress").''; print "
'.$langs->trans("AccountancyCode").'
'.$langs->trans("AccountancyCode").'account_number).'">
'.$langs->trans("AccountancyCode").'
'.$langs->trans("AccountancyCode").'account_number).'">
'.$langs->trans("AccountancyJournal").'
'.$langs->trans("AccountancyJournal").'accountancy_journal).'">
'; - print '
'; + dol_fiche_end(); + + print '
'; print ''; } @@ -538,21 +542,21 @@ else $linkback = ''.$langs->trans("BackToList").''; // Ref - print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").''; print $form->showrefnav($account, 'ref', $linkback, 1, 'ref'); print '
'.$langs->trans("Label").'
'.$langs->trans("Label").''.$account->label.'
'.$langs->trans("AccountType").'
'.$langs->trans("AccountType").''.$account->type_lib[$account->type].'
'.$langs->trans("Currency").'
'.$langs->trans("Currency").''; $selectedcode=$account->account_currency_code; if (! $selectedcode) $selectedcode=$conf->currency; @@ -560,7 +564,7 @@ else print '
'.$langs->trans("Status").'
'.$langs->trans("Status").''.$account->getLibStatut(4).'
'.$langs->trans("Conciliable").'
'.$langs->trans("Conciliable").''; $conciliate=$account->canBeConciliated(); if ($conciliate == -2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')'; @@ -587,19 +591,19 @@ else else print ($account->rappro==1 ? $langs->trans("Yes") : ($langs->trans("No").' ('.$langs->trans("ConciliationDisabled").')')); print '
'.$langs->trans("BalanceMinimalAllowed").'
'.$langs->trans("BalanceMinimalAllowed").''.$account->min_allowed.'
'.$langs->trans("BalanceMinimalDesired").'
'.$langs->trans("BalanceMinimalDesired").''.$account->min_desired.'
'.$langs->trans("Web").''; + print '
'.$langs->trans("Web").''; if ($account->url) print ''; print $account->url; if ($account->url) print ''; print "
'.$langs->trans("Comment").'
'.$langs->trans("Comment").''.dol_htmlentitiesbr($account->comment).'
'.$langs->trans($ibankey).'
'.$langs->trans($ibankey).''.$account->iban.' '; if (! empty($account->iban)) { if (! checkIbanForAccount($account)) { @@ -698,7 +702,7 @@ else } print '
'.$langs->trans($bickey).'
'.$langs->trans($bickey).''.$account->bic.' '; if (! empty($account->bic)) { if (! checkSwiftForAccount($account)) { @@ -709,15 +713,15 @@ else } print '
'.$langs->trans("BankAccountDomiciliation").''; + print '
'.$langs->trans("BankAccountDomiciliation").''; print nl2br($account->domiciliation); print "
'.$langs->trans("BankAccountOwner").''; + print '
'.$langs->trans("BankAccountOwner").''; print $account->proprio; print "
'.$langs->trans("BankAccountOwnerAddress").''; + print '
'.$langs->trans("BankAccountOwnerAddress").''; print nl2br($account->owner_address); print "
'; // Accountancy code - print ''; + print ''; print ''; // Accountancy journal if (! empty($conf->accounting->enabled)) { - print ''; + print ''; print ''; } @@ -799,24 +803,26 @@ else print ''; print ''."\n\n"; + dol_fiche_head(''); + print '
'.$langs->trans("AccountancyCode").'
'.$langs->trans("AccountancyCode").''.$account->account_number.'
'.$langs->trans("AccountancyJournal").'
'.$langs->trans("AccountancyJournal").''.$account->accountancy_journal.'
'; // Ref - print ''; + print ''; print ''; // Label - print ''; + print ''; print ''; // Type - print ''; + print ''; print ''; // Currency - print ''; print ''; // Status - print ''; + print ''; print ''; @@ -840,7 +846,7 @@ else else if (empty($selectedcode)) $selectedcode=$mysoc->country_code; $account->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules - print ''; + print ''; print ''; // Conciliable - print ''; + print ''; print ''; // Balance - print ''; + print ''; print ''; - print ''; + print ''; print ''; // Web - print ''; + print ''; print ''; // Comment - print ''; + print ''; print ''; + print ''; print ''; // Label - print ''; + print ''; print ''; print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").'ref).'">
'.$langs->trans("Label").'
'.$langs->trans("Label").'label).'">
'.$langs->trans("AccountType").'
'.$langs->trans("AccountType").''; $formbank->select_type_comptes_financiers((isset($_POST["type"])?$_POST["type"]:$account->type),"type"); print '
'.$langs->trans("Currency"); + print '
'.$langs->trans("Currency"); print ''; print ''; @@ -828,7 +834,7 @@ else print '
'.$langs->trans("Status").'
'.$langs->trans("Status").''; print $form->selectarray("clos",array(0=>$account->status[0],1=>$account->status[1]),(isset($_POST["clos"])?$_POST["clos"]:$account->clos)); print '
'.$langs->trans("Country").'
'.$langs->trans("Country").''; print $form->select_country($selectedcode,'account_country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); @@ -859,7 +865,7 @@ else print '
'.$langs->trans("Conciliable").'
'.$langs->trans("Conciliable").''; $conciliate=$account->canBeConciliated(); if ($conciliate == -2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')'; @@ -868,19 +874,19 @@ else print '
'.$langs->trans("BalanceMinimalAllowed").'
'.$langs->trans("BalanceMinimalAllowed").'min_allowed).'">
'.$langs->trans("BalanceMinimalDesired").'
'.$langs->trans("BalanceMinimalDesired").'min_desired).'">
'.$langs->trans("Web").'
'.$langs->trans("Web").'url).'">'; print '
'.$langs->trans("Comment").'
'.$langs->trans("Comment").''; // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -903,7 +909,7 @@ else print ''; // If bank account - print ''; + print ''; print ''; print ''; @@ -975,22 +981,22 @@ else if ($account->getCountryCode() == 'IN') $bickey="SWIFT"; // IBAN - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print '"; - print ''; + print ''; print ''; - print '"; @@ -1004,25 +1010,27 @@ else // Accountancy code if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) { - print ''; + print ''; print ''; } else { - print ''; + print ''; print ''; } // Accountancy journal if (! empty($conf->accounting->enabled)) { - print ''; + print ''; print ''; } print '
'.$langs->trans("BankName").'
'.$langs->trans("BankName").'
'.$langs->trans($ibankey).'
'.$langs->trans($ibankey).'
'.$langs->trans($bickey).'
'.$langs->trans($bickey).'
'.$langs->trans("BankAccountDomiciliation").''; + print '
'.$langs->trans("BankAccountDomiciliation").''; print "
'.$langs->trans("BankAccountOwner").'
'.$langs->trans("BankAccountOwner").''; print '
'.$langs->trans("BankAccountOwnerAddress").''; + print '
'.$langs->trans("BankAccountOwnerAddress").''; print "
'.$langs->trans("AccountancyCode").'
'.$langs->trans("AccountancyCode").'account_number).'">
'.$langs->trans("AccountancyCode").'
'.$langs->trans("AccountancyCode").'account_number).'">
'.$langs->trans("AccountancyJournal").'
'.$langs->trans("AccountancyJournal").'accountancy_journal).'">
'; - print '
'; + dol_fiche_end(); + + print '
'; print ''; print '     '; print ''; diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index d87d95f6026..d0afdee61bb 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -441,7 +441,7 @@ else $datas = array(); $datamin = array(); $dataall = array(); - + $subtotal = 0; $day = $min; @@ -483,7 +483,7 @@ else if ($acct->min_desired) array_push($graph_datas[$i],$datamin[$i]); if ($acct->min_allowed) array_push($graph_datas[$i],$dataall[$i]); } - + $px3 = new DolGraph(); $px3->SetData($graph_datas); $arraylegends=array($langs->transnoentities("Balance")); @@ -760,7 +760,7 @@ print ''; $linkback = ''.$langs->trans("BackToList").''; // Ref -print ''; +print ''; print ''; // Label -print ''; +print ''; print ''; + print ''; print ''; // Label - print ''; + print ''; print ''; print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").''; if ($account) { @@ -799,7 +799,7 @@ else print '
'.$langs->trans("Label").'
'.$langs->trans("Label").''; if ($account && $_GET["option"]!='all') { diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 5293f518738..f82139d1f3a 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2015 Jean-François Ferry * @@ -128,13 +128,13 @@ if (empty($num)) $linkback = ''.$langs->trans("BackToList").''; // Ref - print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").''; print $form->showrefnav($acct, 'ref', $linkback, 1, 'ref'); print '
'.$langs->trans("Label").'
'.$langs->trans("Label").''.$acct->label.'
'; diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index e62c5203ea6..4643b367630 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -98,13 +98,13 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $linkback = ''.$langs->trans("BackToList").''; // Ref - print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").''; print $form->showrefnav($acct, 'ref', $linkback, 1, 'ref'); print '
'.$langs->trans("Label").'
'.$langs->trans("Label").''.$acct->label.'
'; diff --git a/htdocs/core/actions_fetchobject.inc.php b/htdocs/core/actions_fetchobject.inc.php index 463b3113c2a..3014e8652a6 100644 --- a/htdocs/core/actions_fetchobject.inc.php +++ b/htdocs/core/actions_fetchobject.inc.php @@ -25,15 +25,19 @@ // $action must be defined // $object must be defined (object is loaded in this file with fetch) +// $cancel must be defined // $id or $ref must be defined (object is loaded in this file with fetch) -if ($id > 0 || ! empty($ref)) +if (($id > 0 || ! empty($ref)) && empty($cancel)) { $ret = $object->fetch($id,$ref); - if ($ret > 0) { + if ($ret > 0) + { $object->fetch_thirdparty(); - $id=$object->id; - } else { + $id = $object->id; + } + else + { setEventMessages($object->error, $object->errors, 'errors'); $action=''; } diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index ca33fc34f0f..0974ce0f31c 100755 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -177,7 +177,7 @@ if ($resql) if ($search_amount_ht) $param.="&search_amount_ht=".$search_amount_ht; if ($search_amount_ttc) $param.="&search_amount_ttc=".$search_amount_ttc; if ($search_status >= 0) $param.="&search_status=".$search_status; - + print_barre_liste($langs->trans("ListTripsAndExpenses"), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print '
'."\n"; print ''; @@ -221,9 +221,9 @@ if ($resql) // Amount with no taxe print ''; - + print ''; - + // Amount with all taxes print ''; @@ -288,7 +288,7 @@ if ($resql) } else { - print ''; + print ''.''; } print "
 '.$langs->trans("NoRecordFound").'
'.$langs->trans("NoRecordFound").'
"; diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index 5f18a524acc..bb9b2c430be 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -88,8 +88,8 @@ foreach($cp->logs as $logs_CP) print ''.$user_action->getNomUrl(1).''; print ''.$user_update->getNomUrl(1).''; print ''.$logs_CP['type_action'].''; - print ''.$logs_CP['prev_solde'].' '.$langs->trans('days').''; - print ''.$logs_CP['new_solde'].' '.$langs->trans('days').''; + print ''.price2num($logs_CP['prev_solde'],8).' '.$langs->trans('days').''; + print ''.price2num($logs_CP['new_solde'],8).' '.$langs->trans('days').''; print ''."\n"; } diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index cd544b4fd83..d49520f2f19 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -38,6 +38,7 @@ $action = GETPOST('action', 'alpha'); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $backtopage=GETPOST('backtopage','alpha'); +$cancel=GETPOST('cancel'); $mode = GETPOST('mode', 'alpha'); $mine = ($mode == 'mine' ? 1 : 0); @@ -48,7 +49,7 @@ $taskstatic = new Task($db); $extrafields_project = new ExtraFields($db); $extrafields_task = new ExtraFields($db); -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not includ_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once if ($id > 0 || ! empty($ref)) { @@ -85,7 +86,7 @@ if ($action == 'createtask' && $user->rights->projet->creer) $date_start = dol_mktime($_POST['dateohour'],$_POST['dateomin'],0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyear'],'user'); $date_end = dol_mktime($_POST['dateehour'],$_POST['dateemin'],0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear'],'user'); - if (empty($_POST["cancel"])) + if (! $cancel) { if (empty($label)) { @@ -271,10 +272,11 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print ''; print ''; print ''; - if (! empty($object->id)) print ''; if (! empty($mode)) print ''; + dol_fiche_head(''); + print ''; $defaultref=''; @@ -342,7 +344,9 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print '
'; - print '

'; + dol_fiche_end(); + + print '
'; print ''; print '     '; print ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index ff91803c96e..f375c8ed78e 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1680,8 +1680,12 @@ table.border, table.dataTable, .table-border, .table-border-col, .table-key-bord .border tbody tr, .border tbody tr td { height: 20px; } -div.tabBar table.border tr { - height: 20px; +div.tabBar table.border tr, div.tabBar table.border tr td { + height: 28px; +} +div.tabBar .tdtop { + vertical-align: top; + padding-top: 6px; } table.border td, div.border div div.tagtd { From 6d95de48c20054f9540f00c0d57be8a29997b84a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2015 20:49:22 +0200 Subject: [PATCH 12/16] Css fixes --- htdocs/adherents/card_subscriptions.php | 14 ++++++++------ htdocs/categories/photos.php | 4 ++-- htdocs/categories/viewcat.php | 6 ++++-- htdocs/projet/card.php | 2 +- htdocs/projet/element.php | 2 +- htdocs/theme/eldy/style.css.php | 11 ++++++++--- 6 files changed, 24 insertions(+), 15 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 3aedb6fe50c..3761b75f384 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -547,7 +547,7 @@ $now=dol_now(); llxHeader('',$langs->trans("Subscriptions"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); -if ($rowid) +if ($rowid > 0) { $res=$object->fetch($rowid); if ($res < 0) { dol_print_error($db,$object->error); exit; } @@ -556,8 +556,6 @@ if ($rowid) $head = member_prepare_head($object); - dol_fiche_head($head, 'subscription', $langs->trans("Member"), 0, 'user'); - $rowspan=10; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++; @@ -565,6 +563,9 @@ if ($rowid) print ''; print ''; print ''; + + dol_fiche_head($head, 'subscription', $langs->trans("Member"), 0, 'user'); + print ''; $linkback = ''.$langs->trans("BackToList").''; @@ -696,10 +697,11 @@ if ($rowid) print ''; print "
\n"; - print ''; dol_fiche_end(); + print ''; + dol_htmloutput_errors($errmsg,$errmsgs); @@ -1008,7 +1010,7 @@ if ($rowid) { $prodtmp=new Product($db); $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); - print '. '.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(0)); + print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product } print '
'; } @@ -1033,7 +1035,7 @@ if ($rowid) { $prodtmp=new Product($db); $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); - print '. '.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(0)); + print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product } print '
'; } diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 36a44f4bdda..59be328c55e 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Jean-François Ferry @@ -128,7 +128,7 @@ if ($object->id) // Description print ''; print $langs->trans("Description").''; - print nl2br($object->description); + print dol_htmlentitiesbr($object->description); print ''; // Visibility diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 927474a5e44..198ac73cd2a 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -166,6 +166,7 @@ elseif ($type == 4) $title=$langs->trans("ContactCategoriesShort"); else $title=$langs->trans("Category"); $head = categories_prepare_head($object,$type); + dol_fiche_head($head, 'card', $title, 0, 'category'); @@ -194,7 +195,7 @@ print ''; // Description print ''; print $langs->trans("Description").''; -print nl2br($object->description); +print dol_htmlentitiesbr($object->description); print ''; $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook @@ -205,12 +206,13 @@ if (empty($reshook) && ! empty($extrafields->attribute_label)) print ''; -print '
'; +dol_fiche_end(); /* * Boutons actions */ + print "
\n"; if ($user->rights->categorie->creer) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 3c4884e2bbf..dc4b1f69bdb 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -679,7 +679,7 @@ else print ''; // Description - print ''.$langs->trans("Description").''; + print ''.$langs->trans("Description").''; print nl2br($object->description); print ''; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index f63c36ffc9e..a56de8ec84b 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -609,7 +609,7 @@ $langs->load("bills"); $langs->load("orders"); $langs->load("proposals"); $langs->load("margins"); -print_fiche_titre($langs->trans("Profit"),''); +print_fiche_titre($langs->trans("Profit"),'','title_accountancy'); print ''; print ''; print ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index f375c8ed78e..3914a8d11f8 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1680,8 +1680,11 @@ table.border, table.dataTable, .table-border, .table-border-col, .table-key-bord .border tbody tr, .border tbody tr td { height: 20px; } -div.tabBar table.border tr, div.tabBar table.border tr td { - height: 28px; +div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { + height: 24px; +} +div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar .table-val-border-col { + vertical-align: middle; } div.tabBar .tdtop { vertical-align: top; @@ -1860,7 +1863,9 @@ table.liste td { background: #ffffff; } - +#GanttChartDIV { + background: #ffffff; +} .even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover { font-family: ; From 60863d5d9df3e122c2c4c83d8a88752a01787134 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2015 02:28:42 +0200 Subject: [PATCH 13/16] Enhance tool to report duplicate and not used language keys. --- dev/translation/sanity_check_en_langfiles.php | 132 ++++++------------ 1 file changed, 45 insertions(+), 87 deletions(-) diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php index fdc0f738431..a3b3911c77f 100644 --- a/dev/translation/sanity_check_en_langfiles.php +++ b/dev/translation/sanity_check_en_langfiles.php @@ -18,20 +18,7 @@ echo ""; echo ""; -echo ""; +"; echo ""; -echo "

If you call this file with the argument \"?unused=true\" it searches for the translation strings that exist in en_US but are never used

"; -echo "

IMPORTANT: that can take quite a lot of time (up to 10 minutes), you need to tune the max_execution_time on your php.ini accordingly

"; -echo "

Happy translating :)

"; -// directory containing the php and lang files -$htdocs = "../../htdocs/"; +echo "If you call this file with the argument \"?unused=true\" it searches for the translation strings that exist in en_US but are never used.
"; +echo "IMPORTANT: that can take quite a lot of time (up to 10 minutes), you need to tune the max_execution_time on your php.ini accordingly.
"; +echo "Happy translating :)
"; + + +// STEP 1 - Search duplicates keys + + +// directory containing the php and lang files +$htdocs = "../../htdocs/"; + // directory containing the english lang files $workdir = $htdocs."langs/en_US/"; + $files = scandir($workdir); +if (empty($files)) +{ + echo "Can't scan workdir = ".$workdir; + exit; +} + $exludefiles = array('.','..','README'); $files = array_diff($files,$exludefiles); $langstrings_3d = array(); @@ -154,11 +103,12 @@ foreach ($files AS $file) { if (substr($row,0,1) !== '#') { // don't want lines without the separator (why should those even be here, anyway...) if (strpos($row,'=')!==false) { - $row_array = explode('=',$row); + $row_array = explode('=',$row); // $row_array[0] = key $langstrings_3d[$path_file['basename']][$line+1]=$row_array[0]; + $langstrings_3dtrans[$path_file['basename']][$line+1]=$row_array[1]; $langstrings_full[]=$row_array[0]; $langstrings_dist[$row_array[0]]=$row_array[0]; - } + } } } } @@ -167,16 +117,16 @@ foreach ($files AS $file) { foreach ($langstrings_3d AS $filename => $file) { foreach ($file AS $linenum => $value) { $keys = array_keys($langstrings_full, $value); - if (count($keys)>1) { + if (count($keys)>1) + { foreach ($keys AS $key) { - $dups[$value][$filename][$linenum] = ''; + $dups[$value][$filename][$linenum] = trim($langstrings_3dtrans[$filename][$linenum]); } } } } echo "

Duplicate strings in lang files in $workdir - ".count($dups)." found

"; -echo "
";
 
 echo "
'.$langs->trans("Element").'
"; echo ""; @@ -190,22 +140,27 @@ foreach ($dups as $string => $pages) { echo ""; + echo "\n"; } echo ""; echo "
#StringFile and lines
"; foreach ($pages AS $page => $lines ) { echo "$page "; - foreach ($lines as $line => $nothing) { - echo "($line) "; + foreach ($lines as $line => $translatedvalue) { + //echo "($line - ".(substr($translatedvalue,0,20)).") "; + echo "($line - ".htmlentities($translatedvalue).") "; } echo "
"; } - echo "
"; -if ($_REQUEST['unused'] == 'true') { +// STEP 2 - Search key not used - foreach ($langstrings_dist AS $value){ + +if (! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') +{ + foreach ($langstrings_dist AS $value) + { $search = '\'trans("'.$value.'")\''; - $string = 'grep -R -m 1 -F --include=*.php '.$search.' '.$htdocs.'*'; + $string = 'grep -R -m 1 -F --exclude=includes/* --include=*.php '.$search.' '.$htdocs.'*'; exec($string,$output); if (empty($output)) { $unused[$value] = true; @@ -216,6 +171,9 @@ if ($_REQUEST['unused'] == 'true') { echo "

Strings in en_US that are never used

"; echo "
";
 	print_r($unused);
+	echo "
"; } + +echo "\n"; echo ""; -echo ""; \ No newline at end of file +echo ""; From bf883e1576a4be4fd7a5d1efd74723c2a6664ccb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2015 02:34:57 +0200 Subject: [PATCH 14/16] Minor cosmetic changes Fix permissions and CRLF --- htdocs/contact/card.php | 12 +- .../doc/pdf_standard.modules.php | 0 .../expensereport/modules_expensereport.php | 0 .../core/modules/modExpenseReport.class.php | 0 htdocs/expensereport/ajax/ajaxprojet.php | 0 htdocs/expensereport/card.php | 0 .../class/expensereport.class.php | 0 htdocs/expensereport/export_csv.php | 0 htdocs/expensereport/list.php | 0 htdocs/expensereport/stats/index.php | 0 htdocs/expensereport/synchro_compta.php | 0 .../fourn/class/fournisseur.product.class.php | 0 htdocs/includes/restler/iCache.php | 0 htdocs/product/class/product.class.php | 0 htdocs/theme/eldy/img/logout.png | Bin 608 -> 168 bytes htdocs/theme/eldy/img/printer.png | Bin 270 -> 167 bytes htdocs/theme/eldy/img/search.png | Bin 432 -> 215 bytes htdocs/theme/eldy/img/searchclear.png | Bin 436 -> 356 bytes htdocs/theme/eldy/style.css.php | 125 +++++++++----- htdocs/user/card.php | 156 +++++++++--------- 20 files changed, 165 insertions(+), 128 deletions(-) mode change 100755 => 100644 htdocs/core/modules/expensereport/doc/pdf_standard.modules.php mode change 100755 => 100644 htdocs/core/modules/expensereport/modules_expensereport.php mode change 100755 => 100644 htdocs/core/modules/modExpenseReport.class.php mode change 100755 => 100644 htdocs/expensereport/ajax/ajaxprojet.php mode change 100755 => 100644 htdocs/expensereport/card.php mode change 100755 => 100644 htdocs/expensereport/class/expensereport.class.php mode change 100755 => 100644 htdocs/expensereport/export_csv.php mode change 100755 => 100644 htdocs/expensereport/list.php mode change 100755 => 100644 htdocs/expensereport/stats/index.php mode change 100755 => 100644 htdocs/expensereport/synchro_compta.php mode change 100755 => 100644 htdocs/fourn/class/fournisseur.product.class.php mode change 100755 => 100644 htdocs/includes/restler/iCache.php mode change 100755 => 100644 htdocs/product/class/product.class.php diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index dcc7949340e..d7841677536 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -798,19 +798,19 @@ else print ''; // Note Public - print ''; + print ''; $doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); print ''; // Note Private - print ''; + print ''; $doleditor = new DolEditor('note_private', $object->note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); print ''; // Statut - print ''.$langs->trans("Status").''; + print ''.$langs->trans("Status").''; print ''; print $object->getLibStatut(5); print ''; @@ -1025,16 +1025,16 @@ else print ''; // Note Public - print ''.$langs->trans("NotePublic").''; + print ''.$langs->trans("NotePublic").''; print nl2br($object->note_public); print ''; // Note Private - print ''.$langs->trans("NotePrivate").''; + print ''.$langs->trans("NotePrivate").''; print nl2br($object->note_private); // Statut - print ''.$langs->trans("Status").''; + print ''.$langs->trans("Status").''; print ''; print $object->getLibStatut(5); print ''; diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php old mode 100755 new mode 100644 diff --git a/htdocs/core/modules/expensereport/modules_expensereport.php b/htdocs/core/modules/expensereport/modules_expensereport.php old mode 100755 new mode 100644 diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php old mode 100755 new mode 100644 diff --git a/htdocs/expensereport/ajax/ajaxprojet.php b/htdocs/expensereport/ajax/ajaxprojet.php old mode 100755 new mode 100644 diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php old mode 100755 new mode 100644 diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php old mode 100755 new mode 100644 diff --git a/htdocs/expensereport/export_csv.php b/htdocs/expensereport/export_csv.php old mode 100755 new mode 100644 diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php old mode 100755 new mode 100644 diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php old mode 100755 new mode 100644 diff --git a/htdocs/expensereport/synchro_compta.php b/htdocs/expensereport/synchro_compta.php old mode 100755 new mode 100644 diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php old mode 100755 new mode 100644 diff --git a/htdocs/includes/restler/iCache.php b/htdocs/includes/restler/iCache.php old mode 100755 new mode 100644 diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php old mode 100755 new mode 100644 diff --git a/htdocs/theme/eldy/img/logout.png b/htdocs/theme/eldy/img/logout.png index 26ae717bc1abfd13b94f215a02ca4c462dc614ca..e2e2e5d973d4b80a0942b92f9cc079cdf0fb89a9 100644 GIT binary patch literal 168 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|m@;zM~Ln;`P7Z_bgzHz32L72(4 z^g&j`9R3?3jIQPfuQsp>F!;($K71tLutH1hMHYpYo$ssF8i#!0CS4twkxe%@=6c)QmuLRYr!jMG?^tZZ@n1 PTFv0;>gTe~DWM4f+V?mH literal 608 zcmW-dOK8+k6owOPoi?R*(E~z?kGl|pAOs&5M1pO(({^n7@LI*VkSnz|E;K?r?ZPfp zMp07KsX7L%WeSDaXuuK>A-h>9gJKlwWT8YX1f>_zg`l9|tv}y6|2hBaaBdC{_O>dj zB1uwfu8&aRo7bzUL3FM3aaCAmGB=RTtSH;tl$}#28sV8<4j5yi0U?Ho!8A>ZfMTFT zr36t*Eew_cmSr&nOao>BW6Z{28(>rH=-?1=Ox3Xs$8qu)@&?Kim=QR5rcfvlD3~DJ zCCH^v6xdLl(ThT!=TY!1@baqXx?Z_lwxCj}_)PWvzz>4JhM-ao{*R#pVID#shhbRF zqpAm0p<1n0)@qfa@W_S8N0F~Z0gBcY$1cQ0h&_k{6o({^ zP8|4g<$3d4ws1?y+*o_?@X^Bjm(j&tZ(2*Qb3+5l)VsNR^2Fa|`nh}FJVO>g%>H7% z?fZ|M%IWpJyWhV!K6H$Bs;|cMmHNs^>F%9RnPvIO`E3UewJiM=#HII~HQ@JXa~8Rp9L^H5h)3o1 zMhnU5pQQzuI69&Qg&Z`T_+GP1bjc;ORWq+rnxoh!Q*7YcqCDdj1B2eyhTJLBR{&WI N44$rjF6*2UngE^zG6Vns literal 270 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh3?wzC-F*zC*h@TpUDAJ0231{C5f z@Q5sCVBq=y!i-L9OlANDS<)SS9T^xl_H+M9WCik#1AIbUr%hY1diCnHYuBz{zkbJ# z9XogKJaFK^;lqcI9Xod7#EGq2x8A;e``NQ+FJHd={Q2|u@8AFb|6jagu02q@U`dc) zFp!G^7*yBJOae+edb&7$!Cb2S zz#@wSU0t@Pto$0DvY0ANJfO+Jc_%@IDc0TTlGYW4ge=dxOQv65K9}b?`&LHRx8cR% ztCu6g?)Y}Lt=ngk@Z`Zl(KEKD3~YMen&xf}*ET;G_$_N8$FwfNh9@fAYVY{i6n=)3 zDh2b4Yjdk#-9FRh%B|g+o6h-co%%=f<|?zlxr?K|Z{I4PY&&VA`EOR~T>aDCXT#Nj PE@kj^^>bP0l+XkKwR2O_ literal 432 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJdx@v7EBjSec0Oh;MG5s+Kq1Zo zkH}&M25un`X1sK_?hjCqCEd~2k%3`jKlh(RRv>?SfKP}kkoJ<`2(q+{(&R|Clt_;1 zNltDlw&W=G(kw3SDPDT7c4>$Mgqj+X4~mbJ%P_P%d9 z_r2vB5dH6Q;^+x7?AiLfXYcc#Yu|hB{hxB|`IP7X=VV*XS-W@6-g|S--JA3L`<(ax zmma&e^!@*}*_vxxoYr2uw>4X0Ymd{`bN9A>|G)MB|Gnp~?fw3L@BjbDiY1Qy|9|fP z|7-vM-&-1V@BjbjYrURtje7q5|E#$=-+)eMED7=pW^j0RBMr#O_jGX#k+__kpupwP zeM&?5^Uk9wsi{u|Yw8SZm3c#XOLs6#Uo&yy#El!xVjLV|9Pghw6T`1}K%Grw!dk*Ar0Tg0#W>&W=bkYi;y X{D&*ed<(lF&}s%xS3j3^P6k44ofy`glX(f`FeQ1ryDPOuQjAy=R>RjeHIlm#&Bx0?Lj!2J-!4EEu9*0Yh+!B-dghS1mI!_+) z{TX@3;h*1^%pmx(qFq`qOR~OOQQ_ehFp<~e@qe;c9A07?}b@ew9jMY=B?C+a+-N@`}V1eSS8?&9w`Gg-g wX9vdq_`A$8HYB?Ds?F`luZoGLpWTn9*sC$qb+%OS+@4BLl<6e(pbstU&(u0G|+7Anhf=5oBo@rOAHGg{vo+VYIIX>QZ)>*1)*h#==k9I&{(tNL|9j6}+xz|h-v9rP6-ylZ|Nq?o z|JVNizqd5#-v9s4*LpqQ8uk49|5-qMG()Oq)nSPeR5#)aq+tE;T+0!F8#rzsYXVVjIOnDb988Xc+Q;p`XK9%BO*)A zEXkQNp=atP^UYHpiMT~5FIu$rh#IT0nAb+FsF@rKcl3o{k7}27ZHYY16xzopr0Dc3&>Hq)$ diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 3914a8d11f8..d024f99a87d 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -119,7 +119,8 @@ if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) $conf->global->THEME_ELDY_VERMENU_BACK1='255,255,255'; // vmenu $conf->global->THEME_ELDY_VERMENU_BACK1b='230,232,232'; // vmenu (not menu) $conf->global->THEME_ELDY_VERMENU_BACK2='240,240,240'; - $conf->global->THEME_ELDY_BACKTITLE1='140,160,185'; // title of arrays + $conf->global->THEME_ELDY_BACKTITLE1='140,160,185'; // title of arrays TO MATCH ELDY + //$conf->global->THEME_ELDY_BACKTITLE1='240,240,240'; // title of arrays TO MATCH BOOTSTRAP $conf->global->THEME_ELDY_BACKTITLE2='230,230,230'; $conf->global->THEME_ELDY_BACKTABCARD1='255,255,255'; $conf->global->THEME_ELDY_BACKTABCARD2='210,210,210'; // card @@ -557,23 +558,27 @@ margin : 0px auto; +div#id-top { + height: px; + background: rgb(); + + background-image: linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); + background-image: -o-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); + background-image: -moz-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); + background-image: -webkit-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); + background-image: -ms-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); + background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.3)), color-stop(1, rgba(0,0,0,.3)) ); +} + div#tmenu_tooltip { display:none; height: px; padding-: 100px; - background: ; - box-shadow: 0 0 6px rgba(0, 0, 0, .4) !important; - background-image: linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(128,128,128,.3) 100%); - background-image: -o-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(128,128,128,.3) 100%); - background-image: -moz-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(128,128,128,.3) 100%); - background-image: -webkit-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(128,128,128,.3) 100%); - background-image: -ms-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(128,128,128,.3) 100%); - background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.3)), color-stop(1, rgba(128,128,128,.3)) ); } @@ -630,7 +635,7 @@ ul.tmenu { /* t r b l */ padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; list-style: none; - box-shadow: 0 0 6px rgba(0, 0, 0, .4) !important; + /* box-shadow: 0 0 6px rgba(0, 0, 0, .4) !important; */ } ul.tmenu li { background: rgb(); @@ -922,6 +927,9 @@ div.login_block { display: none; } +div.login_block a { + color: #fff; +} div.login_block table { display: inline; } @@ -1720,6 +1728,10 @@ table.noborder, table.formdoc, div.noborder { border-collapse: separate !important; border-spacing: 0px; + border-top-width: 1px; + border-top-color: #CCC; + border-top-style: solid; + border-right-width: 1px; border-right-color: #CCC; border-right-style: solid; @@ -1788,6 +1800,10 @@ table.liste { border-collapse: collapse; border-top-color: #FEFEFE; + border-top-width: 1px; + border-top-color: #CCC; + border-top-style: solid; + border-right-width: 1px; border-right-color: #CCC; border-right-style: solid; @@ -1896,6 +1912,22 @@ div.liste_titre .tagtd { } div.liste_titre { min-height: 26px !important; /* We cant use height because it's a div and it should be higher if content is more. but min-height doe not work either for div */ + + padding-left: 3px; + padding-top: 2px; + padding-bottom: 2px; + + border-right-width: 1px; + border-right-color: #CCC; + border-right-style: solid; + + border-left-width: 1px; + border-left-color: #CCC; + border-left-style: solid; + + border-top-width: 1px; + border-top-color: #CCC; + border-top-style: solid; } tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable.tr { @@ -1903,15 +1935,19 @@ tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, tabl } div.liste_titre, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable thead tr { - background: rgb(); - background-repeat: repeat-x; + /* TO MATCH BOOTSTRAP */ + /*background: #ddd; + color: #000 !important;*/ + /* TO MATCH ELDY */ + background: rgb(); background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); background-image: -ms-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); background-image: linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); - font-weight: bold; + + font-weight: bold; color: #; font-family: ; @@ -1926,7 +1962,7 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste { font-family: ; font-weight: bold; - text-shadow: 1px 0px 1px #; + /* text-shadow: 1px 0px 1px #; */ vertical-align: middle; } tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a { @@ -1936,16 +1972,13 @@ tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, fo text-shadow: none !important; color: #; } -div.liste_titre { - padding-left: 3px; -} tr.liste_titre_sel th, th.liste_titre_sel, tr.liste_titre_sel td, td.liste_titre_sel, form.liste_titre_sel div { font-family: ; font-weight: normal; border-bottom: 1px solid #FDFFFF; text-decoration: underline; - text-shadow: 1px 0px 1px #; + /* text-shadow: 1px 0px 1px #; */ } input.liste_titre { background: transparent; @@ -2023,18 +2056,21 @@ div.tabBar .noborder { tr.box_titre { height: 26px; - background: rgb(); - background-repeat: repeat-x; - background-image: linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image: -o-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image: -moz-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image: -webkit-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image: -ms-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); - background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.3)), color-stop(1, rgba(0,0,0,.3)) ); + /* TO MATCH BOOTSTRAP */ + /*background: #ddd; + color: #000 !important;*/ - color: #; - text-shadow: 1px 0px 1px #; + /* TO MATCH ELDY */ + background: rgb(); + background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); + background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); + background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); + background-image: -ms-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); + background-image: linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%); + + color: #; + // text-shadow: 1px 0px 1px #; font-family: , sans-serif; font-weight: bold; border-bottom: 1px solid #FDFFFF; @@ -2278,24 +2314,25 @@ table.valid { /* ============================================================================== */ #tooltip { -position: absolute; -width: px; -border-top: solid 1px #BBBBBB; -border-: solid 1px #BBBBBB; -border-: solid 1px #444444; -border-bottom: solid 1px #444444; -padding: 2px; -z-index: 3000; -background-color: #EFCFAA; -opacity: 1; --moz-border-radius:6px; --webkit-border-radius: 6px; -border-radius: 6px; + position: absolute; + width: px; + border-top: solid 1px #BBBBBB; + border-: solid 1px #BBBBBB; + border-: solid 1px #444444; + border-bottom: solid 1px #444444; + padding: 2px; + z-index: 3000; + background-color: #FFF; + opacity: 1; + -moz-border-radius:6px; + -webkit-border-radius: 6px; + border-radius: 6px; } #tiptip_content { - background-color: rgb(252,248,246); - background-color: rgba(252,248,246,0.95); + background-color: rgb(255,255,255); + background-color: rgba(255,255,255,0.95); line-height: 1.4em; + min-width: 200px; } /* ============================================================================== */ diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 1cbeb6e653d..db1758af860 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -723,7 +723,7 @@ if (($action == 'create') || ($action == 'adduserldap')) print ''; // Lastname - print ''.$langs->trans("Lastname").''; + print ''.$langs->trans("Lastname").''; print ''; if (! empty($ldap_lastname)) { @@ -737,7 +737,7 @@ if (($action == 'create') || ($action == 'adduserldap')) print ''; // Firstname - print ''.$langs->trans("Firstname").''; + print ''.$langs->trans("Firstname").''; print ''; if (! empty($ldap_firstname)) { @@ -751,13 +751,13 @@ if (($action == 'create') || ($action == 'adduserldap')) print ''; // Position/Job - print ''.$langs->trans("PostOrFunction").''; + print ''.$langs->trans("PostOrFunction").''; print ''; print ''; print ''; // Login - print ''.$langs->trans("Login").''; + print ''.$langs->trans("Login").''; print ''; if (! empty($ldap_login)) { @@ -784,7 +784,7 @@ if (($action == 'create') || ($action == 'adduserldap')) $password=$generated_password; // Password - print ''.$langs->trans("Password").''; + print ''.$langs->trans("Password").''; print ''; if (! empty($ldap_sid)) { @@ -808,7 +808,7 @@ if (($action == 'create') || ($action == 'adduserldap')) // Administrator if (! empty($user->admin)) { - print ''.$langs->trans("Administrator").''; + print ''.$langs->trans("Administrator").''; print ''; print $form->selectyesno('admin',GETPOST('admin'),1); @@ -850,13 +850,13 @@ if (($action == 'create') || ($action == 'adduserldap')) } // Type - print ''.$langs->trans("Type").''; + print ''.$langs->trans("Type").''; print ''; print $form->textwithpicto($langs->trans("Internal"),$langs->trans("InternalExternalDesc")); print ''; // Tel - print ''.$langs->trans("PhonePro").''; + print ''.$langs->trans("PhonePro").''; print ''; if (! empty($ldap_phone)) { @@ -870,7 +870,7 @@ if (($action == 'create') || ($action == 'adduserldap')) print ''; // Tel portable - print ''.$langs->trans("PhoneMobile").''; + print ''.$langs->trans("PhoneMobile").''; print ''; if (! empty($ldap_mobile)) { @@ -884,7 +884,7 @@ if (($action == 'create') || ($action == 'adduserldap')) print ''; // Fax - print ''.$langs->trans("Fax").''; + print ''.$langs->trans("Fax").''; print ''; if (! empty($ldap_fax)) { @@ -900,7 +900,7 @@ if (($action == 'create') || ($action == 'adduserldap')) // Skype if (! empty($conf->skype->enabled)) { - print ''.$langs->trans("Skype").''; + print ''.$langs->trans("Skype").''; print ''; if (! empty($ldap_skype)) { @@ -915,7 +915,7 @@ if (($action == 'create') || ($action == 'adduserldap')) } // EMail - print 'global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").''; + print 'global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").''; print ''; if (! empty($ldap_mail)) { @@ -929,7 +929,7 @@ if (($action == 'create') || ($action == 'adduserldap')) print ''; // Signature - print ''.$langs->trans("Signature").''; + print ''.$langs->trans("Signature").''; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('signature',GETPOST('signature'),'',138,'dolibarr_mailings','In',true,true,empty($conf->global->FCKEDITOR_ENABLE_USERSIGN)?0:1,ROWS_4,90); @@ -941,7 +941,7 @@ if (($action == 'create') || ($action == 'adduserldap')) { if (empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity && is_object($mc)) { - print "".''.$langs->trans("Entity").''; + print "".''.$langs->trans("Entity").''; print "".$mc->select_entities($conf->entity); print "\n"; } @@ -952,7 +952,7 @@ if (($action == 'create') || ($action == 'adduserldap')) } // Hierarchy - print ''.$langs->trans("HierarchicalResponsible").''; + print ''.$langs->trans("HierarchicalResponsible").''; print ''; print $form->select_dolusers($object->fk_user,'fk_user',1,array($object->id),0,'',0,$conf->entity); print ''; @@ -963,21 +963,21 @@ if (($action == 'create') || ($action == 'adduserldap')) $langs->load("salaries"); // THM - print ''.$langs->trans("THM").''; + print ''.$langs->trans("THM").''; print ''; print ''; print ''; print "\n"; // TJM - print ''.$langs->trans("TJM").''; + print ''.$langs->trans("TJM").''; print ''; print ''; print ''; print "\n"; // Salary - print ''.$langs->trans("Salary").''; + print ''.$langs->trans("Salary").''; print ''; print ''; print ''; @@ -985,7 +985,7 @@ if (($action == 'create') || ($action == 'adduserldap')) } // Weeklyhours - print ''.$langs->trans("WeeklyHours").''; + print ''.$langs->trans("WeeklyHours").''; print ''; print ''; print ''; @@ -994,7 +994,7 @@ if (($action == 'create') || ($action == 'adduserldap')) // Accountancy code if ($conf->salaries->enabled) { - print ''.$langs->trans("AccountancyCode").''; + print ''.$langs->trans("AccountancyCode").''; print ''; print ''; print ''; @@ -1003,14 +1003,14 @@ if (($action == 'create') || ($action == 'adduserldap')) // User color if (! empty($conf->agenda->enabled)) { - print ''.$langs->trans("ColorUser").''; + print ''.$langs->trans("ColorUser").''; print ''; print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', 'usercolorconfig', 1, '', 'hideifnotset'); print ''; } // Note - print ''; + print ''; print $langs->trans("Note"); print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -1149,7 +1149,7 @@ else print ''; // Ref - print ''; + print ''; print ''; @@ -1163,7 +1163,7 @@ else if (! empty($conf->agenda->enabled)) $rowspan++; // Lastname - print ''; + print ''; print ''; // Photo @@ -1174,17 +1174,17 @@ else print ''."\n"; // Firstname - print ''; + print ''; print ''; print ''."\n"; // Position/Job - print ''; + print ''; print ''; print ''."\n"; // Login - print ''; + print ''; if (! empty($object->ldap_sid) && $object->statut==0) { print ''; @@ -1196,7 +1196,7 @@ else print ''."\n"; // Password - print ''; + print ''; if (! empty($object->ldap_sid)) { if ($passDoNotExpire) @@ -1230,7 +1230,7 @@ else print ''."\n"; // Administrator - print ''."\n"; // Type - print ''."\n"; } // Tel pro - print ''; + print ''; print ''; print ''."\n"; // Tel mobile - print ''; + print ''; print ''; print ''."\n"; // Fax - print ''; + print ''; print ''; print ''."\n"; // Skype if (! empty($conf->skype->enabled)) { - print ''; + print ''; print ''; print "\n"; } // EMail - print ''; + print ''; print ''; print "\n"; // Signature - print '\n"; // Hierarchy - print ''; + print ''; print ''; + print ''; print ''; print "\n"; // TJM - print ''; + print ''; print ''; print "\n"; // Salary - print ''; + print ''; print ''; @@ -1333,7 +1333,7 @@ else } // Weeklyhours - print ''; + print ''; print ''; @@ -1342,14 +1342,14 @@ else // Accountancy code if ($conf->salaries->enabled) { - print ''; + print ''; print ''; } // Color user if (! empty($conf->agenda->enabled)) { - print ''; + print ''; print ''; @@ -1357,23 +1357,23 @@ else } // Status - print ''; + print ''; print ''; print ''."\n"; - print ''; + print ''; print ''; print "\n"; - print ''; + print ''; print ''; print "\n"; if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) { - print ''; + print ''; print ''; print "\n"; } @@ -1381,7 +1381,7 @@ else // Company / Contact if (! empty($conf->societe->enabled)) { - print ''; + print ''; print ''; + print ''; print ''; + print ''; print "
'.$langs->trans("Ref").'
'.$langs->trans("Ref").''; print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); print '
'.$langs->trans("Lastname").'
'.$langs->trans("Lastname").''.$object->lastname.'
'.$langs->trans("Firstname").'
'.$langs->trans("Firstname").''.$object->firstname.'
'.$langs->trans("PostOrFunction").'
'.$langs->trans("PostOrFunction").''.$object->job.'
'.$langs->trans("Login").'
'.$langs->trans("Login").''.$langs->trans("LoginAccountDisableInDolibarr").'
'.$langs->trans("Password").'
'.$langs->trans("Password").'
'.$langs->trans("Administrator").''; + print '
'.$langs->trans("Administrator").''; if (! empty($conf->multicompany->enabled) && $object->admin && ! $object->entity) { print $form->textwithpicto(yn($object->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin"); @@ -1246,7 +1246,7 @@ else print '
'.$langs->trans("Type").''; + print '
'.$langs->trans("Type").''; $type=$langs->trans("Internal"); if ($object->societe_id) $type=$langs->trans("External"); print $form->textwithpicto($type,$langs->trans("InternalExternalDesc")); @@ -1256,46 +1256,46 @@ else // Ldap sid if ($object->ldap_sid) { - print '
'.$langs->trans("Type").''; + print '
'.$langs->trans("Type").''; print $langs->trans("DomainUser",$ldap->domainFQDN); print '
'.$langs->trans("PhonePro").'
'.$langs->trans("PhonePro").''.dol_print_phone($object->office_phone,'',0,0,1).'
'.$langs->trans("PhoneMobile").'
'.$langs->trans("PhoneMobile").''.dol_print_phone($object->user_mobile,'',0,0,1).'
'.$langs->trans("Fax").'
'.$langs->trans("Fax").''.dol_print_phone($object->office_fax,'',0,0,1).'
'.$langs->trans("Skype").'
'.$langs->trans("Skype").''.dol_print_skype($object->skype,0,0,1).'
'.$langs->trans("EMail").'
'.$langs->trans("EMail").''.dol_print_email($object->email,0,0,1).'
'.$langs->trans('Signature').''; + print '
'.$langs->trans('Signature').''; print dol_htmlentitiesbr($object->signature); print "
'.$langs->trans("HierarchicalResponsible").'
'.$langs->trans("HierarchicalResponsible").''; if (empty($object->fk_user)) print $langs->trans("None"); else { @@ -1311,21 +1311,21 @@ else $langs->load("salaries"); // THM - print '
'.$langs->trans("THM").'
'.$langs->trans("THM").''; print ($object->thm!=''?price($object->thm,'',$langs,1,-1,-1,$conf->currency):''); print '
'.$langs->trans("TJM").'
'.$langs->trans("TJM").''; print ($object->tjm!=''?price($object->tjm,'',$langs,1,-1,-1,$conf->currency):''); print '
'.$langs->trans("Salary").'
'.$langs->trans("Salary").''; print ($object->salary!=''?price($object->salary,'',$langs,1,-1,-1,$conf->currency):''); print '
'.$langs->trans("WeeklyHours").'
'.$langs->trans("WeeklyHours").''; print price2num($object->weeklyhours); print '
'.$langs->trans("AccountancyCode").'
'.$langs->trans("AccountancyCode").''.$object->accountancy_code.'
'.$langs->trans("ColorUser").'
'.$langs->trans("ColorUser").''; if ($object->color) print ''; print '
'.$langs->trans("Status").'
'.$langs->trans("Status").''; print $object->getLibStatut(4); print '
'.$langs->trans("LastConnexion").'
'.$langs->trans("LastConnexion").''.dol_print_date($object->datelastlogin,"dayhour").'
'.$langs->trans("PreviousConnexion").'
'.$langs->trans("PreviousConnexion").''.dol_print_date($object->datepreviouslogin,"dayhour").'
'.$langs->trans("OpenIDURL").'
'.$langs->trans("OpenIDURL").''.$object->openid.'
'.$langs->trans("LinkToCompanyContact").'
'.$langs->trans("LinkToCompanyContact").''; if (isset($object->societe_id) && $object->societe_id > 0) { @@ -1409,7 +1409,7 @@ else if (! empty($conf->adherent->enabled)) { $langs->load("members"); - print '
'.$langs->trans("LinkedToDolibarrMember").'
'.$langs->trans("LinkedToDolibarrMember").''; if ($object->fk_member) { @@ -1432,7 +1432,7 @@ else { if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity) { - print '
'.$langs->trans("Entity").''; + print '
'.$langs->trans("Entity").''; if (empty($object->entity)) { print $langs->trans("AllEntities"); @@ -1578,7 +1578,7 @@ else { if ($conf->entity == 1 && $conf->multicompany->transverse_mode) { - print ''.$langs->trans("Entity").''.$langs->trans("Entity").'".$mc->select_entities($conf->entity); } else @@ -1691,7 +1691,7 @@ else print ''; - print ''; + print ''; print ''; @@ -1699,7 +1699,7 @@ else // Lastname print ""; - print ''; + print ''; print ''; // Firstname - print "".''; + print "".''; print ''; // Position/Job - print ''; + print ''; print ''; // Login - print "".''; + print "".''; print ''; // Pass - print ''; + print ''; print '\n"; // Administrator - print ''; + print ''; if ($object->societe_id > 0) { $langs->load("admin"); @@ -1870,7 +1870,7 @@ else } // Type - print ''; + print ''; print ''; // Tel pro - print "".''; + print "".''; print ''; // Tel mobile - print "".''; + print "".''; print ''; // Fax - print "".''; + print "".''; print ''; + print ''; print '".''; + print "".'global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").''; print ''; // Signature - print "".''; + print "".''; print '".''; + print "".''; print ''; + print ''; print ''; + print ''; print ''; print "\n"; // TJM - print ''; + print ''; print ''; print "\n"; // Salary - print ''; + print ''; print ''; @@ -2037,7 +2037,7 @@ else } // Weeklyhours - print ''; + print ''; print ''; @@ -2047,7 +2047,7 @@ else if ($conf->salaries->enabled) { print ""; - print ''; + print ''; print ''; + print ''; print ''; } // Status - print ''; + print ''; print ''; @@ -2080,7 +2080,7 @@ else // Company / Contact if (! empty($conf->societe->enabled)) { - print ''; + print ''; print ''; + print ''; print '".''; + print "".''; print "\n"; } From 49a13f5e728bc8ad6d399d655dc58154fa22fcfa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2015 03:52:29 +0200 Subject: [PATCH 15/16] Debug of module expense report --- htdocs/expensereport/card.php | 24 ++-- .../class/expensereport.class.php | 124 +++++++++++------- .../install/mysql/migration/3.7.0-3.8.0.sql | 7 +- htdocs/theme/eldy/style.css.php | 3 + 4 files changed, 95 insertions(+), 63 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index f0ce82cfb64..a9ccf2471db 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -829,7 +829,7 @@ if ($action == "addline") $object_ligne->fk_c_type_fees = GETPOST('fk_c_type_fees'); $object_ligne->fk_c_tva = GETPOST('fk_c_tva'); - $object_ligne->vatrate = GETPOST('vatrate'); + $object_ligne->vatrate = price2num(GETPOST('vatrate')); $object_ligne->fk_projet = $fk_projet; @@ -877,7 +877,7 @@ if ($action == "addline") $type = 0; // TODO What if service $tmp = calcul_price_total($qty, $up, 0, $vatrate, 0, 0, 0, 'TTC', 0, $type); - $object_ligne->vatrate = GETPOST('vatrate'); + $object_ligne->vatrate = price2num(GETPOST('vatrate')); $object_ligne->total_ttc = $tmp[2]; $object_ligne->total_ht = $tmp[0]; $object_ligne->total_tva = $tmp[1]; @@ -905,11 +905,11 @@ if ($action == 'confirm_delete_line' && GETPOST("confirm") == "yes") $object->fetch($id); $object_ligne = new ExpenseReportLine($db); - $object_ligne->fetch($_GET["rowid"]); + $object_ligne->fetch(GETPOST("rowid")); $total_ht = $object_ligne->total_ht; $total_tva = $object_ligne->total_tva; - $result=$object->deleteline($_GET["rowid"]); + $result=$object->deleteline(GETPOST("rowid")); if ($result >= 0) { if ($result > 0) @@ -950,11 +950,12 @@ if ($action == "updateligne" ) $rowid = $_POST['rowid']; $type_fees_id = GETPOST('fk_c_type_fees'); $object_ligne->fk_c_tva = GETPOST('fk_c_tva'); - $object_ligne->vatrate = GETPOST('vatrate'); + $object_ligne->vatrate = price2num(GETPOST('vatrate')); $projet_id = $fk_projet; $comments = GETPOST('comments'); $qty = GETPOST('qty'); $value_unit = GETPOST('value_unit'); + $vatrate = GETPOST('vatrate'); if (! GETPOST('fk_c_type_fees') > 0) { @@ -971,7 +972,7 @@ if ($action == "updateligne" ) if (! $error) { - $result = $object->updateline($rowid, $type_fees_id, $projet_id, $c_tva, $comments, $qty, $value_unit, $date, $object_id); + $result = $object->updateline($rowid, $type_fees_id, $projet_id, $vatrate, $comments, $qty, $value_unit, $date, $id); if ($result >= 0) { if ($result > 0) @@ -994,8 +995,9 @@ if ($action == "updateligne" ) } } - $object->recalculer($object_id); - header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object_id); + $result = $object->recalculer($id); + + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } else @@ -1369,7 +1371,7 @@ else if ($action == 'delete_line') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id."&rowid=".$_GET['rowid'],$langs->trans("DeleteLine"),$langs->trans("ConfirmDeleteLine"),"confirm_delete_line",'','yes',1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id."&rowid=".GETPOST('rowid'),$langs->trans("DeleteLine"),$langs->trans("ConfirmDeleteLine"),"confirm_delete_line",'','yes',1); if ($ret == 'html') print '
'; } @@ -1635,7 +1637,7 @@ else // Select project print '
'; // Select type @@ -1711,7 +1713,7 @@ else print ''; print ''; - print ''; + print ''; // Select date print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").''; print $object->id; print '
'.$langs->trans("Lastname").''.$langs->trans("Lastname").''; if ($caneditfield && !$object->ldap_sid) { @@ -1728,7 +1728,7 @@ else print '
'.$langs->trans("Firstname").'
'.$langs->trans("Firstname").''; if ($caneditfield && !$object->ldap_sid) { @@ -1742,7 +1742,7 @@ else print '
'.$langs->trans("PostOrFunction").'
'.$langs->trans("PostOrFunction").''; if ($caneditfield) { @@ -1756,7 +1756,7 @@ else print '
'.$langs->trans("Login").'
'.$langs->trans("Login").''; if ($user->admin && !$object->ldap_sid) { @@ -1771,7 +1771,7 @@ else print '
'.$langs->trans("Password").'
'.$langs->trans("Password").''; if ($object->ldap_sid) { @@ -1793,7 +1793,7 @@ else print "
'.$langs->trans("Administrator").'
'.$langs->trans("Administrator").'
'.$langs->trans("Type").'
'.$langs->trans("Type").''; if ($user->id == $object->id || ! $user->admin) { @@ -1889,7 +1889,7 @@ else print '
'.$langs->trans("PhonePro").'
'.$langs->trans("PhonePro").''; if ($caneditfield && empty($object->ldap_sid)) { @@ -1903,7 +1903,7 @@ else print '
'.$langs->trans("PhoneMobile").'
'.$langs->trans("PhoneMobile").''; if ($caneditfield && empty($object->ldap_sid)) { @@ -1917,7 +1917,7 @@ else print '
'.$langs->trans("Fax").'
'.$langs->trans("Fax").''; if ($caneditfield && empty($object->ldap_sid)) { @@ -1933,7 +1933,7 @@ else // Skype if (! empty($conf->skype->enabled)) { - print '
'.$langs->trans("Skype").'
'.$langs->trans("Skype").''; if ($caneditfield && empty($object->ldap_sid)) { @@ -1948,7 +1948,7 @@ else } // EMail - print "
global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").'
'; if ($caneditfield && empty($object->ldap_sid)) { @@ -1962,7 +1962,7 @@ else print '
'.$langs->trans("Signature").'
'.$langs->trans("Signature").''; if ($caneditfield) { @@ -1979,7 +1979,7 @@ else // OpenID url if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) { - print "
'.$langs->trans("OpenIDURL").'
'.$langs->trans("OpenIDURL").''; if ($caneditfield) { @@ -1994,7 +1994,7 @@ else } // Hierarchy - print '
'.$langs->trans("HierarchicalResponsible").'
'.$langs->trans("HierarchicalResponsible").''; if ($caneditfield) { @@ -2015,21 +2015,21 @@ else $langs->load("salaries"); // THM - print '
'.$langs->trans("THM").'
'.$langs->trans("THM").''; print ''; print '
'.$langs->trans("TJM").'
'.$langs->trans("TJM").''; print ''; print '
'.$langs->trans("Salary").'
'.$langs->trans("Salary").''; print ''; print '
'.$langs->trans("WeeklyHours").'
'.$langs->trans("WeeklyHours").''; print ''; print '
'.$langs->trans("AccountancyCode").''.$langs->trans("AccountancyCode").''; if ($caneditfield) { @@ -2065,14 +2065,14 @@ else // User color if (! empty($conf->agenda->enabled)) { - print '
'.$langs->trans("ColorUser").'
'.$langs->trans("ColorUser").''; print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', 'usercolorconfig', 1, '', 'hideifnotset'); print '
'.$langs->trans("Status").'
'.$langs->trans("Status").''; print $object->getLibStatut(4); print '
'.$langs->trans("LinkToCompanyContact").'
'.$langs->trans("LinkToCompanyContact").''; if ($object->societe_id > 0) { @@ -2107,7 +2107,7 @@ else if (! empty($conf->adherent->enabled)) { $langs->load("members"); - print '
'.$langs->trans("LinkedToDolibarrMember").'
'.$langs->trans("LinkedToDolibarrMember").''; if ($object->fk_member) { @@ -2129,7 +2129,7 @@ else { if (empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity) { - print "
'.$langs->trans("Entity").'
'.$langs->trans("Entity").'".$mc->select_entities($object->entity, 'entity', '', 0, 1); // last parameter 1 means, show also a choice 0=>'all entities' print "
'; - $formproject->select_projects(-1, $objp->fk_projet,'fk_projet', 0, 0, 0, 1); + $formproject->select_projects(-1, $objp->fk_projet,'fk_projet', 0, 0, 1, 1); print '
'; diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index d6b767da849..3a0a15d6d81 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -282,7 +282,7 @@ class ExpenseReport extends CommonObject */ function fetch($id, $ref='') { - global $conf,$db; + global $conf; $sql = "SELECT d.rowid, d.ref, d.note_public, d.note_private,"; // DEFAULT $sql.= " d.detail_refuse, d.detail_cancel, d.fk_user_refuse, d.fk_user_cancel,"; // ACTIONS @@ -298,10 +298,10 @@ class ExpenseReport extends CommonObject $sql.= $restrict; dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); - $result = $db->query($sql) ; - if ($result) + $resql = $this->db->query($sql) ; + if ($resql) { - $obj = $db->fetch_object($result); + $obj = $this->db->fetch_object($resql); if ($obj) { $this->id = $obj->rowid; @@ -367,7 +367,7 @@ class ExpenseReport extends CommonObject $result=$this->fetch_lines(); - return 1; + return $result; } else { @@ -376,7 +376,7 @@ class ExpenseReport extends CommonObject } else { - $this->error=$db->lasterror(); + $this->error=$this->db->lasterror(); return -1; } } @@ -663,6 +663,7 @@ class ExpenseReport extends CommonObject /** * recalculer + * TODO Replace this with call to update_price if not already done * * @param int $id Id of expense report * @return int <0 if KO, >0 if OK @@ -733,14 +734,15 @@ class ExpenseReport extends CommonObject $sql.= ' WHERE de.'.$this->fk_element.' = '.$this->id; dol_syslog('ExpenseReport::fetch_lines sql='.$sql, LOG_DEBUG); - $result = $this->db->query($sql); - if ($result) + $resql = $this->db->query($sql); + if ($resql) { - $num = $this->db->num_rows($result); + $num = $this->db->num_rows($resql); $i = 0; while ($i < $num) { - $objp = $this->db->fetch_object($result); + $objp = $this->db->fetch_object($resql); + $deplig = new ExpenseReportLine($this->db); $deplig->rowid = $objp->rowid; @@ -769,13 +771,13 @@ class ExpenseReport extends CommonObject $i++; } - $this->db->free($result); + $this->db->free($resql); return 1; } else { $this->error=$this->db->lasterror(); - dol_syslog('ExpenseReport::fetch_lines: Error '.$this->error,LOG_ERR); + dol_syslog('ExpenseReport::fetch_lines: Error '.$this->error, LOG_ERR); return -3; } } @@ -1198,30 +1200,36 @@ class ExpenseReport extends CommonObject } - - function updateline($rowid, $type_fees_id, $projet_id, $c_tva, $comments, $qty, $value_unit, $date, $expensereport_id) + /** + * updateline + * + * @param int $rowid Line to edit + * @param int $type_fees_id Type payment + * @param int $projet_id Project id + * @param double $vatrate Vat rate + * @param string $comments Description + * @param real $qty Qty + * @param double $value_unit Value init + * @param int $date Date + * @param int $expensereport_id Expense report id + * @return int <0 if KO, >0 if OK + */ + function updateline($rowid, $type_fees_id, $projet_id, $vatrate, $comments, $qty, $value_unit, $date, $expensereport_id) { + global $user; + if ($this->fk_statut==0 || $this->fk_statut==99) { $this->db->begin(); - // Select du taux de tva par rapport au code - $sql = "SELECT t.taux as vatrate"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t"; - $sql.= " WHERE t.rowid = ".$c_tva; - $result = $this->db->query($sql); - $objp_tva = $this->db->fetch_object($result); - // calcul de tous les totaux de la ligne - $total_ttc = $qty*$value_unit; - $total_ttc = number_format($total_ttc,2,'.',''); + $total_ttc = price2num($qty*$value_unit, 'MT'); - $tx_tva = $objp_tva->vatrate/100; + $tx_tva = $vatrate / 100; $tx_tva = $tx_tva + 1; - $total_ht = $total_ttc/$tx_tva; - $total_ht = number_format($total_ht,2,'.',''); + $total_ht = price2num($total_ttc/$tx_tva, 'MT'); - $total_tva = $total_ttc - $total_ht; + $total_tva = price2num($total_ttc - $total_ht, 'MT'); // fin calculs $ligne = new ExpenseReportLine($this->db); @@ -1230,15 +1238,14 @@ class ExpenseReport extends CommonObject $ligne->value_unit = $value_unit; $ligne->date = $date; - $ligne->fk_expensereport = $expensereport_id; + $ligne->fk_expensereport= $expensereport_id; $ligne->fk_c_type_fees = $type_fees_id; $ligne->fk_projet = $projet_id; - $ligne->fk_c_tva = $c_tva; $ligne->total_ht = $total_ht; $ligne->total_tva = $total_tva; $ligne->total_ttc = $total_ttc; - $ligne->vatrate = $objp_tva->vatrate; + $ligne->vatrate = price2num($vatrate); $ligne->rowid = $rowid; // Select des infos sur le type fees @@ -1259,16 +1266,19 @@ class ExpenseReport extends CommonObject $ligne->projet_ref = $objp_projet->ref_projet; $ligne->projet_title = $objp_projet->title_projet; - $result = $ligne->update(); - if ($result > 0): - $this->db->commit(); - return 1; - else: - $this->error=$ligne->error; - $this->db->rollback(); - return -2; - endif; - + $result = $ligne->update($user); + if ($result > 0) + { + $this->db->commit(); + return 1; + } + else + { + $this->error=$ligne->error; + $this->errors=$ligne->errors; + $this->db->rollback(); + return -2; + } } } @@ -1566,15 +1576,17 @@ class ExpenseReportLine $this->comments=trim($this->comments); if (!$this->value_unit_HT) $this->value_unit_HT=0; $this->qty = price2num($this->qty); + $this->vatrate = price2num($this->vatrate); $this->db->begin(); $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'expensereport_det'; $sql.= ' (fk_expensereport, fk_c_type_fees, fk_projet,'; - $sql.= ' fk_c_tva, comments, qty, value_unit, total_ht, total_tva, total_ttc, date)'; + $sql.= ' fk_c_tva, tva_tx, comments, qty, value_unit, total_ht, total_tva, total_ttc, date)'; $sql.= " VALUES (".$this->fk_expensereport.","; $sql.= " ".$this->fk_c_type_fees.","; $sql.= " ".($this->fk_projet>0?$this->fk_projet:'null').","; + $sql.= " ".($this->fk_c_tva?$this->fk_c_tva:"null").","; $sql.= " ".$this->vatrate.","; $sql.= " '".$this->db->escape($this->comments)."',"; $sql.= " ".$this->qty.","; @@ -1631,6 +1643,7 @@ class ExpenseReportLine // Clean parameters $this->comments=trim($this->comments); + $this->vatrate = price2num($this->vatrate); $this->db->begin(); @@ -1639,14 +1652,11 @@ class ExpenseReportLine $sql.= " comments='".$this->db->escape($this->comments)."'"; $sql.= ",value_unit=".$this->value_unit.""; $sql.= ",qty=".$this->qty.""; - if ($this->date) { - $sql.= ",date='".$this->date."'"; - } - else { $sql.=',date=null'; - } + $sql.= ",date='".$this->db->idate($this->date)."'"; $sql.= ",total_ht=".$this->total_ht.""; $sql.= ",total_tva=".$this->total_tva.""; $sql.= ",total_ttc=".$this->total_ttc.""; + $sql.= ",tva_tx=".$this->vatrate; if ($this->fk_c_type_fees) $sql.= ",fk_c_type_fees=".$this->fk_c_type_fees; else $sql.= ",fk_c_type_fees=null"; if ($this->fk_projet) $sql.= ",fk_projet=".$this->fk_projet; @@ -1660,16 +1670,30 @@ class ExpenseReportLine $resql=$this->db->query($sql); if ($resql) { - $tmpparent=new ExpenseReport($db); - $tmpparent->fetch($this->fk_expensereport); - $result = $tmpparent->update_price(); - if ($result < 0) + $tmpparent=new ExpenseReport($this->db); + $result = $tmpparent->fetch($this->fk_expensereport); + if ($result > 0) + { + $result = $tmpparent->update_price(); + if ($result < 0) + { + $error++; + $this->error = $tmpparent->error; + $this->errors = $tmpparent->errors; + } + } + else { $error++; $this->error = $tmpparent->error; $this->errors = $tmpparent->errors; } } + else + { + $error++; + dol_print_error($this->db); + } if (! $error) { diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql index 28f4ab69f71..be2984cb0e0 100755 --- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql +++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql @@ -235,8 +235,8 @@ CREATE TABLE llx_expensereport_det rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, fk_expensereport integer NOT NULL, fk_c_type_fees integer NOT NULL, - fk_projet integer NOT NULL, - fk_c_tva integer NOT NULL, + fk_projet integer, + fk_c_tva integer, comments text NOT NULL, product_type integer DEFAULT -1, qty real NOT NULL, @@ -259,6 +259,9 @@ CREATE TABLE llx_expensereport_det import_key varchar(14) ) ENGINE=innodb; +ALTER TABLE llx_expensereport_det MODIFY COLUMN fk_projet integer NULL; +ALTER TABLE llx_expensereport_det MODIFY COLUMN fk_c_tva integer NULL; + ALTER TABLE llx_projet ADD COLUMN budget_amount double(24,8); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index d024f99a87d..021a2483458 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -439,6 +439,9 @@ textarea.centpercent { { border-right: 1px solid #DDD; } +#formuserfile { + margin-top: 4px; +} #formuserfile_link { margin-left: 1px; } From 493140118869843a740e04f5eceb381580671d26 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2015 04:33:01 +0200 Subject: [PATCH 16/16] Fix new pagination style was not working correctly. --- htdocs/core/lib/functions.lib.php | 43 ++++++++++++++++--------------- htdocs/theme/eldy/style.css.php | 15 ++++++++--- 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 76b36fffc53..27ea19e971d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2804,7 +2804,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so print "\n"; print "\n"; - print ''; + print '
'; // Left if ($picto && $titre) print ''; @@ -2824,44 +2824,44 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so $pagelist = ''; if ($page > 0 || $num > $conf->liste_limit) { - if ($totalnboflines) + if ($totalnboflines) // If we know total nb of lines { $maxnbofpage=10; $nbpages=ceil($totalnboflines/$conf->liste_limit); $cpt=($page-$maxnbofpage); if ($cpt < 0) { $cpt=0; } - $pagelist.=''; + $pagelist.= '
  • '.($page+1)."
  • \n"; } } + print "\n"; print_fleche_navigation($page,$file,$options,$nextpage,$pagelist); if ($morehtml) print $morehtml; print ''; @@ -2871,12 +2871,12 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so } /** - * Fonction servant a afficher les fleches de navigation dans les pages de listes + * Function to show navigation arrows into lists * * @param int $page Number of page - * @param string $file Lien - * @param string $options Autres parametres d'url a propager dans les liens ("" par defaut) - * @param integer $nextpage Do we show a next page button + * @param string $file Page + * @param string $options Other url paramaters to propagate ("" by default) + * @param integer $nextpage Do we show a next page button * @param string $betweenarrows HTML Content to show between arrows * @return void */ @@ -2887,16 +2887,17 @@ function print_fleche_navigation($page,$file,$options='',$nextpage=0,$betweenarr print ''; + print ''."\n"; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 721b5f2741b..8854e8f3477 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1835,8 +1835,13 @@ table.liste td { .tagtr, .table-border-row { display: table-row; } .tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; } + /* Pagination */ -div.pagination ul, div.pagination li + +div.pagination a { + font-weight: normal; +} +div.pagination ul, div.pagination li { list-style: none; display: inline-block; @@ -1859,7 +1864,7 @@ div.pagination li span { padding: 6px 12px; margin-left: -1px; line-height: 1.42857143; - color: #337ab7; + color: #000; text-decoration: none; background-color: #fff; border: 1px solid #ddd; @@ -1879,7 +1884,7 @@ div.pagination li a:hover, div.pagination li span:hover, div.pagination li a:focus, div.pagination li span:focus { - color: #23527c; + color: #000; background-color: #eee; border-color: #ddd; } @@ -1906,7 +1911,9 @@ div.pagination .disabled a:focus { background-color: #fff; border-color: #ddd; } - +div.pagination li .active { + text-decoration: underline; +} /* Prepare to remove class pair - impair .noborder > tbody > tr:nth-child(even) td {
    '.img_picto('', $picto, '', $pictoisfullpath).'