From 3289d93605bb287860b8a114e06d87b33e71ddd5 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 10 Jun 2010 17:24:22 +0000 Subject: [PATCH] - missing target for new button in sidebox - adding message to opener.location.search, instead using referer (which points to toplevel frame and reloads framework) --- calendar/inc/class.calendar_ui.inc.php | 2 +- calendar/inc/class.calendar_uiforms.inc.php | 39 ++++++++------------- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php index 4644d8312b..a1a02bd629 100644 --- a/calendar/inc/class.calendar_ui.inc.php +++ b/calendar/inc/class.calendar_ui.inc.php @@ -511,7 +511,7 @@ class calendar_ui function popup($link,$target='_blank',$width=750,$height=410) { return 'egw_openWindowCentered2('.($link == 'this.href' ? $link : "'".$link."'").','. - ($target == 'this.target' ? $target : "'".$target."'").",$width,$height,'yes')"; + ($target == 'this.target' ? $target : "'".$target."'").",$width,$height,'yes','calendar')"; } /** diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index 8832902382..2b63e659fb 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -172,7 +172,6 @@ class calendar_uiforms extends calendar_ui } $messages = null; $msg_permission_denied_added = false; - $referer = !empty($content['referer']) ? $content['referer'] : '/index.php?menuaction='.$this->view_menuaction; list($button) = @each($content['button']); if (!$button && $content['action']) $button = $content['action']; // action selectbox unset($content['button']); unset($content['action']); @@ -216,9 +215,8 @@ class calendar_uiforms extends calendar_ui { $msg = lang('Alarm deleted'); unset($content['alarm'][$id]); - $js = 'opener.location.href=\''.addslashes(egw::link($referer,array( - 'msg' => $msg, - ))).'\';'; + $js = "opener.location.search += (opener.location.search?'&msg=':'?msg=')+'". + addslashes($msg)."';"; } else { @@ -398,9 +396,8 @@ class calendar_uiforms extends calendar_ui } if (!$content['no_popup']) { - $js = 'opener.location.href=\''.addslashes(egw::link($referer,array( - 'msg' => $msg, - ))).'\';'; + $js = "opener.location.search += (opener.location.search?'&msg=':'?msg=')+'". + addslashes($msg)."';"; } } } @@ -421,7 +418,6 @@ class calendar_uiforms extends calendar_ui 'reference' => $content['reference'], 'recurrence' => $content['recurrence'], 'actual_date' => $content['actual_date'], - 'referer' => $referer, 'no_popup' => $content['no_popup'], $this->tabs => $content[$this->tabs], 'template' => $content['template'], @@ -615,7 +611,6 @@ class calendar_uiforms extends calendar_ui htmlspecialchars(egw::link('/index.php',array( 'menuaction' => 'calendar.calendar_uiforms.edit', 'cal_id' => $content['id'], - 'referer' => $referer, ))).'">',''); $noerror = false; $event = $orig_event; @@ -661,7 +656,6 @@ class calendar_uiforms extends calendar_ui htmlspecialchars(egw::link('/index.php',array( 'menuaction' => 'calendar.calendar_uiforms.edit', 'cal_id' => $content['id'], - 'referer' => $referer, ))).'">',''); $noerror = false; } @@ -718,9 +712,8 @@ class calendar_uiforms extends calendar_ui { egw_link::link('calendar',$event['id'],$content['link_to']['to_id']); } - $js = 'opener.location.href=\''.addslashes(egw::link($referer,array( - 'msg' => $msg, - ))).'\';'; + $js = "opener.location.search += (opener.location.search?'&msg=':'?msg=')+'". + addslashes($msg)."';"; if ($button == 'print') { @@ -741,9 +734,8 @@ class calendar_uiforms extends calendar_ui case 'cancel': if($content['cancel_needs_refresh']) { - $js = 'opener.location.href=\''.addslashes(egw::link($referer,array( - 'msg' => $msg, - ))).'\';'; + $js = "opener.location.search += (opener.location.search?'&msg=':'?msg=')+'". + addslashes($msg)."';"; } break; @@ -783,9 +775,8 @@ class calendar_uiforms extends calendar_ui { $msg = lang('Event deleted'); } - $js = 'opener.location.href=\''.addslashes(egw::link($referer,array( - 'msg' => $msg, - ))).'\';'; + $js = "opener.location.search += (opener.location.search?'&msg=':'?msg=')+'". + addslashes($msg)."';"; } break; @@ -823,9 +814,8 @@ class calendar_uiforms extends calendar_ui $event['alarm'][$alarm_id] = $alarm; $msg = lang('Alarm added'); - $js = 'opener.location.href=\''.addslashes(egw::link($referer,array( - 'msg' => $msg, - ))).'\';'; + $js = "opener.location.search += (opener.location.search?'&msg=':'?msg=')+'". + addslashes($msg)."';"; } else { @@ -852,7 +842,8 @@ class calendar_uiforms extends calendar_ui } if ($content['no_popup']) { - $GLOBALS['egw']->redirect_link($referer,array( + egw::redirect_link('/index.php',array( + 'menuaction' => 'calendar.calendar_uiviews.index', 'msg' => $msg, )); } @@ -982,7 +973,6 @@ class calendar_uiforms extends calendar_ui * @param array $perserv=null following keys: * view boolean view-mode, if no edit-access we automatic fallback to view-mode * hide_delete boolean hide delete button - * referer string menuaction of the referer * no_popup boolean use a popup or not * edit_single int timestamp of single event edited, unset/null otherwise * @param string $msg='' msg to display @@ -1008,7 +998,6 @@ class calendar_uiforms extends calendar_ui { $preserv = array( 'no_popup' => isset($_GET['no_popup']), - 'referer' => common::get_referer('/index.php?menuaction='.$this->view_menuaction), 'template' => isset($_GET['template']) ? $_GET['template'] : (isset($_REQUEST['print']) ? 'calendar.print' : 'calendar.edit'), ); $cal_id = (int) $_GET['cal_id'];