From 622dc7e8d7592c40813a599037add3d29dddb56b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Jan 2020 22:01:55 +0100 Subject: [PATCH] Debug v11 --- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/core/lib/company.lib.php | 6 +++--- htdocs/mrp/mo_production.php | 6 +++++- htdocs/product/stock/movement_list.php | 3 ++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index c249a6a7b5f..b3dab6d5703 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1800,7 +1800,7 @@ class Propal extends CommonObject $this->newref = $num; $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; - $sql .= " SET ref = '".$num."',"; + $sql .= " SET ref = '".$this->db->escape($num)."',"; $sql .= " fk_statut = ".self::STATUS_VALIDATED.", date_valid='".$this->db->idate($now)."', fk_user_valid=".$user->id; $sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 1316bb0db73..f108c5cc04f 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1705,13 +1705,13 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin // Date $out .= ''; - $out .= dol_print_date($histo[$key]['datestart'], 'dayhour'); + $out .= dol_print_date($histo[$key]['datestart'], 'dayhour', 'tzuserrel'); if ($histo[$key]['dateend'] && $histo[$key]['dateend'] != $histo[$key]['datestart']) { $tmpa = dol_getdate($histo[$key]['datestart'], true); $tmpb = dol_getdate($histo[$key]['dateend'], true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $out .= '-'.dol_print_date($histo[$key]['dateend'], 'hour'); - else $out .= '-'.dol_print_date($histo[$key]['dateend'], 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $out .= '-'.dol_print_date($histo[$key]['dateend'], 'hour', 'tzuserrel'); + else $out .= '-'.dol_print_date($histo[$key]['dateend'], 'dayhour', 'tzuserrel'); } $late = 0; if ($histo[$key]['percent'] == 0 && $histo[$key]['datestart'] && $histo[$key]['datestart'] < ($now - $delay_warning)) $late = 1; diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 7284d764d6f..5fc7d78c770 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -345,6 +345,10 @@ if (empty($reshook)) $db->rollback(); } else { $db->commit(); + + // Redirect to avoid to action done a second time if we make a back from browser + header("Location: ".$_SERVER["PHP_SELF"].'?id='.$object->id); + exit; } } } @@ -585,7 +589,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''.$langs->trans("ConfirmProductionDesc", $langs->transnoentitiesnoconv("Confirm")).'
'; print $langs->trans("MovementLabel").':   '; print $langs->trans("InventoryCode").':

'; - print ' '.$langs->trans("AutoCloseMO").'
'; + print '
'; print ''; print '   '; print ''; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index ebcc7968c60..1c7862f10f0 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -750,6 +750,7 @@ if ($resql) } if (!empty($arrayfields['m.datem']['checked'])) { + // Date print ''; print ''; if (empty($conf->productbatch->enabled)) print ' '; @@ -1006,7 +1007,7 @@ if ($resql) if (!empty($arrayfields['m.datem']['checked'])) { // Date - print ''.dol_print_date($db->jdate($objp->datem), 'dayhour').''; + print ''.dol_print_date($db->jdate($objp->datem), 'dayhour', 'tzuserrel').''; } if (!empty($arrayfields['p.ref']['checked'])) {