Fix fields were lost after changing the thirdparty
This commit is contained in:
parent
6c2d08b9f8
commit
bfd48d44ad
@ -80,8 +80,6 @@ if (isModEnabled('margin')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// General $Variables
|
// General $Variables
|
||||||
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : 0);
|
|
||||||
|
|
||||||
$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
|
$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
|
||||||
$ref = GETPOST('ref', 'alpha');
|
$ref = GETPOST('ref', 'alpha');
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
@ -100,6 +98,7 @@ $fac_rec = GETPOST('fac_rec', 'int');
|
|||||||
$facid = GETPOST('facid', 'int');
|
$facid = GETPOST('facid', 'int');
|
||||||
$ref_client = GETPOST('ref_client', 'int');
|
$ref_client = GETPOST('ref_client', 'int');
|
||||||
$rank = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1;
|
$rank = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1;
|
||||||
|
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : 0);
|
||||||
|
|
||||||
// PDF
|
// PDF
|
||||||
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
|
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
|
||||||
@ -3150,7 +3149,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">';
|
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" id="formtocreateaction" value="add">';
|
||||||
if ($soc->id > 0) {
|
if ($soc->id > 0) {
|
||||||
print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
|
print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
|
||||||
}
|
}
|
||||||
@ -3216,11 +3215,10 @@ if ($action == 'create') {
|
|||||||
$(\'input[name="force_fk_account"]\').val(\'1\');
|
$(\'input[name="force_fk_account"]\').val(\'1\');
|
||||||
$("#formtocreate").submit(); */
|
$("#formtocreate").submit(); */
|
||||||
|
|
||||||
// For company change, we must reuse data of comany, not input already done, so we call a GET with action=create, not a POST submit.
|
// For company change, we must submit page with action=create instead of action=add
|
||||||
console.log("We have changed the company - Reload page");
|
console.log("We have changed the company - Resubmit page");
|
||||||
var socid = $(this).val();
|
jQuery("#formtocreateaction").val("create");
|
||||||
var fac_rec = $(\'#fac_rec\').val();
|
jQuery("#formtocreate").submit();
|
||||||
window.location.href = "'.$_SERVER["PHP_SELF"].'?action=create&socid="+socid+"&fac_rec="+fac_rec;
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user