[Rt-commit] r2670 - in rt/branches/PLATANO-EXPERIMENTAL: .
html/Search
jesse at bestpractical.com
jesse at bestpractical.com
Sat Apr 16 02:46:57 EDT 2005
Author: jesse
Date: Sat Apr 16 02:46:56 2005
New Revision: 2670
Added:
rt/branches/PLATANO-EXPERIMENTAL/html/Search/Simple.html
Removed:
rt/branches/PLATANO-EXPERIMENTAL/html/Search/Quick.html
Modified:
rt/branches/PLATANO-EXPERIMENTAL/ (props changed)
rt/branches/PLATANO-EXPERIMENTAL/html/Search/Build.html
rt/branches/PLATANO-EXPERIMENTAL/html/Search/Results.html
Log:
r13008 at hualien: jesse | 2005-04-16 02:27:11 -0400
r12749 at hualien: jesse | 2005-04-12 08:55:47 -0400
* Renamed quick search to simple search
Modified: rt/branches/PLATANO-EXPERIMENTAL/html/Search/Build.html
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL/html/Search/Build.html (original)
+++ rt/branches/PLATANO-EXPERIMENTAL/html/Search/Build.html Sat Apr 16 02:46:56 2005
@@ -127,15 +127,19 @@
# We don't read or write to the session again until the end
$search_hash = $session{'CurrentSearchHash'};
+# Read from user preferences
+my $prefs = $session{'CurrentUser'}->UserObj->Preferences("SearchDisplay") || {};
+
# These variables are what define a search_hash; this is also
# where we give sane defaults.
$Query ||= $search_hash->{'Query'};
-$Format ||= $search_hash->{'Format'};
+$Format ||= $search_hash->{'Format'} || $prefs->{'Format'};
$Description ||= $search_hash->{'Description'};
$SearchId ||= $search_hash->{'SearchId'} || 'new';
-$Order ||= $search_hash->{'Order'} || 'ASC';
-$OrderBy ||= $search_hash->{'OrderBy'} || 'id';
-$RowsPerPage = ( $search_hash->{'RowsPerPage'} || 50 )
+$Order ||= $search_hash->{'Order'} || $prefs->{'Order'} || 'ASC';
+$OrderBy ||= $search_hash->{'OrderBy'} || $prefs->{'OrderBy'} || 'id';
+$RowsPerPage = ( $search_hash->{'RowsPerPage'} || $prefs->{'RowsPerPage'}
+ || 50 )
unless defined($RowsPerPage);
$search ||= $search_hash->{'Object'};
Modified: rt/branches/PLATANO-EXPERIMENTAL/html/Search/Results.html
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL/html/Search/Results.html (original)
+++ rt/branches/PLATANO-EXPERIMENTAL/html/Search/Results.html Sat Apr 16 02:46:56 2005
@@ -85,6 +85,19 @@
<& /Elements/Callback, _CallbackName => 'SearchActions', QueryString => $QueryString&>
</div>
<%INIT>
+# Read from user preferences
+my $prefs = $session{'CurrentUser'}->UserObj->Preferences("SearchDisplay") || {};
+
+# These variables are what define a search_hash; this is also
+# where we give sane defaults.
+$Format ||= $prefs->{'Format'};
+$Order ||= $prefs->{'Order'} || 'ASC';
+$OrderBy ||= $prefs->{'OrderBy'} || 'id';
+$Rows = ( $prefs->{'RowsPerPage'} || 50 )
+ unless defined($Rows);
+
+
+
my ($title, $ticketcount);
$session{'i'}++;
$session{'tickets'} = RT::Tickets->new($session{'CurrentUser'}) ;
@@ -131,8 +144,8 @@
$Query => undef
$Format => undef
$HideResults => 0
-$Rows => 50
+$Rows => undef
$Page => 1
-$OrderBy => 'id'
-$Order => 'ASC'
+$OrderBy => undef
+$Order => undef
</%ARGS>
Added: rt/branches/PLATANO-EXPERIMENTAL/html/Search/Simple.html
==============================================================================
--- (empty file)
+++ rt/branches/PLATANO-EXPERIMENTAL/html/Search/Simple.html Sat Apr 16 02:46:56 2005
@@ -0,0 +1,87 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# <jesse at bestpractical.com>
+%#
+%# (Except where explicitly superseded by other copyright notices)
+%#
+%#
+%# LICENSE:
+%#
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%#
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+%# General Public License for more details.
+%#
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%#
+%#
+%# CONTRIBUTION SUBMISSION POLICY:
+%#
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%#
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%#
+%# END BPS TAGGED BLOCK }}}
+<& /Elements/Header, Title => $title &>
+<& /Ticket/Elements/Tabs,
+ current_tab => "Search/Quick.html?q=".$ARGS{"q"},
+&>
+
+<DIV align="center">
+
+<& /Elements/TitleBoxStart, width=> "40%", titleright => loc("RT [_1]", $RT::VERSION), title => loc('Search') , contentbg=>"#cccccc" &>
+<FORM ACTION="Quick.html">
+<table width="100%" cellpadding="5">
+ <tr>
+ <td width="100%">
+ <input name="q">
+ </td>
+ </tr>
+ <tr>
+ <td align="right">
+ <input type="submit" Value="<&|/l&>Search</&>">
+ </td>
+ </td>
+</table>
+</FORM>
+<&/Elements/TitleBoxEnd&>
+
+<%INIT>
+my $title = loc("Quick Search");
+use RT::Search::Quick;
+
+if ( $ARGS{"q"}) {
+ my $tickets = new RT::Tickets( $session{'CurrentUser'} );
+ my $search = RT::Search::Quick->new(Argument => $ARGS{"q"},
+ TicketsObj => $tickets);
+
+ $m->comp( "Results.html", Query => $search->QueryToSQL());
+ $m->abort();
+}
+</%INIT>
+
+<%ARGS>
+$q => undef
+</%ARGS>
+
More information about the Rt-commit
mailing list