fix call forward back button on save (#7196)

* fix call forward back button on save
This commit is contained in:
frytimo 2024-12-11 17:53:55 -04:00 committed by GitHub
parent 975f0755ea
commit 3d4fe6e5c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View File

@ -209,6 +209,9 @@
}
require_once "resources/header.php";
//set the back button
$_SESSION['call_forward_back'] = $_SERVER['PHP_SELF'];
//show the content
if ($is_included) {
echo "<div class='action_bar sub'>\n";

View File

@ -533,13 +533,16 @@
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//save the back button location using referer
$back_destination = "window.location.href='" . ($_SESSION['call_forward_back'] ?? "/app/call_forward/call_forward.php") . "'";
//show the content
echo "<form method='post' name='frm' id='frm'>\n";
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-call_forward']."</b></div>\n";
echo " <div class='actions'>\n";
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','onclick'=>'history.back();']);
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','onclick'=>$back_destination]);
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','style'=>'margin-left: 15px;']);
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";

View File

@ -1061,6 +1061,9 @@
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//set the back button
$_SESSION['call_forward_back'] = $_SERVER['PHP_SELF'] . "?id=$extension_uuid";
//begin the page content
require_once "resources/header.php";
if ($action == "update") {