[Rt-commit] r7271 -
rtir/branches/2.3-EXPERIMENTAL/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap
ruz at bestpractical.com
ruz at bestpractical.com
Mon Mar 19 13:00:36 EDT 2007
Author: ruz
Date: Mon Mar 19 13:00:35 2007
New Revision: 7271
Modified:
rtir/branches/2.3-EXPERIMENTAL/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/ColumnMap
Log:
* minor
Modified: rtir/branches/2.3-EXPERIMENTAL/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/ColumnMap
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/ColumnMap (original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/ColumnMap Mon Mar 19 13:00:35 2007
@@ -38,16 +38,19 @@
value => sub {
my $id = $_[0]->id;
-$COLUMN_MAP->{'TakeOrSteal'} = {
- title => 'Take/Steal',
- value => sub {
- my $t = shift;
- return '' if $t->Owner == $t->CurrentUser->id;
- my $action = 'Take';
- $action = 'Steal' if $t->Owner != $RT::Nobody->id;
- my $link = RT->Config->Get('WebPath') ."/Ticket/Display.html?Action=$action&id=". $t->id;
- $link = qq{<a href="$link">}. $t->loc($action) .qq{</a>};
- return \$link;
+ my $name = $_[2] || 'SelectedTickets';
+ return \qq{<input type="checkbox" name="$name" value="$id" checked />}
+ if $m->request_args->{ $name . 'All'};
+
+ my $arg = $m->request_args->{ $name };
+ my $checked = '';
+ if ( $arg && ref $arg ) {
+ $checked = 'checked' if grep $_ == $id, @$arg;
+ }
+ elsif ( $arg ) {
+ $checked = 'checked' if $arg == $id;
+ }
+ return \qq{<input type="checkbox" name="$name" value="$id" $checked />}
},
};
@@ -74,6 +77,20 @@
$COLUMN_MAP->{ "CF.{$field}" } =
$COLUMN_MAP->{ "CustomField.{$field}" } = \%h;
}
+
+$COLUMN_MAP->{'TakeOrSteal'} = {
+ title => 'Take/Steal',
+ value => sub {
+ my $t = shift;
+ return '' if $t->Owner == $t->CurrentUser->id;
+ my $action = 'Take';
+ $action = 'Steal' if $t->Owner != $RT::Nobody->id;
+ my $link = RT->Config->Get('WebPath') ."/Ticket/Display.html?Action=$action&id=". $t->id;
+ $link = qq{<a href="$link">}. $t->loc($action) .qq{</a>};
+ return \$link;
+ },
+};
+
</%INIT>
<%ARGS>
$COLUMN_MAP => undef
More information about the Rt-commit
mailing list