From a01f0ec2151f4213d5a17b138909dd79a23ae4d2 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Thu, 24 Nov 2005 10:04:27 -0500
Subject: [PATCH] added return to infos for lists

---
 interface/lib/classes/tform_actions.inc.php |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/interface/lib/classes/tform_actions.inc.php b/interface/lib/classes/tform_actions.inc.php
index 74d7de9..7d40956 100644
--- a/interface/lib/classes/tform_actions.inc.php
+++ b/interface/lib/classes/tform_actions.inc.php
@@ -115,7 +115,14 @@
 			}
 			
 			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;
     		} else {
 				$this->onShow();
@@ -145,7 +152,14 @@
 			}
 			
 			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;
     		} else {
 				$this->onShow();

--
Gitblit v1.9.1