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 $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 => 'Queue',
116 value => sub { return $_[0]->QueueObj->Name }
120 attribute => 'Owner',
121 value => sub { return $_[0]->OwnerObj->Name }
126 value => sub { return $_[0]->id }
129 attribute => 'Status',
130 value => sub { return loc($_[0]->Status) }
133 attribute => 'Subject',
134 value => sub { return $_[0]->Subject || "(" . loc('No subject') . ")" }
138 attribute => 'Status',
142 if ( $Ticket->HasUnresolvedDependencies ) {
143 if ( $Ticket->HasUnresolvedDependencies( Type => 'approval' )
144 or $Ticket->HasUnresolvedDependencies( Type => 'code' ) )
146 return \'<em>', loc('(pending approval)'), \'</em>';
149 return \'<em>', loc('(pending other Collection)'), \'</em>';
153 return loc( $Ticket->Status );
159 attribute => 'Priority',
160 value => sub { return $_[0]->Priority }
163 attribute => 'InitialPriority',
164 name => 'Initial Priority',
165 value => sub { return $_[0]->InitialPriority }
168 attribute => 'FinalPriority',
169 name => 'Final Priority',
170 value => sub { return $_[0]->FinalPriority }
173 attribute => 'EffectiveId',
174 value => sub { return $_[0]->EffectiveId }
178 value => sub { return $_[0]->Type }
181 attribute => 'TimeWorked',
182 title => 'Time Worked',
183 value => sub { return $_[0]->TimeWorked }
186 attribute => 'TimeLeft',
187 title => 'Time Left',
188 value => sub { return $_[0]->TimeLeft }
191 attribute => 'TimeEstimated',
192 title => 'Time Estimated',
193 value => sub { return $_[0]->TimeEstimated }
196 value => sub { return $_[0]->Requestors->MemberEmailAddressesAsString }
199 value => sub { return $_[0]->Cc->MemberEmailAddressesAsString }
202 value => sub { return $_[0]->AdminCc->MemberEmailAddressesAsString }
206 attribute => 'Starts',
207 value => sub { return $_[0]->StartsObj->AgeAsString }
211 attribute => 'Started',
212 value => sub { return $_[0]->StartedObj->AgeAsString }
216 attribute => 'Created',
217 value => sub { return $_[0]->CreatedObj->AgeAsString }
219 LastUpdatedRelative => {
220 title => 'Last Updated',
221 attribute => 'LastUpdated',
222 value => sub { return $_[0]->LastUpdatedObj->AgeAsString }
227 value => sub { return $_[0]->ToldObj->AgeAsString }
233 my $date = $_[0]->DueObj;
234 if ($date && $date->Unix > 0 && $date->Unix < time()) {
235 return (\'<span class="overdue">' , $date->AgeAsString , \'</span>');
237 return $date->AgeAsString;
241 ResolvedRelative => {
243 attribute => 'Resolved',
244 value => sub { return $_[0]->ResolvedObj->AgeAsString }
247 attribute => 'Starts',
248 value => sub { return $_[0]->StartsObj->AsString }
251 attribute => 'Started',
252 value => sub { return $_[0]->StartedObj->AsString }
255 attribute => 'Created',
256 value => sub { return $_[0]->CreatedObj->AsString }
259 attribute => 'CreatedBy',
260 title => 'Created By',
261 value => sub { return $_[0]->CreatorObj->Name }
264 attribute => 'LastUpdated',
265 title => 'Last Updated',
266 value => sub { return $_[0]->LastUpdatedObj->AsString }
269 attribute => 'LastUpdatedBy',
270 title => 'Last Updated By',
271 value => sub { return $_[0]->LastUpdatedByObj->Name }
275 value => sub { return $_[0]->ToldObj->AsString }
279 value => sub { return $_[0]->DueObj->AsString }
282 attribute => 'Resolved',
283 value => sub { return $_[0]->ResolvedObj->AsString }
286 # Everything from LINKTYPEMAP
288 $_ => { value => LinkCallback( $_ ) }
289 } keys %RT::Ticket::LINKTYPEMAP),
292 value => sub { return $_[1] % 2 ? 'oddline' : 'evenline' }
298 $m->comp( '/Elements/Callback', COLUMN_MAP => $COLUMN_MAP, _CallbackName => 'ColumnMap');
299 return ColumnMap($Name, $Attr);