[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.7-11-g85a9852

Alex Vandiver alexmv at bestpractical.com
Wed Dec 8 16:06:10 EST 2010


The branch, 3.9-trunk has been updated
       via  85a98528fcd48f98f84ad5baa2ab49c8a950af86 (commit)
       via  287110f2bcc85e06614e9f077897242ab57ac78c (commit)
      from  235108cfa5fa07107678fd1b66ddec39bcffbc8a (commit)

Summary of changes:
 lib/RT/CustomField_Overlay.pm                   |   50 +++++++++++++++--------
 share/html/Admin/Elements/SelectCustomFieldType |    2 +-
 share/html/m/ticket/create                      |    2 +-
 share/html/m/ticket/show                        |    2 +-
 4 files changed, 36 insertions(+), 20 deletions(-)

- Log -----------------------------------------------------------------
commit 287110f2bcc85e06614e9f077897242ab57ac78c
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Dec 8 15:22:16 2010 -0500

    Remove some indirect object notation

diff --git a/share/html/m/ticket/create b/share/html/m/ticket/create
index ffec253..25357d3 100644
--- a/share/html/m/ticket/create
+++ b/share/html/m/ticket/create
@@ -150,7 +150,7 @@ my @results;
 
 my $title = loc("Create a ticket");
 
-my $QueueObj = new RT::Queue($session{'CurrentUser'});
+my $QueueObj = RT::Queue->new($session{'CurrentUser'});
 $QueueObj->Load($Queue) || Abort(loc("Queue could not be loaded."));
 
 $m->callback( QueueObj => $QueueObj, title => \$title, results => \@results, ARGSRef => \%ARGS );
diff --git a/share/html/m/ticket/show b/share/html/m/ticket/show
index ad94f12..14933f6 100644
--- a/share/html/m/ticket/show
+++ b/share/html/m/ticket/show
@@ -59,7 +59,7 @@ unless ($id) {
 if ($ARGS{'id'} eq 'new') {
     # {{{ Create a new ticket
 
-    my $Queue = new RT::Queue( $session{'CurrentUser'} );
+    my $Queue = RT::Queue->new( $session{'CurrentUser'} );
     $Queue->Load($ARGS{'Queue'});
     unless ( $Queue->id ) {
         Abort('Queue not found');

commit 85a98528fcd48f98f84ad5baa2ab49c8a950af86
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Dec 8 16:05:23 2010 -0500

    Provide a consistent, sane, ordering and default for custom field types

diff --git a/lib/RT/CustomField_Overlay.pm b/lib/RT/CustomField_Overlay.pm
index cd51b22..4458836 100755
--- a/lib/RT/CustomField_Overlay.pm
+++ b/lib/RT/CustomField_Overlay.pm
@@ -57,6 +57,7 @@ use RT::ObjectCustomFieldValues;
 
 our %FieldTypes = (
     Select => {
+        sort_order => 10,
         selection_type => 1,
 
         labels => [ 'Select multiple values',      # loc
@@ -79,6 +80,7 @@ our %FieldTypes = (
 
     },
     Freeform => {
+        sort_order => 20,
         selection_type => 0,
 
         labels => [ 'Enter multiple values',       # loc
@@ -86,23 +88,8 @@ our %FieldTypes = (
                     'Enter up to [_1] values',     # loc
                   ]
                 },
-    IPAddress => {
-        selection_type => 0,
-
-        labels => [ 'Enter multiple IP addresses',       # loc
-                    'Enter one IP address',             # loc
-                    'Enter up to [_1] IP addresses',     # loc
-                  ]
-                },
-    IPAddressRange => {
-        selection_type => 0,
-
-        labels => [ 'Enter multiple IP address ranges',       # loc
-                    'Enter one IP address range',             # loc
-                    'Enter up to [_1] IP address ranges',     # loc
-                  ]
-                },
     Text => {
+        sort_order => 30,
         selection_type => 0,
         labels         => [
                     'Fill in multiple text areas',      # loc
@@ -111,6 +98,7 @@ our %FieldTypes = (
                   ]
             },
     Wikitext => {
+        sort_order => 40,
         selection_type => 0,
         labels         => [
                     'Fill in multiple wikitext areas',      # loc
@@ -118,7 +106,9 @@ our %FieldTypes = (
                     'Fill in up to [_1] wikitext areas',    # loc
                   ]
                 },
+
     Image => {
+        sort_order => 50,
         selection_type => 0,
         labels         => [
                     'Upload multiple images',               # loc
@@ -127,6 +117,7 @@ our %FieldTypes = (
                   ]
              },
     Binary => {
+        sort_order => 60,
         selection_type => 0,
         labels         => [
                     'Upload multiple files',                # loc
@@ -134,7 +125,9 @@ our %FieldTypes = (
                     'Upload up to [_1] files',              # loc
                   ]
               },
+
     Combobox => {
+        sort_order => 70,
         selection_type => 1,
         labels         => [
                     'Combobox: Select or enter multiple values',      # loc
@@ -143,6 +136,7 @@ our %FieldTypes = (
                   ]
                 },
     Autocomplete => {
+        sort_order => 80,
         selection_type => 1,
         labels         => [
                     'Enter multiple values with autocompletion',      # loc
@@ -150,7 +144,9 @@ our %FieldTypes = (
                     'Enter up to [_1] values with autocompletion',    # loc
                   ]
     },
+
     Date => {
+        sort_order => 90,
         selection_type => 0,
         labels         => [
                     'Select multiple dates',                          # loc
@@ -159,6 +155,7 @@ our %FieldTypes = (
                   ]
             },
     DateTime => {
+        sort_order => 100,
         selection_type => 0,
         labels         => [
                     'Select multiple datetimes',                      # loc
@@ -166,6 +163,25 @@ our %FieldTypes = (
                     'Select up to [_1] datetimes',                    # loc
                   ]
                 },
+
+    IPAddress => {
+        sort_order => 110,
+        selection_type => 0,
+
+        labels => [ 'Enter multiple IP addresses',       # loc
+                    'Enter one IP address',             # loc
+                    'Enter up to [_1] IP addresses',     # loc
+                  ]
+                },
+    IPAddressRange => {
+        sort_order => 120,
+        selection_type => 0,
+
+        labels => [ 'Enter multiple IP address ranges',       # loc
+                    'Enter one IP address range',             # loc
+                    'Enter up to [_1] IP address ranges',     # loc
+                  ]
+                },
 );
 
 
@@ -594,7 +610,7 @@ Retuns an array of the types of CustomField that are supported
 =cut
 
 sub Types {
-    return (keys %FieldTypes);
+    return (sort {(($FieldTypes{$a}{sort_order}||999) <=> ($FieldTypes{$b}{sort_order}||999)) or ($a cmp $b)} keys %FieldTypes);
 }
 
 
diff --git a/share/html/Admin/Elements/SelectCustomFieldType b/share/html/Admin/Elements/SelectCustomFieldType
index d065eb6..fa1f8ca 100755
--- a/share/html/Admin/Elements/SelectCustomFieldType
+++ b/share/html/Admin/Elements/SelectCustomFieldType
@@ -52,7 +52,7 @@
 </select>
 <%INIT>
 my $cf = RT::CustomField->new($session{'CurrentUser'});
-
+$Default = "Freeform-1" if $Default eq "-0";
 </%INIT>
 <%ARGS>
 $Default=>undef

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


More information about the Rt-commit mailing list