From 8adf1852b1cf968db61fbf140f15be50dccf8fb1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Aug 2020 03:00:35 +0200 Subject: [PATCH] Clean code --- htdocs/comm/action/card.php | 4 ++-- htdocs/core/class/html.form.class.php | 24 +++++++----------------- htdocs/security.txt | 5 +++++ 3 files changed, 14 insertions(+), 19 deletions(-) create mode 100644 htdocs/security.txt diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 037ac8bed89..dcb72cd2a18 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1190,7 +1190,7 @@ if ($action == 'create') //Time Type print ''.$langs->trans("TimeType").''; - print $form->select_type_duration('offsetunit'); + print $form->selectTypeDuration('offsetunit'); print ''; //Reminder Type @@ -1203,7 +1203,7 @@ if ($action == 'create') //Mail Model print ''.$langs->trans("EMailTemplates").''; - print $form->select_model_mail('actioncommsend', 'actioncomm_send'); + print $form->selectModelMail('actioncommsend', 'actioncomm_send'); print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d3b1589410e..153f1cdbae2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5673,35 +5673,27 @@ class Form return $retstring; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * select_type_duration + * selectTypeDuration * * @param string $prefix Prefix * @param string $selected Selected type * @return string HTML select string */ - public function select_type_duration($prefix, $selected = 'minute') + public function selectTypeDuration($prefix, $selected = 'minute') { - // phpcs:enable global $langs; - $retstring = ''; - $TDurationTypes = array('year'=>$langs->trans('Years'), 'month'=>$langs->trans('Month'), 'week'=>$langs->trans('Weeks'), 'day'=>$langs->trans('Days'), 'hour'=>$langs->trans('Hours'), 'minute'=>$langs->trans('Minutes')); - $retstring .= ''; + foreach ($TDurationTypes as $key=>$typeduration) { $retstring .= '