diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:18:55 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:27:04 -0700 |
commit | e131b1f71f08b69abb832c1687d1f29682d171f8 (patch) | |
tree | 490167e41d9fe05b760e7b21a96ee35a86f8edda /rt/share/html/Articles/Elements | |
parent | d05d7346bb2387fd9d0354923d577275c5c7f019 (diff) |
RT 4.2.11, ticket#13852
Diffstat (limited to 'rt/share/html/Articles/Elements')
-rw-r--r-- | rt/share/html/Articles/Elements/CreateArticle | 4 | ||||
-rw-r--r-- | rt/share/html/Articles/Elements/MaybeNeedsSetup | 55 | ||||
-rw-r--r-- | rt/share/html/Articles/Elements/NeedsSetup | 52 | ||||
-rw-r--r-- | rt/share/html/Articles/Elements/NewestArticles | 4 | ||||
-rw-r--r-- | rt/share/html/Articles/Elements/QuickSearch | 4 | ||||
-rw-r--r-- | rt/share/html/Articles/Elements/ShowTopicLink | 2 | ||||
-rw-r--r-- | rt/share/html/Articles/Elements/SubjectOverride | 92 | ||||
-rw-r--r-- | rt/share/html/Articles/Elements/UpdatedArticles | 4 |
8 files changed, 208 insertions, 9 deletions
diff --git a/rt/share/html/Articles/Elements/CreateArticle b/rt/share/html/Articles/Elements/CreateArticle index 3fb549f..7121b0c 100644 --- a/rt/share/html/Articles/Elements/CreateArticle +++ b/rt/share/html/Articles/Elements/CreateArticle @@ -45,13 +45,13 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<& /Elements/TitleBoxStart, title => loc('Create an article') &> +<& /Widgets/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 &> +<& /Widgets/TitleBoxEnd &> <%init> my $Classes = RT::Classes->new($session{'CurrentUser'}); $Classes->LimitToEnabled; diff --git a/rt/share/html/Articles/Elements/MaybeNeedsSetup b/rt/share/html/Articles/Elements/MaybeNeedsSetup new file mode 100644 index 0000000..40f1d48 --- /dev/null +++ b/rt/share/html/Articles/Elements/MaybeNeedsSetup @@ -0,0 +1,55 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2015 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 $Classes = RT::Classes->new( $session{'CurrentUser'} ); +$Classes->LimitToEnabled(); +# This is a COUNT(), which doesn't apply ACLs; as such, we don't display +# the warning if there are classes, but the user can't see them. +return if $Classes->Count; +</%init> +<& NeedsSetup &> diff --git a/rt/share/html/Articles/Elements/NeedsSetup b/rt/share/html/Articles/Elements/NeedsSetup new file mode 100644 index 0000000..d2722f3 --- /dev/null +++ b/rt/share/html/Articles/Elements/NeedsSetup @@ -0,0 +1,52 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2015 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 }}} +%# Stupidly long lines because our extract-message-catalog doesn't handle multiple lines! +<&|/Widgets/TitleBox, id => "articles-needs-setup", class => "error-titlebox", title => loc("Setup needed") &> +<p><&|/l_unsafe, qq[<a href="@{[RT->Config->Get("WebPath")]}/Admin/Articles/">], '</a>' &>Before Articles can be used, your RT administrator must [_1]create Classes[_2], apply Article custom fields to them, and grant users rights on the classes and CFs.</&></p> +<p><&|/l_unsafe, qq[<a href="http://bestpractical.com/rt/docs/$RT::MAJOR_VERSION.$RT::MINOR_VERSION/customizing/articles_introduction.html">], qq[<a href="http://bestpractical.com/rt/docs/$RT::MAJOR_VERSION.$RT::MINOR_VERSION/">], '</a>' &>An [_1]introduction to getting started with articles[_3] is available from [_2]Best Practical's online documentation[_3].</&></p> +</&> diff --git a/rt/share/html/Articles/Elements/NewestArticles b/rt/share/html/Articles/Elements/NewestArticles index 8ceedec..02cd389 100644 --- a/rt/share/html/Articles/Elements/NewestArticles +++ b/rt/share/html/Articles/Elements/NewestArticles @@ -45,7 +45,7 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<& /Elements/TitleBoxStart, title => loc("[_1] newest articles", $rows), bodyclass=> '' &> +<& /Widgets/TitleBoxStart, title => loc("[_1] newest articles", $rows), bodyclass=> '' &> <table border="0" cellspacing="0" cellpadding="1" width="100%"> <tr> <th align="right"><&|/l&>#</&></th> @@ -67,7 +67,7 @@ </tr> % } </table> -<& /Elements/TitleBoxEnd &> +<& /Widgets/TitleBoxEnd &> <%INIT> my $rows = 10; my $i; diff --git a/rt/share/html/Articles/Elements/QuickSearch b/rt/share/html/Articles/Elements/QuickSearch index da5d824..858fad3 100644 --- a/rt/share/html/Articles/Elements/QuickSearch +++ b/rt/share/html/Articles/Elements/QuickSearch @@ -45,13 +45,13 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<& /Elements/TitleBoxStart, title => loc('Quick search') &> +<& /Widgets/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 &> +<& /Widgets/TitleBoxEnd &> <%init> my $classes = RT::Classes->new($session{'CurrentUser'}); $classes->LimitToEnabled; diff --git a/rt/share/html/Articles/Elements/ShowTopicLink b/rt/share/html/Articles/Elements/ShowTopicLink index 147e5c9..cf54a64 100644 --- a/rt/share/html/Articles/Elements/ShowTopicLink +++ b/rt/share/html/Articles/Elements/ShowTopicLink @@ -58,7 +58,7 @@ $Class => 0 % } % if ( $Articles->Count ) { - (<&|/l, $Articles->Count &>[quant,_1,article]</&>) + (<&|/l, $Articles->Count &>[quant,_1,article,articles]</&>) % } % if ($Link) { diff --git a/rt/share/html/Articles/Elements/SubjectOverride b/rt/share/html/Articles/Elements/SubjectOverride new file mode 100644 index 0000000..eb10fbb --- /dev/null +++ b/rt/share/html/Articles/Elements/SubjectOverride @@ -0,0 +1,92 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2015 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> +foreach my $arg ( keys %$ARGSRef) { + + my $Queue = $QueueObj || RT::Queue->new($session{CurrentUser}); + if (!$Queue->Id && $Ticket && $Ticket->Id) { + $Queue = $Ticket->QueueObj; + } + + my $article = RT::Article->new($session{'CurrentUser'}); + $article->LoadByInclude( + Field => $arg, + Value => $ARGSRef->{$arg}, + Queue => $Queue->Id, + ); + next unless $article && $article->id; + + my $class = $article->ClassObj; + + next unless $class->SubjectOverride; + + my $cfs = $class->ArticleCustomFields; + $cfs->Limit( FIELD => 'id', VALUE => $class->SubjectOverride ); + + my $subjectCF = $cfs->First; + next unless $subjectCF; + + my $subject = $article->CustomFieldValuesAsString($subjectCF->Id); + + $m->callback( CallbackName => 'ProcessContent', Ticket => $Ticket, Article => $article, content => \$subject); + + if ( exists $ARGSRef->{UpdateSubject} ) { + $ARGSRef->{UpdateSubject} = $subject; + } else { + $ARGSRef->{Subject} = $subject; + } +} +return; +</%INIT> +<%ARGS> +$Ticket => undef +$ARGSRef => undef +$results => undef +$QueueObj => undef +</%ARGS> + diff --git a/rt/share/html/Articles/Elements/UpdatedArticles b/rt/share/html/Articles/Elements/UpdatedArticles index c2e1ff8..1a1ec52 100644 --- a/rt/share/html/Articles/Elements/UpdatedArticles +++ b/rt/share/html/Articles/Elements/UpdatedArticles @@ -45,7 +45,7 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<& /Elements/TitleBoxStart, title => loc("[_1] most recently updated articles", $rows), bodyclass=> '' &> +<& /Widgets/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> @@ -68,7 +68,7 @@ </tr> % } </table> -<& /Elements/TitleBoxEnd &> +<& /Widgets/TitleBoxEnd &> <%INIT> my $rows = 10; my $i; |