diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-04-24 11:35:56 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-04-24 11:35:56 -0700 |
commit | 6587f6ba7d047ddc1686c080090afe7d53365bd4 (patch) | |
tree | ec77342668e8865aca669c9b4736e84e3077b523 /rt/share/html/Elements | |
parent | 47153aae5c2fc00316654e7277fccd45f72ff611 (diff) |
first pass RT4 merge, RT#13852
Diffstat (limited to 'rt/share/html/Elements')
-rw-r--r-- | rt/share/html/Elements/EditCustomFieldDateTime | 62 | ||||
-rw-r--r-- | rt/share/html/Elements/EditCustomFieldIPAddress | 50 | ||||
-rw-r--r-- | rt/share/html/Elements/EditCustomFieldIPAddressRange | 50 | ||||
-rw-r--r-- | rt/share/html/Elements/Framekiller | 67 | ||||
-rw-r--r-- | rt/share/html/Elements/QueriesAsComment | 58 | ||||
-rw-r--r-- | rt/share/html/Elements/QueueSummaryByLifecycle | 145 | ||||
-rw-r--r-- | rt/share/html/Elements/QueueSummaryByStatus | 139 | ||||
-rw-r--r-- | rt/share/html/Elements/RT__Article/ColumnMap | 107 | ||||
-rw-r--r-- | rt/share/html/Elements/RT__Class/ColumnMap | 76 | ||||
-rw-r--r-- | rt/share/html/Elements/RT__Dashboard/ColumnMap | 134 | ||||
-rw-r--r-- | rt/share/html/Elements/SelectIPRelation | 64 | ||||
-rw-r--r-- | rt/share/html/Elements/SelectOwnerAutocomplete | 102 | ||||
-rw-r--r-- | rt/share/html/Elements/SelectOwnerDropdown | 99 | ||||
-rw-r--r-- | rt/share/html/Elements/ShowCustomFieldDateTime | 57 | ||||
-rw-r--r-- | rt/share/html/Elements/ShowReminders | 101 | ||||
-rw-r--r-- | rt/share/html/Elements/WidgetBar | 58 |
16 files changed, 1369 insertions, 0 deletions
diff --git a/rt/share/html/Elements/EditCustomFieldDateTime b/rt/share/html/Elements/EditCustomFieldDateTime new file mode 100644 index 000000000..a558884b0 --- /dev/null +++ b/rt/share/html/Elements/EditCustomFieldDateTime @@ -0,0 +1,62 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/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.'-Values'; +<& /Elements/SelectDate, Name => "$name", current => 0 &> (<%$DateObj->AsString%>) + +<%INIT> +my $DateObj = RT::Date->new ( $session{'CurrentUser'} ); +$DateObj->Set( Format => 'ISO', Value => $Default ); +</%INIT> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => 1 +</%ARGS> diff --git a/rt/share/html/Elements/EditCustomFieldIPAddress b/rt/share/html/Elements/EditCustomFieldIPAddress new file mode 100644 index 000000000..ae57fce87 --- /dev/null +++ b/rt/share/html/Elements/EditCustomFieldIPAddress @@ -0,0 +1,50 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/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 $m->comp( 'EditCustomFieldFreeform', %ARGS ); +</%INIT> diff --git a/rt/share/html/Elements/EditCustomFieldIPAddressRange b/rt/share/html/Elements/EditCustomFieldIPAddressRange new file mode 100644 index 000000000..ae57fce87 --- /dev/null +++ b/rt/share/html/Elements/EditCustomFieldIPAddressRange @@ -0,0 +1,50 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/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 $m->comp( 'EditCustomFieldFreeform', %ARGS ); +</%INIT> diff --git a/rt/share/html/Elements/Framekiller b/rt/share/html/Elements/Framekiller new file mode 100644 index 000000000..3b54da192 --- /dev/null +++ b/rt/share/html/Elements/Framekiller @@ -0,0 +1,67 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/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 ( RT->Config->Get('Framebusting') ) { +%# This is defeatable. The current best known implemention uses CSS to hide +%# the content and JS to re-show it, but that fails poorly for clients that +%# don't run JS. +<script> +if (window.top !== window.self) { + document.write = ""; + + window.top.location = window.self.location; + + setTimeout(function(){ + document.body.innerHTML = ""; + }, 1); + + window.self.onload = function(){ + document.body.innerHTML = ""; + }; +} +</script> +% } diff --git a/rt/share/html/Elements/QueriesAsComment b/rt/share/html/Elements/QueriesAsComment new file mode 100644 index 000000000..2658cc444 --- /dev/null +++ b/rt/share/html/Elements/QueriesAsComment @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/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 unless RT->Config->Get('StatementLog') + && $session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser'); +</%INIT> +<!-- +SQL queries: +% for my $statement ($RT::Handle->SQLStatementLog) { +% my ( $time, $sql, $bind, $duration ) = @$statement; +<% sprintf '%0.4f', $duration %> - <% $RT::Handle->FillIn($sql, $bind) %> +% } +--> diff --git a/rt/share/html/Elements/QueueSummaryByLifecycle b/rt/share/html/Elements/QueueSummaryByLifecycle new file mode 100644 index 000000000..1410e82ef --- /dev/null +++ b/rt/share/html/Elements/QueueSummaryByLifecycle @@ -0,0 +1,145 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/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> + foreach my $lifecycle ( map $lifecycle{$_}, sort keys %lifecycle ) { + my @cur_statuses = grep $lifecycle->IsValid($_), @statuses; + next unless @cur_statuses; +</%perl> + +<table border="0" cellspacing="0" cellpadding="1" width="100%" class="queue-summary"> + +<tr> + <th class="collection-as-table"><&|/l&>Queue</&></th> +% for my $status ( @cur_statuses ) { + <th class="collection-as-table"><% loc($status) %></th> +% } +</tr> + +<%PERL> +my $i = 0; +for my $queue (@queues) { + next if lc($queue->{Lifecycle} || '') ne lc $lifecycle->Name; + + $i++; + my $name = $queue->{Name}; + $name =~ s/(['\\])/\\$1/g; + my $queue_cond = "Queue = '$name' AND "; + my $all_q = $queue_cond . '(' . join( " OR ", map "Status = '$_'", @cur_statuses ) . ')'; +</%PERL> +<tr class="<% $i%2 ? 'oddline' : 'evenline'%>" > + +<td> + <a href="<% RT->Config->Get('WebPath') %>/Search/Results.html?Query=<% $all_q |u,n %>" title="<% $queue->{Description} %>"><% $queue->{Name} %></a> +</td> + +% for my $status (@cur_statuses) { +<td align="right"> + <a href="<% RT->Config->Get('WebPath') %>/Search/Results.html?Query=<% $queue_cond ."Status = '$status'" |u,n %>"><% $data->{$queue->{id}}->{$status } || '-' %></a> +</td> +% } +</tr> +% } +</table> +% } +<%INIT> + +my $Queues = RT::Queues->new( $session{'CurrentUser'} ); +$Queues->UnLimit(); +$m->callback( CallbackName => 'SQLFilter', Queues => $Queues ); + +my @queues = grep $queue_filter->($_), @{ $Queues->ItemsArrayRef }; +$m->callback( CallbackName => 'Filter', Queues => \@queues ); + +@queues = map { + { id => $_->Id, + Name => $_->Name, + Description => $_->Description || '', + Lifecycle => $_->Lifecycle->Name, + } +} grep $_, @queues; + +my %lifecycle; + +for my $queue (@queues) { + my $cycle = RT::Lifecycle->Load( $queue->{'Lifecycle'} ); + $lifecycle{ lc $cycle->Name } = $cycle; +} + +unless (@statuses) { + my %seen; + foreach my $set ( 'initial', 'active' ) { + foreach my $lifecycle ( map $lifecycle{$_}, sort keys %lifecycle ) { + push @statuses, grep !$seen{ lc $_ }++, $lifecycle->Valid($set); + } + } +} + +my $data = {}; +my $statuses = {}; + +use RT::Report::Tickets; +my $report = RT::Report::Tickets->new( RT->SystemUser ); +my $query = + "(". + join(" OR ", map {s{(['\\])}{\\$1}g; "Status = '$_'"} @statuses) #' + .") AND (". + join(' OR ', map "Queue = ".$_->{id}, @queues) + .")"; +$query = 'id < 0' unless @queues; +$report->SetupGroupings( Query => $query, GroupBy => [qw(Status Queue)] ); + +while ( my $entry = $report->Next ) { + $data->{ $entry->__Value("Queue") }->{ $entry->__Value("Status") } + = $entry->__Value('id'); + $statuses->{ $entry->__Value("Status") } = 1; +} +</%INIT> +<%ARGS> +$queue_filter => undef +@statuses => () +</%ARGS> diff --git a/rt/share/html/Elements/QueueSummaryByStatus b/rt/share/html/Elements/QueueSummaryByStatus new file mode 100644 index 000000000..09f274f74 --- /dev/null +++ b/rt/share/html/Elements/QueueSummaryByStatus @@ -0,0 +1,139 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/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 }}} +<table border="0" cellspacing="0" cellpadding="1" width="100%" class="queue-summary"> + +<tr> + <th class="collection-as-table"><&|/l&>Queue</&></th> +% for my $status ( @statuses ) { + <th class="collection-as-table"><% loc($status) %></th> +% } +</tr> + +<%PERL> +my $i = 0; +for my $queue (@queues) { + $i++; + my $name = $queue->{Name}; + $name =~ s/(['\\])/\\$1/g; + my $queue_cond = "Queue = '$name' AND "; + my $lifecycle = $lifecycle{ lc $queue->{'Lifecycle'} }; + my $all_q = $queue_cond . '(' . join( " OR ", map "Status = '$_'", grep $lifecycle->IsValid($_), @statuses ) . ')'; +</%PERL> +<tr class="<% $i%2 ? 'oddline' : 'evenline'%>" > + +<td> + <a href="<% RT->Config->Get('WebPath') %>/Search/Results.html?Query=<% $all_q |u,n %>" title="<% $queue->{Description} %>"><% $queue->{Name} %></a> +</td> + +<%perl> + for my $status (@statuses) { + if ( $lifecycle->IsValid( $status ) ) { +</%perl> +<td align="right"> + <a href="<% RT->Config->Get('WebPath') %>/Search/Results.html?Query=<% $queue_cond ."Status = '$status'" |u,n %>"><% $data->{$queue->{id}}->{$status } || '-' %></a> +</td> +% } else { +<td align="right">-</td> +% } +% } +</tr> +% } +</table> +<%INIT> + +my $Queues = RT::Queues->new( $session{'CurrentUser'} ); +$Queues->UnLimit(); +$m->callback( CallbackName => 'SQLFilter', Queues => $Queues ); + +my @queues = grep $queue_filter->($_), @{ $Queues->ItemsArrayRef }; +$m->callback( CallbackName => 'Filter', Queues => \@queues ); + +@queues = map { + { id => $_->Id, + Name => $_->Name, + Description => $_->Description || '', + Lifecycle => $_->Lifecycle->Name, + } +} grep $_, @queues; + +my %lifecycle; + +for my $queue (@queues) { + my $cycle = RT::Lifecycle->Load( $queue->{'Lifecycle'} ); + $lifecycle{ lc $cycle->Name } = $cycle; +} + +unless (@statuses) { + my %seen; + foreach my $set ( 'initial', 'active' ) { + foreach my $lifecycle ( map $lifecycle{$_}, sort keys %lifecycle ) { + push @statuses, grep !$seen{ lc $_ }++, $lifecycle->Valid($set); + } + } +} + +my $data = {}; +my $statuses = {}; + +use RT::Report::Tickets; +my $report = RT::Report::Tickets->new( RT->SystemUser ); +my $query = @queues + ? join(' OR ', map "Queue = ".$_->{id}, @queues) + : 'id < 0'; +$report->SetupGroupings( Query => $query, GroupBy => [qw(Status Queue)] ); + +while ( my $entry = $report->Next ) { + $data->{ $entry->__Value("Queue") }->{ $entry->__Value("Status") } + = $entry->__Value('id'); + $statuses->{ $entry->__Value("Status") } = 1; +} +</%INIT> +<%ARGS> +$queue_filter => undef +@statuses => () +</%ARGS> diff --git a/rt/share/html/Elements/RT__Article/ColumnMap b/rt/share/html/Elements/RT__Article/ColumnMap new file mode 100644 index 000000000..133f3d463 --- /dev/null +++ b/rt/share/html/Elements/RT__Article/ColumnMap @@ -0,0 +1,107 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/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 +</%ARGS> + + +<%ONCE> +my $COLUMN_MAP; + +$COLUMN_MAP = { + Name => { + attribute => 'Name', + title => 'Name', # loc + value => sub { $_[0]->Name }, + }, + Summary => { + attribute => 'Summary', + title => 'Summary', # loc + value => sub { $_[0]->Summary }, + }, + Class => { + attribute => 'Class', + title => 'Class id', # loc + value => sub { $_[0]->Class }, + }, + ClassName => { + attribute => 'Class', + title => 'Class', # loc + value => sub { $_[0]->ClassObj->Name }, + }, + CreatedRelative => { + attribute => 'Created', + title => 'Created', # loc + value => sub { $_[0]->CreatedObj->AgeAsString }, + }, + LastUpdatedRelative => { + attribute => 'LastUpdated', + title => 'LastUpdated', # loc + value => sub { $_[0]->LastUpdatedObj->AgeAsString }, + }, + Topics => { + title => 'Topics', # loc + value => sub { + my $topics = ''; + my $Topics = $_[0]->Topics; + while ( my $t = $Topics->Next ) { + $topics .= + $m->scomp( '/Articles/Elements/ShowTopic', topic => $t->TopicObj ) + . '<br />'; + } + return \$topics; + }, + } +}; + +</%ONCE> +<%init> +$m->callback( COLUMN_MAP => $COLUMN_MAP, CallbackName => 'Once', CallbackOnce => 1 ); +return GetColumnMapEntry( Map => $COLUMN_MAP, Name => $Name, Attribute => $Attr ); +</%init> diff --git a/rt/share/html/Elements/RT__Class/ColumnMap b/rt/share/html/Elements/RT__Class/ColumnMap new file mode 100644 index 000000000..3875d96e8 --- /dev/null +++ b/rt/share/html/Elements/RT__Class/ColumnMap @@ -0,0 +1,76 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/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 +</%ARGS> +<%ONCE> +my $COLUMN_MAP = { + id => { + title => '#', # loc + attribute => 'id', + 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() }, + }, +}; + + +</%ONCE> +<%INIT> +$m->callback( COLUMN_MAP => $COLUMN_MAP, CallbackName => 'ColumnMap', CallbackOnce => 1 ); +return GetColumnMapEntry( Map => $COLUMN_MAP, Name => $Name, Attribute => $Attr ); +</%INIT> diff --git a/rt/share/html/Elements/RT__Dashboard/ColumnMap b/rt/share/html/Elements/RT__Dashboard/ColumnMap new file mode 100644 index 000000000..8bc4383d8 --- /dev/null +++ b/rt/share/html/Elements/RT__Dashboard/ColumnMap @@ -0,0 +1,134 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/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 +</%ARGS> +<%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()||loc("Unnamed dashboard") }, + }, + Subscription => { + title => 'Subscription', # loc + attribute => 'Subscription', + value => sub { + my $Dashboard = shift; + my $Subscription = $Dashboard->Subscription; + + my $url = sprintf '%s/Dashboards/Subscription.html?id=%d', + RT->Config->Get('WebPath'), + $Dashboard->Id; + + my $frequency = loc("None"); + + if (defined $Subscription) { + my $freq = $Subscription->SubValue('Frequency'); + my $hour = $Subscription->SubValue('Hour'); + + if (my ($integer_hour) = $hour =~ /^(\d\d):00$/) { + my $formatter = RT::Date->new($session{CurrentUser})->LocaleObj; + my $dt = DateTime->now; + $dt->set_minute(0); + $dt->set_second(0); + $dt->set_hour($integer_hour); + + # use the formatted hour instead + $hour = $dt->format_cldr($formatter->time_format_short); + } + + if ($freq eq 'weekly') { + my $day = $Subscription->SubValue('Dow'); + $frequency = loc("weekly (on [_1]) at [_2]", loc($day), $hour); + } + elsif ($freq eq 'monthly') { + $frequency = loc("monthly (day [_1]) at [_2]", $Subscription->SubValue('Dom'), $hour); + } + elsif ($freq eq 'daily') { + $frequency = loc("daily at [_1]", $hour); + } + elsif ($freq eq 'm-f') { + $frequency = loc("M-F at [_1]", $hour); + } + elsif ($freq eq 'never') { + $frequency = loc("Never"); + } + else { + $frequency = loc($freq); + } + } + + return \('<a href="'.$url.'">'.$frequency.'</a>'); + }, + }, + ShowURL => { + title => '', + attribute => 'ShowURL', + value => sub { + my $dashboard = shift; + my $id = $dashboard->Id; + my $name = $dashboard->Name; + + return "Dashboards/$id/$name"; + }, + } +}; + +</%ONCE> +<%INIT> +$m->callback( COLUMN_MAP => $COLUMN_MAP, CallbackName => 'ColumnMap', CallbackOnce => 1 ); +return GetColumnMapEntry( Map => $COLUMN_MAP, Name => $Name, Attribute => $Attr ); +</%INIT> diff --git a/rt/share/html/Elements/SelectIPRelation b/rt/share/html/Elements/SelectIPRelation new file mode 100644 index 000000000..ec9f58d13 --- /dev/null +++ b/rt/share/html/Elements/SelectIPRelation @@ -0,0 +1,64 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/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 }}} +<select name="<% $Name %>"> +% while (my $option = shift @Options) { +% my $value = shift @Values; +<option value="<% $value %>" +% if ($Default eq $value) { +selected="selected" +% } +><% $option %></option> +% } +</select> + +<%ARGS> +$Name => undef +@Options => ( loc('is'), loc("isn't"), loc('less than'), loc('greater than')) +@Values => ('=', '!=', '<', '>') +$Default => '' +</%ARGS> diff --git a/rt/share/html/Elements/SelectOwnerAutocomplete b/rt/share/html/Elements/SelectOwnerAutocomplete new file mode 100644 index 000000000..cf2010a80 --- /dev/null +++ b/rt/share/html/Elements/SelectOwnerAutocomplete @@ -0,0 +1,102 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/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 +$Objects => [] +$Default => 0 +$ValueAttribute => 'Name' +$TicketObj => undef +</%ARGS> +<%INIT> +$ValueAttribute = 'Name' unless $ValueAttribute =~ /^(?:id|Name)$/; + +my $value = ''; + +if ( $Default and not $Default =~ /\D/ ) { + my $user = RT::User->new( $session{'CurrentUser'} ); + $user->Load($Default); + $value = $user->$ValueAttribute; +} elsif (defined $TicketObj) { + $value = $TicketObj->OwnerObj->$ValueAttribute; +} + +# Map to a string of RT::Ticket-1|RT::Queue-5|... +my $limit = join '|', map { join '-', ref($_), ($_->id || '') } @$Objects; + +my $query = $m->comp('/Elements/QueryString', + return => $ValueAttribute, + limit => $limit, +); +</%INIT> + +<input type="text" name="<%$Name%>" id="<%$Name%>" value="<% $value %>" /> +<script type="text/javascript"> + jQuery(function() { + var cache = {}; + jQuery("#<% $Name %>").autocomplete({ + minLength: 2, + source: function(request, response) { + if ( request.term in cache ) { + response( cache[ request.term ] ); + } + else { + jQuery.ajax({ + url: "<% RT->Config->Get('WebPath')%>/Helpers/Autocomplete/Owners?<% $query|n %>", + dataType: "json", + data: request, + success: function( data ) { + cache[ request.term ] = data; + response( data ); + } + }); + } + } + }); + }); +</script> + diff --git a/rt/share/html/Elements/SelectOwnerDropdown b/rt/share/html/Elements/SelectOwnerDropdown new file mode 100644 index 000000000..5dd642960 --- /dev/null +++ b/rt/share/html/Elements/SelectOwnerDropdown @@ -0,0 +1,99 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/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 }}} +<select name="<%$Name%>" id="<%$Name%>"> +%if ($DefaultValue) { +<option value=""<% !$Default ? qq[ selected="selected"] : '' |n %>><%$DefaultLabel |n%></option> +%} +% $Default = 0 unless defined $Default && $Default =~ /^\d+$/; +% my @formatednames = sort {lc $a->[1] cmp lc $b->[1]} map {[$_, $m->scomp('/Elements/ShowUser', User => $_)]} grep { $_->id != RT->Nobody->id } @users; +% my $nobody = [RT->Nobody, $m->scomp('/Elements/ShowUser', User => RT->Nobody)]; +% unshift @formatednames, $nobody; +%foreach my $UserRef ( @formatednames) { +%my $User = $UserRef->[0]; +<option <% ( $User->Id == $Default) ? qq[ selected="selected"] : '' |n %> +%if ($ValueAttribute eq 'id') { + value="<%$User->id%>" +%} elsif ($ValueAttribute eq 'Name') { + value="<%$User->Name%>" +%} +><% $UserRef->[1] |n %></option> +%} +</select> +<%INIT> +my %user_uniq_hash; + +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() ) { + $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 = values %user_uniq_hash; +</%INIT> + +<%ARGS> +$Name => undef +$Objects => [] +$Default => 0 +$DefaultValue => 1 +$DefaultLabel => "-" +$ValueAttribute => 'id' +</%ARGS> diff --git a/rt/share/html/Elements/ShowCustomFieldDateTime b/rt/share/html/Elements/ShowCustomFieldDateTime new file mode 100644 index 000000000..e7a9a2bdc --- /dev/null +++ b/rt/share/html/Elements/ShowCustomFieldDateTime @@ -0,0 +1,57 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/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->Content; + my $DateObj = RT::Date->new ( $session{'CurrentUser'} ); + $DateObj->Set( Format => 'ISO', Value => $content ); + $content = $DateObj->AsString; +</%INIT> +<%$content|n%> +<%ARGS> +$Object +</%ARGS> diff --git a/rt/share/html/Elements/ShowReminders b/rt/share/html/Elements/ShowReminders new file mode 100644 index 000000000..34cde464a --- /dev/null +++ b/rt/share/html/Elements/ShowReminders @@ -0,0 +1,101 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/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 ( $reminders->Count ) { +<table border="0" cellpadding="1" cellspacing="0" width="100%" class="collection-as-table"> +<tr> +<th class="collection-as-table"><&|/l&>Reminder</&></th> +<th class="collection-as-table"><&|/l&>Due</&></th> +<th class="collection-as-table"><&|/l&>Ticket</&></th> +</tr> +<%PERL> +my $i =0; +while ( my $reminder = $reminders->Next ) { +$i++; +my $dueobj = $reminder->DueObj; +my $overdue = $dueobj->Unix > 0 && $dueobj->Diff < 0 ? 1 : 0; + +my $targets = RT::Tickets->new($session{'CurrentUser'}); +$targets->FromSQL( "ReferredToBy = " . $reminder->id ); + +if ( my $ticket= $targets->First ) { +</%PERL> +<tr class="<% $i%2 ? 'oddline' : 'evenline' %>"> +<td class="collection-as-table"> +<a href="<% RT->Config->Get('WebPath') %>/Ticket/Reminders.html?id=<% $ticket->id %>"><% $reminder->Subject %></a> +</td> +<td class="collection-as-table"> +<% $overdue ? '<span class="overdue">' : '' |n %><% $dueobj->AgeAsString || loc('Not set') %><% $overdue ? '</span>' : '' |n %> +</td> +<td class="collection-as-table"> +<a href="<% RT->Config->Get( 'WebPath' ) %>/Ticket/Display.html?id=<% $ticket->id %>">#<% $ticket->Id %>: <% $ticket->Subject %></a> +</td> +% } else { +<td colspan="3" class="collection-as-table> +<div class="error"><div class="error">Couldn't find Ticket for reminder <% $reminder->id %>. Please contact administrator.</div></div> +</td> +% } +</tr> +% } +</table> +% } + +<%INIT> +my $reminders = RT::Tickets->new($session{'CurrentUser'}); +my $tsql = 'Type = "reminder"' . + ' AND ( Owner = "Nobody" OR Owner ="' . $session{'CurrentUser'}->id . '")' . + ' AND ( Status = "new" OR Status = "open" )'; + +$tsql .= ' AND Due < "now"' if $OnlyOverdue; + +$reminders->FromSQL($tsql); +$reminders->OrderBy( FIELD => 'Due', ORDER => 'ASC' ); +</%INIT> + +<%ARGS> +$OnlyOverdue => 0 +</%ARGS> diff --git a/rt/share/html/Elements/WidgetBar b/rt/share/html/Elements/WidgetBar new file mode 100644 index 000000000..35e7fe215 --- /dev/null +++ b/rt/share/html/Elements/WidgetBar @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# <sales@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/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 }}} +% return unless ($menu); +% for my $child ($menu->children) { +% if (defined $child->raw_html) { +<% $child->raw_html |n %> +% } else { +<% $child->title %>\ +% } +% } +<%ARGS> +$menu +</%ARGS> |