diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-04-24 11:35:56 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-04-24 11:35:56 -0700 |
commit | 6587f6ba7d047ddc1686c080090afe7d53365bd4 (patch) | |
tree | ec77342668e8865aca669c9b4736e84e3077b523 /rt/share/html/Articles/Elements | |
parent | 47153aae5c2fc00316654e7277fccd45f72ff611 (diff) |
first pass RT4 merge, RT#13852
Diffstat (limited to 'rt/share/html/Articles/Elements')
-rw-r--r-- | rt/share/html/Articles/Elements/BeforeMessageBox | 239 | ||||
-rw-r--r-- | rt/share/html/Articles/Elements/CheckSkipCreate | 76 | ||||
-rw-r--r-- | rt/share/html/Articles/Elements/CreateArticle | 59 | ||||
-rw-r--r-- | rt/share/html/Articles/Elements/GotoArticle | 73 | ||||
-rw-r--r-- | rt/share/html/Articles/Elements/IncludeArticle | 99 | ||||
-rw-r--r-- | rt/share/html/Articles/Elements/NewestArticles | 80 | ||||
-rw-r--r-- | rt/share/html/Articles/Elements/QuickSearch | 59 | ||||
-rw-r--r-- | rt/share/html/Articles/Elements/SelectClass | 95 | ||||
-rw-r--r-- | rt/share/html/Articles/Elements/ShowTopic | 64 | ||||
-rw-r--r-- | rt/share/html/Articles/Elements/UpdatedArticles | 81 |
10 files changed, 925 insertions, 0 deletions
diff --git a/rt/share/html/Articles/Elements/BeforeMessageBox b/rt/share/html/Articles/Elements/BeforeMessageBox new file mode 100644 index 000000000..8ed04513f --- /dev/null +++ b/rt/share/html/Articles/Elements/BeforeMessageBox @@ -0,0 +1,239 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@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/licenses/old-licenses/gpl-2.0.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 }}} +% if ( $ARGS{id} && $ARGS{id} ne 'new' ) { +<input type="hidden" name="<%$ARGS{'id'}%>-RefersTo" value="<% join(' ',grep {$_} sort keys %uri) %>" /> +% } + +<table class="articles-select-article"> +% unless (RT->Config->Get('HideArticleSearchOnReplyCreate')) { +<tr> +<td><&|/l&>Search for Articles matching</&></td> +<td><input size=20 name="<% $name_prefix %>Articles_Content" /></td> +</tr> +<tr> +<td><&|/l&>Include Article:</&></td> +<td><input size=20 name="<% $name_prefix %>Articles-Include-Article-Named" /></td> +<td><input type="submit" name="Go" value="Go" /></td> +</tr> +% } +% if ($hotlist->Count) { +<tr> +<td><&|/l&>Select an Article to include</&></td> +<td><select name="<% $name_prefix %>Articles-Include-Article-Named-Hotlist" onchange="this.form.submit()"> +<option value="" selected><&|/l&>-</&></option> +% while (my $article = $hotlist->Next) { +<option value="<% $article->Id %>"><%$article->Name|| loc('(no name)')%>: <%$article->Summary || ''%></option> +% } +</select> +</td> +<td><input type="submit" name="Go" value="Go" /></td> +</tr> +% } +% my %dedupe_articles; +% while (my $article = $articles_content->Next) { +% $dedupe_articles{$article->Id}++; +<tr> +<td> </td> +<td><%$article->Name|| loc('(no name)')%>: <%$article->Summary%></td> +<td><input type="submit" name="<% $name_prefix %>Articles-Include-Article-<%$article->Id%>" value="Go" /></td> +</tr> +% } +% while (my $article = $articles_basics->Next) { +% next if $dedupe_articles{$article->Id}; +<tr> +<td> </td> +<td><%$article->Name || loc('(no name)')%>: <%$article->Summary || ''%></td> +<td><input type="submit" name="<% $name_prefix %>Articles-Include-Article-<%$article->Id%>" value="Go" /></td> +</tr> +% } +% if ( @$topics ) { +<tr> +<td> +<&|/l, $QueueObj->Name &>Choose from Topics for [_1]</&> +</td> +<td> +<select name="<% $name_prefix %>Articles-Include-Topic" onchange="this.form.submit()"> +<option value="" selected>-</option> +% for ( @$topics ) { +<option value="<% $_->{id} %>"><%' ' x $_->{depth} . ($_->{name}|| loc('(no name)')) |n%> +</option> +% } +</select> +</td> +<td><input type="submit" name="Go" value="Go" /></td> +</tr> + +% if ( $ARGS{$name_prefix .'Articles-Include-Topic'} ) { +<tr> +<td> +<&|/l, $included_topic->Name &>Select an Article from [_1]</&> +</td> +<td> +<select name="<% $name_prefix %>Articles-Include-Article" onchange="this.form.submit()"> +<option value="" selected>-</option> +% while ( my $art = $topic_articles->Next ) { +<option value="<% $art->id %>"><%$art->Name||loc('(no name)')%>: <%$art->Summary%></option> +% } +</select> +</td> +<td><input type="submit" value="Go" name="Go" /></td> +</tr> + +% } +% } + + +</table> + +<%init> +my $QueueObj = $ARGS{QueueObj}; +if ( $ARGS{id} && $ARGS{id} ne 'new' && !$QueueObj ) { + my $ticket = RT::Ticket->new( $session{CurrentUser} ); + $ticket->Load( $ARGS{id} ); + $QueueObj = $ticket->QueueObj; +} + +my $skip = 0; +$m->callback(CallbackName => "Init", skip => \$skip, Queue => $QueueObj); +return if $skip; + +my $name_prefix = ''; +if ( $ARGS{'MessageBoxName'} ) { + $name_prefix = $ARGS{'MessageBoxName'} .'-'; +} + +# convert Articles-Include-Article => $id to Articles-Include-Article-$id +if ( my $tmp = $ARGS{$name_prefix ."Articles-Include-Article"} ) { + $ARGS{$name_prefix ."Articles-Include-Article-$tmp"}++; +} + +my %uri; +if ( $ARGS{id} && $ARGS{id} ne 'new' ) { + $uri{$_}++ for split ' ', ($ARGS{$ARGS{'id'}.'-RefersTo'} || ''); + + foreach my $arg (keys %ARGS) { + next if $name_prefix && substr($arg, 0, length($name_prefix)) ne $name_prefix; + + my $article = RT::Article->new($session{'CurrentUser'}); + $article->LoadByInclude( + Field => substr($arg, length($name_prefix)), + Value => $ARGS{$arg}, + ); + if ($article->Id) { + $uri{$article->URI}++; + } + } +} + +use RT::Articles; + +my $articles_content = + RT::Articles->new( $session{'CurrentUser'} ); +my $articles_basics = RT::Articles->new( $session{'CurrentUser'} ); +if ( my $tmp = $ARGS{ $name_prefix ."Articles_Content" } ) { + $articles_content->LimitCustomField( + VALUE => $tmp, OPERATOR => 'LIKE' + ); + $articles_content->LimitAppliedClasses( Queue => $QueueObj ); + + $articles_basics->Limit( SUBCLAUSE => 'all', + FIELD => 'Name', + OPERATOR => 'LIKE', + VALUE => $tmp, + ENTRYAGGREGATOR => "OR" ); + $articles_basics->Limit( SUBCLAUSE => 'all', + FIELD => 'Summary', + OPERATOR => 'LIKE', + VALUE => $tmp, + ENTRYAGGREGATOR => "OR" ); + $articles_basics->LimitAppliedClasses( Queue => $QueueObj ); +} + +my $hotlist = RT::Articles->new( $session{'CurrentUser'} ); +$hotlist->LimitHotlistClasses; +$hotlist->LimitAppliedClasses( Queue => $QueueObj ); + +my ( $topic_articles, $topics, $included_topic ); +$topic_articles = RT::Articles->new( $session{CurrentUser} ); +$topics = []; + +my $top_topic = RT::Topic->new( $session{CurrentUser} ); +$top_topic->LoadByCols( Name => 'Queues', Parent => 0 , ObjectType => 'RT::System', ObjectId => 1); + +if ( $top_topic->id ) { + my $queue_topic = RT::Topic->new( $session{CurrentUser} ); + $queue_topic->LoadByCols( Name => $QueueObj->Name, Parent => $top_topic->id ); + if ( $queue_topic->id ) { + + # store all topics below $queue_topic to $topics + topics( $queue_topic, $topics, 0 ); + + if ( my $tmp = $ARGS{ $name_prefix .'Articles-Include-Topic'} ) { + $included_topic = RT::Topic->new( $session{CurrentUser} ); + $included_topic->Load( $tmp ); + $topic_articles->LimitTopics( $tmp ); + $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> + + diff --git a/rt/share/html/Articles/Elements/CheckSkipCreate b/rt/share/html/Articles/Elements/CheckSkipCreate new file mode 100644 index 000000000..6524f2615 --- /dev/null +++ b/rt/share/html/Articles/Elements/CheckSkipCreate @@ -0,0 +1,76 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@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/licenses/old-licenses/gpl-2.0.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> + +return if $checks_failure; # we're already skipping Create +return unless RT->Config->Get('ArticleOnTicketCreate'); + + +my $article = RT::Article->new($session{'CurrentUser'}); +foreach my $arg ( keys %$ARGSRef) { + + if ( $ARGSRef->{Articles_Content} || # search for an article + $ARGSRef->{'Articles-Include-Topic'} || # using Queue Topics + ( $article->LoadByInclude( Field => $arg, Value => $ARGSRef->{$arg} ) && + $article->id ) ) { # including an article + + $$skip_create = 1; + last; + } +} +return; + +</%INIT> + +<%ARGS> +$ARGSRef => undef +$skip_create => undef +$checks_failure => undef +$results => undef +</%ARGS> + diff --git a/rt/share/html/Articles/Elements/CreateArticle b/rt/share/html/Articles/Elements/CreateArticle new file mode 100644 index 000000000..effd50315 --- /dev/null +++ b/rt/share/html/Articles/Elements/CreateArticle @@ -0,0 +1,59 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@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/licenses/old-licenses/gpl-2.0.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 }}} +<& /Elements/TitleBoxStart, title => loc('Create an article') &> +<ul> +% while (my $Class = $Classes->Next) { +<li><a href="Article/Edit.html?Class=<%$Class->Id%>"><%$Class->Name%></a></li> +% } +</ul> +<& /Elements/TitleBoxEnd &> +<%init> +my $Classes = RT::Classes->new($session{'CurrentUser'}); +$Classes->LimitToEnabled; +</%init> + diff --git a/rt/share/html/Articles/Elements/GotoArticle b/rt/share/html/Articles/Elements/GotoArticle new file mode 100644 index 000000000..c8e5e5847 --- /dev/null +++ b/rt/share/html/Articles/Elements/GotoArticle @@ -0,0 +1,73 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@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/licenses/old-licenses/gpl-2.0.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 }}} +<form ACTION="<% RT->Config->Get('WebPath') %>/Articles/Article/Search.html"> +<input type="hidden" name="HideOptions" value="1" /> +<input size="12" name="q" accesskey="0" /> +% if ($class or $topic) { +<input type="hidden" name="ExpandTopics" value="1" /> +<select name="Topics"> +% if ($topic) { +<option value="<% $topic %>">in this topic</option> +% } +% if ($class) { +% my $Topics = RT::Topics->new($session{'CurrentUser'}); +% $Topics->Limit(FIELD => 'ObjectType', VALUE => 'RT::Class'); +% $Topics->Limit(FIELD => 'ObjectId', VALUE => $class); +% my @topics; +% push @topics, $_->Id while $_ = $Topics->Next; +<option value="<% join(' ', @topics) %>">in this hierarchy</option> +% } +<option value="">in all topics</option> +</select> +% } +<input type="submit" value="<&|/l&>Search Articles</&>" /> +</form> +<%args> +$topic => "" +$class => "" +</%args> diff --git a/rt/share/html/Articles/Elements/IncludeArticle b/rt/share/html/Articles/Elements/IncludeArticle new file mode 100644 index 000000000..f19815f58 --- /dev/null +++ b/rt/share/html/Articles/Elements/IncludeArticle @@ -0,0 +1,99 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@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/licenses/old-licenses/gpl-2.0.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> + +my $parent_args = $m->caller_args(-1); + +my $name_prefix = ''; +$name_prefix = $ARGS{'Name'} .'-' + if $ARGS{'Name'} + && grep rindex($_, "$ARGS{'Name'}-Articles-", 0) == 0, + keys %$parent_args; + +foreach my $arg ( keys %$parent_args ) { + next if $name_prefix && substr($arg, 0, length($name_prefix)) ne $name_prefix; + + my $Ticket = $ARGS{Ticket}; + if ( !$Ticket and $parent_args->{id} and $parent_args->{id} ne 'new' ) { + $Ticket = RT::Ticket->new($session{'CurrentUser'}); + $Ticket->Load($parent_args->{id}); + unless ( $Ticket->id ) { + $RT::Logger->error("Couldn't load ticket ". $parent_args->{id} ) + } + } + + my $Queue = RT::Queue->new($session{CurrentUser}); + if ($Ticket && $Ticket->Id) { + $Queue = $Ticket->QueueObj; + } + + my $article = RT::Article->new($session{'CurrentUser'}); + $article->LoadByInclude( + Field => substr($arg, length($name_prefix)), + Value => $parent_args->{$arg}, + Queue => $Queue->Id, + ); + next unless $article && $article->id; + + my $formatted_article = $m->scomp('/Articles/Article/Elements/Preformatted', + Article => $article, Ticket => $Ticket + ); + + $m->callback( Article => $article, Ticket => $Ticket, formatted_article => \$formatted_article ); + + if (RT->Config->Get('MessageBoxRichText', $session{'CurrentUser'})) { + $formatted_article =~ s/>/>/g; + $formatted_article =~ s/</</g; + $formatted_article =~ s/&/&/g; + $formatted_article =~ s/\n/\n<br \/>/g; + } + $m->print($formatted_article); + +} +return; +</%INIT> diff --git a/rt/share/html/Articles/Elements/NewestArticles b/rt/share/html/Articles/Elements/NewestArticles new file mode 100644 index 000000000..444b2d89d --- /dev/null +++ b/rt/share/html/Articles/Elements/NewestArticles @@ -0,0 +1,80 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@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/licenses/old-licenses/gpl-2.0.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 }}} +<& /Elements/TitleBoxStart, title => loc("[_1] newest articles", $rows), bodyclass=> '' &> +<table border="0" cellspacing="0" cellpadding="1" width="100%"> +<tr> +<th align="right"><&|/l&>#</&></th> +<th align="left"><&|/l&>Name</&></th> +<th align="left" width="20%"><&|/l&>Created by</&></th> +<th align="left"> </th> +</tr> +% while (my $Article = $MyArticles->Next) { +% $i++; +<tr class="<% $i%2 ? 'oddline' : 'evenline'%>"> +<td align="right"><%$Article->Id%></td> +<td><a href="<% RT->Config->Get('WebPath') %>/Articles/Article/Display.html?id=<%$Article->Id%>"><%$Article->Name || loc('(no name)')%></a></td> +<td><%$Article->CreatorObj->Name%></td> +<td align="right">[<a href="<% RT->Config->Get('WebPath') %>/Articles/Article/Edit.html?id=<%$Article->Id%>"><&|/l&>Update</&></a>]</td> +</tr> +<tr class="<% $i%2 ? 'oddline' : 'evenline'%>"> +<td> </td> +<td colspan="3"><small><%$Article->Summary || loc('(no Summary)')%></small></td> +</tr> +% } +</table> +<& /Elements/TitleBoxEnd &> +<%INIT> +my $rows = 10; +my $i; +my $MyArticles; +$MyArticles = RT::Articles->new($session{'CurrentUser'}); +$MyArticles->UnLimit; +$MyArticles->RowsPerPage($rows); +$MyArticles->OrderBy(FIELD => 'LastUpdated', ORDER => 'DESC'); + +</%INIT> diff --git a/rt/share/html/Articles/Elements/QuickSearch b/rt/share/html/Articles/Elements/QuickSearch new file mode 100644 index 000000000..f0c0d1c89 --- /dev/null +++ b/rt/share/html/Articles/Elements/QuickSearch @@ -0,0 +1,59 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@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/licenses/old-licenses/gpl-2.0.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 }}} +<& /Elements/TitleBoxStart, title => loc('Quick search') &> +<ul> +% while (my $class = $classes->Next) { +<li><a href="<%RT->Config->Get('WebPath')%>/Articles/Article/Search.html?Class=<%$class->Name%>&Parent=0&HideOptions=1"><%$class->Name%></a></li> +% } +</ul> +<& /Elements/TitleBoxEnd &> +<%init> +my $classes = RT::Classes->new($session{'CurrentUser'}); +$classes->LimitToEnabled; +</%init> + diff --git a/rt/share/html/Articles/Elements/SelectClass b/rt/share/html/Articles/Elements/SelectClass new file mode 100644 index 000000000..0ce90609e --- /dev/null +++ b/rt/share/html/Articles/Elements/SelectClass @@ -0,0 +1,95 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@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/licenses/old-licenses/gpl-2.0.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 }}} +% if ($Lite) { +<input name="<%$Name%>" size="25" default="<%$d->Name%>" /> +% } else { +<select NAME ="<%$Name%>" +% if ($Multiple) { +MULTIPLE +% } +% if ($Size) { +SIZE=<%$Size%> +% } +> +% if ($ShowNullOption) { +<option value="">-</option> +% } +% while (my $Class=$Classes->Next) { +% next unless ($Class->Name); # if they can't see it, don't list it +% if ($ShowAllClasses || $Class->CurrentUserHasRight('CreateArticle')) { +<option VALUE="<%$Class->Id%>" <%(grep { $_ && ( ( /^\d+$/ && $Class->Id == $_ ) || $Class->Name eq $_ )} @Default) ? 'SELECTED' : '' %>><%$Class->Name%> +% if (($Verbose) and ($Class->Description) ){ +(<%$Class->Description%>) +% } +</option> +% } +% } +</select> +% } +<%ARGS> +$Multiple => undef +$Size => undef +$ShowNullOption => 1 +$ShowAllClasses => 1 +$Name => undef +$Verbose => undef +$Default => undef +$Lite => 0 +</%ARGS> + +<%INIT> + +my @Default = ref($Default) eq 'ARRAY' ? @$Default : ( $Default); + +my $Classes= RT::Classes->new($session{'CurrentUser'}); +$Classes->LimitToEnabled(); + +my $d = RT::Class->new($session{'CurrentUser'}); +$d->Load($Default[0]); + +</%INIT> diff --git a/rt/share/html/Articles/Elements/ShowTopic b/rt/share/html/Articles/Elements/ShowTopic new file mode 100644 index 000000000..da7c5f213 --- /dev/null +++ b/rt/share/html/Articles/Elements/ShowTopic @@ -0,0 +1,64 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@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/licenses/old-licenses/gpl-2.0.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 }}} +% for (@path) { +%# this isn't always a class, it can be the system object +% my $class_id = ($_->ObjectType eq 'RT::Class' ? $_->ObjectId : 0 ); +<% $_->ParentObj->Id ? " > " : "" %><a href="<% RT->Config->Get('WebPath') %>/Articles/Topics.html?class=<% $class_id %>&id=<% $_->Id %>"><% $_->Name || loc("(no name)") %></a> +% } + +<%args> +$topic +</%args> + +<%init> +my @path; +while ($topic->Id) { + unshift @path, $topic; + $topic = $topic->ParentObj; +} +</%init> diff --git a/rt/share/html/Articles/Elements/UpdatedArticles b/rt/share/html/Articles/Elements/UpdatedArticles new file mode 100644 index 000000000..f2c5226be --- /dev/null +++ b/rt/share/html/Articles/Elements/UpdatedArticles @@ -0,0 +1,81 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@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/licenses/old-licenses/gpl-2.0.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 }}} +<& /Elements/TitleBoxStart, title => loc("[_1] most recently updated articles", $rows), bodyclass=> '' &> +<table border="0" cellspacing="0" cellpadding="1" width="100%"> +<tr> +<th align="right"><&|/l&>#</&></th> +<th align="left"><&|/l&>Name</&></th> +<th align="left" width="20%"><&|/l&>Created by</&></th> +<th> </th> +</tr> + +% while (my $Article = $MyArticles->Next) { +% $i++; +<tr class="<% $i%2 ? 'oddline' : 'evenline'%>"> +<td align="right"><%$Article->Id%></td> +<td><a href="<% RT->Config->Get('WebPath') %>/Articles/Article/Display.html?id=<%$Article->Id%>"><%$Article->Name || loc('(no name)')%></a></td> +<td><%$Article->CreatorObj->Name%></td> +<td align="right">[<a href="<% RT->Config->Get('WebPath') %>/Articles/Article/Edit.html?id=<%$Article->Id%>"><&|/l&>Update</&></a>]</td> +</tr> +<tr class="<% $i%2 ? 'oddline' : 'evenline'%>"> +<td> </td> +<td colspan="3"><small><%$Article->Summary || loc('(no Summary)')%></small></td> +</tr> +% } +</table> +<& /Elements/TitleBoxEnd &> +<%INIT> +my $rows = 10; +my $i; +my $MyArticles; +$MyArticles = RT::Articles->new($session{'CurrentUser'}); +$MyArticles->RowsPerPage($rows); +$MyArticles->Limit(FIELD => 'Created', OPERATOR => '!=', VALUE => 'LastUpdated', QUOTEVALUE => 0 ); +$MyArticles->OrderBy(FIELD => 'Created', ORDER => 'DESC'); + +</%INIT> |