[Rt-commit] rtir branch, 2.9-trunk, updated. 2.6.1rc1-380-g693f072

Ruslan Zakirov ruz at bestpractical.com
Tue Sep 6 12:21:06 EDT 2011


The branch, 2.9-trunk has been updated
       via  693f07234894c096ac530253f6b437a7f5c7767a (commit)
       via  761860448c387debe973449ffb8278c4fe641666 (commit)
       via  abb4e86833fa6e9188180e6f10b9f303c3fed256 (commit)
       via  91ff014acd2f3fe9b81e5c6e996c9464274483ca (commit)
       via  d9876b845ba81123f6a49116dfe69eb6da854ca9 (commit)
      from  1e27969b79e8ffb2a3b4b16d66cfdb77916ac96f (commit)

Summary of changes:
 TODO.porting_over_RT4                              |    6 ---
 html/RTIR/Create.html                              |    2 -
 html/RTIR/Elements/ShowArticles                    |    2 +-
 html/RTIR/Incident/Reply/index.html                |    4 +-
 .../LinkArticles.html => Link/Articles.html}       |    2 +-
 t/009-attachments-processing.t                     |   38 +++++++++++++++++++-
 6 files changed, 41 insertions(+), 13 deletions(-)
 rename html/RTIR/{Incident/LinkArticles.html => Link/Articles.html} (98%)

- Log -----------------------------------------------------------------
commit d9876b845ba81123f6a49116dfe69eb6da854ca9
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Tue Sep 6 15:11:37 2011 +0400

    move LinkArticles.html into more natural location
    
    it's not only about incidents

diff --git a/TODO.porting_over_RT4 b/TODO.porting_over_RT4
index c58f46c..f6b1369 100644
--- a/TODO.porting_over_RT4
+++ b/TODO.porting_over_RT4
@@ -34,8 +34,6 @@
 
 * make Submit buttons names consistent with RT's
 
-* move html/RTIR/Incident/LinkArticles.html -> html/RTIR/Link/Articles.html
-
 * html/RTIR/Forward.html still uses plain inputs for addresses
 
 * re-use CSS squishing
diff --git a/html/RTIR/Elements/ShowArticles b/html/RTIR/Elements/ShowArticles
index f062925..e933955 100644
--- a/html/RTIR/Elements/ShowArticles
+++ b/html/RTIR/Elements/ShowArticles
@@ -36,7 +36,7 @@ if ( $Ticket->CurrentUserHasRight('ModifyTicket') ) {
     );
     $box_actions = join ' 'x3,
         qq{<a href="$web_path/Articles/Article/PreCreate.html?$qs">}. loc('Create') .q{</a>},
-        qq{<a href="$web_path/RTIR/Incident/LinkArticles.html?id=$id">}. loc('Link') .q{</a>},
+        qq{<a href="$web_path/RTIR/Link/Articles.html?id=$id">}. loc('Link') .q{</a>},
     ;
 }
 </%INIT>
diff --git a/html/RTIR/Incident/LinkArticles.html b/html/RTIR/Link/Articles.html
similarity index 98%
rename from html/RTIR/Incident/LinkArticles.html
rename to html/RTIR/Link/Articles.html
index acec7da..b9c9293 100644
--- a/html/RTIR/Incident/LinkArticles.html
+++ b/html/RTIR/Link/Articles.html
@@ -28,7 +28,7 @@
 &>
 <& /Elements/Tabs &>
 
-<form action="LinkArticles.html" method="get">
+<form action="Articles.html" method="get">
 <input type="hidden" name="id" value="<%$id%>" />
 
 Search: <input type="text" name="search" value="<% $search %>" />

commit 91ff014acd2f3fe9b81e5c6e996c9464274483ca
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Tue Sep 6 20:08:20 2011 +0400

    new RT's code handles ok undef subject and body

diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index eb4ba58..5bc7deb 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -514,8 +514,6 @@ foreach my $field ( 'Attach', 'Attachment' ) {
     $filename =~ s{^.*[\\/]}{};
 
     my $entity = MakeMIMEEntity(
-        Subject             => $filename,
-        Body                => '',
         AttachmentFieldName => $field,
     );
     $session{'Attachments'}{ $filename } = $entity;

commit abb4e86833fa6e9188180e6f10b9f303c3fed256
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Tue Sep 6 20:09:43 2011 +0400

    we moved comp, adjust relative call

diff --git a/html/RTIR/Incident/Reply/index.html b/html/RTIR/Incident/Reply/index.html
index 1fbc0de..3a27428 100644
--- a/html/RTIR/Incident/Reply/index.html
+++ b/html/RTIR/Incident/Reply/index.html
@@ -183,7 +183,7 @@ if ( $SubmitTicket && !$checks_failure ) {
     );
     push @{ $session{'Actions'}{''} ||= [] }, @results;
     # NOTE: don't pass %ARGS further as we've done everything we need here
-    return $m->comp("Display.html", %$pass, id => $id);
+    return $m->comp("../Display.html", %$pass, id => $id);
 }
 
 # XXX, BLOODY-DIRTY-EVIL HACK: when we load the page first time we should

commit 761860448c387debe973449ffb8278c4fe641666
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Tue Sep 6 20:16:41 2011 +0400

    we upload attachments, so it should POST

diff --git a/html/RTIR/Incident/Reply/index.html b/html/RTIR/Incident/Reply/index.html
index 3a27428..b1c78b6 100644
--- a/html/RTIR/Incident/Reply/index.html
+++ b/html/RTIR/Incident/Reply/index.html
@@ -28,7 +28,7 @@
 % $m->callback(CallbackName => 'BeforeActionList', Actions => \@results, ARGSRef => \%ARGS, Ticket => $IncidentObj);
 <& /Elements/ListActions, actions => \@results &>
 
-<form action="index.html" name="TicketUpdate" method="get">
+<form action="index.html" name="TicketUpdate" method="post" enctype="multipart/form-data">
 <input type="hidden" name="id" value="<% $id %>" />
 <input type="hidden" name="Status" value="<% $Status %>" />
 <input type="hidden" name="All" value="<% $All %>" />

commit 693f07234894c096ac530253f6b437a7f5c7767a
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Tue Sep 6 20:20:30 2011 +0400

    test attaching files on reply via Incident

diff --git a/TODO.porting_over_RT4 b/TODO.porting_over_RT4
index f6b1369..6c14af5 100644
--- a/TODO.porting_over_RT4
+++ b/TODO.porting_over_RT4
@@ -57,7 +57,3 @@
 * Constituency has special treating on edit depending on constituency propagation mode
 ** These two custom fields are still massaged via callback and RTIR has special editor
 
-=== TESTS
-
-* add tests to make sure attachments attached to all selected Children when
-  replying via Incident
diff --git a/t/009-attachments-processing.t b/t/009-attachments-processing.t
index 430f7ad..ed415d5 100644
--- a/t/009-attachments-processing.t
+++ b/t/009-attachments-processing.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::IR::Test tests => 55;
+use RT::IR::Test tests => 77;
 
 RT::Test->started_ok;
 my $agent = default_agent();
@@ -191,3 +191,39 @@ $agent->goto_create_rtir_ticket('Blocks');
     unlink $filename or die "couldn't delete file '$filename': $!";
 }
 
+# incident reply page, make sure attachments attached to all tickets
+{
+
+    my $inc_id = $agent->create_incident( {Subject => "ir1 for merging"} );
+    my $ir1_id = $agent->create_ir( {Subject => "ir1 for merging", Incident => $inc_id} );
+    my $ir2_id = $agent->create_ir( {Subject => "ir1 for merging", Incident => $inc_id} );
+
+    $agent->display_ticket( $inc_id);
+    $agent->follow_link_ok({text => 'Reply to Reporters'}, "go to 'Reply'");
+
+    my $content = "this is test";
+    my $filename = tempfile($content);
+    $agent->form_number(3);
+    $agent->field('Attach', $filename);
+    $agent->click('AddMoreAttach');
+    is($agent->status, 200, "request successful");
+    $agent->content_like( qr/\Q$filename/, "has file name on the page");
+
+    $agent->form_number(3);
+    ok($agent->value('SubmitTicket'), "we still on the create page");
+    $agent->click('SubmitTicket');
+    is($agent->status, 200, "request successful");
+
+    foreach my $tid ( $ir1_id, $ir2_id ) {
+        $agent->display_ticket( $tid );
+        my $attachment_link = $agent->find_link(
+            tag       => 'a',
+            url_regex => qr/\Q$filename/,
+            text      => "Download $filename",
+        );
+        ok($attachment_link, "has link to attachment");
+    }
+
+    unlink $filename or die "couldn't delete file '$filename': $!";
+}
+

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


More information about the Rt-commit mailing list