summaryrefslogtreecommitdiff
path: root/rt/share/html/Articles/Article/Elements
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-07-09 22:18:55 -0700
committerIvan Kohler <ivan@freeside.biz>2015-07-09 22:18:55 -0700
commit1c538bfabc2cd31f27067505f0c3d1a46cba6ef0 (patch)
tree96922ad4459eda1e649327fd391d60c58d454c53 /rt/share/html/Articles/Article/Elements
parent4f5619288413a185e9933088d9dd8c5afbc55dfa (diff)
RT 4.2.11, ticket#13852
Diffstat (limited to 'rt/share/html/Articles/Article/Elements')
-rw-r--r--rt/share/html/Articles/Article/Elements/EditCustomFields10
-rw-r--r--rt/share/html/Articles/Article/Elements/EditLinks12
-rw-r--r--rt/share/html/Articles/Article/Elements/Preformatted15
-rw-r--r--rt/share/html/Articles/Article/Elements/ShowHistory76
-rw-r--r--rt/share/html/Articles/Article/Elements/ShowLinks8
-rw-r--r--rt/share/html/Articles/Article/Elements/ShowSavedSearches7
-rw-r--r--rt/share/html/Articles/Article/Elements/ShowSearchCriteria10
7 files changed, 20 insertions, 118 deletions
diff --git a/rt/share/html/Articles/Article/Elements/EditCustomFields b/rt/share/html/Articles/Article/Elements/EditCustomFields
index 8af299236..386529597 100644
--- a/rt/share/html/Articles/Article/Elements/EditCustomFields
+++ b/rt/share/html/Articles/Article/Elements/EditCustomFields
@@ -51,12 +51,7 @@
<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'})
- ,
+ Default => $CFContent->{$CustomField->Id},
Rows => 15,
Cols => 70
&></td>
@@ -64,15 +59,12 @@
% }
<%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>
diff --git a/rt/share/html/Articles/Article/Elements/EditLinks b/rt/share/html/Articles/Article/Elements/EditLinks
index 9e8567ef9..325e5809c 100644
--- a/rt/share/html/Articles/Article/Elements/EditLinks
+++ b/rt/share/html/Articles/Article/Elements/EditLinks
@@ -63,9 +63,9 @@
% while (my $link = $refersto->Next) {
% my $member = $link->TargetURI;
<li>
-<input type="CHECKBOX" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" />
+<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>:
+<a href="<%$member->AsHREF%>"><% loc($member->Object->RecordType) %> <%$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')) {
@@ -73,7 +73,7 @@
% }
</a>
% } else {
-<a href="<%$member->Resolver->HREF%>"><%$link->Target%></a>
+<a href="<%$member->AsHREF%>"><%$link->Target%></a>
% }
% }
% }
@@ -90,9 +90,9 @@
% while (my $link = $referredtoby->Next) {
% my $member = $link->BaseURI;
<li>
-<input type="CHECKBOX" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" />
+<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%>:
+<a href="<%$member->AsHREF%>"><% loc($member->Object->RecordType) %> <%$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')) {
@@ -100,7 +100,7 @@
% }
</a>
% } else {
-<a href="<%$member->Resolver->HREF%>"><%$link->Base%></a>
+<a href="<%$member->AsHREF%>"><%$link->Base%></a>
% }
% }
% }
diff --git a/rt/share/html/Articles/Article/Elements/Preformatted b/rt/share/html/Articles/Article/Elements/Preformatted
index 7e3ab7cbd..acfe6330f 100644
--- a/rt/share/html/Articles/Article/Elements/Preformatted
+++ b/rt/share/html/Articles/Article/Elements/Preformatted
@@ -89,19 +89,6 @@ 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;
@@ -116,7 +103,7 @@ my $get_content = sub {
);
if ( $content =~ /<.{1,5}>/ ) {
- $content = $de_htmlify->( $content );
+ $content = RT::Interface::Email::ConvertHTMLToText( $content );
}
return $content;
};
diff --git a/rt/share/html/Articles/Article/Elements/ShowHistory b/rt/share/html/Articles/Article/Elements/ShowHistory
deleted file mode 100644
index 136640e4a..000000000
--- a/rt/share/html/Articles/Article/Elements/ShowHistory
+++ /dev/null
@@ -1,76 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-%# <sales@bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<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
index 50a971a39..80b00e39f 100644
--- a/rt/share/html/Articles/Article/Elements/ShowLinks
+++ b/rt/share/html/Articles/Article/Elements/ShowLinks
@@ -53,7 +53,7 @@
% my $member = $link->TargetURI;
<li>
% if ($link->TargetURI->IsLocal) {
-<a href="<%$member->Resolver->HREF%>"><% loc($member->Object->ObjectTypeStr) %> <%$member->Object->Id%>:
+<a href="<%$member->AsHREF%>"><% loc($member->Object->RecordType) %> <%$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')) {
@@ -61,7 +61,7 @@
% }
</a>
% } else {
-<a href="<%$member->Resolver->HREF%>"><%$link->Target%></a>
+<a href="<%$member->AsHREF%>"><%$link->Target%></a>
% }
</li>
% }
@@ -74,7 +74,7 @@
% my $member = $link->BaseURI;
<li>
% if ($member->IsLocal) {
-<a href="<%$member->Resolver->HREF%>"><% loc($member->Object->ObjectTypeStr) %> <%$member->Object->Id%>:
+<a href="<%$member->AsHREF%>"><% loc($member->Object->RecordType) %> <%$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')) {
@@ -82,7 +82,7 @@
% }
</a>
% } else {
-<a href="<%$member->Resolver->HREF%>"><%$link->Base%></a>
+<a href="<%$member->AsHREF%>"><%$link->Base%></a>
% }
</li>
% }
diff --git a/rt/share/html/Articles/Article/Elements/ShowSavedSearches b/rt/share/html/Articles/Article/Elements/ShowSavedSearches
index 03396c5e8..e06b79fc5 100644
--- a/rt/share/html/Articles/Article/Elements/ShowSavedSearches
+++ b/rt/share/html/Articles/Article/Elements/ShowSavedSearches
@@ -45,7 +45,7 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<& /Elements/TitleBoxStart, title => loc('Saved searches') &>
+<& /Widgets/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.
@@ -53,8 +53,7 @@
% Object=> $RT::System )) {
<h2><&|/l&>Save this search</&></h2>
<&|/l&>Name:</&> <input name="NewSearchName" value="<%$Name||''%>">
-<&|/l&>Privacy:</&> <& SelectSearchPrivacy, Name => 'SearchPrivacy',
- Default => $Privacy &><br />
+<&|/l&>Privacy:</&> <& SelectSearchPrivacy, Name => 'SearchPrivacy', Default => $Privacy &><br />
% if ($CurrentSearch && $CurrentSearch ne 'new') {
<input value="<%loc('Update')%>" name="Update" type="submit" />&nbsp;
<input value="<%loc('Save new')%>" name="Save" type="submit" />&nbsp;
@@ -68,7 +67,7 @@
<h2><&|/l&>Load a saved search</&></h2>
<& SelectSavedSearches, Name => 'LoadSavedSearch', Default => $CurrentSearch &>
<input value="<%loc('Load')%>" name="Load" type="submit">
-<& /Elements/TitleBoxEnd &>
+<& /Widgets/TitleBoxEnd &>
<%INIT>
unless ($session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch',
diff --git a/rt/share/html/Articles/Article/Elements/ShowSearchCriteria b/rt/share/html/Articles/Article/Elements/ShowSearchCriteria
index ad464f8ca..b4dec87f7 100644
--- a/rt/share/html/Articles/Article/Elements/ShowSearchCriteria
+++ b/rt/share/html/Articles/Article/Elements/ShowSearchCriteria
@@ -46,9 +46,9 @@
%#
%# END BPS TAGGED BLOCK }}}
% if ($ARGS{'HideOptions'}) {
-<& /Elements/TitleBoxStart, title => loc('Advanced search'), class => "rolled-up", bodyclass => "hidden" &>
+<& /Widgets/TitleBoxStart, title => loc('Advanced search'), class => "rolled-up", bodyclass => "hidden" &>
% } else {
-<& /Elements/TitleBoxStart, title => loc('Advanced search') &>
+<& /Widgets/TitleBoxStart, title => loc('Advanced search') &>
% }
<table>
<tr>
@@ -136,13 +136,13 @@
<td>
<& /Articles/Article/Elements/EditTopics, %ARGS, Classes => \@Classes, OnlyThisClass => 1 &>
<br />
-<input type="checkbox" name="ExpandTopics" <% $ARGS{'ExpandTopics'} ? 'checked="checked"' : "" %> />
-<&|/l&>Include subtopics</&>
+<input type="checkbox" id="ExpandTopics" name="ExpandTopics" <% $ARGS{'ExpandTopics'} ? 'checked="checked"' : "" %> />
+<label for="ExpandTopics"><&|/l&>Include subtopics</&></label>
</td>
</tr>
</table>
<& /Elements/Submit, Label => loc('Search') &>
-<&/Elements/TitleBoxEnd&>
+<& /Widgets/TitleBoxEnd &>
<%init>
my @Classes =
( ref $ARGS{'Class'} eq 'ARRAY' )