[Rt-commit] r16497 - rt/branches/3.999-DANGEROUS/lib/RT

ruz at bestpractical.com ruz at bestpractical.com
Wed Oct 22 09:12:58 EDT 2008


Author: ruz
Date: Wed Oct 22 09:12:42 2008
New Revision: 16497

Modified:
   rt/branches/3.999-DANGEROUS/lib/RT/StatusSchema.pm

Log:
* add for_localization method

Modified: rt/branches/3.999-DANGEROUS/lib/RT/StatusSchema.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/StatusSchema.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/StatusSchema.pm	Wed Oct 22 09:12:42 2008
@@ -448,4 +448,24 @@
     return;
 }
 
+sub for_localization {
+    my $self = shift;
+    $self->fill_status_schemas_cache
+        unless keys %STATUS_SCHEMAS_CACHE;
+
+    my @res = ();
+
+    push @res, @{ $STATUS_SCHEMAS_CACHE{''}{''} || [] };
+    foreach my $schema ( values %STATUS_SCHEMAS ) {
+        push @res,
+            grep defined && length,
+            map $_->[0],
+            grep ref($_),
+            values %{ $schema->{'actions'} || {} };
+    }
+
+    my %seen;
+    return grep !$seen{lc $_}++, @res;
+}
+
 1;


More information about the Rt-commit mailing list