[Bps-public-commit] rt-extension-jsgantt branch, master, updated. 751fc7dc8e631b708acc4e9f4d3d4e505aed0f69

? sunnavy sunnavy at bestpractical.com
Wed Oct 26 14:25:44 EDT 2011


The branch, master has been updated
       via  751fc7dc8e631b708acc4e9f4d3d4e505aed0f69 (commit)
       via  b2fa5536549949a88a625503a3a2ba40bffd7ce5 (commit)
       via  21e1359b2d0652d05ab902f8f69dc416715d398a (commit)
      from  92b24da62a00bd6d5f156bf95f92c0b8665122ee (commit)

Summary of changes:
 README                      |   17 +++++++++++++----
 lib/RT/Extension/JSGantt.pm |    4 +++-
 2 files changed, 16 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 21e1359b2d0652d05ab902f8f69dc416715d398a
Author: sunnavy <sunnavy at gmail.com>
Date:   Thu Oct 27 01:49:47 2011 +0800

    in case owners are too many, then we have to repeat colors

diff --git a/lib/RT/Extension/JSGantt.pm b/lib/RT/Extension/JSGantt.pm
index f9c42d8..30c798a 100644
--- a/lib/RT/Extension/JSGantt.pm
+++ b/lib/RT/Extension/JSGantt.pm
@@ -136,7 +136,8 @@ sub TicketsInfo {
     my %color_map;
     if ( $options{ColorSchemeByOwner} ) {
         my @owner_names = uniq map { $_->OwnerObj->Name } @{ $args{Tickets} };
-        @color_map{@owner_names} = @colors[0 .. $#owner_names];
+        @color_map{@owner_names} =
+          (@colors) x ( int @colors / @owner_names + 1 );
         if (   ref $options{ColorSchemeByOwner}
             && ref $options{ColorSchemeByOwner} eq 'HASH' )
         {

commit b2fa5536549949a88a625503a3a2ba40bffd7ce5
Author: sunnavy <sunnavy at gmail.com>
Date:   Thu Oct 27 01:45:58 2011 +0800

    make ColorSchemeByOwner true by default
    
    everyone loves coloring owners consistently

diff --git a/README b/README
index 56f6d65..846f856 100644
--- a/README
+++ b/README
@@ -16,14 +16,23 @@ How to install:
         ShowOwner     => 1,
         ShowProgress  => 1,
         ShowDuration  => 1,
+
         # define your own color scheme
         ColorScheme => ['ff0000', 'ffff00', 'ff00ff', '00ff00', '00ffff', '0000ff'],
-        # use the same color for each owner and specify colors to use for some owners
-        ColorSchemeByOwner => { root => 'ff0000', foo => '00ff00' },
+
+        # we color owners consistently by default, you can disable it via:
+        # ColorSchemeByOwner => 0,
+
+        # you can specify colors to use, unspecified owners will be
+        # assigned to some color automatically:
+        # ColorSchemeByOwner => { root => 'ff0000', foo => '00ff00' },
+
         # if can't find both start and end dates, use this color
         NullDatesColor => 333,
+
         # to caculate day length
         WorkingHoursPerDay => 8,
+
         # used to set start/end if one exists but the other does not
         DefaultDays => 7,
     );
diff --git a/lib/RT/Extension/JSGantt.pm b/lib/RT/Extension/JSGantt.pm
index 30c798a..ef24887 100644
--- a/lib/RT/Extension/JSGantt.pm
+++ b/lib/RT/Extension/JSGantt.pm
@@ -134,6 +134,7 @@ sub TicketsInfo {
     my ( $min_start, $min_start_obj );
 
     my %color_map;
+    $options{ColorSchemeByOwner} = 1 unless exists $options{ColorSchemeByOwner};
     if ( $options{ColorSchemeByOwner} ) {
         my @owner_names = uniq map { $_->OwnerObj->Name } @{ $args{Tickets} };
         @color_map{@owner_names} =

commit 751fc7dc8e631b708acc4e9f4d3d4e505aed0f69
Author: sunnavy <sunnavy at gmail.com>
Date:   Thu Oct 27 02:19:37 2011 +0800

    comment ColorScheme in case people copy&paste the config
    
    the default one is already pretty imo

diff --git a/README b/README
index 846f856..c66d834 100644
--- a/README
+++ b/README
@@ -17,8 +17,8 @@ How to install:
         ShowProgress  => 1,
         ShowDuration  => 1,
 
-        # define your own color scheme
-        ColorScheme => ['ff0000', 'ffff00', 'ff00ff', '00ff00', '00ffff', '0000ff'],
+        # define your own color scheme:
+        # ColorScheme => ['ff0000', 'ffff00', 'ff00ff', '00ff00', '00ffff', '0000ff'],
 
         # we color owners consistently by default, you can disable it via:
         # ColorSchemeByOwner => 0,

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



More information about the Bps-public-commit mailing list