[Rt-commit] r10572 - in rt/branches/3.999-DANGEROUS/lib/RT: . Condition ScripAction Search

ruz at bestpractical.com ruz at bestpractical.com
Tue Jan 29 19:12:44 EST 2008


Author: ruz
Date: Tue Jan 29 19:12:44 2008
New Revision: 10572

Modified:
   rt/branches/3.999-DANGEROUS/lib/RT/Condition/Generic.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Condition/UserDefined.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Plugin.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Record.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Reminders.pm
   rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/CreateTickets.pm
   rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/ResolveMembers.pm
   rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm
   rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/UserDefined.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Search/ActiveTicketsInQueue.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Search/Googleish.pm
   rt/branches/3.999-DANGEROUS/lib/RT/SearchBuilder.pm
   rt/branches/3.999-DANGEROUS/lib/RT/StyleGuide.pod
   rt/branches/3.999-DANGEROUS/lib/RT/Test.pm
   rt/branches/3.999-DANGEROUS/lib/RT/URI/fsck_com_rt.pm

Log:
* lower method calls in libs

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Condition/Generic.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Condition/Generic.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Condition/Generic.pm	Tue Jan 29 19:12:44 2008
@@ -60,7 +60,7 @@
 		argument => $arg, 
 		Type => $type);
 
-    if ($foo->IsApplicable) {
+    if ($foo->is_applicable) {
  	   # do something
     }
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Condition/UserDefined.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Condition/UserDefined.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Condition/UserDefined.pm	Tue Jan 29 19:12:44 2008
@@ -62,7 +62,7 @@
 
 sub is_applicable {
     my $self   = shift;
-    my $retval = eval $self->scrip_obj->CustomIsApplicableCode;
+    my $retval = eval $self->scrip_obj->custom_is_applicable_code;
     if ($@) {
         Jifty->log->error(
             "Scrip " . $self->scrip_obj->id . " IsApplicable failed: " . $@ );

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Plugin.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Plugin.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Plugin.pm	Tue Jan 29 19:12:44 2008
@@ -52,7 +52,7 @@
 sub component_root {
     my $self = shift;
 
-    return $self->_BasePath . "/html";
+    return $self->_base_path . "/html";
 }
 
 =head2 PoDir
@@ -63,7 +63,7 @@
 
 sub po_dir {
     my $self = shift;
-    return $self->_BasePath . "/po";
+    return $self->_base_path . "/po";
 
 }
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Record.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Record.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Record.pm	Tue Jan 29 19:12:44 2008
@@ -337,7 +337,7 @@
     delete $self->{'attributes'};
 
     return $self->SUPER::load_by_cols(@_)
-        ;    # unless $self->_Handle->case_sensitive;
+        ;    # unless $self->_handle->case_sensitive;
 
     # If this database is case sensitive we need to uncase objects for
     # explicit loading
@@ -370,7 +370,7 @@
     my $self = shift;
     my $obj  = RT::Date->new();
 
-    $obj->set( Format => 'sql', value => $self->LastUpdated );
+    $obj->set( Format => 'sql', value => $self->last_updated );
     return $obj;
 }
 
@@ -382,7 +382,7 @@
     my $self = shift;
     my $obj  = RT::Date->new();
 
-    $obj->set( Format => 'sql', value => $self->Created );
+    $obj->set( Format => 'sql', value => $self->created );
 
     return $obj;
 }
@@ -406,7 +406,7 @@
 
 sub last_updated_as_string {
     my $self = shift;
-    if ( $self->LastUpdated ) {
+    if ( $self->last_updated ) {
         return ( $self->last_updated_obj->as_string() );
 
     } else {
@@ -433,7 +433,7 @@
 #
 sub long_since_update_as_string {
     my $self = shift;
-    if ( $self->LastUpdated ) {
+    if ( $self->last_updated ) {
 
         return ( $self->last_updated_obj->age_as_string() );
 
@@ -542,7 +542,7 @@
     unless ( exists $self->{'creator_obj'} ) {
 
         $self->{'creator_obj'} = RT::Model::User->new;
-        $self->{'creator_obj'}->load( $self->Creator );
+        $self->{'creator_obj'}->load( $self->creator );
     }
     return ( $self->{'creator_obj'} );
 }
@@ -561,7 +561,7 @@
     my $self = shift;
     unless ( exists $self->{LastUpdatedByObj} ) {
         $self->{'LastUpdatedByObj'} = RT::Model::User->new;
-        $self->{'LastUpdatedByObj'}->load( $self->LastUpdatedBy );
+        $self->{'LastUpdatedByObj'}->load( $self->last_updated_by );
     }
     return $self->{'LastUpdatedByObj'};
 }
@@ -1439,7 +1439,7 @@
     }
 
     if ( $cf->can('validate_Value') ) {
-        unless ( $cf->validate_Value( $args{'Value'} ) ) {
+        unless ( $cf->validate_value( $args{'Value'} ) ) {
             return ( 0, _("Invalid value for custom field") );
         }
     }
@@ -1456,7 +1456,7 @@
 # used to be a multiple and we have many values to whack....
         my $cf_values = $values->count;
 
-        if ( $cf_values > $cf->MaxValues ) {
+        if ( $cf_values > $cf->max_values ) {
             my $i = 0
                 ; #We want to delete all but the max we can currently have , so we can then
                   # execute the same code to "change" the value from old to new

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Reminders.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Reminders.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Reminders.pm	Tue Jan 29 19:12:44 2008
@@ -69,7 +69,7 @@
     my $self = shift;
     unless ( $self->{'_ticketobj'} ) {
         $self->{'_ticketobj'} = RT::Model::Ticket->new;
-        $self->{'_ticketobj'}->load( $self->Ticket );
+        $self->{'_ticketobj'}->load( $self->ticket );
     }
     return $self->{'_ticketobj'};
 }
@@ -88,7 +88,7 @@
         = 'Queue = "'
         . $self->ticket_obj->queue_obj->name
         . '" AND type = "reminder"';
-    $query .= ' AND RefersTo = "' . $self->Ticket . '"';
+    $query .= ' AND RefersTo = "' . $self->ticket . '"';
 
     $col->from_sql($query);
 
@@ -124,7 +124,7 @@
         Due      => $args{'Due'},
         RefersTo => $self->ticket,
         type     => 'reminder',
-        Queue    => $self->ticket_obj->Queue,
+        Queue    => $self->ticket_obj->queue,
 
     );
     $self->ticket_obj->_new_transaction(

Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/CreateTickets.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/CreateTickets.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/CreateTickets.pm	Tue Jan 29 19:12:44 2008
@@ -391,7 +391,7 @@
         }
 
         Jifty->log->debug("Assigned $template_id with $id");
-        $T::Tickets{$template_id}->set_OriginObj( $self->ticket_obj )
+        $T::Tickets{$template_id}->set_origin_obj( $self->ticket_obj )
             if $self->ticket_obj
                 && $T::Tickets{$template_id}->can('SetOriginObj');
 
@@ -1033,14 +1033,14 @@
     my $t    = shift;
 
     my $string;
-    $string .= "Queue: " . $t->Queue . "\n";
+    $string .= "Queue: " . $t->queue . "\n";
     $string .= "Subject: " . $t->subject . "\n";
     $string .= "Status: " . $t->status . "\n";
     $string .= "Due: " . $t->due_obj->unix . "\n";
     $string .= "starts: " . $t->starts_obj->unix . "\n";
     $string .= "Started: " . $t->started_obj->unix . "\n";
     $string .= "Resolved: " . $t->resolved_obj->unix . "\n";
-    $string .= "Owner: " . $t->Owner . "\n";
+    $string .= "Owner: " . $t->owner . "\n";
     $string .= "Requestor: " . $t->requestor_addresses . "\n";
     $string .= "Cc: " . $t->cc_addresses . "\n";
     $string .= "AdminCc: " . $t->admin_cc_addresses . "\n";

Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/ResolveMembers.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/ResolveMembers.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/ResolveMembers.pm	Tue Jan 29 19:12:44 2008
@@ -92,7 +92,7 @@
         my $base = RT::Model::Ticket->new( $self->ticket_obj->current_user );
 
         # Todo: Only work if Base is a plain ticket num:
-        $base->load( $Link->Base );
+        $base->load( $Link->base );
 
     # I'm afraid this might be a major bottleneck if ResolveGroupTicket is on.
         $base->resolve;

Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm	Tue Jan 29 19:12:44 2008
@@ -88,7 +88,7 @@
 sub clean_slate {
     my $self = shift;
     $self->squelch_mail_to(undef);
-    $self->AttachTickets(undef);
+    $self->attach_tickets(undef);
 }
 
 =head2 Commit
@@ -396,7 +396,7 @@
         type     => $attach->content_type,
         Charset  => $attach->original_encoding,
         Data     => $attach->original_content,
-        Filename => defined( $attach->Filename )
+        Filename => defined( $attach->filename )
         ? $self->mime_encode_string( $attach->filename,
             RT->config->get('EmailOutputEncoding') )
         : undef,
@@ -435,7 +435,7 @@
 
 sub add_tickets {
     my $self = shift;
-    $self->add_ticket($_) foreach $self->AttachTickets;
+    $self->add_ticket($_) foreach $self->attach_tickets;
     return;
 }
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/UserDefined.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/UserDefined.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/UserDefined.pm	Tue Jan 29 19:12:44 2008
@@ -61,7 +61,7 @@
 
 sub prepare {
     my $self   = shift;
-    my $retval = eval $self->scrip_obj->CustomPrepareCode;
+    my $retval = eval $self->scrip_obj->custom_prepare_code;
     if ($@) {
         Jifty->log->error(
             "Scrip " . $self->scrip_obj->id . " Prepare failed: " . $@ );
@@ -78,7 +78,7 @@
 
 sub commit {
     my $self   = shift;
-    my $retval = eval $self->scrip_obj->CustomCommitCode;
+    my $retval = eval $self->scrip_obj->custom_commit_code;
     if ($@) {
         Jifty->log->error(
             "Scrip " . $self->scrip_obj->id . " Commit failed: " . $@ );

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Search/ActiveTicketsInQueue.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Search/ActiveTicketsInQueue.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Search/ActiveTicketsInQueue.pm	Tue Jan 29 19:12:44 2008
@@ -80,7 +80,7 @@
 sub prepare {
     my $self = shift;
 
-    $self->tickets_obj->limit_queue( value => $self->Argument );
+    $self->tickets_obj->limit_queue( value => $self->argument );
 
     foreach my $status ( RT::Model::Queue->active_status_array() ) {
         $self->tickets_obj->limit_status( value => $status );

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Search/Googleish.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Search/Googleish.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Search/Googleish.pm	Tue Jan 29 19:12:44 2008
@@ -161,7 +161,7 @@
     for my $queue ( @{ $self->{'Queues'} } ) {
         my $queue_obj = RT::Model::Queue->new(
             current_user => $self->tickets_obj->current_user );
-        $queue_obj->Load($queue) or next;
+        $queue_obj->load($queue) or next;
         push @queue_clauses, "Queue = '" . $queue_obj->name . "'";
     }
 
@@ -179,7 +179,7 @@
 # {{{ sub prepare
 sub prepare {
     my $self = shift;
-    my $tql  = $self->query_to_sql( $self->Argument );
+    my $tql  = $self->query_to_sql( $self->argument );
 
     Jifty->log->fatal($tql);
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/SearchBuilder.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/SearchBuilder.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/SearchBuilder.pm	Tue Jan 29 19:12:44 2008
@@ -282,7 +282,7 @@
     my $items = shift;
 
     if ( $self->new_item()->can('SortOrder') ) {
-        $items = [ sort { $a->SortOrder <=> $b->SortOrder } @{$items} ];
+        $items = [ sort { $a->sort_order <=> $b->sort_order } @{$items} ];
     } elsif ( $self->new_item()->can('name') ) {
         $items = [ sort { lc( $a->name ) cmp lc( $b->name ) } @{$items} ];
     }

Modified: rt/branches/3.999-DANGEROUS/lib/RT/StyleGuide.pod
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/StyleGuide.pod	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/StyleGuide.pod	Tue Jan 29 19:12:44 2008
@@ -511,8 +511,8 @@
 		my $obj = new Constructor;
 		my($var1, $var2);
 
-		$obj->set_Foo($val);
-		$var1 = $obj->Foo();
+		$obj->set_foo($val);
+		$var1 = $obj->foo();
 
 
 		return($val);
@@ -802,9 +802,9 @@
 
 When returning or localizing a single string, the "extra" set of parenthesis () should be omitted.
 
-The code  	return ("subject changed to ". $self->Data );
+The code  	return ("subject changed to ". $self->data );
 
-should become	 return _( "subject changed to %1", $self->Data );
+should become	 return _( "subject changed to %1", $self->data );
 
 
 It is important not to localize  the names of rights or statuses within RT's core, as there is logic that depends on them as string identifiers.  The proper place to localize these values is when they're presented for display in the web or commandline interfaces.

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Test.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Test.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Test.pm	Tue Jan 29 19:12:44 2008
@@ -18,6 +18,7 @@
     $class->SUPER::import(@_);
     $class->_setup_config(%args);
     RT::init_system_objects();
+    $class->load_test_configs;
 }
 
 sub _setup_config {
@@ -31,6 +32,8 @@
     print $config qq{
 set( \$WebPort , $port);
 set( \$WebBaseURL , "http://localhost:\$WebPort");
+set( \$LogToScreen , "debug");
+set( \$LogStackTraces , "warning");
 };
     print $config $args{'config'} if $args{'config'};
     print $config "\n1;\n";
@@ -57,6 +60,7 @@
         Jifty->log->warn($existing_server);
         return ( $existing_server, RT::Test::Web->new );
     }
+        Jifty->log->error("bla");
     my $server = Jifty::Test->make_server;
     $RT::Test::server_url = $server->started_ok . "/";
 
@@ -142,7 +146,7 @@
         );
         $gms->limit( column => 'MemberId', value => $obj->id );
         while ( my $group_member_record = $gms->next ) {
-            $group_member_record->Delete;
+            $group_member_record->delete;
         }
     }
 
@@ -197,7 +201,7 @@
 
     # fake construction
     RT::ACE->new( current_user => RT->system_user );
-    my @fields = keys %{ RT::ACE->_ClassAccessible };
+    my @fields = keys %{ RT::ACE->_class_accessible };
 
     require RT::ACL;
     my $acl = RT::ACL->new( current_user => RT->system_user );

Modified: rt/branches/3.999-DANGEROUS/lib/RT/URI/fsck_com_rt.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/URI/fsck_com_rt.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/URI/fsck_com_rt.pm	Tue Jan 29 19:12:44 2008
@@ -219,7 +219,7 @@
 
 sub as_string {
     my $self = shift;
-    if ( $self->is_local && $self->Object ) {
+    if ( $self->is_local && $self->object ) {
         return _( "%1 #%2", $self->object_type, $self->object->id );
     } else {
         return $self->uri;


More information about the Rt-commit mailing list