File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed
Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,13 @@ function onShow() {
7373 $ lng_file = "lib/lang/ " .$ _SESSION ["s " ]["language " ]."_ " .$ app ->listform ->listDef ['name ' ]."_list.lng " ;
7474 include ($ lng_file );
7575 $ listTpl ->setVar ($ wb );
76+
77+ // Setting Returnto information in the session
78+ $ list_name = $ app ->listform ->listDef ["name " ];
79+ $ _SESSION ["s " ]["list " ][$ list_name ]["parent_id " ] = $ app ->tform_actions ->id ;
80+ $ _SESSION ["s " ]["list " ][$ list_name ]["parent_tab " ] = $ _SESSION ["s " ]["form " ]["tab " ];
81+ $ _SESSION ["s " ]["list " ][$ list_name ]["parent_script " ] = $ app ->tform ->formDef ["action " ];
82+ $ _SESSION ["s " ]["form " ]["return_to " ] = $ list_name ;
7683
7784 return $ listTpl ->grab ();
7885
Original file line number Diff line number Diff line change @@ -115,7 +115,14 @@ function onUpdate() {
115115 }
116116
117117 if ($ _REQUEST ["next_tab " ] == '' ) {
118- header ("Location: " .$ app ->tform ->formDef ['list_default ' ]);
118+ if ($ _SESSION ["s " ]["form " ]["return_to " ] != '' ) {
119+ $ list_name = $ _SESSION ["s " ]["form " ]["return_to " ];
120+ $ 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 " ];
121+ unset($ _SESSION ["s " ]["form " ]["return_to " ]);
122+ header ($ redirect );
123+ } else {
124+ header ("Location: " .$ app ->tform ->formDef ['list_default ' ]);
125+ }
119126 exit ;
120127 } else {
121128 $ this ->onShow ();
@@ -145,7 +152,14 @@ function onInsert() {
145152 }
146153
147154 if ($ _REQUEST ["next_tab " ] == '' ) {
148- header ("Location: " .$ app ->tform ->formDef ['list_default ' ]);
155+ if ($ _SESSION ["s " ]["form " ]["return_to " ] != '' ) {
156+ $ list_name = $ _SESSION ["s " ]["form " ]["return_to " ];
157+ $ 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 " ];
158+ unset($ _SESSION ["s " ]["form " ]["return_to " ]);
159+ header ($ redirect );
160+ } else {
161+ header ("Location: " .$ app ->tform ->formDef ['list_default ' ]);
162+ }
149163 exit ;
150164 } else {
151165 $ this ->onShow ();
Original file line number Diff line number Diff line change 5151$ app ->uses ('tpl,tform,tform_actions ' );
5252$ app ->load ('tform_actions ' );
5353
54+ die (print_r ($ _SESSION ));
55+
5456class page_action extends tform_actions {
5557
5658 function onShowEnd () {
You can’t perform that action at this time.
0 commit comments