File: BeforeMessageBox

package info (click to toggle)
rtfm 2.0.3-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 812 kB
  • ctags: 220
  • sloc: perl: 3,426; sh: 153; makefile: 144
file content (64 lines) | stat: -rw-r--r-- 2,691 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
%# BEGIN LICENSE BLOCK
%# 
%#  Copyright (c) 2002-2003 Jesse Vincent <jesse@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

% foreach my $arg (keys %ARGS) {
% if ($arg =~ /^RTFM-Include-Article-(\d+)$/) {
% my $art = RT::FM::Article->new($session{'CurrentUser'});
% $art->Load($1);
% if ($art->Id) { 
<input type="hidden" name="<%$ARGS{'id'}%>-RefersTo" value="<%$art->URI%>">
% }

% }
%}
<table>
<tr><td><&|/l&>Search for RTFM articles matching</&></td>
<td><input size=20 name="RTFM_Content"></td>
</tr>
<tr>
<td><&|/l&>Include RTFM article:</&></td><td><input size=20 name="RTFM-Include-Article-Named"></td><td><input type=submit value="Go"></td>
</tr>
% while (my $article = $articles_content->Next) {
<tr><td>&nbsp;</td><td><%$article->Name|| loc('(unnamed)')%>: <%$article->Summary%></td><td><input type=submit name="RTFM-Include-Article-<%$article->Id%>" value="Go"></td></tr>
%}
% while (my $article = $articles_basics->Next) {
<tr><td>&nbsp;</td><td><%$article->Name || loc('(unnamed)')%>: <%$article->Summary%></td><td><input type=submit name="RTFM-Include-Article-<%$article->Id%>" value="Go"></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->LimitToCustomFieldValue( 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>