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 }}}
59 # First deal with the simple things from the map
60 if ( $COLUMN_MAP->{$name} ) {
61 return ( $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 $other_mode = ($mode eq "Target" ? "Base" : "Target");
99 my $mode_uri = $mode.'URI';
100 my $local_type = 'Local'.$mode;
105 $_->$mode_uri->Resolver->HREF,
107 ( $_->$mode_uri->IsLocal ? $_->$local_type : $_->$mode ),
109 } @{ $_[0]->Links($other_mode,$type)->ItemsArrayRef }
115 attribute => 'Queue',
117 value => sub { return $_[0]->QueueObj->Name }
121 attribute => 'Owner',
122 value => sub { return $_[0]->OwnerObj->Name }
127 value => sub { return $_[0]->id }
130 attribute => 'Status',
131 value => sub { return loc($_[0]->Status) }
134 attribute => 'Subject',
135 value => sub { return $_[0]->Subject || "(" . loc('No subject') . ")" }
139 attribute => 'Status',
143 if ( $Ticket->HasUnresolvedDependencies ) {
144 if ( $Ticket->HasUnresolvedDependencies( Type => 'approval' )
145 or $Ticket->HasUnresolvedDependencies( Type => 'code' ) )
147 return \'<em>', loc('(pending approval)'), \'</em>';
150 return \'<em>', loc('(pending other Collection)'), \'</em>';
154 return loc( $Ticket->Status );
160 attribute => 'Priority',
161 value => sub { return $_[0]->Priority }
164 attribute => 'InitialPriority',
165 name => 'Initial Priority',
166 value => sub { return $_[0]->InitialPriority }
169 attribute => 'FinalPriority',
170 name => 'Final Priority',
171 value => sub { return $_[0]->FinalPriority }
174 attribute => 'EffectiveId',
175 value => sub { return $_[0]->EffectiveId }
179 value => sub { return $_[0]->Type }
182 attribute => 'TimeWorked',
183 title => 'Time Worked',
184 value => sub { return $_[0]->TimeWorked }
187 attribute => 'TimeLeft',
188 title => 'Time Left',
189 value => sub { return $_[0]->TimeLeft }
192 attribute => 'TimeEstimated',
193 title => 'Time Estimated',
194 value => sub { return $_[0]->TimeEstimated }
197 value => sub { return $_[0]->Requestors->MemberEmailAddressesAsString }
200 value => sub { return $_[0]->Cc->MemberEmailAddressesAsString }
203 value => sub { return $_[0]->AdminCc->MemberEmailAddressesAsString }
207 attribute => 'Starts',
208 value => sub { return $_[0]->StartsObj->AgeAsString }
212 attribute => 'Started',
213 value => sub { return $_[0]->StartedObj->AgeAsString }
217 attribute => 'Created',
218 value => sub { return $_[0]->CreatedObj->AgeAsString }
220 LastUpdatedRelative => {
221 title => 'Last Updated',
222 attribute => 'LastUpdated',
223 value => sub { return $_[0]->LastUpdatedObj->AgeAsString }
228 value => sub { return $_[0]->ToldObj->AgeAsString }
234 my $date = $_[0]->DueObj;
235 if ($date && $date->Unix > 0 && $date->Unix < time()) {
236 return (\'<span class="overdue">' , $date->AgeAsString , \'</span>');
238 return $date->AgeAsString;
242 ResolvedRelative => {
244 attribute => 'Resolved',
245 value => sub { return $_[0]->ResolvedObj->AgeAsString }
248 attribute => 'Starts',
249 value => sub { return $_[0]->StartsObj->AsString }
252 attribute => 'Started',
253 value => sub { return $_[0]->StartedObj->AsString }
256 attribute => 'Created',
257 value => sub { return $_[0]->CreatedObj->AsString }
260 attribute => 'CreatedBy',
261 title => 'Created By',
262 value => sub { return $_[0]->CreatorObj->Name }
265 attribute => 'LastUpdated',
266 title => 'Last Updated',
267 value => sub { return $_[0]->LastUpdatedObj->AsString }
270 attribute => 'LastUpdatedBy',
271 title => 'Last Updated By',
272 value => sub { return $_[0]->LastUpdatedByObj->Name }
276 value => sub { return $_[0]->ToldObj->AsString }
280 value => sub { return $_[0]->DueObj->AsString }
283 attribute => 'Resolved',
284 value => sub { return $_[0]->ResolvedObj->AsString }
287 # Everything from LINKTYPEMAP
289 $_ => { value => LinkCallback( $_ ) }
290 } keys %RT::Ticket::LINKTYPEMAP),
293 value => sub { return $_[1] % 2 ? 'oddline' : 'evenline' }
299 $m->comp( '/Elements/Callback', COLUMN_MAP => $COLUMN_MAP, _CallbackName => 'ColumnMap');
300 return ColumnMap($Name, $Attr);