}
}
-function end_page($no_menu=false, $is_index=false, $hide_back_link=false, $type_no=0, $trans_no=0)
+function end_page($no_menu=false, $is_index=false, $final_screen=false, $type_no=0, $trans_no=0)
{
global $path_to_root;
- if (!$is_index && !$hide_back_link && function_exists('hyperlink_back'))
- hyperlink_back(true, $no_menu, $type_no, $trans_no);
+ if (!$is_index && function_exists('hyperlink_back'))
+ hyperlink_back(true, $no_menu, $type_no, $trans_no, $final_screen);
div_end(); // end of _page_body section
include($path_to_root . "/includes/page/footer.inc");
- page_footer($no_menu, $is_index, $hide_back_link);
+ page_footer($no_menu, $is_index);
}
function cache_js_file($fpath, $text)
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-function page_footer($no_menu=false, $is_index=false, $hide_back_link=false)
+function page_footer($no_menu=false, $is_index=false)
{
global $path_to_root, $js_lib, $Validate, $Editors, $Ajax, $sql_queries;
return $clean ? $label : array($label, $access);
}
-function hyperlink_back($center=true, $no_menu=true, $type_no=0, $trans_no=0)
+function hyperlink_back($center=true, $no_menu=true, $type_no=0, $trans_no=0, $final=false)
{
global $path_to_root;
if ($id != 0)
echo "<td align=center><a href='$path_to_root/admin/attachments.php?vw=$id' target='blanc_'>"._("View Attachment")."</a></td>\n";
echo "<td align=center><a href='javascript:window.print();'>"._("Print")."</a></td>\n";
- }
- echo "<td align=center><a href='javascript:goBack(".($no_menu ? "1":"0").");'>".($no_menu ? _("Close") : _("Back"))."</a></td>\n";
+ }
+ echo "<td align=center><a href='javascript:goBack(".($final ? '-2' : '').");'>".($no_menu ? _("Close") : _("Back"))."</a></td>\n";
end_row();
end_table();
if ($center)
return isNaN(val) ? 0 : val;
}
-function goBack(no_menu) {
- if (no_menu)
+function goBack(deep) {
+ if (window.opener)
window.close();
else
- window.history.go(-1);
+ window.history.go(deep || -1);
}
function setFocus(name, byId) {
function check_edit_conflicts($cartname='Items')
{
global $Ajax;
-
- if (isset($_POST['cart_id']) && $_POST['cart_id'] != $_SESSION[$cartname]->cart_id) {
+
+ if (get_post('cart_id') && $_POST['cart_id'] != $_SESSION[$cartname]->cart_id) {
display_error(_('This edit session has been abandoned by opening sales document in another browser tab. You cannot edit more than one sales document at once.'));
$Ajax->activate('_page_body');
display_footer_exit();