From 53f551347626f1899ea27374dd3061148e289461 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Tue, 5 Sep 2017 18:10:19 +0200 Subject: [PATCH 1/6] FIX: Bad const name --- htdocs/admin/pdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index f366d8a5ce3..e2a5fa6b810 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -77,7 +77,7 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", $_POST["MAIN_PDF_MAIN_HIDE_SECOND_TAX"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", $_POST["_MAIN_PDF_MAIN_HIDE_THIRD_TAX"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", $_POST["MAIN_PDF_MAIN_HIDE_THIRD_TAX"],'chaine',0,'',$conf->entity); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; From 9b357936088a39f9d378b0dce9a7d585b485be01 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 6 Sep 2017 11:08:23 +0200 Subject: [PATCH 2/6] Fix: avoid "Uncaught Error: [] operator not supported for strings" --- htdocs/core/actions_extrafields.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index b34cbe886ab..aee2a39e563 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * or see http://www.gnu.org/ - * + * * $elementype must be defined. */ @@ -25,6 +25,7 @@ $maxsizestring=255; $maxsizeint=10; +$mesg=array(); $extrasize=GETPOST('size','int'); $type=GETPOST('type','alpha'); From 016ed12c117ad6e6ebdf0bc6cf4d30542d5f1b64 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 6 Sep 2017 12:09:07 +0200 Subject: [PATCH 3/6] Fix: Credit card field showing too small --- htdocs/public/stripe/newpayment.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/public/stripe/newpayment.php b/htdocs/public/stripe/newpayment.php index 962185b8397..53ffcf87cbf 100644 --- a/htdocs/public/stripe/newpayment.php +++ b/htdocs/public/stripe/newpayment.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2017 Saasprov * Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2017 Ferran Marcet * * 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 @@ -1125,7 +1126,7 @@ if (preg_match('/^dopayment/',$action)) -
+
From 9fa85a58315ee5785b223583fc435e9fa6c12948 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 6 Sep 2017 12:14:42 +0200 Subject: [PATCH 4/6] Fix: Credit card field showing too small --- htdocs/public/stripe/newpayment.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/public/stripe/newpayment.php b/htdocs/public/stripe/newpayment.php index 53ffcf87cbf..f735cc87da8 100644 --- a/htdocs/public/stripe/newpayment.php +++ b/htdocs/public/stripe/newpayment.php @@ -1085,6 +1085,7 @@ if (preg_match('/^dopayment/',$action)) box-shadow: 0 1px 3px 0 #e6ebf1; -webkit-transition: box-shadow 150ms ease; transition: box-shadow 150ms ease; + width: 350px; } .StripeElement--focus { @@ -1126,7 +1127,7 @@ if (preg_match('/^dopayment/',$action)) -
+
From b5c30ea67969c1feb78181bc2479bf003648fda4 Mon Sep 17 00:00:00 2001 From: Neil Orley Date: Thu, 7 Sep 2017 11:58:22 +0200 Subject: [PATCH 5/6] New: Adds an hide duration button in intervention module Adds a way to set the visibility of the intervention time field from the administration interface of the "intervention" module --- htdocs/admin/fichinter.php | 32 +++++++++++++++++++++++++++ htdocs/langs/en_US/interventions.lang | 1 + htdocs/langs/fr_FR/interventions.lang | 1 + 3 files changed, 34 insertions(+) diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 751cbce81e9..c4d1b1d556b 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -221,9 +221,24 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') } else { setEventMessages($langs->trans("Error"), null, 'errors'); } +} elseif ($action == 'set_FICHINTER_WITHOUT_DURATION') { + $val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha'); + $res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', + $conf->entity); + + if (!$res > 0) { + $error++; + } + + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } } + /* * View */ @@ -576,6 +591,23 @@ print ''; print ''; print ''; +// Use duration +print '
'; +print ''; +print ''; +print ''; +print ''; +print $langs->trans("UseDurationOnFichinter"); +print ''; +print ''; +print 'global->FICHINTER_WITHOUT_DURATION?' checked':'') . '>'; +print ''; +print ''; +print ''; +print ''; +print ''; +print '
'; + print ''; diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 9863471448b..40556724507 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -48,6 +48,7 @@ TypeContact_fichinter_external_CUSTOMER=Following-up customer contact PrintProductsOnFichinter=Print also lines of type "product" (not only services) on intervention card PrintProductsOnFichinterDetails=interventions generated from orders UseServicesDurationOnFichinter=Use services duration for interventions generated from orders +UseDurationOnFichinter=Hides the duration field for intervention records InterventionStatistics=Statistics of interventions NbOfinterventions=Nb of intervention cards NumberOfInterventionsByMonth=Nb of intervention cards by month (date of validation) diff --git a/htdocs/langs/fr_FR/interventions.lang b/htdocs/langs/fr_FR/interventions.lang index 687e078ba70..13bc2cee7d4 100644 --- a/htdocs/langs/fr_FR/interventions.lang +++ b/htdocs/langs/fr_FR/interventions.lang @@ -48,6 +48,7 @@ TypeContact_fichinter_external_CUSTOMER=Contact client suivi de l'intervention PrintProductsOnFichinter=Imprimer aussi les lignes de type "produit" (pas seulement de type service) sur les fiches d'intervention PrintProductsOnFichinterDetails=interventions générées à partir des commandes UseServicesDurationOnFichinter=Utiliser la durée des services dans les interventions créées depuis des commandes +UseDurationOnFichinter=Masquer le champ durée dans les fiches d'intervention InterventionStatistics=Statistiques des interventions NbOfinterventions=Nb de fiches d'intervention NumberOfInterventionsByMonth=Nb de fiches d'intervention par mois (date de validation) From e43b13968e156973f96973fefdc4e1b6d98d4a50 Mon Sep 17 00:00:00 2001 From: Neil Orley Date: Thu, 7 Sep 2017 15:31:19 +0200 Subject: [PATCH 6/6] New: Adds an hide hour button in the "intervention" module Adds a way to set the visibility of hours/mins of the intervention date field from the administration interface of the "intervention" module --- htdocs/admin/fichinter.php | 31 +++++++++++++++++++ .../fichinter/doc/pdf_soleil.modules.php | 10 +++++- htdocs/fichinter/card.php | 8 +++-- htdocs/langs/en_US/interventions.lang | 1 + htdocs/langs/fr_FR/interventions.lang | 1 + 5 files changed, 47 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index c4d1b1d556b..374d72fa7bf 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -230,6 +230,20 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') $error++; } + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} elseif ($action == 'set_FICHINTER_DATE_WITHOUT_HOUR') { + $val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha'); + $res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($val == 'on' ? 1 : 0), 'bool', 0, '', + $conf->entity); + + if (!$res > 0) { + $error++; + } + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -607,6 +621,23 @@ print ''; print ''; print ''; +// use date without hour +print '
'; +print ''; +print ''; +print ''; +print ''; +print $langs->trans("UseDateWithoutHourOnFichinter"); +print ''; +print ''; +print 'global->FICHINTER_DATE_WITHOUT_HOUR?' checked':'') . '>'; +print ''; +print ''; +print ''; +print ''; +print ''; +print '
'; + diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 4d889f84902..f12f0127cec 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -277,7 +277,15 @@ class pdf_soleil extends ModelePDFFicheinter $curX = $this->posxdesc-1; // Description of product line - $txt=$outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true); + if (empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)) + { + $txt=$outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true); + } + else + { + $txt=$outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'day',false,$outputlangs,true); + } + if ($objectligne->duration > 0) { $txt.=" - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 953b48a8adf..fc634bed9ff 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1379,7 +1379,7 @@ else if ($id > 0 || ! empty($ref)) print dol_htmlentitiesbr($objp->description); // Date - print ''.dol_print_date($db->jdate($objp->date_intervention),'dayhour').''; + print ''.(empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)?dol_print_date($db->jdate($objp->date_intervention),'dayhour'):dol_print_date($db->jdate($objp->date_intervention),'day')).''; // Duration print ''.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?convertSecondToTime($objp->duree):'').''; @@ -1452,7 +1452,8 @@ else if ($id > 0 || ! empty($ref)) // Date d'intervention print ''; - $form->select_date($db->jdate($objp->date_intervention),'di',1,1,0,"date_intervention"); + if (!empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)) $form->select_date($db->jdate($objp->date_intervention),'di',0,0,0,"date_intervention"); + else $form->select_date($db->jdate($objp->date_intervention),'di',1,1,0,"date_intervention"); print ''; // Duration @@ -1519,7 +1520,8 @@ else if ($id > 0 || ! empty($ref)) $timearray=dol_getdate($now); if (! GETPOST('diday','int')) $timewithnohour=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']); else $timewithnohour=dol_mktime(GETPOST('dihour','int'),GETPOST('dimin','int'), 0,GETPOST('dimonth','int'),GETPOST('diday','int'),GETPOST('diyear','int')); - $form->select_date($timewithnohour,'di',1,1,0,"addinter"); + if (!empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)) $form->select_date($timewithnohour,'di',0,0,0,"addinter"); + else $form->select_date($timewithnohour,'di',1,1,0,"addinter"); print ''; // Duration diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 40556724507..b151565f3a3 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -49,6 +49,7 @@ PrintProductsOnFichinter=Print also lines of type "product" (not only services) PrintProductsOnFichinterDetails=interventions generated from orders UseServicesDurationOnFichinter=Use services duration for interventions generated from orders UseDurationOnFichinter=Hides the duration field for intervention records +UseDateWithoutHourOnFichinter=Hides hours and minutes off the date field for intervention records InterventionStatistics=Statistics of interventions NbOfinterventions=Nb of intervention cards NumberOfInterventionsByMonth=Nb of intervention cards by month (date of validation) diff --git a/htdocs/langs/fr_FR/interventions.lang b/htdocs/langs/fr_FR/interventions.lang index 13bc2cee7d4..8a7158c212b 100644 --- a/htdocs/langs/fr_FR/interventions.lang +++ b/htdocs/langs/fr_FR/interventions.lang @@ -49,6 +49,7 @@ PrintProductsOnFichinter=Imprimer aussi les lignes de type "produit" (pas seulem PrintProductsOnFichinterDetails=interventions générées à partir des commandes UseServicesDurationOnFichinter=Utiliser la durée des services dans les interventions créées depuis des commandes UseDurationOnFichinter=Masquer le champ durée dans les fiches d'intervention +UseDateWithoutHourOnFichinter=Masquer l'heure de la date d'intervention InterventionStatistics=Statistiques des interventions NbOfinterventions=Nb de fiches d'intervention NumberOfInterventionsByMonth=Nb de fiches d'intervention par mois (date de validation)