[Rt-commit] rt branch, 4.0/transaction-columnmap, updated. rt-4.0.4-199-gb202198

Kevin Falcone falcone at bestpractical.com
Wed Jan 18 17:55:13 EST 2012


The branch, 4.0/transaction-columnmap has been updated
       via  b20219898a1d1b7013f076f8ab5a4ba1b0c8d47d (commit)
      from  6079d526d36ea1b7660788f54048afbef8048b50 (commit)

Summary of changes:
 share/html/Elements/RT__Transaction/ColumnMap |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit b20219898a1d1b7013f076f8ab5a4ba1b0c8d47d
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed Jan 18 17:17:30 2012 -0500

    Add a TimeWorked column
    
    Calculates what work was done during this transaction by looking at
    TimeTaken and changes to the TimeWorked field.
    This is naive and will do the wrong thing if you move your TimeWorked
    backwards.

diff --git a/share/html/Elements/RT__Transaction/ColumnMap b/share/html/Elements/RT__Transaction/ColumnMap
index 2457973..d8c862d 100644
--- a/share/html/Elements/RT__Transaction/ColumnMap
+++ b/share/html/Elements/RT__Transaction/ColumnMap
@@ -114,6 +114,16 @@ my $COLUMN_MAP = {
             }
         },
     },
+    TimeWorked => {
+        title     => 'Time Worked', # loc
+        value     => sub {
+            return $_[0]->TimeTaken if $_[0]->TimeTaken;
+            if ( $_[0]->Field eq 'TimeWorked' ) {
+                return ( $_[0]->NewValue - $_[0]->OldValue );
+            }
+            return;
+        }
+    },
 };
 
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list