[Rt-commit] [svn] r1725 - in rt: . branches/3.3-TESTING/lib/RT branches/3.3-TESTING/sbin

autrijus at pallas.eruditorum.org autrijus at pallas.eruditorum.org
Sun Nov 7 09:22:08 EST 2004


Author: autrijus
Date: Sun Nov  7 09:22:06 2004
New Revision: 1725

Modified:
   rt/   (props changed)
   rt/branches/3.3-TESTING/lib/RT/CustomFieldValues.pm
   rt/branches/3.3-TESTING/lib/RT/CustomFields.pm
   rt/branches/3.3-TESTING/lib/RT/ObjectCustomFieldValue.pm
   rt/branches/3.3-TESTING/lib/RT/ObjectCustomFieldValue_Overlay.pm
   rt/branches/3.3-TESTING/lib/RT/ObjectCustomFieldValues.pm
   rt/branches/3.3-TESTING/lib/RT/ObjectCustomFieldValues_Overlay.pm
   rt/branches/3.3-TESTING/lib/RT/ObjectCustomFields.pm
   rt/branches/3.3-TESTING/sbin/factory
Log:
 r10251 at not:  autrijus | 2004-11-06T10:17:29.202899Z
 * fallouts from the OCFV schema change.
 
 


Modified: rt/branches/3.3-TESTING/lib/RT/CustomFieldValues.pm
==============================================================================
--- rt/branches/3.3-TESTING/lib/RT/CustomFieldValues.pm	(original)
+++ rt/branches/3.3-TESTING/lib/RT/CustomFieldValues.pm	Sun Nov  7 09:22:06 2004
@@ -83,10 +83,15 @@
 
 
 
-  # By default, order by name
-  $self->OrderBy( ALIAS => 'main',
-                  FIELD => 'SortOrder',
-                  ORDER => 'ASC');
+  # By default, order by SortOrder
+  $self->OrderByCols(
+	 { ALIAS => 'main',
+	   FIELD => 'SortOrder',
+	   ORDER => 'ASC' },
+	 { ALIAS => 'main',
+	   FIELD => 'id',
+	   ORDER => 'ASC' },
+     );
 
     return ( $self->SUPER::_Init(@_) );
 }

Modified: rt/branches/3.3-TESTING/lib/RT/CustomFields.pm
==============================================================================
--- rt/branches/3.3-TESTING/lib/RT/CustomFields.pm	(original)
+++ rt/branches/3.3-TESTING/lib/RT/CustomFields.pm	Sun Nov  7 09:22:06 2004
@@ -83,10 +83,15 @@
 
 
 
-  # By default, order by name
-  $self->OrderBy( ALIAS => 'main',
-                  FIELD => 'SortOrder',
-                  ORDER => 'ASC');
+  # By default, order by SortOrder
+  $self->OrderByCols(
+	 { ALIAS => 'main',
+	   FIELD => 'SortOrder',
+	   ORDER => 'ASC' },
+	 { ALIAS => 'main',
+	   FIELD => 'id',
+	   ORDER => 'ASC' },
+     );
 
     return ( $self->SUPER::_Init(@_) );
 }

Modified: rt/branches/3.3-TESTING/lib/RT/ObjectCustomFieldValue.pm
==============================================================================
--- rt/branches/3.3-TESTING/lib/RT/ObjectCustomFieldValue.pm	(original)
+++ rt/branches/3.3-TESTING/lib/RT/ObjectCustomFieldValue.pm	Sun Nov  7 09:22:06 2004
@@ -91,11 +91,12 @@
   int(11) 'CustomField'.
   varchar(255) 'ObjectType'.
   int(11) 'ObjectId'.
-  tinyint(1) 'Current' defaults to '1'.
+  int(11) 'SortOrder'.
   varchar(255) 'Content'.
   longtext 'LargeContent'.
   varchar(80) 'ContentType'.
   varchar(80) 'ContentEncoding'.
+  smallint(6) 'Disabled'.
 
 =cut
 
@@ -108,22 +109,24 @@
                 CustomField => '0',
                 ObjectType => '',
                 ObjectId => '0',
-                Current => '1',
+                SortOrder => '0',
                 Content => '',
                 LargeContent => '',
                 ContentType => '',
                 ContentEncoding => '',
+                Disabled => '0',
 
 		  @_);
     $self->SUPER::Create(
                          CustomField => $args{'CustomField'},
                          ObjectType => $args{'ObjectType'},
                          ObjectId => $args{'ObjectId'},
-                         Current => $args{'Current'},
+                         SortOrder => $args{'SortOrder'},
                          Content => $args{'Content'},
                          LargeContent => $args{'LargeContent'},
                          ContentType => $args{'ContentType'},
                          ContentEncoding => $args{'ContentEncoding'},
+                         Disabled => $args{'Disabled'},
 );
 
 }
@@ -207,19 +210,19 @@
 =cut
 
 
-=head2 Current
+=head2 SortOrder
 
-Returns the current value of Current. 
-(In the database, Current is stored as tinyint(1).)
+Returns the current value of SortOrder. 
+(In the database, SortOrder is stored as int(11).)
 
 
 
-=head2 SetCurrent VALUE
+=head2 SetSortOrder VALUE
 
 
-Set Current to VALUE. 
+Set SortOrder to VALUE. 
 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Current will be stored as a tinyint(1).)
+(In the database, SortOrder will be stored as a int(11).)
 
 
 =cut
@@ -333,6 +336,24 @@
 =cut
 
 
+=head2 Disabled
+
+Returns the current value of Disabled. 
+(In the database, Disabled is stored as smallint(6).)
+
+
+
+=head2 SetDisabled VALUE
+
+
+Set Disabled to VALUE. 
+Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
+(In the database, Disabled will be stored as a smallint(6).)
+
+
+=cut
+
+
 
 sub _CoreAccessible {
     {
@@ -345,8 +366,8 @@
 		{read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
         ObjectId => 
 		{read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
-        Current => 
-		{read => 1, write => 1, sql_type => -6, length => 1,  is_blob => 0,  is_numeric => 1,  type => 'tinyint(1)', default => '1'},
+        SortOrder => 
+		{read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
         Content => 
 		{read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
         LargeContent => 
@@ -363,6 +384,8 @@
 		{read => 1, auto => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
         LastUpdated => 
 		{read => 1, auto => 1, sql_type => 11, length => 0,  is_blob => 0,  is_numeric => 0,  type => 'datetime', default => ''},
+        Disabled => 
+		{read => 1, write => 1, sql_type => 5, length => 6,  is_blob => 0,  is_numeric => 1,  type => 'smallint(6)', default => '0'},
 
  }
 };

Modified: rt/branches/3.3-TESTING/lib/RT/ObjectCustomFieldValue_Overlay.pm
==============================================================================
--- rt/branches/3.3-TESTING/lib/RT/ObjectCustomFieldValue_Overlay.pm	(original)
+++ rt/branches/3.3-TESTING/lib/RT/ObjectCustomFieldValue_Overlay.pm	Sun Nov  7 09:22:06 2004
@@ -53,7 +53,7 @@
                 CustomField => '0',
                 ObjectType => '',
                 ObjectId => '0',
-                Current => '1',
+                Disabled => '0',
                 Content => '',
                 LargeContent => '',
                 ContentType => '',
@@ -65,7 +65,7 @@
                          CustomField => $args{'CustomField'},
                          ObjectType => $args{'ObjectType'},
                          ObjectId => $args{'ObjectId'},
-                         Current => $args{'Current'},
+                         Disabled => $args{'Disabled'},
                          Content => $args{'Content'},
                          LargeContent => $args{'LargeContent'},
                          ContentType => $args{'ContentType'},
@@ -131,7 +131,7 @@
 
 sub Delete {
     my $self = shift;
-    $self->SetCurrent(0);
+    $self->SetDisabled(1);
 }
 
 1;

Modified: rt/branches/3.3-TESTING/lib/RT/ObjectCustomFieldValues.pm
==============================================================================
--- rt/branches/3.3-TESTING/lib/RT/ObjectCustomFieldValues.pm	(original)
+++ rt/branches/3.3-TESTING/lib/RT/ObjectCustomFieldValues.pm	Sun Nov  7 09:22:06 2004
@@ -82,6 +82,17 @@
     $self->{'primary_key'} = 'id';
 
 
+
+  # By default, order by SortOrder
+  $self->OrderByCols(
+	 { ALIAS => 'main',
+	   FIELD => 'SortOrder',
+	   ORDER => 'ASC' },
+	 { ALIAS => 'main',
+	   FIELD => 'id',
+	   ORDER => 'ASC' },
+     );
+
     return ( $self->SUPER::_Init(@_) );
 }
 

Modified: rt/branches/3.3-TESTING/lib/RT/ObjectCustomFieldValues_Overlay.pm
==============================================================================
--- rt/branches/3.3-TESTING/lib/RT/ObjectCustomFieldValues_Overlay.pm	(original)
+++ rt/branches/3.3-TESTING/lib/RT/ObjectCustomFieldValues_Overlay.pm	Sun Nov  7 09:22:06 2004
@@ -124,7 +124,7 @@
     
     #unless we really want to find disabled rows, make sure we\'re only finding enabled ones.
     unless($self->{'find_expired_rows'}) {
-        $self->LimitToCurrent();
+        $self->LimitToEnabled();
     }
     
     return($self->SUPER::_DoSearch(@_));
@@ -136,20 +136,12 @@
     
     #unless we really want to find disabled rows, make sure we\'re only finding enabled ones.
     unless($self->{'find_expired_rows'}) {
-        $self->LimitToCurrent();
+        $self->LimitToEnabled();
     }
     
     return($self->SUPER::_DoCount(@_));
     
 }
 
-sub LimitToCurrent {
-    my $self = shift;
-    
-    $self->Limit( FIELD => 'Current',
-		  VALUE => '1',
-		  OPERATOR => '=' );
-}
-
 1;
 

Modified: rt/branches/3.3-TESTING/lib/RT/ObjectCustomFields.pm
==============================================================================
--- rt/branches/3.3-TESTING/lib/RT/ObjectCustomFields.pm	(original)
+++ rt/branches/3.3-TESTING/lib/RT/ObjectCustomFields.pm	Sun Nov  7 09:22:06 2004
@@ -83,10 +83,15 @@
 
 
 
-  # By default, order by name
-  $self->OrderBy( ALIAS => 'main',
-                  FIELD => 'SortOrder',
-                  ORDER => 'ASC');
+  # By default, order by SortOrder
+  $self->OrderByCols(
+	 { ALIAS => 'main',
+	   FIELD => 'SortOrder',
+	   ORDER => 'ASC' },
+	 { ALIAS => 'main',
+	   FIELD => 'id',
+	   ORDER => 'ASC' },
+     );
 
     return ( $self->SUPER::_Init(@_) );
 }

Modified: rt/branches/3.3-TESTING/sbin/factory
==============================================================================
--- rt/branches/3.3-TESTING/sbin/factory	(original)
+++ rt/branches/3.3-TESTING/sbin/factory	Sun Nov  7 09:22:06 2004
@@ -349,10 +349,15 @@
 
         $CollectionClass .= "
 
-  # By default, order by name
-  \$self->OrderBy( ALIAS => 'main',
-                  FIELD => 'SortOrder',
-                  ORDER => 'ASC');
+  # By default, order by SortOrder
+  \$self->OrderByCols(
+	 { ALIAS => 'main',
+	   FIELD => 'SortOrder',
+	   ORDER => 'ASC' },
+	 { ALIAS => 'main',
+	   FIELD => 'id',
+	   ORDER => 'ASC' },
+     );
 ";
     }
     $CollectionClass .= "


More information about the Rt-commit mailing list