This commit is contained in:
Laurent Destailleur 2021-01-28 10:30:09 +01:00
parent f462e353e9
commit 9d0945bbe2
2 changed files with 11 additions and 14 deletions

View File

@ -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);
}

View File

@ -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 '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" name="addinter" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
if ($action == 'editline')
{
if ($action == 'editline') {
print '<input type="hidden" name="action" value="updateline">';
print '<input type="hidden" name="line_id" value="'.GETPOST('line_id', 'int').'">';
} 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 '<td class="liste_titre">&nbsp;</td>';
print "</tr>\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 '<tr class="oddeven">';
// No.
@ -1402,8 +1400,7 @@ if ($action == 'create')
print "</td>\n";
// Econ to edit and delete
// Icon to edit and delete
if ($object->statut == 0 && $user->rights->ficheinter->creer)
{
print '<td class="center">';