FIX Mandatory fields must stay mandatory if create/update submit fails

This commit is contained in:
Laurent Destailleur
2020-01-27 22:22:59 +01:00
parent a02a2a6def
commit fc63d7366d

View File

@@ -7417,7 +7417,7 @@ function printCommonFooter($zone = 'private')
if (constant('DOL_URL_ROOT')) $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'), '/').'/', '', $relativepathstring); if (constant('DOL_URL_ROOT')) $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'), '/').'/', '', $relativepathstring);
$relativepathstring = preg_replace('/^\//', '', $relativepathstring); $relativepathstring = preg_replace('/^\//', '', $relativepathstring);
$relativepathstring = preg_replace('/^custom\//', '', $relativepathstring); $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
$tmpqueryarraywehave = explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING'])); //$tmpqueryarraywehave = explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
if (!empty($user->default_values[$relativepathstring]['focus'])) if (!empty($user->default_values[$relativepathstring]['focus']))
{ {
foreach ($user->default_values[$relativepathstring]['focus'] as $defkey => $defval) foreach ($user->default_values[$relativepathstring]['focus'] as $defkey => $defval)
@@ -7429,7 +7429,9 @@ function printCommonFooter($zone = 'private')
$foundintru = 0; $foundintru = 0;
foreach ($tmpqueryarraytohave as $tmpquerytohave) foreach ($tmpqueryarraytohave as $tmpquerytohave)
{ {
if (!in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru = 1; $tmpquerytohaveparam = explode('=', $tmpquerytohave);
//print "console.log('".$tmpquerytohaveparam[0]." ".$tmpquerytohaveparam[1]." ".GETPOST($tmpquerytohaveparam[0])."');";
if (!GETPOSTISSET($tmpquerytohaveparam[0]) || ($tmpquerytohaveparam[1] != GETPOST($tmpquerytohaveparam[0]))) $foundintru = 1;
} }
if (!$foundintru) $qualified = 1; if (!$foundintru) $qualified = 1;
//var_dump($defkey.'-'.$qualified); //var_dump($defkey.'-'.$qualified);
@@ -7459,7 +7461,9 @@ function printCommonFooter($zone = 'private')
$foundintru = 0; $foundintru = 0;
foreach ($tmpqueryarraytohave as $tmpquerytohave) foreach ($tmpqueryarraytohave as $tmpquerytohave)
{ {
if (!in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru = 1; $tmpquerytohaveparam = explode('=', $tmpquerytohave);
//print "console.log('".$tmpquerytohaveparam[0]." ".$tmpquerytohaveparam[1]." ".GETPOST($tmpquerytohaveparam[0])."');";
if (!GETPOSTISSET($tmpquerytohaveparam[0]) || ($tmpquerytohaveparam[1] != GETPOST($tmpquerytohaveparam[0]))) $foundintru = 1;
} }
if (!$foundintru) $qualified = 1; if (!$foundintru) $qualified = 1;
//var_dump($defkey.'-'.$qualified); //var_dump($defkey.'-'.$qualified);