diff options
author | ivan <ivan> | 2005-10-15 09:11:20 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-10-15 09:11:20 +0000 |
commit | d4d0590bef31071e8809ec046717444b95b3f30a (patch) | |
tree | ee1236da50578390d2642114f28eaed99a5efb18 /rt/html/Elements | |
parent | d39d52aac8f38ea9115628039f0df5aa3ac826de (diff) |
import rt 3.4.4
Diffstat (limited to 'rt/html/Elements')
71 files changed, 1504 insertions, 591 deletions
diff --git a/rt/html/Elements/BevelBoxRaisedEnd b/rt/html/Elements/BevelBoxRaisedEnd index f1c794b37..e1d1edb7c 100644 --- a/rt/html/Elements/BevelBoxRaisedEnd +++ b/rt/html/Elements/BevelBoxRaisedEnd @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} </TD> </TR> </table> diff --git a/rt/html/Elements/BevelBoxRaisedStart b/rt/html/Elements/BevelBoxRaisedStart index ca504e4b2..6c5a6137e 100644 --- a/rt/html/Elements/BevelBoxRaisedStart +++ b/rt/html/Elements/BevelBoxRaisedStart @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <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 cbec1883d..937e923a1 100644 --- a/rt/html/Elements/Callback +++ b/rt/html/Elements/Callback @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,43 +42,45 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%once> -my (%cache, $check); +my %cache; </%once> <%init> -# checks for inode change time for each callback directory -my $new_check = join( - $;, map { $_->[1] => (stat("$_->[1]/Callbacks"))[10] } $m->interp->resolver->comp_root_array -) or return; - $Page = $m->callers(1)->path unless ($Page); -my $callbacks; -if ($new_check eq $check) { - $callbacks = $cache{$Page,$_CallbackName}; -} -else { - $check = $new_check; -} +my $CacheKey = "Callback--$Page--$_CallbackName"; +my $callbacks = $cache{$CacheKey} || $m->notes($CacheKey); if (!$callbacks) { - my $path = "/Callbacks/*$Page/$_CallbackName"; - $callbacks = [ $m->interp->resolver->glob_path($path) ]; - @$callbacks = grep !/^\.|~$/, @$callbacks; #skip backup files - - #skip files without a package - my $invalid_base = "/Callbacks/$Page/$_CallbackName"; - @$callbacks = grep !/^$invalid_base$/, @$callbacks; - - + my $path = "/Callbacks/*$Page/$_CallbackName"; - $cache{$Page,$_CallbackName} = $callbacks; + # Due to API changes after Mason 1.28, we have to check for which + # version we're running when getting the component roots + my @roots = map { $_->[1] } + $HTML::Mason::VERSION <= 1.28 + ? $m->interp->resolver->comp_root_array + : $m->interp->comp_root_array; + + my %seen; + + for my $root (@roots) { + push @$callbacks, + # Skip backup files, files without a leading package name, + # and files we've already seen + grep { !/^\.|~$/ + and $_ ne "/Callbacks/$Page/$_CallbackName" + and not $seen{$_}++ } + $m->interp->resolver->glob_path($path, $root); + } + + $m->notes($CacheKey => $callbacks); + $cache{$Page,$_CallbackName} = $callbacks if !$RT::DevelMode; } my @rv; foreach my $comp (sort @$callbacks) { - push @rv, $m->comp($comp, %ARGS) if $m->comp_exists($comp); + push @rv, $m->comp($comp, %ARGS); } return @rv; </%init> diff --git a/rt/html/Elements/Checkbox b/rt/html/Elements/Checkbox index 146de6a7a..f2256fb78 100644 --- a/rt/html/Elements/Checkbox +++ b/rt/html/Elements/Checkbox @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,8 +42,8 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<INPUT TYPE="Checkbox" NAME ="<%$Name%>" <%$IsChecked%>> +%# END BPS TAGGED BLOCK }}} +<INPUT TYPE="Checkbox" NAME="<%$Name%>" value="1" <%$IsChecked%>> <%ARGS> $Name => undef diff --git a/rt/html/Elements/CollectionAsTable/Header b/rt/html/Elements/CollectionAsTable/Header index 2d1574dea..9ed4be8ec 100644 --- a/rt/html/Elements/CollectionAsTable/Header +++ b/rt/html/Elements/CollectionAsTable/Header @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK; +%# BEGIN BPS TAGGED BLOCK {{{ %# -%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> %# -%# (Except where explictly superceded by other copyright notices) +%# (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 @@ -14,16 +20,32 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# 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. %# %# -%# END LICENSE BLOCK - +%# 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 }}} <%ARGS> @Format => undef +$FormatString => undef $AllowSorting => undef $Order=>undef $BaseURL => undef @@ -32,53 +54,63 @@ $Rows => undef $Page => undef $maxitems => undef </%ARGS> -<TR> +<TR class="collection-as-table"> <%perl> -my %generic_query_args = ( Query => $Query, Rows => $Rows, Page => $Page ); +my %generic_query_args = ( Query => $Query, Rows => $Rows, Page => $Page, Format => $FormatString ); my $item = 0; -$$maxitems = 0; foreach my $col (@Format) { $item++; - $$maxitems = $item if $item > $$maxitems; if ( $col->{title} eq 'NEWLINE' ) { - $m->out('</TR> <TR>'); - $item = 0; + while ( $item < $maxitems ) { + $m->out(qq{<th class="collection-as-table"> </th>\n}); + $item++; + } + + $item = 0; + $m->out(qq{</TR>\n<TR class="collection-as-table">}); } else { - $m->out('<TH align="center">'); + $m->out('<TH class="collection-as-table">'); my $title = $col->{title}; $title =~ s/^__(.*)__$/$1/o; - $title = ( $m->comp('/Elements/RT__Ticket/ColumnMap', - Name => $title, - Attr => 'title' - ) - || $title - ); - if ( $AllowSorting + $title = ( + $m->comp( + '/Elements/RT__Ticket/ColumnMap', + Name => $title, + Attr => 'title' + ) + || $title + ); + if ( + $AllowSorting && $col->{'attribute'} - && $m->comp('/Elements/RT__Ticket/ColumnMap', - Name => $col->{'attribute'}, - Attr => 'attribute' ) - ) + && $m->comp( + '/Elements/RT__Ticket/ColumnMap', + Name => $col->{'attribute'}, + Attr => 'attribute' + ) + ) { $m->out( - '<a href="' . $BaseURL + '<a href="' . $BaseURL . $m->comp( '/Elements/QueryString', %generic_query_args, OrderBy => ( - $m->comp('/Elements/RT__Ticket/ColumnMap', - Name => $col->{'attribute'}, - Attr => 'attribute' - ) + $m->comp( + '/Elements/RT__Ticket/ColumnMap', + Name => $col->{'attribute'}, + Attr => 'attribute' + ) || $col->{'attribute'} ), Order => ( $ARGS{'Order'} eq 'ASC' ? 'DESC' : 'ASC' ) - ). - '">' . loc($title) . '</a>' + ) + . '">' + . loc($title) . '</a>' ); } else { diff --git a/rt/html/Elements/CollectionAsTable/ParseFormat b/rt/html/Elements/CollectionAsTable/ParseFormat index c7b709bff..57434efe2 100644 --- a/rt/html/Elements/CollectionAsTable/ParseFormat +++ b/rt/html/Elements/CollectionAsTable/ParseFormat @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK; +%# BEGIN BPS TAGGED BLOCK {{{ %# -%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> %# -%# (Except where explictly superceded by other copyright notices) +%# (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 @@ -14,44 +20,59 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# 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. %# %# -%# END LICENSE BLOCK - +%# 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 }}} <%ARGS> $Format </%ARGS> <%init> -use Regexp::Common qw(delimited); +use Regexp::Common; my @Columns; -#my $quoted = qr[$RE{delimited}{-delim=>qq{\'\"}}|(?:\{|\}|\w|\.)+]; -my $justquoted = qr[$RE{delimited}{-delim=>qq{\'\"}}]; -#my $quoted = $RE{quoted}{-esc}; -my $word = qr [(?:\{|\}|\w|\.)+]; -while ($Format =~ /($justquoted|$word)/igx) { +while ($Format =~ /($RE{delimited}{-delim=>qq{\'"}}|[{}\w.]+)/go) { my $col = $1; - if ($col =~ /^$RE{quoted}{-esc}$/) { + if ($col =~ /^$RE{quoted}$/o) { substr($col,0,1) = ""; substr($col,-1,1) = ""; } my $colref; - if ( $col =~ s/\/STYLE:(.*?)$//io ) { + + if ( $col =~ s!/STYLE:([^/]+)!!io ) { $colref->{'style'} = $1; } - if ( $col =~ s/\/CLASS:(.*?)$//io ) { + if ( $col =~ s!/CLASS:([^/]+)!!io ) { $colref->{'class'} = $1; } - if ( $col =~ s/\/TITLE:(.*?)$//io ) { + if ( $col =~ s!/TITLE:([^/]+)!!io ) { $colref->{'title'} = $1; } + if ( $col =~ s!/ALIGN:([^\/]+)!!io ) { + $colref->{'align'} = $1; + } if ( $col =~ /__(.*?)__/gio ) { my @subcols; while ( $col =~ s/^(.*?)__(.*?)__//o ) { diff --git a/rt/html/Elements/CollectionAsTable/Row b/rt/html/Elements/CollectionAsTable/Row index 926317be9..3316bc027 100644 --- a/rt/html/Elements/CollectionAsTable/Row +++ b/rt/html/Elements/CollectionAsTable/Row @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK; +%# BEGIN BPS TAGGED BLOCK {{{ %# -%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> %# -%# (Except where explictly superceded by other copyright notices) +%# (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 @@ -14,14 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# 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. %# %# -%# END LICENSE BLOCK - +%# 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 }}} <%ARGS> $i => undef @Format => undef @@ -32,35 +53,56 @@ $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' ) { - while ($item < $maxitems) { - $m->out("<td> </td>\n"); - $item++; - } - $item = 0; + while ( $item < $maxitems ) { + $m->out(qq{<td class="collection-as-table"> </td>\n}); + $item++; + } + $item = 0; $m->out('</TR>'); - $m->out( '<TR class="' . - ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) . '" >' ); + $m->out('<TR class="' + . ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) + . '" >' ); next; } $item++; - $m->out('<td align="left">'); + $m->out('<td class="collection-as-table" '); + $m->out( 'align="' . $column->{align} . '"' ) if ( $column->{align} ); + $m->out('>'); foreach my $subcol ( @{ $column->{output} } ) { if ( $subcol =~ /^__(.*?)__$/o ) { - my $col = $1; - my $value = $m->comp('/Elements/RT__Ticket/ColumnMap', Name => $col, Attr => 'value'); + my $col = $1; + my $value = $m->comp( + '/Elements/RT__Ticket/ColumnMap', + Name => $col, + Attr => 'value' + ); + my @out; + + if ( $value && ref($value) ) { + + # All HTML snippets are returned by the callback function + # as scalar references. Data fetched from the objects are + # plain scalars, and needs to be escaped properly. + @out = + map { + ref($_) ? $$_ : $m->interp->apply_escapes( $_ => 'h' ) + } &{$value}( $record, $i ) + ; + } + else { - if ( $value && ref($value)) { - $m->out( &{ $value } ( $record, $i ) ); - } else { - $m->out($value ); + # Simple value; just escape it. + @out = $m->interp->apply_escapes( $value => 'h' ); } + s/\n/<br>/gs for @out; + $m->out( @out ); } else { - $m->out( Encode::decode_utf8($subcol) ); + $m->out($subcol); } } $m->out('</td>'); diff --git a/rt/html/Elements/CreateTicket b/rt/html/Elements/CreateTicket index 70c94e78f..bd60bbddf 100644 --- a/rt/html/Elements/CreateTicket +++ b/rt/html/Elements/CreateTicket @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<FORM ACTION="<% $RT::WebPath%>/Ticket/Create.html"> +%# 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"> [_1]</&> </FORM> diff --git a/rt/html/Elements/EditCustomField b/rt/html/Elements/EditCustomField new file mode 100644 index 000000000..d2398c9da --- /dev/null +++ b/rt/html/Elements/EditCustomField @@ -0,0 +1,89 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 $Values; +if ($Object) { + $Values = $Object->CustomFieldValues($CustomField->id); + $Values->Columns( qw( id CustomField ObjectType ObjectId Disabled Content ContentType ContentEncoding ) ); + $NamePrefix ||= join('-', 'Object', ref($Object), $Object->Id, 'CustomField', ''); +} +my $Type = $CustomField->Type; + +return unless ($Type); # if we can't see the type, all hell will break loose. + +my $MaxValues = $CustomField->MaxValues; +if ($MaxValues == 1 and $Object and $Values) { + # what exactly is this doing? Without the "unless" it breaks RTFM + # transaction extraction into articles. + $Default = ($Values->First ? $Values->First->Content : '') unless $Default; + $Values->GotoFirstItem; +} +# 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"); + +return $m->comp( + "EditCustomField$Type", + %ARGS, + Rows => $Rows, + Cols => $Cols, + Default => $Default, + Object => $Object, + Values => $Values, + MaxValues => $MaxValues, + Multiple => ($MaxValues != 1), + NamePrefix => $NamePrefix, + CustomField => $CustomField, +); +</%INIT> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Rows => 5 +$Cols => 15 +$Default => undef +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldBinary b/rt/html/Elements/EditCustomFieldBinary new file mode 100644 index 000000000..002825660 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldBinary @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 ) { +%# 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> +% } +% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) { +<input type="file" name="<%$NamePrefix%><%$CustomField->Id%>-Upload"> +% } +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldFreeform b/rt/html/Elements/EditCustomFieldFreeform new file mode 100644 index 000000000..c097ee0a9 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldFreeform @@ -0,0 +1,68 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if ($Multiple) { +<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><%$Default%></textarea> +% } else { +<input name="<%$NamePrefix%><%$CustomField->Id%>-Value" size="<%$Cols%>" value="<%$Default ? $Default : ''%>"> +% } +<%INIT> +if ($Multiple and $Values) { + $Default = ''; + while (my $value = $Values->Next ) { + $Default .= $value->Content."\n"; + } +} +</%INIT> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$Multiple => undef +$Cols +$Rows +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldImage b/rt/html/Elements/EditCustomFieldImage new file mode 100644 index 000000000..b378ceae6 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldImage @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 ) { +<input type="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"> +% } +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldSelect b/rt/html/Elements/EditCustomFieldSelect new file mode 100644 index 000000000..db33a6839 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldSelect @@ -0,0 +1,71 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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="<%$NamePrefix%><%$CustomField->Id%>-Values" + size="<%$Rows%>" + <% $Multiple && 'MULTIPLE' %>> +% my $selected; +% my $CFVs = $CustomField->Values; +% while ($CFVs and my $value = $CFVs->Next ) { + <option value="<%$value->Name%>" +% if ($Values) { + <% $Values->HasEntry($value->Name) && ($selected = 1) && 'SELECTED' %> +% } elsif ($Default) { + <% ($Default eq $value->Name) && ($selected = 1) && 'SELECTED' %> +% } + ><% $value->Name%></option> +% } + <option value="" <% !$selected && 'SELECTED' %>><&|/l&>(no value)</&></option> + </select> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$Multiple => 0 +$Cols +$Rows +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldText b/rt/html/Elements/EditCustomFieldText new file mode 100644 index 000000000..1aac3283b --- /dev/null +++ b/rt/html/Elements/EditCustomFieldText @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 ) { +<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> +% } +<%INIT> +# XXX - MultiValue textarea is for now outlawed. +$MaxValues = 1; +</%INIT> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef +$Cols +$Rows +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldWikitext b/rt/html/Elements/EditCustomFieldWikitext new file mode 100644 index 000000000..1aac3283b --- /dev/null +++ b/rt/html/Elements/EditCustomFieldWikitext @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 ) { +<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> +% } +<%INIT> +# XXX - MultiValue textarea is for now outlawed. +$MaxValues = 1; +</%INIT> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef +$Cols +$Rows +</%ARGS> diff --git a/rt/html/Elements/EditLinks b/rt/html/Elements/EditLinks index b66291f30..68c08dd16 100755 --- a/rt/html/Elements/EditLinks +++ b/rt/html/Elements/EditLinks @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <TABLE width=100%> <TR> <TD VALIGN=TOP WIDTH=50%> @@ -57,7 +57,7 @@ <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%>"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1"> <& ShowLink, URI => $link->TargetURI &><br> % } </td> @@ -67,7 +67,7 @@ <td class="value"> % while (my $link = $Object->DependedOnBy->Next) { % my $member = $link->BaseObj; - <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1"> <& ShowLink, URI => $link->BaseURI &><br> % } </td> @@ -76,7 +76,7 @@ <td class="labeltop"><&|/l&>Parents</&>:</td> <td class="value"> % while (my $link = $Object->MemberOf->Next) { - <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1"> <& ShowLink, URI => $link->TargetURI &><br> % } </td> @@ -85,7 +85,7 @@ <td class="labeltop"><&|/l&>Children</&>:</td> <td class="value"> % while (my $link = $Object->Members->Next) { - <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1"> <& ShowLink, URI => $link->BaseURI &><br> % } </td> @@ -94,7 +94,7 @@ <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%>"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1"> <& ShowLink, URI => $link->TargetURI &><br> %} </td> @@ -103,7 +103,7 @@ <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%>-"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1"> <& ShowLink, URI => $link->BaseURI &><br> % } </td> @@ -114,9 +114,12 @@ <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.</&></i><br> +<i><&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces.</&> +<& /Elements/Callback, _CallbackName => 'ExtraLinkInstructions' &> +</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><&|/l&>Enter queues or URIs to link queues to. Separate multiple entries with spaces.</&> +</i><br> % } else { <i><&|/l&>Enter objects or URIs to link objects to. Separate multiple entries with spaces.</&></i><br> % } diff --git a/rt/html/Elements/Error b/rt/html/Elements/Error index 3aa77a51e..bc5a1880a 100644 --- a/rt/html/Elements/Error +++ b/rt/html/Elements/Error @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Callback, %ARGS, error => $error &> <& /Elements/Header, Code => $Code, Why => $Why &> <& /Elements/Tabs &> @@ -53,9 +53,11 @@ <%$Details%> </font> <& /Elements/TitleBoxEnd &> -</body> -</HTML> +<%cleanup> +$m->comp('/Elements/Footer'); +$m->abort(); +</%cleanup> <%args> $Code => undef diff --git a/rt/html/Elements/Footer b/rt/html/Elements/Footer index 213761e91..4c90acfa3 100644 --- a/rt/html/Elements/Footer +++ b/rt/html/Elements/Footer @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if ($Menu) { </td> </tr> @@ -51,20 +51,12 @@ % } <& /Elements/Callback, %ARGS &> <div class="bpscredits"> -<&|/l, '»|«', - $RT::VERSION, - '2004', - '<a href="http://www.bestpractical.com?rt='.$RT::VERSION.'">Best Practical Solutions, LLC</a>', -&>[_1] RT [_2] Copyright 1996-[_3] [_4].</&><br> +<&|/l, '»|«', $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> % 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> % } </div> -% if ($Debug) { -<HR> -<b><&|/l&>Time to display</&>: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%></b> -% } % if ($Debug >= 2 ) { % require Data::Dumper; % my $d = Data::Dumper->new([\%ARGS], [qw(%ARGS)]); @@ -72,6 +64,7 @@ <%$d->Dump() %> </pre> % } +<div class="page-stats"><&|/l&>Time to display</&>: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%></div> % if ($Menu) { </TD> </TR> diff --git a/rt/html/Elements/GotoTicket b/rt/html/Elements/GotoTicket index 393b28f89..869d57ef1 100644 --- a/rt/html/Elements/GotoTicket +++ b/rt/html/Elements/GotoTicket @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,5 +42,5 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <FORM ACTION="<%$RT::WebPath%>/Ticket/Display.html"><input type=submit value="<&|/l&>Goto ticket</&>"> <input size=5 name=id accesskey="0"></FORM> diff --git a/rt/html/Elements/Header b/rt/html/Elements/Header index 5d9bbb08b..8c3775bba 100644 --- a/rt/html/Elements/Header +++ b/rt/html/Elements/Header @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %#<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <HEAD> @@ -77,16 +77,18 @@ ONLOAD=" > <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="" width="230" height="50"></a></td> + <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> </td> <td> </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> +% } <& /Elements/Callback, %ARGS &> % unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { -| <A HREF="<%$RT::WebPath%>/NoAuth/Logout.html<%$URL && "?URL=".$URL%>"><&|/l&>Logout</&></a> +| <A HREF="<%$RT::WebPath%>/NoAuth/Logout.html<%$URL ? "?URL=".$URL : ''%>"><&|/l&>Logout</&></a> % } <BR> <&|/l, "<b>".$session{'CurrentUser'}->Name."</b>" &>Logged in as [_1]</&> @@ -105,7 +107,7 @@ $r->headers_out->{'Cache-control'} = 'no-cache'; <%ARGS> $Prefs => '/User/Prefs.html' $Focus => 'focus' -$Title => undef +$Title => 'RT' $Code => undef $Refresh => 0 $Why => undef diff --git a/rt/html/Elements/ListActions b/rt/html/Elements/ListActions index 344fe9e5a..8433d17e0 100644 --- a/rt/html/Elements/ListActions +++ b/rt/html/Elements/ListActions @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if ($actions[0] ) { <& /Elements/TitleBoxStart, title => loc('Results') &> <UL> diff --git a/rt/html/Elements/Login b/rt/html/Elements/Login index 25ded9ff3..1d4bfd5ec 100644 --- a/rt/html/Elements/Login +++ b/rt/html/Elements/Login @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%INIT> if ($m->request_comp->path =~ '^/REST/\d+\.\d+/') { $r->content_type("text/plain"); @@ -67,7 +67,7 @@ if ($m->request_comp->path =~ '^/REST/\d+\.\d+/') { contentbg=>"#cccccc" &> % unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { -<FORM METHOD=POST ACTION="<% (UNIVERSAL::can($r, 'uri') && ($r->uri) =~ m!.*/(.*)!) %>" > +<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> diff --git a/rt/html/Elements/Menu b/rt/html/Elements/Menu index 0e57585c5..398e3ab07 100644 --- a/rt/html/Elements/Menu +++ b/rt/html/Elements/Menu @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# font size depends on level % if ($level ge 3) { % $size = $basesize-(6); @@ -69,16 +69,17 @@ % } % my $style=""; % if ($sep) { -% $style="border-top: solid #999 1px; padding-top: .1em; margin-top: .5em;"; +% $style="minor"; % } elsif ($level == 0 ) { -% $style="border-bottom: solid white 1px; padding-top: .25em; padding-bottom: .5em;" ; +% $style="major"; % } % if ($toptabs->{$tab}->{'separator'}) { % $sep=1; % } else { % $sep=0; % } -<li style="<%$style%>"><A HREF="<%$RT::WebPath%>/<%$toptabs->{$tab}->{'path'}%>" style="font-size: <%$size%>;" class="<%$class%>" +% 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> %# Second-level items diff --git a/rt/html/Elements/MessageBox b/rt/html/Elements/MessageBox index 5faa9575c..dd48bec9a 100644 --- a/rt/html/Elements/MessageBox +++ b/rt/html/Elements/MessageBox @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,8 +42,8 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<TEXTAREA COLS=<%$Width%> ROWS=<%$Height%> WRAP=<%$Wrap%> NAME="<%$Name%>"><& /Elements/Callback, %ARGS &><% $Default %><%$message%><%$IncludeSignature ? $signature : ''%></TEXTAREA> +%# END BPS TAGGED BLOCK }}} +<textarea class="messagebox" COLS=<%$Width%> ROWS=<%$Height%> WRAP=<%$Wrap%> NAME="<%$Name%>"><& /Elements/Callback, %ARGS &><% $Default %><%$message%><%$IncludeSignature ? $signature : ''%></textarea> <%INIT> my ($message); diff --git a/rt/html/Elements/MyRequests b/rt/html/Elements/MyRequests index 4e1bf3eaf..172b4a4fa 100644 --- a/rt/html/Elements/MyRequests +++ b/rt/html/Elements/MyRequests @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <&|/Elements/TitleBox, title => loc("[_1] newest unowned tickets", $rows), title_href => "Search/Results.html".$QueryString &> @@ -61,9 +61,10 @@ my $rows = $RT::MyRequestsLength; my $Query = "Owner = 'Nobody' AND ( Status = 'new' OR Status = 'open')"; -my $QueryString = '?' . $m->comp('/Elements/QueryString', - Query => $Query, - Order => 'DESC', - OrderBy => 'Priority') if ($Query); +my $QueryString = ""; +$QueryString = '?' . $m->comp('/Elements/QueryString', + Query => $Query, + Order => 'DESC', + OrderBy => 'Priority') if ($Query); </%init> diff --git a/rt/html/Elements/MyTickets b/rt/html/Elements/MyTickets index 9f30a893b..cf5225abc 100644 --- a/rt/html/Elements/MyTickets +++ b/rt/html/Elements/MyTickets @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <&|/Elements/TitleBox, title => loc('[_1] highest priority tickets I own', $rows), title_href => "Search/Results.html".$QueryString &> @@ -61,10 +61,11 @@ my $rows = $RT::MyTicketsLength; my $Query = " Owner = '".$session{'CurrentUser'}->Id."' AND ( Status = 'new' OR Status = 'open')"; -my $QueryString = '?' . $m->comp('/Elements/QueryString', - Query => $Query, - Order => 'DESC', - OrderBy => 'Priority') if ($Query); +my $QueryString = ""; +$QueryString = '?' . $m->comp('/Elements/QueryString', + Query => $Query, + Order => 'DESC', + OrderBy => 'Priority') if ($Query); </%init> diff --git a/rt/html/Elements/PageLayout b/rt/html/Elements/PageLayout index 4670a8bb2..3d7241dad 100644 --- a/rt/html/Elements/PageLayout +++ b/rt/html/Elements/PageLayout @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# 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> @@ -76,7 +76,7 @@ % if ($actions->{"$action"}->{'html'}) { % push @actions, $actions->{"$action"}->{'html'}; % } else { -% push @actions, "<A class='nav' HREF=\"".$RT::WebPath."/".$actions->{$action}->{'path'}."\">".$actions->{$action}->{'title'}."</A>"; +% push @actions, qq|<a class="nav" href="|.$RT::WebPath."/".$actions->{$action}->{'path'}.qq|">|.$actions->{$action}->{'title'}."</a>"; % } % } <% join(" | ", @actions) | n %> @@ -93,11 +93,12 @@ </tr> <TR valign="top"> <TD valign="top" width="100%" height="100%" class="mainbody" > - +<& /Elements/Callback, _CallbackName => 'BeforeBody', %ARGS &> +%$m->flush_buffer(); # we've got the page laid out, let's flush the buffer; <%INIT> foreach my $tab (sort keys %{$toptabs}) { - if ($toptabs->{$tab}->{'path'} eq $current_toptab) { + if ($current_toptab && $toptabs->{$tab}->{'path'} eq $current_toptab) { $toptabs->{$tab}->{"subtabs"} = $tabs; $toptabs->{$tab}->{"current_subtab"} = $current_tab; } diff --git a/rt/html/Elements/QueryString b/rt/html/Elements/QueryString index cbec29a30..7d41f15e0 100644 --- a/rt/html/Elements/QueryString +++ b/rt/html/Elements/QueryString @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%init> my @params; while ( (my $key, my $value) = each %ARGS ){ diff --git a/rt/html/Elements/QuickCreate b/rt/html/Elements/QuickCreate index 10cfbd3c0..0d2489c61 100644 --- a/rt/html/Elements/QuickCreate +++ b/rt/html/Elements/QuickCreate @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/TitleBoxStart, title => loc('Quick ticket creation') &> <form method="post" action="<%$RT::WebPath%>/index.html"> <input type="hidden" name="QuickCreate" value="1"> diff --git a/rt/html/Elements/Quicksearch b/rt/html/Elements/Quicksearch index 103c760c7..d54f72e88 100644 --- a/rt/html/Elements/Quicksearch +++ b/rt/html/Elements/Quicksearch @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,42 +42,40 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/TitleBoxStart, title => loc("Quick search"), bodyclass => "" &> <TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH=100%> <tr> - <th align=left><&|/l&>Queue</&></th> - <th align=right><font size=-1><&|/l&>New</&></font></th> - <th align=right><font size=-1><&|/l&>Open</&></font></th> + <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) { - my $new_q = "Queue = '".$queue->Name."' AND Status = 'new'"; - my $open_q = "Queue = '".$queue->Name."' AND Status = 'open'"; - my $all_q = "Queue = '".$queue->Name."' AND (Status = 'open' OR Status = 'new')"; + 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->ClearRestrictions; - $Tickets->LimitStatus(VALUE => "open"); - $Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR => '='); - my $open = $Tickets->Count(); - - $Tickets->ClearRestrictions; - $Tickets->LimitStatus(VALUE => "new"); - $Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR => '='); - my $new = $Tickets->Count(); - + $Tickets->FromSQL($open_q); + my $open = $Tickets->Count(); + $Tickets->FromSQL($new_q); + my $new = $Tickets->Count(); + $i++; </%PERL> -% $i++; <TR class="<% $i%2 ? 'oddline' : 'evenline'%>" > -<td><A HREF="<% $RT::WebPath%>/Search/Results.html?Query=<%$all_q%>&Rows=50" TITLE="<% $queue->Description %>"><%$queue->Name%></a></TD> -<td align="right"><A HREF="<% $RT::WebPath%>/Search/Results.html?Query=<%$new_q%>&Rows=50"><%$new%></a></TD> -<td align="right"><A HREF="<% $RT::WebPath%>/Search/Results.html?Query=<%$open_q%>&Rows=50"><%$open%></a></TD> +<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> diff --git a/rt/html/Elements/RT__Ticket/ColumnMap b/rt/html/Elements/RT__Ticket/ColumnMap index a6d387cae..dade91494 100644 --- a/rt/html/Elements/RT__Ticket/ColumnMap +++ b/rt/html/Elements/RT__Ticket/ColumnMap @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK; +%# BEGIN BPS TAGGED BLOCK {{{ %# -%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> %# -%# (Except where explictly superceded by other copyright notices) +%# (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 @@ -14,25 +20,37 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# 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. %# %# -%# END LICENSE BLOCK - +%# 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 }}} <%ARGS> $Name => undef $Attr => undef </%ARGS> -<%perl> -return ColumnMap($Name, $Attr); -</%perl> -<%INIT> -our ( $COLUMN_MAP, $CUSTOM_FIELD_MAP ); +<%ONCE> +our ( $COLUMN_MAP ); sub ColumnMap { my $name = shift; @@ -45,46 +63,52 @@ sub ColumnMap { # now, let's deal with harder things, like Custom Fields - elsif ( $name =~ /^(?:CF|CustomField).(.*)$/ ) { + elsif ( $name =~ /^(?:CF|CustomField)\.\{(.+)\}$/ ) { my $field = $1; - my $cf; - if ( $CUSTOM_FIELD_MAP->{$field} ) { - $cf = $CUSTOM_FIELD_MAP->{$field}; - } - else { - - $cf = RT::CustomField->new( $session{'CurrentUser'} ); - - if ( $field =~ /^(.+?)\.{(.+)}$/ ) { - $cf->LoadByNameAndQueue( Queue => $1, Name => $2 ); - } - else { - $field = $1 if $field =~ /^{(.+)}$/; # trim { } - $cf->LoadByNameAndQueue( Queue => "0", Name => $field ); - } - $CUSTOM_FIELD_MAP->{$field} = $cf if ( $cf->id ); - } - - unless ( $cf->id ) { - return undef; - } if ( $attr eq 'attribute' ) { return (undef); } elsif ( $attr eq 'title' ) { - return ( $cf->Name ); + return ( $field ); } elsif ( $attr eq 'value' ) { - my $value = eval "sub { - my \$values = \$_[0]->CustomFieldValues('" . $cf->id . "'); - return ( join( ', ', map { \$_->Content } \@{ \$values->ItemsArrayRef } )) - }" || die $@; - return ($value); + # Display custom field contents, separated by newlines. + # For Image custom fields we also show a thumbnail here. + return sub { + my $values = $_[0]->CustomFieldValues($field); + return map { + ( + ($_->CustomFieldObj->Type eq 'Image') + ? \($m->scomp( '/Elements/ShowCustomFieldImage', Object => $_ )) + : $_->Content + ), + \'<br>', + } @{ $values->ItemsArrayRef } + }; } } } +sub LinkCallback { + my $method = shift; + + my $mode = $RT::Ticket::LINKTYPEMAP{$method}{Mode}; + my $type = $RT::Ticket::LINKTYPEMAP{$method}{Type}; + my $mode_uri = $mode.'URI'; + my $local_type = 'Local'.$mode; + + return sub { + map { + \'<A HREF="', + $_->$mode_uri->Resolver->HREF, + \'">', + ( $_->$mode_uri->IsLocal ? $_->$local_type : $_->$mode ), + \'</A><BR>', + } @{ $_[0]->Links($mode,$type)->ItemsArrayRef } + } +} + $COLUMN_MAP = { QueueName => { attribute => 'Queue', @@ -103,7 +127,7 @@ $COLUMN_MAP = { }, Status => { attribute => 'Status', - value => sub { return $_[0]->Status } + value => sub { return loc($_[0]->Status) } }, Subject => { attribute => 'Subject', @@ -119,10 +143,10 @@ $COLUMN_MAP = { if ( $Ticket->HasUnresolvedDependencies( Type => 'approval' ) or $Ticket->HasUnresolvedDependencies( Type => 'code' ) ) { - return "<em>" . loc('(pending approval)') . "</em>"; + return \'<em>', loc('(pending approval)'), \'</em>'; } else { - return "<em>" . loc('(pending other Collection)') . "</em>"; + return \'<em>', loc('(pending other Collection)'), \'</em>'; } } else { @@ -137,10 +161,12 @@ $COLUMN_MAP = { }, InitialPriority => { attribute => 'InitialPriority', + name => 'Initial Priority', value => sub { return $_[0]->InitialPriority } }, FinalPriority => { attribute => 'FinalPriority', + name => 'Final Priority', value => sub { return $_[0]->FinalPriority } }, EffectiveId => { @@ -153,14 +179,17 @@ $COLUMN_MAP = { }, TimeWorked => { attribute => 'TimeWorked', + title => 'Time Worked', value => sub { return $_[0]->TimeWorked } }, TimeLeft => { attribute => 'TimeLeft', + title => 'Time Left', value => sub { return $_[0]->TimeLeft } }, TimeEstimated => { attribute => 'TimeEstimated', + title => 'Time Estimated', value => sub { return $_[0]->TimeEstimated } }, Requestors => { @@ -188,7 +217,7 @@ $COLUMN_MAP = { value => sub { return $_[0]->CreatedObj->AgeAsString } }, LastUpdatedRelative => { - title => 'LastUpdated', + title => 'Last Updated', attribute => 'LastUpdated', value => sub { return $_[0]->LastUpdatedObj->AgeAsString } }, @@ -203,7 +232,7 @@ $COLUMN_MAP = { value => sub { my $date = $_[0]->DueObj; if ($date && $date->Unix > 0 && $date->Unix < time()) { - return '<span class="overdue">' . $date->AgeAsString . '</span>'; + return (\'<span class="overdue">' , $date->AgeAsString , \'</span>'); } else { return $date->AgeAsString; } @@ -228,14 +257,17 @@ $COLUMN_MAP = { }, CreatedBy => { attribute => 'CreatedBy', + title => 'Created By', value => sub { return $_[0]->CreatorObj->Name } }, LastUpdated => { attribute => 'LastUpdated', + title => 'Last Updated', value => sub { return $_[0]->LastUpdatedObj->AsString } }, LastUpdatedBy => { attribute => 'LastUpdatedBy', + title => 'Last Updated By', value => sub { return $_[0]->LastUpdatedByObj->Name } }, Told => { @@ -251,144 +283,18 @@ $COLUMN_MAP = { value => sub { return $_[0]->ResolvedObj->AsString } }, - DependedOnBy => { - value => sub { - my $links = $_[0]->DependedOnBy; - return ( - join( - "<br>", - map { - '<A HREF="' - . $_->BaseURI->Resolver->HREF . '">' - . ( $_->BaseIsLocal ? $_->LocalBase : $_->Base ) - . '</A>' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - Members => { - value => sub { - my $links = $_[0]->Members; - return ( - join( - "<br>", - map { - '<A HREF="' - . $_->BaseURI->Resolver->HREF . '">' - . ( $_->BaseIsLocal ? $_->LocalBase : $_->Base ) - . '</A>' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - Children => { - value => sub { - my $links = $_[0]->Members; - return ( - join( - "<br>", - map { - '<A HREF="' - . $_->BaseURI->Resolver->HREF . '">' - . ( $_->BaseIsLocal ? $_->LocalBase : $_->Base ) - . '</A>' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - ReferredToBy => { - value => sub { - my $links = $_[0]->ReferredToBy; - return ( - join( - "<br>", - map { - '<A HREF="' - . $_->BaseURI->Resolver->HREF . '">' - . ( $_->BaseIsLocal ? $_->LocalBase : $_->Base ) - . '</A>' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - - DependsOn => { - value => sub { - my $links = $_[0]->DependsOn; - return ( - join( - "<br>", - map { - '<A HREF="' - . $_->TargetURI->Resolver->HREF . '">' - . ( $_->TargetIsLocal ? $_->LocalTarget : $_->Target ) - . '</A>' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - MemberOf => { - value => sub { - my $links = $_[0]->MemberOf; - return ( - join( - "<br>", - map { - '<A HREF="' - . $_->TargetURI->Resolver->HREF . '">' - . ( $_->TargetIsLocal ? $_->LocalTarget : $_->Target ) - . '</A>' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - Parents => { - value => sub { - my $links = $_[0]->MemberOf; - return ( - join( - "<br>", - map { - '<A HREF="' - . $_->TargetURI->Resolver->HREF . '">' - . ( $_->TargetIsLocal ? $_->LocalTarget : $_->Target ) - . '</A>' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - RefersTo => { - value => sub { - my $links = $_[0]->RefersTo; - return ( - join( - "<br>", - map { - '<A HREF="' - . $_->TargetURI->Resolver->HREF . '">' - . ( $_->TargetIsLocal ? $_->LocalTarget : $_->Target ) - . '</A>' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, + # Everything from LINKTYPEMAP + (map { + $_ => { value => LinkCallback( $_ ) } + } keys %RT::Ticket::LINKTYPEMAP), '_CLASS' => { value => sub { return $_[1] % 2 ? 'oddline' : 'evenline' } }, }; - - - -# }}} +</%ONCE> +<%init> $m->comp( '/Elements/Callback', COLUMN_MAP => $COLUMN_MAP, _CallbackName => 'ColumnMap'); -</%INIT> +return ColumnMap($Name, $Attr); +</%init> diff --git a/rt/html/Elements/Refresh b/rt/html/Elements/Refresh index 3cfb7c663..9f241d279 100644 --- a/rt/html/Elements/Refresh +++ b/rt/html/Elements/Refresh @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME="<%$Name%>"> <OPTION VALUE="-1" %unless ($Default) { diff --git a/rt/html/Elements/ScrubHTML b/rt/html/Elements/ScrubHTML index 57495bceb..94a729907 100644 --- a/rt/html/Elements/ScrubHTML +++ b/rt/html/Elements/ScrubHTML @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%init> my $scrubber = HTML::Scrubber->new(); diff --git a/rt/html/Elements/Section b/rt/html/Elements/Section index 5bf7270fc..afbb9cf38 100644 --- a/rt/html/Elements/Section +++ b/rt/html/Elements/Section @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <TABLE WIDTH=100%> <TR> <TD> diff --git a/rt/html/Elements/SelectAttachmentField b/rt/html/Elements/SelectAttachmentField index cd16bbaee..ea1528c03 100644 --- a/rt/html/Elements/SelectAttachmentField +++ b/rt/html/Elements/SelectAttachmentField @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME="<%$Name%>"> <OPTION VALUE="Subject"><&|/l&>Subject</&></OPTION> <OPTION VALUE="Content"><&|/l&>Content</&></OPTION> diff --git a/rt/html/Elements/SelectBoolean b/rt/html/Elements/SelectBoolean index d17606027..a3f08fdbc 100644 --- a/rt/html/Elements/SelectBoolean +++ b/rt/html/Elements/SelectBoolean @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> <OPTION VALUE="<%$TrueVal%>" <%$TrueDefault%>><%$True%></OPTION> <OPTION VALUE="<%$FalseVal%>" <%$FalseDefault%>><%$False%></OPTION> diff --git a/rt/html/Elements/SelectCustomFieldOperator b/rt/html/Elements/SelectCustomFieldOperator index 2264f2dcf..8f7ea618b 100644 --- a/rt/html/Elements/SelectCustomFieldOperator +++ b/rt/html/Elements/SelectCustomFieldOperator @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> % while (my $option = shift @Options) { % my $value = shift @Values; diff --git a/rt/html/Elements/SelectCustomFieldValue b/rt/html/Elements/SelectCustomFieldValue index de9f5401d..27d6c4995 100644 --- a/rt/html/Elements/SelectCustomFieldValue +++ b/rt/html/Elements/SelectCustomFieldValue @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Callback, %ARGS &> % if ($CustomField->Type =~ /Select/i) { % my $values = $CustomField->Values; diff --git a/rt/html/Elements/SelectDate b/rt/html/Elements/SelectDate index aaf2534c3..d3815798b 100644 --- a/rt/html/Elements/SelectDate +++ b/rt/html/Elements/SelectDate @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <INPUT NAME="<%$Name%>" VALUE="<%$Default%>" size=<%$Size%>> <%init> diff --git a/rt/html/Elements/SelectDateRelation b/rt/html/Elements/SelectDateRelation index b3f3868b3..ccf0c1121 100644 --- a/rt/html/Elements/SelectDateRelation +++ b/rt/html/Elements/SelectDateRelation @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> <OPTION VALUE="<"><%$Before%></OPTION> <OPTION VALUE="="><%$On%></OPTION> diff --git a/rt/html/Elements/SelectDateType b/rt/html/Elements/SelectDateType index 79bc99436..7b3f0990f 100644 --- a/rt/html/Elements/SelectDateType +++ b/rt/html/Elements/SelectDateType @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME="<%$Name%>"> <OPTION VALUE="Created"><&|/l&>Created</&></OPTION> <OPTION VALUE="Started"><&|/l&>Started</&></OPTION> diff --git a/rt/html/Elements/SelectEqualityOperator b/rt/html/Elements/SelectEqualityOperator index 5e5d1a4b9..0f8deea89 100644 --- a/rt/html/Elements/SelectEqualityOperator +++ b/rt/html/Elements/SelectEqualityOperator @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> % while (my $option = shift @Options) { % my $value = shift @Values; @@ -58,5 +58,5 @@ SELECTED $Name => undef @Options => (loc('less than'), loc('equal to'), loc('greater than'), loc('not equal to')) @Values => qw(< = > !=) -$Default => undef +$Default =>'' </%ARGS> diff --git a/rt/html/Elements/SelectGroups b/rt/html/Elements/SelectGroups index f6f9dae54..bc37fd69a 100644 --- a/rt/html/Elements/SelectGroups +++ b/rt/html/Elements/SelectGroups @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,10 +42,19 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <select name="GroupField"> -<option value="Name"><&|/l&>Name</&> -<option value="Description"><&|/l&>Description</&> +% foreach my $col (RT::Group->BasicColumns) { +<option value="<% $col->[0] %>"><% loc($col->[1]) %> +% } +% while (my $CF = $CFs->Next) { +<option value="CustomField-<% $CF->Id %>"><&|/l&>CustomField</&>: <% $CF->Name %> +% } </select> <& /Elements/SelectMatch, Name=> 'GroupOp' &> <input size=8 name="GroupString"> +<%INIT> +my $CFs = RT::CustomFields->new($session{'CurrentUser'}); +$CFs->LimitToChildType('RT::Group'); +$CFs->OrderBy( FIELD => 'Name' ); +</%INIT> diff --git a/rt/html/Elements/SelectLang b/rt/html/Elements/SelectLang index 46d378437..a439ea330 100644 --- a/rt/html/Elements/SelectLang +++ b/rt/html/Elements/SelectLang @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> % if ($ShowNullOption) { <OPTION VALUE="">-</OPTION> diff --git a/rt/html/Elements/SelectLinkType b/rt/html/Elements/SelectLinkType index d782e08b1..28cb4419a 100644 --- a/rt/html/Elements/SelectLinkType +++ b/rt/html/Elements/SelectLinkType @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> <OPTION VALUE="MemberOf"><&|/l&>Member of</&></OPTION> <OPTION VALUE="DependsOn"><&|/l&>Depends on</&></OPTION> diff --git a/rt/html/Elements/SelectMatch b/rt/html/Elements/SelectMatch index 18a948d12..60949d979 100644 --- a/rt/html/Elements/SelectMatch +++ b/rt/html/Elements/SelectMatch @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> <OPTION VALUE="LIKE" <%$LikeDefault%>><%$Like%></OPTION> <OPTION VALUE="NOT LIKE" <%$NotLikeDefault%>><%$NotLike%></OPTION> diff --git a/rt/html/Elements/SelectNewTicketQueue b/rt/html/Elements/SelectNewTicketQueue index fefb1bc97..d47b58a83 100644 --- a/rt/html/Elements/SelectNewTicketQueue +++ b/rt/html/Elements/SelectNewTicketQueue @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <LABEL ACCESSKEY="9"> <SELECT NAME ="<%$Name%>"> % foreach my $queue (@{$session{'create_in_queues'}}) { @@ -76,6 +76,6 @@ while (my $queue=$q->Next) { <%ARGS> $Name => 'Queue' -$Verbose => undef -$Default => undef +$Verbose => 0 +$Default => 0 </%ARGS> diff --git a/rt/html/Elements/SelectOwner b/rt/html/Elements/SelectOwner index 2a818cdcd..85843e5f0 100644 --- a/rt/html/Elements/SelectOwner +++ b/rt/html/Elements/SelectOwner @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,44 +42,67 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME="<%$Name%>"> %if ($DefaultValue) { -<OPTION <% !$Default && "SELECTED" %> VALUE=""><%$DefaultLabel%></OPTION> +<OPTION <% !$Default ? "SELECTED" : '' %> VALUE=""><%$DefaultLabel%></OPTION> %} -<OPTION <% ($RT::Nobody->Id() == $Default) && "SELECTED" %> VALUE="<%$RT::Nobody->Id%>"><%$RT::Nobody->Name%></OPTION> -%while ( my $User = $Users->Next()) { -<OPTION <% ($User->Id == $Default) && "SELECTED" %> VALUE="<%$User->Id()%>"><%$User->Name()%></OPTION> +%foreach my $User ( @users) { +<OPTION <% ($User->Id == $Default) ? "SELECTED" : ''%> +%if ($ValueAttribute eq 'id') { + value="<%$User->id%>" +%} elsif ($ValueAttribute eq 'Name') { + value="<%$User->Name%>" +%} +><%$User->Name()%></OPTION> %} </SELECT> - <%INIT> -my $Users = RT::Users->new($session{CurrentUser}); -my $object; - +my @objects; +my @users; if ($TicketObj) { - $object = $TicketObj; + @objects = ($TicketObj); } elsif ($QueueObj) { - $object = $QueueObj; + @objects = ($QueueObj); +} +elsif ($cfqueues) { + @objects = keys %{$cfqueues}; } -if ($object) { - $Users->WhoHaveRight(Right => 'OwnTicket', - Object => $object, - IncludeSystemRights => 1, - IncludeSuperusers => 1); -} else { - $Users->LimitToPrivileged; +else { + # Let's check rights on an empty queue object. that will do a search for any queue. + my $queue = RT::Queue->new($session{'CurrentUser'}); + push( @objects, $queue ); } + +my %user_uniq_hash; + + +foreach my $object (@objects) { + my $Users = RT::Users->new($session{CurrentUser}); + $Users->WhoHaveRight(Right => 'OwnTicket', Object => $object, IncludeSystemRights => 1, IncludeSuperusers => 0); + while (my $User = $Users->Next()) { + next if ($User->id == $RT::Nobody->id); # skip nobody here, so we can make them first later + $user_uniq_hash{$User->Id()} = $User; + } +} + +@users = sort { uc($a->Name) cmp uc($b->Name) } values %user_uniq_hash; +unshift(@users, $RT::Nobody); + + + </%INIT> <%ARGS> $QueueObj => undef $Name => undef -$Default => undef +$Default => 0 $User => undef $TicketObj => undef $DefaultValue => 1 $DefaultLabel => "-" +$ValueAttribute => 'id' +$cfqueues => undef </%ARGS> diff --git a/rt/html/Elements/SelectQueue b/rt/html/Elements/SelectQueue index 57d423697..56aede89f 100644 --- a/rt/html/Elements/SelectQueue +++ b/rt/html/Elements/SelectQueue @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if ($Lite) { % my $d = new RT::Queue($session{'CurrentUser'}); % $d->Load($Default); @@ -53,7 +53,7 @@ <OPTION VALUE="">-</OPTION> % } % while (my $queue=$q->Next) { -% if ($ShowAllQueues || $queue->CurrentUserHasRight('CreateTicket')) { +% 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%>) @@ -64,6 +64,7 @@ </SELECT> % } <%ARGS> +$CheckQueueRight => 'CreateTicket' $ShowNullOption => 1 $ShowAllQueues => 1 $Name => undef diff --git a/rt/html/Elements/SelectResultsPerPage b/rt/html/Elements/SelectResultsPerPage index 82f7035fe..65ed536d6 100644 --- a/rt/html/Elements/SelectResultsPerPage +++ b/rt/html/Elements/SelectResultsPerPage @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# TODO: Better default handling <SELECT NAME ="<%$Name%>"> diff --git a/rt/html/Elements/SelectSortOrder b/rt/html/Elements/SelectSortOrder index ea1a305f3..f6dd70ded 100644 --- a/rt/html/Elements/SelectSortOrder +++ b/rt/html/Elements/SelectSortOrder @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME="<%$Name%>"> %foreach my $order (@orders) { <OPTION VALUE="<%$order%>" <%$order eq $Default && 'SELECTED' %>> diff --git a/rt/html/Elements/SelectStatus b/rt/html/Elements/SelectStatus index 694957a66..fa76a3e5d 100644 --- a/rt/html/Elements/SelectStatus +++ b/rt/html/Elements/SelectStatus @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> %if ($DefaultValue) { <OPTION <% !$Default && "SELECTED" %> VALUE=""><%$DefaultLabel%></OPTION> @@ -58,7 +58,7 @@ my @status = $queue->StatusArray(); </%ONCE> <%ARGS> $Name => undef -$Default => undef +$Default => '' $SkipDeleted => 0 $DefaultValue => 1 $DefaultLabel => "-" diff --git a/rt/html/Elements/SelectTicketSortBy b/rt/html/Elements/SelectTicketSortBy index bf4b0bec0..3e05dcce9 100644 --- a/rt/html/Elements/SelectTicketSortBy +++ b/rt/html/Elements/SelectTicketSortBy @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME="<%$Name%>"> % foreach my $field (@sortfields) { <OPTION VALUE="<%$field%>" <% $field eq $Default && 'SELECTED'%>><% loc($field) %></OPTION> diff --git a/rt/html/Elements/SelectTicketTypes b/rt/html/Elements/SelectTicketTypes index c6912c87c..a905f6067 100644 --- a/rt/html/Elements/SelectTicketTypes +++ b/rt/html/Elements/SelectTicketTypes @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME="<%$Name%>"> %foreach (@Types) { <OPTION VALUE="<% $_ %>" <% ($_ eq $Default) && "SELECTED" %>><&|/l&><% $_ %></&> diff --git a/rt/html/Elements/SelectUsers b/rt/html/Elements/SelectUsers index be2230ad1..dfe816e49 100644 --- a/rt/html/Elements/SelectUsers +++ b/rt/html/Elements/SelectUsers @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,12 +42,19 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <select name="UserField"> -<option value="Name"><&|/l&>User Id</&> -<option value="EmailAddress"><&|/l&>Email</&> -<option value="RealName"><&|/l&>Name</&> -<option value="Organization"><&|/l&>Organization</&> +% foreach my $col (RT::User->BasicColumns) { +<option value="<% $col->[0] %>"><% loc($col->[1]) %> +% } +% while (my $CF = $CFs->Next) { +<option value="CustomField-<% $CF->Id %>"><&|/l&>CustomField</&>: <% $CF->Name %> +% } </select> <& /Elements/SelectMatch, Name=> 'UserOp' &> <input size=8 name="UserString"> +<%INIT> +my $CFs = RT::CustomFields->new($session{'CurrentUser'}); +$CFs->LimitToChildType('RT::User'); +$CFs->OrderBy( FIELD => 'Name' ); +</%INIT> diff --git a/rt/html/Elements/SelectWatcherType b/rt/html/Elements/SelectWatcherType index bb098abf6..6ba9c7aa0 100644 --- a/rt/html/Elements/SelectWatcherType +++ b/rt/html/Elements/SelectWatcherType @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> % if ($AllowNull) { <OPTION VALUE="">-</OPTION> diff --git a/rt/html/Elements/SetupSessionCookie b/rt/html/Elements/SetupSessionCookie index e72f45889..bd7861355 100644 --- a/rt/html/Elements/SetupSessionCookie +++ b/rt/html/Elements/SetupSessionCookie @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%init> return if $m->is_subrequest; # avoid reentrancy, as suggested by masonbook @@ -75,18 +75,25 @@ my $pm = "$session_class.pm"; $pm =~ s|::|/|g; require $pm; # If the session is invalid, create a new session. if ( $@ =~ /Object does not/i ) { - tie %session, $session_class, undef, - $backends{$RT::DatabaseType} ? { + 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 "RT Couldn't write to session directory '$RT::MasonSessionDir': $@. Check that this dir ectory's permissions are correct."; + 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" + . $@; } } diff --git a/rt/html/Elements/ShowCustomFieldBinary b/rt/html/Elements/ShowCustomFieldBinary new file mode 100644 index 000000000..ea9e5ae83 --- /dev/null +++ b/rt/html/Elements/ShowCustomFieldBinary @@ -0,0 +1,49 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<a href="<%$RT::WebPath%>/Download/CustomFieldValue/<% $Object->Id %>/<% $Object->Content %>"><% $Object->Content %></a> +<%ARGS> +$Object => undef +</%ARGS> diff --git a/rt/html/Elements/ShowCustomFieldImage b/rt/html/Elements/ShowCustomFieldImage new file mode 100644 index 000000000..7fa5e46d1 --- /dev/null +++ b/rt/html/Elements/ShowCustomFieldImage @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% my $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"> +<%ARGS> +$Object +</%ARGS> diff --git a/rt/html/Elements/ShowCustomFieldWikitext b/rt/html/Elements/ShowCustomFieldWikitext new file mode 100644 index 000000000..ab7c27b8b --- /dev/null +++ b/rt/html/Elements/ShowCustomFieldWikitext @@ -0,0 +1,55 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% my $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 }); +<%$wiki_content|n%> +<%init> +use Text::WikiFormat; +</%init> +<%ARGS> +$Object +</%ARGS> diff --git a/rt/html/Elements/ShowCustomFields b/rt/html/Elements/ShowCustomFields new file mode 100644 index 000000000..7591fa3aa --- /dev/null +++ b/rt/html/Elements/ShowCustomFields @@ -0,0 +1,77 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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> +% my @entry_fields; +% while (my $CustomField = $CustomFields->Next()) { +% my $Values = $Object->CustomFieldValues($CustomField->Id); + <tr> + <td class="label"><%$CustomField->Name%>:</td> + <td class="value"> +<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> +% } +</ul> + </td> + </tr> +% } +</table> +<%INIT> +my $CustomFields = $Object->CustomFields; +</%INIT> +<%ARGS> +$Object => undef +</%ARGS> diff --git a/rt/html/Elements/ShowLink b/rt/html/Elements/ShowLink index 520d6890c..5929a968e 100644 --- a/rt/html/Elements/ShowLink +++ b/rt/html/Elements/ShowLink @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <A href="<%$URI->Resolver->HREF%>"> % if ($URI->IsLocal) { % my $member = $URI->Object; diff --git a/rt/html/Elements/ShowLinks b/rt/html/Elements/ShowLinks index 2ba62b8f4..c9279a5db 100755 --- a/rt/html/Elements/ShowLinks +++ b/rt/html/Elements/ShowLinks @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <table> <tr> <td class="labeltop"><&|/l&>Depends on</&>:</td> diff --git a/rt/html/Elements/ShowMemberships b/rt/html/Elements/ShowMemberships new file mode 100644 index 000000000..3936d5080 --- /dev/null +++ b/rt/html/Elements/ShowMemberships @@ -0,0 +1,86 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<ul> +% while ( my $GroupMember = $GroupMembers->Next ) { +% my $Group = RT::Group->new($session{'CurrentUser'}); +% $Group->Load($GroupMember->GroupId) or next; +% if ($Group->Domain eq 'UserDefined') { +<li><a href="<%$RT::WebPath%>/Admin/Groups/Modify.html?id=<% $Group->Id %>"><% $Group->Name %></a></li> +% } elsif ($Group->Domain eq 'SystemInternal') { +<li><em><% loc($Group->Type) %></em></li> +% } +% } +</ul> +<%INIT> +my $GroupMembers = RT::GroupMembers->new($session{'CurrentUser'}); +$GroupMembers->Limit( FIELD => 'MemberId', VALUE => $UserObj->Id ); +my $alias = $GroupMembers->Join( + TYPE => 'left', + ALIAS1 => 'main', + FIELD1 => 'GroupId', + TABLE2 => 'Groups', + FIELD2 => 'id' +); +$GroupMembers->Limit( + ALIAS => $alias, + FIELD => 'Domain', + OPERATOR => '=', + VALUE => 'SystemInternal', +); +$GroupMembers->Limit( + ALIAS => $alias, + FIELD => 'Domain', + OPERATOR => '=', + VALUE => 'UserDefined', +); +$GroupMembers->OrderByCols( + { ALIAS => $alias, FIELD => 'Domain' }, + { ALIAS => $alias, FIELD => 'Name' }, +); +</%INIT> +<%ARGS> +$UserObj +</%ARGS> diff --git a/rt/html/Elements/SimpleSearch b/rt/html/Elements/SimpleSearch index a468fab59..2b34d3a24 100644 --- a/rt/html/Elements/SimpleSearch +++ b/rt/html/Elements/SimpleSearch @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# 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</&>"> diff --git a/rt/html/Elements/Submit b/rt/html/Elements/Submit index 0b42aab01..9d8dca20f 100644 --- a/rt/html/Elements/Submit +++ b/rt/html/Elements/Submit @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,16 +42,33 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# 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> -% if ($Reset) { <TD> -<FONT COLOR=#ffd800 > +% if ($CheckAll) { +<INPUT TYPE=BUTTON VALUE="<%$CheckAllLabel%>" ONCLICK="set_checkbox(this, true)"> +% } +% if ($ClearAll) { +<INPUT TYPE=BUTTON VALUE="<%$ClearAllLabel%>" ONCLICK="set_checkbox(this, false)"> +% } +% if ($Reset) { <INPUT TYPE=RESET VALUE="<%$ResetLabel%>"> -</FONT> -</TD> %} +</TD> <TD> </TD> @@ -74,11 +91,15 @@ NAME="<%$Name%>" </TABLE> <%ARGS> $color => "#336699" -$Caption => undef +$Caption => '' $AlternateCaption => undef $AlternateLabel => undef $Label => loc('Submit') $Name => undef +$CheckAll => undef +$CheckAllLabel => loc('Check All') +$ClearAll => undef +$ClearAllLabel => loc('Clear All') $Reset => undef $ResetLabel => loc('Reset') </%ARGS> diff --git a/rt/html/Elements/Tabs b/rt/html/Elements/Tabs index e75de8a6a..b2081edca 100644 --- a/rt/html/Elements/Tabs +++ b/rt/html/Elements/Tabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/PageLayout, current_toptab => $current_toptab, current_tab => $current_tab, @@ -71,17 +71,25 @@ my $basetabs = { A => { title => loc('Homepage'), C => { title => loc('Tools'), path => 'Tools/Offline.html' }, - E => { title => loc('Configuration'), - path => 'Admin/' - }, - K => { title => loc('Preferences'), - path => 'User/Prefs.html' - }, P => { title => loc('Approval'), path => 'Approvals/' }, }; +if ($session{'CurrentUser'}->HasRight( Right => 'ShowConfigTab', + Object => $RT::System )) { + $basetabs->{E} = { title => loc('Configuration'), + path => 'Admin/', + }; +} + +if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf', + Object => $RT::System )) { + $basetabs->{K} = { title => loc('Preferences'), + path => 'User/Prefs.html' + }; +} + if (!defined $toptabs) { $toptabs = $basetabs; } diff --git a/rt/html/Elements/TicketList b/rt/html/Elements/TicketList index 80d59f8c6..1a531274f 100644 --- a/rt/html/Elements/TicketList +++ b/rt/html/Elements/TicketList @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK; +%# BEGIN BPS TAGGED BLOCK {{{ %# -%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> %# -%# (Except where explictly superceded by other copyright notices) +%# (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 @@ -14,23 +20,35 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# 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. %# %# -%# END LICENSE BLOCK - -%# If you're having TicketList display a single record, you need -%# to wrap the calls in your own table(s). -% unless (defined $SingleRecord) { +%# 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%> -% } % if ($ShowHeader) { <& /Elements/CollectionAsTable/Header, Format => \@Format, + FormatString => $Format, AllowSorting => $AllowSorting, Order => $Order, Query => $Query, @@ -38,42 +56,46 @@ Page => $Page, OrderBy => $OrderBy , BaseURL => $BaseURL, - maxitems => \$maxitems &> + maxitems => $maxitems &> % } -% if (defined $SingleRecord) { -<& /Elements/CollectionAsTable/Row, Format => \@Format, i => 0, record => $SingleRecord, maxitems => $maxitems &> -% } else { % my $i; % while (my $record = $Collection->Next) { % $i++; +% # Every ten rows, flush the buffer and put something on the page. +% $m->flush_buffer() unless ($i % 10); <& /Elements/CollectionAsTable/Row, Format => \@Format, i => $i, record => $record, maxitems => $maxitems &> % } -% } -% unless (defined $SingleRecord) { </TABLE> -% } -% if ($ShowNavigation) { +% if ($Rows && $ShowNavigation) { <hr> -<&|/l, $Page, int($TotalFound/$Rows)+1&>Page [_1] of [_2]</&> +% my $oddRows; +% if (($TotalFound % $Rows) == 0) { +% $oddRows = 0; +% } else { $oddRows = 1; } +<&|/l, $Page, int($TotalFound/$Rows)+$oddRows&>Page [_1] of [_2]</&> <%perl> -my $prev = $m->comp('/Elements/QueryString', - Query => $Query, - Format => $Format, - Rows => $Rows, - OrderBy => $OrderBy, - Order => $Order, - Page => ($Page-1)); -my $next = $m->comp('/Elements/QueryString', - Query => $Query, - Format => $Format, - Rows => $Rows, - OrderBy => $OrderBy, - Order => $Order, - Page => ($Page+1)); +my $prev = $m->comp( + '/Elements/QueryString', + Query => $Query, + Format => $Format, + Rows => $Rows, + OrderBy => $OrderBy, + Order => $Order, + Page => ( $Page - 1 ) +); +my $next = $m->comp( + '/Elements/QueryString', + Query => $Query, + Format => $Format, + Rows => $Rows, + OrderBy => $OrderBy, + Order => $Order, + Page => ( $Page + 1 ) +); </%perl> % if ($Page > 1) { <A href="<%$BaseURL%><%$prev%>"><&|/l&>Previous Page</&></a> @@ -83,13 +105,12 @@ my $next = $m->comp('/Elements/QueryString', % } % } <%INIT> -my $maxitems; +my $maxitems = 0; $Format ||= $RT::DefaultSearchResultFormat; # Scrub the html of the format string to remove any potential nasties. $Format = $m->comp('/Elements/ScrubHTML', Content => $Format); -$Rows ||= '25'; # we need a positive value unless ($Collection) { $Collection = RT::Tickets->new($session{'CurrentUser'}); @@ -98,19 +119,31 @@ unless ($Collection) { my (@Format) = $m->comp('/Elements/CollectionAsTable/ParseFormat', Format => $Format); +# 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' ) { + $item = 0; + } + else { + $maxitems = $item if $item > $maxitems; + } +} + + $Collection->OrderBy(FIELD => $OrderBy, ORDER => $Order); -$Collection->RowsPerPage($Rows); +$Collection->RowsPerPage($Rows) if ($Rows); $Collection->GotoPage($Page-1); # SB uses page 0 as the first page my $TotalFound = $Collection->CountAll(); </%INIT> <%ARGS> $Query => undef -$Rows => 10 +$Rows => 50 $Page => 1 $Title => 'Ticket Search' $Collection => undef -$SingleRecord => undef $AllowSorting => undef $Order => undef $OrderBy => undef diff --git a/rt/html/Elements/TitleBox b/rt/html/Elements/TitleBox index 591393634..3c638e2d3 100644 --- a/rt/html/Elements/TitleBox +++ b/rt/html/Elements/TitleBox @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,5 +42,5 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& TitleBoxStart, %ARGS&><%$m->content|n%><& TitleBoxEnd&> diff --git a/rt/html/Elements/TitleBoxEnd b/rt/html/Elements/TitleBoxEnd index 1c050bc60..d791e3a4f 100644 --- a/rt/html/Elements/TitleBoxEnd +++ b/rt/html/Elements/TitleBoxEnd @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,10 +42,13 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# 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 diff --git a/rt/html/Elements/TitleBoxStart b/rt/html/Elements/TitleBoxStart index a0c733543..804e5cfaa 100644 --- a/rt/html/Elements/TitleBoxStart +++ b/rt/html/Elements/TitleBoxStart @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <TABLE CLASS="box <%$class|n%>" BGCOLOR="<%$color%>" CELLSPACING=0 @@ -74,7 +74,7 @@ $class => undef $bodyclass => undef $title_href => undef $title => undef -$title_class => undef +$title_class => '' $titleright_href => undef $titleright => undef |