diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 31939708663..26f62320b3b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1984,7 +1984,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = { global $conf, $langs; - if ($tzoutput == 'auto') { + if ($tzoutput === 'auto') { $tzoutput = (empty($conf) ? 'tzserver' : $conf->tzuserinputkey); } diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 2805089aaf3..a4fed934936 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -217,8 +217,9 @@ if (empty($reshook)) if (!empty($origin) && !empty($originid)) { // Parse element/subelement (ex: project_task) - $element = $subelement = $_POST['origin']; - if (preg_match('/^([^_]+)_([^_]+)/i', $_POST['origin'], $regs)) + $regs = array(); + $element = $subelement = GETPOST('origin', 'alphanohtml'); + if (preg_match('/^([^_]+)_([^_]+)/i', GETPOST('origin', 'alphanohtml'), $regs)) { $element = $regs[1]; $subelement = $regs[2]; @@ -478,8 +479,7 @@ if (empty($reshook)) $desc = GETPOST('np_desc', 'restricthtml'); $date_intervention = dol_mktime(GETPOST('dihour', 'int'), GETPOST('dimin', 'int'), 0, GETPOST('dimonth', 'int'), GETPOST('diday', 'int'), GETPOST('diyear', 'int')); - $duration = empty($conf->global->FICHINTER_WITHOUT_DURATION) ?convertTime2Seconds(GETPOST('durationhour', 'int'), GETPOST('durationmin', 'int')) : 0; - + $duration = empty($conf->global->FICHINTER_WITHOUT_DURATION) ? convertTime2Seconds(GETPOST('durationhour', 'int'), GETPOST('durationmin', 'int')) : 0; // Extrafields $extrafields->fetch_name_optionals_label($object->table_element_line); @@ -1335,8 +1335,7 @@ if ($action == 'create') print '
'; print ''; print ''; - if ($action == 'editline') - { + if ($action == 'editline') { print ''; print ''; } else { @@ -1348,8 +1347,9 @@ if ($action == 'create') $sql .= ' ft.date as date_intervention'; $sql .= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft'; $sql .= ' WHERE ft.fk_fichinter = '.$object->id; - if (!empty($conf->global->FICHINTER_HIDE_EMPTY_DURATION)) + if (!empty($conf->global->FICHINTER_HIDE_EMPTY_DURATION)) { $sql .= ' AND ft.duree <> 0'; + } $sql .= ' ORDER BY ft.rang ASC, ft.date ASC, ft.rowid'; $resql = $db->query($sql); @@ -1376,13 +1376,11 @@ if ($action == 'create') print ' '; print "\n"; } - while ($i < $num) - { + while ($i < $num) { $objp = $db->fetch_object($resql); // Ligne en mode visu - if ($action != 'editline' || GETPOST('line_id', 'int') != $objp->rowid) - { + if ($action != 'editline' || GETPOST('line_id', 'int') != $objp->rowid) { print ''; // No. @@ -1402,8 +1400,7 @@ if ($action == 'create') print "\n"; - - // Econ to edit and delete + // Icon to edit and delete if ($object->statut == 0 && $user->rights->ficheinter->creer) { print '';