Merge pull request #9868 from atm-ph/fix_develop_php_warnings_in_js
Fix PHP warnings printed in javascript
This commit is contained in:
commit
e875aee2c5
@ -7094,54 +7094,60 @@ function printCommonFooter($zone='private')
|
|||||||
$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']));
|
||||||
foreach($user->default_values[$relativepathstring]['focus'] as $defkey => $defval)
|
if (!empty($user->default_values[$relativepathstring]['focus']))
|
||||||
{
|
{
|
||||||
$qualified = 0;
|
foreach($user->default_values[$relativepathstring]['focus'] as $defkey => $defval)
|
||||||
if ($defkey != '_noquery_')
|
|
||||||
{
|
{
|
||||||
$tmpqueryarraytohave=explode('&', $defkey);
|
$qualified = 0;
|
||||||
$foundintru=0;
|
if ($defkey != '_noquery_')
|
||||||
foreach($tmpqueryarraytohave as $tmpquerytohave)
|
|
||||||
{
|
{
|
||||||
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1;
|
$tmpqueryarraytohave=explode('&', $defkey);
|
||||||
|
$foundintru=0;
|
||||||
|
foreach($tmpqueryarraytohave as $tmpquerytohave)
|
||||||
|
{
|
||||||
|
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1;
|
||||||
|
}
|
||||||
|
if (! $foundintru) $qualified=1;
|
||||||
|
//var_dump($defkey.'-'.$qualified);
|
||||||
}
|
}
|
||||||
if (! $foundintru) $qualified=1;
|
else $qualified = 1;
|
||||||
//var_dump($defkey.'-'.$qualified);
|
|
||||||
}
|
|
||||||
else $qualified = 1;
|
|
||||||
|
|
||||||
if ($qualified)
|
if ($qualified)
|
||||||
{
|
|
||||||
foreach($defval as $paramkey => $paramval)
|
|
||||||
{
|
{
|
||||||
// Add property 'required' on input
|
foreach($defval as $paramkey => $paramval)
|
||||||
print 'jQuery("input[name=\''.$paramkey.'\']").focus();'."\n";
|
{
|
||||||
|
// Add property 'required' on input
|
||||||
|
print 'jQuery("input[name=\''.$paramkey.'\']").focus();'."\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach($user->default_values[$relativepathstring]['mandatory'] as $defkey => $defval)
|
if (!empty($user->default_values[$relativepathstring]['mandatory']))
|
||||||
{
|
{
|
||||||
$qualified = 0;
|
foreach($user->default_values[$relativepathstring]['mandatory'] as $defkey => $defval)
|
||||||
if ($defkey != '_noquery_')
|
|
||||||
{
|
{
|
||||||
$tmpqueryarraytohave=explode('&', $defkey);
|
$qualified = 0;
|
||||||
$foundintru=0;
|
if ($defkey != '_noquery_')
|
||||||
foreach($tmpqueryarraytohave as $tmpquerytohave)
|
|
||||||
{
|
{
|
||||||
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1;
|
$tmpqueryarraytohave=explode('&', $defkey);
|
||||||
|
$foundintru=0;
|
||||||
|
foreach($tmpqueryarraytohave as $tmpquerytohave)
|
||||||
|
{
|
||||||
|
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1;
|
||||||
|
}
|
||||||
|
if (! $foundintru) $qualified=1;
|
||||||
|
//var_dump($defkey.'-'.$qualified);
|
||||||
}
|
}
|
||||||
if (! $foundintru) $qualified=1;
|
else $qualified = 1;
|
||||||
//var_dump($defkey.'-'.$qualified);
|
|
||||||
}
|
|
||||||
else $qualified = 1;
|
|
||||||
|
|
||||||
if ($qualified)
|
if ($qualified)
|
||||||
{
|
|
||||||
foreach($defval as $paramkey => $paramval)
|
|
||||||
{
|
{
|
||||||
// Add property 'required' on input
|
foreach($defval as $paramkey => $paramval)
|
||||||
print 'jQuery("input[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
|
{
|
||||||
print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; // required on a select works only if key is "", this does not happen in Dolibarr
|
// Add property 'required' on input
|
||||||
|
print 'jQuery("input[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
|
||||||
|
print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; // required on a select works only if key is "", this does not happen in Dolibarr
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user