[Rt-commit] r16311 - in rt/branches/3.999-DANGEROUS: lib/RT lib/RT/Model lib/RT/ScripAction share/html/REST/1.0/Forms/ticket share/html/REST/1.0/ticket share/html/Ticket/Elements t/api

ruz at bestpractical.com ruz at bestpractical.com
Fri Oct 17 04:05:29 EDT 2008


Author: ruz
Date: Fri Oct 17 04:05:29 2008
New Revision: 16311

Modified:
   rt/branches/3.999-DANGEROUS/lib/RT/Dispatcher.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripActionCollection.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripConditionCollection.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/Transaction.pm
   rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordComment.pm
   rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordCorrespondence.pm
   rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm
   rt/branches/3.999-DANGEROUS/share/html/REST/1.0/Forms/ticket/history
   rt/branches/3.999-DANGEROUS/share/html/REST/1.0/ticket/comment
   rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/ShowTransaction
   rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/ShowTransactionAttachments
   rt/branches/3.999-DANGEROUS/t/api/ticket.t
   rt/branches/3.999-DANGEROUS/t/mail/gateway.t

Log:
* lower case more txn types

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Dispatcher.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Dispatcher.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Dispatcher.pm	Fri Oct 17 04:05:29 2008
@@ -60,7 +60,6 @@
 
 before qr/.*/ => run {
     RT::init_system_objects();
-
 };
 
 before qr/.*/ => run {

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripActionCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripActionCollection.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripActionCollection.pm	Fri Oct 17 04:05:29 2008
@@ -88,7 +88,7 @@
     $self->limit(
         entry_aggregator => 'OR',
         column           => 'type',
-        value            => "Correspond"
+        value            => "correspond"
     ) if $type eq "Create";
     $self->limit(
         entry_aggregator => 'OR',

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripConditionCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripConditionCollection.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripConditionCollection.pm	Fri Oct 17 04:05:29 2008
@@ -89,7 +89,7 @@
     $self->limit(
         entry_aggregator => 'OR',
         column           => 'type',
-        value            => "Correspond"
+        value            => "correspond"
     ) if $type eq "Create";
     $self->limit(
         entry_aggregator => 'OR',

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm	Fri Oct 17 04:05:29 2008
@@ -1212,7 +1212,7 @@
 
 =head2 transaction_addresses
 
-Returns a composite hashref of the results of L<RT::Model::Transaction/Addresses> for all this ticket's Create, comment or Correspond transactions.
+Returns a composite hashref of the results of L<RT::Model::Transaction/Addresses> for all this ticket's Create, comment or correspond transactions.
 The keys are C<To>, C<cc> and C<Bcc>. The values are lists of C<Email::Address> objects.
 
 NOTE: For performance reasons, this method might want to skip transactions and go straight for attachments. But to make that work right, we're going to need to go and walk around the access control in Attachment.pm's sub _value.
@@ -1224,7 +1224,7 @@
     my $txns = $self->transactions;
 
     my %addresses = ();
-    foreach my $type (qw(Create comment Correspond)) {
+    foreach my $type (qw(Create comment correspond)) {
         $txns->limit(
             column           => 'type',
             operator         => '=',
@@ -1631,7 +1631,7 @@
         return ( 0, _("Permission Denied"), undef );
     }
 
-    $args{'note_type'} = 'Correspond';
+    $args{'note_type'} = 'correspond';
     if ( $args{'dry_run'} ) {
         Jifty->handle->begin_transaction();
         $args{'commit_scrips'} = 0;
@@ -1670,7 +1670,7 @@
         sign           => undef,
         mime_obj       => undef,
         content        => undef,
-        note_type      => 'Correspond',
+        note_type      => 'correspond',
         time_taken     => 0,
         commit_scrips  => 1,
         @_
@@ -2591,7 +2591,7 @@
 
     my $txns = $self->transactions;
     $txns->limit( column => 'type',    value    => 'comment' );
-    $txns->limit( column => 'type',    value    => 'Correspond' );
+    $txns->limit( column => 'type',    value    => 'correspond' );
     $txns->limit( column => 'creator', operator => '!=', value => $uid );
     $txns->limit(
         column   => 'created',
@@ -2878,7 +2878,7 @@
                 subclause        => 'acl',
                 column           => 'type',
                 operator         => '!=',
-                value            => "CommentEmailRecord",
+                value            => "comment_email_record",
                 entry_aggregator => 'AND'
             );
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Transaction.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Transaction.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Transaction.pm	Fri Oct 17 04:05:29 2008
@@ -736,7 +736,7 @@
 
     if ( $type eq 'Create' ) {
         return ( _( "%1 Created", $obj_type ) );
-    } elsif ( $type =~ /Status/ ) {
+    } elsif ( $type =~ /Status/i ) {
         if ( $self->field eq 'Status' ) {
             if ( $self->new_value eq 'deleted' ) {
                 return ( _( "%1 deleted", $obj_type ) );
@@ -1040,13 +1040,13 @@
         unless ( $self->current_user_has_right('ShowTicketcomments') ) {
             return 0;
         }
-    } elsif ( $type eq 'CommentEmailRecord' ) {
+    } elsif ( $type eq 'comment_email_record' ) {
         unless ( $self->current_user_has_right('ShowTicketcomments')
             && $self->current_user_has_right('ShowOutgoingEmail') )
         {
             return 0;
         }
-    } elsif ( $type eq 'EmailRecord' ) {
+    } elsif ( $type eq 'email_record' ) {
         unless ( $self->current_user_has_right('ShowOutgoingEmail') ) {
             return 0;
         }

Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordComment.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordComment.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordComment.pm	Fri Oct 17 04:05:29 2008
@@ -70,7 +70,7 @@
 =head2 prepare
 
 Check for the existence of a Transaction.  If a Transaction already
-exists, and is of type "comment" or "Correspond", abort because that
+exists, and is of type "comment" or "correspond", abort because that
 will give us a loop.
 
 =cut

Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordCorrespondence.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordCorrespondence.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordCorrespondence.pm	Fri Oct 17 04:05:29 2008
@@ -71,7 +71,7 @@
 =head2 prepare
 
 Check for the existence of a Transaction.  If a Transaction already
-exists, and is of type "comment" or "Correspond", abort because that
+exists, and is of type "comment" or "correspond", abort because that
 will give us a loop.
 
 =cut
@@ -88,9 +88,9 @@
 
 =head2 commit
 
-Create a Transaction by calling the ticket's Correspond method on our
+Create a Transaction by calling the ticket's correspond method on our
 parsed Template, which may have an RT-Send-Cc or RT-Send-Bcc header.
-The Transaction will be of type Correspond.  This Transaction can then
+The Transaction will be of type correspond.  This Transaction can then
 be used by the scrips that actually send the email.
 
 =cut

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	Fri Oct 17 04:05:29 2008
@@ -435,7 +435,7 @@
 
 Each ticket is attached as multipart entity and all its messages and attachments
 are attached as sub entities in order of creation, but only if transaction type
-is Create or Correspond.
+is Create or correspond.
 
 =cut
 
@@ -454,7 +454,7 @@
     $attachs->limit(
         alias  => $txn_alias,
         column => 'type',
-        value  => 'Correspond'
+        value  => 'correspond'
     );
     $attachs->limit_by_ticket($tid);
     $attachs->limit_not_empty;
@@ -512,9 +512,9 @@
 
     my $type;
     if ( $self->transaction_obj->type eq 'comment' ) {
-        $type = 'CommentEmailRecord';
+        $type = 'comment_email_record';
     } else {
-        $type = 'EmailRecord';
+        $type = 'email_record';
     }
 
     my $msgid = $mime_obj->head->get('Message-ID');

Modified: rt/branches/3.999-DANGEROUS/share/html/REST/1.0/Forms/ticket/history
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/REST/1.0/Forms/ticket/history	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/REST/1.0/Forms/ticket/history	Fri Oct 17 04:05:29 2008
@@ -84,7 +84,7 @@
 }
 
 if ($type) {
-    # Create, Set, Status, Correspond, comment, Give, Steal, Take, Told
+    # Create, Set, Status, correspond, comment, Give, Steal, Take, Told
     # CustomField, add_link, DeleteLink, AddWatcher, del_watcher
     if ($args =~ /^links?$/) {
         $trans->limit(column => 'type', operator => 'LIKE', value => '%Link');

Modified: rt/branches/3.999-DANGEROUS/share/html/REST/1.0/ticket/comment
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/REST/1.0/ticket/comment	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/REST/1.0/ticket/comment	Fri Oct 17 04:05:29 2008
@@ -150,7 +150,7 @@
 unless ($ticket->current_user_has_right('ModifyTicket') ||
         ($action eq "comment" &&
          $ticket->current_user_has_right("CommentOnTicket")) ||
-        ($action eq "Correspond" &&
+        ($action eq "correspond" &&
          $ticket->current_user_has_right("ReplyToTicket")))
 {
     $output = "You are not allowed to $action on ticket $object.\n";

Modified: rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/ShowTransaction
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/ShowTransaction	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/ShowTransaction	Fri Oct 17 04:05:29 2008
@@ -105,7 +105,7 @@
 
 my %class = (
     Create     => 'message',
-    Correspond => 'message',
+    correspond => 'message',
     comment    => 'message',
 
     AddWatcher => 'people',
@@ -162,7 +162,7 @@
 }
 my $titlebar_commands = '';
 
-if ( $type =~ /EmailRecord$/ ) {
+if ( $type =~ /email_record$/ ) {
 
     $titlebar_commands .=
         "[<a target=\"_blank\" href=\"$email_record_path?id="

Modified: rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/ShowTransactionAttachments
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/ShowTransactionAttachments	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/ShowTransactionAttachments	Fri Oct 17 04:05:29 2008
@@ -177,7 +177,7 @@
 </%ARGS>
 <%INIT>
 my @display_headers=qw(_all);
-if ( $transaction->type =~ /EmailRecord$/ ) {
+if ( $transaction->type =~ /email_record$/ ) {
     @display_headers = qw(To Cc Bcc);
 }
 

Modified: rt/branches/3.999-DANGEROUS/t/api/ticket.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/api/ticket.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/api/ticket.t	Fri Oct 17 04:05:29 2008
@@ -206,7 +206,7 @@
 $txns->order_by(column => 'id', order => 'DESC');
 $txns->limit(column => 'object_id', value => '1');
 $txns->limit(column => 'object_type', value => 'RT::Model::Ticket');
-$txns->limit(column => 'type', operator => '!=',  value => 'EmailRecord');
+$txns->limit(column => 'type', operator => '!=',  value => 'email_record');
 
 my $give  = $txns->first;
 is($give->type, 'Give');

Modified: rt/branches/3.999-DANGEROUS/t/mail/gateway.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/mail/gateway.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/mail/gateway.t	Fri Oct 17 04:05:29 2008
@@ -160,7 +160,7 @@
 
     my $transactions = $tick->transactions;
     $transactions->order_by({ column => 'id', order => 'DESC' });
-    $transactions->limit( column => 'type', operator => '!=', value => 'EmailRecord');
+    $transactions->limit( column => 'type', operator => '!=', value => 'email_record');
     my $txn = $transactions->first;
     isa_ok ($txn, 'RT::Model::Transaction');
     is ($txn->type, 'Create', "correct type");
@@ -194,7 +194,7 @@
 
     my $transactions = $tick->transactions;
     $transactions->order_by({ column => 'id', order => 'DESC' });
-    $transactions->limit( column => 'type', operator => '!=', value => 'EmailRecord');
+    $transactions->limit( column => 'type', operator => '!=', value => 'email_record');
     my $txn = $transactions->first;
     isa_ok ($txn, 'RT::Model::Transaction');
     is ($txn->type, 'Create', "correct type");
@@ -357,10 +357,10 @@
 
     my $transactions = $tick->transactions;
     $transactions->order_by({ column => 'id', order => 'DESC' });
-    $transactions->limit( column => 'type', operator => '!=', value => 'EmailRecord');
+    $transactions->limit( column => 'type', operator => '!=', value => 'email_record');
     my $txn = $transactions->first;
     isa_ok ($txn, 'RT::Model::Transaction');
-    is ($txn->type, 'Correspond', "correct type");
+    is ($txn->type, 'correspond', "correct type");
 
     my $attachment = $txn->attachments->first;
     isa_ok ($attachment, 'RT::Model::Attachment');
@@ -440,7 +440,7 @@
     $transactions->limit(
         column => 'type',
         operator => 'NOT ENDSWITH',
-        value => 'EmailRecord',
+        value => 'email_record',
         entry_aggregator => 'AND',
     );
     my $txn = $transactions->first;
@@ -670,7 +670,7 @@
 is( $tick->id, $id, "load correct ticket #$id");
 is( $tick->owner_obj->email, 'root at localhost', 'successfuly take ticket via email');
 my $txns = $tick->transactions;
-$txns->limit( column => 'type', value => 'Correspond');
+$txns->limit( column => 'type', value => 'correspond');
 $txns->order_by( column => 'id', order => 'DESC' );
 # +1 because of auto open
 is( $tick->transactions->count, 6, 'no superfluous transactions');


More information about the Rt-commit mailing list