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/Article/Elements/EditBasics | 73 +++++++++ .../Articles/Article/Elements/EditCustomFields | 83 ++++++++++ rt/share/html/Articles/Article/Elements/EditLinks | 113 ++++++++++++++ rt/share/html/Articles/Article/Elements/EditTopics | 147 ++++++++++++++++++ .../Article/Elements/LinkEntryInstructions | 49 ++++++ .../html/Articles/Article/Elements/Preformatted | 127 +++++++++++++++ .../Articles/Article/Elements/SearchByCustomField | 70 +++++++++ .../Articles/Article/Elements/SelectSavedSearches | 76 +++++++++ .../Articles/Article/Elements/SelectSearchPrivacy | 62 ++++++++ .../html/Articles/Article/Elements/ShowHistory | 76 +++++++++ rt/share/html/Articles/Article/Elements/ShowLinks | 92 +++++++++++ .../Articles/Article/Elements/ShowSavedSearches | 85 ++++++++++ .../Articles/Article/Elements/ShowSearchCriteria | 171 +++++++++++++++++++++ rt/share/html/Articles/Article/Elements/ShowTopics | 58 +++++++ 14 files changed, 1282 insertions(+) create mode 100644 rt/share/html/Articles/Article/Elements/EditBasics create mode 100644 rt/share/html/Articles/Article/Elements/EditCustomFields create mode 100644 rt/share/html/Articles/Article/Elements/EditLinks create mode 100644 rt/share/html/Articles/Article/Elements/EditTopics create mode 100644 rt/share/html/Articles/Article/Elements/LinkEntryInstructions create mode 100644 rt/share/html/Articles/Article/Elements/Preformatted create mode 100644 rt/share/html/Articles/Article/Elements/SearchByCustomField create mode 100644 rt/share/html/Articles/Article/Elements/SelectSavedSearches create mode 100644 rt/share/html/Articles/Article/Elements/SelectSearchPrivacy create mode 100644 rt/share/html/Articles/Article/Elements/ShowHistory create mode 100644 rt/share/html/Articles/Article/Elements/ShowLinks create mode 100644 rt/share/html/Articles/Article/Elements/ShowSavedSearches create mode 100644 rt/share/html/Articles/Article/Elements/ShowSearchCriteria create mode 100644 rt/share/html/Articles/Article/Elements/ShowTopics (limited to 'rt/share/html/Articles/Article/Elements') 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 +%# +%# +%# (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&>Name + + + +<&|/l&>Summary + + + +<&|/l&>Class + +% if ($EditClass) { +<& /Articles/Elements/SelectClass, Name => 'Class', Default =>$ArticleObj->ClassObj->Id&> +% } else { +<%$ClassObj->Name%> + +% } + + +<%INIT> + +<%ARGS> +$EditClass => 1 +$ClassObj => undef +$ArticleObj => undef + 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 +%# +%# +%# (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()) { + + <%$CustomField->Name%>
<%$CustomField->FriendlyType%> + <& /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 + &> + +% } +<%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-"; +} + +<%ARGS> +$ArticleObj => undef +$ClassObj => undef +$CFContent => undef +$id => undef + 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 +%# +%# +%# (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&>Enter articles, tickets, or other URLs related to this article. +<& LinkEntryInstructions &> +% unless ($id eq 'new') { +<&|/l&>(Check boxes to delete)
+% } + + + +<&|/l&>Refers to: +
+
    +% if ($id ne 'new') { +% my $refersto = $ArticleObj->RefersTo; +% while (my $link = $refersto->Next) { +% my $member = $link->TargetURI; +
  • + +% if ($link->TargetURI->IsLocal) { +<% 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%> +% } + +% } else { +<%$link->Target%> +% } +% } +% } +
+ + + +<&|/l&>Referred to by: + +
+ + + +<%ARGS> +$ArticleObj => undef +$id => undef + 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 +%# +%# +%# (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> +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; +} + + +<%ARGS> +$ArticleObj => RT::Article->new($session{'CurrentUser'}) +@Classes => () +@Topics => () +$OnlyThisClass => undef + 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 +%# +%# +%# (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 a: before article numbers and t: 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 +%# +%# +%# (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; +}; + + +<%args> +$Article + 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 +%# +%# +%# (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(); + +% } +%# otherwise, put in a textedity field +% else { + +% } +<%init> +my @Values =ref( $Values ) ? @{ $Values } : ( $Values ); + +<%ARGS> +$Field => undef +$Name => 'CustomField' +$Values => undef + 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 +%# +%# +%# (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> +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}; + + +<%args> +$Name => undef +$Default => undef + 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 +%# +%# +%# (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 $user = $session{'CurrentUser'}->UserObj; +my $groups = $session{'CurrentUser'}->UserObj->OwnGroups; +$Default = '' unless defined $Default; + +<%ARGS> +$Name => 'GroupField' +$Default => '' + 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 +%# +%# +%# (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 $i; +% while (my $transaction = $transactions->Next) { + + + + + +% } +
<%$transaction->CreatedObj->AsString%><%$transaction->CreatorObj->Name%><%$transaction->Description%>
+<%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(); + + +<%args> +$id => undef + 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 +%# +%# +%# (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&>Refers to:
+ + +<&|/l&>Referred to by:
+ +<%args> +$article => undef + 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 +%# +%# +%# (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. + +%# Hide all the save functionality if the user shouldn't see it. +% if ($session{'CurrentUser'}->HasRight( Right => 'CreateSavedSearch', +% Object=> $RT::System )) { +

<&|/l&>Save this search

+<&|/l&>Name: +<&|/l&>Privacy: <& SelectSearchPrivacy, Name => 'SearchPrivacy', + Default => $Privacy &>
+% if ($CurrentSearch && $CurrentSearch ne 'new') { +  +  +  +% } else { + +% } +
+% } # if HasRight 'CreateSavedSearch' + +

<&|/l&>Load a saved search

+<& SelectSavedSearches, Name => 'LoadSavedSearch', Default => $CurrentSearch &> + +<& /Elements/TitleBoxEnd &> + +<%INIT> +unless ($session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch', + Object=> $RT::System )) { + return; +} + + + +<%ARGS> +$CurrentSearch => undef +$Name => undef +$Privacy => undef + 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 +%# +%# +%# (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') &> +% } + + + + + + + + + + + + + + + + + + + + + +% while (my $field = $customfields->Next ) { + + + + +% } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

<&|/l&>Basics

<&|/l&>Classis <& /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!'} &>
<&|/l&>Name<&|/l&>matches <&|/l&>and not
<&|/l&>Summary<&|/l&>matches <&|/l&>and not

<&|/l&>Content

<&|/l&>Any field <&|/l&>matches <&|/l&>and not
<% $field->Name %><&|/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} + &> +

<&|/l&>Dates

<&|/l&>Created<&|/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:'')&> +
<&|/l&>Last updated<&|/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:'')&> +

<&|/l&>Links

<& LinkEntryInstructions &>
<&|/l&>Refer to
<&|/l&>Referred to by

<&|/l&>Topics

+<& /Articles/Article/Elements/EditTopics, %ARGS, Classes => \@Classes, OnlyThisClass => 1 &> +
+ /> +<&|/l&>Include subtopics +
+<& /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; + + + +<%ARGS> +$dates =>undef +$RefersTo => '' +$ReferredToBy => '' +$customfields => undef + 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 +%# +%# +%# (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 &>
+% } +
+ +<%args> +$article => undef + -- cgit v1.2.1 From c24d6e2242ae0e026684b8f95decf156aba6e75e Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 7 Jun 2012 16:55:45 -0700 Subject: rt 4.0.6 --- rt/share/html/Articles/Article/Elements/EditTopics | 55 ++++++++++------------ 1 file changed, 26 insertions(+), 29 deletions(-) (limited to 'rt/share/html/Articles/Article/Elements') diff --git a/rt/share/html/Articles/Article/Elements/EditTopics b/rt/share/html/Articles/Article/Elements/EditTopics index 807360bf2..82e907135 100644 --- a/rt/share/html/Articles/Article/Elements/EditTopics +++ b/rt/share/html/Articles/Article/Elements/EditTopics @@ -47,35 +47,32 @@ %# END BPS TAGGED BLOCK }}} -- cgit v1.2.1