Skip to content
Snippets Groups Projects
Commit a01f0ec2 authored by tbrehm's avatar tbrehm
Browse files

added return to infos for lists

parent 4991f9e0
No related branches found
No related tags found
No related merge requests found
...@@ -73,6 +73,13 @@ class plugin_listview extends plugin_base { ...@@ -73,6 +73,13 @@ class plugin_listview extends plugin_base {
$lng_file = "lib/lang/".$_SESSION["s"]["language"]."_".$app->listform->listDef['name']."_list.lng"; $lng_file = "lib/lang/".$_SESSION["s"]["language"]."_".$app->listform->listDef['name']."_list.lng";
include($lng_file); include($lng_file);
$listTpl->setVar($wb); $listTpl->setVar($wb);
// Setting Returnto information in the session
$list_name = $app->listform->listDef["name"];
$_SESSION["s"]["list"][$list_name]["parent_id"] = $app->tform_actions->id;
$_SESSION["s"]["list"][$list_name]["parent_tab"] = $_SESSION["s"]["form"]["tab"];
$_SESSION["s"]["list"][$list_name]["parent_script"] = $app->tform->formDef["action"];
$_SESSION["s"]["form"]["return_to"] = $list_name;
return $listTpl->grab(); return $listTpl->grab();
......
...@@ -115,7 +115,14 @@ class tform_actions { ...@@ -115,7 +115,14 @@ class tform_actions {
} }
if($_REQUEST["next_tab"] == '') { if($_REQUEST["next_tab"] == '') {
header("Location: ".$app->tform->formDef['list_default']); if($_SESSION["s"]["form"]["return_to"] != '') {
$list_name = $_SESSION["s"]["form"]["return_to"];
$redirect = "Location: ".$_SESSION["s"]["list"][$list_name]["parent_script"]."?id=".$_SESSION["s"]["list"][$list_name]["parent_id"]."&next_tab=".$_SESSION["s"]["list"][$list_name]["parent_tab"];
unset($_SESSION["s"]["form"]["return_to"]);
header($redirect);
} else {
header("Location: ".$app->tform->formDef['list_default']);
}
exit; exit;
} else { } else {
$this->onShow(); $this->onShow();
...@@ -145,7 +152,14 @@ class tform_actions { ...@@ -145,7 +152,14 @@ class tform_actions {
} }
if($_REQUEST["next_tab"] == '') { if($_REQUEST["next_tab"] == '') {
header("Location: ".$app->tform->formDef['list_default']); if($_SESSION["s"]["form"]["return_to"] != '') {
$list_name = $_SESSION["s"]["form"]["return_to"];
$redirect = "Location: ".$_SESSION["s"]["list"][$list_name]["parent_script"]."?id=".$_SESSION["s"]["list"][$list_name]["parent_id"]."&next_tab=".$_SESSION["s"]["list"][$list_name]["parent_tab"];
unset($_SESSION["s"]["form"]["return_to"]);
header($redirect);
} else {
header("Location: ".$app->tform->formDef['list_default']);
}
exit; exit;
} else { } else {
$this->onShow(); $this->onShow();
......
...@@ -51,6 +51,8 @@ if(!stristr($_SESSION["s"]["user"]["modules"],$_SESSION["s"]["module"]["name"])) ...@@ -51,6 +51,8 @@ if(!stristr($_SESSION["s"]["user"]["modules"],$_SESSION["s"]["module"]["name"]))
$app->uses('tpl,tform,tform_actions'); $app->uses('tpl,tform,tform_actions');
$app->load('tform_actions'); $app->load('tform_actions');
die(print_r($_SESSION));
class page_action extends tform_actions { class page_action extends tform_actions {
function onShowEnd() { function onShowEnd() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment