From 22c8c1dd5863c5c9d1c20e810eec9440ba1da795 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Wed, 12 Mar 2003 18:36:54 +0000 Subject: [PATCH] Bugfix for querywindow: Didn't show the latest queries. --- ChangeLog | 2 ++ header.inc.php3 | 9 ++++++--- libraries/common.lib.php3 | 2 +- querywindow.php3 | 7 +++++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2888e990d..2a245211c 100755 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ $Id$ $Source$ 2003-03-12 Garvin Hicking + * header.inc.php3, querywindow.php3, libraries/common.lib.php3: Fixed some bugs for + the querywindow which didn't show the latest querys always. * Documentation.html, db_details.php3, read_dump.php3, tbl_query_box.php3: RFE #470000 - Use parameters for bookmarked queries. This is a bit tricky to do, so please see Documentation.html. I thought it too hard to move the diff --git a/header.inc.php3 b/header.inc.php3 index 6c93df05f..797f2ed91 100755 --- a/header.inc.php3 +++ b/header.inc.php3 @@ -145,17 +145,20 @@ if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) { } } - function focus_querywindow() { + function focus_querywindow(sql_query) { if (top.frames.queryframe && top.frames.queryframe.querywindow && !top.frames.queryframe.querywindow.closed && top.frames.queryframe.querywindow.location) { top.frames.queryframe.querywindow.focus(); + return false; } else if (top.frames.queryframe) { - top.frames.queryframe.querywindow=window.open('querywindow.php3?&db=&table=', 'js_querywindow','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=yes,resizable=yes,width=,height='); + new_win_url = 'querywindow.php3?sql_query=' + sql_query + '&&db=&table='; + top.frames.queryframe.querywindow=window.open(new_win_url, 'js_querywindow','toolbar=0,location=1,directories=0,status=1,menubar=0,scrollbars=yes,resizable=yes,width=,height='); if (!top.frames.queryframe.querywindow.opener) { top.frames.queryframe.querywindow.opener = top.frames.queryframe; } - reload_querywindow(); + // reload_querywindow(); + return false; } } diff --git a/libraries/common.lib.php3 b/libraries/common.lib.php3 index 2efe0bfd8..b1285be63 100644 --- a/libraries/common.lib.php3 +++ b/libraries/common.lib.php3 @@ -1376,7 +1376,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold} $onclick = ''; if ($cfg['QueryFrameJS'] && $cfg['QueryFrame']) { - $onclick = 'onclick="focus_querywindow(); return false;"'; + $onclick = 'onclick="focus_querywindow(\'' . urlencode($GLOBALS['sql_query']) . '\'); return false;"'; } $edit_link = ' [ - +