[Rt-commit] r2600 - in rtfm/branches/2.1-TESTING/html/RTFM/Article: . Elements

tla at bestpractical.com tla at bestpractical.com
Sun Apr 10 18:41:21 EDT 2005


Author: tla
Date: Sun Apr 10 18:41:20 2005
New Revision: 2600

Added:
   rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/SelectSavedSearches
   rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/SelectSearchPrivacy   (contents, props changed)
   rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/ShowSavedSearches
Modified:
   rtfm/branches/2.1-TESTING/html/RTFM/Article/Search.html
Log:
Saved searches interface bits.



Added: rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/SelectSavedSearches
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/SelectSavedSearches	Sun Apr 10 18:41:20 2005
@@ -0,0 +1,70 @@
+%# 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 }}}
+<select name="<%$Name%>">
+% foreach my $object (@objects) {
+%     my @searches = $object->Attributes->Named('ArticleSavedSearch');
+%     next unless @searches;
+%     if ($object->Id == $session{'CurrentUser'}->UserObj->Id) {
+<option value=""><&|/l&>My saved searches</&></option>
+%     } else {
+<option value=""><&|/l, $object->Name&>[_1]'s saved searches</&></option>
+%     }
+%     foreach my $search (@searches) { 
+<option value="<%ref($object)%>-<%$object->id%>-ArticleSavedSearch-<%$search->Id%>"> -<%$search->Description||loc('Unnamed search')%></option>
+%     }
+% }
+</select>
+
+<%init>
+my $groups = $session{'CurrentUser'}->UserObj->OwnGroups;
+my @objects;
+push(@objects, $session{'CurrentUser'}->UserObj);
+push(@objects, @{$groups->ItemsArrayRef});
+</%init>
+
+<%args>
+$Name => undef
+</%args>

Added: rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/SelectSearchPrivacy
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/SelectSearchPrivacy	Sun Apr 10 18:41:20 2005
@@ -0,0 +1,59 @@
+%# 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 }}}
+<select name="<%$Name%>">
+<option value="User-<% $user->Id %>">My searches</option>
+% while (my $group = $groups->Next) {
+<option value="Group-<% $group->Id %>"><% $group->Name %>'s searches</option>
+% }
+</select>
+<%INIT>
+my $user = $session{'CurrentUser'}->UserObj;
+my $groups = $session{'CurrentUser'}->UserObj->OwnGroups;
+
+</%INIT>
+<%ARGS>
+$Name => 'GroupField'
+</%ARGS>
\ No newline at end of file

Added: rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/ShowSavedSearches
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/ShowSavedSearches	Sun Apr 10 18:41:20 2005
@@ -0,0 +1,76 @@
+%# 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/TitleBoxStart, title => loc('Saved searches') &>
+%# Hide all the save functionality if the user shouldn't see it.
+% if ($session{'CurrentUser'}->HasRight( Right => 'CreateSavedSearch',
+%                                       Object=> $RT::System )) {
+<&|/l&>Save the current search:</&><br>
+<&|/l&>Name:</&> <input name="NewSearchName">
+<&|/l&>Privacy:</&> <& SelectSearchPrivacy &><br>
+<input value="<%loc('Save')%>" name="Save" type="submit">
+<hr>
+% } # if HasRight 'CreateSavedSearch'
+
+<&|/l&>Load saved search:</&><br>
+<& SelectSavedSearches, Name => 'LoadSavedSearch' &>
+<input value="<%loc('Load')%>" type="submit">
+<& /Elements/TitleBoxEnd &>
+
+<%INIT>
+unless ($session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch',
+                                          Object=> $RT::System )) {
+    return;
+}
+
+</%INIT>
+
+<%ARGS>
+$SearchId => undef
+$CurrentSearch => undef
+$Description => undef
+$HideResults => 0
+$Dirty => 0
+</%ARGS>

Modified: rtfm/branches/2.1-TESTING/html/RTFM/Article/Search.html
==============================================================================
--- rtfm/branches/2.1-TESTING/html/RTFM/Article/Search.html	(original)
+++ rtfm/branches/2.1-TESTING/html/RTFM/Article/Search.html	Sun Apr 10 18:41:20 2005
@@ -19,6 +19,8 @@
 <& /RTFM/Article/Elements/Tabs, current_tab => "RTFM/Article/Search.html", Title => loc("Search for articles") &>
 <& Elements/ShowSearchResults, articles => $articles &>
 
+<& Elements/ShowSavedSearches &>
+
 <& Elements/ShowSearchCriteria, dates => \%dates, RefersTo => $RefersTo, customfields => $customfields,  ReferredToBy => $ReferredToBy, %ARGS &>
 <%init>
 my @results;
@@ -41,8 +43,6 @@
 else {
     $customfields->LimitToGlobalOrObjectId();
 }
-$customfields->GroupByCols({FIELD => 'id'});
-
 
 my %dates;
 foreach my $date qw(Created< Created> LastUpdated< LastUpdated>) {


More information about the Rt-commit mailing list