[Rt-commit] rt branch, 4.0/saved-search-context, updated. rt-4.0.1-207-g956de34
Jason May
jasonmay at bestpractical.com
Tue Aug 2 16:57:45 EDT 2011
The branch, 4.0/saved-search-context has been updated
via 956de34b890c725798111ff3b75ff331e8717fe1 (commit)
from 0ef0b63599fd0823f82cce371132e590b72c5bbd (commit)
Summary of changes:
share/html/Elements/Tabs | 9 ++++++++-
share/html/Search/Chart.html | 30 +++++++++++++++++++++++++++++-
share/html/Search/Elements/EditSearches | 4 ++--
3 files changed, 39 insertions(+), 4 deletions(-)
- Log -----------------------------------------------------------------
commit 956de34b890c725798111ff3b75ff331e8717fe1
Author: Jason May <jasonmay at bestpractical.com>
Date: Tue Aug 2 16:17:40 2011 -0400
Work-in-progress on preserving chart search IDs across tab clicking
The tests in this commit currently fail. Performing the equivalent
actions in a live browser does what we expect. This could be
session-related.
diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index a7ac54d..0f30903 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -570,12 +570,19 @@ my $build_admin_menu = sub {
my $has_query = '';
my $current_search = $session{"CurrentSearchHash"} || {};
my $search_id = $m->request_args->{'SavedSearchLoad'} || $m->request_args->{'SavedSearchId'} || $current_search->{'SearchId'} || '';
+ my $chart_id = $m->request_args->{'SavedChartSearchId'} || $current_search->{SavedChartSearchId};
+
+ if ($request_path =~ m{^/Search/Chart\.html}) {
+ if ($m->request_args->{'SavedSearchLoadButton'}) {
+ chart_id = $m->request_args->{'SavedSearchLoad'};
+ }
+ }
$has_query = 1 if ( $m->request_args->{'Query'} or $current_search->{'Query'} );
my %query_args = (
SavedSearchId => ( $search_id eq 'new' ) ? undef : $search_id,
- SavedChartSearchId => $m->request_args->{'SavedChartSearchId'} || $current_search->{SavedChartSearchId},
+ SavedChartSearchId => $chart_id,
Query => $m->request_args->{'Query'} || $current_search->{'Query'},
Format => $m->request_args->{'Format'} || $current_search->{'Format'},
OrderBy => $m->request_args->{'OrderBy'} || $current_search->{'OrderBy'} ||'',
diff --git a/share/html/Search/Chart.html b/share/html/Search/Chart.html
index b036565..b9413be 100644
--- a/share/html/Search/Chart.html
+++ b/share/html/Search/Chart.html
@@ -76,9 +76,37 @@ my $saved_search = $m->comp( '/Widgets/SavedSearch:new',
my @actions = $m->comp( '/Widgets/SavedSearch:process', args => \%ARGS, self => $saved_search );
+my %query;
+
+{
+ if ($saved_search->{'CurrentSearch'}->{'Object'}) {
+ foreach my $search_field (@{ $saved_search->{'SearchFields'} }) {
+ $query{$search_field} = $saved_search->{'CurrentSearch'}->{'Object'}->Content->{$search_field};
+ }
+ }
+
+ my $current = $session{'CurrentSearchHash'};
+
+ my @session_fields = qw(
+ Query
+ SavedChartSearchId
+ SavedSearchDescription
+ SavedSearchLoad
+ SavedSearchLoadButton
+ SavedSearchOwner
+ );
+
+ for(@session_fields) {
+ $query{$_} = $current->{$_} unless defined $query{$_};
+ $query{$_} = $m->request_args->{$_} unless defined $query{$_};
+ }
+
+}
+
+my $QueryString = $m->comp('/Elements/QueryString', %query );
</%init>
<& /Elements/Header, Title => $title &>
-<& /Elements/Tabs &>
+<& /Elements/Tabs, QueryString => $QueryString &>
<& /Elements/ListActions, actions => \@actions &>
<& /Search/Elements/Chart, %ARGS &>
diff --git a/share/html/Search/Elements/EditSearches b/share/html/Search/Elements/EditSearches
index 7f2f9f6..89d652d 100644
--- a/share/html/Search/Elements/EditSearches
+++ b/share/html/Search/Elements/EditSearches
@@ -68,9 +68,9 @@
</nobr>
% }
% if ( $Object && $Object->Id ) {
-<input type="submit" class="button" name="SavedSearchSave" value="<%loc('Update')%>" />
+<input type="submit" class="button" id="SavedSearchSave" name="SavedSearchSave" value="<%loc('Update')%>" />
% } else {
-<input type="submit" class="button" name="SavedSearchSave" value="<%loc('Save')%>" />
+<input type="submit" class="button" id="SavedSearchSave" name="SavedSearchSave" value="<%loc('Save')%>" />
%}
% }
<br />
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list