Clean code

This commit is contained in:
Laurent Destailleur 2020-08-30 03:00:35 +02:00
parent 6293f76692
commit 8adf1852b1
3 changed files with 14 additions and 19 deletions

View File

@ -1190,7 +1190,7 @@ if ($action == 'create')
//Time Type
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("TimeType").'</td><td colspan="3">';
print $form->select_type_duration('offsetunit');
print $form->selectTypeDuration('offsetunit');
print '</td></tr>';
//Reminder Type
@ -1203,7 +1203,7 @@ if ($action == 'create')
//Mail Model
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("EMailTemplates").'</td><td colspan="3">';
print $form->select_model_mail('actioncommsend', 'actioncomm_send');
print $form->selectModelMail('actioncommsend', 'actioncomm_send');
print '</td></tr>';

View File

@ -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 .= '<select class="flat" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
foreach ($TDurationTypes as $key=>$typeduration){
$retstring = '<select class="flat" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
foreach ($TDurationTypes as $key=>$typeduration) {
$retstring .= '<option value="'.$key.'"';
if($key == $selected)
{
if ($key == $selected) {
$retstring .= " selected";
}
$retstring .= ">".$typeduration."</option>";
}
$retstring .= "</select>";
return $retstring;
@ -7980,17 +7972,15 @@ class Form
return $ret;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* select_model_mail
* selectModelMail
*
* @param string $prefix Prefix
* @param string $modelType Model type
* @return string HTML select string
*/
public function select_model_mail($prefix, $modelType = '')
public function selectModelMail($prefix, $modelType = '')
{
// phpcs:enable
global $langs, $db, $user;
$retstring = '';

5
htdocs/security.txt Normal file
View File

@ -0,0 +1,5 @@
# Security policies of Dolibarr ERP CRM project
Contact: mailto:security@dolibarr.org
Preferred-Languages: en
Policy: https://github.com/Dolibarr/dolibarr/security/policy
Expires: Sat, 31 Dec 2050 00:00:00 GMT