diff options
Diffstat (limited to 'rt/html/Elements')
71 files changed, 601 insertions, 1510 deletions
diff --git a/rt/html/Elements/BevelBoxRaisedEnd b/rt/html/Elements/BevelBoxRaisedEnd index e1d1edb..f1c794b 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 6c5a613..ca504e4 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 937e923..cbec188 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,45 +42,43 @@ %# 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; +my (%cache, $check); </%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 $CacheKey = "Callback--$Page--$_CallbackName"; -my $callbacks = $cache{$CacheKey} || $m->notes($CacheKey); +my $callbacks; +if ($new_check eq $check) { + $callbacks = $cache{$Page,$_CallbackName}; +} +else { + $check = $new_check; +} if (!$callbacks) { - my $path = "/Callbacks/*$Page/$_CallbackName"; + 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; + + - # 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; + $cache{$Page,$_CallbackName} = $callbacks; } my @rv; foreach my $comp (sort @$callbacks) { - push @rv, $m->comp($comp, %ARGS); + push @rv, $m->comp($comp, %ARGS) if $m->comp_exists($comp); } return @rv; </%init> diff --git a/rt/html/Elements/Checkbox b/rt/html/Elements/Checkbox index f2256fb..146de6a 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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%>" value="1" <%$IsChecked%>> +%# }}} END BPS TAGGED BLOCK +<INPUT TYPE="Checkbox" NAME ="<%$Name%>" <%$IsChecked%>> <%ARGS> $Name => undef diff --git a/rt/html/Elements/CollectionAsTable/Header b/rt/html/Elements/CollectionAsTable/Header index 9ed4be8..2d1574d 100644 --- a/rt/html/Elements/CollectionAsTable/Header +++ b/rt/html/Elements/CollectionAsTable/Header @@ -1,14 +1,8 @@ -%# BEGIN BPS TAGGED BLOCK {{{ +%# BEGIN LICENSE BLOCK; %# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC -%# <jesse@bestpractical.com> +%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> %# -%# (Except where explicitly superseded by other copyright notices) -%# -%# -%# LICENSE: +%# (Except where explictly superceded by other copyright notices) %# %# 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 @@ -20,32 +14,16 @@ %# 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: +%# 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. %# -%# (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 }}} +%# END LICENSE BLOCK + <%ARGS> @Format => undef -$FormatString => undef $AllowSorting => undef $Order=>undef $BaseURL => undef @@ -54,63 +32,53 @@ $Rows => undef $Page => undef $maxitems => undef </%ARGS> -<TR class="collection-as-table"> +<TR> <%perl> -my %generic_query_args = ( Query => $Query, Rows => $Rows, Page => $Page, Format => $FormatString ); +my %generic_query_args = ( Query => $Query, Rows => $Rows, Page => $Page ); my $item = 0; +$$maxitems = 0; foreach my $col (@Format) { $item++; + $$maxitems = $item if $item > $$maxitems; if ( $col->{title} eq 'NEWLINE' ) { - 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">}); + $m->out('</TR> <TR>'); + $item = 0; } else { - $m->out('<TH class="collection-as-table">'); + $m->out('<TH align="center">'); 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 57434ef..c7b709b 100644 --- a/rt/html/Elements/CollectionAsTable/ParseFormat +++ b/rt/html/Elements/CollectionAsTable/ParseFormat @@ -1,14 +1,8 @@ -%# BEGIN BPS TAGGED BLOCK {{{ +%# BEGIN LICENSE BLOCK; %# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC -%# <jesse@bestpractical.com> +%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> %# -%# (Except where explicitly superseded by other copyright notices) -%# -%# -%# LICENSE: +%# (Except where explictly superceded by other copyright notices) %# %# 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 @@ -20,59 +14,44 @@ %# 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: +%# 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. %# -%# (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 }}} +%# END LICENSE BLOCK + <%ARGS> $Format </%ARGS> <%init> -use Regexp::Common; +use Regexp::Common qw(delimited); 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 =~ /($RE{delimited}{-delim=>qq{\'"}}|[{}\w.]+)/go) { +while ($Format =~ /($justquoted|$word)/igx) { my $col = $1; - if ($col =~ /^$RE{quoted}$/o) { + if ($col =~ /^$RE{quoted}{-esc}$/) { 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 3316bc0..701966f 100644 --- a/rt/html/Elements/CollectionAsTable/Row +++ b/rt/html/Elements/CollectionAsTable/Row @@ -1,14 +1,8 @@ -%# BEGIN BPS TAGGED BLOCK {{{ +%# BEGIN LICENSE BLOCK; %# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC -%# <jesse@bestpractical.com> +%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> %# -%# (Except where explicitly superseded by other copyright notices) -%# -%# -%# LICENSE: +%# (Except where explictly superceded by other copyright notices) %# %# 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 @@ -20,29 +14,14 @@ %# 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.) +%# 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. %# -%# 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 }}} +%# END LICENSE BLOCK + <%ARGS> $i => undef @Format => undef @@ -53,56 +32,42 @@ $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(qq{<td class="collection-as-table"> </td>\n}); - $item++; - } - $item = 0; + while ($item < $maxitems) { + $m->out("<td> </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 class="collection-as-table" '); - $m->out( 'align="' . $column->{align} . '"' ) if ( $column->{align} ); - $m->out('>'); + $m->out('<td align="left">'); foreach my $subcol ( @{ $column->{output} } ) { if ( $subcol =~ /^__(.*?)__$/o ) { - 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 { + my $col = $1; + my $value = $m->comp('/Elements/RT__Ticket/ColumnMap', Name => $col, Attr => 'value'); - # Simple value; just escape it. - @out = $m->interp->apply_escapes( $value => 'h' ); + 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. + $m->out( + map { ref($_) ? $$_ : $m->interp->apply_escapes( $_ => 'h' ) } + &{ $value } ( $record, $i ) + ); + } else { + # Simple value; just escape it. + $m->out( $m->interp->apply_escapes( $value => 'h' ) ); } - s/\n/<br>/gs for @out; - $m->out( @out ); } else { - $m->out($subcol); + $m->out( Encode::decode_utf8($subcol) ); } } $m->out('</td>'); diff --git a/rt/html/Elements/CreateTicket b/rt/html/Elements/CreateTicket index bd60bbd..70c94e7 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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" NAME="CreateTicketInQueue"> +%# }}} END BPS TAGGED BLOCK +<FORM ACTION="<% $RT::WebPath%>/Ticket/Create.html"> <&|/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 deleted file mode 100644 index d2398c9..0000000 --- a/rt/html/Elements/EditCustomField +++ /dev/null @@ -1,89 +0,0 @@ -%# 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 deleted file mode 100644 index 0028256..0000000 --- a/rt/html/Elements/EditCustomFieldBinary +++ /dev/null @@ -1,60 +0,0 @@ -%# 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 deleted file mode 100644 index c097ee0..0000000 --- a/rt/html/Elements/EditCustomFieldFreeform +++ /dev/null @@ -1,68 +0,0 @@ -%# 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 deleted file mode 100644 index b378cea..0000000 --- a/rt/html/Elements/EditCustomFieldImage +++ /dev/null @@ -1,60 +0,0 @@ -%# 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 deleted file mode 100644 index db33a68..0000000 --- a/rt/html/Elements/EditCustomFieldSelect +++ /dev/null @@ -1,71 +0,0 @@ -%# 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 deleted file mode 100644 index 1aac328..0000000 --- a/rt/html/Elements/EditCustomFieldText +++ /dev/null @@ -1,65 +0,0 @@ -%# 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 deleted file mode 100644 index 1aac328..0000000 --- a/rt/html/Elements/EditCustomFieldWikitext +++ /dev/null @@ -1,65 +0,0 @@ -%# 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 68c08dd..b66291f 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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%>" value="1"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>"> <& 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%>-" value="1"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-"> <& 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%>" value="1"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>"> <& 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%>-" value="1"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-"> <& 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%>" value="1"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>"> <& 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%>-" value="1"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-"> <& ShowLink, URI => $link->BaseURI &><br> % } </td> @@ -114,12 +114,9 @@ <TD VALIGN=TOP> <h3><&|/l&>New Links</&></h3> % if (ref($Object) eq 'RT::Ticket') { -<i><&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces.</&> -<& /Elements/Callback, _CallbackName => 'ExtraLinkInstructions' &> -</i><br> +<i><&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces.</&></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 bc5a188..3aa77a5 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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,11 +53,9 @@ <%$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 78a116f..12432ca 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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> @@ -52,13 +52,21 @@ <& /Elements/Callback, %ARGS &> <!-- <div class="bpscredits"> -<&|/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> +<&|/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> % 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)]); @@ -66,7 +74,6 @@ <%$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 869d57e..393b28f 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 a2563fe..27658df 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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,17 +77,15 @@ ONLOAD=" > <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF"> <tr> - <td colspan=2 rowspan=2><img border=0 alt="freeside" src="<%$RT::WebImagesURL%>/small-logo.png" width="92" height="62"></td> - <td align="left" rowspan=2><font size=6><% &RT::URI::freeside::FreesideGetConfig('company_name') %> Ticketing</font></td> + <td rowspan=2><img border=0 alt="freeside" src="<%$RT::WebImagesURL%>/small-logo.png" width="92" height="62"></td> + <td align="left" rowspan=2><font size=6><% FS::Conf->new->config('company_name') %> Ticketing</font></td> <td align="right" valign="top"> % 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]</&> @@ -104,7 +102,7 @@ ONLOAD=" <tr> <td align=right> <FONT SIZE="-3"> - <A HREF="http://www.sisd.com/freeside">Freeside</A> v<% &RT::URI::freeside::FreesideVersion() %><BR> + <A HREF="http://www.sisd.com/freeside">Freeside</A> v<% $FS::VERSION %><BR> <A HREF="../docs/">Documentation</A><BR> </FONT> </td> @@ -126,13 +124,12 @@ ONLOAD=" $r->headers_out->{'Pragma'} = 'no-cache'; $r->headers_out->{'Cache-control'} = 'no-cache'; -require RT::URI::freeside; </%INIT> <%ARGS> $Prefs => '/User/Prefs.html' $Focus => 'focus' -$Title => 'RT' +$Title => undef $Code => undef $Refresh => 0 $Why => undef diff --git a/rt/html/Elements/ListActions b/rt/html/Elements/ListActions index 8433d17..344fe9e 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 1d4bfd5..25ded9f 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 id="login" name="login" METHOD=POST ACTION="<% (UNIVERSAL::can($r, 'uri') && ($r->uri) =~ m!.*/(.*)!) %>" > +<FORM 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 398e3ab..0e57585 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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,17 +69,16 @@ % } % my $style=""; % if ($sep) { -% $style="minor"; +% $style="border-top: solid #999 1px; padding-top: .1em; margin-top: .5em;"; % } elsif ($level == 0 ) { -% $style="major"; +% $style="border-bottom: solid white 1px; padding-top: .25em; padding-bottom: .5em;" ; % } % if ($toptabs->{$tab}->{'separator'}) { % $sep=1; % } else { % $sep=0; % } -% my $url = $toptabs->{$tab}->{'path'} =~ /^https?:/i ? $toptabs->{$tab}->{'path'} : $RT::WebPath . "/" . $toptabs->{$tab}->{'path'}; -<li class="<%$class%>-<%$level%>-<%$style%>"><A HREF="<% $url %>" class="<%$class%>-<%$level%>" +<li style="<%$style%>"><A HREF="<%$RT::WebPath%>/<%$toptabs->{$tab}->{'path'}%>" style="font-size: <%$size%>;" class="<%$class%>" <%($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 dd48bec..5faa957 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 class="messagebox" COLS=<%$Width%> ROWS=<%$Height%> WRAP=<%$Wrap%> NAME="<%$Name%>"><& /Elements/Callback, %ARGS &><% $Default %><%$message%><%$IncludeSignature ? $signature : ''%></textarea> +%# }}} END BPS TAGGED BLOCK +<TEXTAREA 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 172b4a4..4e1bf3e 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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,10 +61,9 @@ my $rows = $RT::MyRequestsLength; my $Query = "Owner = 'Nobody' AND ( Status = 'new' OR Status = 'open')"; -my $QueryString = ""; -$QueryString = '?' . $m->comp('/Elements/QueryString', - Query => $Query, - Order => 'DESC', - OrderBy => 'Priority') if ($Query); +my $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 cf5225a..9f30a89 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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,11 +61,10 @@ my $rows = $RT::MyTicketsLength; my $Query = " Owner = '".$session{'CurrentUser'}->Id."' AND ( Status = 'new' OR Status = 'open')"; -my $QueryString = ""; -$QueryString = '?' . $m->comp('/Elements/QueryString', - Query => $Query, - Order => 'DESC', - OrderBy => 'Priority') if ($Query); +my $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 94bdbe1..41eae78 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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="lightgray" border=0 cellspacing=0 cellpadding=0 width="100%"> <th class="lightgray" align="left" width=42%><span class="rtname"><%$AppName%></span> </th> @@ -76,7 +76,7 @@ % if ($actions->{"$action"}->{'html'}) { % push @actions, $actions->{"$action"}->{'html'}; % } else { -% push @actions, qq|<a class="nav" href="|.$RT::WebPath."/".$actions->{$action}->{'path'}.qq|">|.$actions->{$action}->{'title'}."</a>"; +% push @actions, "<A class='nav' HREF=\"".$RT::WebPath."/".$actions->{$action}->{'path'}."\">".$actions->{$action}->{'title'}."</A>"; % } % } %#<% join(" | ", @actions) | n %> @@ -94,12 +94,11 @@ </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 ($current_toptab && $toptabs->{$tab}->{'path'} eq $current_toptab) { + if ($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 7d41f15..cbec29a 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 0d2489c..10cfbd3 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 d54f72e..103c760 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,40 +42,42 @@ %# 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 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> + <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> </tr> <%PERL> my $i; while (my $queue = $Queues->Next) { - next unless ($queue->CurrentUserHasRight('ShowTicket')); + 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')"; - my $name = $queue->Name; - $name =~ s|(['\\])|\\$1|g; - - my $new_q = "Queue = '$name' AND Status = 'new'"; - my $open_q = "Queue = '$name' AND Status = 'open'"; - my $all_q = "Queue = '$name' AND (Status = 'open' OR Status = 'new')"; - $Tickets->FromSQL($open_q); - my $open = $Tickets->Count(); + $Tickets->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($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 |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> +<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> </TR> % } </TABLE> diff --git a/rt/html/Elements/RT__Ticket/ColumnMap b/rt/html/Elements/RT__Ticket/ColumnMap index dade914..a6d387c 100644 --- a/rt/html/Elements/RT__Ticket/ColumnMap +++ b/rt/html/Elements/RT__Ticket/ColumnMap @@ -1,14 +1,8 @@ -%# BEGIN BPS TAGGED BLOCK {{{ +%# BEGIN LICENSE BLOCK; %# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC -%# <jesse@bestpractical.com> +%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> %# -%# (Except where explicitly superseded by other copyright notices) -%# -%# -%# LICENSE: +%# (Except where explictly superceded by other copyright notices) %# %# 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 @@ -20,37 +14,25 @@ %# 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. -%# +%# 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. %# -%# 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 }}} +%# END LICENSE BLOCK + <%ARGS> $Name => undef $Attr => undef </%ARGS> +<%perl> +return ColumnMap($Name, $Attr); +</%perl> -<%ONCE> -our ( $COLUMN_MAP ); +<%INIT> +our ( $COLUMN_MAP, $CUSTOM_FIELD_MAP ); sub ColumnMap { my $name = shift; @@ -63,52 +45,46 @@ 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 ( $field ); + return ( $cf->Name ); } elsif ( $attr eq '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 } - }; + my $value = eval "sub { + my \$values = \$_[0]->CustomFieldValues('" . $cf->id . "'); + return ( join( ', ', map { \$_->Content } \@{ \$values->ItemsArrayRef } )) + }" || die $@; + return ($value); } } } -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', @@ -127,7 +103,7 @@ $COLUMN_MAP = { }, Status => { attribute => 'Status', - value => sub { return loc($_[0]->Status) } + value => sub { return $_[0]->Status } }, Subject => { attribute => 'Subject', @@ -143,10 +119,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 { @@ -161,12 +137,10 @@ $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 => { @@ -179,17 +153,14 @@ $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 => { @@ -217,7 +188,7 @@ $COLUMN_MAP = { value => sub { return $_[0]->CreatedObj->AgeAsString } }, LastUpdatedRelative => { - title => 'Last Updated', + title => 'LastUpdated', attribute => 'LastUpdated', value => sub { return $_[0]->LastUpdatedObj->AgeAsString } }, @@ -232,7 +203,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; } @@ -257,17 +228,14 @@ $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 => { @@ -283,18 +251,144 @@ $COLUMN_MAP = { value => sub { return $_[0]->ResolvedObj->AsString } }, - # Everything from LINKTYPEMAP - (map { - $_ => { value => LinkCallback( $_ ) } - } keys %RT::Ticket::LINKTYPEMAP), + 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 } + ) + ); + } + }, '_CLASS' => { value => sub { return $_[1] % 2 ? 'oddline' : 'evenline' } }, }; -</%ONCE> -<%init> + + + +# }}} $m->comp( '/Elements/Callback', COLUMN_MAP => $COLUMN_MAP, _CallbackName => 'ColumnMap'); -return ColumnMap($Name, $Attr); -</%init> +</%INIT> diff --git a/rt/html/Elements/Refresh b/rt/html/Elements/Refresh index 9f241d2..3cfb7c6 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 94a7299..57495bc 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 afbb9cf..5bf7270 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 ea1528c..cd16bba 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 a3f08fd..d176060 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 8f7ea61..2264f2d 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 27d6c49..de9f540 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 d381579..aaf2534 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 ccf0c11..b3f3868 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 7b3f099..79bc994 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 0f8deea..5e5d1a4 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 =>'' +$Default => undef </%ARGS> diff --git a/rt/html/Elements/SelectGroups b/rt/html/Elements/SelectGroups index bc37fd6..f6f9dae 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,19 +42,10 @@ %# 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"> -% 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 %> -% } +<option value="Name"><&|/l&>Name</&> +<option value="Description"><&|/l&>Description</&> </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 a439ea3..46d3784 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 28cb441..d782e08 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 60949d9..18a948d 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 d47b58a..fefb1bc 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 => 0 -$Default => 0 +$Verbose => undef +$Default => undef </%ARGS> diff --git a/rt/html/Elements/SelectOwner b/rt/html/Elements/SelectOwner index 85843e5..2a818cd 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,67 +42,44 @@ %# 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> %} -%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> +<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> %} </SELECT> + <%INIT> -my @objects; -my @users; +my $Users = RT::Users->new($session{CurrentUser}); +my $object; + if ($TicketObj) { - @objects = ($TicketObj); + $object = $TicketObj; } elsif ($QueueObj) { - @objects = ($QueueObj); -} -elsif ($cfqueues) { - @objects = keys %{$cfqueues}; + $object = $QueueObj; } -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 ); +if ($object) { + $Users->WhoHaveRight(Right => 'OwnTicket', + Object => $object, + IncludeSystemRights => 1, + IncludeSuperusers => 1); +} else { + $Users->LimitToPrivileged; } - -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 => 0 +$Default => undef $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 56aede8..57d4236 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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($CheckQueueRight)) { +% if ($ShowAllQueues || $queue->CurrentUserHasRight('CreateTicket')) { <OPTION VALUE="<%($NamedValues ? $queue->Name : $queue->Id) %>" <%( $queue->Id eq $Default ? 'SELECTED' : '')%>><%$queue->Name%> % if (($Verbose) and ($queue->Description) ){ (<%$queue->Description%>) @@ -64,7 +64,6 @@ </SELECT> % } <%ARGS> -$CheckQueueRight => 'CreateTicket' $ShowNullOption => 1 $ShowAllQueues => 1 $Name => undef diff --git a/rt/html/Elements/SelectResultsPerPage b/rt/html/Elements/SelectResultsPerPage index 65ed536..82f7035 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 f6dd70d..ea1a305 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 fa76a3e..694957a 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 => '' +$Default => undef $SkipDeleted => 0 $DefaultValue => 1 $DefaultLabel => "-" diff --git a/rt/html/Elements/SelectTicketSortBy b/rt/html/Elements/SelectTicketSortBy index 3e05dcc..bf4b0be 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 a905f60..c6912c8 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 dfe816e..be2230a 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,19 +42,12 @@ %# 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"> -% 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 %> -% } +<option value="Name"><&|/l&>User Id</&> +<option value="EmailAddress"><&|/l&>Email</&> +<option value="RealName"><&|/l&>Name</&> +<option value="Organization"><&|/l&>Organization</&> </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 6ba9c7a..bb098ab 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 bd78613..e72f458 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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,25 +75,18 @@ 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 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" - . $@; + die "RT Couldn't write to session directory '$RT::MasonSessionDir': $@. Check that this dir ectory's permissions are correct."; } } diff --git a/rt/html/Elements/ShowCustomFieldBinary b/rt/html/Elements/ShowCustomFieldBinary deleted file mode 100644 index ea9e5ae..0000000 --- a/rt/html/Elements/ShowCustomFieldBinary +++ /dev/null @@ -1,49 +0,0 @@ -%# 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 deleted file mode 100644 index 7fa5e46..0000000 --- a/rt/html/Elements/ShowCustomFieldImage +++ /dev/null @@ -1,51 +0,0 @@ -%# 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 deleted file mode 100644 index ab7c27b..0000000 --- a/rt/html/Elements/ShowCustomFieldWikitext +++ /dev/null @@ -1,55 +0,0 @@ -%# 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 deleted file mode 100644 index 7591fa3..0000000 --- a/rt/html/Elements/ShowCustomFields +++ /dev/null @@ -1,77 +0,0 @@ -%# 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 5929a96..520d689 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 c9279a5..2ba62b8 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 deleted file mode 100644 index 3936d50..0000000 --- a/rt/html/Elements/ShowMemberships +++ /dev/null @@ -1,86 +0,0 @@ -%# 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 e76f801..213aa7e 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 tickets</&>"> diff --git a/rt/html/Elements/Submit b/rt/html/Elements/Submit index 9d8dca2..0b42aab 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,33 +42,16 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# END BPS TAGGED BLOCK }}} -% if ($CheckAll or $ClearAll) { -<script><!-- -function set_checkbox (obj, val) { - var i; - var myfield = obj.form.getElementsByTagName('input'); - for (i = 0; i < myfield.length; i++) { - if (myfield[i].type == 'checkbox') { - myfield[i].checked = val; - } - } -} ---></script> -% } +%# }}} END BPS TAGGED BLOCK <TABLE WIDTH=100% BGCOLOR="<%$color%>" CELLSPACING=0 BORDER=0 CELLPADDING=0 > <TR> -<TD> -% 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) { +<TD> +<FONT COLOR=#ffd800 > <INPUT TYPE=RESET VALUE="<%$ResetLabel%>"> -%} +</FONT> </TD> +%} <TD> </TD> @@ -91,15 +74,11 @@ NAME="<%$Name%>" </TABLE> <%ARGS> $color => "#336699" -$Caption => '' +$Caption => undef $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 f5839a9..4fc229b 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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, @@ -64,7 +64,7 @@ my $basetopactions = { }; my $basetabs = { ' A'=> { title => 'Billing Main', - path => &RT::URI::freeside::FreesideURL(), + path => '../', }, A => { #title => loc('Homepage'), title => 'Ticketing Main', @@ -76,33 +76,23 @@ my $basetabs = { 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; } if (!defined $topactions) { $topactions = $basetopactions; } - - require RT::URI::freeside; # Now let callbacks add their extra tabs $m->comp('/Elements/Callback', diff --git a/rt/html/Elements/TicketList b/rt/html/Elements/TicketList index 1a53127..80d59f8 100644 --- a/rt/html/Elements/TicketList +++ b/rt/html/Elements/TicketList @@ -1,14 +1,8 @@ -%# BEGIN BPS TAGGED BLOCK {{{ +%# BEGIN LICENSE BLOCK; %# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC -%# <jesse@bestpractical.com> +%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> %# -%# (Except where explicitly superseded by other copyright notices) -%# -%# -%# LICENSE: +%# (Except where explictly superceded by other copyright notices) %# %# 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 @@ -20,35 +14,23 @@ %# 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. -%# +%# 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. %# -%# 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 }}} +%# 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) { <TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH=100%> +% } % if ($ShowHeader) { <& /Elements/CollectionAsTable/Header, Format => \@Format, - FormatString => $Format, AllowSorting => $AllowSorting, Order => $Order, Query => $Query, @@ -56,46 +38,42 @@ 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 ($Rows && $ShowNavigation) { +% if ($ShowNavigation) { <hr> -% my $oddRows; -% if (($TotalFound % $Rows) == 0) { -% $oddRows = 0; -% } else { $oddRows = 1; } -<&|/l, $Page, int($TotalFound/$Rows)+$oddRows&>Page [_1] of [_2]</&> +<&|/l, $Page, int($TotalFound/$Rows)+1&>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> @@ -105,12 +83,13 @@ my $next = $m->comp( % } % } <%INIT> -my $maxitems = 0; +my $maxitems; $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'}); @@ -119,31 +98,19 @@ 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) if ($Rows); +$Collection->RowsPerPage($Rows); $Collection->GotoPage($Page-1); # SB uses page 0 as the first page my $TotalFound = $Collection->CountAll(); </%INIT> <%ARGS> $Query => undef -$Rows => 50 +$Rows => 10 $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 3c638e2..5913936 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 d791e3a..1c050bc 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,13 +42,10 @@ %# 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 804e5cf..a0c7335 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-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 => '' +$title_class => undef $titleright_href => undef $titleright => undef |