diff options
Diffstat (limited to 'rt/share/html/Articles/Article/Elements')
14 files changed, 1282 insertions, 0 deletions
diff --git a/rt/share/html/Articles/Article/Elements/EditBasics b/rt/share/html/Articles/Article/Elements/EditBasics new file mode 100644 index 000000000..256d81610 --- /dev/null +++ b/rt/share/html/Articles/Article/Elements/EditBasics @@ -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 }}} +<tr> +<td class="label"><&|/l&>Name</&></td> +<td><input name="Name" value="<%($ARGS{'id'} eq 'new' ? '' : $ArticleObj->Name) || $ARGS{'Name'} || ''|h%>" size="50" /></td> +</tr> +<tr> +<td class="label"><&|/l&>Summary</&></td> +<td><input name="Summary" value="<%($ARGS{'id'} eq 'new' ? '' : $ArticleObj->Summary) || $ARGS{'Summary'} ||'' |h%>" size="50" /></td> +</tr> +<tr> +<td class="label"><&|/l&>Class</&></td> +<td> +% if ($EditClass) { +<& /Articles/Elements/SelectClass, Name => 'Class', Default =>$ArticleObj->ClassObj->Id&> +% } else { +<%$ClassObj->Name%> +<input type="hidden" name="Class" value="<%$ClassObj->Id%>" /> +% } +</td> +</tr> +<%INIT> +</%INIT> +<%ARGS> +$EditClass => 1 +$ClassObj => undef +$ArticleObj => undef +</%ARGS> diff --git a/rt/share/html/Articles/Article/Elements/EditCustomFields b/rt/share/html/Articles/Article/Elements/EditCustomFields new file mode 100644 index 000000000..db719eb2e --- /dev/null +++ b/rt/share/html/Articles/Article/Elements/EditCustomFields @@ -0,0 +1,83 @@ +%# 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 }}} +% while (my $CustomField = $CustomFields->Next()) { +<tr> + <td class="labeltop"><b><%$CustomField->Name%></b><br /><i><%$CustomField->FriendlyType%></i></td> + <td class="entry"><& /Elements/EditCustomField, + Object => $ArticleObj, + CustomField => $CustomField, + NamePrefix => $NamePrefix, + Default => + ($CFContent->{$CustomField->Id} || + $ARGS{$NamePrefix .$CustomField->id .'-Values'} || + $ARGS{$NamePrefix .$CustomField->id .'-Value'}) + , + Rows => 15, + Cols => 70 + &></td> +</tr> +% } +<%INIT> +my $CustomFields; +my $NamePrefix; + +if ($ArticleObj->id && $ArticleObj->ClassObj->id) { + $CustomFields = $ArticleObj->CustomFields(); + $NamePrefix = "Object-RT::Article-".$ArticleObj->Id."-CustomField-"; +} +else { + $CustomFields = $ClassObj->ArticleCustomFields(); + $NamePrefix = "Object-RT::Article--CustomField-"; +} +</%INIT> +<%ARGS> +$ArticleObj => undef +$ClassObj => undef +$CFContent => undef +$id => undef +</%ARGS> diff --git a/rt/share/html/Articles/Article/Elements/EditLinks b/rt/share/html/Articles/Article/Elements/EditLinks new file mode 100644 index 000000000..03b99c8d3 --- /dev/null +++ b/rt/share/html/Articles/Article/Elements/EditLinks @@ -0,0 +1,113 @@ +%# 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 }}} +<tr> +<td class="label"></td> +<td class="value"><i><&|/l&>Enter articles, tickets, or other URLs related to this article.</&> +<& LinkEntryInstructions &></i> +% unless ($id eq 'new') { +<i><&|/l&>(Check boxes to delete)</&></i><br /> +% } +</td> +</tr> +<tr> +<td class="label"><&|/l&>Refers to</&>:</td> +<td><input name="<%$id%>-RefersTo" value="<%$ARGS{$id.'-RefersTo'}||''%>" /><br /> +<ul> +% if ($id ne 'new') { +% my $refersto = $ArticleObj->RefersTo; +% while (my $link = $refersto->Next) { +% my $member = $link->TargetURI; +<li> +<input type="CHECKBOX" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" /> +% if ($link->TargetURI->IsLocal) { +<a href="<%$member->Resolver->HREF%>"><% loc($member->Object->ObjectTypeStr) %> <%$member->Object->Id%></a>: +% if (UNIVERSAL::isa($member->Object, "RT::Article") or UNIVERSAL::can($member->Object, 'Name')) { +<%$member->Object->Name%> +% } elsif (UNIVERSAL::isa($member->Object, "RT::Ticket") or UNIVERSAL::can($member->Object, 'Subject')) { +<%$member->Object->Subject%> +% } +</a> +% } else { +<a href="<%$member->Resolver->HREF%>"><%$link->Target%></a> +% } +% } +% } +</ul> +</td> +</tr> +<tr> +<td class="label"><&|/l&>Referred to by</&>:</td> +<td><input name="RefersTo-<%$id%>" value="<%$ARGS{'RefersTo-'.$id}||''%>" /> +<br /> +<ul> +% if ($id ne 'new') { +% my $referredtoby = $ArticleObj->ReferredToBy; +% while (my $link = $referredtoby->Next) { +% my $member = $link->BaseURI; +<li> +<input type="CHECKBOX" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" /> +% if ($link->BaseURI->IsLocal) { +<a href="<%$member->Resolver->HREF%>"><% loc($member->Object->ObjectTypeStr) %> <%$member->Object->Id%>: +% if (UNIVERSAL::isa($member->Object, "RT::Article") or UNIVERSAL::can($member->Object, 'Name')) { +<%$member->Object->Name%> +% } elsif (UNIVERSAL::isa($member->Object, "RT::Ticket") or UNIVERSAL::can($member->Object, 'Subject')) { +<%$member->Object->Subject%> +% } +</a> +% } else { +<a href="<%$member->Resolver->HREF%>"><%$link->Base%></a> +% } +% } +% } +</ul> +</td> +</tr> +<%ARGS> +$ArticleObj => undef +$id => undef +</%ARGS> diff --git a/rt/share/html/Articles/Article/Elements/EditTopics b/rt/share/html/Articles/Article/Elements/EditTopics new file mode 100644 index 000000000..807360bf2 --- /dev/null +++ b/rt/share/html/Articles/Article/Elements/EditTopics @@ -0,0 +1,147 @@ +%# 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 }}} +<input type="hidden" name="EditTopics" value="1" /> +<select multiple size="10" name="Topics"> +<%perl> +if (@Classes) { + $m->print("<optgroup label=\"Current classes (".join (' ',map {$_->Name} @Classes).")\">") + unless $OnlyThisClass; + $inTree->traverse(sub { + my $tree = shift; + my $topic = $tree->getNodeValue; + $m->print("<option value=\"".$topic->Id."\"" + .(exists $topics{$topic->Id} ? " selected" : "").">" + .(" " x ($tree->getDepth*5)).($topic->Name || loc("(no name)"))."</option>\n"); + }); +} +unless ($OnlyThisClass) { + my $class = $Classes[-1]->Id; + $otherTree->traverse(sub { + my $tree = shift; + my $topic = $tree->getNodeValue; + unless ($topic->ObjectId == $class) { + $class = $topic->ObjectId; + $m->print("</optgroup>\n"); + my $c = RT::Class->new($session{'CurrentUser'}); + $c->Load($topic->ObjectId); + $m->print("<optgroup label=\"".$c->Name."\">\n"); + } + $m->print("<option value=\"".$topic->Id."\"" + .(exists $topics{$topic->Id} ? " selected" : "").">" + .(" " x ($tree->getDepth*5)).($topic->Name || loc("(no name)"))."</option>\n"); + }); +</%perl> +</optgroup> +% } +</select> + +<%INIT> +use Tree::Simple; + +my $inClass = RT::Topics->new($session{'CurrentUser'}); +# global topics should always be available +push @Classes,$RT::System unless grep { $_ == $RT::System } @Classes; +$inClass->LimitToObject($_) for @Classes; +$inClass->OrderByCols({FIELD => 'Name'}); +my $inTree = buildTree($inClass); + +my $otherClass = RT::Topics->new($session{'CurrentUser'}); +if (@Classes) { + $otherClass->Limit(FIELD => 'ObjectType', VALUE => 'RT::Class'); + for (@Classes) { + $otherClass->Limit(FIELD => 'ObjectId', OPERATOR => '!=', VALUE => $_->Id); + } +} else { + $otherClass->UnLimit; +} +my $otherTree = buildTree($otherClass); + +my $articleTopics = RT::ObjectTopics->new($session{'CurrentUser'}); +$articleTopics->LimitToObject($ArticleObj); +my %topics; +while (my $topicObj = $articleTopics->Next) { + $topics{$topicObj->Topic} = 1; +} +$topics{$_} = 1 for @Topics; + +sub buildTree { + my $query = shift; + + use Tree::Simple; + my $tree = Tree::Simple->new(Tree::Simple->ROOT); + my %lookup = (0 => $tree); + + my @todo; + while (my $topic = $query->Next) { + push @todo, $topic; + } + + { + my $changed = 0; + my @work = @todo; + @todo = (); + for my $topic (@work) { + if (defined $lookup{$topic->Parent}) { + $lookup{$topic->Id} = Tree::Simple->new($topic, $lookup{$topic->Parent}); + $changed = 1; + } else { + push @todo, $topic; + } + } + redo unless $changed == 0; + } + return $tree; +} + +</%INIT> +<%ARGS> +$ArticleObj => RT::Article->new($session{'CurrentUser'}) +@Classes => () +@Topics => () +$OnlyThisClass => undef +</%ARGS> diff --git a/rt/share/html/Articles/Article/Elements/LinkEntryInstructions b/rt/share/html/Articles/Article/Elements/LinkEntryInstructions new file mode 100644 index 000000000..c2fd1efed --- /dev/null +++ b/rt/share/html/Articles/Article/Elements/LinkEntryInstructions @@ -0,0 +1,49 @@ +%# 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 }}} +<&|/l&>Type <b>a:</b> before article numbers and <b>t:</b> before ticket numbers.</&> +<&|/l&>Separate multiple entries with spaces.</&> diff --git a/rt/share/html/Articles/Article/Elements/Preformatted b/rt/share/html/Articles/Article/Elements/Preformatted new file mode 100644 index 000000000..2f0e7869e --- /dev/null +++ b/rt/share/html/Articles/Article/Elements/Preformatted @@ -0,0 +1,127 @@ +%# 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 ($include{Name}) { +#<%$Article->Id%>: <%$Article->Name || loc('(no name)')%> +<%'-' x length("#".$Article->Id.": ".($Article->Name || loc('(no name)'))) %> +% } +% if ( $include{Summary} && ($Article->Summary||'') =~ /\S/ ) { +<% $Article->Summary %> +% } +% while (my $cf = $cfs->Next) { +% next unless $include{"CF-Title-".$cf->Id} or $include{"CF-Value-".$cf->Id}; +% my $values = $Article->CustomFieldValues($cf->Id); +% if ($values->Count == 1) { +% my $value = $values->First; +% if ($include{"CF-Title-".$cf->Id}) { +<% $cf->Name%>: +<% '-' x length($cf->Name) %> +% } +% if ($value && $include{"CF-Value-".$cf->Id}) { +<% $get_content->( $value ) %> +% } +% } else { +% my $val = $values->Next; +% if ($include{"CF-Title-".$cf->Id}) { +<% $cf->Name%>: \ +% } +% if ($val && $include{"CF-Value-".$cf->Id}) { +<% $get_content->( $val ) %> +% } +% while ($val = $values->Next) { +% if ($include{"CF-Title-".$cf->Id}) { +<% ' ' x length($cf->Name)%> \ +% } +% if ($include{"CF-Value-".$cf->Id}) { +<% $get_content->( $val ) %> +% } +% } +% } +% } +<%init> +my $class = $Article->ClassObj; +my %include = (Name => 1, Summary => 1); +my $cfs = $class->ArticleCustomFields; +$include{"CF-Title-".$_->Id} = $include{"CF-Value-".$_->Id} = 1 while $_ = $cfs->Next; +$include{$_} = not $class->FirstAttribute("Skip-$_") for keys %include; + +my $de_htmlify = sub { + my $content = shift; + require HTML::TreeBuilder; + my $tree = HTML::TreeBuilder->new; + $tree->parse($content); + $tree->eof(); + + require HTML::FormatText; + my $formatter = HTML::FormatText->new(leftmargin => 0, rightmargin => 50); + $content = $formatter->format($tree); + return $content; +}; + +my $get_content = sub { + my $value = shift; + return '' unless $value; + + my $content = $value->Content; + return '' unless defined $content && length $content; + + $m->callback( + %ARGS, + CallbackName => 'ProcessContent', + content => \$content, + ); + + if ( $content =~ /<.{1,5}>/ ) { + $content = $de_htmlify->( $content ); + } + return $content; +}; + +</%init> +<%args> +$Article +</%args> diff --git a/rt/share/html/Articles/Article/Elements/SearchByCustomField b/rt/share/html/Articles/Article/Elements/SearchByCustomField new file mode 100644 index 000000000..2a9d14506 --- /dev/null +++ b/rt/share/html/Articles/Article/Elements/SearchByCustomField @@ -0,0 +1,70 @@ +%# 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 the custom field is a select, enumerate the options +% if ($Field->Type =~ /^Select/) { +% my $CustomFieldValues = $Field->ValuesObj(); +<select name="<%$Name%>" size="5" multiple> +% while (my $value = $CustomFieldValues->Next) { +% my $name = $value->Name || ''; +<option value="<% $name %>" <% grep($_ eq $name, @Values)? 'SELECTED' : ''%>><% $name %></option> +% } +<option value="" <% $#Values < 0 && 'SELECTED'%>><&|/l&>(no value)</&></option> +</select> +% } +%# otherwise, put in a textedity field +% else { +<input name="<%$Name%>" value="<%$Values[0]||''%>" /> +% } +<%init> +my @Values =ref( $Values ) ? @{ $Values } : ( $Values ); +</%init> +<%ARGS> +$Field => undef +$Name => 'CustomField' +$Values => undef +</%ARGS> diff --git a/rt/share/html/Articles/Article/Elements/SelectSavedSearches b/rt/share/html/Articles/Article/Elements/SelectSavedSearches new file mode 100644 index 000000000..c42fae1b5 --- /dev/null +++ b/rt/share/html/Articles/Article/Elements/SelectSavedSearches @@ -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 }}} +<select name="<%$Name%>"> +% foreach my $privacy (reverse sort keys %privacies) { +% my $searches = RT::SavedSearches->new($session{'CurrentUser'}); +% $searches->LimitToPrivacy($privacy, 'Article'); +% next unless $searches->Count; +% if ($privacy =~ /^RT::User/) { +<option value=""><&|/l&>My saved searches</&></option> +% } else { +<option value=""><&|/l, $privacies{$privacy}->Name&>[_1]'s saved searches</&></option> +% } +% while (my $search = $searches->Next) { +% my $optionval = "$privacy-SavedSearch-". $search->Id; +<option value="<%$optionval%>"<% $optionval eq $Default ? 'selected' : '' %>> - <%$search->Name||loc('Unnamed search')%></option> +% } +% } +</select> + +<%init> +use RT::SavedSearches; +my $groups = $session{'CurrentUser'}->UserObj->OwnGroups; +my %privacies; +$privacies{'RT::User-' . $session{'CurrentUser'}->UserObj->Id} = 1; +map { $privacies{'RT::Group-'.$_->Id} = $_ } @{$groups->ItemsArrayRef}; +</%init> + +<%args> +$Name => undef +$Default => undef +</%args> diff --git a/rt/share/html/Articles/Article/Elements/SelectSearchPrivacy b/rt/share/html/Articles/Article/Elements/SelectSearchPrivacy new file mode 100644 index 000000000..674a0ffa7 --- /dev/null +++ b/rt/share/html/Articles/Article/Elements/SelectSearchPrivacy @@ -0,0 +1,62 @@ +%# 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 }}} +<select name="<%$Name%>"> +<option value="RT::User-<% $user->Id %>" <% $Default eq 'RT::User-'.$user->Id ? 'selected' : '' %>>My searches</option> +% while (my $group = $groups->Next) { +<option value="RT::Group-<% $group->Id %>" <% $Default eq 'RT::Group-'.$group->Id ? 'selected' : '' %>><% $group->Name %>'s searches</option> +% } +</select> +<%INIT> +my $user = $session{'CurrentUser'}->UserObj; +my $groups = $session{'CurrentUser'}->UserObj->OwnGroups; +$Default = '' unless defined $Default; +</%INIT> +<%ARGS> +$Name => 'GroupField' +$Default => '' +</%ARGS> diff --git a/rt/share/html/Articles/Article/Elements/ShowHistory b/rt/share/html/Articles/Article/Elements/ShowHistory new file mode 100644 index 000000000..6ca74bf61 --- /dev/null +++ b/rt/share/html/Articles/Article/Elements/ShowHistory @@ -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 }}} +<table width="100%" cellspacing="0" cellpadding="2"> +% my $i; +% while (my $transaction = $transactions->Next) { +<tr class="<% ($i++)%2 ? 'oddline' : 'evenline'%>" > +<td width="20%"><small><%$transaction->CreatedObj->AsString%></small></td> +<td><%$transaction->CreatorObj->Name%></td> +<td><%$transaction->Description%></td> +</tr> +% } +</table> +<%init> + +my $article = RT::Article->new($session{'CurrentUser'}); + +$article->Load($id); +unless ($article->Id) { + $m->comp("/Elements/Error", Why => loc("Article not found")); +} + +unless ($article->ClassObj->CurrentUserHasRight('ShowArticle')) { + $m->comp("/Elements/Error", Why => loc("Permission Denied")); +} + +my $transactions = $article->Transactions(); + +</%init> +<%args> +$id => undef +</%args> diff --git a/rt/share/html/Articles/Article/Elements/ShowLinks b/rt/share/html/Articles/Article/Elements/ShowLinks new file mode 100644 index 000000000..2e48ac949 --- /dev/null +++ b/rt/share/html/Articles/Article/Elements/ShowLinks @@ -0,0 +1,92 @@ +%# 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 }}} +<span class="label"><&|/l&>Refers to</&></span>:<br /> +<ul class="value"> +% my $refersto = $article->RefersTo; + +% while (my $link = $refersto->Next) { +% my $member = $link->TargetURI; +<li> +% if ($link->TargetURI->IsLocal) { +<a href="<%$member->Resolver->HREF%>"><% loc($member->Object->ObjectTypeStr) %> <%$member->Object->Id%>: +% if (UNIVERSAL::isa($member->Object, "RT::Article") or UNIVERSAL::can($member->Object, 'Name')) { +<%$member->Object->Name%> +% } elsif (UNIVERSAL::isa($member->Object, "RT::Ticket") or UNIVERSAL::can($member->Object, 'Subject')) { +<%$member->Object->Subject%> +% } +</a> +% } else { +<a href="<%$member->Resolver->HREF%>"><%$link->Target%></a> +% } +</li> +% } +</ul> + +<span class="label"><&|/l&>Referred to by</&></span>:<br /> +<ul class="value"> +% my $referredtoby = $article->ReferredToBy; +% while (my $link = $referredtoby->Next) { +% my $member = $link->BaseURI; +<li> +% if ($member->IsLocal) { +<a href="<%$member->Resolver->HREF%>"><% loc($member->Object->ObjectTypeStr) %> <%$member->Object->Id%>: +% if (UNIVERSAL::isa($member->Object, "RT::Article") or UNIVERSAL::can($member->Object, 'Name')) { +<%$member->Object->Name%> +% } elsif (UNIVERSAL::isa($member->Object, "RT::Ticket") or UNIVERSAL::can($member->Object, 'Subject')) { +<%$member->Object->Subject%> +% } +</a> +% } else { +<a href="<%$member->Resolver->HREF%>"><%$link->Base%></a> +% } +</li> +% } +</ul> +<%args> +$article => undef +</%args> diff --git a/rt/share/html/Articles/Article/Elements/ShowSavedSearches b/rt/share/html/Articles/Article/Elements/ShowSavedSearches new file mode 100644 index 000000000..8ced74b1c --- /dev/null +++ b/rt/share/html/Articles/Article/Elements/ShowSavedSearches @@ -0,0 +1,85 @@ +%# 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('Saved searches') &> +%# Keep track of what our current search ID is. +<input type="hidden" name="CurrentSearch" value="<% $CurrentSearch ? $CurrentSearch : 'new' %>"> +%# Hide all the save functionality if the user shouldn't see it. +% if ($session{'CurrentUser'}->HasRight( Right => 'CreateSavedSearch', +% Object=> $RT::System )) { +<h2><&|/l&>Save this search</&></h2> +<&|/l&>Name:</&> <input name="NewSearchName" value="<%$Name||''%>"> +<&|/l&>Privacy:</&> <& SelectSearchPrivacy, Name => 'SearchPrivacy', + Default => $Privacy &><br /> +% if ($CurrentSearch && $CurrentSearch ne 'new') { +<input value="<%loc('Update')%>" name="Update" type="submit" /> +<input value="<%loc('Save new')%>" name="Save" type="submit" /> +<input value="<%loc('Delete')%>" name="Delete" type="submit" /> +% } else { +<input value="<%loc('Save')%>" name="Save" type="submit" /> +% } +<hr /> +% } # if HasRight 'CreateSavedSearch' + +<h2><&|/l&>Load a saved search</&></h2> +<& SelectSavedSearches, Name => 'LoadSavedSearch', Default => $CurrentSearch &> +<input value="<%loc('Load')%>" name="Load" type="submit"> +<& /Elements/TitleBoxEnd &> + +<%INIT> +unless ($session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch', + Object=> $RT::System )) { + return; +} + +</%INIT> + +<%ARGS> +$CurrentSearch => undef +$Name => undef +$Privacy => undef +</%ARGS> diff --git a/rt/share/html/Articles/Article/Elements/ShowSearchCriteria b/rt/share/html/Articles/Article/Elements/ShowSearchCriteria new file mode 100644 index 000000000..377cdb1f0 --- /dev/null +++ b/rt/share/html/Articles/Article/Elements/ShowSearchCriteria @@ -0,0 +1,171 @@ +%# 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{'HideOptions'}) { +<& /Elements/TitleBoxStart, title => loc('Advanced search'), class => "rolled-up", bodyclass => "hidden" &> +% } else { +<& /Elements/TitleBoxStart, title => loc('Advanced search') &> +% } +<table> +<tr> +<td class="label" colspan="2"><h2><&|/l&>Basics</&></h2></td> +</tr> +<tr> +<td class="label"><&|/l&>Class</&></td><td class="value">is <& /Articles/Elements/SelectClass, Name => 'Class', Multiple =>1, Size => 5 , ShowNullOption => undef, Default => $ARGS{'Class'} &> +<&|/l&>and not</&> +<& /Articles/Elements/SelectClass, Name => 'Class!', Multiple =>1, Size => 5 , ShowNullOption => undef, Default => $ARGS{'Class!'} &></td> +</tr> +<tr> +<td class="label"><&|/l&>Name</&></td> +<td class="value"><&|/l&>matches</&> <input name="Name~" value="<%$ARGS{'Name~'}%>" /> <&|/l&>and not</&> <input name="Name!~" value="<%$ARGS{'Name!~'}%>" /></td> +</tr> +<tr> +<td class="label"><&|/l&>Summary</&></td> +<td class="value"><&|/l&>matches</&> <input name="Summary~" value="<%$ARGS{'Summary~'}%>" /> <&|/l&>and not</&> <input name="Summary!~" value="<%$ARGS{'Summary!~'}%>" /></td> +</tr> +<tr> +<td class="label" colspan="2"><h2><&|/l&>Content</&></h2></td> +</tr> +<tr> +<td class="label"><&|/l&>Any field</&></td><td class="value"> <&|/l&>matches</&> <input name="Article~" value="<%$ARGS{'Article~'}%>" /> <&|/l&>and not</&> <input name="Article!~" value="<%$ARGS{'Article!~'}%>" /></td> +</tr> +% while (my $field = $customfields->Next ) { +<tr> +<td class="label"><% $field->Name %></td> +<td class="value"><&|/l&>matches</&> +% my $matches = $field->Name."~"; +% my $nomatches = $field->Name."!~"; +<& /Articles/Article/Elements/SearchByCustomField, + Field => $field, + Name => $matches, + Values => $ARGS{$matches} &> + <&|/l&>and not</&> +<& /Articles/Article/Elements/SearchByCustomField, + Field => $field, + Name => $nomatches, + Values => $ARGS{$nomatches} + &> +</td> +</tr> +% } +<tr> +<td class="label" colspan="2"><h2><&|/l&>Dates</&></h2></td> +</tr> +<tr> +<td class="label"><&|/l&>Created</&></td> +<td class="value"><&|/l&>after</&> +<& /Elements/SelectDate, Name=>"Created>", Default => ($dates->{'Created>'} ? $dates->{'Created>'}->ISO : '') &> +<&|/l&>and before</&> +<& /Elements/SelectDate, Name=>"Created<", Default => ($dates->{'Created<'} ? $dates->{'Created<'}->ISO:'')&> +</td> +</tr> +<tr> +<td class="label"><&|/l&>Last updated</&></td> +<td class="value"><&|/l&>after</&> +<& /Elements/SelectDate, Name=>"LastUpdated>", Default => +($dates->{'LastUpdated>'} ? $dates->{'LastUpdated>'}->AsString:'')&> +<&|/l&>and before</&> +<& /Elements/SelectDate, Name=>"LastUpdated<", Default => +($dates->{'LastUpdated<'} ? $dates->{'LastUpdated<'}->AsString:'')&> +</td> +</tr> +<tr> +<td class="label" colspan="2"><h2><&|/l&>Links</&></h2></td> +</tr> +<tr> +<td class="label"></td> +<td><& LinkEntryInstructions &></td> +</tr> +<tr> +<td class="label"><&|/l&>Refer to</&></td> +<td class="value"><input type=text size=50 name="RefersTo" value="<%$RefersTo%>" /></td> +</tr> +<tr> +<td class="label"><&|/l&>Referred to by</&></td> +<td class="value"><input type=text size=50 name="ReferredToBy" value="<%$ReferredToBy%>" /></td> +</tr> +<tr> +<td class="label" colspan="2"><h2><&|/l&>Topics</&></h2></td> +</tr> +<tr> +<td class="label"></td> +<td> +<& /Articles/Article/Elements/EditTopics, %ARGS, Classes => \@Classes, OnlyThisClass => 1 &> +<br /> +<input type="checkbox" name="ExpandTopics" <% $ARGS{'ExpandTopics'} ? 'checked="checked"' : "" %> /> +<&|/l&>Include subtopics</&> +</td> +</tr> +</table> +<& /Elements/Submit, Label => loc('Search') &> +<&/Elements/TitleBoxEnd&> +<%init> +my @Classes = + ( ref $ARGS{'Class'} eq 'ARRAY' ) + ? @{ $ARGS{'Class'} } + : ( $ARGS{'Class'} ); +for (@Classes) { + my $class = RT::Class->new( $session{'CurrentUser'} ); + $class->LoadById($_); + $_ = $class; +} + +for my $field ( qw/Class Name Summary Article/ ) { + $ARGS{"$field~"} = '' unless defined $ARGS{"$field~"}; + $ARGS{"$field!~"} = '' unless defined $ARGS{"$field!~"}; +} +$RefersTo = '' unless defined $RefersTo; +$ReferredToBy = '' unless defined $ReferredToBy; + +</%init> + +<%ARGS> +$dates =>undef +$RefersTo => '' +$ReferredToBy => '' +$customfields => undef +</%ARGS> diff --git a/rt/share/html/Articles/Article/Elements/ShowTopics b/rt/share/html/Articles/Article/Elements/ShowTopics new file mode 100644 index 000000000..31aae36eb --- /dev/null +++ b/rt/share/html/Articles/Article/Elements/ShowTopics @@ -0,0 +1,58 @@ +%# 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 }}} +% my $topics = RT::ObjectTopics->new($session{'CurrentUser'}); +% $topics->LimitToObject($article); +% my @topics; +% while (my $t = $topics->Next) { +<& /Articles/Elements/ShowTopic, topic => $t->TopicObj &><br /> +% } +<br /> + +<%args> +$article => undef +</%args> |