1 %# BEGIN BPS TAGGED BLOCK {{{
5 %# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
6 %# <jesse@bestpractical.com>
8 %# (Except where explicitly superseded by other copyright notices)
13 %# This work is made available to you under the terms of Version 2 of
14 %# the GNU General Public License. A copy of that license should have
15 %# been provided with this software, but in any event can be snarfed
18 %# This work is distributed in the hope that it will be useful, but
19 %# WITHOUT ANY WARRANTY; without even the implied warranty of
20 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 %# General Public License for more details.
23 %# You should have received a copy of the GNU General Public License
24 %# along with this program; if not, write to the Free Software
25 %# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 %# CONTRIBUTION SUBMISSION POLICY:
30 %# (The following paragraph is not intended to limit the rights granted
31 %# to you to modify and distribute this software under the terms of
32 %# the GNU General Public License and is only of importance to you if
33 %# you choose to contribute your changes and enhancements to the
34 %# community by submitting them to Best Practical Solutions, LLC.)
36 %# By intentionally submitting any modifications, corrections or
37 %# derivatives to this work, or any other work intended for use with
38 %# Request Tracker, to Best Practical Solutions, LLC, you confirm that
39 %# you are the copyright holder for those contributions and you grant
40 %# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
41 %# royalty-free, perpetual, license to use, copy, create derivative
42 %# works based on those contributions, and sublicense and distribute
43 %# those contributions and any derivatives thereof.
45 %# END BPS TAGGED BLOCK }}}
53 our ( $STAT_COLUMN_MAP );
59 # First deal with the simple things from the map
60 if ( $STAT_COLUMN_MAP->{$name} ) {
61 return ( $STAT_COLUMN_MAP->{$name}->{$attr} );
64 # now, let's deal with harder things, like Custom Fields
66 elsif ( $name =~ /^(?:CF|CustomField)\.\{(.+)\}$/ ) {
69 if ( $attr eq 'attribute' ) {
72 elsif ( $attr eq 'title' ) {
75 elsif ( $attr eq 'value' ) {
76 # Display custom field contents, separated by newlines.
77 # For Image custom fields we also show a thumbnail here.
79 my $values = $_[0]->CustomFieldValues($field);
82 ($_->CustomFieldObj->Type eq 'Image')
83 ? \($m->scomp( '/Elements/ShowCustomFieldImage', Object => $_ ))
87 } @{ $values->ItemsArrayRef }
96 my $mode = $RT::Ticket::LINKTYPEMAP{$method}{Mode};
97 my $type = $RT::Ticket::LINKTYPEMAP{$method}{Type};
98 my $mode_uri = $mode.'URI';
99 my $local_type = 'Local'.$mode;
104 $_->$mode_uri->Resolver->HREF,
106 ( $_->$mode_uri->IsLocal ? $_->$local_type : $_->$mode ),
108 } @{ $_[0]->Links($mode,$type)->ItemsArrayRef }
114 attribute => 'LastUpdated',
115 title => 'Last Updated',
116 value => sub { return $_[0]->LastUpdatedObj->AsString }
121 value => sub { return $_[0]{values}{Statistics_Date} }
124 Statistics_Created_Count => {
126 value => sub { return $_[0]{values}{Statistics_Created_Count} }
129 Statistics_Resolved_Count => {
131 value => sub { return $_[0]{values}{Statistics_Resolved_Count} }
134 Statistics_Deleted_Count => {
136 value => sub { return $_[0]{values}{Statistics_Deleted_Count} }
139 Statistics_Totals => {
141 value => sub { return $_[0]{values}{Statistics_Totals} }
144 Statistics_Status => {
146 value => sub { return $_[0]{values}{Statistics_Status} }
149 Statistics_Dynamic => {
150 # Depends on having a KEY as second param
155 return $$record{values}{$key}
159 # Everything from LINKTYPEMAP
161 $_ => { value => LinkCallback( $_ ) }
162 } keys %RT::Ticket::LINKTYPEMAP),
165 value => sub { return $_[1] % 2 ? 'oddline' : 'evenline' }
171 $m->comp( '/Elements/Callback', STAT_COLUMN_MAP => $STAT_COLUMN_MAP, _CallbackName => 'StatColumnMap');
172 return StatColumnMap($Name, $Attr);