FIX Load chart of account only if we click or select button "Load chart"
This commit is contained in:
parent
80c1a92872
commit
edfedbb818
@ -101,7 +101,7 @@ if (empty($reshook))
|
|||||||
$search_array_options=array();
|
$search_array_options=array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('change_chart', 'alpha') && GETPOST('valid_change_chart', 'int'))
|
if (GETPOST('change_chart', 'alpha') && (GETPOST('valid_change_chart', 'int') || empty($conf->use_javascript_ajax)))
|
||||||
{
|
{
|
||||||
$chartofaccounts = GETPOST('chartofaccounts', 'int');
|
$chartofaccounts = GETPOST('chartofaccounts', 'int');
|
||||||
|
|
||||||
@ -237,21 +237,24 @@ if ($resql)
|
|||||||
if ($search_pcgsubtype) $param.= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
|
if ($search_pcgsubtype) $param.= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
|
||||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||||
|
|
||||||
print '<!-- Add javascript to update a flag when we select "Change plan" -->
|
if (! empty($conf->use_javascript_ajax))
|
||||||
<script type="text/javascript">
|
{
|
||||||
$(document).ready(function () {
|
print '<!-- Add javascript to update a flag when we select "Change plan" -->
|
||||||
$("#searchFormList").on("submit", function (e) {
|
<script type="text/javascript">
|
||||||
console.log("chartofaccounts focus = "+$("#chartofaccounts").is(":focus"));
|
$(document).ready(function () {
|
||||||
console.log("change_chart focus = "+$("#change_chart").is(":focus"));
|
$("#searchFormList").on("submit", function (e) {
|
||||||
if ($("#change_chart").is(":focus"))
|
console.log("chartofaccounts focus = "+$("#chartofaccounts").is(":focus"));
|
||||||
{
|
console.log("change_chart focus = "+$("#change_chart").is(":focus"));
|
||||||
console.log("We set valid_change_chart to 1");
|
if ($("#change_chart").is(":focus"))
|
||||||
$("#valid_change_chart").val(1);
|
{
|
||||||
}
|
console.log("We set valid_change_chart to 1");
|
||||||
return true;
|
$("#valid_change_chart").val(1);
|
||||||
});
|
}
|
||||||
});
|
return true;
|
||||||
</script>';
|
});
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
|
print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user