[Rt-commit] r11447 - in rtfm/branches/2.3-EXPERIMENTAL: html/Callbacks/RTFM/Ticket/Create.html

falcone at bestpractical.com falcone at bestpractical.com
Thu Apr 3 17:37:28 EDT 2008


Author: falcone
Date: Thu Apr  3 17:37:26 2008
New Revision: 11447

Modified:
   rtfm/branches/2.3-EXPERIMENTAL/   (props changed)
   rtfm/branches/2.3-EXPERIMENTAL/html/Callbacks/RTFM/Ticket/Create.html/BeforeMessageBox

Log:
 r30914 at ketch:  falcone | 2008-04-03 17:35:54 -0400
 * handle the Create case where we don't have a ticket id
   but we can be passed a Queue object


Modified: rtfm/branches/2.3-EXPERIMENTAL/html/Callbacks/RTFM/Ticket/Create.html/BeforeMessageBox
==============================================================================
--- rtfm/branches/2.3-EXPERIMENTAL/html/Callbacks/RTFM/Ticket/Create.html/BeforeMessageBox	(original)
+++ rtfm/branches/2.3-EXPERIMENTAL/html/Callbacks/RTFM/Ticket/Create.html/BeforeMessageBox	Thu Apr  3 17:37:26 2008
@@ -46,163 +46,4 @@
 %# 
 %# END BPS TAGGED BLOCK }}}
 
-% # convert RTFM-Include-Article => $id to RTFM-Include-Article-$id
-% if ( $ARGS{'RTFM-Include-Article'} ) {
-%    $ARGS{"RTFM-Include-Article-$ARGS{'RTFM-Include-Article'}"}++;
-% }
-
-<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>
-% if ($hotlist->Count) {
-<tr>
-<td>&nbsp;</td>
-<td><select name="RTFM-Include-Article-Named-Hotlist">
-<option value="" selected><&|/l&>Select an article</&></option>
-% while (my $article = $hotlist->Next) {
-<option value="<% $article->Id %>"><%$article->Name|| loc('(no name)')%>: <%$article->Summary%></option>
-% }
-</select>
-</td>
-<td><input type="submit" value="Go" /></td>
-</tr>
-% }
-% my %dedupe_articles;
-% while (my $article = $articles_content->Next) {
-%   $dedupe_articles{$article->Id}++;
-<tr>
-<td>&nbsp;</td>
-<td><%$article->Name|| loc('(no name)')%>: <%$article->Summary%></td>
-<td><input type="submit" name="RTFM-Include-Article-<%$article->Id%>" value="Go" /></td>
-</tr>
-% }
-% while (my $article = $articles_basics->Next) {
-%   next if $dedupe_articles{$article->Id};
-<tr>
-<td>&nbsp;</td>
-<td><%$article->Name || loc('(no name)')%>: <%$article->Summary%></td>
-<td><input type="submit" name="RTFM-Include-Article-<%$article->Id%>" value="Go" /></td>
-</tr>
-% }
-<tr>
-<td>
-
-% if ( @$topics ) {
-<select name="RTFM-Include-Topic">
-<option value="" <% $ARGS{'RTFM-Include-Topic'} ? () : 'selected' %>><&|/l&>Select a topic</&></option>
-% for ( @$topics ) { 
-<option value="<% $_->{id} %>" <% $ARGS{'RTFM-Include-Topic'} == $_->{id} ? 'selected' : () %> ><%'&nbsp;' x $_->{depth} . ($_->{name}|| loc('(no name)')) |n%>
-</option>
-% }
-</select>
-</td>
-<td><input type="submit" value="Go" /></td>
-</tr>
-
-% if ( $ARGS{'RTFM-Include-Topic'} ) {
-<tr>
-<td>
-<select name="RTFM-Include-Article">
-<option value="" <% $ARGS{'RTFM-Include-Article'} ? () : 'selected' %>><&|/l&>Select an article</&></option>
-% while ( my $art = $articles->Next ) {
-<option value="<% $art->id %>" <% $ARGS{'RTFM-Include-Article'} == $art->id ? 'selected' : () %> ><%$art->Name||loc('(no name)')%>: <%$art->Summary%></option>
-% }
-</select>
-</td>
-<td><input type="submit" 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->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" );
-}
-
-my $hotlist = RT::FM::ArticleCollection->new( $session{'CurrentUser'} );
-my $classes = $hotlist->Join(
-    ALIAS1 => 'main',
-    FIELD1 => 'Class',
-    TABLE2 => 'FM_Classes',
-    FIELD2 => 'id',
-);
-$hotlist->Limit( ALIAS => $classes, FIELD => 'HotList', VALUE => 1 );
-
-# By default, order by name
-$hotlist->OrderByCols( {
-            ALIAS => 'main',
-            FIELD => 'Name',
-            ORDER => 'ASC'
-    },
-        {   ALIAS => 'main',
-            FIELD => 'SortOrder',
-            ORDER => 'ASC'
-        },
-
-    );
-
-my ( $articles, $topics );
-$articles = RT::FM::ArticleCollection->new( $session{CurrentUser} );
-$topics = [];
-
-my $top_topic = RT::FM::Topic->new( $session{CurrentUser} );
-$top_topic->LoadByCols( Name => 'Queues', Parent => 0 , ObjectType => 'RT::FM::System', ObjectId => 1);
-
-if ( $top_topic->id ) {
-    my $queue_topic = RT::FM::Topic->new( $session{CurrentUser} );
-    $queue_topic->LoadByCols( Name => $ARGS{QueueObj}->Name, Parent =>
-            $top_topic->id );
-    if ( $queue_topic->id ) {
-    
-        # store all topics below $queue_topic to $topics
-        topics( $queue_topic, $topics, 0 );
-        
-        if ( $ARGS{'RTFM-Include-Topic'}  ) {
-            $articles->LimitTopics( $ARGS{'RTFM-Include-Topic'} );
-            $articles->OrderBy( FIELD => 'Name' );
-        }
-    }
-}
-
-
-# recursively get all the topics given a top topic
-sub topics {
-    my $parent = shift;
-    my $out = shift;
-    my $depth = shift;
-    while ( my $topic = $parent->Children->Next ) {
-	push @$out, { id => $topic->id, name => $topic->Name, depth => $depth };
-	topics( $topic, $out, $depth+1 );
-    }
-}
-
-</%init>
-
+<& /RTFM/Elements/BeforeMessageBox, %ARGS &>


More information about the Rt-commit mailing list