Merge pull request #15213 from ATM-Consulting/fix/10.0_delete_action_from_redirect_url_when_reordering_lines

FIX - 10.0 - remove 'action' parameter from redirect URL when reordering lines
This commit is contained in:
Laurent Destailleur 2020-11-02 09:41:00 +01:00 committed by GitHub
commit f25a6b2e67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 -->