From d53e5291cecde0cb4331f9f2576b2ce2a6861f97 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 7 Jun 2010 14:43:34 +0000 Subject: [PATCH] - not longer using referer for message of successful saved infolog, but using opener.location.search += 'msg=...', as it works better with jDots - calling static methods of egw and common class static --- infolog/inc/class.infolog_ui.inc.php | 35 +++++++++++++--------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/infolog/inc/class.infolog_ui.inc.php b/infolog/inc/class.infolog_ui.inc.php index fbf9111d2a..c993230e4a 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -491,7 +491,7 @@ class infolog_ui } elseif ($own_referer === '') { - $own_referer = $GLOBALS['egw']->common->get_referer(); + $own_referer = common::get_referer(); if (strpos($own_referer,'menuaction=infolog.infolog_ui.edit') !== false) { $own_referer = $GLOBALS['egw']->session->appsession('own_session','infolog'); @@ -917,7 +917,7 @@ class infolog_ui $content['msg'] = $info_id !== 0 || !$content['info_id'] ? lang('Error: saving the entry') : lang('Error: the entry has been updated since you opened it for editing!').'
'. lang('Copy your changes to the clipboard, %1reload the entry%2 and merge them.','link($referer,array('msg' => $content['msg'])))."';"; - } + $content['js'] = "opener.location.search += (opener.location.search ? '&msg=' : '?msg=')+'{$content['msg']}';"; } $content[$tabs] = $active_tab; if ((int) $content['pm_id'] != (int) $content['old_pm_id']) @@ -995,22 +992,22 @@ class infolog_ui ); if (!($content['msg'] = $this->delete($info_id,$referer,'edit'))) return; // checks ACL first - $content['js'] = "opener.location.href='".$GLOBALS['egw']->link($referer,array('msg' => $content['msg']))."';"; + $content['js'] = "opener.location.href='".egw::link($referer,array('msg' => $content['msg']))."';"; } // called again after delete confirmation dialog elseif ($button == 'deleted' && $content['msg']) { - $content['js'] = "opener.location.href='".$GLOBALS['egw']->link($referer,array('msg' => $content['msg']))."';"; + $content['js'] = "opener.location.href='".egw::link($referer,array('msg' => $content['msg']))."';"; } if ($button == 'save' || $button == 'cancel' || $button == 'delete' || $button == 'deleted') { if ($no_popup) { - $GLOBALS['egw']->redirect_link($referer,array('msg' => $content['msg'])); + egw::redirect_link($referer,array('msg' => $content['msg'])); } $content['js'] .= 'window.close();'; echo ''; - $GLOBALS['egw']->common->egw_exit(); + common::egw_exit(); } if ($content['js']) $content['js'] = ''; } @@ -1029,7 +1026,7 @@ class infolog_ui $info_id = $content ? $content : get_var('info_id', array('POST','GET')); $type = $type ? $type : get_var('type', array('POST','GET')); $ref=$referer = $referer !== '' ? $referer : ($_GET['referer'] ? $_GET['referer'] : - $GLOBALS['egw']->common->get_referer('/index.php?menuaction=infolog.infolog_ui.index')); + common::get_referer('/index.php?menuaction=infolog.infolog_ui.index')); $referer = preg_replace('/([&?]{1})msg=[^&]+&?/','\\1',$referer); // remove previou/old msg from referer $no_popup = $_GET['no_popup']; $print = (int) $_REQUEST['print']; @@ -1100,14 +1097,14 @@ class infolog_ui { if ($no_popup) { - $GLOBALS['egw']->common->egw_header(); + common::egw_header(); parse_navbar(); echo '

'.lang('Permission denied')."

\n"; - $GLOBALS['egw']->common->egw_exit(); + common::egw_exit(); } $js = "alert('".lang('Permission denied')."'); window.close();"; echo ''; - $GLOBALS['egw']->common->egw_exit(); + common::egw_exit(); } } $content['links'] = $content['link_to'] = array( @@ -1333,7 +1330,7 @@ class infolog_ui { $icon = $this->icons[$cat][$id]; } - if ($icon && !is_readable($GLOBALS['egw']->common->get_image_dir() . '/' . $icon)) + if ($icon && !is_readable(common::get_image_dir() . '/' . $icon)) { $icon = False; } @@ -1407,11 +1404,11 @@ class infolog_ui } if($_POST['cancel'] || $_POST['save']) { - $GLOBALS['egw']->redirect_link('/infolog/index.php'); + egw::redirect_link('/infolog/index.php'); } $GLOBALS['egw_info']['flags']['app_header'] = lang('InfoLog').' - '.lang('Site configuration'); - $GLOBALS['egw']->common->egw_header(); + common::egw_header(); $GLOBALS['egw']->template->set_file(array('info_admin_t' => 'admin.tpl')); $GLOBALS['egw']->template->set_block('info_admin_t', 'admin_line'); @@ -1536,9 +1533,9 @@ class infolog_ui strtotime($mailcontent['headers']['DATE']) )); } - $GLOBALS['egw']->common->egw_header(); + common::egw_header(); echo ""; - $GLOBALS['egw']->common->egw_exit(); + common::egw_exit(); exit; }