Merge pull request #22756 from OPEN-DSI/14.0_fix_reload_page_on_supplier_change
FIX: Reload page on supplier change and keeping the values
This commit is contained in:
commit
010014b4ea
@ -1695,13 +1695,13 @@ if ($action == 'create') {
|
|||||||
print img_picto('', 'company').$form->select_company((empty($socid) ? '' : $socid), 'socid', '(s.fournisseur=1 AND s.status=1)', 'SelectThirdParty', 1, 0, null, 0, 'minwidth175 maxwidth500 widthcentpercentminusxx');
|
print img_picto('', 'company').$form->select_company((empty($socid) ? '' : $socid), 'socid', '(s.fournisseur=1 AND s.status=1)', 'SelectThirdParty', 1, 0, null, 0, 'minwidth175 maxwidth500 widthcentpercentminusxx');
|
||||||
// reload page to retrieve customer informations
|
// reload page to retrieve customer informations
|
||||||
if (!empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE)) {
|
if (!empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE)) {
|
||||||
print '<script>
|
print '<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$("#socid").change(function() {
|
$("#socid").change(function() {
|
||||||
var socid = $(this).val();
|
console.log("We have changed the company - Reload page");
|
||||||
var prjid = $("#projectid").val();
|
|
||||||
// reload page
|
// reload page
|
||||||
window.location.href = "'.$_SERVER["PHP_SELF"].'?action=create&socid="+socid+"&projectid="+prjid
|
$("input[name=action]").val("create");
|
||||||
|
$("form[name=add]").submit();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
|||||||
@ -2103,9 +2103,10 @@ if ($action == 'create') {
|
|||||||
print '<script type="text/javascript">
|
print '<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$("#socid").change(function() {
|
$("#socid").change(function() {
|
||||||
var socid = $(this).val();
|
console.log("We have changed the company - Reload page");
|
||||||
var fac_rec = $(\'#fac_rec\').val();
|
// reload page
|
||||||
window.location.href = "'.$_SERVER["PHP_SELF"].'?action=create&socid="+socid+"&fac_rec="+fac_rec;
|
$("input[name=action]").val("create");
|
||||||
|
$("form[name=add]").submit();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user