diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e746708d277..333b601cb34 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2679,7 +2679,7 @@ function price2num($amount,$rounding='',$alreadysqlnb=0) if ($rounding == 'MU') $nbofdectoround=$conf->global->MAIN_MAX_DECIMALS_UNIT; elseif ($rounding == 'MT') $nbofdectoround=$conf->global->MAIN_MAX_DECIMALS_TOT; elseif ($rounding == 'MS') $nbofdectoround=$conf->global->MAIN_MAX_DECIMALS_SHOWN; - elseif ($rounding == '2') $nbofdectoround=2; // For admin info page + elseif (is_numeric($rounding)) $nbofdectoround=$rounding; // For admin info page //print "RR".$amount.' - '.$nbofdectoround.'
'; if (dol_strlen($nbofdectoround)) $amount = round($amount,$nbofdectoround); // $nbofdectoround can be 0. else return 'ErrorBadParameterProvidedToFunction'; diff --git a/htdocs/holiday/admin/holiday.php b/htdocs/holiday/admin/holiday.php index 99e6f7fa4af..4c2844af408 100644 --- a/htdocs/holiday/admin/holiday.php +++ b/htdocs/holiday/admin/holiday.php @@ -72,7 +72,7 @@ if ($action == "add") } // Option du nombre de jours à ajouter chaque mois - $nbHolidayEveryMonth = price2num($_POST['nbHolidayEveryMonth'],2); + $nbHolidayEveryMonth = price2num($_POST['nbHolidayEveryMonth'],5); if(!$cp->updateConfCP('nbHolidayEveryMonth',$nbHolidayEveryMonth)) { @@ -80,28 +80,28 @@ if ($action == "add") } // Option du nombre de jours pour un mariage - $OptMariageCP = price2num($_POST['OptMariage'],2); + $OptMariageCP = price2num($_POST['OptMariage'],5); if(!$cp->updateConfCP('OptMariage',$OptMariageCP)) { $error = true; } // Option du nombre de jours pour un décés d'un proche - $OptDecesProcheCP = price2num($_POST['OptDecesProche'],2); + $OptDecesProcheCP = price2num($_POST['OptDecesProche'],5); if(!$cp->updateConfCP('OptDecesProche',$OptDecesProcheCP)) { $error = true; } // Option du nombre de jours pour un mariage d'un enfant - $OptMariageProcheCP = price2num($_POST['OptMariageProche'],2); + $OptMariageProcheCP = price2num($_POST['OptMariageProche'],5); if(!$cp->updateConfCP('OptMariageProche',$OptMariageProcheCP)) { $error = true; } // Option du nombre de jours pour un décés d'un parent - $OptDecesParentsCP = price2num($_POST['OptDecesParents'],2); + $OptDecesParentsCP = price2num($_POST['OptDecesParents'],5); if(!$cp->updateConfCP('OptDecesParents',$OptDecesParentsCP)) { $error = true; @@ -307,7 +307,7 @@ print ''."\n"; $var=!$var; print ''."\n"; print ''.$langs->trans('nbHolidayEveryMonthCP').''."\n"; -print ' '.$langs->trans('Jours').''."\n"; +print ' '.$langs->trans('Jours').''."\n"; print ''."\n"; $var=!$var; diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 9664299657c..a033813c93d 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1399,42 +1399,39 @@ class Holiday extends CommonObject } /** - * select event + * Select event * - * @return string|boolean + * @return string|boolean Select Html to select type of holiday */ function selectEventCP() { - $sql = "SELECT *"; + $sql = "SELECT rowid, name, value"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday_events"; $result = $this->db->query($sql); - - if($result) { - + if ($result) + { $num = $this->db->num_rows($result); $i = 0; + $out = ''; return $out; - - } else { - - return false; - } - + else + { + return false; + } } /** diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 04938436d69..3870945387b 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -124,7 +124,7 @@ if($cp_events == 1) print $langs->trans('MotifCP').' : '; print $holiday->selectEventCP(); - print ' '.$langs->trans('UserCP').' : '; + print '   '.$langs->trans('UserCP').' : '; print $form->select_users('',"userCP",1,"",0,''); print ' ';