[Rt-commit] r9664 - rtfm/branches/2.3-EXPERIMENTAL/html/SelfService/Article

sunnavy at bestpractical.com sunnavy at bestpractical.com
Wed Nov 14 05:02:02 EST 2007


Author: sunnavy
Date: Wed Nov 14 05:01:44 2007
New Revision: 9664

Added:
   rtfm/branches/2.3-EXPERIMENTAL/html/SelfService/Article/
   rtfm/branches/2.3-EXPERIMENTAL/html/SelfService/Article/Display.html
   rtfm/branches/2.3-EXPERIMENTAL/html/SelfService/Article/Search.html
   rtfm/branches/2.3-EXPERIMENTAL/html/SelfService/Article/autohandler   (contents, props changed)

Log:
new article search stuff in selfservice

Added: rtfm/branches/2.3-EXPERIMENTAL/html/SelfService/Article/Display.html
==============================================================================
--- (empty file)
+++ rtfm/branches/2.3-EXPERIMENTAL/html/SelfService/Article/Display.html	Wed Nov 14 05:01:44 2007
@@ -0,0 +1,19 @@
+%# BEGIN LICENSE BLOCK
+%# 
+%#  Copyright (c) 2002-2003 Jesse Vincent <jesse at bestpractical.com>
+%#  
+%#  This program is free software; you can redistribute it and/or modify
+%#  it under the terms of version 2 of the GNU General Public License 
+%#  as published by the Free Software Foundation.
+%# 
+%#  A copy of that license should have arrived with this
+%#  software, but in any event can be snarfed from www.gnu.org.
+%# 
+%#  This program 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.
+%# 
+%# END LICENSE BLOCK
+<& /SelfService/Elements/Header, Title => loc('Display Article ' . $ARGS{id} ) &>
+<& /RTFM/Article/Display.html, id => $ARGS{id}, SelfService => 1 &>

Added: rtfm/branches/2.3-EXPERIMENTAL/html/SelfService/Article/Search.html
==============================================================================
--- (empty file)
+++ rtfm/branches/2.3-EXPERIMENTAL/html/SelfService/Article/Search.html	Wed Nov 14 05:01:44 2007
@@ -0,0 +1,57 @@
+%# BEGIN LICENSE BLOCK
+%# 
+%#  Copyright (c) 2002-2007 Jesse Vincent <jesse at bestpractical.com>
+%#  
+%#  This program is free software; you can redistribute it and/or modify
+%#  it under the terms of version 2 of the GNU General Public License 
+%#  as published by the Free Software Foundation.
+%# 
+%#  A copy of that license should have arrived with this
+%#  software, but in any event can be snarfed from www.gnu.org.
+%# 
+%#  This program 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.
+%# 
+%# END LICENSE BLOCK
+
+<& /SelfService/Elements/Header, Title => loc('Search Articles') &>
+
+<table>
+<tr>
+<td><&|/l&>Search for RTFM articles matching</&></td>
+<td><input size=20 name="RTFM_Content" /></td>
+</tr>
+
+% while (my $article = $articles_basics->Next) {
+<tr>
+<td>&nbsp;</td>
+<td><a href="Display.html?id=<%$article->Id%>"><%$article->Name || loc('(no name)')%>: <%$article->Summary%><a></td>
+</tr>
+% }
+</table>
+<%init>
+use RT::FM::ArticleCollection;
+
+my $articles_content =
+  RT::FM::ArticleCollection->new( $session{'CurrentUser'} );
+my $articles_basics = RT::FM::ArticleCollection->new( $session{'CurrentUser'} );
+if ( $ARGS{'RTFM_Content'} ) {
+    $articles_content->LimitCustomField( VALUE => $ARGS{'RTFM_Content'},
+                                                OPERATOR => 'LIKE' );
+
+    $articles_basics->Limit( SUBCLAUSE       => 'all',
+                             FIELD           => 'Name',
+                             OPERATOR        => 'LIKE',
+                             VALUE           => $ARGS{'RTFM_Content'},
+                             ENTRYAGGREGATOR => "OR" );
+    $articles_basics->Limit( SUBCLAUSE       => 'all',
+                             FIELD           => 'Summary',
+                             OPERATOR        => 'LIKE',
+                             VALUE           => $ARGS{'RTFM_Content'},
+                             ENTRYAGGREGATOR => "OR" );
+}
+
+
+</%init>

Added: rtfm/branches/2.3-EXPERIMENTAL/html/SelfService/Article/autohandler
==============================================================================
--- (empty file)
+++ rtfm/branches/2.3-EXPERIMENTAL/html/SelfService/Article/autohandler	Wed Nov 14 05:01:44 2007
@@ -0,0 +1,58 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%# 
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2007 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., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
+%# 
+%# 
+%# 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 }}}
+<%INIT>
+
+if ( $session{'CurrentUser'}->HasRight( Right => 'ShowArticle',
+                   Object => $RT::FM::System )) {
+    $m->comp( { base_comp => $m->request_comp }, $m->fetch_next, %ARGS);    
+}
+else {
+    RT::Interface::Web::Redirect($RT::WebURL."SelfService/");
+}
+
+</%INIT>


More information about the Rt-commit mailing list