diff options
Diffstat (limited to 'rt/html/Elements')
89 files changed, 7027 insertions, 0 deletions
diff --git a/rt/html/Elements/AddCustomers b/rt/html/Elements/AddCustomers new file mode 100644 index 000000000..aaf8ca8ba --- /dev/null +++ b/rt/html/Elements/AddCustomers @@ -0,0 +1,59 @@ +%# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am> +%# Copyright (c) 2008 Freeside Internet Services, Inc. +%# +%# 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. +<BR> +<%$msg%><br> + +% if (@Customers) { + +<br><i>(Check box to link)<i> +<table> +% foreach my $customer (@Customers) { +<tr> + <td> + <input type="checkbox" name="Object-AddCustomer-<% $customer->{'custnum'} %>" VALUE="1" <% scalar(@Customers) == 1 ? 'CHECKED' : '' %>> + <A HREF="<%$freeside_url%>/view/cust_main.cgi?<% $customer->{'custnum'} %>"><% &RT::URI::freeside::small_custview($customer->{'custnum'}, &RT::URI::freeside::FreesideGetConfig('countrydefault'), 1) |n %> + </td> +</tr> +% } +</table> + +% } + +<%INIT> +my ($msg); + +my $freeside_url = &RT::URI::freeside::FreesideURL(); + +warn "/Elements/AddCustomers called with CustomerString $CustomerString\n" + if $Debug; + +my @Customers = (); +if ( $CustomerString ) { + @Customers = &RT::URI::freeside::smart_search( 'search' => $CustomerString ); +} + +my @Services = (); +if ($ServiceString) { + @Services = (); #service_search(); +} + +warn "/Elements/AddCustomers displaying ". scalar(@Customers). " customers\n" + if $Debug; + +</%INIT> + +<%ARGS> +$CustomerString => undef +$ServiceString => undef +$Debug => 0 +</%ARGS> diff --git a/rt/html/Elements/BevelBoxRaisedEnd b/rt/html/Elements/BevelBoxRaisedEnd new file mode 100644 index 000000000..b1ba8f69b --- /dev/null +++ b/rt/html/Elements/BevelBoxRaisedEnd @@ -0,0 +1,50 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + </td> +</tr> +</table> diff --git a/rt/html/Elements/BevelBoxRaisedStart b/rt/html/Elements/BevelBoxRaisedStart new file mode 100644 index 000000000..b690c1d74 --- /dev/null +++ b/rt/html/Elements/BevelBoxRaisedStart @@ -0,0 +1,50 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<table 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 new file mode 100644 index 000000000..b498f2816 --- /dev/null +++ b/rt/html/Elements/Callback @@ -0,0 +1,92 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%once> +my %cache; +</%once> +<%init> +$Page = $m->callers(1)->path unless ($Page); + +my $CacheKey = "Callback--$Page--$_CallbackName"; +my $callbacks = $cache{$CacheKey} || $m->notes($CacheKey); + +if (!$callbacks) { + my $path = "/Callbacks/*$Page/$_CallbackName"; + + # 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{$CacheKey} = $callbacks if !$RT::DevelMode; +} + +my @rv; +foreach my $comp (sort @$callbacks) { + push @rv, $m->comp($comp, %ARGS); +} +return @rv; +</%init> +<%args> +$_CallbackName => 'Default' +$Page => undef +</%args> diff --git a/rt/html/Elements/Checkbox b/rt/html/Elements/Checkbox new file mode 100644 index 000000000..5593c7a71 --- /dev/null +++ b/rt/html/Elements/Checkbox @@ -0,0 +1,63 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<input type="checkbox" class="checkbox" name="<%$Name%>" value="1" <%$IsChecked%> /> + +<%ARGS> +$Name => undef +$Default => undef +$True => undef +$False => undef +$IsChecked => undef +</%ARGS> + +<%INIT> +$IsChecked = + ($Default && $Default =~ /checked/i) + ? " CHECKED " : ""; +1; +</%INIT> diff --git a/rt/html/Elements/CollectionAsTable/Header b/rt/html/Elements/CollectionAsTable/Header new file mode 100644 index 000000000..a3277b317 --- /dev/null +++ b/rt/html/Elements/CollectionAsTable/Header @@ -0,0 +1,125 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +@Format => undef +$FormatString => undef +$AllowSorting => undef +$Order=>undef +$BaseURL => undef +$Query => undef +$Rows => undef +$Page => undef +$maxitems => undef +</%ARGS> +<tr class="collection-as-table"> +<%perl> + +my %generic_query_args = ( Query => $Query, Rows => $Rows, Page => $Page, Format => $FormatString ); + +my $item = 0; +foreach my $col (@Format) { + $item++; + if ( $col->{title} && ($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">}); + } + else { + $m->out('<th class="collection-as-table">'); + my $title = $col->{title} || ''; + $title =~ s/^__(.*)__$/$1/o; + $title = ( + $m->comp( + '/Elements/RT__Ticket/ColumnMap', + Name => $title, + Attr => 'title' + ) + || $title + ); + if ( + $AllowSorting + && $col->{'attribute'} + && $m->comp( + '/Elements/RT__Ticket/ColumnMap', + Name => $col->{'attribute'}, + Attr => 'attribute' + ) + ) + { + + $m->out( + '<a href="' . $BaseURL + . $m->comp( + '/Elements/QueryString', + %generic_query_args, + OrderBy => ( + $m->comp( + '/Elements/RT__Ticket/ColumnMap', + Name => $col->{'attribute'}, + Attr => 'attribute' + ) + || $col->{'attribute'} + ), + Order => ( $ARGS{'Order'} eq 'ASC' ? 'DESC' : 'ASC' ) + ) + . '">' + . loc($title) . '</a>' + ); + } + else { + $m->out( loc($title) ); + } + $m->out('</th>'); + } +} +</%perl> +</tr> diff --git a/rt/html/Elements/CollectionAsTable/ParseFormat b/rt/html/Elements/CollectionAsTable/ParseFormat new file mode 100644 index 000000000..227076093 --- /dev/null +++ b/rt/html/Elements/CollectionAsTable/ParseFormat @@ -0,0 +1,106 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Format +</%ARGS> + +<%init> +use Regexp::Common qw/delimited/; +my @Columns; + +while ($Format =~ /($RE{delimited}{-delim=>qq{\'"}}|[{}\w.]+)/go) { + my $col = $1; + + if ($col =~ /^$RE{quoted}$/o) { + substr($col,0,1) = ""; + substr($col,-1,1) = ""; + } + + my $colref = { + title => '', + }; + + if ( $col =~ s!/STYLE:([^/]+)!!io ) { + $colref->{'style'} = $1; + } + if ( $col =~ s!/CLASS:([^/]+)!!io ) { + $colref->{'class'} = $1; + } + 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 ) { + push ( @subcols, $1 ) if ($1); + push ( @subcols, "__$2__" ); + $colref->{'attribute'} = $2; + } + push ( @subcols, $col ); + @{ $colref->{'output'} } = @subcols; + } + else { + @{ $colref->{'output'} } = ( "__" . $col . "__" ); + $colref->{'attribute'} = $col; + } + + if ( !$colref->{'title'} && grep { /^__(.+?)__$/io } + @{ $colref->{'output'} } ) + { + $colref->{'title'} = $1; + $colref->{'attribute'} = $1; + } + + + push @Columns, $colref; +} + return(@Columns); +</%init> diff --git a/rt/html/Elements/CollectionAsTable/Row b/rt/html/Elements/CollectionAsTable/Row new file mode 100644 index 000000000..d8492265e --- /dev/null +++ b/rt/html/Elements/CollectionAsTable/Row @@ -0,0 +1,117 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$i => undef +@Format => undef +$record => undef +$maxitems => undef +$Depth => undef +$Warning => undef +</%ARGS> + +<%PERL> +use HTML::Entities; +$m->out('<tr class="' . ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) . '" >' ); +my $item; +foreach my $column (@Format) { + if ( defined $column->{title} && $column->{title} eq 'NEWLINE' ) { + while ( $item < $maxitems ) { + $m->out(qq{<td class="collection-as-table"> </td>\n}); + $item++; + } + $item = 0; + $m->out('</tr>'); + $m->out('<tr class="' + . ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) + . '" >' ); + next; + } + $item++; + my $class = $column->{class} + ? encode_entities($column->{class}, q{'"&<>}) : 'collection-as-table'; + $m->out(qq{<td class="$class" }); + $m->out( 'align="' . $column->{align} . '"' ) if ( $column->{align} ); + $m->out( 'style="' . $column->{style} . '"' ) if ( $column->{style} ); + $m->out('>'); + foreach my $subcol ( @{ $column->{output} } ) { + if ( $subcol =~ /^__(.*?)__$/o ) { + my $col = $1; + my $value = $m->comp( + '/Elements/RT__Ticket/ColumnMap', + Name => $col, + Attr => 'value' + ); + my @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 { + + # Simple value; just escape it. + @out = $m->interp->apply_escapes( $value => 'h' ); + } + s/\n/<br \/>/gs for @out; + $m->out( @out ); + } + else { + $m->out($subcol); + } + } + $m->out('</td>'); +} +$m->out('</tr>'); +</%PERL> diff --git a/rt/html/Elements/CreateTicket b/rt/html/Elements/CreateTicket new file mode 100644 index 000000000..644df223a --- /dev/null +++ b/rt/html/Elements/CreateTicket @@ -0,0 +1,50 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<form action="<% $RT::WebPath %>/Ticket/Create.html" name="CreateTicketInQueue"> +<&|/l, $m->scomp('/Elements/SelectNewTicketQueue')&><input type="submit" class="button" value="New ticket in" /> [_1]</&> +</form> diff --git a/rt/html/Elements/EditCustomField b/rt/html/Elements/EditCustomField new file mode 100644 index 000000000..d247c63f1 --- /dev/null +++ b/rt/html/Elements/EditCustomField @@ -0,0 +1,99 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%INIT> +my $Values; +if ($Object and $Object->id) { + $Values = $Object->CustomFieldValues($CustomField->id); + $Values->Columns( qw( id CustomField ObjectType ObjectId Disabled Content ContentType ContentEncoding ) ); + $NamePrefix ||= join('-', 'Object', ref($Object), $Object->Id, 'CustomField', ''); +} elsif (not $Default) { + my %TOP = $m->request_args; + $Default = $TOP{ $NamePrefix .$CustomField->Id . '-Values' } + || $TOP{ $NamePrefix .$CustomField->Id . '-Value' }; +} +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" class="hidden" name="'.$NamePrefix.$CustomField->Id.'-Values-Magic" value="1" />'."\n"); + +my $EditComponent = "EditCustomField$Type"; +$m->comp('/Elements/Callback', _CallbackName => 'EditComponentName', Name => \$EditComponent, CustomField => $CustomField, Object => $Object ); +$EditComponent = "EditCustomField$Type" unless $m->comp_exists($EditComponent); + +return $m->comp( + $EditComponent, + %ARGS, + Rows => $Rows, + Cols => $Cols, + Default => $Default, + Object => $Object, + Values => $Values, + MaxValues => $MaxValues, + Multiple => ($MaxValues != 1), + NamePrefix => $NamePrefix, + CustomField => $CustomField, +); +</%INIT> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Rows => 5 +$Cols => 15 +$Default => undef +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldBinary b/rt/html/Elements/EditCustomFieldBinary new file mode 100644 index 000000000..485457c25 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldBinary @@ -0,0 +1,62 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ($Values and my $value = $Values->Next ) { +%# XXX - let user download the file(s) here? +<input type="checkbox" class="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValueIds" value="<% $value->Id %>" /><a href="<%$RT::WebPath%>/Download/CustomFieldValue/<% $value->Id %>/<% $value->Content %>"><% $value->Content %></a><br /> +% } +% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) { +<input type="file" name="<%$NamePrefix%><%$CustomField->Id%>-Upload" /> +% } +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldCombobox b/rt/html/Elements/EditCustomFieldCombobox new file mode 100644 index 000000000..071ef0772 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldCombobox @@ -0,0 +1,68 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ($Values and my $value = $Values->Next and $Multiple) { +<input type="checkbox" class="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValueIds" value="<% $value->Id %>" /><% $value->Content %> +<br /> +% } +% (!$Multiple or !$MaxValues or !$Values or $Values->Count < $MaxValues) or return; +<& /Widgets/ComboBox, + Name => $NamePrefix . $CustomField->Id . "-Value", + Default => $Default, + Rows => $Rows, + Values => [map {$_->Name} @{$CustomField->Values->ItemsArrayRef}], +&> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$Multiple => 0 +$Rows => undef +$MaxValues => undef +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldFreeform b/rt/html/Elements/EditCustomFieldFreeform new file mode 100644 index 000000000..279632dcc --- /dev/null +++ b/rt/html/Elements/EditCustomFieldFreeform @@ -0,0 +1,74 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% my $name = $NamePrefix . $CustomField->Id . '-Value'; +% if ($Multiple) { +<textarea cols="<%$Cols%>" rows="<%$Rows%>" name="<%$name%>s" id="<%$name%>s" ><%$Default%></textarea> +% } else { +<input name="<%$name%>" id="<%$name%>" size="<%$Cols%>" value="<%$Default ? $Default : ''%>" /> +% } +<%INIT> +if ($Multiple and $Values) { + $Default = ''; + while (my $value = $Values->Next ) { + $Default .= $value->Content."\n"; + } +} +elsif ( ! $Multiple ) { + $Default =~ s/\s*\n\s*/ /g if $Default; +} +</%INIT> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$Multiple => undef +$Cols +$Rows +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldImage b/rt/html/Elements/EditCustomFieldImage new file mode 100644 index 000000000..b6a30c659 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldImage @@ -0,0 +1,62 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ($Values and my $value = $Values->Next ) { +<input type="checkbox" class="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValueIds" value="<% $value->Id %>" /><& ShowCustomFieldImage, Object => $value &> +<br /> +% } +% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) { +<input type="file" name="<%$NamePrefix%><%$CustomField->Id%>-Upload" /> +% } +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldSelect b/rt/html/Elements/EditCustomFieldSelect new file mode 100644 index 000000000..815e977a0 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldSelect @@ -0,0 +1,128 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%# Build up the set of cascading select boxes as "guides" +%# each one limits the options of the final one a bit +%# (perhaps by tweaking the .display style?) +% my $selected = 0; +% my @category; +% my $id = $NamePrefix . $CustomField->Id; +% my $out = $m->scomp('SELF:options', %ARGS, SelectedRef => \$selected, CategoryRef => \@category); +% if (@category) { +<script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/cascaded.js"></script> +%# XXX - Hide this select from w3m? + <select onchange="filter_cascade('<% $id %>-Values', this.value)" name="<%$id%>-Category"> + <option value="" <% !$selected && 'SELECTED' %>><&|/l&>-</&></option> +% foreach my $cat (@category) { +% my ($depth, $name) = @$cat; + <option value="<% $name %>"><% ' ' x $depth |n %><%$name%></option> +% } + </select><br /> +% } + <select name="<%$id%>-Values" id="<%$id%>-Values" +% if ($Multiple or !@category) { + size="<%$Rows%>" +% } + <% $Multiple && 'MULTIPLE' %>> + <option value="" <% !$selected && 'SELECTED' %>><&|/l&>(no value)</&></option> +% $m->out($out); + </select> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$Multiple => 0 +$Rows => undef +</%ARGS> + +<%method options> +% my $selected; +% my $CFVs = $CustomField->Values; +% my @levels; +% while ($CFVs and my $value = $CFVs->Next ) { +% my $category = $value->Category; +% if (1) { # length $category) { +% my $level = (split(/:/, $category || ''))[0]; +% while (@levels) { +% if ($levels[-1] eq $level) { +% undef $level; +% last; +% } elsif (index($level, $levels[-1]) != 0) { + </optgroup> +% pop @levels; +% } else { +% last; +% } +% } +% if ($level) { +% push @$CategoryRef, [0+@levels, $level]; + <optgroup style="padding-left: <% @levels/2 %>em" label="<%$category%>"> +% push @levels, $level; +% } +% } + <option value="<%$value->Name%>" +% if ($Values) { + <% ($Values->HasEntry($value->Name)||'') && ($$SelectedRef = 1) && 'SELECTED' %> +% } elsif ($Default) { + <% (ref $Default ? (grep {$_ eq $value->Name} @{$Default}) : ($Default eq $value->Name)) + && ($$SelectedRef = 1) && 'SELECTED' %> +% } + ><% $value->Name%></option> +% } +% for (@levels) { + </optgroup> +% } +<%args> +$CustomField => undef +$Default => undef +$Values => undef +$SelectedRef => undef +$CategoryRef => undef +</%args> +</%method> diff --git a/rt/html/Elements/EditCustomFieldText b/rt/html/Elements/EditCustomFieldText new file mode 100644 index 000000000..b7569b003 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldText @@ -0,0 +1,67 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ($Values and my $value = $Values->Next ) { +<textarea cols="<%$Cols%>" rows="<%$Rows%>" name="<%$NamePrefix%><%$CustomField->Id%>-Values"><% $value->Content %></textarea><br /> +% } +% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) { +<textarea cols="<%$Cols%>" rows="<%$Rows%>" name="<%$NamePrefix%><%$CustomField->Id%>-Values"><% $Default %></textarea> +% } +<%INIT> +# XXX - MultiValue textarea is for now outlawed. +$MaxValues = 1; +</%INIT> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef +$Cols +$Rows +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldWikitext b/rt/html/Elements/EditCustomFieldWikitext new file mode 100644 index 000000000..b7569b003 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldWikitext @@ -0,0 +1,67 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ($Values and my $value = $Values->Next ) { +<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/EditCustomers b/rt/html/Elements/EditCustomers new file mode 100644 index 000000000..68efb5f40 --- /dev/null +++ b/rt/html/Elements/EditCustomers @@ -0,0 +1,63 @@ +%# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am> +%# Copyright (c) 2008 Freeside Internet Services, Inc. +%# +%# 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. +<TABLE width=100%> + <TR> + <TD VALIGN=TOP WIDTH=50%> + <h3><&|/l&>Current Customers</&></h3> + +<table> + <tr> + <td><i><&|/l&>(Check box to disassociate)</&></i></td> + </tr> + <tr> + <td class="value"> +% foreach my $link ( @{ $Object->Customers->ItemsArrayRef } ) { + + <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>"> +%# <& ShowLink, URI => $link->TargetURI &><br> + <A HREF="<% $link->TargetURI->Resolver->HREF %>"><% $link->TargetURI->Resolver->AsStringLong |n %></A> + <BR> +% } + </td> + </tr> +</table> + +</TD> + +<TD VALIGN=TOP> +<h3><&|/l&>New Customer Links</&></h3> +<&|/l&>Find customer</&><BR> +<input name="CustomerString"> +<input type=submit name="OnlySearchForCustomers" value="<&|/l&>Go!</&>"> +<br><i>cust #, name, company or phone</i> +<BR> +%#<BR> +%#<&|/l&>Find service</&><BR> +%#<input name="ServiceString"> +%#<input type=submit name="OnlySearchForServices" value="<&|/l&>Go!</&>"> +%#<br><i>username, username@domain, domain, or IP address</i> +%#<BR> + +<& AddCustomers, Object => $Object, + CustomerString => $CustomerString, + ServiceString => $ServiceString, &> + +</TD> +</TR> +</TABLE> + +<%ARGS> +$CustomerString => undef +$ServiceString => undef +$Object => undef +</%ARGS> diff --git a/rt/html/Elements/EditLinks b/rt/html/Elements/EditLinks new file mode 100755 index 000000000..7670ffa24 --- /dev/null +++ b/rt/html/Elements/EditLinks @@ -0,0 +1,177 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<table width="100%"> + <tr> + <td valign="top" width="50%"> + <h3><&|/l&>Current Links</&></h3> + +<table> + <tr> + <td></td> + <td><i><&|/l&>(Check box to delete)</&></i></td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Depends on</&>:</td> + <td class="value"> +% while (my $link = $Object->DependsOn->Next) { + <input type="checkbox" class="checkbox" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" /> + <& ShowLink, URI => $link->TargetURI &><br /> +% } + </td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Depended on by</&>:</td> + <td class="value"> +% while (my $link = $Object->DependedOnBy->Next) { + <input type="checkbox" class="checkbox" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" /> + <& ShowLink, URI => $link->BaseURI &><br /> +% } + </td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Parents</&>:</td> + <td class="value"> +% while (my $link = $Object->MemberOf->Next) { + <input type="checkbox" class="checkbox" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" /> + <& ShowLink, URI => $link->TargetURI &><br /> +% } + </td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Children</&>:</td> + <td class="value"> +% while (my $link = $Object->Members->Next) { + <input type="checkbox" class="checkbox" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" /> + <& ShowLink, URI => $link->BaseURI &><br /> +% } + </td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Refers to</&>:</td> + <td class="value"> +% while (my $link = $Object->RefersTo->Next) { + <input type="checkbox" class="checkbox" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" /> + <& ShowLink, URI => $link->TargetURI &><br /> +%} + </td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Referred to by</&>:</td> + <td class="value"> +% while (my $link = $Object->ReferredToBy->Next) { +% # Skip reminders +% next if (UNIVERSAL::isa($link->BaseObj, 'RT::Ticket') && $link->BaseObj->Type eq 'reminder'); + <input type="checkbox" class="checkbox" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" /> + <& ShowLink, URI => $link->BaseURI &><br /> +% } + </td> + </tr> +</table> + +</td> +<td valign="top"> +<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 /> +% } elsif (ref($Object) eq 'RT::Queue') { +<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 /> +% } +<table> +% if ($Merge) { + <tr> + <td class="label"><&|/l&>Merge into</&>:</td> + <td class="entry"><input name="<%$id%>-MergeInto" /> <i><&|/l&>(only one ticket)</&></i></td> + </tr> +% } + <tr> + <td class="label"><&|/l&>Depends on</&>:</td> + <td class="entry"><input name="<%$id%>-DependsOn" /></td> + </tr> + <tr> + <td class="label"><&|/l&>Depended on by</&>:</td> + <td class="entry"><input name="DependsOn-<%$id%>" /></td> + </tr> + <tr> + <td class="label"><&|/l&>Parents</&>:</td> + <td class="entry"><input name="<%$id%>-MemberOf" /></td> + </tr> + <tr> + <td class="label"><&|/l&>Children</&>:</td> + <td class="entry"> <input name="MemberOf-<%$id%>" /></td> + </tr> + <tr> + <td class="label"><&|/l&>Refers to</&>:</td> + <td class="entry"><input name="<%$id%>-RefersTo" /></td> + </tr> + <tr> + <td class="label"><&|/l&>Referred to by</&>:</td> + <td class="entry"> <input name="RefersTo-<%$id%>" /></td> + </tr> +</table> +</td> +</tr> +</table> + +<%INIT> +my $id; +if ($Object && $Object->Id) { + $id = $Object->Id; +} else { + $id = 'new'; +} +</%INIT> + +<%ARGS> +$Object => undef +$Merge => 0 +</%ARGS> diff --git a/rt/html/Elements/EmailInput b/rt/html/Elements/EmailInput new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/rt/html/Elements/EmailInput diff --git a/rt/html/Elements/Error b/rt/html/Elements/Error new file mode 100644 index 000000000..369327406 --- /dev/null +++ b/rt/html/Elements/Error @@ -0,0 +1,86 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Elements/Callback, %ARGS, error => $error &> +<& /Elements/Header, Code => $Code, Why => $Why, Title => $Title &> +<& /Elements/Tabs, Title => $Title &> +<div class="error"> +<%$Why%> +<br /> +<%$Details%> +</div> + +<%cleanup> +$m->comp('/Elements/Footer'); +$m->abort(); +</%cleanup> + +<%args> +$Code => undef +$Details =>'' +$Title => loc("RT Error") +$Why => loc("the calling component did not specify why") +</%args> + +<%INIT> +my $error = "WebRT: $Why ($Details)"; + +# TODO: Log::Dispatch isn't UTF-8 safe. Autrijus needs to talk to dave rolsky about getting this fixed +if ($] >= 5.007001) { + require Encode; + Encode::_utf8_off($error); +} + +$RT::Logger->error($error); + +if ( defined ($session{'SessionType'}) && $session{'SessionType'} eq 'REST' ) { + $r->content_type('text/plain'); + $m->out( "Error: " . $Why . "\n" ); + $m->out( $Details . "\n" ); + $m->abort(); +} +</%INIT> diff --git a/rt/html/Elements/Footer b/rt/html/Elements/Footer new file mode 100644 index 000000000..0cb528f19 --- /dev/null +++ b/rt/html/Elements/Footer @@ -0,0 +1,94 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%# End of div#body from /Elements/PageLayout +</div> +</td> +</tr> +<tr> +<td> +<& /Elements/Callback, %ARGS &> +<div id="footer"> + <p id="time"> + <span><&|/l&>Time to display</&>: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%></span> + </p> + +<!-- + <p id="bpscredits"> + <span> +<&|/l, '»|«', $RT::VERSION, '2006', '<a href="http://www.bestpractical.com?rt='.$RT::VERSION.'">Best Practical Solutions, LLC</a>', &>[_1] RT [_2] Copyright 1996-[_3] [_4].</&> +</span> +</p> +% if (!$Menu) { + <p id="legal"> +<&|/l&>Distributed under version 2 <a href="http://www.gnu.org/copyleft/gpl.html"> of the GNU GPL.</a></&><br /> +<&|/l, '<a href="mailto:sales@bestpractical.com">sales@bestpractical.com</a>' &>To inquire about support, training, custom development or licensing, please contact [_1].</&><br /> + </p> +% } + +</div> +--> +% if ($Debug >= 2 ) { +% require Data::Dumper; +% my $d = Data::Dumper->new([\%ARGS], [qw(%ARGS)]); +<pre> +<%$d->Dump() %> +</pre> +% } + +</TD> +</TR> +</TABLE> + + </body> +</html> +% $m->abort(); + +<%ARGS> +$Debug => 0 +$Menu => 1 +</%ARGS> diff --git a/rt/html/Elements/FreesideInvoiceSearch b/rt/html/Elements/FreesideInvoiceSearch new file mode 100644 index 000000000..3842b2ff9 --- /dev/null +++ b/rt/html/Elements/FreesideInvoiceSearch @@ -0,0 +1,20 @@ +% if ( $FS::CurrentUser::CurrentUser->access_right('View invoices') ) { + + <form action="<% $RT::URI::freeside::URL %>/search/cust_bill.html" STYLE="margin:0"> + <SCRIPT TYPE="text/javascript"> + function clearhint_search_invoice (what) { + if ( what.value == '(inv #)' ) + what.value = ''; + } + </SCRIPT> + <input name="invnum" accesskey="0" VALUE="(inv #)" SIZE="4" onFocus="clearhint_search_invoice(this);" onClick="clearhint_search_invoice(this);" STYLE="text-align:right; margin-bottom:1px; font-family: Arial, Verdana, Helvetica, sans-serif;"> + +% if ( $FS::CurrentUser::CurrentUser->access_right('List invoices') ) { + <A HREF="<% $RT::URI::freeside::URL %>search/report_cust_bill.html" STYLE="color: #ffffff; font-size: 70%; font-weight:normal">Advanced</A> +% } + <BR> + + <input type="submit" value="<&|/l&>Search invoices</&>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%"> + </form> + +% } diff --git a/rt/html/Elements/FreesideNewCust b/rt/html/Elements/FreesideNewCust new file mode 100644 index 000000000..f60e99559 --- /dev/null +++ b/rt/html/Elements/FreesideNewCust @@ -0,0 +1,3 @@ +<form action="<% $RT::URI::freeside::URL %>/edit/cust_main.cgi" STYLE="margin:0"> +<INPUT TYPE="submit" VALUE="<&|/l&>New customer</&>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="vertical-align:bottom; font-size:100%"> +</FORM> diff --git a/rt/html/Elements/FreesideSearch b/rt/html/Elements/FreesideSearch new file mode 100644 index 000000000..8e609bb4b --- /dev/null +++ b/rt/html/Elements/FreesideSearch @@ -0,0 +1,13 @@ +% if ( $FS::CurrentUser::CurrentUser->access_right('List customers') ) { +<form action="<% $RT::URI::freeside::URL %>/search/cust_main.cgi" STYLE="margin:0"> + <SCRIPT TYPE="text/javascript"> + function clearhint_search_cust (what) { + if ( what.value == '(cust #, name, company or phone)' ) + what.value = ''; + } + </SCRIPT> +<input name="search_cust" accesskey="0" VALUE="(cust #, name, company or phone)" SIZE="28" onFocus="clearhint_search_cust(this);" onClick="clearhint_search_cust(this);" STYLE="text-align:right; font-family: Arial, Verdana, Helvetica, sans-serif;"><BR> +<A HREF="<% $RT::URI::freeside::URL %>/search/report_cust_main.html" STYLE="color: #ffffff; font-size: 70%; font-weight:normal">Advanced</A> +<input type="submit" value="<&|/l&>Search customers</&>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%"> +</form> +% } diff --git a/rt/html/Elements/FreesideSvcSearch b/rt/html/Elements/FreesideSvcSearch new file mode 100644 index 000000000..4a5942421 --- /dev/null +++ b/rt/html/Elements/FreesideSvcSearch @@ -0,0 +1,11 @@ +<form action="<% $RT::URI::freeside::URL %>/search/cust_svc.html" STYLE="margin:0"> + <SCRIPT TYPE="text/javascript"> + function clearhint_search_svc (what) { + if ( what.value == '(user, user@domain or domain)' ) + what.value = ''; + } + </SCRIPT> +<input name="search_svc" accesskey="0" VALUE="(user, user@domain or domain)" SIZE="26" onFocus="clearhint_search_svc(this);" onClick="clearhint_search_svc(this);" STYLE="text-align:right; font-family: Arial, Verdana, Helvetica, sans-serif;"><BR> + <A NOTYET="<% $RT::URI::freeside::URL %>search/svc_Smarter.html" STYLE="color: #000000; font-size: 70%; font-weight:normal">Advanced</A> +<input type="submit" value="<&|/l&>Search services</&>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%"> +</form> diff --git a/rt/html/Elements/GotoTicket b/rt/html/Elements/GotoTicket new file mode 100644 index 000000000..ad6ad1b15 --- /dev/null +++ b/rt/html/Elements/GotoTicket @@ -0,0 +1,48 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<form action="<%$RT::WebPath%>/Ticket/Display.html"><input type="submit" class="button" value="<&|/l&>Goto ticket</&>" /> <input size="5" name="id" accesskey="0" /></form> diff --git a/rt/html/Elements/Header b/rt/html/Elements/Header new file mode 100644 index 000000000..bf6fa46fa --- /dev/null +++ b/rt/html/Elements/Header @@ -0,0 +1,172 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head> + +<title><%$Title%></title> + +% if ($Refresh && $Refresh > 0) { + <meta http-equiv="refresh" content="<%$Refresh%>" /> +% } + +<link rel="shortcut icon" href="<%$RT::WebImagesURL%>/favicon.png" type="image/png" /> +<link rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/css/<% $RT::WebDefaultStylesheet %>/main-squished.css" type="text/css" media="all" /> +<link rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/css/print.css" type="text/css" media="print" /> + +% if ( $RSSAutoDiscovery ) { + <link rel="alternate" href="<%$RSSAutoDiscovery%>" type="application/rss+xml" title="RSS RT Search" /> +% } + +<script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/util.js"></script> +<script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/ahah.js"></script> +<script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/titlebox-state.js"></script> +<script type="text/javascript"><!-- + onLoadHook("loadTitleBoxStates()"); +% if ( $Focus ) { + onLoadHook("focusElementById('<% $Focus %>')"); +% } +% if ( $onload ) { + onLoadHook("<% $onload |n %>"); +% } +--></script> + +<& /Elements/Callback, _CallbackName => 'Head', %ARGS &> + +</head> + <body NOTBACKGROUND="<% $RT::URI::freeside::URL %>/images/background-cheat.png" + STYLE="margin-top:0; margin-bottom:0; margin-left:0; margin-right:0" + <% $id && qq[ id="comp-$id"] |n %> + > + +% if ($ShowBar) { + +<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" STYLE="padding-left:0; padding-right:4"> + <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') || 'ExampleCo' %></font></td> + <td align="right" valign="top"> + +<div id="quickbar"> + <div id="quick-personal"> + <span class="hide"><a href="#skipnav"><&|/l&>Skip Menu</&></a> | </span> +% if ($session{'CurrentUser'}->Name) { + <&|/l, "<span>".$session{'CurrentUser'}->Name."</span>" &>Logged in as [_1]</&> +% if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => $RT::System )) { + | <a href="<%$RT::WebPath%><%$Prefs%>"><&|/l&>Preferences</&></a> +% } +% } else { + <&|/l&>Not logged in.</&> +% } + <& /Elements/Callback, %ARGS &> +% unless (!$session{'CurrentUser'}->Name +% or ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth)) { + | <a href="<%$RT::WebPath%>/NoAuth/Logout.html<%$URL ? "?URL=".$URL : ''%>"><&|/l&>Logout</&></a> +% } + </div> +% } + + </td> + + </tr> + <tr> + + <td align=right valign=bottom> + <table> + <tr> + <td align=right> + <FONT SIZE="-3"> + <A HREF="http://www.sisd.com/freeside">Freeside</A> v<% &RT::URI::freeside::FreesideVersion() %><BR> + <A HREF="<% FS::Conf->new->config('support-key') ? "http://www.sisd.com/mediawiki/index.php/Supported:Documentation" : "http://www.sisd.com/mediawiki/index.php/Freeside:1.9:Documentation" %>">Documentation</A><BR> + </FONT> + </td> + <td bgcolor=#000000></td> + <td align=left> + <FONT SIZE="-3"> + <A HREF="http://www.bestpractical.com/rt">RT</A> v<% $RT::VERSION %><BR> + <A HREF="http://wiki.bestpractical.com/">Documentation</A><BR> + </FONT> + </td> + + </tr> + </table> + </td> + + </tr> +</table> + +<%INIT> +$r->headers_out->{'Pragma'} = 'no-cache'; +$r->headers_out->{'Cache-control'} = 'no-cache'; + +require RT::URI::freeside; + +my $id = $m->request_comp->path; +$id =~ s|^/||g; +$id =~ s|/|-|g; +$id =~ s|\.html$||g; +$id =~ s|index$||g + if $id ne 'index'; +$id =~ s|-$||g; +</%INIT> + +<%ARGS> +$Prefs => '/User/Prefs.html' +#$Focus => 'focus' +$Focus => '' +$Title => 'RT' +$Code => undef +$Refresh => 0 +$Why => undef +$ShowBar => 1 +$URL => undef +$RSSAutoDiscovery => undef +$onload => undef +</%ARGS> diff --git a/rt/html/Elements/ListActions b/rt/html/Elements/ListActions new file mode 100644 index 000000000..24f923a8a --- /dev/null +++ b/rt/html/Elements/ListActions @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<&| /Widgets/TitleBox, title => loc('Results') &> + <ul class="action-results"> +% foreach my $action (@actions) { +% next unless $action; +% my $skip = 0; +% $m->comp('/Elements/Callback', _CallbackName => 'ModifyRow', row => \$action, skip => \$skip, %ARGS); +% next if $skip; + <li><%$action%></li> +% } + </ul> +</&> +<%init> +@actions = grep $_, @actions; +return unless @actions; +</%init> +<%ARGS> +@actions => undef +</%ARGS> diff --git a/rt/html/Elements/Login b/rt/html/Elements/Login new file mode 100644 index 000000000..cd39b87d8 --- /dev/null +++ b/rt/html/Elements/Login @@ -0,0 +1,138 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%INIT> +if ($m->request_comp->path =~ '^/REST/\d+\.\d+/') { + $r->content_type("text/plain"); + $m->error_format("text"); + $m->out("RT/$RT::VERSION 401 Credentials required\n"); + $m->out("\n$Error\n") if $Error; + $m->abort; +} + +my $req_uri; + +if (UNIVERSAL::can($r, 'uri') and $r->uri =~ m{.*/(.*)}) { + $req_uri = $1; +} + +my $form_action = defined $goto ? $goto + : defined $req_uri ? $req_uri + : $RT::WebPath + ; +</%INIT> + +<& /Elements/Callback, %ARGS, _CallbackName => 'Header' &> +<& /Elements/Header, Title => loc('Login'), Focus => 'user' &> + +%# End of div#quickbar from /Elements/Header +</div> + +<div id="body" class="login-body"> + +% if ($Error) { +<&| "/Widgets/TitleBox", title => loc('Error'), hideable => 0 &> +<% $Error %> +</&> +% } + +<& /Elements/Callback, %ARGS, _CallbackName => 'BeforeForm' &> + +<div id="login-box"> +<&| /Widgets/TitleBox, title => loc('Login'), titleright => $RT::VERSION, hideable => 0 &> + +% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { +<form id="login" name="login" method="post" action="<% $form_action %>"> + +<div class="input-row"> + <span class="label"><&|/l&>Username</&>:</span> + <span class="input"><input name="user" value="<%$user%>" id="user" /></span> +</div> + +<div class="input-row"> + <span class="label"><&|/l&>Password</&>:</span> + <span class="input"><input type="password" name="pass" /></span> +</div> + +<div class="button-row"> + <span class="input"><input type="submit" class="button" value="<&|/l&>Login</&>" /></span> +</div> + +%# Give callbacks a chance to add more control elements +<& /Elements/Callback, %ARGS &> + +% # From mason 1.0.1 forward, this doesn't work. in fact, it breaks things. +% # But on Mason 1.15 it's fixed again, so we still use it. +% # The code below iterates through everything in the passed in arguments +% # Preserving all the old parameters +% # This would be easier, except mason is 'smart' and calls multiple values +% # arrays rather than multiple hash keys +% my $key; my $val; +% foreach $key (keys %ARGS) { +% if (($key ne 'user') and ($key ne 'pass')) { +% if (ref($ARGS{$key}) =~ /ARRAY/) { +% foreach $val (@{$ARGS{$key}}) { +<input type="hidden" class="hidden" name="<%$key %>" value="<% $val %>" /> +% } +% } +% else { +<input type="hidden" class="hidden" name="<% $key %>" value="<% $ARGS{$key} %>" /> +% } +% } +% } +</form> +% } +</&> +</div><!-- #login-box --> +<& /Elements/Callback, %ARGS, _CallbackName => 'AfterForm' &> +<& /Elements/Footer, Menu => 0 &> +<%ARGS> +$user => "" +$pass => undef +$goto => undef +$Error => undef +</%ARGS> diff --git a/rt/html/Elements/Logo b/rt/html/Elements/Logo new file mode 100644 index 000000000..157f7bece --- /dev/null +++ b/rt/html/Elements/Logo @@ -0,0 +1,56 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + <div id="logo"> + <a href="http://bestpractical.com"><img src="<%$RT::WebImagesURL%>/bplogo.gif" alt="<%loc("Best Practical Solutions, LLC corporate logo")%>" width="177" height="33" /></a> +% if ($show_name) { + <div class="rtname"><% loc("RT for [_1]", $RT::rtname) %></div> +% } + </div> +<%args> + $show_name => 1 +</%args> diff --git a/rt/html/Elements/Menu b/rt/html/Elements/Menu new file mode 100644 index 000000000..b5b2bdad5 --- /dev/null +++ b/rt/html/Elements/Menu @@ -0,0 +1,134 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<ul<% !$level ? ' id="system-menu"' : ''|n %><% $menu_class ? qq[ class="$menu_class"] : ''|n %>> +<div<% $menu_class ? qq[ class="$menu_class"] : ''|n %>><div class="wrapper"> +% my $sep = 0; +% my $postsep = 0; +% my $accesskey = 1; +% +% $count = 0; +% $class = {}; +% +% foreach $tab (sort keys %{$toptabs}) { +% $count++; +% +% my $current = $current_toptab || ""; +% my $path = $toptabs->{$tab}->{'path'} || ""; +% +% $path =~ s#/index.html$##gi; +% $current =~ s#/index.html$##gi; +% +% $sep = $toptabs->{$tab}->{'separator'} ? 1 : 0; +% +% my @aclass; +% push @aclass, 'selected' +% if $path eq $current; +% +% push @aclass, 'odd' +% if $level % 2; +% +% $class->{a} = join ' ', @aclass; +% +% my @li; +% push @li, 'first' +% if $count == 1; +% +% push @li, 'pre-separator' +% if $sep; +% +% push @li, 'post-separator' +% if $postsep; +% +% $class->{li} = join ' ', @li; +% +% my $url = ($toptabs->{$tab}->{'path'}||'') =~ /^https?:/i +% ? $toptabs->{$tab}->{'path'} || '' +% : $RT::WebPath . "/" . $toptabs->{$tab}->{'path'}; +% + <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>> + <% $count > 1 && !$postsep && qq[<span class="bullet">· </span>]|n%> + <a href="<% $url %>" + <% $class->{a} && qq[ class="$class->{a}"] |n%> + <% !$level && " accesskey='".$accesskey++."'" |n%>> + <% $toptabs->{$tab}->{'title'} || ''%></a> +%# Second-level items +% if ($toptabs->{$tab}->{'subtabs'} +% and keys %{$toptabs->{$tab}->{'subtabs'}}) +% { + <& /Elements/Menu, level => $level+1, + current_toptab => $toptabs->{$tab}->{'current_subtab'}, + toptabs => $toptabs->{$tab}->{'subtabs'}, + last_level => $toptabs->{$tab}->{last_system_menu_level} &> +% } + </li> +% if ($sep) { + <li class="separator">···</li> +% } +% +% $postsep = $sep; +% } +</div></div> +</ul> + +<%INIT> +my ($tab, $class, $count); + +my @ul; +push @ul, 'last-menu-level' + if $last_level; +push @ul, 'odd' + if $level % 2; +my $menu_class = join ' ', @ul; +</%INIT> + +<%ARGS> +$current_toptab => "" +$toptabs => undef +$level => 0 +$last_level => 0 +</%ARGS> diff --git a/rt/html/Elements/MessageBox b/rt/html/Elements/MessageBox new file mode 100644 index 000000000..0149e1b30 --- /dev/null +++ b/rt/html/Elements/MessageBox @@ -0,0 +1,74 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<textarea class="messagebox" cols="<%$Width%>" rows="<%$Height%>" wrap="<%$Wrap%>" name="<%$Name%>"><& /Elements/Callback, %ARGS &><% $Default %><%$message%><%$IncludeSignature ? $signature : ''%></textarea> +<%INIT> + +my $message = ''; + +if ($QuoteTransaction) { + my $transaction=RT::Transaction->new($session{'CurrentUser'}); + $transaction->Load($QuoteTransaction); + $message=$transaction->Content(Quote => 1); +} + +my $signature = ''; +if ($IncludeSignature && $session{'CurrentUser'}->UserObj->Signature) { + $signature = "-- \n".$session{'CurrentUser'}->UserObj->Signature; +} + +</%INIT> +<%ARGS> +$QuoteTransaction => undef +$Name => 'Content' +$Default => '' +$Width => $RT::MessageBoxWidth || 72 +$Height => $RT::MessageBoxHeight || 15 +$Wrap => $RT::MessageBoxWrap || 'HARD' +$IncludeSignature => 1 +</%ARGS> + diff --git a/rt/html/Elements/MyAdminQueues b/rt/html/Elements/MyAdminQueues new file mode 100644 index 000000000..7e720ad71 --- /dev/null +++ b/rt/html/Elements/MyAdminQueues @@ -0,0 +1,54 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<&|/Widgets/TitleBox, title => loc("Queues I administer"), bodyclass => "" &> +<& /Elements/QueueSummary, + cache => 'my_admin_queues', + queue_filter => sub { $_->CurrentUserHasRight('AdminQueue') }, + conditions => [ {cond => "Status = 'new'", name => loc ('new') }, + {cond => "Status = 'open'", name => loc ('open') }] &> +</&> diff --git a/rt/html/Elements/MyRT b/rt/html/Elements/MyRT new file mode 100644 index 000000000..3fde555c2 --- /dev/null +++ b/rt/html/Elements/MyRT @@ -0,0 +1,100 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<table border="0" width="100%"> +<tr valign="top"> + +<td class="boxcontainer" <% $summary? 'width="70%"': '' |n %>> +% $show_cb->($_) foreach @$body; +</td> + +% if ( $summary ) { +<td class="boxcontainer"> +% $show_cb->($_) foreach @$summary; +</td> +% } + +</tr> +</table> + +<%INIT> + +my $user = $session{'CurrentUser'}->UserObj; +unless (exists $session{'my_rt_portlets'}) { + my ($default_portlets) = RT::System->new($session{'CurrentUser'})->Attributes->Named('HomepageSettings'); + $session{'my_rt_portlets'} = $user->Preferences( + HomepageSettings => $default_portlets? $default_portlets->Content: {}, + ); +} + +my ($body, $summary) = @{$session{'my_rt_portlets'}}{qw(body summary)}; +unless( $body && @$body ) { + $body = $summary || []; + $summary = undef; +} +$summary = undef unless $summary && @$summary; + +my $Rows = $user->Preferences( 'SummaryRows', ( $RT::DefaultSummaryRows || 10 ) ); + +my $show_cb = sub { + my $entry = shift; + my $type = $entry->{type}; + if ( $type eq 'component' ) { + my $name = $entry->{name}; + + # security check etc. + $m->comp( $name, %{ $entry->{arguments} || {} } ); + } elsif ( $type eq 'system' ) { + $m->comp( '/Elements/ShowSearch', Name => $entry->{name}, Override => { Rows => $Rows } ); + } elsif ( $type eq 'saved' ) { + $m->comp( '/Elements/ShowSearch', SavedSearch => $entry->{name}, Override => { Rows => $Rows } ); + } else { + $RT::Logger->error("unknown portlet type $type"); + } +}; + +</%INIT> diff --git a/rt/html/Elements/MyReminders b/rt/html/Elements/MyReminders new file mode 100755 index 000000000..1e962bd61 --- /dev/null +++ b/rt/html/Elements/MyReminders @@ -0,0 +1,73 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%# DEPRECATED +<&|/Widgets/TitleBox, + title => loc("Reminders") &> +<table width="100%"> +% my $i =0; +% while (my $reminder = $reminders->Next) { +% $i++; +% if ($reminder->RefersTo->First) { +% my $ticket= $reminder->RefersTo->First->TargetObj; +<tr class="<%$i%2 ? 'evenline' : 'oddline'%>"><td><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$ticket->id%>"><%$reminder->Subject%></a><br /> +<blockquote> +#<%$ticket->id%>: <%$ticket->Subject%><br /> +<%$reminder->OwnerObj->Name %> <%$reminder->DueObj->Unix >0 ? '• '.$reminder->DueObj->AgeAsString : '' |n %> +</blockquote> +</td> +</tr> +% }} +</table> +</&> + +<%init> +my $reminders = RT::Tickets->new($session{'CurrentUser'}); +$reminders->FromSQL('(Owner = "Nobody" OR Owner = "'.$session{'CurrentUser'}->Name.'")' . + ' AND Type = "reminder" AND (Status = "new" OR Status = "open") AND Due > "1970-01-01"'); +$reminders->OrderBy(FIELD => 'Due', ORDER => 'DESC'); +</%init> diff --git a/rt/html/Elements/MyRequests b/rt/html/Elements/MyRequests new file mode 100644 index 000000000..fc1e27095 --- /dev/null +++ b/rt/html/Elements/MyRequests @@ -0,0 +1,49 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%# DEPRECATED +<& /Elements/ShowSearch, Name => 'My Requests' &> diff --git a/rt/html/Elements/MySupportQueues b/rt/html/Elements/MySupportQueues new file mode 100644 index 000000000..f9e18a09a --- /dev/null +++ b/rt/html/Elements/MySupportQueues @@ -0,0 +1,54 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<&|/Widgets/TitleBox, title => loc("Queues I'm an AdminCc for"), bodyclass => "" &> +<& /Elements/QueueSummary, + cache => 'my_support_queues', + queue_filter => sub { $_->IsAdminCc($session{'CurrentUser'}->Id) }, + conditions => [ {cond => "Status = 'new'", name => loc ('new') }, + {cond => "Status = 'open'", name => loc ('open') }] &> +</&> diff --git a/rt/html/Elements/MyTickets b/rt/html/Elements/MyTickets new file mode 100644 index 000000000..8d657db3d --- /dev/null +++ b/rt/html/Elements/MyTickets @@ -0,0 +1,49 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%# DEPRECATED +<& /Elements/ShowSearch, Name => 'My Tickets' &> diff --git a/rt/html/Elements/PageLayout b/rt/html/Elements/PageLayout new file mode 100644 index 000000000..b9fd31f71 --- /dev/null +++ b/rt/html/Elements/PageLayout @@ -0,0 +1,256 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<table class="black" border=0 cellspacing=0 cellpadding=0 width="100%"> +<tr> + <TD colspan=5 WIDTH="100%" STYLE="padding:0"><IMG BORDER=0 ALT="" SRC="<% $RT::URI::freeside::URL %>/images/black-gradient.png" HEIGHT="13" WIDTH="100%"></TD> +</tr> +<tr> + + <div id="topactions"> +% my $notfirst = 0; foreach my $action (sort keys %{$topactions}) { + <span class="topaction"> + <td class="blackright" ALIGN="right" VALIGN="center"> +% $m->out($topactions->{"$action"}->{'html'}); + </td> + </span> +% } + </div> + +</tr> +</table> + +%# End of div#quickbar from /Elements/Header +</div> + +<table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%"> + <TR> + <TD STYLE="padding:0" WIDTH="100%"><IMG BORDER=0 ALT="" SRC="<% $RT::URI::freeside::URL %>/images/black-gray-top.png" HEIGHT="13" WIDTH="100%"></TD> + </TR> + <TR HEIGHT="100%"> + <TD> + +% if ( $show_menu ) { +<div id="nav"> +<& /Elements/Menu, toptabs => $toptabs, current_toptab => $current_toptab &> +</div> +% } + +<div id="header"> + <h1><%$title%></h1> + +% my $sep = 0; +% my $postsep = 0; +% my $count = 0; +% my $class = { }; +% + <ul id="page-menu"<% (($actions && %$actions) || ($subactions && %$subactions)) && q[ class="actions-present"] | n %>> + <div><div><div> +% if ($page_tabs) { +% foreach my $tab (sort keys %{$page_tabs}) { +% next if $tab =~ /^(?:current_toptab|this)$/; +% $count++; +% +% my $current = $page_tabs->{current_toptab} || ""; +% my $path = $page_tabs->{$tab}->{'path'} || ""; +% +% $path =~ s#/index.html$##gi; +% $current =~ s#/index.html$##gi; +% +% $sep = $toptabs->{$tab}->{'separator'} ? 1 : 0; +% +% $class->{a} = $path eq $current ? ' class="selected"' : undef; +% +% my @li; +% push @li, 'first' +% if $count == 1; +% +% push @li, 'pre-separator' +% if $sep; +% +% push @li, 'post-separator' +% if $postsep; +% +% $class->{li} = join ' ', @li; +% +% + <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && "· "|n%><a href="<%$RT::WebPath%>/<%$page_tabs->{$tab}->{'path'}%>"<%$class->{a}|n%><% $class->{a} ? ' name="focus"' : ''|n %>><% $page_tabs->{$tab}->{'title'} %></a></li> +% +% if ($sep) { + <li class="separator">···</li> +% } +% $postsep = $sep; +% } +% } else { + +% } + </div></div></div> + </ul> + +% if (($actions && %$actions) || ($subactions && %$subactions)) { + <ul id="actions-menu"> + <div><div><div> +% $sep = 0; +% $postsep = 0; +% $count = 0; +% $class = { }; +% +% for my $type ($actions, $subactions) { +% +% if ($type && %$type) { +% foreach my $action (sort keys %{$type}) { +% $count++; +% +% $sep = $type->{$action}->{'separator'} ? 1 : 0; +% +% my @li; +% push @li, 'first' +% if $count == 1; +% +% push @li, 'pre-separator' +% if $sep; +% +% push @li, 'post-separator' +% if $postsep; +% +% $class->{li} = join ' ', @li; +% + <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && qq[<span class="bullet">· </span>]|n%> +% if ($type->{"$action"}->{'html'}) { + <% $type->{"$action"}->{'html'} | n %> +% } else { + <a href="<%$RT::WebPath%>/<%$type->{$action}->{'path'}%>"<% $type->{$action}->{class} && ' class="'.$type->{$action}->{class}.'"' |n %><% $type->{$action}->{id} && ' id="'.$type->{$action}->{id}.'"' |n %>><%$type->{$action}->{'title'}%></a> +% } + </li> +% if ($sep) { + <li class="separator">···</li> +% } +% $postsep = $sep; +% } +% } +% } + </div></div></div> + </ul> +% } +</div> + +<div id="body"> +<& /Elements/Callback, _CallbackName => 'BeforeBody', %ARGS &> +%$m->flush_buffer(); # we've got the page laid out, let's flush the buffer; + +<%INIT> + foreach my $tab (sort keys %{$toptabs}) { + if ($current_toptab && $toptabs->{$tab}->{'path'} eq $current_toptab) { + $toptabs->{$tab}->{"subtabs"} = $tabs; + $toptabs->{$tab}->{"current_subtab"} = $current_tab; + } + } + +if (! defined($AppName)) { + $AppName = loc("RT for [_1]", $RT::rtname); +} + +my ($menu_depth, $almost_last, $page_tabs); + +if ($RT::WebDefaultStylesheet ne '3.4-compat') { + ($menu_depth, $almost_last) = @{$m->comp('.menu_recurse', data => $toptabs)}; + + if (defined $almost_last->{subtabs} and %{$almost_last->{subtabs}}) { + $page_tabs = { + current_toptab => $almost_last->{current_subtab}, + %{$almost_last->{subtabs}}, + }; + + delete $almost_last->{subtabs}; + delete $almost_last->{current_subtab}; + } +} +</%INIT> + +%# There's probably a better way to do this that involves three times as +%# much work and redoing the whole menu/tab system... which would seem a +%# bit out of scope. +%# +%# This function recurses through the menu and returns the second to +%# last menu, that is, the menu holding the last reference to +%# and submenu. It also returns the number of menu levels minus +%# the last submenu. +<%def .menu_recurse> + <%args> + $data => { } + $pdata => { } + $ppdata => { } + $level => 0 + </%args> + <%init> + for my $key (keys %$data) { + return $m->comp('.menu_recurse', data => $data->{$key}->{subtabs}, + pdata => $data->{$key}, + ppdata => $pdata, + level => $level+1) + if ref($data->{$key}) eq 'HASH' + and defined $data->{$key}->{subtabs} + and %{$data->{$key}->{subtabs}}; + } + $ppdata->{last_system_menu_level}++; + return [$level, $pdata]; + </%init> +</%def> + +<%ARGS> +$current_toptab => undef +$current_tab => undef +$toptabs => undef +$topactions => undef +$tabs => undef +$actions => undef +$subactions => undef +$title => $m->callers(-1)->path +$AppName => undef +$show_menu => 1 +</%ARGS> diff --git a/rt/html/Elements/QueryString b/rt/html/Elements/QueryString new file mode 100644 index 000000000..0176180d2 --- /dev/null +++ b/rt/html/Elements/QueryString @@ -0,0 +1,63 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%init> +my @params; +while ( my ($key, $value) = each %ARGS ){ + if( UNIVERSAL::isa( $value, 'ARRAY' ) ) { + push @params, map $key."=".$m->interp->apply_escapes($_,'u'), @$value; + } else { + if (ref $value eq "ARRAY") { + push @params, $key."=".$m->interp->apply_escapes($_, 'u') + for @{$value}; + } else { + push @params, $key."=".$m->interp->apply_escapes($value||"",'u'); + } + } +} +return(join('&',@params)); +</%init> diff --git a/rt/html/Elements/QueueSummary b/rt/html/Elements/QueueSummary new file mode 100644 index 000000000..133539cc0 --- /dev/null +++ b/rt/html/Elements/QueueSummary @@ -0,0 +1,92 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<table border="0" cellspacing="0" cellpadding="1" width="100%"> +<tr> + <th class="collection-as-table"><&|/l&>Queue</&></th> +% for my $condition (@$conditions) { + <th class="collection-as-table"><% $condition->{name} %></th> +% } +</tr> +% my $i; +% for my $queue (@queues) { +% $i++; +% my $queue_cond = "Queue = '$queue->{Name}' AND "; +% my $all_q = $queue_cond . "(Status = 'open' OR Status = 'new' OR Status = 'stalled')"; +<tr class="<% $i%2 ? 'oddline' : 'evenline'%>" > +<td><a href="<% $RT::WebPath%>/Search/Results.html?Query=<% $all_q |u,n %>" title="<% $queue->{Description} %>"><% $queue->{Name} %></a></td> +% for my $condition (@$conditions) { +% $Tickets->FromSQL( "Queue = $queue->{id} AND ". $condition->{cond} ); +<td align="right"><a href="<% $RT::WebPath%>/Search/Results.html?Query=<% $queue_cond.$condition->{cond} |u,n %>"><% $Tickets->Count %></a></td> +% } +</tr> +% } +</table> +<%INIT> +my @queues; + +if ($cache && exists $session{$cache}) { + @queues = @{$session{$cache}}; +} +else { + my $Queues = RT::Queues->new($session{'CurrentUser'}); + $Queues->UnLimit(); + @queues = map { + { Name => $_->Name, Description => $_->Description, + id => $_->Id } } + grep $queue_filter->($_), @{$Queues->ItemsArrayRef}; + + $session{$cache} = \@queues if $cache; +} + +my $Tickets = RT::Tickets->new($session{'CurrentUser'}); +</%INIT> +<%ARGS> +$cache => undef +$queue_filter => undef +$conditions => () +</%ARGS> diff --git a/rt/html/Elements/QuickCreate b/rt/html/Elements/QuickCreate new file mode 100644 index 000000000..75b3a4598 --- /dev/null +++ b/rt/html/Elements/QuickCreate @@ -0,0 +1,71 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<div class="quick-create"> +<&| /Widgets/TitleBox, title => loc('Quick ticket creation') &> +<form method="post" action="<%$RT::WebPath%>/<% $RT::QuickCreateLong ? 'Ticket/Create.html' : 'index.html' %>"> +<input type="hidden" class="hidden" name="QuickCreate" value="1" /> +<table> +<tr><td> +<&|/l&>Subject</&>:<br /><input size="30" name="Subject" /> +</td><td> +<&|/l&>Queue</&>:<br /><& /Elements/SelectNewTicketQueue, Name => 'Queue', ShowNullOption => 0 &> +</td><td> +<&|/l&>Owner</&>:<br /> +<select type="select" name="Owner"> +<option value="<%$session{'CurrentUser'}->id%>" selected><%$session{'CurrentUser'}->Name %></option> +<option value="<%$RT::Nobody->id%>"><%loc('Nobody')%></option> +</select> +</td> +</tr> +%#<tr><td colspan="3"><textarea cols="50" rows="3"></textarea></td></tr> +</table> +<div align="right"><input type="submit" class="button" value="<%loc('Create')%>" /></div> +</form> +</&> +</div> + diff --git a/rt/html/Elements/Quicksearch b/rt/html/Elements/Quicksearch new file mode 100644 index 000000000..4acbc204d --- /dev/null +++ b/rt/html/Elements/Quicksearch @@ -0,0 +1,61 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<div class="ticket-overview"> +<&|/Widgets/TitleBox, title => loc("Quick search"), bodyclass => "", + titleright => loc("Edit"), titleright_href => $RT::WebPath.'/Prefs/Quicksearch.html' &> +<& /Elements/QueueSummary, + cache => 'quick_search_queues', + queue_filter => sub { $_->CurrentUserHasRight('ShowTicket') && !exists $unwanted->{$_->Name} }, + conditions => [ {cond => "Status = 'new'", name => loc ('new') }, + {cond => "Status = 'open'", name => loc ('open') }, + {cond => "Status = 'stalled'", name => loc ('stalled') }] &> +</&> +</div> +<%INIT> +my $unwanted = $session{'CurrentUser'}->UserObj->Preferences('QuickSearch', {}); +</%INIT> diff --git a/rt/html/Elements/RT__Ticket/ColumnMap b/rt/html/Elements/RT__Ticket/ColumnMap new file mode 100644 index 000000000..21dc2a753 --- /dev/null +++ b/rt/html/Elements/RT__Ticket/ColumnMap @@ -0,0 +1,314 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Name => undef +$Attr => undef +</%ARGS> + + +<%ONCE> +our ( $COLUMN_MAP ); + +my $ColumnMap = sub { + my $name = shift; + my $attr = shift; + + # First deal with the simple things from the map + if ( $COLUMN_MAP->{$name} ) { + return ( $COLUMN_MAP->{$name}->{$attr} ); + } + + # now, let's deal with harder things, like Custom Fields + + elsif ( $name =~ /^(?:CF|CustomField)\.\{(.+)\}$/ ) { + my $field = $1; + + if ( $attr eq 'attribute' ) { + return (undef); + } + elsif ( $attr eq 'title' ) { + return ( $field ); + } + 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); + my @values = map { + ( + ($_->CustomFieldObj->Type eq 'Image') + ? \($m->scomp( '/Elements/ShowCustomFieldImage', Object => $_ )) + : $_->Content + ), + \'<br />', + } @{ $values->ItemsArrayRef }; + pop @values; # Remove that last <br /> + return @values; + }; + } + } +}; + +my $LinkCallback = sub { + my $method = shift; + + my $mode = $RT::Ticket::LINKTYPEMAP{$method}{Mode}; + my $type = $RT::Ticket::LINKTYPEMAP{$method}{Type}; + my $other_mode = ($mode eq "Target" ? "Base" : "Target"); + 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($other_mode,$type)->ItemsArrayRef } + } +}; + +$COLUMN_MAP = { + QueueName => { + attribute => 'Queue', + title => 'Queue', + value => sub { return $_[0]->QueueObj->Name } + }, + OwnerName => { + title => 'Owner', + attribute => 'Owner', + value => sub { return $_[0]->OwnerObj->Name } + }, + id => { + attribute => 'id', + align => 'right', + value => sub { return $_[0]->id } + }, + Status => { + attribute => 'Status', + value => sub { return loc($_[0]->Status) } + }, + Subject => { + attribute => 'Subject', + value => sub { return $_[0]->Subject || "(" . loc('No subject') . ")" } + }, + ExtendedStatus => { + title => 'Status', + attribute => 'Status', + value => sub { + my $Ticket = shift; + + if ( $Ticket->HasUnresolvedDependencies ) { + if ( $Ticket->HasUnresolvedDependencies( Type => 'approval' ) + or $Ticket->HasUnresolvedDependencies( Type => 'code' ) ) + { + return \'<em>', loc('(pending approval)'), \'</em>'; + } + else { + return \'<em>', loc('(pending other Collection)'), \'</em>'; + } + } + else { + return loc( $Ticket->Status ); + } + + } + }, + Priority => { + attribute => 'Priority', + value => sub { return $_[0]->Priority } + }, + InitialPriority => { + attribute => 'InitialPriority', + name => 'Initial Priority', + value => sub { return $_[0]->InitialPriority } + }, + FinalPriority => { + attribute => 'FinalPriority', + name => 'Final Priority', + value => sub { return $_[0]->FinalPriority } + }, + EffectiveId => { + attribute => 'EffectiveId', + value => sub { return $_[0]->EffectiveId } + }, + Type => { + attribute => 'Type', + value => sub { return $_[0]->Type } + }, + 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 => { + attribute => 'Requestor.EmailAddress', + value => sub { return $_[0]->Requestors->MemberEmailAddressesAsString } + }, + Cc => { + attribute => 'Cc.EmailAddress', + value => sub { return $_[0]->Cc->MemberEmailAddressesAsString } + }, + AdminCc => { + attribute => 'AdminCc.EmailAddress', + value => sub { return $_[0]->AdminCc->MemberEmailAddressesAsString } + }, + StartsRelative => { + title => 'Starts', + attribute => 'Starts', + value => sub { return $_[0]->StartsObj->AgeAsString } + }, + StartedRelative => { + title => 'Started', + attribute => 'Started', + value => sub { return $_[0]->StartedObj->AgeAsString } + }, + CreatedRelative => { + title => 'Created', + attribute => 'Created', + value => sub { return $_[0]->CreatedObj->AgeAsString } + }, + LastUpdatedRelative => { + title => 'Last Updated', + attribute => 'LastUpdated', + value => sub { return $_[0]->LastUpdatedObj->AgeAsString } + }, + ToldRelative => { + title => 'Told', + attribute => 'Told', + value => sub { return $_[0]->ToldObj->AgeAsString } + }, + DueRelative => { + title => 'Due', + attribute => 'Due', + value => sub { + my $date = $_[0]->DueObj; + if ($date && $date->Unix > 0 && $date->Unix < time()) { + return (\'<span class="overdue">' , $date->AgeAsString , \'</span>'); + } else { + return $date->AgeAsString; + } + } + }, + ResolvedRelative => { + title => 'Resolved', + attribute => 'Resolved', + value => sub { return $_[0]->ResolvedObj->AgeAsString } + }, + Starts => { + attribute => 'Starts', + value => sub { return $_[0]->StartsObj->AsString } + }, + Started => { + attribute => 'Started', + value => sub { return $_[0]->StartedObj->AsString } + }, + Created => { + attribute => 'Created', + value => sub { return $_[0]->CreatedObj->AsString } + }, + 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 => { + attribute => 'Told', + value => sub { return $_[0]->ToldObj->AsString } + }, + Due => { + attribute => 'Due', + value => sub { return $_[0]->DueObj->AsString } + }, + Resolved => { + attribute => 'Resolved', + value => sub { return $_[0]->ResolvedObj->AsString } + }, + + # Everything from LINKTYPEMAP + (map { + $_ => { value => $LinkCallback->( $_ ) } + } keys %RT::Ticket::LINKTYPEMAP), + + '_CLASS' => { + value => sub { return $_[1] % 2 ? 'oddline' : 'evenline' } + }, + '_CHECKBOX' => { + attribute => 'checkbox', + title => loc('Update'), + align => 'right', + value => sub { return \('<input type="checkbox" class="checkbox" name="UpdateTicket'.$_[0]->id.'" value="1" checked />') } + }, + +}; +</%ONCE> +<%init> +$m->comp( '/Elements/Callback', COLUMN_MAP => $COLUMN_MAP, _CallbackName => 'ColumnMap'); +return $ColumnMap->( $Name, $Attr ); +</%init> diff --git a/rt/html/Elements/Refresh b/rt/html/Elements/Refresh new file mode 100644 index 000000000..6edec0967 --- /dev/null +++ b/rt/html/Elements/Refresh @@ -0,0 +1,69 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select name="<%$Name%>"> +<option value="-1" +%unless ($Default) { + selected +%} +><&|/l&>Don't refresh this page.</&></option> +%foreach my $value (@refreshevery) { +<option value="<%$value%>" +% if ( $Default && ($value == $Default)) { +selected +% } +><&|/l, $value/60 &>Refresh this page every [_1] minutes.</&></option> +%} +</select> + +<%INIT> +my @refreshevery = qw(120 300 600 1200 3600 7200); +</%INIT> +<%ARGS> +$Name => undef +$Default => 0 +</%ARGS> diff --git a/rt/html/Elements/RefreshHomepage b/rt/html/Elements/RefreshHomepage new file mode 100644 index 000000000..167a48cab --- /dev/null +++ b/rt/html/Elements/RefreshHomepage @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<form method="get" action="<%$RT::WebPath%>/index.html"> +<& /Elements/Refresh, Name => 'HomeRefreshInterval', Default => $session {'home_refresh_interval'} &> +<div align="right"><input type="submit" class="button" value="<&|/l&>Go!</&>" /></div> +</form> diff --git a/rt/html/Elements/ScrubHTML b/rt/html/Elements/ScrubHTML new file mode 100644 index 000000000..f382cc273 --- /dev/null +++ b/rt/html/Elements/ScrubHTML @@ -0,0 +1,73 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%init> +my $scrubber = HTML::Scrubber->new(); + +$scrubber->default( + 0, + { + '*' => 0, + id => 1, + class => 1, + # Match http, ftp and relative urls + href => qr{^(?:http:|ftp:|https:|/|__Web(?:Path|BaseURL|URL)__)}i, + face => 1, + size => 1, + target => 1 + } +); + +$scrubber->deny(qw[*]); +$scrubber->allow( + qw[A B U P BR I HR BR SMALL EM FONT SPAN DIV UL OL LI DL DT DD PRE]); +$scrubber->comment(0); +return ( $scrubber->scrub($Content) ); +</%init> +<%args> +$Content => undef +</%args> diff --git a/rt/html/Elements/Section b/rt/html/Elements/Section new file mode 100644 index 000000000..befe2475f --- /dev/null +++ b/rt/html/Elements/Section @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<h1><%$title%></h1> +<%ARGS> +$title => undef +</%ARGS> diff --git a/rt/html/Elements/SelectAttachmentField b/rt/html/Elements/SelectAttachmentField new file mode 100644 index 000000000..8a37ca504 --- /dev/null +++ b/rt/html/Elements/SelectAttachmentField @@ -0,0 +1,56 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select name="<%$Name%>"> +<option value="Subject"><&|/l&>Subject</&></option> +<option value="Content"><&|/l&>Content</&></option> +<option value="ContentType"><&|/l&>Content-Type</&></option> +<option value="Filename"><&|/l&>Filename</&></option> +</select> +<%ARGS> +$Name => 'AttachmentField' +</%ARGS> diff --git a/rt/html/Elements/SelectBoolean b/rt/html/Elements/SelectBoolean new file mode 100644 index 000000000..b34e07a14 --- /dev/null +++ b/rt/html/Elements/SelectBoolean @@ -0,0 +1,71 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select NAME ="<%$Name%>"> +<option value="<%$TrueVal%>" <%$TrueDefault%>><%$True%></option> +<option value="<%$FalseVal%>" <%$FalseDefault%>><%$False%></option> +</select> + +<%ARGS> +$Name => undef +$True => loc("is") +$Default => 'true' +$TrueVal => 1 +$FalseVal => 0 +$False => loc("isn't") +</%ARGS> + +<%INIT> +my $TrueDefault = ''; +my $FalseDefault =''; +if ($Default && $Default !~ /true/i) { + $FalseDefault = "SELECTED"; +} +else { + $TrueDefault = "SELECTED"; +} +</%INIT> diff --git a/rt/html/Elements/SelectCustomFieldOperator b/rt/html/Elements/SelectCustomFieldOperator new file mode 100644 index 000000000..ecb306c58 --- /dev/null +++ b/rt/html/Elements/SelectCustomFieldOperator @@ -0,0 +1,64 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select NAME ="<%$Name%>"> +% while (my $option = shift @Options) { +% my $value = shift @Values; +<option value="<%$value%>" +% if ($Default eq $value) { +selected +% } +><%$option%></option> +% } +</select> + +<%ARGS> +$Name => undef +@Options => ( loc('contains'), loc("doesn't contain"), loc('is'), loc("isn't"), loc('less than'), loc('greater than')) +@Values => ('LIKE', 'NOT LIKE', '=', '!=', '<', '>') +$Default => '' +</%ARGS> diff --git a/rt/html/Elements/SelectCustomFieldValue b/rt/html/Elements/SelectCustomFieldValue new file mode 100644 index 000000000..2bcb35e9a --- /dev/null +++ b/rt/html/Elements/SelectCustomFieldValue @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Elements/Callback, %ARGS &> +% if ($CustomField->Type =~ /Select/i) { +% my $values = $CustomField->Values; +<select name="<%$Name%>"> +<option value="" selected>-</option> +<option value="NULL"><&|/l&>(no value)</&></option> +% while (my $value = $values->Next) { +<option value="<%$value->Name%>"><%$value->Name%></option> +% } +</select> +% } +% else { +<input name="<%$Name%>" size="20" /> +% } +<%args> +$Name => undef +$CustomField =>undef +</%args> diff --git a/rt/html/Elements/SelectDate b/rt/html/Elements/SelectDate new file mode 100644 index 000000000..b43f324ac --- /dev/null +++ b/rt/html/Elements/SelectDate @@ -0,0 +1,75 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<script type="text/javascript"><!-- + onLoadHook('createCalendarLink("<% $Name %>");'); +--></script> +<input type="text" id="<% $Name %>" name="<% $Name %>" value="<% $Default %>" size="<% $Size %>" /> +<%init> +unless ((defined $Default) or + ($current <= 0)) { + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = + localtime($current); + $Default = sprintf("%04d-%02d-%02d %02d:%02d", + $year+1900,$mon+1,$mday, + $hour,$min); +} + +unless ($Name) { + $Name = $menu_prefix. "_Date"; +} +</%init> + +<%args> + +$ShowTime => undef +$menu_prefix=>'' +$current=>time +$Default => '' +$Name => undef +$Size => 16 +</%args> diff --git a/rt/html/Elements/SelectDateRelation b/rt/html/Elements/SelectDateRelation new file mode 100644 index 000000000..9c80be4d7 --- /dev/null +++ b/rt/html/Elements/SelectDateRelation @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select NAME ="<%$Name%>"> +<option value="<"><%$Before%></option> +<option value="="><%$On%></option> +<option value=">"><%$After%></option> +</select> + +<%ARGS> +$Name => undef +$Default => undef +$Before => loc('Before') +$On => loc('On') +$After => loc('After') +</%ARGS> diff --git a/rt/html/Elements/SelectDateType b/rt/html/Elements/SelectDateType new file mode 100644 index 000000000..653949a83 --- /dev/null +++ b/rt/html/Elements/SelectDateType @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select name="<%$Name%>"> +<option value="Created"><&|/l&>Created</&></option> +<option value="Started"><&|/l&>Started</&></option> +<option value="Resolved"><&|/l&>Resolved</&></option> +<option value="Told"><&|/l&>Last Contacted</&></option> +<option value="LastUpdated"><&|/l&>Last Updated</&></option> +<option value="Starts"><&|/l&>Starts</&></option> +<option value="Due"><&|/l&>Due</&></option> +<option value="Updated"><&|/l&>Updated</&></option> +</select> +<%ARGS> +$Name => 'DateType' +</%ARGS> diff --git a/rt/html/Elements/SelectEqualityOperator b/rt/html/Elements/SelectEqualityOperator new file mode 100644 index 000000000..851add309 --- /dev/null +++ b/rt/html/Elements/SelectEqualityOperator @@ -0,0 +1,64 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select NAME ="<%$Name%>"> +% while (my $option = shift @Options) { +% my $value = shift @Values; +<option value="<%$value%>" +% if ($Default eq $value) { +selected +% } +><%$option%></option> +% } +</select> + +<%ARGS> +$Name => undef +@Options => (loc('less than'), loc('equal to'), loc('greater than'), loc('not equal to')) +@Values => qw(< = > !=) +$Default =>'' +</%ARGS> diff --git a/rt/html/Elements/SelectGroups b/rt/html/Elements/SelectGroups new file mode 100644 index 000000000..c1fb9df2a --- /dev/null +++ b/rt/html/Elements/SelectGroups @@ -0,0 +1,62 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select name="GroupField"> +% foreach my $col (RT::Group->BasicColumns) { +<option value="<% $col->[0] %>"><% loc($col->[1]) %></option> +% } +% while (my $CF = $CFs->Next) { +<option value="CustomField-<% $CF->Id %>"><&|/l&>CustomField</&>: <% $CF->Name %></option> +% } +</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 new file mode 100644 index 000000000..7640744c9 --- /dev/null +++ b/rt/html/Elements/SelectLang @@ -0,0 +1,80 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select NAME ="<%$Name%>"> +% if ($ShowNullOption) { +<option value="">-</option> +% } +% foreach my $lang (@lang) { +<option value="<%$lang%>" <%($Default && ($lang eq $Default)) && 'SELECTED'%>><% $lang_to_desc{$lang} %> +% if (($Verbose) and (my $description = I18N::LangTags::List::native_name($lang)) ){ +(<%$description%>) +% } +</option> +% } +</select> +<%ARGS> +$ShowNullOption => 1 +$ShowAllQueues => 1 +$Name => undef +$Verbose => undef +$Default => 0 +$Lite => 0 +</%ARGS> + +<%ONCE> +use I18N::LangTags::List; +my (@lang, %lang_to_desc); +foreach my $lang (map { s/:://; s/_/-/g; $_ } grep { /^\w+::$/ } keys %RT::I18N::) { + next if $lang =~ /i-default|en-us/; + my $desc = I18N::LangTags::List::name($lang); + next unless ($desc); + $desc =~ s/(.*) (.*)/$2 ($1)/; + $lang_to_desc{$lang} = $desc; +} +@lang = sort { $lang_to_desc{$a} cmp $lang_to_desc{$b} } keys %lang_to_desc; +</%ONCE> diff --git a/rt/html/Elements/SelectLinkType b/rt/html/Elements/SelectLinkType new file mode 100644 index 000000000..4617e7c1c --- /dev/null +++ b/rt/html/Elements/SelectLinkType @@ -0,0 +1,61 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select NAME ="<%$Name%>"> +<option value="MemberOf"><&|/l&>Member of</&></option> +<option value="DependsOn"><&|/l&>Depends on</&></option> +<option value="RefersTo"><&|/l&>Refers to</&></option> +</select> + +<%ARGS> +$Name => "LinkType" +$Default => undef +</%ARGS> + +<%INIT> +# TODO handle Default +</%INIT> diff --git a/rt/html/Elements/SelectMatch b/rt/html/Elements/SelectMatch new file mode 100644 index 000000000..646ad4e31 --- /dev/null +++ b/rt/html/Elements/SelectMatch @@ -0,0 +1,82 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select NAME ="<%$Name%>"> +<option value="LIKE" <%$LikeDefault%>><%$Like%></option> +<option value="NOT LIKE" <%$NotLikeDefault%>><%$NotLike%></option> +<option value="=" <%$TrueDefault%>><%$True%></option> +<option value="!=" <%$FalseDefault%>><%$False%></option> +</select> + +<%ARGS> +$Name => undef +$Like => loc('contains') +$NotLike => loc("doesn't contain") +$True => loc('is') +$False => loc("isn't") +$Default => undef +</%ARGS> +<%INIT> + +my $TrueDefault = ''; +my $FalseDefault=''; +my $LikeDefault=''; +my $NotLikeDefault =''; + +if ($Default && $Default =~ /false/i) { + $FalseDefault = "SELECTED"; +} +elsif ($Default && $Default =~ /true/i) { + $TrueDefault = "SELECTED"; +} +elsif ($Default && $Default =~ /notlike/i) { + $NotLikeDefault = "SELECTED"; +} +else { + $LikeDefault = "SELECTED"; +} +</%INIT> diff --git a/rt/html/Elements/SelectNewTicketQueue b/rt/html/Elements/SelectNewTicketQueue new file mode 100644 index 000000000..55dc7d2ea --- /dev/null +++ b/rt/html/Elements/SelectNewTicketQueue @@ -0,0 +1,50 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<label accesskey="9"> + <& /Elements/SelectQueue, Name => 'Queue', %ARGS, ShowNullOption => 0, ShowAllQueues => 0 &> +</label> diff --git a/rt/html/Elements/SelectOwner b/rt/html/Elements/SelectOwner new file mode 100644 index 000000000..f33b346dc --- /dev/null +++ b/rt/html/Elements/SelectOwner @@ -0,0 +1,110 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select name="<%$Name%>"> +%if ($DefaultValue) { +<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> +%} +</select> +<%INIT> +my @objects; +my @users; + +if ($TicketObj) { + @objects = ($TicketObj); +} +elsif ($QueueObj) { + @objects = ($QueueObj); +} +elsif ($cfqueues) { + @objects = keys %{$cfqueues}; +} +else { + # Let's check rights on an empty queue object. that will do a search for any queue. + my $queue = RT::Queue->new($session{'CurrentUser'}); + push( @objects, $queue ); +} + +my %user_uniq_hash; + + +foreach my $object (@objects) { + my $Users = RT::Users->new($session{CurrentUser}); + $Users->WhoHaveRight(Right => 'OwnTicket', Object => $object, IncludeSystemRights => 1, IncludeSuperusers => 0); + while (my $User = $Users->Next()) { + next if ($User->id == $RT::Nobody->id); # skip nobody here, so we can make them first later + $user_uniq_hash{$User->Id()} = $User; + } +} + +@users = sort { uc($a->Name) cmp uc($b->Name) } values %user_uniq_hash; +unshift(@users, $RT::Nobody); + + + +</%INIT> + +<%ARGS> +$QueueObj => undef +$Name => undef +$Default => 0 +$User => undef +$TicketObj => undef +$DefaultValue => 1 +$DefaultLabel => "-" +$ValueAttribute => 'id' +$cfqueues => undef +</%ARGS> diff --git a/rt/html/Elements/SelectQueue b/rt/html/Elements/SelectQueue new file mode 100644 index 000000000..0decb5bc9 --- /dev/null +++ b/rt/html/Elements/SelectQueue @@ -0,0 +1,97 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if ($Lite) { +% my $d = new RT::Queue($session{'CurrentUser'}); +% $d->Load($Default); +<input name="<%$Name%>" size="25" value="<%$d->Name%>" /> +% } +% else { +<select name="<%$Name%>"> +% if ($ShowNullOption) { + <option value="">-</option> +% } +% for my $queue (@{$session{$cache_key}}) { + <option value="<% ($NamedValues ? $queue->{Name} : $queue->{Id}) %>" <% ($queue->{Id} eq $Default ? 'selected="selected"' : '') |n %>> + <%$queue->{Name}%> +% if ($Verbose and $queue->{Description}) { + (<%$queue->{Description}%>) +% } + </option> +% } +</select> +% } +<%args> +$CheckQueueRight => 'CreateTicket' +$ShowNullOption => 1 +$ShowAllQueues => 1 +$Name => undef +$Verbose => undef +$NamedValues => 0 +$Default => 0 +$Lite => 0 +</%args> +<%init> +my $cache_key = "SelectQueue---" + . $session{'CurrentUser'}->Id + . "---$CheckQueueRight---$ShowAllQueues"; + +if (not defined $session{$cache_key} and not $Lite) { + my $q = new RT::Queues($session{'CurrentUser'}); + $q->UnLimit; + + while (my $queue = $q->Next) { + if ($ShowAllQueues || $queue->CurrentUserHasRight($CheckQueueRight)) { + push @{$session{$cache_key}}, { + Id => $queue->Id, + Name => $queue->Name, + Description => $queue->Description, + }; + } + } +} +</%init> diff --git a/rt/html/Elements/SelectResultsPerPage b/rt/html/Elements/SelectResultsPerPage new file mode 100644 index 000000000..a83cfaab7 --- /dev/null +++ b/rt/html/Elements/SelectResultsPerPage @@ -0,0 +1,68 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%# TODO: Better default handling + +<select name="<% $Name %>"> +% foreach my $value ( @values ) { +<option value="<% $value %>" <% $value == $Default? 'selected': '' %>> +<% shift @labels %> +</option> +% } +</select> + +<%INIT> +my @values = qw(0 10 25 50 100); +my @labels = (loc('Unlimited'), qw(10 25 50 100)); +$Default = 50 unless defined $Default; +</%INIT> +<%ARGS> + +$Name => undef +$Default => 50 + +</%ARGS> diff --git a/rt/html/Elements/SelectSortOrder b/rt/html/Elements/SelectSortOrder new file mode 100644 index 000000000..2a2771777 --- /dev/null +++ b/rt/html/Elements/SelectSortOrder @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select name="<%$Name%>"> +%foreach my $order (@orders) { +<option value="<%$order%>" <%$order eq $Default && 'SELECTED' %>> +<% shift @order_names %> +</option> +% } +</select> + +<%INIT> +my @orders = qw (ASC DESC); +my @order_names = (loc('Ascending'), loc('Descending')); + +</%INIT> + +<%ARGS> +$Name => 'SortOrder' +$Default => 'ASC' +</%ARGS> diff --git a/rt/html/Elements/SelectStatus b/rt/html/Elements/SelectStatus new file mode 100644 index 000000000..5f861af4f --- /dev/null +++ b/rt/html/Elements/SelectStatus @@ -0,0 +1,67 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select NAME ="<%$Name%>"> +%if ($DefaultValue) { +<option <% !$Default && "SELECTED" %> value=""><%$DefaultLabel%></option> +%} +%foreach my $status (@status) { +%next if ($SkipDeleted && $status eq 'deleted'); +<option <% ($status eq $Default) && "SELECTED" %> value="<%$status%>"><%loc($status)%></option> +% } +</select> +<%ONCE> +my $queue = new RT::Queue($session{'CurrentUser'}); +my @status = $queue->StatusArray(); +</%ONCE> +<%ARGS> +$Name => undef +$Default => '' +$SkipDeleted => 0 +$DefaultValue => 1 +$DefaultLabel => "-" +</%ARGS> diff --git a/rt/html/Elements/SelectTicketSortBy b/rt/html/Elements/SelectTicketSortBy new file mode 100644 index 000000000..aca98f878 --- /dev/null +++ b/rt/html/Elements/SelectTicketSortBy @@ -0,0 +1,62 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select name="<%$Name%>"> +% foreach my $field (@sortfields) { +<option value="<%$field%>" <% $field eq $Default && 'SELECTED'%>><% loc($field) %></option> +% } +</select> + +<%INIT> +my $tickets = new RT::Tickets($session{'CurrentUser'}); +my @sortfields = $tickets->SortFields(); + +</%INIT> +<%ARGS> +$Name => 'SortTicketsBy' +$Default => 'id' +</%ARGS> diff --git a/rt/html/Elements/SelectTicketTypes b/rt/html/Elements/SelectTicketTypes new file mode 100644 index 000000000..5bacccf6c --- /dev/null +++ b/rt/html/Elements/SelectTicketTypes @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select name="<%$Name%>"> +%foreach (@Types) { +<option value="<% $_ %>" <% ($_ eq $Default) && "SELECTED" %>><&|/l&><% $_ %></&> +%} +</select> + +<%ARGS> +$Name => 'TickType' +$Default => undef +@Types => qw(Approval Ticket) +</%ARGS> diff --git a/rt/html/Elements/SelectTimeUnits b/rt/html/Elements/SelectTimeUnits new file mode 100755 index 000000000..e1656f113 --- /dev/null +++ b/rt/html/Elements/SelectTimeUnits @@ -0,0 +1,57 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select name="<% $Name %>"> +<option value="minutes" selected><% loc('Minutes') %></option> +<option value="hours"><% loc('Hours') %></option> +</select> +<%INIT> +$Name .= '-TimeUnits' unless $Name =~ /-TimeUnits$/io; +</%INIT> +<%ARGS> +$Name => '' +</%ARGS> diff --git a/rt/html/Elements/SelectUsers b/rt/html/Elements/SelectUsers new file mode 100644 index 000000000..52febb837 --- /dev/null +++ b/rt/html/Elements/SelectUsers @@ -0,0 +1,62 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select name="UserField"> +% foreach my $col (RT::User->BasicColumns) { +<option value="<% $col->[0] %>"><% loc($col->[1]) %></option> +% } +% while (my $CF = $CFs->Next) { +<option value="CustomField-<% $CF->Id %>"><&|/l&>CustomField</&>: <% $CF->Name %></option> +% } +</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 new file mode 100644 index 000000000..26854a782 --- /dev/null +++ b/rt/html/Elements/SelectWatcherType @@ -0,0 +1,71 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<select NAME ="<%$Name%>"> +% if ($AllowNull) { +<option value="">-</option> +% } +%for my $option (@types) { +<option value="<%$option%>" <%defined($Default) && $option eq $Default && "SELECTED"%>><%loc($option)%></option> +%} +</select> + +<%INIT> +my @types; +if ($Scope =~ 'queue') { + @types = qw(Cc AdminCc); +} +else { + @types = qw(Requestor Cc AdminCc); +} +</%INIT> +<%ARGS> +$AllowNull => 1 +$Default=>undef +$Scope => 'ticket' +$Name => 'WatcherType' +</%ARGS> diff --git a/rt/html/Elements/SetupSessionCookie b/rt/html/Elements/SetupSessionCookie new file mode 100644 index 000000000..63101af5a --- /dev/null +++ b/rt/html/Elements/SetupSessionCookie @@ -0,0 +1,126 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%init> +return if $m->is_subrequest; # avoid reentrancy, as suggested by masonbook + +my %cookies = CGI::Cookie->fetch(); +my $cookiename = "RT_SID_" . $RT::rtname . "." . $ENV{'SERVER_PORT'}; +$SessionCookie ||= $cookies{$cookiename} ? $cookies{$cookiename}->value : undef; + +my %backends = ( + mysql => 'Apache::Session::MySQL', + Pg => 'Apache::Session::Postgres', + + # Oracle => 'Apache::Session::Oracle', +); + +my $session_class = $RT::WebSessionClass + || $backends{$RT::DatabaseType} + || 'Apache::Session::File'; +my $pm = "$session_class.pm"; +$pm =~ s|::|/|g; +require $pm; + +# morning bug avoidance attempt -- pdh 20030815 +unless ( $RT::Handle->dbh && $RT::Handle->dbh->ping ) { + $RT::Handle->Connect(); +} + +my $session_properties; +if ( $session_class eq 'Apache::Session::File' ) { + $session_properties = { + Directory => $RT::MasonSessionDir, + LockDirectory => $RT::MasonSessionDir, + Transaction => 1 + }; +} else { + $session_properties = { + Handle => $RT::Handle->dbh, + LockHandle => $RT::Handle->dbh, + Transaction => 1 + }; +} + +eval { + tie %session, $session_class, $SessionCookie, $session_properties +}; +if ($@) { + + # If the session is invalid, create a new session. + eval { + tie %session, $session_class, undef, $session_properties; + undef $cookies{$cookiename}; + }; +} + +if ($@) { + die loc("RT couldn't store your session.") . "\n" + . loc( + "This may mean that that the directory '[_1]' isn't writable or a database table is missing or corrupt.", + $RT::MasonSessionDir + ) + . "\n\n" + . $@; +} + +if ( !$cookies{$cookiename} ) { + my $cookie = new CGI::Cookie( + -name => $cookiename, + -value => $session{_session_id}, + -path => $RT::WebPath, + -secure => ($RT::WebSecureCookies ? 1 :0) + ); + $r->headers_out->{'Set-Cookie'} = $cookie->as_string; + +} + +return (); +</%init> +<%args> +$SessionCookie => undef +</%args> diff --git a/rt/html/Elements/ShowCustomFieldBinary b/rt/html/Elements/ShowCustomFieldBinary new file mode 100644 index 000000000..9dd5faaf1 --- /dev/null +++ b/rt/html/Elements/ShowCustomFieldBinary @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<a href="<%$RT::WebPath%>/Download/CustomFieldValue/<% $Object->Id %>/<% $Object->Content %>"><% $Object->Content %></a> +<%ARGS> +$Object => undef +</%ARGS> diff --git a/rt/html/Elements/ShowCustomFieldImage b/rt/html/Elements/ShowCustomFieldImage new file mode 100644 index 000000000..c49ae0ecf --- /dev/null +++ b/rt/html/Elements/ShowCustomFieldImage @@ -0,0 +1,53 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% my $url = $RT::WebPath . "/Download/CustomFieldValue/".$Object->Id.'/'.$Object->Content; +<a href="<% $url %>"><% $Object->Content %></a> +<img type="<% $Object->ContentType %>" height="64" src="<% $url %>" align="middle" /> +<%ARGS> +$Object +</%ARGS> diff --git a/rt/html/Elements/ShowCustomFieldWikitext b/rt/html/Elements/ShowCustomFieldWikitext new file mode 100644 index 000000000..1ddd7da1f --- /dev/null +++ b/rt/html/Elements/ShowCustomFieldWikitext @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% my $content = $Object->LargeContent || $Object->Content; +% $content = $m->comp('/Elements/ScrubHTML', Content => $content); +% my $base = $Object->Object->WikiBase; +% my $wiki_content = Text::WikiFormat::format( $content."\n" , {}, { extended => 1, absolute_links => 1, implicit_links => $RT::WikiImplicitLinks, prefix => $base} ); +<%$wiki_content|n%> +<%init> +use Text::WikiFormat; +</%init> +<%ARGS> +$Object +</%ARGS> diff --git a/rt/html/Elements/ShowCustomFields b/rt/html/Elements/ShowCustomFields new file mode 100644 index 000000000..743c9999b --- /dev/null +++ b/rt/html/Elements/ShowCustomFields @@ -0,0 +1,115 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<table> +% while ( my $CustomField = $CustomFields->Next ) { +% my $Values = $Object->CustomFieldValues( $CustomField->Id ); +% my $count = $Values->Count; + <tr id="CF-<%$CustomField->id%>-ShowRow"> + <td class="label"><% $CustomField->Name %>:</td> + <td class="value"> +% unless ( $count ) { +<i><&|/l&>(no value)</&></i> +% } elsif ( $count == 1 ) { +% $print_value->( $CustomField, $Values->First ); +% } else { +<ul> +% while ( my $Value = $Values->Next ) { +<li> +% $print_value->( $CustomField, $Value ); +</li> +% } +</ul> +% } + </td> + </tr> +% } +</table> +<%INIT> +my $CustomFields = $Object->CustomFields; +$m->comp('/Elements/Callback', _CallbackName => 'MassageCustomFields', + CustomFields => $CustomFields); + +my $print_value = sub { + my ($cf, $value) = @_; + my $linked = $cf->LinkValueTo; + if ( $linked ) { + $m->out('<a href="'. $value->LinkValueTo .'" target="_new">'); + } + my $comp = "ShowCustomField". $cf->Type; + $m->comp('/Elements/Callback', + _CallbackName => 'ShowComponentName', + Name => \$comp, + CustomField => $cf, + Object => $Object + ); + if ( $m->comp_exists( $comp ) ) { + $m->comp( $comp, Object => $value ); + } else { + $m->print( $value->Content ); + } + $m->out('</a>') if $linked; + + # This section automatically populates a div with the "IncludeContentForValue" for this custom + # field if it's been defined + if ( $cf->IncludeContentForValue ) { + my $vid = $value->id; + $m->out( '<div class="object_cf_value_include" id="object_cf_value_'. $vid .'">' ); + $m->print( loc("See also:") ); + $m->out( '<a href="'. $value->IncludeContentForValue .'">' ); + $m->print( $value->IncludeContentForValue ); + $m->out( qq{</a></div>\n} ); + $m->out( qq{<script><!--\nahah('} ); + $m->print( $value->IncludeContentForValue ); + $m->out( qq{', 'object_cf_value_$vid');\n--></script>\n} ); + } +}; + +</%INIT> +<%ARGS> +$Object => undef +</%ARGS> diff --git a/rt/html/Elements/ShowLink b/rt/html/Elements/ShowLink new file mode 100644 index 000000000..a1d6bdf97 --- /dev/null +++ b/rt/html/Elements/ShowLink @@ -0,0 +1,64 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<a href="<%$URI->Resolver->HREF%>"> +% if ($URI->IsLocal) { +% my $member = $URI->Object; +% if (UNIVERSAL::isa($member, "RT::Ticket")) { +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<% loc($member->Status) %>] +% } elsif ( UNIVERSAL::can($member, 'Name')) { +<%$URI->Resolver->AsString%>: <%$member->Name%> +% } else { +<%$URI->Resolver->AsString%> +% } +% } else { +<%$URI->Resolver->AsString%> +% } +</a> +<%ARGS> +$URI => undef +</%ARGS> diff --git a/rt/html/Elements/ShowLinks b/rt/html/Elements/ShowLinks new file mode 100755 index 000000000..800e82ea2 --- /dev/null +++ b/rt/html/Elements/ShowLinks @@ -0,0 +1,112 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<table> + <tr> + <td class="labeltop"><&|/l&>Depends on</&>:</td> + <td class="value"> +<ul> +% while (my $Link = $Ticket->DependsOn->Next) { +<li><& ShowLink, URI => $Link->TargetURI &></li> +% } +</ul> + </td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Depended on by</&>:</td> + <td class="value"> +<ul> +% while (my $Link = $Ticket->DependedOnBy->Next) { +<li><& ShowLink, URI => $Link->BaseURI &></li> +% } +</ul> + </td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Parents</&>:</td> + <td class="value"> +<ul> +% while (my $Link = $Ticket->MemberOf->Next) { +<li><& ShowLink, URI => $Link->TargetURI &></li> +% } +</ul> + </td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Children</&>:</td> + <td class="value"><& /Ticket/Elements/ShowMembers, Ticket => $Ticket &></td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Refers to</&>:</td> + <td class="value"> +<ul> +% while (my $Link = $Ticket->RefersTo->Next) { +<li><& ShowLink, URI => $Link->TargetURI &></li> +% } +</ul> + </td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Referred to by</&>:</td> + <td class="value"> + <ul> +% while (my $Link = $Ticket->ReferredToBy->Next) { +% next if (UNIVERSAL::isa($Link->BaseObj, 'RT::Ticket') && $Link->BaseObj->Type eq 'reminder'); +<li><& ShowLink, URI => $Link->BaseURI &></li> +% } +</ul> + </td> + </tr> + +% # Allow people to add more rows to the table +% $m->comp('/Elements/Callback', %ARGS ); + +</table> + +<%ARGS> +$Ticket => undef +</%ARGS> diff --git a/rt/html/Elements/ShowMemberships b/rt/html/Elements/ShowMemberships new file mode 100644 index 000000000..f6b2817d7 --- /dev/null +++ b/rt/html/Elements/ShowMemberships @@ -0,0 +1,88 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<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/ShowSearch b/rt/html/Elements/ShowSearch new file mode 100644 index 000000000..ded865b82 --- /dev/null +++ b/rt/html/Elements/ShowSearch @@ -0,0 +1,126 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<&|/Widgets/TitleBox, + title => loc($search->Description, $ProcessedSearchArg->{'Rows'}), + title_href => $query_link_url.$QueryString, + titleright => $customize ? loc('Edit') : '', + titleright_href => $customize &> +<& $query_display_component, %$ProcessedSearchArg, ShowNavigation => 0 &> +</&> +<%init> +my $search; +my $user = $session{'CurrentUser'}->UserObj; +my $SearchArg; +my $customize; +my $query_display_component = '/Elements/TicketList'; +my $query_link_url = 'Search/Results.html'; + +if ($SavedSearch) { + my ( $container_object, $search_id ) = _parse_saved_search($SavedSearch); + $search = $container_object->Attributes->WithId($search_id); + unless ( $search->Id && ref( $SearchArg = $search->Content ) eq 'HASH' ) { + $m->out("Saved Search $SavedSearch not found"); + return; + } + $SearchArg->{'SearchType'} ||= 'Ticket'; + if ( $SearchArg->{SearchType} ne 'Ticket' ) { + + # XXX: dispatch to different handler here + $query_display_component + = '/Search/Elements/' . $SearchArg->{SearchType}; + $query_link_url = "Search/$SearchArg->{SearchType}.html"; + } else { + $customize = $RT::WebPath . '/Search/Build.html?' + . $m->comp( '/Elements/QueryString', + LoadSavedSearch => $SavedSearch ); + } +} else { + ($search) = RT::System->new( $session{'CurrentUser'} ) ->Attributes->Named( 'Search - ' . $Name ); + unless ( $search && $search->Id ) { + my (@custom_searches) = RT::System->new( $session{'CurrentUser'} )->Attributes->Named('SavedSearch'); + foreach my $custom (@custom_searches) { + if ($custom->Description eq $Name) { $search = $custom; last } + } + unless ($search && $search->id) { + $m->out("Predefined search $Name not found"); + return; + } + } + + $SearchArg = $user->Preferences( $search, $search->Content ); + $customize = $RT::WebPath . '/Prefs/Search.html?' + . $m->comp( '/Elements/QueryString', + name => ref($search) . '-' . $search->Id ); +} + +# ProcessedSearchArg is a search with overridings, but for link we use +# orginal search's poperties +my $ProcessedSearchArg = $SearchArg; +$ProcessedSearchArg = { %$SearchArg, %Override } if keys %Override; + +$m->comp( + '/Elements/Callback', %ARGS, + _CallbackName => 'ModifySearch', + OriginalSearch => $SearchArg, + Search => $ProcessedSearchArg, +); + +foreach ( $SearchArg, $ProcessedSearchArg ) { + $_->{'Query'} =~ s/__CurrentUser__/$session{'CurrentUser'}->Id/ge; + $_->{'Format'} =~ s/__WebPath__/$RT::WebPath/g; + $_->{'Format'} =~ s/__loc\(["']?(\w+)["']?\)__/loc("$1")/ge; +} + +my $QueryString = '?' . $m->comp( '/Elements/QueryString', %$SearchArg ); + +</%init> +<%ARGS> +$Name => undef +$SavedSearch => undef +%Override => () +</%ARGS> diff --git a/rt/html/Elements/SimpleSearch b/rt/html/Elements/SimpleSearch new file mode 100644 index 000000000..a4fd7e270 --- /dev/null +++ b/rt/html/Elements/SimpleSearch @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<form action="<% $RT::WebPath %>/Search/Simple.html" STYLE="margin:0"> +<SCRIPT TYPE="text/javascript"> + function clearhint_search_ticket (what) { + if ( what.value == '(ticket # or subject string)' ) + what.value = ''; + } +</SCRIPT> +<input name="q" autocomplete="off" accesskey="0" class="field" VALUE="(ticket # or subject string)" onFocus="clearhint_search_ticket(this);" onClick="clearhint_search_ticket(this);" STYLE="text-align:right; font-family: Arial, Verdana, Helvetica, sans-serif;"><BR> +<A HREF="<% $RT::WebPath %>/Search/Build.html" STYLE="color: #ffffff; font-size: 70%; font-weight:normal">Advanced</A> +<input type="submit" class="fsblackbutton" value="<&|/l&>Search tickets</&>" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%;padding-left:2px;padding-right:2px"> +</form> diff --git a/rt/html/Elements/Submit b/rt/html/Elements/Submit new file mode 100644 index 000000000..ee3e8b6f6 --- /dev/null +++ b/rt/html/Elements/Submit @@ -0,0 +1,86 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<div class="submit"> + <div class="extra-buttons"> +% if ($CheckAll) { + <input type="button" value="<%$CheckAllLabel%>" onclick="setCheckbox(this.form, '<% $CheckboxName %>', true);return false;" class="button" /> +% } +% if ($ClearAll) { + <input type="button" value="<%$ClearAllLabel%>" onclick="setCheckbox(this.form, '<% $CheckboxName %>', false);return false;" class="button" /> +% } +% if ($Reset) { + <input type="reset" value="<%$ResetLabel%>" class="button" /> +% } + </div> + <div class="buttons"> +% if ($AlternateLabel) { + <span class="caption"><%$AlternateCaption%></span> + <input type="submit" <% $Name && qq[ name="$Name"] | n %> value="<%$AlternateLabel%>" class="button" /> +% } else { + <span class="caption"><%$Caption%></span> + <input type="submit" <% $Name && qq[ name="$Name"] | n %> value="<%$Label%>" class="button" /> +% } + </div> + <div class="submit-clear"></div> +</div> + +<%ARGS> +$color => undef +$Caption => '' +$AlternateCaption => undef +$AlternateLabel => undef +$Label => loc('Submit') +$Name => undef +$CheckAll => undef +$CheckAllLabel => loc('Check All') +$ClearAll => undef +$ClearAllLabel => loc('Clear All') +$CheckboxName => '' +$Reset => undef +$ResetLabel => loc('Reset') +</%ARGS> diff --git a/rt/html/Elements/Tabs b/rt/html/Elements/Tabs new file mode 100644 index 000000000..9d1eea602 --- /dev/null +++ b/rt/html/Elements/Tabs @@ -0,0 +1,137 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Elements/PageLayout, + current_toptab => $current_toptab, + current_tab => $current_tab, + toptabs => $toptabs, + topactions => $topactions, + tabs => $tabs, + actions => $actions, + subactions => $subactions, + title => $Title, + show_menu => $show_menu, +&> +<a name="skipnav" id="skipnav" accesskey="8"></a> +<%INIT> +my $action; +my $basetopactions = { +# A => { html => $m->scomp('/Elements/CreateTicket') +# }, + A => { html => $m->scomp('/Elements/FreesideNewCust') + }, + B => { html => $m->scomp('/Elements/FreesideSearch') + }, + C => { html => $m->scomp('/Elements/FreesideInvoiceSearch') + }, + D => { html => $m->scomp('/Elements/FreesideSvcSearch') + }, + E => { html => $m->scomp('/Elements/SimpleSearch') + } + }; +my $basetabs = { + ' A'=> { title => 'Billing Main', + path => &RT::URI::freeside::FreesideURL(), + }, + A => { #title => loc('Homepage'), + title => 'Ticketing Main', + path => '', + }, + Ab => { title => loc('Simple Ticket Search'), + path => 'Search/Simple.html' + }, + B => { title => loc('Adv. Ticket Search'), + path => 'Search/Build.html' + }, + C => { title => loc('Tools'), + path => 'Tools/index.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', + topactions => $topactions, + toptabs => $toptabs, %ARGS); + +</%INIT> +<%ARGS> +$current_toptab => undef +$current_tab => undef +$toptabs => undef +$topactions => undef +$tabs => undef +$actions => undef +$subactions => undef +$Title => undef +$show_menu => 1 +</%ARGS> diff --git a/rt/html/Elements/TicketList b/rt/html/Elements/TicketList new file mode 100644 index 000000000..b36101e73 --- /dev/null +++ b/rt/html/Elements/TicketList @@ -0,0 +1,179 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<table border="0" cellspacing="0" cellpadding="1" width="100%"> + +% if ($ShowHeader) { +<& /Elements/CollectionAsTable/Header, + Format => \@Format, + FormatString => $Format, + AllowSorting => $AllowSorting, + Order => $Order, + Query => $Query, + Rows => $Rows, + Page => $Page, + OrderBy => $OrderBy , + BaseURL => $BaseURL, + maxitems => $maxitems &> +% } + +% my $i; +% while (my $record = $Collection->Next) { +% $i++; +% # Every ten rows, flush the buffer and put something on the page. +% # hun, this flushes things out out-of-order for me on "RT at a glance"...? +% # $m->flush_buffer() unless ($i % 10); +<& /Elements/CollectionAsTable/Row, Format => \@Format, i => $i, record => $record, maxitems => $maxitems &> +% } + +</table> + +% if ($Rows && $ShowNavigation) { +<hr> +% my $oddRows; +% if (($TotalFound % $Rows) == 0) { +% $oddRows = 0; +% } else { $oddRows = 1; } +% my $pages = int($TotalFound/$Rows)+$oddRows; +% $pages = 1 if $pages < 1; +<&|/l, $Page, $pages &>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 ) +); +</%perl> +% if ($Page > 1) { +<a href="<%$BaseURL%><%$prev%>"><&|/l&>Previous Page</&></a> +% } +% if (($Page * $Rows) < $TotalFound) { +<a href="<%$BaseURL%><%$next%>"><&|/l&>Next Page</&></a> +% } +% } +<%INIT> +my $maxitems = 0; + +$Format ||= $RT::DefaultSearchResultFormat; + +# DisplayFormat lets us use a "temporary" format for display, while +# still using our original format for next/prev page links. +# bulk update uses this feature to add checkboxes + + +$DisplayFormat ||= $Format; + +# Scrub the html of the format string to remove any potential nasties. +$Format = $m->comp('/Elements/ScrubHTML', Content => $Format); +$DisplayFormat = $m->comp('/Elements/ScrubHTML', Content => $DisplayFormat); + + +unless ($Collection) { + $Collection = RT::Tickets->new($session{'CurrentUser'}); + $Collection->FromSQL($Query); +} + +my (@Format) = $m->comp('/Elements/CollectionAsTable/ParseFormat', Format => $DisplayFormat); + +# Find the maximum number of items in any row, so we can pad the table. +my $item = 0; +foreach my $col (@Format) { + $item++; + if ( $col->{title} && ($col->{title} eq 'NEWLINE') ) { + $item = 0; + } + else { + $maxitems = $item if $item > $maxitems; + } +} + +if ($OrderBy =~ /\|/) { + # Multiple Sorts + my @OrderBy = split /\|/,$OrderBy; + my @Order = split /\|/,$Order; + $Collection->OrderByCols( + map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } } ( 0 + .. $#OrderBy ) );; +} else { + $Collection->OrderBy(FIELD => $OrderBy, ORDER => $Order); +} + +$Collection->RowsPerPage($Rows) if ($Rows); +$Page = 1 unless $Page > 0; # workaround problems with Page = '' or undef +$Collection->GotoPage( $Page - 1 ); # SB uses page 0 as the first page +my $TotalFound = $Collection->CountAll(); + +</%INIT> +<%ARGS> +$Query => undef +$Rows => 50 +$Page => 1 +$Title => 'Ticket Search' +$Collection => undef +$AllowSorting => undef +$Order => undef +$OrderBy => undef +$BaseURL => undef +$Format => $RT::DefaultSearchResultFormat +$DisplayFormat => undef +$ShowNavigation => 1 +$ShowHeader => 1 +</%ARGS> diff --git a/rt/html/Elements/TitleBox b/rt/html/Elements/TitleBox new file mode 100644 index 000000000..dfab9ea82 --- /dev/null +++ b/rt/html/Elements/TitleBox @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%init> +# For compatibility with 3.4 +$m->comp('/Widgets/TitleBox', %ARGS ); +</%init> diff --git a/rt/html/Elements/TitleBoxEnd b/rt/html/Elements/TitleBoxEnd new file mode 100644 index 000000000..933d77000 --- /dev/null +++ b/rt/html/Elements/TitleBoxEnd @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%init> +# For compatibility with 3.4 +$m->comp('/Widgets/TitleBoxEnd', %ARGS ); +</%init> diff --git a/rt/html/Elements/TitleBoxStart b/rt/html/Elements/TitleBoxStart new file mode 100644 index 000000000..ba24fd92e --- /dev/null +++ b/rt/html/Elements/TitleBoxStart @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%init> +# For compatibility with 3.4 +$m->comp('/Widgets/TitleBoxStart', %ARGS ); +</%init> diff --git a/rt/html/Elements/ValidateCustomFields b/rt/html/Elements/ValidateCustomFields new file mode 100644 index 000000000..483021952 --- /dev/null +++ b/rt/html/Elements/ValidateCustomFields @@ -0,0 +1,81 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%INIT> +my $valid = 1; +$CustomFields->GotoFirstItem; +while (my $CF = $CustomFields->Next) { + my $pattern = $CF->Pattern; + my $field = $NamePrefix . $CF->Id . "-Value"; + my $value; + + if ($ARGSRef->{"${field}s-Magic"} and exists $ARGSRef->{"${field}s"}) { + $value = $ARGSRef->{"${field}s"}; + + # We only validate Single Combos -- multis can never be user input + next if ref $value; + } + else { + $value = $ARGSRef->{$field}; + } + + $m->notes(('Field-' . $CF->Id) => $value); + next if $CF->MatchPattern($value); + $m->notes( + ('InvalidField-' . $CF->Id) + => (loc("Input must match [_1]", $CF->FriendlyPattern)) + ); + $valid = 0; +} +$m->notes('ValidFields', $valid); +return $valid; +</%INIT> +<%ARGS> +$CustomFields +$ARGSRef +$NamePrefix => "Object-RT::Ticket--CustomField-" +</%ARGS> |