[Bps-public-commit] RT-Extension-PriorityAsString branch, master, updated. 0.02-5-g4606e5f

Ruslan Zakirov ruz at bestpractical.com
Mon Mar 8 03:36:57 EST 2010


The branch, master has been updated
       via  4606e5fd70afc04c82095827a128fd4f92635ac0 (commit)
       via  96f2c16c96775d21b3a8f04f51e50003375a5c6f (commit)
       via  0276b7464c2d3e17eeb9c1deb53384c702cffd27 (commit)
       via  9f9471fadb26556c87c3e7d3f997356985f1bb73 (commit)
       via  6771b6512115193c2a4157db6c40274f2e7768c6 (commit)
      from  2da8acda6d9a3ff1dbb06a31f7fc40acf60c09ee (commit)

Summary of changes:
 .gitignore                           |    4 ++++
 CHANGES                              |    8 ++++++++
 MANIFEST                             |   18 ++++++++++++++++++
 META.yml                             |    2 +-
 html/Elements/SelectPriority         |    4 ++--
 html/Ticket/Elements/ShowPriority    |    7 ++++++-
 lib/RT/Extension/PriorityAsString.pm |    8 ++++++--
 7 files changed, 45 insertions(+), 6 deletions(-)
 create mode 100644 .gitignore
 create mode 100644 CHANGES
 create mode 100644 MANIFEST

- Log -----------------------------------------------------------------
commit 6771b6512115193c2a4157db6c40274f2e7768c6
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Sat Sep 5 05:28:53 2009 +0400

    search for exact match first
    
    it's especialy important when we have more important priorities with
    lower numeric values

diff --git a/lib/RT/Extension/PriorityAsString.pm b/lib/RT/Extension/PriorityAsString.pm
index d75125d..275c015 100644
--- a/lib/RT/Extension/PriorityAsString.pm
+++ b/lib/RT/Extension/PriorityAsString.pm
@@ -68,7 +68,11 @@ sub _PriorityAsString {
     my $priority = shift;
     return undef unless defined $priority && length $priority;
 
-    my %map   = RT->Config->Get('PriorityAsString');
+    my %map = RT->Config->Get('PriorityAsString');
+    if ( my ($res) = grep $map{$_} == $priority, keys %map ) {
+        return $res;
+    }
+
     my @order = reverse grep defined && length, RT->Config->Get('PriorityAsStringOrder');
     @order = sort { $map{$b} <=> $map{$a} } keys %map
         unless @order;

commit 9f9471fadb26556c87c3e7d3f997356985f1bb73
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Sat Sep 5 05:35:11 2009 +0400

    bump version, 0.03
    
    add manifest
    add changelog

diff --git a/CHANGES b/CHANGES
new file mode 100644
index 0000000..f752b31
--- /dev/null
+++ b/CHANGES
@@ -0,0 +1,8 @@
+0.03 2009-09-05
+
+    * return exact match if it's in the map, switch to
+      heuristic only after the check
+
+0.02 2009-06-18
+
+    * initial release
diff --git a/MANIFEST b/MANIFEST
new file mode 100644
index 0000000..e87e469
--- /dev/null
+++ b/MANIFEST
@@ -0,0 +1,18 @@
+CHANGES
+html/Callbacks/PriorityAsString/Elements/RT__Ticket/ColumnMap/Once
+html/Elements/SelectPriority
+html/Ticket/Elements/ShowPriority
+inc/Module/Install.pm
+inc/Module/Install/Base.pm
+inc/Module/Install/Can.pm
+inc/Module/Install/Fetch.pm
+inc/Module/Install/Makefile.pm
+inc/Module/Install/Metadata.pm
+inc/Module/Install/RTx.pm
+inc/Module/Install/Win32.pm
+inc/Module/Install/WriteAll.pm
+lib/RT/Extension/PriorityAsString.pm
+Makefile.PL
+MANIFEST			This list of files
+META.yml
+README

commit 0276b7464c2d3e17eeb9c1deb53384c702cffd27
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Sun Mar 7 09:49:06 2010 +0300

    * bump version, 0.03

diff --git a/META.yml b/META.yml
index 965c4e1..af9b176 100644
--- a/META.yml
+++ b/META.yml
@@ -24,4 +24,4 @@ requires:
   perl: 5.8.3
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.02
+version: 0.03
diff --git a/lib/RT/Extension/PriorityAsString.pm b/lib/RT/Extension/PriorityAsString.pm
index 275c015..fb99e60 100644
--- a/lib/RT/Extension/PriorityAsString.pm
+++ b/lib/RT/Extension/PriorityAsString.pm
@@ -4,7 +4,7 @@ use warnings;
 
 package RT::Extension::PriorityAsString;
 
-our $VERSION = '0.02';
+our $VERSION = '0.03';
 
 =head1 NAME
 

commit 96f2c16c96775d21b3a8f04f51e50003375a5c6f
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Sun Mar 7 09:51:32 2010 +0300

    gitignore

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..4982072
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+Makefile
+pm_to_blib
+blib/
+MANIFEST.bak

commit 4606e5fd70afc04c82095827a128fd4f92635ac0
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Sun Mar 7 09:52:42 2010 +0300

    priority based classes and localization
    
    Thanks to Christian Loos

diff --git a/html/Elements/SelectPriority b/html/Elements/SelectPriority
index ecb378a..bebec4b 100644
--- a/html/Elements/SelectPriority
+++ b/html/Elements/SelectPriority
@@ -1,4 +1,4 @@
-<select name="<% $Name %>">
+<select class="select-priority" name="<% $Name %>">
 % unless ( defined $Default ) {
 <option value="">-</option>
 % }
@@ -11,7 +11,7 @@ foreach my $label ( @order ) {
         ($value, $selected) = ($map{ $label }, '');
     }
 </%PERL>
-<option value="<% $value %>" <% $selected |n %>><% $label %></option>
+<option class="<% lc $label %>" value="<% $value %>" <% $selected |n %>><% loc($label) %></option>
 % }
 </select>
 <%ARGS>
diff --git a/html/Ticket/Elements/ShowPriority b/html/Ticket/Elements/ShowPriority
index 5bb5bd2..29775f3 100644
--- a/html/Ticket/Elements/ShowPriority
+++ b/html/Ticket/Elements/ShowPriority
@@ -1,4 +1,9 @@
-<span class="ticket-info-priority"><% $Ticket->PriorityAsString %></span>/<span class="ticket-info-final-priority"><% $Ticket->FinalPriorityAsString %></span>
+<span class="ticket-info-priority-<% lc($current) %>"><% loc($current) %></span>/\
+<span class="ticket-info-final-priority-<% lc($final) %>"><% loc($final) %></span>
 <%ARGS>
 $Ticket => undef
 </%ARGS>
+<%INIT>
+my $current = $Ticket->PriorityAsString;
+my $final = $Ticket->FinalPriorityAsString;
+</%INIT>

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



More information about the Bps-public-commit mailing list