FIX - 10.0 - remove 'action' parameter from redirect URL when reordering lines on a document

This commit is contained in:
Florian Mortgat 2020-10-29 10:50:13 +01:00
parent 12289ceb9e
commit 5e2962ef38

View File

@ -80,7 +80,12 @@ $(document).ready(function(){
console.log("tableDND end of ajax call");
if (reloadpage == 1) {
//console.log('<?php echo $urltorefreshaftermove.' - '.$_SERVER['PHP_SELF'].' - '.dol_escape_js($_SERVER['QUERY_STRING']); ?>');
location.href = '<?php echo dol_escape_js(empty($urltorefreshaftermove) ? ($_SERVER['PHP_SELF'].'?'.dol_escape_js($_SERVER['QUERY_STRING'])) : $urltorefreshaftermove); ?>';
<?php
$redirectURL = empty($urltorefreshaftermove) ? ($_SERVER['PHP_SELF'].'?'.dol_escape_js($_SERVER['QUERY_STRING'])) : $urltorefreshaftermove;
// remove action parameter from URL
$redirectURL = preg_replace('/[&?]action=[^&]*/', '', $redirectURL);
?>
location.href = '<?php echo dol_escape_js($redirectURL); ?>';
} else {
$("#<?php echo $tagidfortablednd; ?> .drag").each(
function( intIndex ) {
@ -108,4 +113,4 @@ $(document).ready(function(){
});
</script>
<?php } ?>
<!-- END PHP TEMPLATE AJAXROW.TPL.PHP -->
<!-- END PHP TEMPLATE AJAXROW.TPL.PHP -->