From b4b0c7e72d7eaee2fbfc7022022c9698323203dd Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 31 Dec 2009 13:16:41 +0000 Subject: import rt 3.8.7 --- rt/share/html/Elements/BevelBoxRaisedEnd | 50 +++ rt/share/html/Elements/BevelBoxRaisedStart | 50 +++ rt/share/html/Elements/Callback | 53 +++ rt/share/html/Elements/Checkbox | 63 ++++ rt/share/html/Elements/CollectionAsTable/Header | 142 +++++++++ .../html/Elements/CollectionAsTable/ParseFormat | 108 +++++++ rt/share/html/Elements/CollectionAsTable/Row | 143 +++++++++ rt/share/html/Elements/CollectionList | 175 ++++++++++ rt/share/html/Elements/CollectionListPaging | 108 +++++++ rt/share/html/Elements/ColumnMap | 151 +++++++++ rt/share/html/Elements/CreateTicket | 50 +++ rt/share/html/Elements/DashboardTabs | 52 +++ rt/share/html/Elements/Dashboards | 66 ++++ rt/share/html/Elements/EditCustomField | 116 +++++++ rt/share/html/Elements/EditCustomFieldAutocomplete | 88 +++++ rt/share/html/Elements/EditCustomFieldBinary | 62 ++++ rt/share/html/Elements/EditCustomFieldCombobox | 69 ++++ rt/share/html/Elements/EditCustomFieldFreeform | 71 +++++ rt/share/html/Elements/EditCustomFieldImage | 62 ++++ rt/share/html/Elements/EditCustomFieldSelect | 161 ++++++++++ rt/share/html/Elements/EditCustomFieldText | 67 ++++ rt/share/html/Elements/EditCustomFieldWikitext | 67 ++++ rt/share/html/Elements/EditLinks | 178 +++++++++++ rt/share/html/Elements/EditTimeValue | 65 ++++ rt/share/html/Elements/EmailInput | 53 +++ rt/share/html/Elements/Error | 90 ++++++ rt/share/html/Elements/Footer | 84 +++++ rt/share/html/Elements/GnuPG/KeyIssues | 92 ++++++ .../html/Elements/GnuPG/SelectKeyForEncryption | 81 +++++ rt/share/html/Elements/GnuPG/SelectKeyForSigning | 64 ++++ rt/share/html/Elements/GnuPG/SignEncryptWidget | 184 +++++++++++ rt/share/html/Elements/GotoTicket | 50 +++ rt/share/html/Elements/Header | 118 +++++++ rt/share/html/Elements/HeaderJavascript | 122 +++++++ rt/share/html/Elements/ListActions | 94 ++++++ rt/share/html/Elements/ListMenu | 58 ++++ rt/share/html/Elements/Login | 139 ++++++++ rt/share/html/Elements/Logo | 66 ++++ rt/share/html/Elements/Logout | 65 ++++ rt/share/html/Elements/MakeClicky | 207 ++++++++++++ rt/share/html/Elements/Menu | 139 ++++++++ rt/share/html/Elements/MessageBox | 82 +++++ rt/share/html/Elements/MyAdminQueues | 54 ++++ rt/share/html/Elements/MyRT | 106 ++++++ rt/share/html/Elements/MyReminders | 74 +++++ rt/share/html/Elements/MyRequests | 49 +++ rt/share/html/Elements/MySupportQueues | 60 ++++ rt/share/html/Elements/MyTickets | 49 +++ rt/share/html/Elements/PageLayout | 251 +++++++++++++++ rt/share/html/Elements/PersonalQuickbar | 16 + rt/share/html/Elements/QueryString | 64 ++++ rt/share/html/Elements/QueueSummary | 108 +++++++ rt/share/html/Elements/QuickCreate | 77 +++++ rt/share/html/Elements/Quicksearch | 65 ++++ rt/share/html/Elements/RT__Group/ColumnMap | 92 ++++++ rt/share/html/Elements/RT__Queue/ColumnMap | 115 +++++++ rt/share/html/Elements/RT__Scrip/ColumnMap | 103 ++++++ rt/share/html/Elements/RT__Template/ColumnMap | 76 +++++ rt/share/html/Elements/RT__Ticket/ColumnMap | 355 +++++++++++++++++++++ rt/share/html/Elements/RT__User/ColumnMap | 141 ++++++++ rt/share/html/Elements/Refresh | 69 ++++ rt/share/html/Elements/RefreshHomepage | 54 ++++ rt/share/html/Elements/ScrubHTML | 77 +++++ rt/share/html/Elements/Section | 51 +++ rt/share/html/Elements/SelectAttachmentField | 56 ++++ rt/share/html/Elements/SelectBoolean | 71 +++++ rt/share/html/Elements/SelectCustomFieldOperator | 64 ++++ rt/share/html/Elements/SelectCustomFieldValue | 65 ++++ rt/share/html/Elements/SelectDate | 77 +++++ rt/share/html/Elements/SelectDateRelation | 60 ++++ rt/share/html/Elements/SelectDateType | 60 ++++ rt/share/html/Elements/SelectEqualityOperator | 64 ++++ rt/share/html/Elements/SelectGroups | 68 ++++ rt/share/html/Elements/SelectLang | 80 +++++ rt/share/html/Elements/SelectLinkType | 57 ++++ rt/share/html/Elements/SelectMatch | 82 +++++ rt/share/html/Elements/SelectNewTicketQueue | 50 +++ rt/share/html/Elements/SelectOwner | 133 ++++++++ rt/share/html/Elements/SelectPriority | 8 + rt/share/html/Elements/SelectQueue | 106 ++++++ rt/share/html/Elements/SelectResultsPerPage | 68 ++++ rt/share/html/Elements/SelectSortOrder | 65 ++++ rt/share/html/Elements/SelectStatus | 67 ++++ rt/share/html/Elements/SelectTicketSortBy | 62 ++++ rt/share/html/Elements/SelectTicketTypes | 58 ++++ rt/share/html/Elements/SelectTimeUnits | 62 ++++ rt/share/html/Elements/SelectTimezone | 84 +++++ rt/share/html/Elements/SelectUsers | 68 ++++ rt/share/html/Elements/SelectWatcherType | 71 +++++ rt/share/html/Elements/SetupSessionCookie | 57 ++++ rt/share/html/Elements/ShowCustomFieldBinary | 51 +++ rt/share/html/Elements/ShowCustomFieldImage | 53 +++ rt/share/html/Elements/ShowCustomFieldText | 56 ++++ rt/share/html/Elements/ShowCustomFieldWikitext | 58 ++++ rt/share/html/Elements/ShowCustomFields | 123 +++++++ rt/share/html/Elements/ShowLink | 69 ++++ rt/share/html/Elements/ShowLinks | 160 ++++++++++ rt/share/html/Elements/ShowMemberships | 88 +++++ rt/share/html/Elements/ShowSearch | 151 +++++++++ rt/share/html/Elements/ShowUser | 69 ++++ rt/share/html/Elements/ShowUserConcise | 52 +++ rt/share/html/Elements/ShowUserEmailFrequency | 56 ++++ rt/share/html/Elements/ShowUserVerbose | 73 +++++ rt/share/html/Elements/SimpleSearch | 53 +++ rt/share/html/Elements/Submit | 103 ++++++ rt/share/html/Elements/Tabs | 128 ++++++++ rt/share/html/Elements/TicketList | 70 ++++ rt/share/html/Elements/TitleBox | 51 +++ rt/share/html/Elements/TitleBoxEnd | 51 +++ rt/share/html/Elements/TitleBoxStart | 51 +++ rt/share/html/Elements/ValidateCustomFields | 100 ++++++ 111 files changed, 9540 insertions(+) create mode 100755 rt/share/html/Elements/BevelBoxRaisedEnd create mode 100755 rt/share/html/Elements/BevelBoxRaisedStart create mode 100755 rt/share/html/Elements/Callback create mode 100755 rt/share/html/Elements/Checkbox create mode 100644 rt/share/html/Elements/CollectionAsTable/Header create mode 100644 rt/share/html/Elements/CollectionAsTable/ParseFormat create mode 100644 rt/share/html/Elements/CollectionAsTable/Row create mode 100644 rt/share/html/Elements/CollectionList create mode 100644 rt/share/html/Elements/CollectionListPaging create mode 100644 rt/share/html/Elements/ColumnMap create mode 100755 rt/share/html/Elements/CreateTicket create mode 100644 rt/share/html/Elements/DashboardTabs create mode 100644 rt/share/html/Elements/Dashboards create mode 100644 rt/share/html/Elements/EditCustomField create mode 100644 rt/share/html/Elements/EditCustomFieldAutocomplete create mode 100644 rt/share/html/Elements/EditCustomFieldBinary create mode 100644 rt/share/html/Elements/EditCustomFieldCombobox create mode 100644 rt/share/html/Elements/EditCustomFieldFreeform create mode 100644 rt/share/html/Elements/EditCustomFieldImage create mode 100644 rt/share/html/Elements/EditCustomFieldSelect create mode 100644 rt/share/html/Elements/EditCustomFieldText create mode 100644 rt/share/html/Elements/EditCustomFieldWikitext create mode 100755 rt/share/html/Elements/EditLinks create mode 100644 rt/share/html/Elements/EditTimeValue create mode 100644 rt/share/html/Elements/EmailInput create mode 100755 rt/share/html/Elements/Error create mode 100755 rt/share/html/Elements/Footer create mode 100644 rt/share/html/Elements/GnuPG/KeyIssues create mode 100644 rt/share/html/Elements/GnuPG/SelectKeyForEncryption create mode 100644 rt/share/html/Elements/GnuPG/SelectKeyForSigning create mode 100644 rt/share/html/Elements/GnuPG/SignEncryptWidget create mode 100755 rt/share/html/Elements/GotoTicket create mode 100755 rt/share/html/Elements/Header create mode 100644 rt/share/html/Elements/HeaderJavascript create mode 100755 rt/share/html/Elements/ListActions create mode 100644 rt/share/html/Elements/ListMenu create mode 100755 rt/share/html/Elements/Login create mode 100644 rt/share/html/Elements/Logo create mode 100644 rt/share/html/Elements/Logout create mode 100644 rt/share/html/Elements/MakeClicky create mode 100755 rt/share/html/Elements/Menu create mode 100755 rt/share/html/Elements/MessageBox create mode 100644 rt/share/html/Elements/MyAdminQueues create mode 100644 rt/share/html/Elements/MyRT create mode 100755 rt/share/html/Elements/MyReminders create mode 100755 rt/share/html/Elements/MyRequests create mode 100644 rt/share/html/Elements/MySupportQueues create mode 100755 rt/share/html/Elements/MyTickets create mode 100755 rt/share/html/Elements/PageLayout create mode 100644 rt/share/html/Elements/PersonalQuickbar create mode 100644 rt/share/html/Elements/QueryString create mode 100644 rt/share/html/Elements/QueueSummary create mode 100644 rt/share/html/Elements/QuickCreate create mode 100755 rt/share/html/Elements/Quicksearch create mode 100644 rt/share/html/Elements/RT__Group/ColumnMap create mode 100644 rt/share/html/Elements/RT__Queue/ColumnMap create mode 100644 rt/share/html/Elements/RT__Scrip/ColumnMap create mode 100644 rt/share/html/Elements/RT__Template/ColumnMap create mode 100644 rt/share/html/Elements/RT__Ticket/ColumnMap create mode 100644 rt/share/html/Elements/RT__User/ColumnMap create mode 100755 rt/share/html/Elements/Refresh create mode 100644 rt/share/html/Elements/RefreshHomepage create mode 100644 rt/share/html/Elements/ScrubHTML create mode 100755 rt/share/html/Elements/Section create mode 100755 rt/share/html/Elements/SelectAttachmentField create mode 100755 rt/share/html/Elements/SelectBoolean create mode 100755 rt/share/html/Elements/SelectCustomFieldOperator create mode 100755 rt/share/html/Elements/SelectCustomFieldValue create mode 100755 rt/share/html/Elements/SelectDate create mode 100755 rt/share/html/Elements/SelectDateRelation create mode 100755 rt/share/html/Elements/SelectDateType create mode 100755 rt/share/html/Elements/SelectEqualityOperator create mode 100755 rt/share/html/Elements/SelectGroups create mode 100755 rt/share/html/Elements/SelectLang create mode 100755 rt/share/html/Elements/SelectLinkType create mode 100755 rt/share/html/Elements/SelectMatch create mode 100755 rt/share/html/Elements/SelectNewTicketQueue create mode 100755 rt/share/html/Elements/SelectOwner create mode 100644 rt/share/html/Elements/SelectPriority create mode 100755 rt/share/html/Elements/SelectQueue create mode 100755 rt/share/html/Elements/SelectResultsPerPage create mode 100755 rt/share/html/Elements/SelectSortOrder create mode 100755 rt/share/html/Elements/SelectStatus create mode 100755 rt/share/html/Elements/SelectTicketSortBy create mode 100755 rt/share/html/Elements/SelectTicketTypes create mode 100755 rt/share/html/Elements/SelectTimeUnits create mode 100644 rt/share/html/Elements/SelectTimezone create mode 100755 rt/share/html/Elements/SelectUsers create mode 100755 rt/share/html/Elements/SelectWatcherType create mode 100755 rt/share/html/Elements/SetupSessionCookie create mode 100644 rt/share/html/Elements/ShowCustomFieldBinary create mode 100644 rt/share/html/Elements/ShowCustomFieldImage create mode 100644 rt/share/html/Elements/ShowCustomFieldText create mode 100644 rt/share/html/Elements/ShowCustomFieldWikitext create mode 100644 rt/share/html/Elements/ShowCustomFields create mode 100644 rt/share/html/Elements/ShowLink create mode 100755 rt/share/html/Elements/ShowLinks create mode 100644 rt/share/html/Elements/ShowMemberships create mode 100644 rt/share/html/Elements/ShowSearch create mode 100644 rt/share/html/Elements/ShowUser create mode 100644 rt/share/html/Elements/ShowUserConcise create mode 100644 rt/share/html/Elements/ShowUserEmailFrequency create mode 100644 rt/share/html/Elements/ShowUserVerbose create mode 100755 rt/share/html/Elements/SimpleSearch create mode 100755 rt/share/html/Elements/Submit create mode 100755 rt/share/html/Elements/Tabs create mode 100644 rt/share/html/Elements/TicketList create mode 100644 rt/share/html/Elements/TitleBox create mode 100644 rt/share/html/Elements/TitleBoxEnd create mode 100644 rt/share/html/Elements/TitleBoxStart create mode 100644 rt/share/html/Elements/ValidateCustomFields (limited to 'rt/share/html/Elements') diff --git a/rt/share/html/Elements/BevelBoxRaisedEnd b/rt/share/html/Elements/BevelBoxRaisedEnd new file mode 100755 index 000000000..575a47ab7 --- /dev/null +++ b/rt/share/html/Elements/BevelBoxRaisedEnd @@ -0,0 +1,50 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + diff --git a/rt/share/html/Elements/BevelBoxRaisedStart b/rt/share/html/Elements/BevelBoxRaisedStart new file mode 100755 index 000000000..980c4cf95 --- /dev/null +++ b/rt/share/html/Elements/BevelBoxRaisedStart @@ -0,0 +1,50 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + +<%PERL> + +my $generic_query_args = $GenericQueryArgs || {map { $_ => $ARGS{$_} } @PassArguments}; +# backward compatibility workaround +$generic_query_args->{'Format'} = $FormatString if grep $_ eq 'Format', @PassArguments; + +my $item = 0; +foreach my $col ( @Format ) { + my $title = $col->{'title'} || ''; + if ( $title eq 'NEWLINE' ) { + while ( $item < $maxitems ) { + $m->out(qq{\n}); + $item++; + } + + $item = 0; + $m->out(qq{\n}); + next; + } elsif ( $title eq 'NBSP' ) { + $item++; + $m->out(qq{\n}); + next; + } + + my $span = $col->{'span'}; + $item += ($span || 1); + + $m->out(''); +} + + diff --git a/rt/share/html/Elements/CollectionAsTable/ParseFormat b/rt/share/html/Elements/CollectionAsTable/ParseFormat new file mode 100644 index 000000000..d58246fff --- /dev/null +++ b/rt/share/html/Elements/CollectionAsTable/ParseFormat @@ -0,0 +1,108 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Format + + +<%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 = { }; + + $m->callback(CallbackName => 'PreColumn', Column => $colref, col => \$col); + + while ( $col =~ s{/(STYLE|CLASS|TITLE|ALIGN|SPAN|ATTRIBUTE):([^/]*)}{}i ) { + $colref->{ lc $1 } = $2; + } + $colref->{'last_attribute'} = $colref->{'attribute'}; + + unless ( length $col ) { + $colref->{'output'} = []; + $colref->{'last_attribute'} = $colref->{'attribute'} = '' + unless defined $colref->{'attribute'}; + } + elsif ( $col =~ /^__(NEWLINE|NBSP)__$/ || $col =~ /^(NEWLINE|NBSP)$/ ) { + $colref->{'title'} = $1; + } + elsif ( $col =~ /__(.*?)__/io ) { + my @subcols; + while ( $col =~ s/^(.*?)__(.*?)__//o ) { + push ( @subcols, $1 ) if $1; + push ( @subcols, "__$2__" ); + $colref->{'last_attribute'} = $2; + } + push @subcols, $col; + $colref->{'output'} = \@subcols; + $colref->{'attribute'} = $colref->{'last_attribute'} + unless defined $colref->{'attribute'}; + } + else { + $colref->{'output'} = [ "__" . $col . "__" ]; + $colref->{'last_attribute'} = $col; + $colref->{'attribute'} = $col + unless defined $colref->{'attribute'}; + } + + $m->callback(CallbackName => 'PostColumn', Column => $colref, col => \$col); + + push @Columns, $colref; +} + +$m->callback(CallbackName => 'PostProcess', Columns => \@Columns, Format => $Format); + +return(@Columns); + diff --git a/rt/share/html/Elements/CollectionAsTable/Row b/rt/share/html/Elements/CollectionAsTable/Row new file mode 100644 index 000000000..fa7474b6c --- /dev/null +++ b/rt/share/html/Elements/CollectionAsTable/Row @@ -0,0 +1,143 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$i => undef +@Format => undef +$record => undef +$maxitems => undef +$Depth => undef +$Warning => undef +$ColumnMap => {} +$Class => 'RT__Ticket' + +<%init> +$m->out( '' + . "\n" ); +use HTML::Entities; +my $item; +foreach my $column (@Format) { + if ( defined $column->{title} && $column->{title} eq 'NEWLINE' ) { + while ( $item < $maxitems ) { + $m->out(qq{\n}); + $item++; + } + $item = 0; + $m->out( '' . "\n" ); + $m->out( '' + . "\n" ); + next; + } + + my $class = $column->{class} ? encode_entities( $column->{class}, q{'"&<>} ) : 'collection-as-table'; + $m->out(qq{' . "\n" ); +} +$m->out(''); + diff --git a/rt/share/html/Elements/CollectionList b/rt/share/html/Elements/CollectionList new file mode 100644 index 000000000..6f21420f5 --- /dev/null +++ b/rt/share/html/Elements/CollectionList @@ -0,0 +1,175 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%INIT> +if (!$Collection && $Class eq 'RT::Tickets') { + $Collection = RT::Tickets->new( $session{'CurrentUser'} ); + $Collection->FromSQL($Query); +} + +my $TotalFound = $Collection->CountAll(); +return '' if !$TotalFound && !$ShowEmpty; + +if ( @OrderBy ) { + if ( $OrderBy[0] =~ /\|/ ) { + @OrderBy = split /\|/, $OrderBy[0]; + @Order = split /\|/,$Order[0]; + } + $Collection->OrderByCols( + map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } } + ( 0 .. $#OrderBy ) + ); +} + +$Collection->RowsPerPage( $Rows ) if $Rows; +$Page = 1 unless $Page && $Page > 0; # workaround problems with $Page = '' or undef +$Collection->GotoPage( $Page - 1 ); # SB uses page 0 as the first page + +# 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); + +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 ($maxitems, $item) = (0, 0); +foreach my $col (@Format) { + $item++; + if ( $col->{title} && ($col->{title} eq 'NEWLINE') ) { + $item = 0; + } + else { + $maxitems = $item if $item > $maxitems; + } +} + +$Class ||= ref $Collection; +$Class =~ s/s$//; +$Class =~ s/:/_/g; + +$m->out('
diff --git a/rt/share/html/Elements/Callback b/rt/share/html/Elements/Callback new file mode 100755 index 000000000..ec647097f --- /dev/null +++ b/rt/share/html/Elements/Callback @@ -0,0 +1,53 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%INIT> +$ARGS{'CallbackPage'} = delete $ARGS{'Page'} || $m->callers(1)->path; +$ARGS{'CallbackName'} = delete $ARGS{'_CallbackName'}; +$RT::Logger->debug("$ARGS{'CallbackPage'} calls old style callback, use \$m->callback"); +return $m->callback( %ARGS ); + diff --git a/rt/share/html/Elements/Checkbox b/rt/share/html/Elements/Checkbox new file mode 100755 index 000000000..72ab677b6 --- /dev/null +++ b/rt/share/html/Elements/Checkbox @@ -0,0 +1,63 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + /> + +<%ARGS> +$Name => undef +$Default => undef +$True => undef +$False => undef +$IsChecked => undef + + +<%INIT> +$IsChecked = + ($Default && $Default =~ /checked/i) + ? ' checked="checked" ' : ""; +1; + diff --git a/rt/share/html/Elements/CollectionAsTable/Header b/rt/share/html/Elements/CollectionAsTable/Header new file mode 100644 index 000000000..550ce9f3f --- /dev/null +++ b/rt/share/html/Elements/CollectionAsTable/Header @@ -0,0 +1,142 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Class => 'RT__Ticket' + +@Format => undef +$FormatString => undef +@OrderBy => () +@Order => () +$Query => undef +$Rows => undef +$Page => undef +$GenericQueryArgs => undef +$maxitems => undef + +$AllowSorting => undef +$BaseURL => undef +@PassArguments => qw(Query Format Rows Page Order OrderBy) + +
 
 out(' colspan="' . $m->interp->apply_escapes($span => 'h') . '"') + if $span; + $m->out('>'); + + # if title is not defined then use defined attribute or last + # one we saw in the format + unless ( defined $col->{'title'} ) { + my $attr = $col->{'attribute'} || $col->{'last_attribute'}; + my $tmp = $m->comp( '/Elements/ColumnMap', + Class => $Class, + Name => $attr, + Attr => 'title', + ); + $title = ProcessColumnMapValue( $tmp, Arguments => [ $attr ] ); + } else { + $title = $m->comp('/Elements/ScrubHTML', Content => $title); + } + + if ( $AllowSorting and $col->{'attribute'} + and my $attr = $m->comp( + "/Elements/ColumnMap", + Class => $Class, + Name => $col->{'attribute'}, + Attr => 'attribute' + ) + ) + { + $attr = ProcessColumnMapValue( $attr, Arguments => [ $col->{'attribute'} ], Escape => 0 ); + + my $new_order = 'ASC'; + $new_order = $Order[0] eq 'ASC'? 'DESC': 'ASC' + if $OrderBy[0] && $OrderBy[0] eq $attr; + + $m->out( + ''. loc($title) .'' + ); + } + else { + $m->out( loc($title) ); + } + $m->out('
 
{ $attr } ) { + $attrs{ $attr } = $column->{ $attr }; + next; + } + + # if it's not defined then use column map + my $col = $column->{'attribute'} || $column->{'last_attribute'}; + unless ( exists $ColumnMap->{$col}{$attr} ) { + next unless $col; + + $ColumnMap->{$col}{$attr} = $m->comp( + "/Elements/ColumnMap", + Class => $Class, + Name => $col, + Attr => $attr, + ); + } + $attrs{ $attr } = ProcessColumnMapValue( + $ColumnMap->{$col}{$attr}, + Arguments => [$record, $i], + Escape => 0, + ); + } + + $attrs{colspan} = $column->{span}; + $item += ($attrs{'colspan'} || 1); + + my @out; + foreach my $subcol ( @{ $column->{output} } ) { + my ($col) = ($subcol =~ /^__(.*?)__$/); + unless ( $col ) { + push @out, $subcol; + next; + } + + unless ( exists $ColumnMap->{$col}{'value'} ) { + $ColumnMap->{$col}{'value'} = $m->comp( + "/Elements/ColumnMap", + Class => $Class, + Name => $col, + Attr => 'value' + ); + } + + push @out, ProcessColumnMapValue( + $ColumnMap->{$col}{'value'}, + Arguments => [$record, $i], + ); + } + s/\n/
/gs for @out; + + $m->out( $_ .'="'. $m->interp->apply_escapes( $attrs{$_} => 'h' ) .'"' ) + foreach grep $attrs{$_}, qw(align style colspan); + + $m->out('>'); + $m->out(@out) if @out; + $m->out( '
'); + +if ( $ShowHeader ) { + $m->comp('/Elements/CollectionAsTable/Header', + %ARGS, + Class => $Class, + Format => \@Format, + FormatString => $Format, + Order => \@Order, + OrderBy => \@OrderBy, + Rows => $Rows, + Page => $Page, + AllowSorting => $AllowSorting, + BaseURL => $BaseURL, + GenericQueryArgs => $GenericQueryArgs, + maxitems => $maxitems, + ); +} + +my ($i, $column_map) = (0, {}); +while ( my $record = $Collection->Next ) { + # Every ten rows, flush the buffer and put something on the page. + $m->flush_buffer unless ++$i % 10; + $m->comp('/Elements/CollectionAsTable/Row', + i => $i, + Format => \@Format, + record => $record, + maxitems => $maxitems, + ColumnMap => $column_map, + Class => $Class, + ); +} + +$m->out('
'); +if ( $Rows && $ShowNavigation && $TotalFound > $Rows ) { + my $oddRows = ($TotalFound && $TotalFound % $Rows == 0 )? 0 : 1; + my $pages = int( $TotalFound / $Rows ) + $oddRows; + $pages = 1 if $pages < 1; + + + my %query_args = map { $_ => $ARGS{$_} } @PassArguments; + $m->comp( + '/Elements/CollectionListPaging', + BaseURL => $BaseURL, + Rows => $Rows, + TotalFound => $TotalFound, + CurrentPage => $Page, + Pages => $pages, + URLParams => \%query_args + ); + +} + + +<%ARGS> +$Class => '' +$Collection => undef +$Format => undef +$DisplayFormat => undef +@Order => () +@OrderBy => () +$GenericQueryArgs => undef +$Rows => undef +$Page => 1 +$Title => loc('Ticket Search') +$BaseURL => RT->Config->Get('WebPath') . $m->request_comp->path .'?' +@PassArguments => qw( Query Format Rows Page Order OrderBy) + +$AllowSorting => 0 +$ShowNavigation => 1 +$ShowHeader => 1 +$ShowEmpty => 0 +$Query => 0 + diff --git a/rt/share/html/Elements/CollectionListPaging b/rt/share/html/Elements/CollectionListPaging new file mode 100644 index 000000000..8fc0632b8 --- /dev/null +++ b/rt/share/html/Elements/CollectionListPaging @@ -0,0 +1,108 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$BaseURL => undef +$Rows => undef +$TotalFound => undef +$CurrentPage => undef +$Pages => undef +$URLParams => undef + + +<%INIT> +$m->out(qq{
}); +if ($Pages == 1) { + $m->out(loc('Page 1 of 1')); +} +else{ +$m->out(loc('Page') . ' '); +my $prev = $m->comp( + '/Elements/QueryString', + %$URLParams, + Page => ( $CurrentPage - 1 ) + ); +my $next = $m->comp( + '/Elements/QueryString', + %$URLParams, + Page => ( $CurrentPage + 1 ) + ); +my %show; +$show{1} = 1; +$show{$_} = 1 for (($CurrentPage - 2)..($CurrentPage + 2)); +$show{$Pages} = 1; +my $dots; + +for my $number ( 1 .. $Pages ) { + if ( $show{$number} ) { + $dots = undef; + my $qs = + $m->comp( '/Elements/QueryString', %$URLParams, Page => $number ); + $m->out(qq{}); + if ( $number == $CurrentPage ) { + $m->out(qq{$number }); + } + else { + $m->out(qq{$number }); + } + } + elsif ( not $dots ) { + $dots = 1; + $m->out(qq{...}); + } + $m->out(qq{}); +} + +if ($CurrentPage > 1) { + $m->out(qq{}.loc('Previous') . qq{}); +} +if (($CurrentPage * $Rows) < $TotalFound) { + $m->out(qq{}.loc('Next').qq{}); +} +} +$m->out(qq{
}); + diff --git a/rt/share/html/Elements/ColumnMap b/rt/share/html/Elements/ColumnMap new file mode 100644 index 000000000..71517e063 --- /dev/null +++ b/rt/share/html/Elements/ColumnMap @@ -0,0 +1,151 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Class => 'RT__Ticket' +$Name +$Attr => undef + +<%ONCE> + +# This is scary and should totally be refactored -- jesse +my $COLUMN_MAP = { + id => { + attribute => 'id', + title => 'id', # loc + align => 'right', + value => sub { return $_[0]->id } + }, + + Created => { + attribute => 'Created', + title => 'Created', # loc + value => sub { return $_[0]->CreatedObj->AsString } + }, + CreatedRelative => { + attribute => 'Created', + title => 'Created', # loc + value => sub { return $_[0]->CreatedObj->AgeAsString } + }, + CreatedBy => { + attribute => 'CreatedBy', + title => 'Created By', # loc + value => sub { return $_[0]->CreatorObj->Name } + }, + LastUpdated => { + attribute => 'LastUpdated', + title => 'Last Updated', # loc + value => sub { return $_[0]->LastUpdatedObj->AsString } + }, + LastUpdatedRelative => { + attribute => 'LastUpdated', + title => 'Last Updated', # loc + value => sub { return $_[0]->LastUpdatedObj->AgeAsString } + }, + LastUpdatedBy => { + attribute => 'LastUpdatedBy', + title => 'Last Updated By', # loc + value => sub { return $_[0]->LastUpdatedByObj->Name } + }, + + + CheckBox => { + title => sub { + my $name = $_[1] || 'SelectedTickets'; + my $checked = $m->request_args->{ $name .'All' }? 'checked="checked"': ''; + + return \qq{}; + }, + value => sub { + my $id = $_[0]->id; + + my $name = $_[2] || 'SelectedTickets'; + return \qq{} + if $m->request_args->{ $name . 'All'}; + + my $arg = $m->request_args->{ $name }; + my $checked = ''; + if ( $arg && ref $arg ) { + $checked = 'checked="checked"' if grep $_ == $id, @$arg; + } + elsif ( $arg ) { + $checked = 'checked="checked"' if $arg == $id; + } + return \qq{} + }, + }, + RadioButton => { + title => \' ', + value => sub { + my $id = $_[0]->id; + + my $name = $_[2] || 'SelectedTicket'; + my $arg = $m->request_args->{ $name }; + my $checked = ''; + $checked = 'checked="checked"' if $arg && $arg == $id; + return \qq{}; + }, + }, + (map { + my $value = RT->Config->Get($_); + $_ => { value => sub { return \$value } }; + + } qw(WebPath WebBaseURL WebURL)), +}; + + +<%INIT> +$m->callback( COLUMN_MAP => $COLUMN_MAP, CallbackName => 'Once', CallbackOnce => 1 ); +$m->callback( COLUMN_MAP => $COLUMN_MAP ); + +# first deal with class specific things +my $class_map = $m->comp("/Elements/$Class/ColumnMap", Attr => $Attr, Name => $Name ); +return $class_map if defined $class_map; +return GetColumnMapEntry( Map => $COLUMN_MAP, Name => $Name, Attribute => $Attr ); + + diff --git a/rt/share/html/Elements/CreateTicket b/rt/share/html/Elements/CreateTicket new file mode 100755 index 000000000..9c8f3aadf --- /dev/null +++ b/rt/share/html/Elements/CreateTicket @@ -0,0 +1,50 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
+<&|/l, $m->scomp('/Elements/SelectNewTicketQueue', OnChange => 'document.CreateTicketInQueue.submit()')&> [_1] +
diff --git a/rt/share/html/Elements/DashboardTabs b/rt/share/html/Elements/DashboardTabs new file mode 100644 index 000000000..f9493d5fe --- /dev/null +++ b/rt/share/html/Elements/DashboardTabs @@ -0,0 +1,52 @@ +<%args> +$CurrentDashboard => undef + +<%init> +my @dashboards = $m->comp("/Dashboards/Elements/ListOfDashboards"); +my $limit = 7; + +$m->callback( + Dashboards => \@dashboards, + Limit => \$limit, + CallbackName => 'MassageDashboards', +); + +my $more = 0; +if (@dashboards > $limit) { + $more = 1; + splice @dashboards, $limit; +} + +# always include the current dashboard, even if it's not in the initial list +push @dashboards, $CurrentDashboard + if $CurrentDashboard + && 0 == grep { $_->Id == $CurrentDashboard->Id } @dashboards; + +my $position = 0; + +my $tabs = { + map { + ++$position; + my $key = sprintf 'D-%03d', $position; + $key => { + title => $_->Name, + path => 'Dashboards/' . $_->Id . '/' . $_->Name, + } + } + @dashboards +}; + +$tabs->{"A"} = { + title => loc('Home'), + path => 'index.html', +}; + +if ($more) { + $tabs->{"D-more"} = { + title => loc('More'), + path => 'Dashboards/index.html', + } +} + +return $tabs; + diff --git a/rt/share/html/Elements/Dashboards b/rt/share/html/Elements/Dashboards new file mode 100644 index 000000000..3653aa5b8 --- /dev/null +++ b/rt/share/html/Elements/Dashboards @@ -0,0 +1,66 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
+<&|/Widgets/TitleBox, + title => loc("Dashboards"), + title_href => RT->Config->Get('WebPath').'/Dashboards/index.html', + bodyclass => "", + titleright => loc("Edit"), + titleright_href => RT->Config->Get('WebPath').'/Dashboards/', +&> + +<& /Dashboards/Elements/ShowDashboards:table, + Dashboards => \@dashboards, + Verbose => 0, +&> + +
+<%INIT> +my @dashboards = $m->comp("/Dashboards/Elements/ListOfDashboards"); + + diff --git a/rt/share/html/Elements/EditCustomField b/rt/share/html/Elements/EditCustomField new file mode 100644 index 000000000..d1bb0c295 --- /dev/null +++ b/rt/share/html/Elements/EditCustomField @@ -0,0 +1,116 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%INIT> + +my $Type = $CustomField->Type; +unless ( $Type ) { + # if we can't see the type, all hell will break loose. + $RT::Logger->error( "Custom field #". $CustomField->id ." has empty type" ); + return; +} + +my $Values; +if ( $Object && $Object->id ) { + $NamePrefix ||= join '-', + 'Object', ref($Object), $Object->Id, 'CustomField', ''; + + $Values = $Object->CustomFieldValues( $CustomField->id ); + $Values->Columns( + qw( id CustomField ObjectType ObjectId Disabled Content + ContentType ContentEncoding SortOrder Creator Created + LastUpdatedBy LastUpdated ) + ); + # Don't take care of $Values if there isn't values inside + undef ( $Values ) unless ( $Values->Count ); +} + +# Always fill $Default with submited values if it's empty +if ( ( !defined $Default || !length $Default ) && $DefaultsFromTopArguments ) { + my %TOP = $m->request_args; + $Default = $TOP{ $NamePrefix .$CustomField->Id . '-Values' } + || $TOP{ $NamePrefix .$CustomField->Id . '-Value' }; +} + +my $MaxValues = $CustomField->MaxValues; +if ($MaxValues == 1 && $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".''."\n"); + +my $EditComponent = "EditCustomField$Type"; +$m->callback( %ARGS, 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, +); + +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Rows => 5 +$Cols => 15 +$Default => undef +$DefaultsFromTopArguments => 1, + diff --git a/rt/share/html/Elements/EditCustomFieldAutocomplete b/rt/share/html/Elements/EditCustomFieldAutocomplete new file mode 100644 index 000000000..ba7907b19 --- /dev/null +++ b/rt/share/html/Elements/EditCustomFieldAutocomplete @@ -0,0 +1,88 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if ( $Multiple ) { +
+ +<%INIT> +my $name = $NamePrefix . $CustomField->Id; +if ( $Default && !$Multiple ) { + $Default =~ s/\s*\r*\n\s*/ /g; +} +if ( $Multiple and $Values ) { + $Default = ''; + while (my $value = $Values->Next ) { + $Default .= $value->Content ."\n"; + } +} + +<%ARGS> +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$Multiple => undef +$Rows => undef +$Cols => undef + diff --git a/rt/share/html/Elements/EditCustomFieldBinary b/rt/share/html/Elements/EditCustomFieldBinary new file mode 100644 index 000000000..89a669f9f --- /dev/null +++ b/rt/share/html/Elements/EditCustomFieldBinary @@ -0,0 +1,62 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ( $Values and my $value = $Values->Next ) { +%# XXX - let user download the file(s) here? +<% $value->Content %>
+% } +% if (!$MaxValues || !$Values || $Values->Count < $MaxValues) { + +% } +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef + diff --git a/rt/share/html/Elements/EditCustomFieldCombobox b/rt/share/html/Elements/EditCustomFieldCombobox new file mode 100644 index 000000000..e6b76ff10 --- /dev/null +++ b/rt/share/html/Elements/EditCustomFieldCombobox @@ -0,0 +1,69 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ($Values and my $value = $Values->Next and $Multiple) { +<% $value->Content %> +
+% } +% (!$Multiple or !$MaxValues or !$Values or $Values->Count < $MaxValues) or return; +<& /Widgets/ComboBox, + Name => $NamePrefix . $CustomField->Id . "-Value", + Default => $Default, + Rows => $Rows, + Class => "CF-".$CustomField->id."-Edit", + Values => [map {$_->Name} @{$CustomField->Values->ItemsArrayRef}], +&> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$Multiple => 0 +$Rows => undef +$MaxValues => undef + diff --git a/rt/share/html/Elements/EditCustomFieldFreeform b/rt/share/html/Elements/EditCustomFieldFreeform new file mode 100644 index 000000000..856a61f31 --- /dev/null +++ b/rt/share/html/Elements/EditCustomFieldFreeform @@ -0,0 +1,71 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% my $name = $NamePrefix . $CustomField->Id . '-Value'; +% if ($Multiple) { + +% } else { + +% } +<%INIT> +if ( $Multiple and $Values ) { + $Default = join "\n", map $_->Content, @{ $Values->ItemsArrayRef }; +} +unless ( $Multiple ) { + $Default =~ s/\s*\n+\s*/ /g if $Default; +} + +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$Multiple => undef +$Cols +$Rows + diff --git a/rt/share/html/Elements/EditCustomFieldImage b/rt/share/html/Elements/EditCustomFieldImage new file mode 100644 index 000000000..b15cc5d2c --- /dev/null +++ b/rt/share/html/Elements/EditCustomFieldImage @@ -0,0 +1,62 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ($Values and my $value = $Values->Next ) { +<& ShowCustomFieldImage, Object => $value &> +
+% } +% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) { + +% } +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef + diff --git a/rt/share/html/Elements/EditCustomFieldSelect b/rt/share/html/Elements/EditCustomFieldSelect new file mode 100644 index 000000000..8fe79f9f9 --- /dev/null +++ b/rt/share/html/Elements/EditCustomFieldSelect @@ -0,0 +1,161 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%# 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 and not $CustomField->BasedOnObj->id) { + +%# XXX - Hide this select from w3m? +
+% } elsif ($CustomField->BasedOnObj->id) { + + +% } +% if (@category) { +%# this hidden select is to supply a full list of values, +%# see filter_cascade() in js/cascaded.js + +% } + +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$Multiple => 0 +$Rows => undef + + +<%METHOD options> +% @Default = grep defined && length, @Default; +% # $Values->HasEntry is too slow here +% if ( !@Default && $Values ) { +% @Default = map $_->Content, @{$Values->ItemsArrayRef}; +% } +% $_ = lc $_ foreach @Default; +% my $selected; +% my $CFVs = $CustomField->Values; +% my @levels; +% while ( my $value = $CFVs->Next ) { +% my $name = $value->Name; +% my $category = $value->Category || ''; +% my $level = (split /:/, $category, 2)[0] || ''; +% while (@levels) { +% if ($levels[-1] eq $level) { +% $level = ''; +% last; +% } elsif (index($level, $levels[-1]) != 0) { +% $m->out(''); +% pop @levels; +% } else { +% last; +% } +% } +% if ( length $level ) { +% push @$CategoryRef, [0+@levels, $level]; + +% push @levels, $level; +% } + +% } +% for (@levels) { + +% } +<%ARGS> +$CustomField => undef +@Default => () +$Values => undef +$SelectedRef => undef +$CategoryRef => undef + + diff --git a/rt/share/html/Elements/EditCustomFieldText b/rt/share/html/Elements/EditCustomFieldText new file mode 100644 index 000000000..7d69ffcea --- /dev/null +++ b/rt/share/html/Elements/EditCustomFieldText @@ -0,0 +1,67 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ($Values and my $value = $Values->Next ) { +
+% } +% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) { + +% } +<%INIT> +# XXX - MultiValue textarea is for now outlawed. +$MaxValues = 1; + +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => '' +$Default => undef +$Values => undef +$MaxValues => undef +$Cols +$Rows + diff --git a/rt/share/html/Elements/EditCustomFieldWikitext b/rt/share/html/Elements/EditCustomFieldWikitext new file mode 100644 index 000000000..f11b48d74 --- /dev/null +++ b/rt/share/html/Elements/EditCustomFieldWikitext @@ -0,0 +1,67 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ($Values and my $value = $Values->Next ) { +
+% } +% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) { + +% } +<%INIT> +# XXX - MultiValue textarea is for now outlawed. +$MaxValues = 1; + +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef +$Cols +$Rows + diff --git a/rt/share/html/Elements/EditLinks b/rt/share/html/Elements/EditLinks new file mode 100755 index 000000000..637762e1b --- /dev/null +++ b/rt/share/html/Elements/EditLinks @@ -0,0 +1,178 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + + + +
+

<&|/l&>Current Links

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<&|/l&>Depends on: +% while (my $link = $Object->DependsOn->Next) { + + <& ShowLink, URI => $link->TargetURI &>
+% } +
<&|/l&>Depended on by: +% while (my $link = $Object->DependedOnBy->Next) { + + <& ShowLink, URI => $link->BaseURI &>
+% } +
<&|/l&>Parents: +% while (my $link = $Object->MemberOf->Next) { + + <& ShowLink, URI => $link->TargetURI &>
+% } +
<&|/l&>Children: +% while (my $link = $Object->Members->Next) { + + <& ShowLink, URI => $link->BaseURI &>
+% } +
<&|/l&>Refers to: +% while (my $link = $Object->RefersTo->Next) { + + <& ShowLink, URI => $link->TargetURI &>
+%} +
<&|/l&>Referred to by: +% while (my $link = $Object->ReferredToBy->Next) { +% # Skip reminders +% next if (UNIVERSAL::isa($link->BaseObj, 'RT::Ticket') && $link->BaseObj->Type eq 'reminder'); + + <& ShowLink, URI => $link->BaseURI &>
+% } +
<&|/l&>(Check box to delete)
+ +
+

<&|/l&>New Links

+% if (ref($Object) eq 'RT::Ticket') { +<&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces. +% $m->callback( CallbackName => 'ExtraLinkInstructions' ); +
+% } elsif (ref($Object) eq 'RT::Queue') { +<&|/l&>Enter queues or URIs to link queues to. Separate multiple entries with spaces. +
+% } else { +<&|/l&>Enter objects or URIs to link objects to. Separate multiple entries with spaces.
+% } + +% if ($Merge) { + + + + +% } + + + + + + + + + + + + + + + + + + + + + + + + +% $m->callback( CallbackName => 'NewLink' ); +
<&|/l&>Merge into: <&|/l&>(only one ticket)
<&|/l&>Depends on:
<&|/l&>Depended on by:
<&|/l&>Parents:
<&|/l&>Children:
<&|/l&>Refers to:
<&|/l&>Referred to by:
+
+ +<%INIT> +my $id; +if ($Object && $Object->Id) { + $id = $Object->Id; +} else { + $id = 'new'; +} + + +<%ARGS> +$Object => undef +$Merge => 0 + diff --git a/rt/share/html/Elements/EditTimeValue b/rt/share/html/Elements/EditTimeValue new file mode 100644 index 000000000..863f8bfec --- /dev/null +++ b/rt/share/html/Elements/EditTimeValue @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<& /Elements/SelectTimeUnits, Name => $UnitName &> +<%ARGS> +$Default => '' +$Name => '' +$ValueName => '' +$UnitName => '' +$InputUnits => 'minutes' + +<%INIT> +$ValueName ||= $Name; +$UnitName ||= ($Name||$ValueName) . '-TimeUnits'; + +if ($InputUnits eq 'minutes' && RT->Config->Get('DefaultTimeUnitsToHours')) { + $Default = sprintf '%.3g', $Default / 60 + unless $Default eq ''; +} + diff --git a/rt/share/html/Elements/EmailInput b/rt/share/html/Elements/EmailInput new file mode 100644 index 000000000..5c7f27772 --- /dev/null +++ b/rt/share/html/Elements/EmailInput @@ -0,0 +1,53 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<%ARGS> +$Name +$Size => 40 +$Default => '' + diff --git a/rt/share/html/Elements/Error b/rt/share/html/Elements/Error new file mode 100755 index 000000000..604d29be4 --- /dev/null +++ b/rt/share/html/Elements/Error @@ -0,0 +1,90 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% $m->callback( %ARGS, error => $error ); + +% unless ($SuppressHeader) { +<& /Elements/Header, Code => $Code, Why => $Why, Title => $Title &> +<& /Elements/Tabs, Title => $Title &> +% } + +
+<%$Why%> +
+<%$Details%> +
+ +<%cleanup> +$m->comp('/Elements/Footer'); +$m->abort(); + + +<%args> +$Code => undef +$Details => '' +$Title => loc("RT Error") +$Why => loc("the calling component did not specify why"), +$SuppressHeader => 0, + + +<%INIT> +my $error = "WebRT: $Why"; +$error .= " ($Details)" if defined $Details && length $Details; + +# TODO: Log::Dispatch isn't UTF-8 safe. Autrijus needs to talk to dave rolsky about getting this fixed +use 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" ) if defined $Details && length $Details; + $m->abort(); +} + diff --git a/rt/share/html/Elements/Footer b/rt/share/html/Elements/Footer new file mode 100755 index 000000000..2fcdee949 --- /dev/null +++ b/rt/share/html/Elements/Footer @@ -0,0 +1,84 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%# End of div#body from /Elements/PageLayout + +% $m->callback( %ARGS ); + +% if ($Debug >= 2 ) { +% require Data::Dumper; +% my $d = Data::Dumper->new([\%ARGS], [qw(%ARGS)]); +
+<%$d->Dump() %>
+
+% } + + + + +<%ARGS> +$Debug => 0 +$Menu => 1 + diff --git a/rt/share/html/Elements/GnuPG/KeyIssues b/rt/share/html/Elements/GnuPG/KeyIssues new file mode 100644 index 000000000..48a7fd21e --- /dev/null +++ b/rt/share/html/Elements/GnuPG/KeyIssues @@ -0,0 +1,92 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if ( @$Issues || @$SignAddresses ) { +<&| /Widgets/TitleBox, title => loc('GnuPG issues') &> + +% if ( @$SignAddresses ) { +<% loc("The system is unable to sign outgoing email messages. This usually indicates that the passphrase was mis-set, or that GPG Agent is down. Please alert your system administrator immediately. The problem addresses are:") %> +
    +% for my $address (@$SignAddresses) { +
  • <% $address %>
  • +% } +
+% } + +% if (@$Issues == 1) { +<% loc("You are going to encrypt outgoing email messages, but there is a problem with a recipient's public key. You have to fix the problem with the key, disable sending a message to that recipient, or disable encryption.") %> +% } elsif (@$Issues > 1) { +<% loc("You are going to encrypt outgoing email messages, but there are problems with recipients' public keys. You have to fix the problems with the keys, disable sending a message to the recipients with key problems, or disable encryption.") %> +% } + +
    +% foreach my $issue ( @$Issues ) { +
  • +% if ( $issue->{'User'} ) { +User <&/Elements/ShowUser, User => $issue->{'User'} &> has a problem. +% } else { +There is a problem with key(s) for address <% $issue->{'EmailAddress'} %>, but there is no user in the DB for this address. +% } +<% $issue->{'Message'} %> +
    +Select a key you want to use for encryption: +<& /Elements/GnuPG/SelectKeyForEncryption, + Name => 'UseKey-'. $issue->{'EmailAddress'}, + EmailAddress => $issue->{'EmailAddress'}, + Default => ( $issue->{'User'}? $issue->{'User'}->PreferredKey : undef ), +&> +
  • +% } +
+ +% } + +<%ARGS> +$Issues => [] +$SignAddresses => [] + + diff --git a/rt/share/html/Elements/GnuPG/SelectKeyForEncryption b/rt/share/html/Elements/GnuPG/SelectKeyForEncryption new file mode 100644 index 000000000..c28c5ad3f --- /dev/null +++ b/rt/share/html/Elements/GnuPG/SelectKeyForEncryption @@ -0,0 +1,81 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if (!@keys) { +<% loc("No usable keys.") %> +% } else { + +% } + +<%INIT> +require RT::Crypt::GnuPG; +my $d; + +my %res = RT::Crypt::GnuPG::GetKeysForEncryption($EmailAddress); +# move the preferred key to the top of the list +my @keys = map { + $_->{'Fingerprint'} eq ( $Default || '' ) + ? do { $d = $_; () } + : $_ + } + @{ $res{'info'} }; + +@keys = sort { $b->{'TrustLevel'} <=> $a->{'TrustLevel'} } @keys; + +unshift @keys, $d if defined $d; + + +<%ARGS> +$Name => 'PreferredKey' +$EmailAddress => undef +$Default => undef + + diff --git a/rt/share/html/Elements/GnuPG/SelectKeyForSigning b/rt/share/html/Elements/GnuPG/SelectKeyForSigning new file mode 100644 index 000000000..13b40df26 --- /dev/null +++ b/rt/share/html/Elements/GnuPG/SelectKeyForSigning @@ -0,0 +1,64 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if ( $user_key ) { + +% } else { +<% loc("Queue's key") %> +% } +<%ARGS> +$Name => 'SignUsing', +$User => undef, + +<%INIT> +return unless RT->Config->Get('GnuPG')->{'Enable'}; + +my $user_key = $User->PrivateKey; + diff --git a/rt/share/html/Elements/GnuPG/SignEncryptWidget b/rt/share/html/Elements/GnuPG/SignEncryptWidget new file mode 100644 index 000000000..9303fb52a --- /dev/null +++ b/rt/share/html/Elements/GnuPG/SignEncryptWidget @@ -0,0 +1,184 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + + + +
<% loc('Sign')%><& /Widgets/Form/Boolean:InputOnly, Name => 'Sign', CurrentValue => $self->{'Sign'} &> +using <& SelectKeyForSigning, User => $session{'CurrentUser'}->UserObj &> +<% loc('Encrypt')%><& /Widgets/Form/Boolean:InputOnly, Name => 'Encrypt', CurrentValue => $self->{'Encrypt'} &>
+<%ARGS> +$self => undef, + +<%INIT> +return unless $self; + + +<%METHOD new> +<%ARGS> +$Arguments => {} + +<%INIT> +return undef unless RT->Config->Get('GnuPG')->{'Enable'}; + +require RT::Crypt::GnuPG; +return { %$Arguments }; + + + +<%METHOD ShowIssues> +<%ARGS> +$self => undef, + +<%INIT> +return unless $self; + +return $m->comp( '/Elements/GnuPG/KeyIssues', + Issues => $self->{'GnuPGRecipientsKeyIssues'} || [], + SignAddresses => $self->{'GnuPGCanNotSignAs'} || [], +); + + + + +<%METHOD Process> +<%ARGS> +$self => undef +$QueueObj => undef +$TicketObj => undef + +<%INIT> +return unless $self; + +$QueueObj ||= $TicketObj->QueueObj if $TicketObj; + +foreach ( qw(Sign Encrypt) ) { + $self->{ $_ } = $m->comp( '/Widgets/Form/Boolean:Process', + Name => $_, + DefaultValue => $QueueObj->$_, + Arguments => $self, + ); +} + + + +<%METHOD Check> +<%ARGS> +$self => undef +$Operation => 'Update' +$TicketObj => undef +$QueueObj => undef + +<%INIT> +return 1 unless $self; + +my $checks_failure = 0; + +if ( $self->{'Sign'} ) { + $QueueObj ||= $TicketObj->QueueObj + if $TicketObj; + + my $address = $self->{'SignUsing'}; + $address ||= ($self->{'UpdateType'} && $self->{'UpdateType'} eq "private") + ? ( $QueueObj->CommentAddress || RT->Config->Get('CommentAddress') ) + : ( $QueueObj->CorrespondAddress || RT->Config->Get('CorrespondAddress') ); + + unless ( RT::Crypt::GnuPG::DrySign( $address ) ) { + push @{ $self->{'GnuPGCanNotSignAs'} ||= [] }, $address; + $checks_failure = 1; + } else { + RT::Crypt::GnuPG::UseKeyForSigning( $self->{'SignUsing'} ) + if $self->{'SignUsing'}; + } +} + +if ( $self->{'Encrypt'} ) { + + my @recipients; + + if ( $Operation eq 'Update' ) { + # skip any email addresses that we won't be sending mail to + my %squelch = $m->comp( + '/Ticket/Elements/PreviewScrips:SquelchRecipients', + %$self, + TicketObj => $TicketObj + ); + + @recipients = $m->comp( + '/Ticket/Elements/PreviewScrips:GetRecipients', + %$self, TicketObj => $TicketObj + ); + } + elsif ( $Operation eq 'Create' ) { + @recipients = $m->comp( + '/Ticket/Elements/PreviewScrips:GetRecipientsOnCreate', + %$self, + ); + } + else { + $RT::Logger->crit('Incorrect operation: '. $Operation ); + } + + my %seen; + @recipients = grep !$seen{ lc $_ }++, @recipients; + + RT::Crypt::GnuPG::UseKeyForEncryption( + map { (/^UseKey-(.*)$/)[0] => $self->{ $_ } } + grep $self->{ $_ } && /^UseKey-/, + keys %$self + ); + + my ($status, @issues) = RT::Crypt::GnuPG::CheckRecipients( @recipients ); + push @{ $self->{'GnuPGRecipientsKeyIssues'} ||= [] }, @issues; + $checks_failure = 1 unless $status; +} + +return $checks_failure ? 0 : 1; + + diff --git a/rt/share/html/Elements/GotoTicket b/rt/share/html/Elements/GotoTicket new file mode 100755 index 000000000..517bee77c --- /dev/null +++ b/rt/share/html/Elements/GotoTicket @@ -0,0 +1,50 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
+  +
diff --git a/rt/share/html/Elements/Header b/rt/share/html/Elements/Header new file mode 100755 index 000000000..953efcb22 --- /dev/null +++ b/rt/share/html/Elements/Header @@ -0,0 +1,118 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + +<%$Title%> + + +% if ($Refresh && $Refresh =~ /^(\d+)/ && $1 > 0) { + +% } + + + + + +% for (keys %{$LinkRel || {}}) { + +% } + +% if ( $RSSAutoDiscovery ) { + +% } + +% if ($JavaScript) { +<& HeaderJavascript, focus => $Focus, onload => $onload &> +% } + +% my $stylesheet_plugin = "/NoAuth/css/". RT->Config->Get( 'WebDefaultStylesheet', $session{'CurrentUser'} )."/InHeader"; +% if ($m->comp_exists($stylesheet_plugin) ) { +<& $stylesheet_plugin &> +% } +% $m->callback( %ARGS, CallbackName => 'Head' ); + + + > + +% if ($ShowBar) { +<& /Elements/Logo, %ARGS &> + +
+ <& /Elements/PersonalQuickbar, %ARGS &> +% } + +<%INIT> +$r->headers_out->{'Pragma'} = 'no-cache'; +$r->headers_out->{'Cache-control'} = 'no-cache'; + +my $id = $m->request_comp->path; +$id =~ s|^/||g; +$id =~ s|/|-|g; +$id =~ s|\.html$||g; +$id =~ s|index$||g + if $id ne 'index'; +$id =~ s|-$||g; + + +<%ARGS> +#$Focus => 'focus' +$Focus => '' +$Title => 'RT' +$Code => undef +$Refresh => 0 +$Why => undef +$ShowBar => 1 +$URL => undef +$RSSAutoDiscovery => undef +$onload => undef +$LinkRel => undef +$JavaScript => 1 + diff --git a/rt/share/html/Elements/HeaderJavascript b/rt/share/html/Elements/HeaderJavascript new file mode 100644 index 000000000..6ee88a13b --- /dev/null +++ b/rt/share/html/Elements/HeaderJavascript @@ -0,0 +1,122 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%args> +$focus => undef +$onload => undef + + + + + + +% if ( RT->Config->Get('MessageBoxRichText', $session{'CurrentUser'}) ) { + +% } + diff --git a/rt/share/html/Elements/ListActions b/rt/share/html/Elements/ListActions new file mode 100755 index 000000000..86773aeb7 --- /dev/null +++ b/rt/share/html/Elements/ListActions @@ -0,0 +1,94 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
+<&| /Widgets/TitleBox, title => loc('Results') &> +
    +% foreach my $action (@actions) { +
  • <%$action%>
  • +% } +
+ +
+<%init> + +# backward compatibility, don't use array in new code, but use keyed hash +if ( ref( $session{'Actions'} ) eq 'ARRAY' ) { + unshift @actions, @{ delete $session{'Actions'} }; +} + +if ( ref( $session{'Actions'}{''} ) eq 'ARRAY' ) { + unshift @actions, @{ delete $session{'Actions'}{''} }; +} + +my $actions_pointer = $m->request_args->{'results'}; + +if ($actions_pointer && ref( $session{'Actions'}->{$actions_pointer} ) eq 'ARRAY' ) { + unshift @actions, @{ delete $session{'Actions'}->{$actions_pointer} }; +} + +# XXX: run callbacks per row really crazy idea +@actions = + grep $_, + grep { + my $skip; + $m->callback( + %ARGS, + row => \$_, + skip => \$skip, + CallbackName => 'ModifyRow', + ); + !$skip; + } + grep $_, @actions; + +return unless @actions; + + +<%ARGS> +@actions => undef + diff --git a/rt/share/html/Elements/ListMenu b/rt/share/html/Elements/ListMenu new file mode 100644 index 000000000..63d4a1e86 --- /dev/null +++ b/rt/share/html/Elements/ListMenu @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%args> +$items + + diff --git a/rt/share/html/Elements/Login b/rt/share/html/Elements/Login new file mode 100755 index 000000000..8dfbe51d1 --- /dev/null +++ b/rt/share/html/Elements/Login @@ -0,0 +1,139 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%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->Config->Get('WebPath') + ; + + +% $m->callback( %ARGS, CallbackName => 'Header' ); +<& /Elements/Header, Title => loc('Login'), Focus => 'user' &> + + +%# End of div#quickbar from /Elements/Header +
+ + +<& /Elements/Footer, Menu => 0 &> +<%ARGS> +$user => "" +$pass => undef +$goto => undef +$Error => undef + diff --git a/rt/share/html/Elements/Logo b/rt/share/html/Elements/Logo new file mode 100644 index 000000000..359738b5e --- /dev/null +++ b/rt/share/html/Elements/Logo @@ -0,0 +1,66 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<%INIT> +if ( exists $ARGS{'show_name'} ) { + $RT::Logger->warning('show_name argument was renamed, use ShowName'); + $ShowName = delete $ARGS{'show_name'}; +} + +<%ARGS> +$ShowName => 1 +$Name => undef + diff --git a/rt/share/html/Elements/Logout b/rt/share/html/Elements/Logout new file mode 100644 index 000000000..34ed1a317 --- /dev/null +++ b/rt/share/html/Elements/Logout @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + | <&|/l&>Logout +<%ARGS> +$URL => undef + +<%INIT> +my $show = 0; +if ( $session{'CurrentUser'}->Name + && ( !RT->Config->Get('WebExternalAuth') + || RT->Config->Get('WebFallbackToInternalAuth') + ) +) { + $show = 1; +} + +$m->callback( %ARGS, URL => \$URL, show => \$show ); + +return unless $show; + diff --git a/rt/share/html/Elements/MakeClicky b/rt/share/html/Elements/MakeClicky new file mode 100644 index 000000000..f0aaf0696 --- /dev/null +++ b/rt/share/html/Elements/MakeClicky @@ -0,0 +1,207 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ONCE> +use Regexp::Common qw(URI); + +my %actions = ( + default => sub { + my %args = @_; + return $args{value}; + }, + url => sub { + my %args = @_; + my $result = qq{[}. loc('Open URL') .qq{]}; + return $args{value} . qq{ $result}; + }, + url_overwrite => sub { + my %args = @_; + my $result = qq{}; + #XXX: use spaces here. ­ are not well supported :( + $args{'value'} =~ s/(\S{30})/$1 /g; + $result .= qq{$args{'value'}}; + return qq{$result}; + }, +); + +my @types = ( + { + name => "httpurl", + regex => qr/$RE{URI}{HTTP}{-keep}{-scheme => 'https?'}/, + action => "url", + }, + { + name => "httpurl_overwrite", + regex => qr/$RE{URI}{HTTP}{-keep}{-scheme => 'https?'}/, + action => "url_overwrite", + }, +); + +my $handle = sub { + my %args = @_; + for my $rec( @types ) { + return $rec->{action}->( + %args, + all_matches => [ $args{value}, $1, $2, $3, $4, $5, $6, $7, $8, $9 ], + ) if $args{value} =~ $rec->{regex}; + } +}; + +my $escaper = sub { + my $content = shift; + RT::Interface::Web::EscapeUTF8( \$content ); + return $content; +}; + +# Hook to add more Clicky types +# XXX Have to have Page argument, as Mason gets caller wrong in Callback? +# This happens as we are in <%ONCE> block +$m->callback( + CallbackPage => "/Elements/MakeClicky", + types => \@types, + actions => \%actions, + handle => \$handle, +); + + +# Filter +my %active; +$active{$_}++ for RT->Config->Get('Active_MakeClicky'); +@types = grep $active{$_->{name}}, @types; + +# Build up the whole match +my $regexp = join "|", map $_->{regex}, @types; + +# Make sure we have a default +$actions{default} ||= sub {}; + +# Anchor the regexes and look up the actions +foreach my $type ( @types ) { + $type->{regex} = qr/^$type->{regex}$/; + $type->{action} = $actions{$type->{action}} || $actions{default}; +} + + +<%ARGS> +$content => undef +$html => undef + +<%INIT> +return unless defined $$content; +unless ( $regexp ) { + RT::Interface::Web::EscapeUTF8( $content ) unless $html; + return; +} + +my $pos = 0; +while ( $$content =~ /($regexp)/gsio ) { + my $match = $1; + next if $` =~ /href=(?:"|")$/; + my $skipped_len = pos($$content) - $pos - length($match); + if ( $skipped_len > 0 ) { + my $plain; + if ( $html ) { + $plain = substr( $$content, $pos, $skipped_len ); + } + else { + $plain = $escaper->( substr( $$content, $pos, $skipped_len ) ) + } + substr( $$content, $pos, $skipped_len ) = $plain; + $pos += length($plain); + } + my $plain = $handle->( + %ARGS, + value => $match, + all_matches => [ $1, $2, $3, $4, $5, $6, $7, $8, $9 ], + ); + substr( $$content, $pos, length($match) ) = $plain; + pos($$content) = ( $pos += length($plain) ); + +} +substr( $$content, $pos ) = $escaper->( substr( $$content, $pos ) ) unless +($pos == length $$content) || $html; + +pos($$content) = 0; + + +<%doc> + +MakeClicky detects various formats of data in headers and email +messages, and extends them with supporting links. By default, RT +provides two formats: + + * 'httpurl': detects http:// and https:// URLs and adds '[Open URL]' + link after the URL. + + * 'httpurl_overwrite': also detects URLs as 'httpurl' format, but + replace URL with link and *adds spaces* into text if it's longer + then 30 chars. This allow browser to wrap long URLs and avoid + horizontal scrolling. + +To extend this with your own types of data, use the callback. +It will be provided with: + + * 'types': An array reference of hash references. Modify this array + reference to add your own types; the first matching type will be + used. Each hashref should contain: + - 'name': The name of the data format; this is used in the + configuration file to enable the format. + - 'regex': A regular expression to match against + - 'action': The name of the action to run (see "actions", below) + + * 'actions': A hash reference of 'actions'. Modify this hash + reference to change or add action types. Values are subroutine + references which will get called when needed. They should return + the modified string. Note that subroutine must escape HTML. + + * 'handler': A reference to a subroutine reference; modify it if you + have to. This can be used to add pre- or post-processing around + all actions. + +Read more about writing new actions in docs/extending_clickable_links.pod + + diff --git a/rt/share/html/Elements/Menu b/rt/share/html/Elements/Menu new file mode 100755 index 000000000..83644da11 --- /dev/null +++ b/rt/share/html/Elements/Menu @@ -0,0 +1,139 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<% $menu_class ? qq[ class="$menu_class"] : ''|n %>> +>
+<%perl> + my $sep = 0; + my $postsep = 0; + my $accesskey = 1; + + $count = 0; + $class = {}; + +my @tabs = sort keys %$toptabs; + foreach $tab (@tabs) { + $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; + + push @li, 'last' if ( $tab eq $tabs[-1]); + $class->{li} = join ' ', @li; + + my $url = ($toptabs->{$tab}->{'path'}||'') =~ /^(?:https?|mailto):/i + ? $toptabs->{$tab}->{'path'} || '' + : RT->Config->Get('WebPath') . "/" . $toptabs->{$tab}->{'path'}; + + + {'li'} ? qq[ class="$class->{li}"] : ''|n %> > + <% $count > 1 && !$postsep && qq[· ]|n%> + {a} && qq[ class="$class->{a}"] |n %> + <% !$level && " accesskey='".$accesskey++."'" |n %>> + <% $toptabs->{$tab}->{'title'}%> + +%# 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} &> +% } + +% if ($sep) { +
  • ···
  • +% } +% +% $postsep = $sep; +% } +
    + + +<%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; + + +<%ARGS> +$toptabs => {} +$current_toptab => '' +$level => 0 +$last_level => 0 + diff --git a/rt/share/html/Elements/MessageBox b/rt/share/html/Elements/MessageBox new file mode 100755 index 000000000..4985b23e3 --- /dev/null +++ b/rt/share/html/Elements/MessageBox @@ -0,0 +1,82 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +% $m->callback( %ARGS, CallbackName => 'AfterTextArea' ); +<%INIT> + +my $message = ''; + +if ( $QuoteTransaction ) { + my $transaction = RT::Transaction->new( $session{'CurrentUser'} ); + $transaction->Load( $QuoteTransaction ); + $message = $transaction->Content( Quote => 1 ); +} + +my $signature = ''; +if ( $IncludeSignature and my $text = $session{'CurrentUser'}->UserObj->Signature ) { + $signature = "-- \n". $text; +} + +# wrap="something" seems to really break IE + richtext +my $wrap_type = ''; +if ( not RT->Config->Get('MessageBoxRichText', $session{'CurrentUser'}) ) { + $wrap_type = qq(wrap="$Wrap"); +} + + +<%ARGS> +$QuoteTransaction => undef +$Name => 'Content' +$Default => '' +$Width => RT->Config->Get('MessageBoxWidth', $session{'CurrentUser'} ) || 72 +$Height => RT->Config->Get('MessageBoxHeight', $session{'CurrentUser'} ) || 15 +$Wrap => RT->Config->Get('MessageBoxWrap') || 'HARD' +$IncludeSignature => RT->Config->Get('MessageBoxIncludeSignature'); + diff --git a/rt/share/html/Elements/MyAdminQueues b/rt/share/html/Elements/MyAdminQueues new file mode 100644 index 000000000..e7d2b2ac7 --- /dev/null +++ b/rt/share/html/Elements/MyAdminQueues @@ -0,0 +1,54 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<&|/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/share/html/Elements/MyRT b/rt/share/html/Elements/MyRT new file mode 100644 index 000000000..7b719fd42 --- /dev/null +++ b/rt/share/html/Elements/MyRT @@ -0,0 +1,106 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% $m->callback( ARGSRef => \%ARGS, CallbackName => 'BeforeTable' ); + + + + + +% if ( $summary ) { + +% } + +
    +% $show_cb->($_) foreach @$body; + +% $show_cb->($_) foreach @$summary; +
    +% $m->callback( ARGSRef => \%ARGS, CallbackName => 'AfterTable' ); +<%INIT> + +# XXX: we don't use this, but should. +my %allowed_components = map {$_ => 1} @{RT->Config->Get('HomepageComponents')}; + +my $user = $session{'CurrentUser'}->UserObj; +$Portlets ||= $session{'my_rt_portlets'}; +unless ( $Portlets ) { + my ($default_portlets) = RT::System->new($session{'CurrentUser'})->Attributes->Named('HomepageSettings'); + $Portlets = $session{'my_rt_portlets'} = $user->Preferences( + HomepageSettings => $default_portlets? $default_portlets->Content: {}, + ); +} + +my ($body, $summary) = @{$Portlets}{qw(body summary)}; +unless( $body && @$body ) { + $body = $summary || []; + $summary = undef; +} +$summary = undef unless $summary && @$summary; + +my $Rows = $user->Preferences( 'SummaryRows', ( RT->Config->Get('DefaultSummaryRows') || 10 ) ); + +my $show_cb = sub { + my $entry = shift; + my $type = $entry->{type}; + my $name = $entry->{'name'}; + if ( $type eq 'component' ) { + # XXX: security check etc. + $m->comp( $name, %{ $entry->{arguments} || {} } ); + } elsif ( $type eq 'system' ) { + $m->comp( '/Elements/ShowSearch', Name => $name, Override => { Rows => $Rows } ); + } elsif ( $type eq 'saved' ) { + $m->comp( '/Elements/ShowSearch', SavedSearch => $name, Override => { Rows => $Rows }, IgnoreMissing => 1 ); + } else { + $RT::Logger->error("unknown portlet type '$type'"); + } +}; + + +<%ARGS> +$Portlets => undef + diff --git a/rt/share/html/Elements/MyReminders b/rt/share/html/Elements/MyReminders new file mode 100755 index 000000000..25fdf5d48 --- /dev/null +++ b/rt/share/html/Elements/MyReminders @@ -0,0 +1,74 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%# DEPRECATED +<&|/Widgets/TitleBox, + title => loc("Reminders") &> + +% my $i =0; +% while (my $reminder = $reminders->Next) { +% $i++; +% if ($reminder->RefersTo->First) { +% my $ticket= $reminder->RefersTo->First->TargetObj; + + +% }} +
    <%$reminder->Subject%>
    +
    +#<%$ticket->id%>: <%$ticket->Subject%>
    +<%$reminder->OwnerObj->Name %> <%$reminder->DueObj->Unix >0 ? '• '.$reminder->DueObj->AgeAsString : '' |n %> +
    +
    + + +<%init> +return unless RT->Config->Get('EnableReminders'); +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")'); +$reminders->OrderBy(FIELD => 'Due', ORDER => 'ASC'); + diff --git a/rt/share/html/Elements/MyRequests b/rt/share/html/Elements/MyRequests new file mode 100755 index 000000000..c08560db8 --- /dev/null +++ b/rt/share/html/Elements/MyRequests @@ -0,0 +1,49 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%# DEPRECATED +<& /Elements/ShowSearch, Name => 'My Requests' &> diff --git a/rt/share/html/Elements/MySupportQueues b/rt/share/html/Elements/MySupportQueues new file mode 100644 index 000000000..e59c62384 --- /dev/null +++ b/rt/share/html/Elements/MySupportQueues @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<&|/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 => \@conditions, +&> + +<%INIT> +my @conditions = (); +foreach ( RT::Queue->ActiveStatusArray ) { + push @conditions, { cond => "Status = '$_'", name => loc($_) }; +} + diff --git a/rt/share/html/Elements/MyTickets b/rt/share/html/Elements/MyTickets new file mode 100755 index 000000000..354a9642e --- /dev/null +++ b/rt/share/html/Elements/MyTickets @@ -0,0 +1,49 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%# DEPRECATED +<& /Elements/ShowSearch, Name => 'My Tickets' &> diff --git a/rt/share/html/Elements/PageLayout b/rt/share/html/Elements/PageLayout new file mode 100755 index 000000000..981e58a3c --- /dev/null +++ b/rt/share/html/Elements/PageLayout @@ -0,0 +1,251 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
    +% foreach my $action (reverse sort keys %{$topactions}) { +<% $topactions->{"$action"}->{'html'} |n %> +% } +
    + +%# End of div#quickbar from /Elements/Header + + +% if ( $show_menu ) { + +% } + + +
    +% $m->callback( %ARGS, CallbackName => 'BeforeBody' ); +% $m->flush_buffer(); # we've got the page laid out, let's flush the buffer; + +<%INIT> +if ( defined $current_toptab ) { + foreach my $tab ( values %{$toptabs} ) { + next unless $tab->{'path'} eq $current_toptab; + @{ $tab }{ qw(subtabs current_subtab) } = ($tabs, $current_tab); + } +} + +my ($menu_depth, $almost_last, $page_tabs); + +if (RT->Config->Get( 'WebDefaultStylesheet', $session{'CurrentUser'} ) ne '3.4-compat') { + ($menu_depth, $almost_last) = @{ $m->comp('.menu_recurse', data => $toptabs, current => $current_toptab ) }; + + 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}; + } +} + + +%# 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 => { } + $current => '' + $pdata => { } + $ppdata => { } + $level => 0 + + <%init> + if ($current) { + for my $key (keys %$data) { + next if !defined $data->{$key}->{'path'} + || $data->{$key}->{'path'} ne $current; + next unless ref( $data->{$key} ) eq 'HASH' + && ref( $data->{$key}->{'subtabs'} ) eq 'HASH' + && keys %{ $data->{$key}->{'subtabs'} }; + return $m->comp('.menu_recurse', + data => $data->{$key}->{'subtabs'}, + current => $data->{$key}->{'current_subtab'} || '', + pdata => $data->{$key}, + ppdata => $pdata, + level => $level + 1, + ); + } + } + $ppdata->{last_system_menu_level}++; + return [$level, $pdata]; + + + +<%ARGS> +$current_toptab => undef +$current_tab => undef +$toptabs => undef +$topactions => undef +$tabs => undef +$actions => undef +$subactions => undef +$title => $m->callers(-1)->path +$show_menu => 1 + diff --git a/rt/share/html/Elements/PersonalQuickbar b/rt/share/html/Elements/PersonalQuickbar new file mode 100644 index 000000000..5d6497ce1 --- /dev/null +++ b/rt/share/html/Elements/PersonalQuickbar @@ -0,0 +1,16 @@ +<%ARGS> +$Prefs => '/Prefs/Other.html' + +
    + <&|/l&>Skip Menu | +% if ($session{'CurrentUser'}->Name) { + <&|/l, "".$session{'CurrentUser'}->Name."" &>Logged in as [_1] +% if ( $session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => $RT::System ) ) { + | <&|/l&>Preferences +% } +% } else { + <&|/l&>Not logged in. +% } +% $m->callback( %ARGS ); +<& Logout, %ARGS &> +
    diff --git a/rt/share/html/Elements/QueryString b/rt/share/html/Elements/QueryString new file mode 100644 index 000000000..e55454cd9 --- /dev/null +++ b/rt/share/html/Elements/QueryString @@ -0,0 +1,64 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%INIT> +my @params; +for my $key (sort keys %ARGS) { + my $value = $ARGS{$key}; + next unless defined $value; + $key = $m->interp->apply_escapes( $key, 'u' ); + if( UNIVERSAL::isa( $value, 'ARRAY' ) ) { + push @params, + map $key ."=". $m->interp->apply_escapes( $_, 'u' ), + @$value; + } else { + push @params, $key ."=". $m->interp->apply_escapes($value, 'u'); + } +} + +return join '&', sort(@params); + diff --git a/rt/share/html/Elements/QueueSummary b/rt/share/html/Elements/QueueSummary new file mode 100644 index 000000000..bbfd65e56 --- /dev/null +++ b/rt/share/html/Elements/QueueSummary @@ -0,0 +1,108 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + +% for my $condition (@$conditions) { + +% } + +% my $i; +% for my $queue (@queues) { +% $i++; +% my $name = $queue->{Name}; +% $name =~ s/'/\\'/g; +% my $queue_cond = "Queue = '$name' AND "; +% my $all_q = $queue_cond . "(".join( " OR ", map $_->{cond}, @$conditions).")"; + + +% for my $condition (@$conditions) { +% $Tickets->FromSQL( "Queue = $queue->{id} AND ". $condition->{cond} ); + +% } + +% } +
    <&|/l&>Queue<% $condition->{name} %>
    <% $queue->{Name} %><% $Tickets->Count %>
    +<%INIT> +# Ensure sane default +unless ( @$conditions ) { + foreach (RT::Queue->ActiveStatusArray()) { + push @$conditions, { cond => "Status = '$_'", name => loc($_) }; + } +} + + +my @queues; + +if ($cache && exists $session{$cache}) { + @queues = @{$session{$cache}}; +} +else { + my $Queues = RT::Queues->new($session{'CurrentUser'}); + $Queues->UnLimit(); + @queues = grep $queue_filter->($_), @{$Queues->ItemsArrayRef}; + + $m->callback( CallbackName => 'Filter', Queues => \@queues ); + + @queues = map { { + id => $_->Id, + Name => $_->Name, + Description => $_->Description, + } } grep $_, @queues; + + $session{$cache} = \@queues if $cache; +} + + +my $Tickets = RT::Tickets->new($session{'CurrentUser'}); + +<%ARGS> +$cache => undef +$queue_filter => undef +$conditions => [] + diff --git a/rt/share/html/Elements/QuickCreate b/rt/share/html/Elements/QuickCreate new file mode 100644 index 000000000..45e2e2f97 --- /dev/null +++ b/rt/share/html/Elements/QuickCreate @@ -0,0 +1,77 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
    +<&| /Widgets/TitleBox, title => loc('Quick ticket creation') &> +
    + + + + + + + + + + + + + + + +
    <&|/l&>Subject:
    <&|/l&>Queue:<& /Elements/SelectNewTicketQueue, Name => 'Queue' &> +<&|/l&>Owner: + +
    <&|/l&>Requestors:<& /Elements/EmailInput, Name => 'Requestors', Size => '40', Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress &>
    <&|/l&>Content:
    +<& /Elements/Submit, Label => loc('Create') &> +
    + +
    + diff --git a/rt/share/html/Elements/Quicksearch b/rt/share/html/Elements/Quicksearch new file mode 100755 index 000000000..402a2f23f --- /dev/null +++ b/rt/share/html/Elements/Quicksearch @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
    +<&|/Widgets/TitleBox, title => loc("Quick search"), bodyclass => "", + titleright => loc("Edit"), titleright_href => RT->Config->Get('WebPath').'/Prefs/Quicksearch.html' &> +<& /Elements/QueueSummary, + cache => 'quick_search_queues', + queue_filter => sub { $_->CurrentUserHasRight('ShowTicket') && !exists $unwanted->{$_->Name} }, + conditions => \@conditions, +&> + +
    +<%INIT> +my $unwanted = $session{'CurrentUser'}->UserObj->Preferences('QuickSearch', {}); + +my @conditions = (); +foreach ( RT::Queue->ActiveStatusArray ) { + push @conditions, { cond => "Status = '$_'", name => loc($_) }; +} + diff --git a/rt/share/html/Elements/RT__Group/ColumnMap b/rt/share/html/Elements/RT__Group/ColumnMap new file mode 100644 index 000000000..f7dd0f89d --- /dev/null +++ b/rt/share/html/Elements/RT__Group/ColumnMap @@ -0,0 +1,92 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Name +$Attr => undef + +<%ONCE> +my $COLUMN_MAP = { + id => { + title => '#', # loc + attribute => 'id', + align => 'right', + value => sub { return $_[0]->id }, + }, + HasMember => { + title => 'Member', # loc + value => sub { + my $group = $_[0]; + my $uid = $_[2] || return ''; + return $group->HasMember( $uid )? $_[0]->loc('yes'): $_[0]->loc('no'); + }, + }, + HasMemberRecursively => { + title => 'Recursive member', # loc + value => sub { + my $group = $_[0]; + my $uid = $_[2] || return ''; + return $group->HasMemberRecursively( $uid )? $_[0]->loc('yes'): $_[0]->loc('no'); + }, + }, + Name => { + title => 'Name', # loc + attribute => 'Name', + value => sub { return $_[0]->Name() }, + }, + Description => { + title => 'Description', # loc + attribute => 'Description', + value => sub { return $_[0]->Description() }, + }, +}; + + +<%INIT> +$m->callback( COLUMN_MAP => $COLUMN_MAP, CallbackName => 'ColumnMap', CallbackOnce => 1 ); +return GetColumnMapEntry( Map => $COLUMN_MAP, Name => $Name, Attribute => $Attr ); + diff --git a/rt/share/html/Elements/RT__Queue/ColumnMap b/rt/share/html/Elements/RT__Queue/ColumnMap new file mode 100644 index 000000000..5c56004d1 --- /dev/null +++ b/rt/share/html/Elements/RT__Queue/ColumnMap @@ -0,0 +1,115 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Name => undef +$Attr => undef + +<%ONCE> +my $COLUMN_MAP = { + id => { + title => '#', # loc + attribute => 'id', + align => 'right', + value => sub { return $_[0]->id }, + }, + Disabled => { + title => \' ', + attribute => 'Disabled', + value => sub { return $_[0]->Disabled? $_[0]->loc('Disabled'): $_[0]->loc('Enabled') }, + }, + Priority => { + title => 'Priority', # loc + value => sub { return $_[0]->InitialPriority .'-'. $_[0]->FinalPriority }, + }, + Address => { + title => 'Address', # loc + value => sub { return ($_[0]->CorrespondAddress||'-') .'/'. ($_[0]->CommentAddress||'-') }, + }, + Name => { + title => 'Name', # loc + attribute => 'Name', + value => sub { return $_[0]->Name() }, + }, + Description => { + title => 'Description', # loc + attribute => 'Description', + value => sub { return $_[0]->Description() }, + }, + CorrespondAddress => { + title => 'CorrespondAddress', # loc + attribute => 'CorrespondAddress', + value => sub { return $_[0]->CorrespondAddress() }, + }, + CommentAddress => { + title => 'CommentAddress', # loc + attribute => 'CommentAddress', + value => sub { return $_[0]->CommentAddress() }, + }, + InitialPriority => { + title => 'InitialPriority', # loc + attribute => 'InitialPriority', + value => sub { return $_[0]->InitialPriority() }, + }, + FinalPriority => { + title => 'FinalPriority', # loc + attribute => 'FinalPriority', + value => sub { return $_[0]->FinalPriority() }, + }, + DefaultDueIn => { + title => 'DefaultDueIn', # loc + attribute => 'DefaultDueIn', + value => sub { return $_[0]->DefaultDueIn() }, + }, +}; + + +<%INIT> +$m->callback( COLUMN_MAP => $COLUMN_MAP, CallbackName => 'ColumnMap', CallbackOnce => 1 ); +return GetColumnMapEntry( Map => $COLUMN_MAP, Name => $Name, Attribute => $Attr ); + + diff --git a/rt/share/html/Elements/RT__Scrip/ColumnMap b/rt/share/html/Elements/RT__Scrip/ColumnMap new file mode 100644 index 000000000..88b4c4bea --- /dev/null +++ b/rt/share/html/Elements/RT__Scrip/ColumnMap @@ -0,0 +1,103 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Name +$Attr => undef + +<%ONCE> +my $COLUMN_MAP = { + id => { + title => '#', # loc + attribute => 'id', + align => 'right', + value => sub { return $_[0]->id }, + }, + Queue => { + title => 'Queue', # loc + value => sub { + return $_[0]->QueueObj->Name if $_[0]->Queue; + return $_[0]->loc('Global'); + }, + }, + Condition => { + title => 'Condition', # loc + value => sub { return $_[0]->loc( $_[0]->ScripConditionObj->Name ) }, + }, + Action => { + title => 'Action', # loc + value => sub { return $_[0]->loc( $_[0]->ScripActionObj->Name ) }, + }, + Template => { + title => 'Template', # loc + value => sub { return $_[0]->loc( $_[0]->TemplateObj->Name ) }, + }, + AutoDescription => { + title => 'Condition, Action and Template', # loc + value => sub { return $_[0]->loc( "[_1] [_2] with template [_3]", + $_[0]->loc($_[0]->ConditionObj->Name), + $_[0]->loc($_[0]->ActionObj->Name), + $_[0]->loc($_[0]->TemplateObj->Name), + ) }, + }, + Description => { + title => 'Description', # loc + attribute => 'Description', + value => sub { return $_[0]->Description() }, + }, + Stage => { + title => 'Stage', # loc + attribute => 'Stage', + value => sub { return $_[0]->Stage() }, + }, +}; + + +<%INIT> +$m->callback( COLUMN_MAP => $COLUMN_MAP, CallbackName => 'ColumnMap', CallbackOnce => 1 ); +return GetColumnMapEntry( Map => $COLUMN_MAP, Name => $Name, Attribute => $Attr ); + diff --git a/rt/share/html/Elements/RT__Template/ColumnMap b/rt/share/html/Elements/RT__Template/ColumnMap new file mode 100644 index 000000000..851cc9dec --- /dev/null +++ b/rt/share/html/Elements/RT__Template/ColumnMap @@ -0,0 +1,76 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Name +$Attr => undef + +<%ONCE> +my $COLUMN_MAP = { + id => { + title => '#', # loc + attribute => 'id', + align => 'right', + value => sub { return $_[0]->id }, + }, + Name => { + title => 'Name', # loc + attribute => 'Name', + value => sub { return $_[0]->Name() }, + }, + Description => { + title => 'Description', # loc + attribute => 'Description', + value => sub { return $_[0]->Description() }, + }, +}; + + +<%INIT> +$m->callback( COLUMN_MAP => $COLUMN_MAP, CallbackName => 'ColumnMap', CallbackOnce => 1 ); +return GetColumnMapEntry( Map => $COLUMN_MAP, Name => $Name, Attribute => $Attr ); + diff --git a/rt/share/html/Elements/RT__Ticket/ColumnMap b/rt/share/html/Elements/RT__Ticket/ColumnMap new file mode 100644 index 000000000..7df471009 --- /dev/null +++ b/rt/share/html/Elements/RT__Ticket/ColumnMap @@ -0,0 +1,355 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Name => undef +$Attr => undef + + + +<%ONCE> +my $COLUMN_MAP; + +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 { + \'', + ( $_->$mode_uri->IsLocal ? $_->$local_type : $_->$mode ), + \'
    ', + } @{ $_[0]->Links($other_mode,$type)->ItemsArrayRef } + } +}; + +$COLUMN_MAP = { + Queue => { + attribute => 'Queue', + title => 'Queue id', # loc + value => sub { return $_[0]->Queue } + }, + QueueName => { + attribute => 'Queue', + title => 'Queue', # loc + value => sub { return $_[0]->QueueObj->Name } + }, + OwnerName => { + title => 'Owner', # loc + attribute => 'Owner', + value => sub { return $_[0]->OwnerObj->Name } + }, + Status => { + title => 'Status', # loc + attribute => 'Status', + value => sub { return loc($_[0]->Status) } + }, + Subject => { + title => 'Subject', # loc + attribute => 'Subject', + value => sub { return $_[0]->Subject || "(" . loc('No subject') . ")" } + }, + ExtendedStatus => { + title => 'Status', # loc + attribute => 'Status', + value => sub { + my $Ticket = shift; + + if ( my $count = $Ticket->HasUnresolvedDependencies ) { + if ( $Ticket->HasUnresolvedDependencies( Type => 'approval' ) + or $Ticket->HasUnresolvedDependencies( Type => 'code' ) ) + { + return \'', loc('(pending approval)'), \''; + } + else { + my $Query = "DependedOnBy = " . $Ticket->id; + $Query .= " AND (" . join(" OR ", map { "Status = '$_'" } RT::Queue->ActiveStatusArray) . ")"; + + my $SearchURL = RT->Config->Get('WebPath') . '/Search/Results.html?' . $m->comp('/Elements/QueryString', Query => $Query); + + return \'', loc('(pending [quant,_1,other ticket])',$count), \''; + } + } + else { + return loc( $Ticket->Status ); + } + + } + }, + Priority => { + title => 'Priority', # loc + attribute => 'Priority', + value => sub { return $_[0]->Priority } + }, + InitialPriority => { + title => 'InitialPriority', # loc + attribute => 'InitialPriority', + name => 'Initial Priority', + value => sub { return $_[0]->InitialPriority } + }, + FinalPriority => { + title => 'FinalPriority', # loc + attribute => 'FinalPriority', + name => 'Final Priority', + value => sub { return $_[0]->FinalPriority } + }, + EffectiveId => { + title => 'EffectiveId', # loc + attribute => 'EffectiveId', + value => sub { return $_[0]->EffectiveId } + }, + Type => { + title => 'Type', # loc + attribute => 'Type', + value => sub { return $_[0]->Type } + }, + TimeWorked => { + attribute => 'TimeWorked', + title => 'Time Worked', # loc + value => sub { return $_[0]->TimeWorked } + }, + TimeLeft => { + attribute => 'TimeLeft', + title => 'Time Left', # loc + value => sub { return $_[0]->TimeLeftAsString } + }, + TimeEstimated => { + attribute => 'TimeEstimated', + title => 'Time Estimated', # loc + value => sub { return $_[0]->TimeEstimated } + }, + Requestors => { + title => 'Requestors', # loc + attribute => 'Requestor.EmailAddress', + value => sub { return $_[0]->Requestors->MemberEmailAddressesAsString } + }, + Cc => { + title => 'Cc', # loc + attribute => 'Cc.EmailAddress', + value => sub { return $_[0]->Cc->MemberEmailAddressesAsString } + }, + AdminCc => { + title => 'AdminCc', # loc + attribute => 'AdminCc.EmailAddress', + value => sub { return $_[0]->AdminCc->MemberEmailAddressesAsString } + }, + StartsRelative => { + title => 'Starts', # loc + attribute => 'Starts', + value => sub { return $_[0]->StartsObj->AgeAsString } + }, + StartedRelative => { + title => 'Started', # loc + attribute => 'Started', + value => sub { return $_[0]->StartedObj->AgeAsString } + }, + ToldRelative => { + title => 'Told', # loc + attribute => 'Told', + value => sub { return $_[0]->ToldObj->AgeAsString } + }, + DueRelative => { + title => 'Due', # loc + attribute => 'Due', + value => sub { + my $date = $_[0]->DueObj; + # Highlight the date if it was due in the past, and it's still active + if ( $date && $date->Unix > 0 && $date->Diff < 0 && $_[0]->QueueObj->IsActiveStatus($_[0]->Status)) { + return (\'' , $date->AgeAsString , \''); + } else { + return $date->AgeAsString; + } + } + }, + ResolvedRelative => { + title => 'Resolved', # loc + attribute => 'Resolved', + value => sub { return $_[0]->ResolvedObj->AgeAsString } + }, + Starts => { + title => 'Starts', # loc + attribute => 'Starts', + value => sub { return $_[0]->StartsObj->AsString } + }, + Started => { + title => 'Started', # loc + attribute => 'Started', + value => sub { return $_[0]->StartedObj->AsString } + }, + Told => { + title => 'Told', # loc + attribute => 'Told', + value => sub { return $_[0]->ToldObj->AsString } + }, + Due => { + title => 'Due', # loc + attribute => 'Due', + value => sub { return $_[0]->DueObj->AsString } + }, + Resolved => { + title => 'Resolved', # loc + attribute => 'Resolved', + value => sub { return $_[0]->ResolvedObj->AsString } + }, + UpdateStatus => { + title => 'New messages', # loc + value => sub { + my $txn = $_[0]->SeenUpTo or return $_[0]->loc('No'); + return \(''), + $_[0]->loc('New'), \''; + }, + }, + KeyRequestors => { + title => 'Requestors', # loc + attribute => 'Requestor.EmailAddress', + value => sub { + my $t = shift; + my @requestors = $t->Requestors->MemberEmailAddresses; + for my $email (@requestors) + { + my %key = RT::Crypt::GnuPG::GetKeyInfo($email); + if (!defined $key{'info'}) { + $email .= loc(" (no pubkey!)"); + } + elsif ($key{'info'}{'TrustLevel'} == 0) { + $email .= loc(" (untrusted!)"); + } + } + return join ', ', @requestors; + } + }, + KeyOwnerName => { + title => 'Owner', # loc + attribute => 'Owner', + value => sub { + my $t = shift; + my $name = $t->OwnerObj->Name; + my %key = RT::Crypt::GnuPG::GetKeyInfo($t->OwnerObj->EmailAddress); + if (!defined $key{'info'}) { + $name .= ' '. loc("(no pubkey!)"); + } + elsif ($key{'info'}{'TrustLevel'} == 0) { + $name .= ' '. loc("(untrusted!)"); + } + + return $name; + } + }, + + # Everything from LINKTYPEMAP + (map { + $_ => { value => $LinkCallback->( $_ ) } + } keys %RT::Ticket::LINKTYPEMAP), + + '_CLASS' => { + value => sub { return $_[1] % 2 ? 'oddline' : 'evenline' } + }, + '_CHECKBOX' => { + attribute => 'checkbox', + title => 'Update', # loc + align => 'right', + value => sub { return \('') } + }, + + CustomField => { + attribute => sub { return shift @_ }, + title => sub { return pop @_ }, + value => sub { + # Display custom field contents, separated by newlines. + # For Image custom fields we also show a thumbnail here. + + my $values = $_[0]->CustomFieldValues( $_[-1] ); + my @values = map { + ( + ($_->CustomFieldObj->Type eq 'Image') + ? \($m->scomp( '/Elements/ShowCustomFieldImage', Object => $_ )) + : $_->Content + ), + \'
    ', + } @{ $values->ItemsArrayRef }; + pop @values; # Remove that last
    + return @values; + }, + }, + Bookmark => { + title => ' ', + value => sub { + my $bookmark = $m->scomp( '/Ticket/Elements/Bookmark', id => $_[0]->id ); + # the CollectionAsTable/Row template replaces newlines with
    + $bookmark =~ s/\n//g; + + return \$bookmark; + }, + }, +}; + +$COLUMN_MAP->{'CF'} = $COLUMN_MAP->{'CustomField'}; + +# if no GPG support, then KeyOwnerName and KeyRequestors fall back to the regular +# versions +if (RT->Config->Get('GnuPG')->{'Enable'}) { + require RT::Crypt::GnuPG; +} +else { + $COLUMN_MAP->{KeyOwnerName} = $COLUMN_MAP->{OwnerName}; + $COLUMN_MAP->{KeyRequestors} = $COLUMN_MAP->{Requestors}; +} + +<%init> +$m->callback( COLUMN_MAP => $COLUMN_MAP, CallbackName => 'Once', CallbackOnce => 1 ); +# backward compatibility +$m->callback( COLUMN_MAP => $COLUMN_MAP, CallbackName => 'ColumnMap' ); +return GetColumnMapEntry( Map => $COLUMN_MAP, Name => $Name, Attribute => $Attr ); + diff --git a/rt/share/html/Elements/RT__User/ColumnMap b/rt/share/html/Elements/RT__User/ColumnMap new file mode 100644 index 000000000..bb93b978f --- /dev/null +++ b/rt/share/html/Elements/RT__User/ColumnMap @@ -0,0 +1,141 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Name +$Attr => undef + +<%ONCE> +my $COLUMN_MAP = { + id => { + title => '#', # loc + attribute => 'id', + align => 'right', + value => sub { return $_[0]->id }, + }, + Name => { + title => 'Name', # loc + attribute => 'Name', + value => sub { return $_[0]->Name() }, + }, + RealName => { + title => 'RealName', # loc + attribute => 'RealName', + value => sub { return $_[0]->RealName() }, + }, + NickName => { + title => 'NickName', # loc + attribute => 'NickName', + value => sub { return $_[0]->NickName() }, + }, + EmailAddress => { + title => 'EmailAddress', # loc + attribute => 'EmailAddress', + value => sub { return $_[0]->EmailAddress() }, + }, + Organization => { + title => 'Organization', # loc + attribute => 'Organization', + value => sub { return $_[0]->Organization() }, + }, + HomePhone => { + title => 'HomePhone', # loc + attribute => 'HomePhone', + value => sub { return $_[0]->HomePhone() }, + }, + WorkPhone => { + title => 'WorkPhone', # loc + attribute => 'WorkPhone', + value => sub { return $_[0]->WorkPhone() }, + }, + MobilePhone => { + title => 'MobilePhone', # loc + attribute => 'MobilePhone', + value => sub { return $_[0]->MobilePhone() }, + }, + PagerPhone => { + title => 'PagerPhone', # loc + attribute => 'PagerPhone', + value => sub { return $_[0]->PagerPhone() }, + }, + Address1 => { + title => 'Address1', # loc + attribute => 'Address1', + value => sub { return $_[0]->Address1() }, + }, + Address2 => { + title => 'Address2', # loc + attribute => 'Address2', + value => sub { return $_[0]->Address2() }, + }, + City => { + title => 'City', # loc + attribute => 'City', + value => sub { return $_[0]->City() }, + }, + State => { + title => 'State', # loc + attribute => 'State', + value => sub { return $_[0]->State() }, + }, + Zip => { + title => 'Zip', # loc + attribute => 'Zip', + value => sub { return $_[0]->Zip() }, + }, + Country => { + title => 'Country', # loc + attribute => 'Country', + value => sub { return $_[0]->Country() }, + }, +}; + + +<%INIT> +$m->callback( COLUMN_MAP => $COLUMN_MAP, CallbackName => 'ColumnMap', CallbackOnce => 1 ); +return GetColumnMapEntry( Map => $COLUMN_MAP, Name => $Name, Attribute => $Attr ); + diff --git a/rt/share/html/Elements/Refresh b/rt/share/html/Elements/Refresh new file mode 100755 index 000000000..7e36c6855 --- /dev/null +++ b/rt/share/html/Elements/Refresh @@ -0,0 +1,69 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%INIT> +my @refreshevery = qw(120 300 600 1200 3600 7200); + +<%ARGS> +$Name => undef +$Default => 0 + diff --git a/rt/share/html/Elements/RefreshHomepage b/rt/share/html/Elements/RefreshHomepage new file mode 100644 index 000000000..bf91a9522 --- /dev/null +++ b/rt/share/html/Elements/RefreshHomepage @@ -0,0 +1,54 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<&|/Widgets/TitleBox, title => loc('Refresh')&> +
    +<& /Elements/Refresh, Name => 'HomeRefreshInterval', + Default => $session{'home_refresh_interval'}||RT->Config->Get('HomePageRefreshInterval', $session{'CurrentUser'}) &> +<& /Elements/Submit, Label => loc('Go!') &> + +
    diff --git a/rt/share/html/Elements/ScrubHTML b/rt/share/html/Elements/ScrubHTML new file mode 100644 index 000000000..7744a8532 --- /dev/null +++ b/rt/share/html/Elements/ScrubHTML @@ -0,0 +1,77 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ONCE> +my $scrubber = new HTML::Scrubber; +$scrubber->default( + 0, + { + '*' => 0, + id => 1, + class => 1, + # Match http, ftp and relative urls + # XXX: we also scrub format strings with this module then allow simple config options + href => qr{^(?:http:|ftp:|https:|/|__Web(?:Path|BaseURL|URL)__)}i, + face => 1, + size => 1, + target => 1, + style => qr{^(?:(?:color:\s*rgb\(\d+,\s*\d+,\s*\d+\))| + (?:text-align:\s*))}ix, + } +); +$scrubber->deny(qw[*]); +$scrubber->allow( + qw[A B U P BR I HR BR SMALL EM FONT SPAN STRONG SUB SUP STRIKE H1 H2 H3 H4 H5 H6 DIV UL OL LI DL DT DD PRE] +); +$scrubber->comment(0); + +<%init> +return $scrubber->scrub($Content); + +<%args> +$Content => undef + diff --git a/rt/share/html/Elements/Section b/rt/share/html/Elements/Section new file mode 100755 index 000000000..b67115d85 --- /dev/null +++ b/rt/share/html/Elements/Section @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +

    <%$title%>

    +<%ARGS> +$title => undef + diff --git a/rt/share/html/Elements/SelectAttachmentField b/rt/share/html/Elements/SelectAttachmentField new file mode 100755 index 000000000..459b6926e --- /dev/null +++ b/rt/share/html/Elements/SelectAttachmentField @@ -0,0 +1,56 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<%ARGS> +$Name => 'AttachmentField' + diff --git a/rt/share/html/Elements/SelectBoolean b/rt/share/html/Elements/SelectBoolean new file mode 100755 index 000000000..e535ae547 --- /dev/null +++ b/rt/share/html/Elements/SelectBoolean @@ -0,0 +1,71 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%ARGS> +$Name => undef +$True => loc("is") +$Default => 'true' +$TrueVal => 1 +$FalseVal => 0 +$False => loc("isn't") + + +<%INIT> +my $TrueDefault = ''; +my $FalseDefault = ''; +if ($Default && $Default !~ /true/i) { + $FalseDefault = 'selected="selected"'; +} +else { + $TrueDefault = 'selected="selected"'; +} + diff --git a/rt/share/html/Elements/SelectCustomFieldOperator b/rt/share/html/Elements/SelectCustomFieldOperator new file mode 100755 index 000000000..f7fdaadf5 --- /dev/null +++ b/rt/share/html/Elements/SelectCustomFieldOperator @@ -0,0 +1,64 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%ARGS> +$Name => undef +@Options => ( loc('matches'), loc("doesn't match"), loc('is'), loc("isn't"), loc('less than'), loc('greater than')) +@Values => ('LIKE', 'NOT LIKE', '=', '!=', '<', '>') +$Default => '' + diff --git a/rt/share/html/Elements/SelectCustomFieldValue b/rt/share/html/Elements/SelectCustomFieldValue new file mode 100755 index 000000000..579f6962a --- /dev/null +++ b/rt/share/html/Elements/SelectCustomFieldValue @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% $m->callback( Name => $Name, CustomField => $CustomField ); +% if ($CustomField->Type =~ /Select/i) { +% my $values = $CustomField->Values; + +% } +% else { + +% } +<%args> +$Name => undef +$CustomField =>undef + diff --git a/rt/share/html/Elements/SelectDate b/rt/share/html/Elements/SelectDate new file mode 100755 index 000000000..32a173db4 --- /dev/null +++ b/rt/share/html/Elements/SelectDate @@ -0,0 +1,77 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%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); +} +$Value = $Value || $Default; + +unless ($Name) { + $Name = $menu_prefix. "_Date"; +} + + +<%args> + +$ShowTime => 1 +$menu_prefix=>'' +$current=>time +$Default => '' +$Value => '' +$Name => undef +$Size => 16 + diff --git a/rt/share/html/Elements/SelectDateRelation b/rt/share/html/Elements/SelectDateRelation new file mode 100755 index 000000000..61ab350f3 --- /dev/null +++ b/rt/share/html/Elements/SelectDateRelation @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%ARGS> +$Name => undef +$Default => undef +$Before => loc('before') +$On => loc('on') +$After => loc('after') + diff --git a/rt/share/html/Elements/SelectDateType b/rt/share/html/Elements/SelectDateType new file mode 100755 index 000000000..a8631134d --- /dev/null +++ b/rt/share/html/Elements/SelectDateType @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<%ARGS> +$Name => 'DateType' + diff --git a/rt/share/html/Elements/SelectEqualityOperator b/rt/share/html/Elements/SelectEqualityOperator new file mode 100755 index 000000000..2d52df7f0 --- /dev/null +++ b/rt/share/html/Elements/SelectEqualityOperator @@ -0,0 +1,64 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%ARGS> +$Name => undef +@Options => (loc('less than'), loc('equal to'), loc('greater than'), loc('not equal to')) +@Values => qw(< = > !=) +$Default =>'' + diff --git a/rt/share/html/Elements/SelectGroups b/rt/share/html/Elements/SelectGroups new file mode 100755 index 000000000..766a389c4 --- /dev/null +++ b/rt/share/html/Elements/SelectGroups @@ -0,0 +1,68 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<& /Elements/SelectMatch, Name => 'GroupOp', Default => $GroupOp &> + +<%INIT> +my $CFs = RT::CustomFields->new($session{'CurrentUser'}); +$CFs->LimitToChildType('RT::Group'); +$CFs->OrderBy( FIELD => 'Name' ); + +<%ARGS> +$GroupField => '' +$GroupOp => '' +$GroupString => '' + diff --git a/rt/share/html/Elements/SelectLang b/rt/share/html/Elements/SelectLang new file mode 100755 index 000000000..914a6f59c --- /dev/null +++ b/rt/share/html/Elements/SelectLang @@ -0,0 +1,80 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<%ARGS> +$ShowNullOption => 1 +$ShowAllQueues => 1 +$Name => undef +$Verbose => undef +$Default => 0 +$Lite => 0 + + +<%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)/ unless ( $desc =~ /.* \(.*\)/ ); + $lang_to_desc{$lang} = $desc; +} +@lang = sort { $lang_to_desc{$a} cmp $lang_to_desc{$b} } keys %lang_to_desc; + diff --git a/rt/share/html/Elements/SelectLinkType b/rt/share/html/Elements/SelectLinkType new file mode 100755 index 000000000..e4babe3c9 --- /dev/null +++ b/rt/share/html/Elements/SelectLinkType @@ -0,0 +1,57 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%ARGS> +$Name => "LinkType" +$Default => '' + diff --git a/rt/share/html/Elements/SelectMatch b/rt/share/html/Elements/SelectMatch new file mode 100755 index 000000000..78a87caae --- /dev/null +++ b/rt/share/html/Elements/SelectMatch @@ -0,0 +1,82 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%ARGS> +$Name => undef +$Like => loc('matches') +$NotLike => loc("doesn't match") +$True => loc('is') +$False => loc("isn't") +$Default => undef + +<%INIT> + +my $TrueDefault = ''; +my $FalseDefault=''; +my $LikeDefault=''; +my $NotLikeDefault =''; + +if ($Default && $Default =~ /false|!=/i) { + $FalseDefault = qq[ selected="selected"]; +} +elsif ($Default && $Default =~ /true|=/i) { + $TrueDefault = qq[ selected="selected"]; +} +elsif ($Default && $Default =~ /notlike|NOT LIKE/i) { + $NotLikeDefault = qq[ selected="selected"]; +} +else { + $LikeDefault = qq[ selected="selected"]; +} + diff --git a/rt/share/html/Elements/SelectNewTicketQueue b/rt/share/html/Elements/SelectNewTicketQueue new file mode 100755 index 000000000..d7d406ea7 --- /dev/null +++ b/rt/share/html/Elements/SelectNewTicketQueue @@ -0,0 +1,50 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + diff --git a/rt/share/html/Elements/SelectOwner b/rt/share/html/Elements/SelectOwner new file mode 100755 index 000000000..6bdb24064 --- /dev/null +++ b/rt/share/html/Elements/SelectOwner @@ -0,0 +1,133 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<%INIT> + +my @objects; +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; + +$m->callback( + %ARGS, + objects => \@objects, + CallbackName => 'UpdateObjectList' +); + +my $isSU = $session{CurrentUser} + ->HasRight( Right => 'SuperUser', Object => $RT::System ); +foreach my $object (@objects) { + my $Users = RT::Users->new( $session{CurrentUser} ); + $Users->WhoHaveRight( + Right => 'OwnTicket', + Object => $object, + IncludeSystemRights => 1, + IncludeSuperusers => $isSU + ); + 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; + } +} +if ($Default && $Default != $RT::Nobody->id && !$user_uniq_hash{$Default}) { + $user_uniq_hash{$Default} = RT::User->new($session{CurrentUser}); + $user_uniq_hash{$Default}->Load($Default); +} + +my @users = sort { uc( $a->Name ) cmp uc( $b->Name ) } values %user_uniq_hash; +unshift( @users, $RT::Nobody ); + +$m->callback( + %ARGS, + objects => \@objects, + CallbackName => 'UpdateObjectList' +); + + + + +<%ARGS> +$QueueObj => undef +$Name => undef +$Default => 0 +$User => undef +$TicketObj => undef +$DefaultValue => 1 +$DefaultLabel => "-" +$ValueAttribute => 'id' +$cfqueues => undef + diff --git a/rt/share/html/Elements/SelectPriority b/rt/share/html/Elements/SelectPriority new file mode 100644 index 000000000..c8af7cca8 --- /dev/null +++ b/rt/share/html/Elements/SelectPriority @@ -0,0 +1,8 @@ + +<%ARGS> +$Name => 'Priority' +$Default => '' + +<%INIT> +$Default = '' unless defined $Default; + diff --git a/rt/share/html/Elements/SelectQueue b/rt/share/html/Elements/SelectQueue new file mode 100755 index 000000000..20a5b7d9d --- /dev/null +++ b/rt/share/html/Elements/SelectQueue @@ -0,0 +1,106 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if ($Lite) { +% my $d = new RT::Queue($session{'CurrentUser'}); +% $d->Load($Default); + +% } +% else { + +% } +<%args> +$CheckQueueRight => 'CreateTicket' +$ShowNullOption => 1 +$ShowAllQueues => 1 +$Name => undef +$Verbose => undef +$NamedValues => 0 +$Default => 0 +$Lite => 0 +$OnChange => undef +$Class => 'select-queue' + +<%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, + }; + } + } +} + diff --git a/rt/share/html/Elements/SelectResultsPerPage b/rt/share/html/Elements/SelectResultsPerPage new file mode 100755 index 000000000..ec1f27f3c --- /dev/null +++ b/rt/share/html/Elements/SelectResultsPerPage @@ -0,0 +1,68 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%# TODO: Better default handling + + + +<%INIT> +my @values = qw(0 10 25 50 100); +my @labels = (loc('Unlimited'), qw(10 25 50 100)); +$Default = 50 unless defined $Default; + +<%ARGS> + +$Name => undef +$Default => 50 + + diff --git a/rt/share/html/Elements/SelectSortOrder b/rt/share/html/Elements/SelectSortOrder new file mode 100755 index 000000000..ded5a99c9 --- /dev/null +++ b/rt/share/html/Elements/SelectSortOrder @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%INIT> +my @orders = qw (ASC DESC); +my @order_names = (loc('Ascending'), loc('Descending')); + + + +<%ARGS> +$Name => 'SortOrder' +$Default => 'ASC' + diff --git a/rt/share/html/Elements/SelectStatus b/rt/share/html/Elements/SelectStatus new file mode 100755 index 000000000..7f328e5b4 --- /dev/null +++ b/rt/share/html/Elements/SelectStatus @@ -0,0 +1,67 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<%ONCE> +my $queue = new RT::Queue($session{'CurrentUser'}); +my @status = $queue->StatusArray(); + +<%ARGS> +$Name => undef +$Default => '' +$SkipDeleted => 0 +$DefaultValue => 1 +$DefaultLabel => "-" + diff --git a/rt/share/html/Elements/SelectTicketSortBy b/rt/share/html/Elements/SelectTicketSortBy new file mode 100755 index 000000000..d6964ec5b --- /dev/null +++ b/rt/share/html/Elements/SelectTicketSortBy @@ -0,0 +1,62 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%INIT> +my $tickets = new RT::Tickets($session{'CurrentUser'}); +my @sortfields = $tickets->SortFields(); + + +<%ARGS> +$Name => 'SortTicketsBy' +$Default => 'id' + diff --git a/rt/share/html/Elements/SelectTicketTypes b/rt/share/html/Elements/SelectTicketTypes new file mode 100755 index 000000000..792130988 --- /dev/null +++ b/rt/share/html/Elements/SelectTicketTypes @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%ARGS> +$Name => 'TickType' +$Default => undef +@Types => qw(Approval Ticket) + diff --git a/rt/share/html/Elements/SelectTimeUnits b/rt/share/html/Elements/SelectTimeUnits new file mode 100755 index 000000000..5438d3d6c --- /dev/null +++ b/rt/share/html/Elements/SelectTimeUnits @@ -0,0 +1,62 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<%INIT> +$Name .= '-TimeUnits' unless $Name =~ /-TimeUnits$/io; +my $HoursDefault = RT->Config->Get('DefaultTimeUnitsToHours'); + +<%ARGS> +$Name => '' + diff --git a/rt/share/html/Elements/SelectTimezone b/rt/share/html/Elements/SelectTimezone new file mode 100644 index 000000000..09399e1ce --- /dev/null +++ b/rt/share/html/Elements/SelectTimezone @@ -0,0 +1,84 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ONCE> +my $HAS_DATETIME_TZ = eval { require DateTime::TimeZone }; +my $HAS_DATETIME = eval { require DateTime }; + +my (@names, %label); +if ( $HAS_DATETIME_TZ ) { + @names = DateTime::TimeZone->all_names; +} + +if ( $HAS_DATETIME ) { + my $dt = DateTime->now; + for ( @names ) { + $dt->set_time_zone( $_ ); + $label{$_} = $_ . ' ' . $dt->strftime('%z'); + } +} + + +% unless ( $HAS_DATETIME_TZ && @names ) { + +% } else { + +% } +<%ARGS> +$ShowNullOption => 1 +$Name => undef +$Default => 0 + + diff --git a/rt/share/html/Elements/SelectUsers b/rt/share/html/Elements/SelectUsers new file mode 100755 index 000000000..b4a3aa0db --- /dev/null +++ b/rt/share/html/Elements/SelectUsers @@ -0,0 +1,68 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<& /Elements/SelectMatch, Name => 'UserOp', Default => $UserOp &> + +<%INIT> +my $CFs = RT::CustomFields->new($session{'CurrentUser'}); +$CFs->LimitToChildType('RT::User'); +$CFs->OrderBy( FIELD => 'Name' ); + +<%ARGS> +$UserField => '' +$UserOp => '' +$UserString => '' + diff --git a/rt/share/html/Elements/SelectWatcherType b/rt/share/html/Elements/SelectWatcherType new file mode 100755 index 000000000..b5636af49 --- /dev/null +++ b/rt/share/html/Elements/SelectWatcherType @@ -0,0 +1,71 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%INIT> +my @types; +if ($Scope =~ 'queue') { + @types = qw(Cc AdminCc); +} +else { + @types = qw(Requestor Cc AdminCc); +} + +<%ARGS> +$AllowNull => 1 +$Default=>undef +$Scope => 'ticket' +$Name => 'WatcherType' + diff --git a/rt/share/html/Elements/SetupSessionCookie b/rt/share/html/Elements/SetupSessionCookie new file mode 100755 index 000000000..3afe68376 --- /dev/null +++ b/rt/share/html/Elements/SetupSessionCookie @@ -0,0 +1,57 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%INIT> +return if $m->is_subrequest; # avoid reentrancy, as suggested by masonbook + +RT::Interface::Web::LoadSessionFromCookie(); + +return (); + +<%ARGS> +$SessionCookie => undef + diff --git a/rt/share/html/Elements/ShowCustomFieldBinary b/rt/share/html/Elements/ShowCustomFieldBinary new file mode 100644 index 000000000..9c73e8026 --- /dev/null +++ b/rt/share/html/Elements/ShowCustomFieldBinary @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<% $Object->Content %> +<%ARGS> +$Object => undef + diff --git a/rt/share/html/Elements/ShowCustomFieldImage b/rt/share/html/Elements/ShowCustomFieldImage new file mode 100644 index 000000000..2f470cdbd --- /dev/null +++ b/rt/share/html/Elements/ShowCustomFieldImage @@ -0,0 +1,53 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% my $url = RT->Config->Get('WebPath') . "/Download/CustomFieldValue/".$Object->Id.'/'.$Object->Content; +<% $Object->Content %> + +<%ARGS> +$Object + diff --git a/rt/share/html/Elements/ShowCustomFieldText b/rt/share/html/Elements/ShowCustomFieldText new file mode 100644 index 000000000..beaa2a5a1 --- /dev/null +++ b/rt/share/html/Elements/ShowCustomFieldText @@ -0,0 +1,56 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%init> + my $content = $Object->LargeContent || $Object->Content; + $content = $m->comp('/Elements/ScrubHTML', Content => $content); + $content =~ s|\n|
    |g; + +<%$content|n%> +<%ARGS> +$Object + diff --git a/rt/share/html/Elements/ShowCustomFieldWikitext b/rt/share/html/Elements/ShowCustomFieldWikitext new file mode 100644 index 000000000..49376aeb3 --- /dev/null +++ b/rt/share/html/Elements/ShowCustomFieldWikitext @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% 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->Config->Get('WikiImplicitLinks'), prefix => $base} ); +<%$wiki_content|n%> +<%init> +use Text::WikiFormat; + +<%ARGS> +$Object + diff --git a/rt/share/html/Elements/ShowCustomFields b/rt/share/html/Elements/ShowCustomFields new file mode 100644 index 000000000..ddb8b72e3 --- /dev/null +++ b/rt/share/html/Elements/ShowCustomFields @@ -0,0 +1,123 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if ($Table) { + +% } +% while ( my $CustomField = $CustomFields->Next ) { +% my $Values = $Object->CustomFieldValues( $CustomField->Id ); +% my $count = $Values->Count; + + + + +% } +% if ($Table) { +
    <% $CustomField->Name %>: +% unless ( $count ) { +<&|/l&>(no value) +% } elsif ( $count == 1 ) { +% $print_value->( $CustomField, $Values->First ); +% } else { +
      +% while ( my $Value = $Values->Next ) { +
    • +% $print_value->( $CustomField, $Value ); +
    • +% } +
    +% } +
    +% } +<%INIT> +$m->callback( + CallbackName => 'MassageCustomFields', + Object => $Object, + CustomFields => $CustomFields, +); + +my $print_value = sub { + my ($cf, $value) = @_; + my $linked = $cf->LinkValueTo; + if ( $linked ) { + $m->out(''); + } + my $comp = "ShowCustomField". $cf->Type; + $m->callback( + CallbackName => 'ShowComponentName', + Name => \$comp, + CustomField => $cf, + Object => $Object, + ); + if ( $m->comp_exists( $comp ) ) { + $m->comp( $comp, Object => $value ); + } else { + $m->out( $m->interp->apply_escapes( $value->Content, 'h' ) ); + } + $m->out('') 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( '
    ' ); + $m->print( loc("See also:") ); + $m->out( '' ); + $m->print( $value->IncludeContentForValue ); + $m->out( qq{
    \n} ); + $m->out( qq{\n} ); + } +}; + + +<%ARGS> +$Object => undef +$CustomFields => $Object->CustomFields +$Table => 1 + diff --git a/rt/share/html/Elements/ShowLink b/rt/share/html/Elements/ShowLink new file mode 100644 index 000000000..6bd9021b7 --- /dev/null +++ b/rt/share/html/Elements/ShowLink @@ -0,0 +1,69 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +% if ($URI->IsLocal) { +% my $member = $URI->Object; +% if (UNIVERSAL::isa($member, "RT::Ticket")) { +% my $inactive = $member->QueueObj->IsInactiveStatus($member->Status); + + +<%$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%> +% } + +<%ARGS> +$URI => undef + diff --git a/rt/share/html/Elements/ShowLinks b/rt/share/html/Elements/ShowLinks new file mode 100755 index 000000000..569bad39c --- /dev/null +++ b/rt/share/html/Elements/ShowLinks @@ -0,0 +1,160 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + + + + + + + + + + + + + + + + + + + + + + + + + +% # Allow people to add more rows to the table +% $m->callback( %ARGS ); + +
    <&|/l&>Depends on: (<% loc('Create') %>) + +<%PERL> +my ( @active, @inactive, @not_tickets ); +for my $link ( @{ $Ticket->DependsOn->ItemsArrayRef } ) { + my $target = $link->TargetObj; + if ( $target && $target->isa('RT::Ticket') ) { + if ( $target->QueueObj->IsInactiveStatus( $target->Status ) ) { + push( @inactive, $link->TargetURI ); + } + else { + push( @active, $link->TargetURI ); + } + } + else { + push( @not_tickets, $link->TargetURI ); + } +} + + + +
      +% for my $Link (@not_tickets, @active, @inactive) { +
    • <& ShowLink, URI => $Link &>
    • +% } +
    +
    <&|/l&>Depended on by: (<% loc('Create') %>) +
      +% while (my $Link = $Ticket->DependedOnBy->Next) { +
    • <& ShowLink, URI => $Link->BaseURI &>
    • +% } +
    +
    <&|/l&>Parents: (<% loc('Create') %>)<& /Ticket/Elements/ShowParents, Ticket => $Ticket &>
    <&|/l&>Children: (<% loc('Create') %>)<& /Ticket/Elements/ShowMembers, Ticket => $Ticket &>
    <&|/l&>Refers to: (<% loc('Create') %>) +
      +% while (my $Link = $Ticket->RefersTo->Next) { +
    • <& ShowLink, URI => $Link->TargetURI &>
    • +% } +
    +
    <&|/l&>Referred to by: (<% loc('Create') %>) +
      +% while (my $Link = $Ticket->ReferredToBy->Next) { +% next if (UNIVERSAL::isa($Link->BaseObj, 'RT::Ticket') && $Link->BaseObj->Type eq 'reminder'); +
    • <& ShowLink, URI => $Link->BaseURI &>
    • +% } +
    +
    + +<%INIT> + +my $clone = {}; +my $path + = RT->Config->Get('WebPath') + . '/Ticket/Create.html?Queue=' + . $Ticket->Queue + . '&CloneTicket=' + . $Ticket->id; + + +for my $relation ( + qw(RefersTo ReferredToBy)) { + my $mode = $RT::Ticket::LINKTYPEMAP{$relation}->{Mode}; + my $type = $RT::Ticket::LINKTYPEMAP{$relation}->{Type}; + my $other = "Local" . $mode; + my $field = $mode eq 'Base' ? 'new-' . $type : $type . '-new'; + $clone->{$field} + = $path . "&$field=" + . join( '%20', + ( map { $_->$other() } @{ $Ticket->$relation->ItemsArrayRef } ), + $Ticket->id ); +} + +for my $relation ( qw(MemberOf Members DependsOn DependedOnBy)) { + my $mode = $RT::Ticket::LINKTYPEMAP{$relation}->{Mode}; + my $type = $RT::Ticket::LINKTYPEMAP{$relation}->{Type}; + my $field = $mode eq 'Base' ? 'new-' . $type : $type . '-new'; + $clone->{$field} = $path . "&$field=". $Ticket->id ; +} + + + +<%ARGS> +$Ticket => undef + diff --git a/rt/share/html/Elements/ShowMemberships b/rt/share/html/Elements/ShowMemberships new file mode 100644 index 000000000..84f7155f8 --- /dev/null +++ b/rt/share/html/Elements/ShowMemberships @@ -0,0 +1,88 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
      +% while ( my $GroupMember = $GroupMembers->Next ) { +% my $Group = RT::Group->new($session{'CurrentUser'}); +% $Group->Load($GroupMember->GroupId) or next; +% if ($Group->Domain eq 'UserDefined') { +
    • <% $Group->Name %>
    • +% } elsif ($Group->Domain eq 'SystemInternal') { +
    • <% loc($Group->Type) %>
    • +% } +% } +
    +<%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' }, +); + +<%ARGS> +$UserObj + diff --git a/rt/share/html/Elements/ShowSearch b/rt/share/html/Elements/ShowSearch new file mode 100644 index 000000000..a7fc54566 --- /dev/null +++ b/rt/share/html/Elements/ShowSearch @@ -0,0 +1,151 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<&|/Widgets/TitleBox, + title => loc($search->Description, $ProcessedSearchArg->{'Rows'}), + title_href => $query_link_url.$QueryString, + titleright => $customize ? loc('Edit') : '', + titleright_href => $customize, + hideable => $hideable &> +<& $query_display_component, hideable => $hideable, %$ProcessedSearchArg, ShowNavigation => 0, Class => 'RT::Tickets' &> + +<%init> +my $search; +my $user = $session{'CurrentUser'}->UserObj; +my $SearchArg; +my $customize; +my $query_display_component = '/Elements/CollectionList'; +my $query_link_url = RT->Config->Get('WebPath').'/Search/Results.html'; + +if ($SavedSearch) { + my ( $container_object, $search_id ) = _parse_saved_search($SavedSearch); + unless ( $container_object ) { + $m->out(loc("Either you have no rights to view saved search [_1] or identifier is incorrect", $SavedSearch)); + return; + } + $search = $container_object->Attributes->WithId($search_id); + unless ( $search->Id && ref( $SearchArg = $search->Content ) eq 'HASH' ) { + $m->out(loc("Saved Search [_1] not found", $SavedSearch)) unless $IgnoreMissing; + 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 = RT->Config->Get('WebURL') . "/Search/$SearchArg->{SearchType}.html"; + } elsif ($ShowCustomize) { + $customize = RT->Config->Get('WebPath') . '/Search/Build.html?' + . $m->comp( '/Elements/QueryString', + SavedSearchLoad => $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 ); + if ($ShowCustomize) { + $customize = RT->Config->Get('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->callback( + %ARGS, + CallbackName => 'ModifySearch', + OriginalSearch => $SearchArg, + Search => $ProcessedSearchArg, +); + +foreach ( $SearchArg, $ProcessedSearchArg ) { + $_->{'Format'} ||= ''; + + $_->{'Format'} =~ s/__(Web(?:Path|Base|BaseURL))__/scalar RT->Config->Get($1)/ge; + # extract-message-catalog would "$1", so we avoid quotes for loc calls + $_->{'Format'} =~ s/__loc\(["']?(\w+)["']?\)__/my $f = "$1"; loc($f)/ge; + if ( $_->{'Query'} =~ /__Bookmarked__/ ) { + $_->{'Rows'} = 999; + } + elsif ( $_->{'Query'} =~ /__Bookmarks__/ ) { + $_->{'Rows'} = 999; + + # DEPRECATED: will be here for a while up to 3.10/4.0 + my $bookmarks = $session{'CurrentUser'}->UserObj->FirstAttribute('Bookmarks'); + $bookmarks = $bookmarks->Content if $bookmarks; + $bookmarks ||= {}; + my $query = join(" OR ", map " id = '$_' ", grep $bookmarks->{ $_ }, keys %$bookmarks ) || 'id=0'; + $_->{'Query'} =~ s/__Bookmarks__/( $query )/g; + } +} + +my $QueryString = '?' . $m->comp( '/Elements/QueryString', %$SearchArg ); + + +<%ARGS> +$Name => undef +$SavedSearch => undef +%Override => () +$IgnoreMissing => undef +$hideable => 1 +$ShowCustomize => 1 + diff --git a/rt/share/html/Elements/ShowUser b/rt/share/html/Elements/ShowUser new file mode 100644 index 000000000..2fbdcbc3e --- /dev/null +++ b/rt/share/html/Elements/ShowUser @@ -0,0 +1,69 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%# Released under the terms of version 2 of the GNU Public License +<%INIT> +# $User is an RT::User object +# $Address is Email::Address object +if ( !$User && $Address ) { + $User = RT::User->new( $session{'CurrentUser'} ); + $User->LoadByEmail( $Address->address ); + unless ( $User->Id ) { + $m->comp( '/Elements/ShowUserVerbose', Address => $Address ); + return; + } +} +if ( $style eq 'concise' ) { + $m->comp( '/Elements/ShowUserConcise', User => $User ); +} +else { $m->comp( '/Elements/ShowUserVerbose', User => $User ); } + +<%ARGS> +$User => undef +$Address => undef +$style => RT->Config->Get('UsernameFormat', $session{'CurrentUser'}) + diff --git a/rt/share/html/Elements/ShowUserConcise b/rt/share/html/Elements/ShowUserConcise new file mode 100644 index 000000000..3cdba10dd --- /dev/null +++ b/rt/share/html/Elements/ShowUserConcise @@ -0,0 +1,52 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%# Released under the terms of version 2 of the GNU Public License +<% $User->RealName || $User->Name %>\ +<%ARGS> +$User + diff --git a/rt/share/html/Elements/ShowUserEmailFrequency b/rt/share/html/Elements/ShowUserEmailFrequency new file mode 100644 index 000000000..b7654944b --- /dev/null +++ b/rt/share/html/Elements/ShowUserEmailFrequency @@ -0,0 +1,56 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +(<% loc($frequency) %>) +<%INIT> +my $frequency = $User->EmailFrequency( Ticket => $Ticket ); +return unless $frequency; + +<%ARGS> +$User +$Ticket => undef + diff --git a/rt/share/html/Elements/ShowUserVerbose b/rt/share/html/Elements/ShowUserVerbose new file mode 100644 index 000000000..82d65b0b3 --- /dev/null +++ b/rt/share/html/Elements/ShowUserVerbose @@ -0,0 +1,73 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%# Released under the terms of version 2 of the GNU Public License +<%$Address->format%>\ +<%INIT> +my ($phrase, $address, $comment); + +if ($User) { + $address = $User->EmailAddress; + $phrase = $User->RealName + if $User->RealName && lc $User->RealName ne lc $address; + $comment = $User->Name if lc $User->Name ne lc $address; + $comment = "($comment)" if defined $comment and length $comment; + $Address = Email::Address->new( $phrase, $address, $comment ); +} + +$Address->comment('') if $comment && lc $Address->user eq lc $comment; +if ( $phrase and my ( $l, $r ) = ( $phrase =~ /^(\w+) (\w+)$/ ) ) { + $Address->phrase('') + if $Address->user =~ /^\Q$l\E.\Q$r\E$/ + || $Address->user =~ /^\Q$r\E.\Q$l\E$/; +} + + +<%ARGS> +$User => undef +$Address => undef + diff --git a/rt/share/html/Elements/SimpleSearch b/rt/share/html/Elements/SimpleSearch new file mode 100755 index 000000000..16b55fcee --- /dev/null +++ b/rt/share/html/Elements/SimpleSearch @@ -0,0 +1,53 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<%ARGS> +$SendTo => '/Search/Simple.html' + diff --git a/rt/share/html/Elements/Submit b/rt/share/html/Elements/Submit new file mode 100755 index 000000000..79d87a6c8 --- /dev/null +++ b/rt/share/html/Elements/Submit @@ -0,0 +1,103 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
    +
    +% if ($CheckAll) { + +% } +% if ($ClearAll) { + +% } +% if ($Reset) { + +% } +
    +
    +% if ( $Back ) { + <%$BackCaption%> + <% + $BackName ? qq[ name="$BackName"] : '' | n %> value="<%$BackLabel%>" class="button" /> +% } + +% if ($AlternateLabel) { + <%$AlternateCaption%> + <% $Name ? qq[ name="$Name"] : '' | n %> value="<%$AlternateLabel%>" class="button" /> +% } else { + <%$Caption%> + <% $Name ? qq[ name="$Name"] : '' | n %> value="<%$Label%>" class="button" /> +% } +
    +
    +
    + +<%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 => '' +$Back => undef +$BackName => 'Back' +$BackLabel => loc('Back') +$BackCaption => '' +$BackOnClick => undef +$OnClick => undef +$Reset => undef +$ResetLabel => loc('Reset') +$id => undef + diff --git a/rt/share/html/Elements/Tabs b/rt/share/html/Elements/Tabs new file mode 100755 index 000000000..0e0ab978d --- /dev/null +++ b/rt/share/html/Elements/Tabs @@ -0,0 +1,128 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /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, +&> + +<%INIT> +my $action; +my $basetopactions = { + A => { html => $m->scomp('/Elements/CreateTicket') + }, + B => { html => $m->scomp('/Elements/SimpleSearch') + } + }; +my $basetabs = { A => { title => loc('Homepage'), + path => 'index.html', + }, + Ab => { title => loc('Simple Search'), + path => 'Search/Simple.html' + }, + B => { title => loc('Tickets'), + path => 'Search/Build.html' + }, + C => { title => loc('Tools'), + path => 'Tools/index.html' + }, + }; + +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 => 'Prefs/Other.html' + }; +} + +if ($session{'CurrentUser'}->HasRight( Right => 'ShowApprovalsTab', + Object => $RT::System )) { + $basetabs->{P} = { title => loc('Approval'), + path => 'Approvals/' + }; +} + +if (!defined $toptabs) { + $toptabs = $basetabs; +} +if (!defined $topactions) { + $topactions = $basetopactions; +} + +# Now let callbacks add their extra tabs +$m->callback( + topactions => $topactions, + toptabs => $toptabs, + %ARGS +); + + +<%ARGS> +$current_toptab => undef +$current_tab => undef +$toptabs => undef +$topactions => undef +$tabs => undef +$actions => undef +$subactions => undef +$Title => undef +$show_menu => 1 + diff --git a/rt/share/html/Elements/TicketList b/rt/share/html/Elements/TicketList new file mode 100644 index 000000000..059ad7be0 --- /dev/null +++ b/rt/share/html/Elements/TicketList @@ -0,0 +1,70 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%INIT> +$m->comp( + '/Elements/CollectionList', + %ARGS, + Class => 'RT::Tickets' + ); + +<%ARGS> +$Collection => undef +$Query => undef +$Format => RT->Config->Get('DefaultSearchResultFormat') +$DisplayFormat => undef +$Order => undef +$OrderBy => undef +$Rows => 50 +$Page => 1 +$Title => loc('Ticket Search') +$BaseURL => undef +$AllowSorting => undef +$ShowNavigation => 1 +$ShowHeader => 1 +$ShowEmpty => 0 + diff --git a/rt/share/html/Elements/TitleBox b/rt/share/html/Elements/TitleBox new file mode 100644 index 000000000..1efb45a80 --- /dev/null +++ b/rt/share/html/Elements/TitleBox @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%init> +# For compatibility with 3.4 +$m->comp('/Widgets/TitleBox', %ARGS ); + diff --git a/rt/share/html/Elements/TitleBoxEnd b/rt/share/html/Elements/TitleBoxEnd new file mode 100644 index 000000000..1c10a866c --- /dev/null +++ b/rt/share/html/Elements/TitleBoxEnd @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%init> +# For compatibility with 3.4 +$m->comp('/Widgets/TitleBoxEnd', %ARGS ); + diff --git a/rt/share/html/Elements/TitleBoxStart b/rt/share/html/Elements/TitleBoxStart new file mode 100644 index 000000000..65e750348 --- /dev/null +++ b/rt/share/html/Elements/TitleBoxStart @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%init> +# For compatibility with 3.4 +$m->comp('/Widgets/TitleBoxStart', %ARGS ); + diff --git a/rt/share/html/Elements/ValidateCustomFields b/rt/share/html/Elements/ValidateCustomFields new file mode 100644 index 000000000..0253e1cbc --- /dev/null +++ b/rt/share/html/Elements/ValidateCustomFields @@ -0,0 +1,100 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%INIT> +my ($valid, @res) = (1, ()); +$CustomFields->GotoFirstItem; +while ( my $CF = $CustomFields->Next ) { + 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); + + my @values = (); + if ( ref $value eq 'ARRAY' ) { + @values = @$value; + } elsif ( $CF->Type =~ /text/i ) { + @values = ($value); + } else { + @values = split /\r*\n/, ( defined $value ? $value : ''); + } + @values = grep $_ ne '', + map { + s/\r+\n/\n/g; + s/^\s+//; + s/\s+$//; + $_; + } + grep defined, @values; + @values = ('') unless @values; + + foreach my $value( @values ) { + next if $CF->MatchPattern($value); + + my $msg = loc("Input must match [_1]", $CF->FriendlyPattern); + $m->notes( ('InvalidField-' . $CF->Id) => $msg ); + push @res, $msg; + $valid = 0; + } +} +$m->notes('ValidFields', $valid); +return wantarray? ($valid, @res): $valid; + +<%ARGS> +$CustomFields +$ARGSRef +$NamePrefix => "Object-RT::Ticket--CustomField-" + -- cgit v1.2.1