From 6587f6ba7d047ddc1686c080090afe7d53365bd4 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 24 Apr 2012 11:35:56 -0700 Subject: first pass RT4 merge, RT#13852 --- rt/share/html/Articles/Elements/BeforeMessageBox | 239 +++++++++++++++++++++++ rt/share/html/Articles/Elements/CheckSkipCreate | 76 +++++++ rt/share/html/Articles/Elements/CreateArticle | 59 ++++++ rt/share/html/Articles/Elements/GotoArticle | 73 +++++++ rt/share/html/Articles/Elements/IncludeArticle | 99 ++++++++++ rt/share/html/Articles/Elements/NewestArticles | 80 ++++++++ rt/share/html/Articles/Elements/QuickSearch | 59 ++++++ rt/share/html/Articles/Elements/SelectClass | 95 +++++++++ rt/share/html/Articles/Elements/ShowTopic | 64 ++++++ rt/share/html/Articles/Elements/UpdatedArticles | 81 ++++++++ 10 files changed, 925 insertions(+) create mode 100644 rt/share/html/Articles/Elements/BeforeMessageBox create mode 100644 rt/share/html/Articles/Elements/CheckSkipCreate create mode 100644 rt/share/html/Articles/Elements/CreateArticle create mode 100644 rt/share/html/Articles/Elements/GotoArticle create mode 100644 rt/share/html/Articles/Elements/IncludeArticle create mode 100644 rt/share/html/Articles/Elements/NewestArticles create mode 100644 rt/share/html/Articles/Elements/QuickSearch create mode 100644 rt/share/html/Articles/Elements/SelectClass create mode 100644 rt/share/html/Articles/Elements/ShowTopic create mode 100644 rt/share/html/Articles/Elements/UpdatedArticles (limited to 'rt/share/html/Articles/Elements') 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 +%# +%# +%# (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' ) { + +% } + + +% unless (RT->Config->Get('HideArticleSearchOnReplyCreate')) { + + + + + + + + + +% } +% if ($hotlist->Count) { + + + + + +% } +% my %dedupe_articles; +% while (my $article = $articles_content->Next) { +% $dedupe_articles{$article->Id}++; + + + + + +% } +% while (my $article = $articles_basics->Next) { +% next if $dedupe_articles{$article->Id}; + + + + + +% } +% if ( @$topics ) { + + + + + + +% if ( $ARGS{$name_prefix .'Articles-Include-Topic'} ) { + + + + + + +% } +% } + + +
<&|/l&>Search for Articles matching
<&|/l&>Include Article:
<&|/l&>Select an Article to include +
 <%$article->Name|| loc('(no name)')%>: <%$article->Summary%>
 <%$article->Name || loc('(no name)')%>: <%$article->Summary || ''%>
+<&|/l, $QueueObj->Name &>Choose from Topics for [_1] + + +
+<&|/l, $included_topic->Name &>Select an Article from [_1] + + +
+ +<%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 ); + } +} + + + + 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 +%# +%# +%# (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; + + + +<%ARGS> +$ARGSRef => undef +$skip_create => undef +$checks_failure => undef +$results => undef + + 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 +%# +%# +%# (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') &> + +<& /Elements/TitleBoxEnd &> +<%init> +my $Classes = RT::Classes->new($session{'CurrentUser'}); +$Classes->LimitToEnabled; + + 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 +%# +%# +%# (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 ($class or $topic) { + + +% } +  +
+<%args> +$topic => "" +$class => "" + 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 +%# +%# +%# (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; + } + $m->print($formatted_article); + +} +return; + 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 +%# +%# +%# (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=> '' &> + + + + + + + +% while (my $Article = $MyArticles->Next) { +% $i++; + + + + + + + + + + +% } +
<&|/l&>#<&|/l&>Name<&|/l&>Created by 
<%$Article->Id%><%$Article->Name || loc('(no name)')%><%$Article->CreatorObj->Name%>[<&|/l&>Update]
 <%$Article->Summary || loc('(no Summary)')%>
+<& /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'); + + 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 +%# +%# +%# (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') &> + +<& /Elements/TitleBoxEnd &> +<%init> +my $classes = RT::Classes->new($session{'CurrentUser'}); +$classes->LimitToEnabled; + + 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 +%# +%# +%# (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) { + +% } else { + +% } +<%ARGS> +$Multiple => undef +$Size => undef +$ShowNullOption => 1 +$ShowAllClasses => 1 +$Name => undef +$Verbose => undef +$Default => undef +$Lite => 0 + + +<%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]); + + 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 +%# +%# +%# (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 ? " > " : "" %><% $_->Name || loc("(no name)") %> +% } + +<%args> +$topic + + +<%init> +my @path; +while ($topic->Id) { + unshift @path, $topic; + $topic = $topic->ParentObj; +} + 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 +%# +%# +%# (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=> '' &> + + + + + + + + +% while (my $Article = $MyArticles->Next) { +% $i++; + + + + + + + + + + +% } +
<&|/l&>#<&|/l&>Name<&|/l&>Created by 
<%$Article->Id%><%$Article->Name || loc('(no name)')%><%$Article->CreatorObj->Name%>[<&|/l&>Update]
 <%$Article->Summary || loc('(no Summary)')%>
+<& /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'); + + -- cgit v1.2.1 From 21a232b78413718d8a68867ba7eb4f52a287f9b6 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 7 Jun 2012 16:58:33 -0700 Subject: rt 4.0.6 --- rt/share/html/Articles/Elements/ShowTopicLink | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 rt/share/html/Articles/Elements/ShowTopicLink (limited to 'rt/share/html/Articles/Elements') diff --git a/rt/share/html/Articles/Elements/ShowTopicLink b/rt/share/html/Articles/Elements/ShowTopicLink new file mode 100644 index 000000000..7b6d550be --- /dev/null +++ b/rt/share/html/Articles/Elements/ShowTopicLink @@ -0,0 +1,27 @@ +<%args> +$Topic +$Class => 0 + +% if ($Link) { +\ +% } +<% $Topic->Name() || loc("(no name)") %>\ +% if ($Topic->Description) { +: <% $Topic->Description %> +% } + +% if ( $Articles->Count ) { + (<&|/l, $Articles->Count &>[quant,_1,article]) +% } + +% if ($Link) { + +% } + +<%init> +my $Articles = RT::ObjectTopics->new( $session{'CurrentUser'} ); +$Articles->Limit( FIELD => 'ObjectType', VALUE => 'RT::Article' ); +$Articles->Limit( FIELD => 'Topic', VALUE => $Topic->Id ); + +my $Link = $Topic->Children->Count || $Articles->Count; + -- cgit v1.2.1