[Rt-commit] r11446 - in rtfm/branches/2.3-EXPERIMENTAL: .
falcone at bestpractical.com
falcone at bestpractical.com
Thu Apr 3 17:37:11 EDT 2008
Author: falcone
Date: Thu Apr 3 17:37:08 2008
New Revision: 11446
Modified:
rtfm/branches/2.3-EXPERIMENTAL/ (props changed)
rtfm/branches/2.3-EXPERIMENTAL/html/RTFM/Elements/BeforeMessageBox
Log:
r30913 at ketch: falcone | 2008-04-03 17:27:17 -0400
* move perl code into INIT
* only build the RefersTo block if this is an existing ticket
Modified: rtfm/branches/2.3-EXPERIMENTAL/html/RTFM/Elements/BeforeMessageBox
==============================================================================
--- rtfm/branches/2.3-EXPERIMENTAL/html/RTFM/Elements/BeforeMessageBox (original)
+++ rtfm/branches/2.3-EXPERIMENTAL/html/RTFM/Elements/BeforeMessageBox Thu Apr 3 17:37:08 2008
@@ -46,27 +46,10 @@
%#
%# END BPS TAGGED BLOCK }}}
-% my %uri;
-% $uri{$_}++ for split ' ', ($ARGS{$ARGS{'id'}.'-RefersTo'} || '');
-
-
-% # convert RTFM-Include-Article => $id to RTFM-Include-Article-$id
-% if ( $ARGS{'RTFM-Include-Article'} ) {
-% $ARGS{"RTFM-Include-Article-$ARGS{'RTFM-Include-Article'}"}++;
-% }
-
-% 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) {
-% $uri{$art->URI}++;
-% }
-
+% if ( $ARGS{id} && $ARGS{id} ne 'new' ) {
+<input type="hidden" name="<%$ARGS{'id'}%>-RefersTo" value="<% join(' ',grep {$_} sort keys %uri) %>" />
% }
-%}
-<input type="hidden" name="<%$ARGS{'id'}%>-RefersTo" value="<% join(' ',grep {$_} sort keys %uri) %>" />
<table>
<tr>
<td><&|/l&>Search for RTFM articles matching</&></td>
@@ -142,6 +125,27 @@
</table>
<%init>
+# convert RTFM-Include-Article => $id to RTFM-Include-Article-$id
+if ( $ARGS{'RTFM-Include-Article'} ) {
+ $ARGS{"RTFM-Include-Article-$ARGS{'RTFM-Include-Article'}"}++;
+}
+
+my %uri;
+if ( $ARGS{id} && $ARGS{id} ne 'new' ) {
+ $uri{$_}++ for split ' ', ($ARGS{$ARGS{'id'}.'-RefersTo'} || '');
+
+ 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) {
+ $uri{$art->URI}++;
+ }
+
+ }
+ }
+}
+
use RT::FM::ArticleCollection;
my $articles_content =
More information about the Rt-commit
mailing list