[Rt-commit] r6747 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Sun Jan 14 23:33:52 EST 2007


Author: ruz
Date: Sun Jan 14 23:33:51 2007
New Revision: 6747

Added:
   rt/branches/3.7-EXPERIMENTAL/html/Elements/RT__Queue/
   rt/branches/3.7-EXPERIMENTAL/html/Elements/RT__Queue/ColumnMap
Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)

Log:
 r4359 at cubic-pc:  cubic | 2007-01-14 16:38:51 +0300
 * column map for RT::Queue


Added: rt/branches/3.7-EXPERIMENTAL/html/Elements/RT__Queue/ColumnMap
==============================================================================
--- (empty file)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/RT__Queue/ColumnMap	Sun Jan 14 23:33:51 2007
@@ -0,0 +1,43 @@
+<%ARGS>
+$Name => undef
+$Attr => undef
+</%ARGS>
+<%ONCE>
+our $COLUMN_MAP = {
+    id => {
+        title     => '#',
+        attribute => 'id',
+        align     => 'right',
+        value     => sub { return $_[0]->id },
+    },
+    Disabled => {
+        title     => \'&nbsp;',
+        attribute => 'Disabled',
+        value     => sub { return $_[0]->Disabled? $_[0]->loc('Disabled'): $_[0]->loc('Enabled') },
+    },
+    Priority => {
+        value     => sub { return $_[0]->InitialPriority .'-'. $_[0]->FinalPriority },
+    },
+    Address  => {
+        value     => sub { return ($_[0]->CorrespondAddress||'-') .'/'. ($_[0]->CommentAddress||'-') },
+    },
+};
+foreach my $col(qw(Name Description CorrespondAddress CommentAddress InitialPriority FinalPriority DefaultDueIn)) {
+    $COLUMN_MAP->{$col} = { attribute => $col, value => sub { return $_[0]->$col() } };
+}
+
+our $ColumnMap = sub {
+    my $name = shift;
+    my $attr = shift;
+
+    return $COLUMN_MAP->{$name}->{$attr}
+        if $COLUMN_MAP->{$name};
+
+};
+
+</%ONCE>
+<%INIT>
+$m->callback( COLUMN_MAP => $COLUMN_MAP, CallbackName => 'ColumnMap', CallbackOnce => 1 );
+return $ColumnMap->($Name, $Attr);
+</%INIT>
+


More information about the Rt-commit mailing list