From 46611908ae92be42086f9b73e1d422252ef6ed3a Mon Sep 17 00:00:00 2001 From: abb Date: Tue, 1 Dec 2015 11:10:05 +0100 Subject: [PATCH 1/3] add constant FICHINTER_EMPTY_LINE_DESC to allow empty line descriptions in interventions --- htdocs/fichinter/card.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 9dd3577b91d..0b343524f9c 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -6,6 +6,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Ferran Marcet * Copyright (C) 201 Charlie Benke + * 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 @@ -466,8 +467,8 @@ if (empty($reshook)) // Add line else if ($action == "addline" && $user->rights->ficheinter->creer) { - if (!GETPOST('np_desc')) - { + if (!GETPOST('np_desc')&&($conf->global->FICHINTER_EMPTY_LINE_DESC!=1)) + { $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Description")).'
'; $error++; } @@ -1566,16 +1567,18 @@ else if ($id > 0 || ! empty($ref)) $var=true; - print '\n"; - print ''; - // editeur wysiwyg - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('np_desc',GETPOST('np_desc','alpha'),'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,ROWS_2,70); - $doleditor->Create(); - print ''; + print '\n"; + print ''; + // editeur wysiwyg + if ($conf->global->FICHINTER_EMPTY_LINE_DESC != 1) { + require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; + $doleditor = new DolEditor('np_desc', GETPOST('np_desc', 'alpha'), '', 100, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_DETAILS, ROWS_2, 70); + $doleditor->Create(); + } + print ''; - // Date intervention - print ''; + // Date intervention + print ''; $now=dol_now(); $timearray=dol_getdate($now); if (! GETPOST('diday','int')) $timewithnohour=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']); From 5360ea65bf2e04079c33133389387e1e9b433d95 Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Tue, 1 Dec 2015 21:26:04 +0100 Subject: [PATCH 2/3] Update card.php --- htdocs/fichinter/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 0b343524f9c..33c2e48b599 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -467,7 +467,7 @@ if (empty($reshook)) // Add line else if ($action == "addline" && $user->rights->ficheinter->creer) { - if (!GETPOST('np_desc')&&($conf->global->FICHINTER_EMPTY_LINE_DESC!=1)) + if (!GETPOST('np_desc') && $conf->global->FICHINTER_EMPTY_LINE_DESC!=1 ) { $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Description")).'
'; $error++; From fb692f4cd50baae47edda578f1a50351d25d1ff1 Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Thu, 3 Dec 2015 19:10:15 +0100 Subject: [PATCH 3/3] Update card.php --- htdocs/fichinter/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 33c2e48b599..403f1411dc8 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -467,7 +467,7 @@ if (empty($reshook)) // Add line else if ($action == "addline" && $user->rights->ficheinter->creer) { - if (!GETPOST('np_desc') && $conf->global->FICHINTER_EMPTY_LINE_DESC!=1 ) + if (!GETPOST('np_desc') && empty($conf->global->FICHINTER_EMPTY_LINE_DESC) ) { $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Description")).'
'; $error++; @@ -1570,7 +1570,7 @@ else if ($id > 0 || ! empty($ref)) print '\n"; print ''; // editeur wysiwyg - if ($conf->global->FICHINTER_EMPTY_LINE_DESC != 1) { + if (empty($conf->global->FICHINTER_EMPTY_LINE_DESC)) { require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; $doleditor = new DolEditor('np_desc', GETPOST('np_desc', 'alpha'), '', 100, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_DETAILS, ROWS_2, 70); $doleditor->Create();