[Rt-commit] rt branch, 4.0/current-user-outdated-email-name-fix, created. rt-4.0.1rc1-5-ga882b3d

? sunnavy sunnavy at bestpractical.com
Tue May 24 03:43:14 EDT 2011


The branch, 4.0/current-user-outdated-email-name-fix has been created
        at  a882b3d4a5453d1d83a977f74a7ad3fe83acc9dd (commit)

- Log -----------------------------------------------------------------
commit be826107fb772bf5661940f95feac4884aad0f95
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue May 24 13:15:43 2011 +0800

    $session{CurrentUser}'s EmailAddress and Name may be out of date.

diff --git a/share/html/Elements/QuickCreate b/share/html/Elements/QuickCreate
index 40941d6..d442055 100644
--- a/share/html/Elements/QuickCreate
+++ b/share/html/Elements/QuickCreate
@@ -68,7 +68,7 @@
 </tr>
 <tr class="input-row">
     <td class="label"><&|/l&>Requestors</&>:</td>
-    <td colspan="3" class="value"><& /Elements/EmailInput, Name => 'Requestors', Size => '40', Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress &></td>
+    <td colspan="3" class="value"><& /Elements/EmailInput, Name => 'Requestors', Size => '40', Default => $ARGS{Requestors} || $session{CurrentUser}->UserObj->EmailAddress &></td>
 </tr>
 <tr class="input-row">
 <td class="labeltop"><&|/l&>Content</&>:</td>
diff --git a/share/html/REST/1.0/Forms/ticket/default b/share/html/REST/1.0/Forms/ticket/default
index 48aec8b..6ee7035 100755
--- a/share/html/REST/1.0/Forms/ticket/default
+++ b/share/html/REST/1.0/Forms/ticket/default
@@ -107,7 +107,7 @@ else {
             {
                 id               => "ticket/new",
                 Queue            => $queue->Name,
-                Requestor        => $session{CurrentUser}->Name,
+                Requestor        => $session{CurrentUser}->UserObj->Name,
                 Subject          => "",
                 Cc               => [],
                 AdminCc          => [],
@@ -162,7 +162,7 @@ else {
         if ($text) {
             $v{MIMEObj} =
                 MIME::Entity->build(
-                    From => $session{CurrentUser}->EmailAddress,
+                    From => $session{CurrentUser}->UserObj->EmailAddress,
                     Subject => $v{Subject},
                     Data => $text
                 );
diff --git a/share/html/SelfService/Create.html b/share/html/SelfService/Create.html
index ec86fb7..7862f74 100755
--- a/share/html/SelfService/Create.html
+++ b/share/html/SelfService/Create.html
@@ -67,7 +67,7 @@
 <&|/l&>Requestors</&>:
 </td>
 <td class="value">
-<& /Elements/EmailInput, Name => 'Requestors', Size => '20', Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress &>
+<& /Elements/EmailInput, Name => 'Requestors', Size => '20', Default => $ARGS{Requestors} || $session{CurrentUser}->UserObj->EmailAddress &>
 </td>
 </tr>
 <tr>
diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index fb70c2b..2b9e7e4 100755
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -116,7 +116,7 @@
 <&|/l&>Requestors</&>:
 </td>
 <td class="value" colspan="5">
-<& /Elements/EmailInput, Name => 'Requestors', Size => undef, Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress &>
+<& /Elements/EmailInput, Name => 'Requestors', Size => undef, Default => $ARGS{Requestors} || $session{CurrentUser}->UserObj->EmailAddress &>
 % $m->callback( CallbackName => 'AfterRequestors', QueueObj => $QueueObj, ARGSRef => \%ARGS );
 </td>
 </tr>
diff --git a/share/html/m/ticket/create b/share/html/m/ticket/create
index 5ddb6b8..970f85f 100644
--- a/share/html/m/ticket/create
+++ b/share/html/m/ticket/create
@@ -308,7 +308,7 @@ $showrows->(
         "/Elements/EmailInput",
         Name    => 'Requestors',
         Size    => '40',
-        Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress
+        Default => $ARGS{Requestors} || $session{CurrentUser}->UserObj->EmailAddress
     ),
 
     loc("Cc") =>

commit e89e4badb8fe4603696b230821f1931f091eca4b
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue May 24 15:16:10 2011 +0800

    extra query support so we can set Requestors, Subject, etc via url

diff --git a/lib/RT/Test/Web.pm b/lib/RT/Test/Web.pm
index 3be1b85..f86b972 100644
--- a/lib/RT/Test/Web.pm
+++ b/lib/RT/Test/Web.pm
@@ -161,6 +161,8 @@ sub goto_ticket {
 sub goto_create_ticket {
     my $self = shift;
     my $queue = shift;
+    my $query = shift || '';
+    $query = '&' . $query if $query && $query !~ /^&/;
 
     my $id;
     if ( ref $queue ) {
@@ -171,7 +173,8 @@ sub goto_create_ticket {
         die "not yet implemented";
     }
 
-    $self->get($self->rt_base_url . 'Ticket/Create.html?Queue='.$id);
+    $self->get(
+        $self->rt_base_url . 'Ticket/Create.html?Queue=' . $id . $query );
 
     return 1;
 }

commit a882b3d4a5453d1d83a977f74a7ad3fe83acc9dd
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue May 24 15:19:14 2011 +0800

    set Requestors explicitly since now we use user's up to date email

diff --git a/t/web/crypt-gnupg.t b/t/web/crypt-gnupg.t
index 6bdefda..ab1e62f 100644
--- a/t/web/crypt-gnupg.t
+++ b/t/web/crypt-gnupg.t
@@ -51,7 +51,7 @@ $m->submit;
 
 RT::Test->clean_caught_mails;
 
-$m->goto_create_ticket( $queue );
+$m->goto_create_ticket( $queue, 'Requestors=recipient at example.com' );
 $m->form_name('TicketCreate');
 $m->field('Subject', 'Encryption test');
 $m->field('Content', 'Some content');
@@ -120,7 +120,7 @@ $m->submit;
 
 RT::Test->clean_caught_mails;
 
-$m->goto_create_ticket( $queue );
+$m->goto_create_ticket( $queue, 'Requestors=recipient at example.com' );
 $m->form_name('TicketCreate');
 $m->field('Subject', 'Signing test');
 $m->field('Content', 'Some other content');
@@ -193,7 +193,7 @@ $m->submit;
 RT::Test->clean_caught_mails;
 
 
-$m->goto_create_ticket( $queue );
+$m->goto_create_ticket( $queue, 'Requestors=recipient at example.com' );
 $m->form_name('TicketCreate');
 $m->field('Subject', 'Crypt+Sign test');
 $m->field('Content', 'Some final? content');
@@ -258,7 +258,7 @@ MAIL
 
 RT::Test->clean_caught_mails;
 
-$m->goto_create_ticket( $queue );
+$m->goto_create_ticket( $queue, 'Requestors=recipient at example.com' );
 $m->form_name('TicketCreate');
 $m->field('Subject', 'Test crypt-off on encrypted queue');
 $m->field('Content', 'Thought you had me figured out didya');

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


More information about the Rt-commit mailing list