summaryrefslogtreecommitdiff
path: root/rt/html/Elements
diff options
context:
space:
mode:
Diffstat (limited to 'rt/html/Elements')
-rw-r--r--rt/html/Elements/BevelBoxRaisedEnd10
-rw-r--r--rt/html/Elements/BevelBoxRaisedStart12
-rw-r--r--rt/html/Elements/Callback6
-rw-r--r--rt/html/Elements/Checkbox8
-rw-r--r--rt/html/Elements/CollectionAsTable/Header20
-rw-r--r--rt/html/Elements/CollectionAsTable/ParseFormat14
-rw-r--r--rt/html/Elements/CollectionAsTable/Row18
-rw-r--r--rt/html/Elements/CreateTicket12
-rw-r--r--rt/html/Elements/EditCustomField16
-rw-r--r--rt/html/Elements/EditCustomFieldBinary10
-rw-r--r--rt/html/Elements/EditCustomFieldCombobox68
-rw-r--r--rt/html/Elements/EditCustomFieldFreeform21
-rw-r--r--rt/html/Elements/EditCustomFieldImage12
-rw-r--r--rt/html/Elements/EditCustomFieldSelect84
-rw-r--r--rt/html/Elements/EditCustomFieldText10
-rw-r--r--rt/html/Elements/EditCustomFieldWikitext10
-rwxr-xr-xrt/html/Elements/EditLinks114
-rw-r--r--rt/html/Elements/Error22
-rw-r--r--rt/html/Elements/Footer47
-rw-r--r--rt/html/Elements/GotoTicket8
-rw-r--r--rt/html/Elements/Header119
-rw-r--r--rt/html/Elements/ListActions30
-rw-r--r--rt/html/Elements/Login80
-rw-r--r--rt/html/Elements/Logo56
-rw-r--r--rt/html/Elements/Menu128
-rw-r--r--rt/html/Elements/MessageBox10
-rw-r--r--rt/html/Elements/MyAdminQueues54
-rw-r--r--rt/html/Elements/MyRT100
-rwxr-xr-xrt/html/Elements/MyReminders73
-rw-r--r--rt/html/Elements/MyRequests33
-rw-r--r--rt/html/Elements/MySupportQueues54
-rw-r--r--rt/html/Elements/MyTickets34
-rw-r--r--rt/html/Elements/PageLayout208
-rw-r--r--rt/html/Elements/QueryString13
-rw-r--r--rt/html/Elements/QueueSummary92
-rw-r--r--rt/html/Elements/QuickCreate37
-rw-r--r--rt/html/Elements/Quicksearch59
-rw-r--r--rt/html/Elements/RT__Ticket/ColumnMap39
-rw-r--r--rt/html/Elements/Refresh22
-rw-r--r--rt/html/Elements/RefreshHomepage51
-rw-r--r--rt/html/Elements/ScrubHTML8
-rw-r--r--rt/html/Elements/Section15
-rw-r--r--rt/html/Elements/SelectAttachmentField18
-rw-r--r--rt/html/Elements/SelectBoolean17
-rw-r--r--rt/html/Elements/SelectCustomFieldOperator18
-rw-r--r--rt/html/Elements/SelectCustomFieldValue10
-rw-r--r--rt/html/Elements/SelectDate14
-rw-r--r--rt/html/Elements/SelectDateRelation16
-rw-r--r--rt/html/Elements/SelectDateType26
-rw-r--r--rt/html/Elements/SelectEqualityOperator16
-rw-r--r--rt/html/Elements/SelectGroups12
-rw-r--r--rt/html/Elements/SelectLang16
-rw-r--r--rt/html/Elements/SelectLinkType16
-rw-r--r--rt/html/Elements/SelectMatch18
-rw-r--r--rt/html/Elements/SelectNewTicketQueue45
-rw-r--r--rt/html/Elements/SelectOwner16
-rw-r--r--rt/html/Elements/SelectQueue69
-rw-r--r--rt/html/Elements/SelectResultsPerPage17
-rw-r--r--rt/html/Elements/SelectSortOrder14
-rw-r--r--rt/html/Elements/SelectStatus14
-rw-r--r--rt/html/Elements/SelectTicketSortBy12
-rw-r--r--rt/html/Elements/SelectTicketTypes12
-rwxr-xr-xrt/html/Elements/SelectTimeUnits57
-rw-r--r--rt/html/Elements/SelectUsers12
-rw-r--r--rt/html/Elements/SelectWatcherType14
-rw-r--r--rt/html/Elements/SetupSessionCookie126
-rw-r--r--rt/html/Elements/ShowCustomFieldBinary6
-rw-r--r--rt/html/Elements/ShowCustomFieldImage8
-rw-r--r--rt/html/Elements/ShowCustomFieldWikitext9
-rw-r--r--rt/html/Elements/ShowCustomFields73
-rw-r--r--rt/html/Elements/ShowLink8
-rwxr-xr-xrt/html/Elements/ShowLinks7
-rw-r--r--rt/html/Elements/ShowMemberships6
-rw-r--r--rt/html/Elements/ShowSearch126
-rw-r--r--rt/html/Elements/SimpleSearch12
-rw-r--r--rt/html/Elements/Submit65
-rw-r--r--rt/html/Elements/Tabs11
-rw-r--r--rt/html/Elements/TicketList46
-rw-r--r--rt/html/Elements/TitleBox11
-rw-r--r--rt/html/Elements/TitleBoxEnd21
-rw-r--r--rt/html/Elements/TitleBoxStart49
-rw-r--r--rt/html/Elements/ValidateCustomFields81
82 files changed, 2036 insertions, 945 deletions
diff --git a/rt/html/Elements/BevelBoxRaisedEnd b/rt/html/Elements/BevelBoxRaisedEnd
index e1d1edb..b1ba8f6 100644
--- a/rt/html/Elements/BevelBoxRaisedEnd
+++ b/rt/html/Elements/BevelBoxRaisedEnd
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,6 +45,6 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
- </TD>
-</TR>
+ </td>
+</tr>
</table>
diff --git a/rt/html/Elements/BevelBoxRaisedStart b/rt/html/Elements/BevelBoxRaisedStart
index 6c5a613..b690c1d 100644
--- a/rt/html/Elements/BevelBoxRaisedStart
+++ b/rt/html/Elements/BevelBoxRaisedStart
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,6 +45,6 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<table cellspacing=0 cellpadding=0 width=100% height=100%>
- <TR>
- <TD width=100% height=100%>
+<table cellspacing="0" cellpadding="0" width="100%" height="100%">
+ <tr>
+ <td width="100%" height="100%">
diff --git a/rt/html/Elements/Callback b/rt/html/Elements/Callback
index c7aeb9f..b498f28 100644
--- a/rt/html/Elements/Callback
+++ b/rt/html/Elements/Callback
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
diff --git a/rt/html/Elements/Checkbox b/rt/html/Elements/Checkbox
index f2256fb..5593c7a 100644
--- a/rt/html/Elements/Checkbox
+++ b/rt/html/Elements/Checkbox
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,7 +45,7 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<INPUT TYPE="Checkbox" NAME="<%$Name%>" value="1" <%$IsChecked%>>
+<input type="checkbox" class="checkbox" name="<%$Name%>" value="1" <%$IsChecked%> />
<%ARGS>
$Name => undef
diff --git a/rt/html/Elements/CollectionAsTable/Header b/rt/html/Elements/CollectionAsTable/Header
index 9ed4be8..a3277b3 100644
--- a/rt/html/Elements/CollectionAsTable/Header
+++ b/rt/html/Elements/CollectionAsTable/Header
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -54,7 +56,7 @@ $Rows => undef
$Page => undef
$maxitems => undef
</%ARGS>
-<TR class="collection-as-table">
+<tr class="collection-as-table">
<%perl>
my %generic_query_args = ( Query => $Query, Rows => $Rows, Page => $Page, Format => $FormatString );
@@ -62,18 +64,18 @@ my %generic_query_args = ( Query => $Query, Rows => $Rows, Page => $Page, Format
my $item = 0;
foreach my $col (@Format) {
$item++;
- if ( $col->{title} eq 'NEWLINE' ) {
+ if ( $col->{title} && ($col->{title} eq 'NEWLINE') ) {
while ( $item < $maxitems ) {
$m->out(qq{<th class="collection-as-table">&nbsp;</th>\n});
$item++;
}
$item = 0;
- $m->out(qq{</TR>\n<TR class="collection-as-table">});
+ $m->out(qq{</tr>\n<tr class="collection-as-table">});
}
else {
- $m->out('<TH class="collection-as-table">');
- my $title = $col->{title};
+ $m->out('<th class="collection-as-table">');
+ my $title = $col->{title} || '';
$title =~ s/^__(.*)__$/$1/o;
$title = (
$m->comp(
@@ -116,8 +118,8 @@ foreach my $col (@Format) {
else {
$m->out( loc($title) );
}
- $m->out('</TH>');
+ $m->out('</th>');
}
}
</%perl>
-</TR>
+</tr>
diff --git a/rt/html/Elements/CollectionAsTable/ParseFormat b/rt/html/Elements/CollectionAsTable/ParseFormat
index 57434ef..2270760 100644
--- a/rt/html/Elements/CollectionAsTable/ParseFormat
+++ b/rt/html/Elements/CollectionAsTable/ParseFormat
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -48,7 +50,7 @@ $Format
</%ARGS>
<%init>
-use Regexp::Common;
+use Regexp::Common qw/delimited/;
my @Columns;
while ($Format =~ /($RE{delimited}{-delim=>qq{\'"}}|[{}\w.]+)/go) {
@@ -59,7 +61,9 @@ while ($Format =~ /($RE{delimited}{-delim=>qq{\'"}}|[{}\w.]+)/go) {
substr($col,-1,1) = "";
}
- my $colref;
+ my $colref = {
+ title => '',
+ };
if ( $col =~ s!/STYLE:([^/]+)!!io ) {
$colref->{'style'} = $1;
@@ -88,7 +92,7 @@ while ($Format =~ /($RE{delimited}{-delim=>qq{\'"}}|[{}\w.]+)/go) {
$colref->{'attribute'} = $col;
}
- if ( !$colref->{'title'} && grep { /^__(.*?)__$/io }
+ if ( !$colref->{'title'} && grep { /^__(.+?)__$/io }
@{ $colref->{'output'} } )
{
$colref->{'title'} = $1;
diff --git a/rt/html/Elements/CollectionAsTable/Row b/rt/html/Elements/CollectionAsTable/Row
index 0de362e..64ecef4 100644
--- a/rt/html/Elements/CollectionAsTable/Row
+++ b/rt/html/Elements/CollectionAsTable/Row
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -53,17 +55,17 @@ $Warning => undef
</%ARGS>
<%PERL>
-$m->out('<TR class="' . ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) . '" >' );
+$m->out('<tr class="' . ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) . '" >' );
my $item;
foreach my $column (@Format) {
- if ( $column->{title} eq 'NEWLINE' ) {
+ if ( defined $column->{title} && $column->{title} eq 'NEWLINE' ) {
while ( $item < $maxitems ) {
$m->out(qq{<td class="collection-as-table">&nbsp;</td>\n});
$item++;
}
$item = 0;
- $m->out('</TR>');
- $m->out('<TR class="'
+ $m->out('</tr>');
+ $m->out('<tr class="'
. ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' )
. '" >' );
next;
@@ -99,7 +101,7 @@ foreach my $column (@Format) {
# Simple value; just escape it.
@out = $m->interp->apply_escapes( $value => 'h' );
}
- s/\n/<br>/gs for @out;
+ s/\n/<br \/>/gs for @out;
$m->out( @out );
}
else {
@@ -108,5 +110,5 @@ foreach my $column (@Format) {
}
$m->out('</td>');
}
-$m->out('</TR>');
+$m->out('</tr>');
</%PERL>
diff --git a/rt/html/Elements/CreateTicket b/rt/html/Elements/CreateTicket
index bd60bbd..644df22 100644
--- a/rt/html/Elements/CreateTicket
+++ b/rt/html/Elements/CreateTicket
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,6 +45,6 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<FORM ACTION="<% $RT::WebPath %>/Ticket/Create.html" NAME="CreateTicketInQueue">
-<&|/l, $m->scomp('/Elements/SelectNewTicketQueue')&><input type="submit" value="New ticket in">&nbsp;[_1]</&>
-</FORM>
+<form action="<% $RT::WebPath %>/Ticket/Create.html" name="CreateTicketInQueue">
+<&|/l, $m->scomp('/Elements/SelectNewTicketQueue')&><input type="submit" class="button" value="New ticket in" />&nbsp;[_1]</&>
+</form>
diff --git a/rt/html/Elements/EditCustomField b/rt/html/Elements/EditCustomField
index e443c76..d247c63 100644
--- a/rt/html/Elements/EditCustomField
+++ b/rt/html/Elements/EditCustomField
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -45,7 +47,7 @@
%# END BPS TAGGED BLOCK }}}
<%INIT>
my $Values;
-if ($Object) {
+if ($Object and $Object->id) {
$Values = $Object->CustomFieldValues($CustomField->id);
$Values->Columns( qw( id CustomField ObjectType ObjectId Disabled Content ContentType ContentEncoding ) );
$NamePrefix ||= join('-', 'Object', ref($Object), $Object->Id, 'CustomField', '');
@@ -67,10 +69,14 @@ if ($MaxValues == 1 and $Object and $Values) {
}
# The "Magic" hidden input causes RT to know that we were trying to edit the field, even if
# we don't see a value later, since browsers aren't compelled to submit empty form fields
-$m->out("\n".'<input type="hidden" name="'.$NamePrefix.$CustomField->Id.'-Values-Magic" value="1">'."\n");
+$m->out("\n".'<input type="hidden" class="hidden" name="'.$NamePrefix.$CustomField->Id.'-Values-Magic" value="1" />'."\n");
+
+my $EditComponent = "EditCustomField$Type";
+$m->comp('/Elements/Callback', _CallbackName => 'EditComponentName', Name => \$EditComponent, CustomField => $CustomField, Object => $Object );
+$EditComponent = "EditCustomField$Type" unless $m->comp_exists($EditComponent);
return $m->comp(
- "EditCustomField$Type",
+ $EditComponent,
%ARGS,
Rows => $Rows,
Cols => $Cols,
diff --git a/rt/html/Elements/EditCustomFieldBinary b/rt/html/Elements/EditCustomFieldBinary
index 0028256..485457c 100644
--- a/rt/html/Elements/EditCustomFieldBinary
+++ b/rt/html/Elements/EditCustomFieldBinary
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -45,10 +47,10 @@
%# END BPS TAGGED BLOCK }}}
% while ($Values and my $value = $Values->Next ) {
%# XXX - let user download the file(s) here?
-<input type="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValueIds" value="<% $value->Id %>"><a href="<%$RT::WebPath%>/Download/CustomFieldValue/<% $value->Id %>/<% $value->Content %>"><% $value->Content %></a><br>
+<input type="checkbox" class="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValueIds" value="<% $value->Id %>" /><a href="<%$RT::WebPath%>/Download/CustomFieldValue/<% $value->Id %>/<% $value->Content %>"><% $value->Content %></a><br />
% }
% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) {
-<input type="file" name="<%$NamePrefix%><%$CustomField->Id%>-Upload">
+<input type="file" name="<%$NamePrefix%><%$CustomField->Id%>-Upload" />
% }
<%ARGS>
$Object => undef
diff --git a/rt/html/Elements/EditCustomFieldCombobox b/rt/html/Elements/EditCustomFieldCombobox
new file mode 100644
index 0000000..071ef07
--- /dev/null
+++ b/rt/html/Elements/EditCustomFieldCombobox
@@ -0,0 +1,68 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
+%# <jesse@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/copyleft/gpl.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 ($Values and my $value = $Values->Next and $Multiple) {
+<input type="checkbox" class="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValueIds" value="<% $value->Id %>" /><% $value->Content %>
+<br />
+% }
+% (!$Multiple or !$MaxValues or !$Values or $Values->Count < $MaxValues) or return;
+<& /Widgets/ComboBox,
+ Name => $NamePrefix . $CustomField->Id . "-Value",
+ Default => $Default,
+ Rows => $Rows,
+ Values => [map {$_->Name} @{$CustomField->Values->ItemsArrayRef}],
+&>
+<%ARGS>
+$Object => undef
+$CustomField => undef
+$NamePrefix => undef
+$Default => undef
+$Values => undef
+$Multiple => 0
+$Rows => undef
+$MaxValues => undef
+</%ARGS>
diff --git a/rt/html/Elements/EditCustomFieldFreeform b/rt/html/Elements/EditCustomFieldFreeform
index c097ee0..2eb49eb 100644
--- a/rt/html/Elements/EditCustomFieldFreeform
+++ b/rt/html/Elements/EditCustomFieldFreeform
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,17 +45,20 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
+% my $name = $NamePrefix . $CustomField->Id . '-Value';
% if ($Multiple) {
-<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><%$Default%></textarea>
+<textarea cols="<%$Cols%>" rows="<%$Rows%>" name="<%$name%>s" id="<%$name%>s" ><%$Default%></textarea>
% } else {
-<input name="<%$NamePrefix%><%$CustomField->Id%>-Value" size="<%$Cols%>" value="<%$Default ? $Default : ''%>">
+<input name="<%$name%>" id="<%$name%>" size="<%$Cols%>" value="<%$Default ? $Default : ''%>" />
% }
<%INIT>
if ($Multiple and $Values) {
- $Default = '';
- while (my $value = $Values->Next ) {
- $Default .= $value->Content."\n";
- }
+ $Default = '';
+ while (my $value = $Values->Next ) {
+ $Default .= $value->Content."\n";
+ }
+} else {
+ $Default =~ s/\s*\n\s*/ /g if $Default;
}
</%INIT>
<%ARGS>
diff --git a/rt/html/Elements/EditCustomFieldImage b/rt/html/Elements/EditCustomFieldImage
index b378cea..b6a30c6 100644
--- a/rt/html/Elements/EditCustomFieldImage
+++ b/rt/html/Elements/EditCustomFieldImage
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -44,11 +46,11 @@
%#
%# END BPS TAGGED BLOCK }}}
% while ($Values and my $value = $Values->Next ) {
-<input type="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValueIds" value="<% $value->Id %>"><& ShowCustomFieldImage, Object => $value &>
-<br>
+<input type="checkbox" class="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValueIds" value="<% $value->Id %>" /><& ShowCustomFieldImage, Object => $value &>
+<br />
% }
% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) {
-<input type="file" name="<%$NamePrefix%><%$CustomField->Id%>-Upload">
+<input type="file" name="<%$NamePrefix%><%$CustomField->Id%>-Upload" />
% }
<%ARGS>
$Object => undef
diff --git a/rt/html/Elements/EditCustomFieldSelect b/rt/html/Elements/EditCustomFieldSelect
index 2a2a64a..815e977 100644
--- a/rt/html/Elements/EditCustomFieldSelect
+++ b/rt/html/Elements/EditCustomFieldSelect
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,30 +45,84 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
- <select name="<%$NamePrefix%><%$CustomField->Id%>-Values"
+%# Build up the set of cascading select boxes as "guides"
+%# each one limits the options of the final one a bit
+%# (perhaps by tweaking the .display style?)
+% my $selected = 0;
+% my @category;
+% my $id = $NamePrefix . $CustomField->Id;
+% my $out = $m->scomp('SELF:options', %ARGS, SelectedRef => \$selected, CategoryRef => \@category);
+% if (@category) {
+<script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/cascaded.js"></script>
+%# XXX - Hide this select from w3m?
+ <select onchange="filter_cascade('<% $id %>-Values', this.value)" name="<%$id%>-Category">
+ <option value="" <% !$selected && 'SELECTED' %>><&|/l&>-</&></option>
+% foreach my $cat (@category) {
+% my ($depth, $name) = @$cat;
+ <option value="<% $name %>"><% '&nbsp;' x $depth |n %><%$name%></option>
+% }
+ </select><br />
+% }
+ <select name="<%$id%>-Values" id="<%$id%>-Values"
+% if ($Multiple or !@category) {
size="<%$Rows%>"
+% }
<% $Multiple && 'MULTIPLE' %>>
+ <option value="" <% !$selected && 'SELECTED' %>><&|/l&>(no value)</&></option>
+% $m->out($out);
+ </select>
+<%ARGS>
+$Object => undef
+$CustomField => undef
+$NamePrefix => undef
+$Default => undef
+$Values => undef
+$Multiple => 0
+$Rows => undef
+</%ARGS>
+
+<%method options>
% my $selected;
% my $CFVs = $CustomField->Values;
+% my @levels;
% while ($CFVs and my $value = $CFVs->Next ) {
+% my $category = $value->Category;
+% if (1) { # length $category) {
+% my $level = (split(/:/, $category || ''))[0];
+% while (@levels) {
+% if ($levels[-1] eq $level) {
+% undef $level;
+% last;
+% } elsif (index($level, $levels[-1]) != 0) {
+ </optgroup>
+% pop @levels;
+% } else {
+% last;
+% }
+% }
+% if ($level) {
+% push @$CategoryRef, [0+@levels, $level];
+ <optgroup style="padding-left: <% @levels/2 %>em" label="<%$category%>">
+% push @levels, $level;
+% }
+% }
<option value="<%$value->Name%>"
% if ($Values) {
- <% $Values->HasEntry($value->Name) && ($selected = 1) && 'SELECTED' %>
+ <% ($Values->HasEntry($value->Name)||'') && ($$SelectedRef = 1) && 'SELECTED' %>
% } elsif ($Default) {
<% (ref $Default ? (grep {$_ eq $value->Name} @{$Default}) : ($Default eq $value->Name))
- && ($selected = 1) && 'SELECTED' %>
+ && ($$SelectedRef = 1) && 'SELECTED' %>
% }
><% $value->Name%></option>
% }
- <option value="" <% !$selected && 'SELECTED' %>><&|/l&>(no value)</&></option>
- </select>
-<%ARGS>
-$Object => undef
+% for (@levels) {
+ </optgroup>
+% }
+<%args>
$CustomField => undef
-$NamePrefix => undef
$Default => undef
$Values => undef
-$Multiple => 0
-$Cols
-$Rows
-</%ARGS>
+$SelectedRef => undef
+$CategoryRef => undef
+</%args>
+</%method>
diff --git a/rt/html/Elements/EditCustomFieldText b/rt/html/Elements/EditCustomFieldText
index 1aac328..b7569b0 100644
--- a/rt/html/Elements/EditCustomFieldText
+++ b/rt/html/Elements/EditCustomFieldText
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -44,10 +46,10 @@
%#
%# END BPS TAGGED BLOCK }}}
% while ($Values and my $value = $Values->Next ) {
-<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><% $value->Content %></textarea><br>
+<textarea cols="<%$Cols%>" rows="<%$Rows%>" name="<%$NamePrefix%><%$CustomField->Id%>-Values"><% $value->Content %></textarea><br />
% }
% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) {
-<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><% $Default %></textarea>
+<textarea cols="<%$Cols%>" rows="<%$Rows%>" name="<%$NamePrefix%><%$CustomField->Id%>-Values"><% $Default %></textarea>
% }
<%INIT>
# XXX - MultiValue textarea is for now outlawed.
diff --git a/rt/html/Elements/EditCustomFieldWikitext b/rt/html/Elements/EditCustomFieldWikitext
index 1aac328..b7569b0 100644
--- a/rt/html/Elements/EditCustomFieldWikitext
+++ b/rt/html/Elements/EditCustomFieldWikitext
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -44,10 +46,10 @@
%#
%# END BPS TAGGED BLOCK }}}
% while ($Values and my $value = $Values->Next ) {
-<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><% $value->Content %></textarea><br>
+<textarea cols="<%$Cols%>" rows="<%$Rows%>" name="<%$NamePrefix%><%$CustomField->Id%>-Values"><% $value->Content %></textarea><br />
% }
% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) {
-<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><% $Default %></textarea>
+<textarea cols="<%$Cols%>" rows="<%$Rows%>" name="<%$NamePrefix%><%$CustomField->Id%>-Values"><% $Default %></textarea>
% }
<%INIT>
# XXX - MultiValue textarea is for now outlawed.
diff --git a/rt/html/Elements/EditLinks b/rt/html/Elements/EditLinks
index 68c08dd..32c75a5 100755
--- a/rt/html/Elements/EditLinks
+++ b/rt/html/Elements/EditLinks
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,9 +45,9 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<TABLE width=100%>
- <TR>
- <TD VALIGN=TOP WIDTH=50%>
+<table width="100%">
+ <tr>
+ <td valign="top" width="50%">
<h3><&|/l&>Current Links</&></h3>
<table>
@@ -57,8 +59,8 @@
<td class="labeltop"><&|/l&>Depends on</&>:</td>
<td class="value">
% while (my $link = $Object->DependsOn->Next) {
- <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1">
- <& ShowLink, URI => $link->TargetURI &><br>
+ <input type="checkbox" class="checkbox" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" />
+ <& ShowLink, URI => $link->TargetURI &><br />
% }
</td>
</tr>
@@ -67,8 +69,8 @@
<td class="value">
% while (my $link = $Object->DependedOnBy->Next) {
% my $member = $link->BaseObj;
- <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1">
- <& ShowLink, URI => $link->BaseURI &><br>
+ <input type="checkbox" class="checkbox" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" />
+ <& ShowLink, URI => $link->BaseURI &><br />
% }
</td>
</tr>
@@ -76,8 +78,8 @@
<td class="labeltop"><&|/l&>Parents</&>:</td>
<td class="value">
% while (my $link = $Object->MemberOf->Next) {
- <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1">
- <& ShowLink, URI => $link->TargetURI &><br>
+ <input type="checkbox" class="checkbox" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" />
+ <& ShowLink, URI => $link->TargetURI &><br />
% }
</td>
</tr>
@@ -85,8 +87,8 @@
<td class="labeltop"><&|/l&>Children</&>:</td>
<td class="value">
% while (my $link = $Object->Members->Next) {
- <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1">
- <& ShowLink, URI => $link->BaseURI &><br>
+ <input type="checkbox" class="checkbox" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" />
+ <& ShowLink, URI => $link->BaseURI &><br />
% }
</td>
</tr>
@@ -94,8 +96,8 @@
<td class="labeltop"><&|/l&>Refers to</&>:</td>
<td class="value">
% while (my $link = $Object->RefersTo->Next) {
- <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1">
- <& ShowLink, URI => $link->TargetURI &><br>
+ <input type="checkbox" class="checkbox" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" />
+ <& ShowLink, URI => $link->TargetURI &><br />
%}
</td>
</tr>
@@ -103,61 +105,63 @@
<td class="labeltop"><&|/l&>Referred to by</&>:</td>
<td class="value">
% while (my $link = $Object->ReferredToBy->Next) {
- <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1">
- <& ShowLink, URI => $link->BaseURI &><br>
+% # Skip reminders
+% next if (UNIVERSAL::isa($link->BaseObj, 'RT::Ticket') && $link->BaseObj->Type eq 'reminder');
+ <input type="checkbox" class="checkbox" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" />
+ <& ShowLink, URI => $link->BaseURI &><br />
% }
</td>
</tr>
</table>
-</TD>
-<TD VALIGN=TOP>
+</td>
+<td valign="top">
<h3><&|/l&>New Links</&></h3>
% if (ref($Object) eq 'RT::Ticket') {
<i><&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces.</&>
<& /Elements/Callback, _CallbackName => 'ExtraLinkInstructions' &>
-</i><br>
+</i><br />
% } elsif (ref($Object) eq 'RT::Queue') {
<i><&|/l&>Enter queues or URIs to link queues to. Separate multiple entries with spaces.</&>
-</i><br>
+</i><br />
% } else {
-<i><&|/l&>Enter objects or URIs to link objects to. Separate multiple entries with spaces.</&></i><br>
+<i><&|/l&>Enter objects or URIs to link objects to. Separate multiple entries with spaces.</&></i><br />
% }
-<TABLE>
+<table>
% if ($Merge) {
- <TR>
- <TD class="label"><&|/l&>Merge into</&>:</TD>
- <TD class="entry"><input name="<%$id%>-MergeInto"> <i><&|/l&>(only one ticket)</&></i></TD>
- </TR>
+ <tr>
+ <td class="label"><&|/l&>Merge into</&>:</td>
+ <td class="entry"><input name="<%$id%>-MergeInto" /> <i><&|/l&>(only one ticket)</&></i></td>
+ </tr>
% }
- <TR>
- <TD class="label"><&|/l&>Depends on</&>:</TD>
- <TD class="entry"><input name="<%$id%>-DependsOn"></TD>
- </TR>
- <TR>
- <TD class="label"><&|/l&>Depended on by</&>:</TD>
- <TD class="entry"><input name="DependsOn-<%$id%>"></TD>
- </TR>
- <TR>
- <TD class="label"><&|/l&>Parents</&>:</TD>
- <TD class="entry"><input name="<%$id%>-MemberOf"></TD>
- </TR>
- <TR>
- <TD class="label"><&|/l&>Children</&>:</TD>
- <TD class="entry"> <input name="MemberOf-<%$id%>"></TD>
- </TR>
- <TR>
- <TD class="label"><&|/l&>Refers to</&>:</TD>
- <TD class="entry"><input name="<%$id%>-RefersTo"></TD>
- </TR>
- <TR>
- <TD class="label"><&|/l&>Referred to by</&>:</TD>
- <TD class="entry"> <input name="RefersTo-<%$id%>"></TD>
- </TR>
-</TABLE>
-</TD>
-</TR>
-</TABLE>
+ <tr>
+ <td class="label"><&|/l&>Depends on</&>:</td>
+ <td class="entry"><input name="<%$id%>-DependsOn" /></td>
+ </tr>
+ <tr>
+ <td class="label"><&|/l&>Depended on by</&>:</td>
+ <td class="entry"><input name="DependsOn-<%$id%>" /></td>
+ </tr>
+ <tr>
+ <td class="label"><&|/l&>Parents</&>:</td>
+ <td class="entry"><input name="<%$id%>-MemberOf" /></td>
+ </tr>
+ <tr>
+ <td class="label"><&|/l&>Children</&>:</td>
+ <td class="entry"> <input name="MemberOf-<%$id%>" /></td>
+ </tr>
+ <tr>
+ <td class="label"><&|/l&>Refers to</&>:</td>
+ <td class="entry"><input name="<%$id%>-RefersTo" /></td>
+ </tr>
+ <tr>
+ <td class="label"><&|/l&>Referred to by</&>:</td>
+ <td class="entry"> <input name="RefersTo-<%$id%>" /></td>
+ </tr>
+</table>
+</td>
+</tr>
+</table>
<%INIT>
my $id;
diff --git a/rt/html/Elements/Error b/rt/html/Elements/Error
index bc5a188..3693274 100644
--- a/rt/html/Elements/Error
+++ b/rt/html/Elements/Error
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -44,15 +46,13 @@
%#
%# END BPS TAGGED BLOCK }}}
<& /Elements/Callback, %ARGS, error => $error &>
-<& /Elements/Header, Code => $Code, Why => $Why &>
-<& /Elements/Tabs &>
-<& /Elements/TitleBoxStart, class=> "error", title => $Title &>
+<& /Elements/Header, Code => $Code, Why => $Why, Title => $Title &>
+<& /Elements/Tabs, Title => $Title &>
+<div class="error">
<%$Why%>
-<br>
-<font size=-1>
+<br />
<%$Details%>
-</font>
-<& /Elements/TitleBoxEnd &>
+</div>
<%cleanup>
$m->comp('/Elements/Footer');
@@ -61,7 +61,7 @@ $m->abort();
<%args>
$Code => undef
-$Details => undef
+$Details =>''
$Title => loc("RT Error")
$Why => loc("the calling component did not specify why")
</%args>
@@ -77,7 +77,7 @@ if ($] >= 5.007001) {
$RT::Logger->error($error);
-if ( $session{'SessionType'} eq 'REST' ) {
+if ( defined ($session{'SessionType'}) && $session{'SessionType'} eq 'REST' ) {
$r->content_type('text/plain');
$m->out( "Error: " . $Why . "\n" );
$m->out( $Details . "\n" );
diff --git a/rt/html/Elements/Footer b/rt/html/Elements/Footer
index 4c90acf..16f13f9 100644
--- a/rt/html/Elements/Footer
+++ b/rt/html/Elements/Footer
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,19 +45,26 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-% if ($Menu) {
-</td>
-</tr>
-<tr>
-<td>
-% }
+%# End of div#body from /Elements/PageLayout
+</div>
<& /Elements/Callback, %ARGS &>
-<div class="bpscredits">
-<&|/l, '&#187;&#124;&#171;', $RT::VERSION, '2005', '<a href="http://www.bestpractical.com?rt='.$RT::VERSION.'">Best Practical Solutions, LLC</a>', &>[_1] RT [_2] Copyright 1996-[_3] [_4].</&><br>
+<div id="footer">
+ <p id="time">
+ <span><&|/l&>Time to display</&>: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%></span>
+ </p>
+
+ <p id="bpscredits">
+ <span>
+<&|/l, '&#187;&#124;&#171;', $RT::VERSION, '2006', '<a href="http://www.bestpractical.com?rt='.$RT::VERSION.'">Best Practical Solutions, LLC</a>', &>[_1] RT [_2] Copyright 1996-[_3] [_4].</&>
+</span>
+</p>
% if (!$Menu) {
-<&|/l&>Distributed under version 2 <a href="http://www.gnu.org/copyleft/gpl.html"> of the GNU GPL.</a></&><br>
-<&|/l, '<a href="mailto:sales@bestpractical.com">sales@bestpractical.com</a>' &>To inquire about support, training, custom development or licensing, please contact [_1].</&><br>
+ <p id="legal">
+<&|/l&>Distributed under version 2 <a href="http://www.gnu.org/copyleft/gpl.html"> of the GNU GPL.</a></&><br />
+<&|/l, '<a href="mailto:sales@bestpractical.com">sales@bestpractical.com</a>' &>To inquire about support, training, custom development or licensing, please contact [_1].</&><br />
+ </p>
% }
+
</div>
% if ($Debug >= 2 ) {
% require Data::Dumper;
@@ -64,17 +73,9 @@
<%$d->Dump() %>
</pre>
% }
-<div class="page-stats"><&|/l&>Time to display</&>: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%></div>
-% if ($Menu) {
-</TD>
-</TR>
-</TABLE>
-</TD>
-</TR>
-</TABLE>
-% }
-</BODY>
-</HTML>
+
+ </body>
+</html>
% $m->abort();
<%ARGS>
diff --git a/rt/html/Elements/GotoTicket b/rt/html/Elements/GotoTicket
index 869d57e..ad6ad1b 100644
--- a/rt/html/Elements/GotoTicket
+++ b/rt/html/Elements/GotoTicket
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,4 +45,4 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<FORM ACTION="<%$RT::WebPath%>/Ticket/Display.html"><input type=submit value="<&|/l&>Goto ticket</&>">&nbsp;<input size=5 name=id accesskey="0"></FORM>
+<form action="<%$RT::WebPath%>/Ticket/Display.html"><input type="submit" class="button" value="<&|/l&>Goto ticket</&>" />&nbsp;<input size="5" name="id" accesskey="0" /></form>
diff --git a/rt/html/Elements/Header b/rt/html/Elements/Header
index f5a616e..ed7c133 100644
--- a/rt/html/Elements/Header
+++ b/rt/html/Elements/Header
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,78 +45,89 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-%#<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<HTML>
-<HEAD>
-<TITLE><%$Title%></TITLE>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
+
+<title><%$Title%></title>
+
% if ($Refresh && $Refresh > 0) {
-<META HTTP-EQUIV="REFRESH" CONTENT="<%$Refresh%>">
+ <meta http-equiv="refresh" content="<%$Refresh%>" />
% }
<link rel="shortcut icon" href="<%$RT::WebImagesURL%>/favicon.png" type="image/png" />
-<link media="all" rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/webrt.css" type="text/css" />
-<link media="print" rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/printrt.css" type="text/css" />
+<link rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/css/<% $RT::WebDefaultStylesheet %>/main.css" type="text/css" media="all" />
+<link rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/css/print.css" type="text/css" media="print" />
-<script>
-function hideshow(num) {
- idstring = "element-" + num;
- chunk = document.getElementById(idstring);
- if ( chunk.style.display == "none") {
- chunk.style.display = chunk.style.tag;
- } else {
- chunk.style.tag = chunk.style.display;
- chunk.style.display = "none";
- }
-}
-</script>
-<& /Elements/Callback, _CallbackName => 'Head', %ARGS &>
-</HEAD>
-<BODY BGCOLOR="<%$BgColor%>"
-% if ($Focus) {
-ONLOAD="
- var tmp = (document.getElementsByName('<% $Focus %>'));
- if (tmp.length > 0) tmp[tmp.length-1].focus();
-"
+% if ( $RSSAutoDiscovery ) {
+ <link rel="alternate" href="<%$RSSAutoDiscovery%>" type="application/rss+xml" title="RSS RT Search" />
% }
->
-<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
- <tr>
- <td colspan=2><a href="http://bestpractical.com"><img src="<%$RT::WebImagesURL%>/bplogo.gif" alt="<%loc("Best Practical Solutions, LLC corporate logo")%>" width="230" height="50"></a></td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td width="50%" align="right">
-% if ($session{'CurrentUser'} && $session{'CurrentUser'}->Id && $LoggedIn) {
-<SPAN STYLE="display: none"><A HREF="#skipnav"><&|/l&>Skip Menu</&></A> |</SPAN>
-%if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => $RT::System )) {
-<A HREF="<%$RT::WebPath%><% $Prefs %>" ><&|/l&>Preferences</&></A>
+
+<script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/util.js"></script>
+<script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/ahah.js"></script>
+<script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/titlebox-state.js"></script>
+<script type="text/javascript"><!--
+ onLoadHook("loadTitleBoxStates()");
+% if ( $Focus ) {
+ onLoadHook("focusElementById('<% $Focus %>')");
% }
-<& /Elements/Callback, %ARGS &>
-% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) {
-| <A HREF="<%$RT::WebPath%>/NoAuth/Logout.html<%$URL ? "?URL=".$URL : ''%>"><&|/l&>Logout</&></a>
+% if ( $onload ) {
+ onLoadHook("<% $onload |n %>");
% }
-<BR>
-<&|/l, "<b>".$session{'CurrentUser'}->Name."</b>" &>Logged in as [_1]</&>
+--></script>
+
+<& /Elements/Callback, _CallbackName => 'Head', %ARGS &>
+
+</head>
+ <body<% $id && qq[ id="comp-$id"] |n %>>
+
+% if ($ShowBar) {
+<& /Elements/Logo &>
+
+<div id="quickbar">
+ <div id="quick-personal">
+ <span class="hide"><a href="#skipnav"><&|/l&>Skip Menu</&></a> | </span>
+% if ($session{'CurrentUser'}->Name) {
+ <&|/l, "<span>".$session{'CurrentUser'}->Name."</span>" &>Logged in as [_1]</&>
+% if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => $RT::System )) {
+ | <a href="<%$RT::WebPath%><%$Prefs%>"><&|/l&>Preferences</&></a>
+% }
% } else {
-<&|/l&>Not logged in.</&>
+ <&|/l&>Not logged in.</&>
+% }
+ <& /Elements/Callback, %ARGS &>
+% unless (!$session{'CurrentUser'}->Name
+% or ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth)) {
+ | <a href="<%$RT::WebPath%>/NoAuth/Logout.html<%$URL ? "?URL=".$URL : ''%>"><&|/l&>Logout</&></a>
+% }
+ </div>
% }
- </td>
- </tr>
-</table>
-<%INIT>
+<%INIT>
$r->headers_out->{'Pragma'} = 'no-cache';
$r->headers_out->{'Cache-control'} = 'no-cache';
+
+my $id = $m->request_comp->path;
+$id =~ s|^/||g;
+$id =~ s|/|-|g;
+$id =~ s|\.html$||g;
+$id =~ s|index$||g
+ if $id ne 'index';
+$id =~ s|-$||g;
</%INIT>
<%ARGS>
$Prefs => '/User/Prefs.html'
-$Focus => 'focus'
+#$Focus => 'focus'
+$Focus => ''
$Title => 'RT'
$Code => undef
$Refresh => 0
$Why => undef
-$BgColor => '#ffffff'
$ShowBar => 1
-$LoggedIn => 1
$URL => undef
+$RSSAutoDiscovery => undef
+$onload => undef
</%ARGS>
diff --git a/rt/html/Elements/ListActions b/rt/html/Elements/ListActions
index 8433d17..24f923a 100644
--- a/rt/html/Elements/ListActions
+++ b/rt/html/Elements/ListActions
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,22 +45,20 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-% if ($actions[0] ) {
-<& /Elements/TitleBoxStart, title => loc('Results') &>
-<UL>
+<&| /Widgets/TitleBox, title => loc('Results') &>
+ <ul class="action-results">
% foreach my $action (@actions) {
-% next unless ($action);
-% my $skip = 0;
-% $m->comp('/Elements/Callback', _CallbackName => 'ModifyRow', row => \$action, skip => \$skip, %ARGS);
-% next if $skip;
-<LI><%$action%></LI>
-% }
-</UL>
-<& /Elements/TitleBoxEnd &>
-<BR>
+% next unless $action;
+% my $skip = 0;
+% $m->comp('/Elements/Callback', _CallbackName => 'ModifyRow', row => \$action, skip => \$skip, %ARGS);
+% next if $skip;
+ <li><%$action%></li>
% }
+ </ul>
+</&>
<%init>
-@actions = grep (/./,@actions);
+@actions = grep $_, @actions;
+return unless @actions;
</%init>
<%ARGS>
@actions => undef
diff --git a/rt/html/Elements/Login b/rt/html/Elements/Login
index 1d4bfd5..cd39b87 100644
--- a/rt/html/Elements/Login
+++ b/rt/html/Elements/Login
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -51,36 +53,58 @@ if ($m->request_comp->path =~ '^/REST/\d+\.\d+/') {
$m->out("\n$Error\n") if $Error;
$m->abort;
}
+
+my $req_uri;
+
+if (UNIVERSAL::can($r, 'uri') and $r->uri =~ m{.*/(.*)}) {
+ $req_uri = $1;
+}
+
+my $form_action = defined $goto ? $goto
+ : defined $req_uri ? $req_uri
+ : $RT::WebPath
+ ;
</%INIT>
<& /Elements/Callback, %ARGS, _CallbackName => 'Header' &>
<& /Elements/Header, Title => loc('Login'), Focus => 'user' &>
-<DIV ALIGN=CENTER>
+%# End of div#quickbar from /Elements/Header
+</div>
+
+<div id="body" class="login-body">
+
% if ($Error) {
-<& /Elements/TitleBoxStart, title => loc('Error') &>
+<&| "/Widgets/TitleBox", title => loc('Error'), hideable => 0 &>
<% $Error %>
-<& /Elements/TitleBoxEnd &>
+</&>
% }
-<BR>
-<& /Elements/TitleBoxStart, width=> "40%", titleright => loc("RT [_1]", $RT::VERSION), title => loc('Login') ,
-contentbg=>"#cccccc" &>
+
+<& /Elements/Callback, %ARGS, _CallbackName => 'BeforeForm' &>
+
+<div id="login-box">
+<&| /Widgets/TitleBox, title => loc('Login'), titleright => $RT::VERSION, hideable => 0 &>
% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) {
-<FORM id="login" name="login" METHOD=POST ACTION="<% (UNIVERSAL::can($r, 'uri') && ($r->uri) =~ m!.*/(.*)!) %>" >
-<TABLE BORDER=0 WIDTH=100%>
-<TR ALIGN=RIGHT>
-<TD ALIGN=RIGHT><&|/l&>Username</&>:</TD><TD ALIGN=LEFT><input name=user value="<%$user%>"></TD></TR>
-<TR><TD ALIGN=RIGHT><&|/l&>Password</&>:</TD><TD ALIGN=LEFT><input type=password name=pass></TD></TR>
-<TR><TD colspan=2 align=right>
-<input type=submit Value="<&|/l&>Login</&>">
-</TD></TR>
-</TABLE>
+<form id="login" name="login" method="post" action="<% $form_action %>">
+
+<div class="input-row">
+ <span class="label"><&|/l&>Username</&>:</span>
+ <span class="input"><input name="user" value="<%$user%>" id="user" /></span>
+</div>
+
+<div class="input-row">
+ <span class="label"><&|/l&>Password</&>:</span>
+ <span class="input"><input type="password" name="pass" /></span>
+</div>
+
+<div class="button-row">
+ <span class="input"><input type="submit" class="button" value="<&|/l&>Login</&>" /></span>
+</div>
%# Give callbacks a chance to add more control elements
<& /Elements/Callback, %ARGS &>
-<&/Elements/TitleBoxEnd&>
% # From mason 1.0.1 forward, this doesn't work. in fact, it breaks things.
% # But on Mason 1.15 it's fixed again, so we still use it.
% # The code below iterates through everything in the passed in arguments
@@ -92,27 +116,19 @@ contentbg=>"#cccccc" &>
% if (($key ne 'user') and ($key ne 'pass')) {
% if (ref($ARGS{$key}) =~ /ARRAY/) {
% foreach $val (@{$ARGS{$key}}) {
-<input type=hidden name="<%$key %>" value="<% $val %>">
+<input type="hidden" class="hidden" name="<%$key %>" value="<% $val %>" />
% }
% }
% else {
-<input type="hidden" name="<% $key %>" value="<% $ARGS{$key} %>">
+<input type="hidden" class="hidden" name="<% $key %>" value="<% $ARGS{$key} %>" />
% }
% }
% }
-</FORM>
+</form>
% }
-</DIV>
-
-<BR>
-<!-- TODO: not yet implemented
-If you've forgotten your username or password, RT can <A
-href="/NoAuth/Reminder.html">send you a reminder</a>.
--->
-<BR>
-<BR>
-<BR>
-<HR>
+</&>
+</div><!-- #login-box -->
+<& /Elements/Callback, %ARGS, _CallbackName => 'AfterForm' &>
<& /Elements/Footer, Menu => 0 &>
<%ARGS>
$user => ""
diff --git a/rt/html/Elements/Logo b/rt/html/Elements/Logo
new file mode 100644
index 0000000..157f7be
--- /dev/null
+++ b/rt/html/Elements/Logo
@@ -0,0 +1,56 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
+%# <jesse@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/copyleft/gpl.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 }}}
+ <div id="logo">
+ <a href="http://bestpractical.com"><img src="<%$RT::WebImagesURL%>/bplogo.gif" alt="<%loc("Best Practical Solutions, LLC corporate logo")%>" width="177" height="33" /></a>
+% if ($show_name) {
+ <div class="rtname"><% loc("RT for [_1]", $RT::rtname) %></div>
+% }
+ </div>
+<%args>
+ $show_name => 1
+</%args>
diff --git a/rt/html/Elements/Menu b/rt/html/Elements/Menu
index 398e3ab..b5b2bda 100644
--- a/rt/html/Elements/Menu
+++ b/rt/html/Elements/Menu
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,66 +45,90 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-%# font size depends on level
-% if ($level ge 3) {
-% $size = $basesize-(6);
-% } elsif ($level gt 0) {
-% $size = $basesize-($level * 2);
-% $padding = 2;
-% }
-% else {
-% $size = $basesize;
-% $padding = 5;
-% }
-<ul class="topnav" >
-% my $sep=0;
-% my $accesskey="1";
+<ul<% !$level ? ' id="system-menu"' : ''|n %><% $menu_class ? qq[ class="$menu_class"] : ''|n %>>
+<div<% $menu_class ? qq[ class="$menu_class"] : ''|n %>><div class="wrapper">
+% my $sep = 0;
+% my $postsep = 0;
+% my $accesskey = 1;
+%
+% $count = 0;
+% $class = {};
+%
% foreach $tab (sort keys %{$toptabs}) {
-% my $current = $current_toptab || "";
-% my $path = $toptabs->{$tab}->{'path'} || "";
-% $path =~ s#/index.html$##gi;
-% $current =~ s#/index.html$##gi;
-% if ( $path eq $current) {
-% $class="currenttopnav"
-% } else {
-% $class="topnav"
-% }
-% my $style="";
-% if ($sep) {
-% $style="minor";
-% } elsif ($level == 0 ) {
-% $style="major";
-% }
-% if ($toptabs->{$tab}->{'separator'}) {
-% $sep=1;
-% } else {
-% $sep=0;
-% }
-% my $url = $toptabs->{$tab}->{'path'} =~ /^https?:/i ? $toptabs->{$tab}->{'path'} : $RT::WebPath . "/" . $toptabs->{$tab}->{'path'};
-<li class="<%$class%>-<%$level%>-<%$style%>"><A HREF="<% $url %>" class="<%$class%>-<%$level%>"
-<%($class eq 'currenttopnav') ? "name='focus'" : ""|n %>
-<% !$level && "accesskey='".$accesskey++."'" |n%>><% $toptabs->{$tab}->{'title'}%></A>
+% $count++;
+%
+% my $current = $current_toptab || "";
+% my $path = $toptabs->{$tab}->{'path'} || "";
+%
+% $path =~ s#/index.html$##gi;
+% $current =~ s#/index.html$##gi;
+%
+% $sep = $toptabs->{$tab}->{'separator'} ? 1 : 0;
+%
+% my @aclass;
+% push @aclass, 'selected'
+% if $path eq $current;
+%
+% push @aclass, 'odd'
+% if $level % 2;
+%
+% $class->{a} = join ' ', @aclass;
+%
+% my @li;
+% push @li, 'first'
+% if $count == 1;
+%
+% push @li, 'pre-separator'
+% if $sep;
+%
+% push @li, 'post-separator'
+% if $postsep;
+%
+% $class->{li} = join ' ', @li;
+%
+% my $url = ($toptabs->{$tab}->{'path'}||'') =~ /^https?:/i
+% ? $toptabs->{$tab}->{'path'} || ''
+% : $RT::WebPath . "/" . $toptabs->{$tab}->{'path'};
+%
+ <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>>
+ <% $count > 1 && !$postsep && qq[<span class="bullet">&#183; </span>]|n%>
+ <a href="<% $url %>"
+ <% $class->{a} && qq[ class="$class->{a}"] |n%>
+ <% !$level && " accesskey='".$accesskey++."'" |n%>>
+ <% $toptabs->{$tab}->{'title'} || ''%></a>
%# Second-level items
-%# if ($current_toptab eq $toptabs->{$tab}->{'path'}) {
-%# commented out by jesse on 4 jan 2003 so that tickets/search and ticket/# can
-%# both have menu items
-% if ($toptabs->{$tab}->{'subtabs'}) {
- <& /Elements/Menu, level => $level+1,
- current_toptab => $toptabs->{$tab}->{'current_subtab'},
- toptabs => $toptabs->{$tab}->{'subtabs'} &></li>
-% }
-%# }
+% if ($toptabs->{$tab}->{'subtabs'}
+% and keys %{$toptabs->{$tab}->{'subtabs'}})
+% {
+ <& /Elements/Menu, level => $level+1,
+ current_toptab => $toptabs->{$tab}->{'current_subtab'},
+ toptabs => $toptabs->{$tab}->{'subtabs'},
+ last_level => $toptabs->{$tab}->{last_system_menu_level} &>
+% }
+ </li>
+% if ($sep) {
+ <li class="separator">&#183;&#183;&#183;</li>
+% }
+%
+% $postsep = $sep;
% }
+</div></div>
</ul>
<%INIT>
-my ($tab, $subtab, $class, $size, $padding);
-my $basesize=16;
+my ($tab, $class, $count);
+my @ul;
+push @ul, 'last-menu-level'
+ if $last_level;
+push @ul, 'odd'
+ if $level % 2;
+my $menu_class = join ' ', @ul;
</%INIT>
<%ARGS>
$current_toptab => ""
$toptabs => undef
$level => 0
+$last_level => 0
</%ARGS>
diff --git a/rt/html/Elements/MessageBox b/rt/html/Elements/MessageBox
index dd48bec..0149e1b 100644
--- a/rt/html/Elements/MessageBox
+++ b/rt/html/Elements/MessageBox
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,10 +45,10 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<textarea class="messagebox" COLS=<%$Width%> ROWS=<%$Height%> WRAP=<%$Wrap%> NAME="<%$Name%>"><& /Elements/Callback, %ARGS &><% $Default %><%$message%><%$IncludeSignature ? $signature : ''%></textarea>
+<textarea class="messagebox" cols="<%$Width%>" rows="<%$Height%>" wrap="<%$Wrap%>" name="<%$Name%>"><& /Elements/Callback, %ARGS &><% $Default %><%$message%><%$IncludeSignature ? $signature : ''%></textarea>
<%INIT>
-my ($message);
+my $message = '';
if ($QuoteTransaction) {
my $transaction=RT::Transaction->new($session{'CurrentUser'});
diff --git a/rt/html/Elements/MyAdminQueues b/rt/html/Elements/MyAdminQueues
new file mode 100644
index 0000000..7e720ad
--- /dev/null
+++ b/rt/html/Elements/MyAdminQueues
@@ -0,0 +1,54 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
+%# <jesse@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/copyleft/gpl.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 }}}
+<&|/Widgets/TitleBox, title => loc("Queues I administer"), bodyclass => "" &>
+<& /Elements/QueueSummary,
+ cache => 'my_admin_queues',
+ queue_filter => sub { $_->CurrentUserHasRight('AdminQueue') },
+ conditions => [ {cond => "Status = 'new'", name => loc ('new') },
+ {cond => "Status = 'open'", name => loc ('open') }] &>
+</&>
diff --git a/rt/html/Elements/MyRT b/rt/html/Elements/MyRT
new file mode 100644
index 0000000..be487a4
--- /dev/null
+++ b/rt/html/Elements/MyRT
@@ -0,0 +1,100 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
+%# <jesse@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/copyleft/gpl.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 border="0" width="100%">
+<tr valign="top">
+
+<td class="boxcontainer" width="70%" <% $summary? 'width="70%"': '' %>>
+% $show_cb->($_) foreach @$body;
+</td>
+
+% if ( $summary ) {
+<td class="boxcontainer">
+% $show_cb->($_) foreach @$summary;
+</td>
+% }
+
+</tr>
+</table>
+
+<%INIT>
+
+my $user = $session{'CurrentUser'}->UserObj;
+unless (exists $session{'my_rt_portlets'}) {
+ my ($default_portlets) = RT::System->new($session{'CurrentUser'})->Attributes->Named('HomepageSettings');
+ $session{'my_rt_portlets'} = $user->Preferences(
+ HomepageSettings => $default_portlets? $default_portlets->Content: {},
+ );
+}
+
+my ($body, $summary) = @{$session{'my_rt_portlets'}}{qw(body summary)};
+unless( $body && @$body ) {
+ $body = $summary || [];
+ $summary = undef;
+}
+$summary = undef unless $summary && @$summary;
+
+my $Rows = $user->Preferences( 'SummaryRows', ( $RT::DefaultSummaryRows || 10 ) );
+
+my $show_cb = sub {
+ my $entry = shift;
+ my $type = $entry->{type};
+ if ( $type eq 'component' ) {
+ my $name = $entry->{name};
+
+ # security check etc.
+ $m->comp( $name, %{ $entry->{arguments} || {} } );
+ } elsif ( $type eq 'system' ) {
+ $m->comp( '/Elements/ShowSearch', Name => $entry->{name}, Override => { Rows => $Rows } );
+ } elsif ( $type eq 'saved' ) {
+ $m->comp( '/Elements/ShowSearch', SavedSearch => $entry->{name}, Override => { Rows => $Rows } );
+ } else {
+ $RT::Logger->error("unknown portlet type $type");
+ }
+};
+
+</%INIT>
diff --git a/rt/html/Elements/MyReminders b/rt/html/Elements/MyReminders
new file mode 100755
index 0000000..1e962bd
--- /dev/null
+++ b/rt/html/Elements/MyReminders
@@ -0,0 +1,73 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
+%# <jesse@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/copyleft/gpl.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 }}}
+%# DEPRECATED
+<&|/Widgets/TitleBox,
+ title => loc("Reminders") &>
+<table width="100%">
+% my $i =0;
+% while (my $reminder = $reminders->Next) {
+% $i++;
+% if ($reminder->RefersTo->First) {
+% my $ticket= $reminder->RefersTo->First->TargetObj;
+<tr class="<%$i%2 ? 'evenline' : 'oddline'%>"><td><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$ticket->id%>"><%$reminder->Subject%></a><br />
+<blockquote>
+#<%$ticket->id%>: <%$ticket->Subject%><br />
+<%$reminder->OwnerObj->Name %> <%$reminder->DueObj->Unix >0 ? '&bull; '.$reminder->DueObj->AgeAsString : '' |n %>
+</blockquote>
+</td>
+</tr>
+% }}
+</table>
+</&>
+
+<%init>
+my $reminders = RT::Tickets->new($session{'CurrentUser'});
+$reminders->FromSQL('(Owner = "Nobody" OR Owner = "'.$session{'CurrentUser'}->Name.'")' .
+ ' AND Type = "reminder" AND (Status = "new" OR Status = "open") AND Due > "1970-01-01"');
+$reminders->OrderBy(FIELD => 'Due', ORDER => 'DESC');
+</%init>
diff --git a/rt/html/Elements/MyRequests b/rt/html/Elements/MyRequests
index 172b4a4..fc1e270 100644
--- a/rt/html/Elements/MyRequests
+++ b/rt/html/Elements/MyRequests
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,28 +45,5 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<&|/Elements/TitleBox,
- title => loc("[_1] newest unowned tickets", $rows),
- title_href => "Search/Results.html".$QueryString &>
-<& /Elements/TicketList,
- Format => "'<a href=\"$RT::WebPath/Ticket/Display.html?id=__id__\">__id__</a>/TITLE:#', '<a href=\"$RT::WebPath/Ticket/Display.html?id=__id__\">__Subject__</a>/TITLE:Subject', QueueName, ExtendedStatus, CreatedRelative, '<A HREF=\"$RT::WebPath/Ticket/Display.html?Action=Take&id=__id__\">".loc('Take')."</a>/TITLE:&nbsp;' ",
- Query => $Query,
- OrderBy => 'Created',
- Order => 'DESC',
- ShowNavigation => 0,
- Rows => $rows
-
- &>
-</&>
-<%init>
-my $rows = $RT::MyRequestsLength;
-
-my $Query = "Owner = 'Nobody' AND ( Status = 'new' OR Status = 'open')";
-
-my $QueryString = "";
-$QueryString = '?' . $m->comp('/Elements/QueryString',
- Query => $Query,
- Order => 'DESC',
- OrderBy => 'Priority') if ($Query);
-
-</%init>
+%# DEPRECATED
+<& /Elements/ShowSearch, Name => 'My Requests' &>
diff --git a/rt/html/Elements/MySupportQueues b/rt/html/Elements/MySupportQueues
new file mode 100644
index 0000000..f9e18a0
--- /dev/null
+++ b/rt/html/Elements/MySupportQueues
@@ -0,0 +1,54 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
+%# <jesse@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/copyleft/gpl.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 }}}
+<&|/Widgets/TitleBox, title => loc("Queues I'm an AdminCc for"), bodyclass => "" &>
+<& /Elements/QueueSummary,
+ cache => 'my_support_queues',
+ queue_filter => sub { $_->IsAdminCc($session{'CurrentUser'}->Id) },
+ conditions => [ {cond => "Status = 'new'", name => loc ('new') },
+ {cond => "Status = 'open'", name => loc ('open') }] &>
+</&>
diff --git a/rt/html/Elements/MyTickets b/rt/html/Elements/MyTickets
index cf5225a..8d657db 100644
--- a/rt/html/Elements/MyTickets
+++ b/rt/html/Elements/MyTickets
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,29 +45,5 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<&|/Elements/TitleBox,
- title => loc('[_1] highest priority tickets I own', $rows),
- title_href => "Search/Results.html".$QueryString &>
-<& /Elements/TicketList,
- Format => "'<a href=\"$RT::WebPath/Ticket/Display.html?id=__id__\">__id__</a>/TITLE:#', '<a href=\"$RT::WebPath/Ticket/Display.html?id=__id__\">__Subject__</a>/TITLE:Subject', Priority, QueueName, ExtendedStatus",
-
- Query => $Query,
- OrderBy => 'Priority',
- Order => 'DESC',
- Rows => $rows,
- ShowNavigation => 0
- &>
-</&>
-<%init>
-my $rows = $RT::MyTicketsLength;
-
-my $Query = " Owner = '".$session{'CurrentUser'}->Id."' AND ( Status = 'new' OR Status = 'open')";
-
-my $QueryString = "";
-$QueryString = '?' . $m->comp('/Elements/QueryString',
- Query => $Query,
- Order => 'DESC',
- OrderBy => 'Priority') if ($Query);
-
-</%init>
-
+%# DEPRECATED
+<& /Elements/ShowSearch, Name => 'My Tickets' &>
diff --git a/rt/html/Elements/PageLayout b/rt/html/Elements/PageLayout
index 3d7241d..493f227 100644
--- a/rt/html/Elements/PageLayout
+++ b/rt/html/Elements/PageLayout
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,60 +45,124 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<table class="darkblue" border=0 cellspacing=0 cellpadding=0 width="100%">
- <th class="titlebox" align="left"><span class="rtname"><%$AppName%></span>
- </th>
- <span class="topactions">
-% foreach my $action (sort keys %{$topactions}) {
- <td class="darkblueright">
- <%$topactions->{"$action"}->{'html'} |n %>
- </td>
+ <div id="topactions">
+% foreach my $action (reverse sort keys %{$topactions}) {
+ <span class="topaction">
+% $m->out($topactions->{"$action"}->{'html'});
+ </span>
% }
- </span>
-</table>
-<table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%">
-%# Vertical menu
-<TR height="100%">
-<TD valign="top" width="140" class="blue">
- <& /Elements/Menu, toptabs => $toptabs, current_toptab => $current_toptab &>
-</TD>
-<td valign="top">
-<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
-<tr>
- <td class="blue" valign="top">
- <span class="title"><%$title%></span>
-</td>
-</tr>
-<tr>
-<td class="blueright" valign="top">
- <span class="nav">
-% if ($actions) {
-% my @actions;
-% foreach my $action (sort keys %{$actions}) {
-% if ($actions->{"$action"}->{'html'}) {
-% push @actions, $actions->{"$action"}->{'html'};
+ </div>
+
+%# End of div#quickbar from /Elements/Header
+</div>
+
+<div id="nav">
+<& /Elements/Menu, toptabs => $toptabs, current_toptab => $current_toptab &>
+</div>
+
+<div id="header">
+ <h1><%$title%></h1>
+
+% my $sep = 0;
+% my $postsep = 0;
+% my $count = 0;
+% my $class = { };
+%
+ <ul id="page-menu"<% (($actions && %$actions) || ($subactions && %$subactions)) && q[ class="actions-present"] | n %>>
+ <div><div><div>
+% if ($page_tabs) {
+% foreach my $tab (sort keys %{$page_tabs}) {
+% next if $tab =~ /^(?:current_toptab|this)$/;
+% $count++;
+%
+% my $current = $page_tabs->{current_toptab} || "";
+% my $path = $page_tabs->{$tab}->{'path'} || "";
+%
+% $path =~ s#/index.html$##gi;
+% $current =~ s#/index.html$##gi;
+%
+% $sep = $toptabs->{$tab}->{'separator'} ? 1 : 0;
+%
+% $class->{a} = $path eq $current ? ' class="selected"' : undef;
+%
+% my @li;
+% push @li, 'first'
+% if $count == 1;
+%
+% push @li, 'pre-separator'
+% if $sep;
+%
+% push @li, 'post-separator'
+% if $postsep;
+%
+% $class->{li} = join ' ', @li;
+%
+%
+ <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && "&#183; "|n%><a href="<%$RT::WebPath%>/<%$page_tabs->{$tab}->{'path'}%>"<%$class->{a}|n%><% $class->{a} ? ' name="focus"' : ''|n %>><% $page_tabs->{$tab}->{'title'} %></a></li>
+%
+% if ($sep) {
+ <li class="separator">&#183;&#183;&#183;</li>
+% }
+% $postsep = $sep;
+% }
% } else {
-% push @actions, qq|<a class="nav" href="|.$RT::WebPath."/".$actions->{$action}->{'path'}.qq|">|.$actions->{$action}->{'title'}."</a>";
+&nbsp;
% }
-% }
-<% join(" | ", @actions) | n %>
-% if ($subactions) {
-% my @actions;
-% foreach my $action (sort keys %{$subactions}) {
-% push @actions, $subactions->{"$action"}->{'html'};
-% }
-<% join(" | ", @actions) | n %>
+ </div></div></div>
+ </ul>
+
+% if (($actions && %$actions) || ($subactions && %$subactions)) {
+ <ul id="actions-menu">
+ <div><div><div>
+% $sep = 0;
+% $postsep = 0;
+% $count = 0;
+% $class = { };
+%
+% for my $type ($actions, $subactions) {
+%
+% if ($type && %$type) {
+% foreach my $action (sort keys %{$type}) {
+% $count++;
+%
+% $sep = $type->{$action}->{'separator'} ? 1 : 0;
+%
+% my @li;
+% push @li, 'first'
+% if $count == 1;
+%
+% push @li, 'pre-separator'
+% if $sep;
+%
+% push @li, 'post-separator'
+% if $postsep;
+%
+% $class->{li} = join ' ', @li;
+%
+ <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && qq[<span class="bullet">&#183; </span>]|n%>
+% if ($type->{"$action"}->{'html'}) {
+ <% $type->{"$action"}->{'html'} | n %>
+% } else {
+ <a href="<%$RT::WebPath%>/<%$type->{$action}->{'path'}%>"<% $type->{$action}->{class} && ' class="'.$type->{$action}->{class}.'"' |n %><% $type->{$action}->{id} && ' id="'.$type->{$action}->{id}.'"' |n %>><%$type->{$action}->{'title'}%></a>
+% }
+ </li>
+% if ($sep) {
+ <li class="separator">&#183;&#183;&#183;</li>
+% }
+% $postsep = $sep;
+% }
% }
% }
- </span>
- </td>
-</tr>
-<TR valign="top">
-<TD valign="top" width="100%" height="100%" class="mainbody" >
+ </div></div></div>
+ </ul>
+% }
+</div>
+
+<div id="body">
<& /Elements/Callback, _CallbackName => 'BeforeBody', %ARGS &>
%$m->flush_buffer(); # we've got the page laid out, let's flush the buffer;
-<%INIT>
+<%INIT>
foreach my $tab (sort keys %{$toptabs}) {
if ($current_toptab && $toptabs->{$tab}->{'path'} eq $current_toptab) {
$toptabs->{$tab}->{"subtabs"} = $tabs;
@@ -108,7 +174,53 @@ if (! defined($AppName)) {
$AppName = loc("RT for [_1]", $RT::rtname);
}
+my ($menu_depth, $almost_last, $page_tabs);
+
+if ($RT::WebDefaultStylesheet ne '3.4-compat') {
+ ($menu_depth, $almost_last) = @{$m->comp('.menu_recurse', data => $toptabs)};
+
+ if (defined $almost_last->{subtabs} and %{$almost_last->{subtabs}}) {
+ $page_tabs = {
+ current_toptab => $almost_last->{current_subtab},
+ %{$almost_last->{subtabs}},
+ };
+
+ delete $almost_last->{subtabs};
+ delete $almost_last->{current_subtab};
+ }
+}
</%INIT>
+
+%# There's probably a better way to do this that involves three times as
+%# much work and redoing the whole menu/tab system... which would seem a
+%# bit out of scope.
+%#
+%# This function recurses through the menu and returns the second to
+%# last menu, that is, the menu holding the last reference to
+%# and submenu. It also returns the number of menu levels minus
+%# the last submenu.
+<%def .menu_recurse>
+ <%args>
+ $data => { }
+ $pdata => { }
+ $ppdata => { }
+ $level => 0
+ </%args>
+ <%init>
+ for my $key (keys %$data) {
+ return $m->comp('.menu_recurse', data => $data->{$key}->{subtabs},
+ pdata => $data->{$key},
+ ppdata => $pdata,
+ level => $level+1)
+ if ref($data->{$key}) eq 'HASH'
+ and defined $data->{$key}->{subtabs}
+ and %{$data->{$key}->{subtabs}};
+ }
+ $ppdata->{last_system_menu_level}++;
+ return [$level, $pdata];
+ </%init>
+</%def>
+
<%ARGS>
$current_toptab => undef
$current_tab => undef
diff --git a/rt/html/Elements/QueryString b/rt/html/Elements/QueryString
index 1ddab85..0176180 100644
--- a/rt/html/Elements/QueryString
+++ b/rt/html/Elements/QueryString
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -49,7 +51,12 @@ while ( my ($key, $value) = each %ARGS ){
if( UNIVERSAL::isa( $value, 'ARRAY' ) ) {
push @params, map $key."=".$m->interp->apply_escapes($_,'u'), @$value;
} else {
- push @params, $key."=".$m->interp->apply_escapes($value,'u');
+ if (ref $value eq "ARRAY") {
+ push @params, $key."=".$m->interp->apply_escapes($_, 'u')
+ for @{$value};
+ } else {
+ push @params, $key."=".$m->interp->apply_escapes($value||"",'u');
+ }
}
}
return(join('&',@params));
diff --git a/rt/html/Elements/QueueSummary b/rt/html/Elements/QueueSummary
new file mode 100644
index 0000000..133539c
--- /dev/null
+++ b/rt/html/Elements/QueueSummary
@@ -0,0 +1,92 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
+%# <jesse@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/copyleft/gpl.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 border="0" cellspacing="0" cellpadding="1" width="100%">
+<tr>
+ <th class="collection-as-table"><&|/l&>Queue</&></th>
+% for my $condition (@$conditions) {
+ <th class="collection-as-table"><% $condition->{name} %></th>
+% }
+</tr>
+% my $i;
+% for my $queue (@queues) {
+% $i++;
+% my $queue_cond = "Queue = '$queue->{Name}' AND ";
+% my $all_q = $queue_cond . "(Status = 'open' OR Status = 'new' OR Status = 'stalled')";
+<tr class="<% $i%2 ? 'oddline' : 'evenline'%>" >
+<td><a href="<% $RT::WebPath%>/Search/Results.html?Query=<% $all_q |u,n %>" title="<% $queue->{Description} %>"><% $queue->{Name} %></a></td>
+% for my $condition (@$conditions) {
+% $Tickets->FromSQL( "Queue = $queue->{id} AND ". $condition->{cond} );
+<td align="right"><a href="<% $RT::WebPath%>/Search/Results.html?Query=<% $queue_cond.$condition->{cond} |u,n %>"><% $Tickets->Count %></a></td>
+% }
+</tr>
+% }
+</table>
+<%INIT>
+my @queues;
+
+if ($cache && exists $session{$cache}) {
+ @queues = @{$session{$cache}};
+}
+else {
+ my $Queues = RT::Queues->new($session{'CurrentUser'});
+ $Queues->UnLimit();
+ @queues = map {
+ { Name => $_->Name, Description => $_->Description,
+ id => $_->Id } }
+ grep $queue_filter->($_), @{$Queues->ItemsArrayRef};
+
+ $session{$cache} = \@queues if $cache;
+}
+
+my $Tickets = RT::Tickets->new($session{'CurrentUser'});
+</%INIT>
+<%ARGS>
+$cache => undef
+$queue_filter => undef
+$conditions => ()
+</%ARGS>
diff --git a/rt/html/Elements/QuickCreate b/rt/html/Elements/QuickCreate
index 0d2489c..bad7503 100644
--- a/rt/html/Elements/QuickCreate
+++ b/rt/html/Elements/QuickCreate
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,28 +45,27 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<& /Elements/TitleBoxStart, title => loc('Quick ticket creation') &>
+<div class="quick-create">
+<&| /Widgets/TitleBox, title => loc('Quick ticket creation') &>
<form method="post" action="<%$RT::WebPath%>/index.html">
-<input type="hidden" name="QuickCreate" value="1">
+<input type="hidden" class="hidden" name="QuickCreate" value="1" />
<table>
-<tr>
-<td>
-<font size="-2"><&|/l&>Subject</&>:<br><input size="15" name="Subject"></font>
-</td>
-<td>
-<font size="-2"><&|/l&>Queue</&>:<br><& /Elements/SelectQueue, Name => 'Queue', ShowNullOption => 0 &></font>
-</td>
-<td>
-<font size="-2"><&|/l&>Owner</&>:<br>
+<tr><td>
+<&|/l&>Subject</&>:<br /><input size="15" name="Subject" />
+</td><td>
+<&|/l&>Queue</&>:<br /><& /Elements/SelectNewTicketQueue, Name => 'Queue', ShowNullOption => 0 &>
+</td><td>
+<&|/l&>Owner</&>:<br />
<select type="select" name="Owner">
-<option value="<%$session{'CurrentUser'}->id%>" SELECTED><%$session{'CurrentUser'}->Name %></option>
+<option value="<%$session{'CurrentUser'}->id%>" selected><%$session{'CurrentUser'}->Name %></option>
<option value="<%$RT::Nobody->id%>"><%loc('Nobody')%></option>
</select>
-</font>
</td>
</tr>
-%#<tr><td colspan="3"><font size="-2"><textarea cols="50" rows="3"></textarea></font></td></tr>
+%#<tr><td colspan="3"><textarea cols="50" rows="3"></textarea></td></tr>
</table>
-<div align="right"><input type="submit" value="<%loc('Create')%>"></div>
+<div align="right"><input type="submit" class="button" value="<%loc('Create')%>" /></div>
</form>
-<& /Elements/TitleBoxEnd &>
+</&>
+</div>
+
diff --git a/rt/html/Elements/Quicksearch b/rt/html/Elements/Quicksearch
index d54f72e..4acbc20 100644
--- a/rt/html/Elements/Quicksearch
+++ b/rt/html/Elements/Quicksearch
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,46 +45,17 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<& /Elements/TitleBoxStart, title => loc("Quick search"), bodyclass => "" &>
-
-<TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH=100%>
-<tr>
- <th class="collection-as-table" align=left><&|/l&>Queue</&></th>
- <th class="collection-as-table" align=right><&|/l&>New</&></th>
- <th class="collection-as-table" align=right><&|/l&>Open</&></th>
-</tr>
-
-<%PERL>
-my $i;
-while (my $queue = $Queues->Next) {
- next unless ($queue->CurrentUserHasRight('ShowTicket'));
-
- my $name = $queue->Name;
- $name =~ s|(['\\])|\\$1|g;
-
- my $new_q = "Queue = '$name' AND Status = 'new'";
- my $open_q = "Queue = '$name' AND Status = 'open'";
- my $all_q = "Queue = '$name' AND (Status = 'open' OR Status = 'new')";
-
- $Tickets->FromSQL($open_q);
- my $open = $Tickets->Count();
-
- $Tickets->FromSQL($new_q);
- my $new = $Tickets->Count();
-
- $i++;
-</%PERL>
-<TR class="<% $i%2 ? 'oddline' : 'evenline'%>" >
-<td><A HREF="<% $RT::WebPath%>/Search/Results.html?Query=<%$all_q |nu%>&Rows=50" TITLE="<% $queue->Description %>"><%$queue->Name%></a></TD>
-<td align="right"><A HREF="<% $RT::WebPath%>/Search/Results.html?Query=<%$new_q |nu%>&Rows=50"><%$new%></a></TD>
-<td align="right"><A HREF="<% $RT::WebPath%>/Search/Results.html?Query=<%$open_q |nu%>&Rows=50"><%$open%></a></TD>
-</TR>
-% }
-</TABLE>
-<& /Elements/TitleBoxEnd &>
-
+<div class="ticket-overview">
+<&|/Widgets/TitleBox, title => loc("Quick search"), bodyclass => "",
+ titleright => loc("Edit"), titleright_href => $RT::WebPath.'/Prefs/Quicksearch.html' &>
+<& /Elements/QueueSummary,
+ cache => 'quick_search_queues',
+ queue_filter => sub { $_->CurrentUserHasRight('ShowTicket') && !exists $unwanted->{$_->Name} },
+ conditions => [ {cond => "Status = 'new'", name => loc ('new') },
+ {cond => "Status = 'open'", name => loc ('open') },
+ {cond => "Status = 'stalled'", name => loc ('stalled') }] &>
+</&>
+</div>
<%INIT>
-my $Queues = RT::Queues->new($session{'CurrentUser'});
-$Queues->UnLimit();
-my $Tickets = RT::Tickets->new($session{'CurrentUser'});
+my $unwanted = $session{'CurrentUser'}->UserObj->Preferences('QuickSearch', {});
</%INIT>
diff --git a/rt/html/Elements/RT__Ticket/ColumnMap b/rt/html/Elements/RT__Ticket/ColumnMap
index 80e3c69..21dc2a7 100644
--- a/rt/html/Elements/RT__Ticket/ColumnMap
+++ b/rt/html/Elements/RT__Ticket/ColumnMap
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -52,7 +54,7 @@ $Attr => undef
<%ONCE>
our ( $COLUMN_MAP );
-sub ColumnMap {
+my $ColumnMap = sub {
my $name = shift;
my $attr = shift;
@@ -77,20 +79,22 @@ sub ColumnMap {
# For Image custom fields we also show a thumbnail here.
return sub {
my $values = $_[0]->CustomFieldValues($field);
- return map {
+ my @values = map {
(
($_->CustomFieldObj->Type eq 'Image')
? \($m->scomp( '/Elements/ShowCustomFieldImage', Object => $_ ))
: $_->Content
),
- \'<br>',
- } @{ $values->ItemsArrayRef }
+ \'<br />',
+ } @{ $values->ItemsArrayRef };
+ pop @values; # Remove that last <br />
+ return @values;
};
}
}
-}
+};
-sub LinkCallback {
+my $LinkCallback = sub {
my $method = shift;
my $mode = $RT::Ticket::LINKTYPEMAP{$method}{Mode};
@@ -101,14 +105,14 @@ sub LinkCallback {
return sub {
map {
- \'<A HREF="',
+ \'<a href="',
$_->$mode_uri->Resolver->HREF,
\'">',
( $_->$mode_uri->IsLocal ? $_->$local_type : $_->$mode ),
- \'</A><BR>',
+ \'</a><br />',
} @{ $_[0]->Links($other_mode,$type)->ItemsArrayRef }
}
-}
+};
$COLUMN_MAP = {
QueueName => {
@@ -194,12 +198,15 @@ $COLUMN_MAP = {
value => sub { return $_[0]->TimeEstimated }
},
Requestors => {
+ attribute => 'Requestor.EmailAddress',
value => sub { return $_[0]->Requestors->MemberEmailAddressesAsString }
},
Cc => {
+ attribute => 'Cc.EmailAddress',
value => sub { return $_[0]->Cc->MemberEmailAddressesAsString }
},
AdminCc => {
+ attribute => 'AdminCc.EmailAddress',
value => sub { return $_[0]->AdminCc->MemberEmailAddressesAsString }
},
StartsRelative => {
@@ -286,16 +293,22 @@ $COLUMN_MAP = {
# Everything from LINKTYPEMAP
(map {
- $_ => { value => LinkCallback( $_ ) }
+ $_ => { value => $LinkCallback->( $_ ) }
} keys %RT::Ticket::LINKTYPEMAP),
'_CLASS' => {
value => sub { return $_[1] % 2 ? 'oddline' : 'evenline' }
},
+ '_CHECKBOX' => {
+ attribute => 'checkbox',
+ title => loc('Update'),
+ align => 'right',
+ value => sub { return \('<input type="checkbox" class="checkbox" name="UpdateTicket'.$_[0]->id.'" value="1" checked />') }
+ },
};
</%ONCE>
<%init>
$m->comp( '/Elements/Callback', COLUMN_MAP => $COLUMN_MAP, _CallbackName => 'ColumnMap');
-return ColumnMap($Name, $Attr);
+return $ColumnMap->( $Name, $Attr );
</%init>
diff --git a/rt/html/Elements/Refresh b/rt/html/Elements/Refresh
index 9f241d2..6edec09 100644
--- a/rt/html/Elements/Refresh
+++ b/rt/html/Elements/Refresh
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,20 +45,20 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<SELECT NAME="<%$Name%>">
-<OPTION VALUE="-1"
+<select name="<%$Name%>">
+<option value="-1"
%unless ($Default) {
- SELECTED
+ selected
%}
-><&|/l&>Don't refresh this page.</&></OPTION>
+><&|/l&>Don't refresh this page.</&></option>
%foreach my $value (@refreshevery) {
-<OPTION VALUE="<%$value%>"
+<option value="<%$value%>"
% if ( $Default && ($value == $Default)) {
-SELECTED
+selected
% }
-><&|/l, $value/60 &>Refresh this page every [_1] minutes.</&></OPTION>
+><&|/l, $value/60 &>Refresh this page every [_1] minutes.</&></option>
%}
-</SELECT>
+</select>
<%INIT>
my @refreshevery = qw(120 300 600 1200 3600 7200);
diff --git a/rt/html/Elements/RefreshHomepage b/rt/html/Elements/RefreshHomepage
new file mode 100644
index 0000000..167a48c
--- /dev/null
+++ b/rt/html/Elements/RefreshHomepage
@@ -0,0 +1,51 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
+%# <jesse@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/copyleft/gpl.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 }}}
+<form method="get" action="<%$RT::WebPath%>/index.html">
+<& /Elements/Refresh, Name => 'HomeRefreshInterval', Default => $session {'home_refresh_interval'} &>
+<div align="right"><input type="submit" class="button" value="<&|/l&>Go!</&>" /></div>
+</form>
diff --git a/rt/html/Elements/ScrubHTML b/rt/html/Elements/ScrubHTML
index 443ded9..f382cc2 100644
--- a/rt/html/Elements/ScrubHTML
+++ b/rt/html/Elements/ScrubHTML
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -52,8 +54,8 @@ $scrubber->default(
'*' => 0,
id => 1,
class => 1,
- href => qr{^(?:http:|ftp:|https:|/)}i,
# Match http, ftp and relative urls
+ href => qr{^(?:http:|ftp:|https:|/|__Web(?:Path|BaseURL|URL)__)}i,
face => 1,
size => 1,
target => 1
diff --git a/rt/html/Elements/Section b/rt/html/Elements/Section
index afbb9cf..befe247 100644
--- a/rt/html/Elements/Section
+++ b/rt/html/Elements/Section
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,14 +45,7 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<TABLE WIDTH=100%>
-<TR>
-<TD>
-<font size=+4><%$title%></font>
-</TD>
-</TR>
-</TABLE>
-
+<h1><%$title%></h1>
<%ARGS>
$title => undef
</%ARGS>
diff --git a/rt/html/Elements/SelectAttachmentField b/rt/html/Elements/SelectAttachmentField
index ea1528c..8a37ca5 100644
--- a/rt/html/Elements/SelectAttachmentField
+++ b/rt/html/Elements/SelectAttachmentField
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,12 +45,12 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<SELECT NAME="<%$Name%>">
-<OPTION VALUE="Subject"><&|/l&>Subject</&></OPTION>
-<OPTION VALUE="Content"><&|/l&>Content</&></OPTION>
-<OPTION VALUE="ContentType"><&|/l&>Content-Type</&></OPTION>
-<OPTION VALUE="Filename"><&|/l&>Filename</&></OPTION>
-</SELECT>
+<select name="<%$Name%>">
+<option value="Subject"><&|/l&>Subject</&></option>
+<option value="Content"><&|/l&>Content</&></option>
+<option value="ContentType"><&|/l&>Content-Type</&></option>
+<option value="Filename"><&|/l&>Filename</&></option>
+</select>
<%ARGS>
$Name => 'AttachmentField'
</%ARGS>
diff --git a/rt/html/Elements/SelectBoolean b/rt/html/Elements/SelectBoolean
index a3f08fd..b34e07a 100644
--- a/rt/html/Elements/SelectBoolean
+++ b/rt/html/Elements/SelectBoolean
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,10 +45,10 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<SELECT NAME ="<%$Name%>">
-<OPTION VALUE="<%$TrueVal%>" <%$TrueDefault%>><%$True%></OPTION>
-<OPTION VALUE="<%$FalseVal%>" <%$FalseDefault%>><%$False%></OPTION>
-</SELECT>
+<select NAME ="<%$Name%>">
+<option value="<%$TrueVal%>" <%$TrueDefault%>><%$True%></option>
+<option value="<%$FalseVal%>" <%$FalseDefault%>><%$False%></option>
+</select>
<%ARGS>
$Name => undef
@@ -58,7 +60,8 @@ $False => loc("isn't")
</%ARGS>
<%INIT>
-my ($TrueDefault, $FalseDefault);
+my $TrueDefault = '';
+my $FalseDefault ='';
if ($Default && $Default !~ /true/i) {
$FalseDefault = "SELECTED";
}
diff --git a/rt/html/Elements/SelectCustomFieldOperator b/rt/html/Elements/SelectCustomFieldOperator
index 8f7ea61..ecb306c 100644
--- a/rt/html/Elements/SelectCustomFieldOperator
+++ b/rt/html/Elements/SelectCustomFieldOperator
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,20 +45,20 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<SELECT NAME ="<%$Name%>">
+<select NAME ="<%$Name%>">
% while (my $option = shift @Options) {
% my $value = shift @Values;
-<OPTION VALUE="<%$value%>"
+<option value="<%$value%>"
% if ($Default eq $value) {
-SELECTED
+selected
% }
-><%$option%></OPTION>
+><%$option%></option>
% }
-</SELECT>
+</select>
<%ARGS>
$Name => undef
@Options => ( loc('contains'), loc("doesn't contain"), loc('is'), loc("isn't"), loc('less than'), loc('greater than'))
@Values => ('LIKE', 'NOT LIKE', '=', '!=', '<', '>')
-$Default => undef
+$Default => ''
</%ARGS>
diff --git a/rt/html/Elements/SelectCustomFieldValue b/rt/html/Elements/SelectCustomFieldValue
index 27d6c49..2bcb35e 100644
--- a/rt/html/Elements/SelectCustomFieldValue
+++ b/rt/html/Elements/SelectCustomFieldValue
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -47,7 +49,7 @@
% if ($CustomField->Type =~ /Select/i) {
% my $values = $CustomField->Values;
<select name="<%$Name%>">
-<option value="" SELECTED>-</option>
+<option value="" selected>-</option>
<option value="NULL"><&|/l&>(no value)</&></option>
% while (my $value = $values->Next) {
<option value="<%$value->Name%>"><%$value->Name%></option>
@@ -55,7 +57,7 @@
</select>
% }
% else {
-<input name="<%$Name%>" size="20">
+<input name="<%$Name%>" size="20" />
% }
<%args>
$Name => undef
diff --git a/rt/html/Elements/SelectDate b/rt/html/Elements/SelectDate
index d381579..b43f324 100644
--- a/rt/html/Elements/SelectDate
+++ b/rt/html/Elements/SelectDate
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,8 +45,10 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<INPUT NAME="<%$Name%>" VALUE="<%$Default%>" size=<%$Size%>>
-
+<script type="text/javascript"><!--
+ onLoadHook('createCalendarLink("<% $Name %>");');
+--></script>
+<input type="text" id="<% $Name %>" name="<% $Name %>" value="<% $Default %>" size="<% $Size %>" />
<%init>
unless ((defined $Default) or
($current <= 0)) {
@@ -65,7 +69,7 @@ unless ($Name) {
$ShowTime => undef
$menu_prefix=>''
$current=>time
-$Default => undef
+$Default => ''
$Name => undef
$Size => 16
</%args>
diff --git a/rt/html/Elements/SelectDateRelation b/rt/html/Elements/SelectDateRelation
index ccf0c11..9c80be4 100644
--- a/rt/html/Elements/SelectDateRelation
+++ b/rt/html/Elements/SelectDateRelation
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,11 +45,11 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<SELECT NAME ="<%$Name%>">
-<OPTION VALUE="&lt;"><%$Before%></OPTION>
-<OPTION VALUE="="><%$On%></OPTION>
-<OPTION VALUE="&gt;"><%$After%></OPTION>
-</SELECT>
+<select NAME ="<%$Name%>">
+<option value="&lt;"><%$Before%></option>
+<option value="="><%$On%></option>
+<option value="&gt;"><%$After%></option>
+</select>
<%ARGS>
$Name => undef
diff --git a/rt/html/Elements/SelectDateType b/rt/html/Elements/SelectDateType
index 7b3f099..653949a 100644
--- a/rt/html/Elements/SelectDateType
+++ b/rt/html/Elements/SelectDateType
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,16 +45,16 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<SELECT NAME="<%$Name%>">
-<OPTION VALUE="Created"><&|/l&>Created</&></OPTION>
-<OPTION VALUE="Started"><&|/l&>Started</&></OPTION>
-<OPTION VALUE="Resolved"><&|/l&>Resolved</&></OPTION>
-<OPTION VALUE="Told"><&|/l&>Last Contacted</&></OPTION>
-<OPTION VALUE="LastUpdated"><&|/l&>Last Updated</&></OPTION>
-<OPTION VALUE="Starts"><&|/l&>Starts</&></OPTION>
-<OPTION VALUE="Due"><&|/l&>Due</&></OPTION>
-<OPTION VALUE="Updated"><&|/l&>Updated</&></OPTION>
-</SELECT>
+<select name="<%$Name%>">
+<option value="Created"><&|/l&>Created</&></option>
+<option value="Started"><&|/l&>Started</&></option>
+<option value="Resolved"><&|/l&>Resolved</&></option>
+<option value="Told"><&|/l&>Last Contacted</&></option>
+<option value="LastUpdated"><&|/l&>Last Updated</&></option>
+<option value="Starts"><&|/l&>Starts</&></option>
+<option value="Due"><&|/l&>Due</&></option>
+<option value="Updated"><&|/l&>Updated</&></option>
+</select>
<%ARGS>
$Name => 'DateType'
</%ARGS>
diff --git a/rt/html/Elements/SelectEqualityOperator b/rt/html/Elements/SelectEqualityOperator
index 0f8deea..851add3 100644
--- a/rt/html/Elements/SelectEqualityOperator
+++ b/rt/html/Elements/SelectEqualityOperator
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,16 +45,16 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<SELECT NAME ="<%$Name%>">
+<select NAME ="<%$Name%>">
% while (my $option = shift @Options) {
% my $value = shift @Values;
-<OPTION VALUE="<%$value%>"
+<option value="<%$value%>"
% if ($Default eq $value) {
-SELECTED
+selected
% }
-><%$option%></OPTION>
+><%$option%></option>
% }
-</SELECT>
+</select>
<%ARGS>
$Name => undef
diff --git a/rt/html/Elements/SelectGroups b/rt/html/Elements/SelectGroups
index bc37fd6..c1fb9df 100644
--- a/rt/html/Elements/SelectGroups
+++ b/rt/html/Elements/SelectGroups
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -45,14 +47,14 @@
%# END BPS TAGGED BLOCK }}}
<select name="GroupField">
% foreach my $col (RT::Group->BasicColumns) {
-<option value="<% $col->[0] %>"><% loc($col->[1]) %>
+<option value="<% $col->[0] %>"><% loc($col->[1]) %></option>
% }
% while (my $CF = $CFs->Next) {
-<option value="CustomField-<% $CF->Id %>"><&|/l&>CustomField</&>: <% $CF->Name %>
+<option value="CustomField-<% $CF->Id %>"><&|/l&>CustomField</&>: <% $CF->Name %></option>
% }
</select>
<& /Elements/SelectMatch, Name=> 'GroupOp' &>
-<input size=8 name="GroupString">
+<input size="8" name="GroupString" />
<%INIT>
my $CFs = RT::CustomFields->new($session{'CurrentUser'});
$CFs->LimitToChildType('RT::Group');
diff --git a/rt/html/Elements/SelectLang b/rt/html/Elements/SelectLang
index a439ea3..7640744 100644
--- a/rt/html/Elements/SelectLang
+++ b/rt/html/Elements/SelectLang
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,18 +45,18 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<SELECT NAME ="<%$Name%>">
+<select NAME ="<%$Name%>">
% if ($ShowNullOption) {
-<OPTION VALUE="">-</OPTION>
+<option value="">-</option>
% }
% foreach my $lang (@lang) {
-<OPTION VALUE="<%$lang%>" <%($Default && ($lang eq $Default)) && 'SELECTED'%>><% $lang_to_desc{$lang} %>
+<option value="<%$lang%>" <%($Default && ($lang eq $Default)) && 'SELECTED'%>><% $lang_to_desc{$lang} %>
% if (($Verbose) and (my $description = I18N::LangTags::List::native_name($lang)) ){
(<%$description%>)
% }
-</OPTION>
+</option>
% }
-</SELECT>
+</select>
<%ARGS>
$ShowNullOption => 1
$ShowAllQueues => 1
diff --git a/rt/html/Elements/SelectLinkType b/rt/html/Elements/SelectLinkType
index 28cb441..4617e7c 100644
--- a/rt/html/Elements/SelectLinkType
+++ b/rt/html/Elements/SelectLinkType
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,11 +45,11 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<SELECT NAME ="<%$Name%>">
-<OPTION VALUE="MemberOf"><&|/l&>Member of</&></OPTION>
-<OPTION VALUE="DependsOn"><&|/l&>Depends on</&></OPTION>
-<OPTION VALUE="RefersTo"><&|/l&>Refers to</&></OPTION>
-</SELECT>
+<select NAME ="<%$Name%>">
+<option value="MemberOf"><&|/l&>Member of</&></option>
+<option value="DependsOn"><&|/l&>Depends on</&></option>
+<option value="RefersTo"><&|/l&>Refers to</&></option>
+</select>
<%ARGS>
$Name => "LinkType"
diff --git a/rt/html/Elements/SelectMatch b/rt/html/Elements/SelectMatch
index 60949d9..646ad4e 100644
--- a/rt/html/Elements/SelectMatch
+++ b/rt/html/Elements/SelectMatch
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,12 +45,12 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<SELECT NAME ="<%$Name%>">
-<OPTION VALUE="LIKE" <%$LikeDefault%>><%$Like%></OPTION>
-<OPTION VALUE="NOT LIKE" <%$NotLikeDefault%>><%$NotLike%></OPTION>
-<OPTION VALUE="=" <%$TrueDefault%>><%$True%></OPTION>
-<OPTION VALUE="!=" <%$FalseDefault%>><%$False%></OPTION>
-</SELECT>
+<select NAME ="<%$Name%>">
+<option value="LIKE" <%$LikeDefault%>><%$Like%></option>
+<option value="NOT LIKE" <%$NotLikeDefault%>><%$NotLike%></option>
+<option value="=" <%$TrueDefault%>><%$True%></option>
+<option value="!=" <%$FalseDefault%>><%$False%></option>
+</select>
<%ARGS>
$Name => undef
diff --git a/rt/html/Elements/SelectNewTicketQueue b/rt/html/Elements/SelectNewTicketQueue
index d47b58a..55dc7d2 100644
--- a/rt/html/Elements/SelectNewTicketQueue
+++ b/rt/html/Elements/SelectNewTicketQueue
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,39 +45,6 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<LABEL ACCESSKEY="9">
-<SELECT NAME ="<%$Name%>">
-% foreach my $queue (@{$session{'create_in_queues'}}) {
-<OPTION
- VALUE="<%$queue->{'id'}%>"
- <%$Default && ($queue->{'id'} == $Default) && 'SELECTED'%>>
-<%$queue->{'Name'}%>
-% if (($Verbose) and ($queue->{'Description'}) ){
-(<%$queue->{'Description'}%>)
-% }
-</OPTION>
-% }
-</SELECT>
-</LABEL>
-
-<%INIT>
-unless ($session{'create_in_queues'}) {
-
-@{$session{'create_in_queues'}} = ();
-my $q=new RT::Queues($session{'CurrentUser'});
-$q->UnLimit;
-while (my $queue=$q->Next) {
- if ($queue->CurrentUserHasRight('CreateTicket')) {
- my $ds = { Name => $queue->Name, Description => $queue->Description, id => $queue->id };
- push (@{$session{'create_in_queues'}}, $ds);
- }
-}
-}
-</%INIT>
-
-
-<%ARGS>
-$Name => 'Queue'
-$Verbose => 0
-$Default => 0
-</%ARGS>
+<label accesskey="9">
+ <& /Elements/SelectQueue, Name => 'Queue', %ARGS, ShowNullOption => 0, ShowAllQueues => 0 &>
+</label>
diff --git a/rt/html/Elements/SelectOwner b/rt/html/Elements/SelectOwner
index 85843e5..f33b346 100644
--- a/rt/html/Elements/SelectOwner
+++ b/rt/html/Elements/SelectOwner
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,20 +45,20 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<SELECT NAME="<%$Name%>">
+<select name="<%$Name%>">
%if ($DefaultValue) {
-<OPTION <% !$Default ? "SELECTED" : '' %> VALUE=""><%$DefaultLabel%></OPTION>
+<option <% !$Default ? "SELECTED" : '' %> value=""><%$DefaultLabel%></option>
%}
%foreach my $User ( @users) {
-<OPTION <% ($User->Id == $Default) ? "SELECTED" : ''%>
+<option <% ($User->Id == $Default) ? "SELECTED" : ''%>
%if ($ValueAttribute eq 'id') {
value="<%$User->id%>"
%} elsif ($ValueAttribute eq 'Name') {
value="<%$User->Name%>"
%}
-><%$User->Name()%></OPTION>
+><%$User->Name()%></option>
%}
-</SELECT>
+</select>
<%INIT>
my @objects;
my @users;
diff --git a/rt/html/Elements/SelectQueue b/rt/html/Elements/SelectQueue
index 56aede8..0decb5b 100644
--- a/rt/html/Elements/SelectQueue
+++ b/rt/html/Elements/SelectQueue
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -44,26 +46,26 @@
%#
%# END BPS TAGGED BLOCK }}}
% if ($Lite) {
-% my $d = new RT::Queue($session{'CurrentUser'});
-% $d->Load($Default);
-<INPUT NAME="<%$Name%>" size=25 DEFAULT="<%$d->Name%>">
-% } else {
-<SELECT NAME ="<%$Name%>">
-% if ($ShowNullOption) {
-<OPTION VALUE="">-</OPTION>
+% my $d = new RT::Queue($session{'CurrentUser'});
+% $d->Load($Default);
+<input name="<%$Name%>" size="25" value="<%$d->Name%>" />
% }
-% while (my $queue=$q->Next) {
-% if ($ShowAllQueues || $queue->CurrentUserHasRight($CheckQueueRight)) {
-<OPTION VALUE="<%($NamedValues ? $queue->Name : $queue->Id) %>" <%( $queue->Id eq $Default ? 'SELECTED' : '')%>><%$queue->Name%>
-% if (($Verbose) and ($queue->Description) ){
-(<%$queue->Description%>)
-% }
-</OPTION>
+% else {
+<select name="<%$Name%>">
+% if ($ShowNullOption) {
+ <option value="">-</option>
+% }
+% for my $queue (@{$session{$cache_key}}) {
+ <option value="<% ($NamedValues ? $queue->{Name} : $queue->{Id}) %>" <% ($queue->{Id} eq $Default ? 'selected="selected"' : '') |n %>>
+ <%$queue->{Name}%>
+% if ($Verbose and $queue->{Description}) {
+ (<%$queue->{Description}%>)
+% }
+ </option>
+% }
+</select>
% }
-% }
-</SELECT>
-% }
-<%ARGS>
+<%args>
$CheckQueueRight => 'CreateTicket'
$ShowNullOption => 1
$ShowAllQueues => 1
@@ -72,11 +74,24 @@ $Verbose => undef
$NamedValues => 0
$Default => 0
$Lite => 0
-</%ARGS>
-
-<%INIT>
-
-my $q=new RT::Queues($session{'CurrentUser'});
-$q->UnLimit;
+</%args>
+<%init>
+my $cache_key = "SelectQueue---"
+ . $session{'CurrentUser'}->Id
+ . "---$CheckQueueRight---$ShowAllQueues";
-</%INIT>
+if (not defined $session{$cache_key} and not $Lite) {
+ my $q = new RT::Queues($session{'CurrentUser'});
+ $q->UnLimit;
+
+ while (my $queue = $q->Next) {
+ if ($ShowAllQueues || $queue->CurrentUserHasRight($CheckQueueRight)) {
+ push @{$session{$cache_key}}, {
+ Id => $queue->Id,
+ Name => $queue->Name,
+ Description => $queue->Description,
+ };
+ }
+ }
+}
+</%init>
diff --git a/rt/html/Elements/SelectResultsPerPage b/rt/html/Elements/SelectResultsPerPage
index 65ed536..a83cfaa 100644
--- a/rt/html/Elements/SelectResultsPerPage
+++ b/rt/html/Elements/SelectResultsPerPage
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -45,17 +47,18 @@
%# END BPS TAGGED BLOCK }}}
%# TODO: Better default handling
-<SELECT NAME ="<%$Name%>">
-% foreach my $value (@values) {
-<OPTION VALUE="<%$value%>" <% $value == $Default && 'SELECTED' %>>
+<select name="<% $Name %>">
+% foreach my $value ( @values ) {
+<option value="<% $value %>" <% $value == $Default? 'selected': '' %>>
<% shift @labels %>
-</OPTION>
+</option>
% }
-</SELECT>
+</select>
<%INIT>
my @values = qw(0 10 25 50 100);
my @labels = (loc('Unlimited'), qw(10 25 50 100));
+$Default = 50 unless defined $Default;
</%INIT>
<%ARGS>
diff --git a/rt/html/Elements/SelectSortOrder b/rt/html/Elements/SelectSortOrder
index f6dd70d..2a27717 100644
--- a/rt/html/Elements/SelectSortOrder
+++ b/rt/html/Elements/SelectSortOrder
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,13 +45,13 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<SELECT NAME="<%$Name%>">
+<select name="<%$Name%>">
%foreach my $order (@orders) {
-<OPTION VALUE="<%$order%>" <%$order eq $Default && 'SELECTED' %>>
+<option value="<%$order%>" <%$order eq $Default && 'SELECTED' %>>
<% shift @order_names %>
-</OPTION>
+</option>
% }
-</SELECT>
+</select>
<%INIT>
my @orders = qw (ASC DESC);
diff --git a/rt/html/Elements/SelectStatus b/rt/html/Elements/SelectStatus
index fa76a3e..5f861af 100644
--- a/rt/html/Elements/SelectStatus
+++ b/rt/html/Elements/SelectStatus
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,15 +45,15 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<SELECT NAME ="<%$Name%>">
+<select NAME ="<%$Name%>">
%if ($DefaultValue) {
-<OPTION <% !$Default && "SELECTED" %> VALUE=""><%$DefaultLabel%></OPTION>
+<option <% !$Default && "SELECTED" %> value=""><%$DefaultLabel%></option>
%}
%foreach my $status (@status) {
%next if ($SkipDeleted && $status eq 'deleted');
-<OPTION <% ($status eq $Default) && "SELECTED" %> VALUE="<%$status%>"><%loc($status)%></OPTION>
+<option <% ($status eq $Default) && "SELECTED" %> value="<%$status%>"><%loc($status)%></option>
% }
-</SELECT>
+</select>
<%ONCE>
my $queue = new RT::Queue($session{'CurrentUser'});
my @status = $queue->StatusArray();
diff --git a/rt/html/Elements/SelectTicketSortBy b/rt/html/Elements/SelectTicketSortBy
index 3e05dcc..aca98f8 100644
--- a/rt/html/Elements/SelectTicketSortBy
+++ b/rt/html/Elements/SelectTicketSortBy
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,11 +45,11 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<SELECT NAME="<%$Name%>">
+<select name="<%$Name%>">
% foreach my $field (@sortfields) {
-<OPTION VALUE="<%$field%>" <% $field eq $Default && 'SELECTED'%>><% loc($field) %></OPTION>
+<option value="<%$field%>" <% $field eq $Default && 'SELECTED'%>><% loc($field) %></option>
% }
-</SELECT>
+</select>
<%INIT>
my $tickets = new RT::Tickets($session{'CurrentUser'});
diff --git a/rt/html/Elements/SelectTicketTypes b/rt/html/Elements/SelectTicketTypes
index a905f60..5bacccf 100644
--- a/rt/html/Elements/SelectTicketTypes
+++ b/rt/html/Elements/SelectTicketTypes
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,11 +45,11 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<SELECT NAME="<%$Name%>">
+<select name="<%$Name%>">
%foreach (@Types) {
-<OPTION VALUE="<% $_ %>" <% ($_ eq $Default) && "SELECTED" %>><&|/l&><% $_ %></&>
+<option value="<% $_ %>" <% ($_ eq $Default) && "SELECTED" %>><&|/l&><% $_ %></&>
%}
-</SELECT>
+</select>
<%ARGS>
$Name => 'TickType'
diff --git a/rt/html/Elements/SelectTimeUnits b/rt/html/Elements/SelectTimeUnits
new file mode 100755
index 0000000..e1656f1
--- /dev/null
+++ b/rt/html/Elements/SelectTimeUnits
@@ -0,0 +1,57 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
+%# <jesse@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/copyleft/gpl.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="minutes" selected><% loc('Minutes') %></option>
+<option value="hours"><% loc('Hours') %></option>
+</select>
+<%INIT>
+$Name .= '-TimeUnits' unless $Name =~ /-TimeUnits$/io;
+</%INIT>
+<%ARGS>
+$Name => ''
+</%ARGS>
diff --git a/rt/html/Elements/SelectUsers b/rt/html/Elements/SelectUsers
index dfe816e..52febb8 100644
--- a/rt/html/Elements/SelectUsers
+++ b/rt/html/Elements/SelectUsers
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -45,14 +47,14 @@
%# END BPS TAGGED BLOCK }}}
<select name="UserField">
% foreach my $col (RT::User->BasicColumns) {
-<option value="<% $col->[0] %>"><% loc($col->[1]) %>
+<option value="<% $col->[0] %>"><% loc($col->[1]) %></option>
% }
% while (my $CF = $CFs->Next) {
-<option value="CustomField-<% $CF->Id %>"><&|/l&>CustomField</&>: <% $CF->Name %>
+<option value="CustomField-<% $CF->Id %>"><&|/l&>CustomField</&>: <% $CF->Name %></option>
% }
</select>
<& /Elements/SelectMatch, Name=> 'UserOp' &>
-<input size=8 name="UserString">
+<input size="8" name="UserString" />
<%INIT>
my $CFs = RT::CustomFields->new($session{'CurrentUser'});
$CFs->LimitToChildType('RT::User');
diff --git a/rt/html/Elements/SelectWatcherType b/rt/html/Elements/SelectWatcherType
index 6ba9c7a..26854a7 100644
--- a/rt/html/Elements/SelectWatcherType
+++ b/rt/html/Elements/SelectWatcherType
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,14 +45,14 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<SELECT NAME ="<%$Name%>">
+<select NAME ="<%$Name%>">
% if ($AllowNull) {
-<OPTION VALUE="">-</OPTION>
+<option value="">-</option>
% }
%for my $option (@types) {
-<OPTION VALUE="<%$option%>" <%$option eq $Default && "SELECTED"%>><%loc($option)%></OPTION>
+<option value="<%$option%>" <%defined($Default) && $option eq $Default && "SELECTED"%>><%loc($option)%></option>
%}
-</SELECT>
+</select>
<%INIT>
my @types;
diff --git a/rt/html/Elements/SetupSessionCookie b/rt/html/Elements/SetupSessionCookie
index bd78613..087f825 100644
--- a/rt/html/Elements/SetupSessionCookie
+++ b/rt/html/Elements/SetupSessionCookie
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -46,69 +48,77 @@
<%init>
return if $m->is_subrequest; # avoid reentrancy, as suggested by masonbook
-my %cookies = CGI::Cookie->fetch();
-my $cookiename = "RT_SID_".$RT::rtname.".".$ENV{'SERVER_PORT'};
-my %backends = (
- mysql => 'Apache::Session::MySQL',
- Pg => 'Apache::Session::Postgres',
-# Oracle => 'Apache::Session::Oracle',
-) unless $RT::WebSessionClass;
-my $session_class = $RT::WebSessionClass || $backends{$RT::DatabaseType} || 'Apache::Session::File';
-my $pm = "$session_class.pm"; $pm =~ s|::|/|g; require $pm;
+my %cookies = CGI::Cookie->fetch();
+my $cookiename = "RT_SID_" . $RT::rtname . "." . $ENV{'SERVER_PORT'};
+$SessionCookie ||= $cookies{$cookiename} ? $cookies{$cookiename}->value : undef;
- # morning bug avoidance attempt -- pdh 20030815
- unless ($RT::Handle->dbh && $RT::Handle->dbh->ping) {
- $RT::Handle->Connect();
- }
+my %backends = (
+ mysql => 'Apache::Session::MySQL',
+ Pg => 'Apache::Session::Postgres',
+
+ # Oracle => 'Apache::Session::Oracle',
+);
+
+my $session_class = $RT::WebSessionClass
+ || $backends{$RT::DatabaseType}
+ || 'Apache::Session::File';
+my $pm = "$session_class.pm";
+$pm =~ s|::|/|g;
+require $pm;
+
+# morning bug avoidance attempt -- pdh 20030815
+unless ( $RT::Handle->dbh && $RT::Handle->dbh->ping ) {
+ $RT::Handle->Connect();
+}
+
+my $session_properties;
+if ( $session_class eq 'Apache::Session::File' ) {
+ $session_properties = {
+ Directory => $RT::MasonSessionDir,
+ LockDirectory => $RT::MasonSessionDir,
+ };
+} else {
+ $session_properties = {
+ Handle => $RT::Handle->dbh,
+ LockHandle => $RT::Handle->dbh,
+ };
+}
+
+eval {
+ tie %session, $session_class, $SessionCookie, $session_properties
+};
+if ($@) {
+
+ # If the session is invalid, create a new session.
eval {
- tie %session, $session_class,
- $SessionCookie || ( $cookies{$cookiename} ? $cookies{$cookiename}->value() : undef ),
- $backends{$RT::DatabaseType} ? {
- Handle => $RT::Handle->dbh,
- LockHandle => $RT::Handle->dbh,
- } : {
- Directory => $RT::MasonSessionDir,
- LockDirectory => $RT::MasonSessionDir,
- };
+ tie %session, $session_class, undef, $session_properties;
+ undef $cookies{$cookiename};
};
- if ($@) {
+}
- # If the session is invalid, create a new session.
- if ( $@ =~ /Object does not/i ) {
- tie %session, $session_class, undef, $backends{$RT::DatabaseType}
- ? {
- Handle => $RT::Handle->dbh,
- LockHandle => $RT::Handle->dbh,
- }
- : {
- Directory => $RT::MasonSessionDir,
- LockDirectory => $RT::MasonSessionDir,
- };
- undef $cookies{$cookiename};
- }
- else {
- die loc("RT couldn't store your session.") . "\n"
- . loc(
-"This may mean that that the directory '[_1]' isn't writable or a database table is missing or corrupt.",
- $RT::MasonSessionDir
- )
- . "\n\n"
- . $@;
- }
- }
+if ($@) {
+ die loc("RT couldn't store your session.") . "\n"
+ . loc(
+ "This may mean that that the directory '[_1]' isn't writable or a database table is missing or corrupt.",
+ $RT::MasonSessionDir
+ )
+ . "\n\n"
+ . $@;
+}
- if ( !$cookies{$cookiename} ) {
- my $cookie = new CGI::Cookie(
- -name => $cookiename,
- -value => $session{_session_id},
- -path => '/',
- );
- $r->headers_out->{'Set-Cookie'} = $cookie->as_string;
+if ( !$cookies{$cookiename} ) {
+ my $cookie = new CGI::Cookie(
+ -name => $cookiename,
+ -value => $session{_session_id},
+ -path => $RT::WebPath,
+ -secure => ($RT::WebSecureCookies ? 1 :0)
+ );
+ $r->headers_out->{'Set-Cookie'} = $cookie->as_string;
- }
+}
- return();
+return ();
</%init>
<%args>
-$SessionCookie => ''
+$SessionCookie => undef
</%args>
diff --git a/rt/html/Elements/ShowCustomFieldBinary b/rt/html/Elements/ShowCustomFieldBinary
index ea9e5ae..9dd5faa 100644
--- a/rt/html/Elements/ShowCustomFieldBinary
+++ b/rt/html/Elements/ShowCustomFieldBinary
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
diff --git a/rt/html/Elements/ShowCustomFieldImage b/rt/html/Elements/ShowCustomFieldImage
index 7fa5e46..c49ae0e 100644
--- a/rt/html/Elements/ShowCustomFieldImage
+++ b/rt/html/Elements/ShowCustomFieldImage
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -45,7 +47,7 @@
%# END BPS TAGGED BLOCK }}}
% my $url = $RT::WebPath . "/Download/CustomFieldValue/".$Object->Id.'/'.$Object->Content;
<a href="<% $url %>"><% $Object->Content %></a>
-<img type="<% $Object->ContentType %>" height=64 src="<% $url %>" align="middle">
+<img type="<% $Object->ContentType %>" height="64" src="<% $url %>" align="middle" />
<%ARGS>
$Object
</%ARGS>
diff --git a/rt/html/Elements/ShowCustomFieldWikitext b/rt/html/Elements/ShowCustomFieldWikitext
index ab7c27b..1ddd7da 100644
--- a/rt/html/Elements/ShowCustomFieldWikitext
+++ b/rt/html/Elements/ShowCustomFieldWikitext
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -45,7 +47,8 @@
%# END BPS TAGGED BLOCK }}}
% my $content = $Object->LargeContent || $Object->Content;
% $content = $m->comp('/Elements/ScrubHTML', Content => $content);
-% my $wiki_content = Text::WikiFormat::format( $content."\n" , {}, { extended => 1, absolute_links => 1 });
+% my $base = $Object->Object->WikiBase;
+% my $wiki_content = Text::WikiFormat::format( $content."\n" , {}, { extended => 1, absolute_links => 1, implicit_links => $RT::WikiImplicitLinks, prefix => $base} );
<%$wiki_content|n%>
<%init>
use Text::WikiFormat;
diff --git a/rt/html/Elements/ShowCustomFields b/rt/html/Elements/ShowCustomFields
index 9861841..06b5996 100644
--- a/rt/html/Elements/ShowCustomFields
+++ b/rt/html/Elements/ShowCustomFields
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -44,36 +46,67 @@
%#
%# END BPS TAGGED BLOCK }}}
<table>
-% my @entry_fields;
-% while (my $CustomField = $CustomFields->Next()) {
-% my $Values = $Object->CustomFieldValues($CustomField->Id);
- <tr>
- <td class="label"><%$CustomField->Name%>:</td>
+% while ( my $CustomField = $CustomFields->Next ) {
+% my $Values = $Object->CustomFieldValues( $CustomField->Id );
+% my $count = $Values->Count;
+ <tr id="CF-<%$CustomField->id%>-ShowRow">
+ <td class="label"><% $CustomField->Name %>:</td>
<td class="value">
+% unless ( $count ) {
+<i><&|/l&>(no value)</&></i>
+% } elsif ( $count == 1 ) {
+% $print_value->( $CustomField, $Values->First );
+% } else {
<ul>
-% while (my $Value = $Values->Next()) {
-<li>
-% my $comp = "ShowCustomField".$CustomField->Type;
-% if ($m->comp_exists($comp)) {
-<& $comp, Object => $Value &>
-% } else {
-<%$Value->Content%>
-% }
-</li>
-% }
-% unless ($Values->Count()) {
-<li><i><&|/l&>(no value)</&></i></li>
+% while ( my $Value = $Values->Next ) {
+<li><% $print_value->( $CustomField, $Value ) |n %></li>
% }
</ul>
+% }
</td>
</tr>
% }
</table>
<%INIT>
my $CustomFields = $Object->CustomFields;
- $m->comp('/Elements/Callback', _CallbackName => 'MassageCustomFields',
+$m->comp('/Elements/Callback', _CallbackName => 'MassageCustomFields',
CustomFields => $CustomFields);
+my $print_value = sub {
+ my ($cf, $value) = @_;
+ my $linked = $cf->LinkValueTo;
+ if ( $linked ) {
+ $m->out('<a href="'. $value->LinkValueTo .'" target="_new">');
+ }
+ my $comp = "ShowCustomField". $cf->Type;
+ $m->comp('/Elements/Callback',
+ _CallbackName => 'ShowComponentName',
+ Name => \$comp,
+ CustomField => $cf,
+ Object => $Object
+ );
+ if ( $m->comp_exists( $comp ) ) {
+ $m->comp( $comp, Object => $value );
+ } else {
+ $m->print( $value->Content );
+ }
+ $m->out('</a>') if $linked;
+
+ # This section automatically populates a div with the "IncludeContentForValue" for this custom
+ # field if it's been defined
+ if ( $cf->IncludeContentForValue ) {
+ my $vid = $value->id;
+ $m->out( '<div class="object_cf_value_include" id="object_cf_value_'. $vid .'">' );
+ $m->print( loc("See also:") );
+ $m->out( '<a href="'. $value->IncludeContentForValue .'">' );
+ $m->print( $value->IncludeContentForValue );
+ $m->out( qq{</a></div>\n} );
+ $m->out( qq{<script><!--\nahah('} );
+ $m->print( $value->IncludeContentForValue );
+ $m->out( qq{', 'object_cf_value_$vid');\n--></script>\n} );
+ }
+};
+
</%INIT>
<%ARGS>
$Object => undef
diff --git a/rt/html/Elements/ShowLink b/rt/html/Elements/ShowLink
index 5929a96..a1d6bdf 100644
--- a/rt/html/Elements/ShowLink
+++ b/rt/html/Elements/ShowLink
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,7 +45,7 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<A href="<%$URI->Resolver->HREF%>">
+<a href="<%$URI->Resolver->HREF%>">
% if ($URI->IsLocal) {
% my $member = $URI->Object;
% if (UNIVERSAL::isa($member, "RT::Ticket")) {
diff --git a/rt/html/Elements/ShowLinks b/rt/html/Elements/ShowLinks
index c9279a5..913a4ee 100755
--- a/rt/html/Elements/ShowLinks
+++ b/rt/html/Elements/ShowLinks
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -93,6 +95,7 @@
<td class="value">
<ul>
% while (my $Link = $Ticket->ReferredToBy->Next) {
+% next if (UNIVERSAL::isa($Link->BaseObj, 'RT::Ticket') && $Link->BaseObj->Type eq 'reminder');
<li><& ShowLink, URI => $Link->BaseURI &>
% }
</ul>
diff --git a/rt/html/Elements/ShowMemberships b/rt/html/Elements/ShowMemberships
index 3936d50..f6b2817 100644
--- a/rt/html/Elements/ShowMemberships
+++ b/rt/html/Elements/ShowMemberships
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
diff --git a/rt/html/Elements/ShowSearch b/rt/html/Elements/ShowSearch
new file mode 100644
index 0000000..ded865b
--- /dev/null
+++ b/rt/html/Elements/ShowSearch
@@ -0,0 +1,126 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
+%# <jesse@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/copyleft/gpl.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 }}}
+<&|/Widgets/TitleBox,
+ title => loc($search->Description, $ProcessedSearchArg->{'Rows'}),
+ title_href => $query_link_url.$QueryString,
+ titleright => $customize ? loc('Edit') : '',
+ titleright_href => $customize &>
+<& $query_display_component, %$ProcessedSearchArg, ShowNavigation => 0 &>
+</&>
+<%init>
+my $search;
+my $user = $session{'CurrentUser'}->UserObj;
+my $SearchArg;
+my $customize;
+my $query_display_component = '/Elements/TicketList';
+my $query_link_url = 'Search/Results.html';
+
+if ($SavedSearch) {
+ my ( $container_object, $search_id ) = _parse_saved_search($SavedSearch);
+ $search = $container_object->Attributes->WithId($search_id);
+ unless ( $search->Id && ref( $SearchArg = $search->Content ) eq 'HASH' ) {
+ $m->out("Saved Search $SavedSearch not found");
+ return;
+ }
+ $SearchArg->{'SearchType'} ||= 'Ticket';
+ if ( $SearchArg->{SearchType} ne 'Ticket' ) {
+
+ # XXX: dispatch to different handler here
+ $query_display_component
+ = '/Search/Elements/' . $SearchArg->{SearchType};
+ $query_link_url = "Search/$SearchArg->{SearchType}.html";
+ } else {
+ $customize = $RT::WebPath . '/Search/Build.html?'
+ . $m->comp( '/Elements/QueryString',
+ LoadSavedSearch => $SavedSearch );
+ }
+} else {
+ ($search) = RT::System->new( $session{'CurrentUser'} ) ->Attributes->Named( 'Search - ' . $Name );
+ unless ( $search && $search->Id ) {
+ my (@custom_searches) = RT::System->new( $session{'CurrentUser'} )->Attributes->Named('SavedSearch');
+ foreach my $custom (@custom_searches) {
+ if ($custom->Description eq $Name) { $search = $custom; last }
+ }
+ unless ($search && $search->id) {
+ $m->out("Predefined search $Name not found");
+ return;
+ }
+ }
+
+ $SearchArg = $user->Preferences( $search, $search->Content );
+ $customize = $RT::WebPath . '/Prefs/Search.html?'
+ . $m->comp( '/Elements/QueryString',
+ name => ref($search) . '-' . $search->Id );
+}
+
+# ProcessedSearchArg is a search with overridings, but for link we use
+# orginal search's poperties
+my $ProcessedSearchArg = $SearchArg;
+$ProcessedSearchArg = { %$SearchArg, %Override } if keys %Override;
+
+$m->comp(
+ '/Elements/Callback', %ARGS,
+ _CallbackName => 'ModifySearch',
+ OriginalSearch => $SearchArg,
+ Search => $ProcessedSearchArg,
+);
+
+foreach ( $SearchArg, $ProcessedSearchArg ) {
+ $_->{'Query'} =~ s/__CurrentUser__/$session{'CurrentUser'}->Id/ge;
+ $_->{'Format'} =~ s/__WebPath__/$RT::WebPath/g;
+ $_->{'Format'} =~ s/__loc\(["']?(\w+)["']?\)__/loc("$1")/ge;
+}
+
+my $QueryString = '?' . $m->comp( '/Elements/QueryString', %$SearchArg );
+
+</%init>
+<%ARGS>
+$Name => undef
+$SavedSearch => undef
+%Override => ()
+</%ARGS>
diff --git a/rt/html/Elements/SimpleSearch b/rt/html/Elements/SimpleSearch
index 2b34d3a..78abce4 100644
--- a/rt/html/Elements/SimpleSearch
+++ b/rt/html/Elements/SimpleSearch
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,7 +45,7 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<form action="<% $RT::WebPath %>/index.html">
-<input size="12" name="q" autocomplete="off" accesskey="0">
-<input type="submit" value="<&|/l&>Search</&>">&nbsp;
+<form action="<% $RT::WebPath %>/Search/Simple.html">
+ <input size="12" name="q" autocomplete="off" accesskey="0" class="field" />
+ <input type="submit" class="button" value="<&|/l&>Search</&>" />
</form>
diff --git a/rt/html/Elements/Submit b/rt/html/Elements/Submit
index 9d8dca2..ee3e8b6 100644
--- a/rt/html/Elements/Submit
+++ b/rt/html/Elements/Submit
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,54 +45,32 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-% if ($CheckAll or $ClearAll) {
-<script><!--
-function set_checkbox (obj, val) {
- var i;
- var myfield = obj.form.getElementsByTagName('input');
- for (i = 0; i < myfield.length; i++) {
- if (myfield[i].type == 'checkbox') {
- myfield[i].checked = val;
- }
- }
-}
---></script>
-% }
-<TABLE WIDTH=100% BGCOLOR="<%$color%>" CELLSPACING=0 BORDER=0 CELLPADDING=0 >
-<TR>
-<TD>
+<div class="submit">
+ <div class="extra-buttons">
% if ($CheckAll) {
-<INPUT TYPE=BUTTON VALUE="<%$CheckAllLabel%>" ONCLICK="set_checkbox(this, true)">
+ <input type="button" value="<%$CheckAllLabel%>" onclick="setCheckbox(this.form, '<% $CheckboxName %>', true);return false;" class="button" />
% }
% if ($ClearAll) {
-<INPUT TYPE=BUTTON VALUE="<%$ClearAllLabel%>" ONCLICK="set_checkbox(this, false)">
+ <input type="button" value="<%$ClearAllLabel%>" onclick="setCheckbox(this.form, '<% $CheckboxName %>', false);return false;" class="button" />
% }
% if ($Reset) {
-<INPUT TYPE=RESET VALUE="<%$ResetLabel%>">
-%}
-</TD>
-<TD>
-&nbsp;
-</TD>
-<TD ALIGN=RIGHT VALIGN=CENTER><FONT COLOR=#ffd800>
-% if ($AlternateLabel) {
-<B><%$AlternateCaption%>
-<INPUT TYPE=SUBMIT
-%if ($Name) {
-NAME="<%$Name%>"
-%}
-VALUE='<%$AlternateLabel%>'></B>
+ <input type="reset" value="<%$ResetLabel%>" class="button" />
% }
-<B><%$Caption%> <INPUT TYPE=SUBMIT
-%if ($Name) {
-NAME="<%$Name%>"
+ </div>
+ <div class="buttons">
+% if ($AlternateLabel) {
+ <span class="caption"><%$AlternateCaption%></span>
+ <input type="submit" <% $Name && qq[ name="$Name"] | n %> value="<%$AlternateLabel%>" class="button" />
+% } else {
+ <span class="caption"><%$Caption%></span>
+ <input type="submit" <% $Name && qq[ name="$Name"] | n %> value="<%$Label%>" class="button" />
% }
- VALUE='<%$Label%>'></B></FONT>
-</TD>
-</TR>
-</TABLE>
+ </div>
+ <div class="submit-clear"></div>
+</div>
+
<%ARGS>
-$color => "#336699"
+$color => undef
$Caption => ''
$AlternateCaption => undef
$AlternateLabel => undef
@@ -100,6 +80,7 @@ $CheckAll => undef
$CheckAllLabel => loc('Check All')
$ClearAll => undef
$ClearAllLabel => loc('Clear All')
+$CheckboxName => ''
$Reset => undef
$ResetLabel => loc('Reset')
</%ARGS>
diff --git a/rt/html/Elements/Tabs b/rt/html/Elements/Tabs
index b2081ed..5afc54a 100644
--- a/rt/html/Elements/Tabs
+++ b/rt/html/Elements/Tabs
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -65,11 +67,14 @@ my $basetopactions = {
my $basetabs = { A => { title => loc('Homepage'),
path => '',
},
+ Ab => { title => loc('Simple Search'),
+ path => 'Search/Simple.html'
+ },
B => { title => loc('Tickets'),
path => 'Search/Build.html'
},
C => { title => loc('Tools'),
- path => 'Tools/Offline.html'
+ path => 'Tools/index.html'
},
P => { title => loc('Approval'),
path => 'Approvals/'
diff --git a/rt/html/Elements/TicketList b/rt/html/Elements/TicketList
index 1a53127..593a77b 100644
--- a/rt/html/Elements/TicketList
+++ b/rt/html/Elements/TicketList
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,7 +45,7 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH=100%>
+<table border="0" cellspacing="0" cellpadding="1" width="100%">
% if ($ShowHeader) {
<& /Elements/CollectionAsTable/Header,
@@ -67,7 +69,7 @@
<& /Elements/CollectionAsTable/Row, Format => \@Format, i => $i, record => $record, maxitems => $maxitems &>
% }
-</TABLE>
+</table>
% if ($Rows && $ShowNavigation) {
<hr>
@@ -75,7 +77,9 @@
% if (($TotalFound % $Rows) == 0) {
% $oddRows = 0;
% } else { $oddRows = 1; }
-<&|/l, $Page, int($TotalFound/$Rows)+$oddRows&>Page [_1] of [_2]</&>
+% my $pages = int($TotalFound/$Rows)+$oddRows;
+% $pages = 1 if $pages < 1;
+<&|/l, $Page, $pages &>Page [_1] of [_2]</&>
<%perl>
my $prev = $m->comp(
@@ -98,18 +102,27 @@ my $next = $m->comp(
);
</%perl>
% if ($Page > 1) {
-<A href="<%$BaseURL%><%$prev%>"><&|/l&>Previous Page</&></a>
+<a href="<%$BaseURL%><%$prev%>"><&|/l&>Previous Page</&></a>
% }
% if (($Page * $Rows) < $TotalFound) {
-<A href="<%$BaseURL%><%$next%>"><&|/l&>Next Page</&></a>
+<a href="<%$BaseURL%><%$next%>"><&|/l&>Next Page</&></a>
% }
% }
<%INIT>
my $maxitems = 0;
$Format ||= $RT::DefaultSearchResultFormat;
+
+# DisplayFormat lets us use a "temporary" format for display, while
+# still using our original format for next/prev page links.
+# bulk update uses this feature to add checkboxes
+
+
+$DisplayFormat ||= $Format;
+
# Scrub the html of the format string to remove any potential nasties.
$Format = $m->comp('/Elements/ScrubHTML', Content => $Format);
+$DisplayFormat = $m->comp('/Elements/ScrubHTML', Content => $DisplayFormat);
unless ($Collection) {
@@ -117,13 +130,13 @@ unless ($Collection) {
$Collection->FromSQL($Query);
}
-my (@Format) = $m->comp('/Elements/CollectionAsTable/ParseFormat', Format => $Format);
+my (@Format) = $m->comp('/Elements/CollectionAsTable/ParseFormat', Format => $DisplayFormat);
# Find the maximum number of items in any row, so we can pad the table.
my $item = 0;
foreach my $col (@Format) {
$item++;
- if ( $col->{title} eq 'NEWLINE' ) {
+ if ( $col->{title} && ($col->{title} eq 'NEWLINE') ) {
$item = 0;
}
else {
@@ -131,10 +144,20 @@ foreach my $col (@Format) {
}
}
+if ($OrderBy =~ /\|/) {
+ # Multiple Sorts
+ my @OrderBy = split /\|/,$OrderBy;
+ my @Order = split /\|/,$Order;
+ $Collection->OrderByCols(
+ map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } } ( 0
+ .. $#OrderBy ) );;
+} else {
+ $Collection->OrderBy(FIELD => $OrderBy, ORDER => $Order);
+}
-$Collection->OrderBy(FIELD => $OrderBy, ORDER => $Order);
$Collection->RowsPerPage($Rows) if ($Rows);
-$Collection->GotoPage($Page-1); # SB uses page 0 as the first page
+$Page = 1 unless $Page > 0; # workaround problems with Page = '' or undef
+$Collection->GotoPage( $Page - 1 ); # SB uses page 0 as the first page
my $TotalFound = $Collection->CountAll();
</%INIT>
@@ -149,6 +172,7 @@ $Order => undef
$OrderBy => undef
$BaseURL => undef
$Format => $RT::DefaultSearchResultFormat
+$DisplayFormat => undef
$ShowNavigation => 1
$ShowHeader => 1
</%ARGS>
diff --git a/rt/html/Elements/TitleBox b/rt/html/Elements/TitleBox
index 3c638e2..dfab9ea 100644
--- a/rt/html/Elements/TitleBox
+++ b/rt/html/Elements/TitleBox
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,4 +45,7 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<& TitleBoxStart, %ARGS&><%$m->content|n%><& TitleBoxEnd&>
+<%init>
+# For compatibility with 3.4
+$m->comp('/Widgets/TitleBox', %ARGS );
+</%init>
diff --git a/rt/html/Elements/TitleBoxEnd b/rt/html/Elements/TitleBoxEnd
index d791e3a..933d770 100644
--- a/rt/html/Elements/TitleBoxEnd
+++ b/rt/html/Elements/TitleBoxEnd
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,14 +45,7 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
- </TD>
- </TR>
-</TABLE>
-% #Manually flush the content buffer after each titlebox is displayed
-% $m->flush_buffer();
-
-<%ARGS>
-$title => undef
-$content => undef
-</%ARGS>
-
+<%init>
+# For compatibility with 3.4
+$m->comp('/Widgets/TitleBoxEnd', %ARGS );
+</%init>
diff --git a/rt/html/Elements/TitleBoxStart b/rt/html/Elements/TitleBoxStart
index 804e5cf..ba24fd9 100644
--- a/rt/html/Elements/TitleBoxStart
+++ b/rt/html/Elements/TitleBoxStart
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -43,46 +45,7 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<TABLE CLASS="box <%$class|n%>"
- BGCOLOR="<%$color%>"
- CELLSPACING=0
- BORDER=0
- WIDTH="<%$width%>"
- CELLPADDING="0">
-
- <TR>
- <TH
- <%$color && "style=\"color: $color;\""|n%>
- <%$class ? "class=\"$class\"" : "class=\"titlebox\""|n%>>
- <span class="titleboxclose">
- <a href="#" onClick="hideshow('<%$id%>')">X</A></span>&nbsp;
- <span class="titleboxtitle">
- <b><% $title_href && "<A $title_class HREF=\"$title_href\">"|n%><%$title |n %><% $title_href && "</A>" |n%></b>
- </span>
- </TH>
- <TH
- <%$color && "style=\"color: $color;\""|n%>
- <%$class ? "class=\"$class\"": "class=\"titleboxright\""|n%>>
- <span class="titleboxright"><%$titleright ? $titleright : '&nbsp;' |n %></span>
- </TH>
- </TR>
- <tr id="element-<%$id%>">
- <td bgcolor="<%$contentbg%>" colspan="3" class="<%defined($bodyclass) ? $bodyclass : $class|n%>">
-<%ARGS>
-$width => "100%"
-$class => undef
-$bodyclass => undef
-$title_href => undef
-$title => undef
-$title_class => ''
-
-$titleright_href => undef
-$titleright => undef
-$contentbg => "#dddddd"
-$color => "#336699"
-</%ARGS>
<%init>
-my $id = rand(2000);
-
-$title_class = "CLASS=\"$title_class\"" if $title_class;
+# For compatibility with 3.4
+$m->comp('/Widgets/TitleBoxStart', %ARGS );
</%init>
diff --git a/rt/html/Elements/ValidateCustomFields b/rt/html/Elements/ValidateCustomFields
new file mode 100644
index 0000000..4830219
--- /dev/null
+++ b/rt/html/Elements/ValidateCustomFields
@@ -0,0 +1,81 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
+%# <jesse@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/copyleft/gpl.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 $valid = 1;
+$CustomFields->GotoFirstItem;
+while (my $CF = $CustomFields->Next) {
+ my $pattern = $CF->Pattern;
+ my $field = $NamePrefix . $CF->Id . "-Value";
+ my $value;
+
+ if ($ARGSRef->{"${field}s-Magic"} and exists $ARGSRef->{"${field}s"}) {
+ $value = $ARGSRef->{"${field}s"};
+
+ # We only validate Single Combos -- multis can never be user input
+ next if ref $value;
+ }
+ else {
+ $value = $ARGSRef->{$field};
+ }
+
+ $m->notes(('Field-' . $CF->Id) => $value);
+ next if $CF->MatchPattern($value);
+ $m->notes(
+ ('InvalidField-' . $CF->Id)
+ => (loc("Input must match [_1]", $CF->FriendlyPattern))
+ );
+ $valid = 0;
+}
+$m->notes('ValidFields', $valid);
+return $valid;
+</%INIT>
+<%ARGS>
+$CustomFields
+$ARGSRef
+$NamePrefix => "Object-RT::Ticket--CustomField-"
+</%ARGS>