[Rt-commit] rt branch, 4.0/mobile-fix, created. rt-4.0.1rc1-12-g3c1d7ad
? sunnavy
sunnavy at bestpractical.com
Tue Jun 7 03:13:48 EDT 2011
The branch, 4.0/mobile-fix has been created
at 3c1d7ad1d95e475245ec4aea377704f4e2c54b1e (commit)
- Log -----------------------------------------------------------------
commit b1bc1f797a792b099ac93cc7c83e35e4c1e39958
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Jun 7 13:00:45 2011 +0800
html cleanup
diff --git a/share/html/m/ticket/create b/share/html/m/ticket/create
index 5ddb6b8..d476739 100644
--- a/share/html/m/ticket/create
+++ b/share/html/m/ticket/create
@@ -323,7 +323,7 @@ $showrows->(
loc("Admin Cc") =>
$m->scomp( "/Elements/EmailInput", Name => 'AdminCc', Size => '40', Default => $ARGS{AdminCc} )
- . '<span class="comment" colspan="2"><i><font size="-2">'
+ . '<span class="comment"><i><font size="-2">'
. loc(
"(Sends a carbon-copy of this update to a comma-delimited list of administrative email addresses. These people <strong>will</strong> receive future updates.)"
)
@@ -355,8 +355,7 @@ $m->scomp("/Ticket/Elements/EditTransactionCustomFields", %ARGS, QueueObj => $Qu
$showrows->(
loc("Attach file") =>
- '<div class="value" colspan="5">
-<input type="file" name="Attach" />
+ '<input type="file" name="Attach" />
<input type="submit" class="button" name="AddMoreAttach" value="' . loc("Add More Files") . '" />'
);
</%perl>
commit 70f449a1a26c41c98284d4c19dfc58568ee55388
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Jun 7 13:01:53 2011 +0800
attachments support on reply with mobile ui
diff --git a/share/html/m/ticket/reply b/share/html/m/ticket/reply
index 4aadfe3..682270b 100644
--- a/share/html/m/ticket/reply
+++ b/share/html/m/ticket/reply
@@ -109,6 +109,28 @@
<& /Elements/MessageBox, Name=>"UpdateContent", IncludeSignature => $IncludeSignature, %ARGS &>
% }
</div></div>
+
+</%perl>
+% if (exists $session{'Attachments'}) {
+
+<%loc("Attached file") %>
+
+<%loc("Check box to delete")%><br />
+% foreach my $attach_name (keys %{$session{'Attachments'}}) {
+<input type="checkbox" class="checkbox" name="DeleteAttach-<%$attach_name%>" value="1" /><%$attach_name%><br />
+% } # end of foreach
+
+
+% } # end of if
+
+<div class="entry">
+<span class="label"><&|/l&>Attach file</&>:</span>
+<div class="value">
+<input type="file" name="Attach" />
+<input type="submit" class="button" name="AddMoreAttach" value="<% loc("Add More Files") %>" />
+</div>
+</div>
+
<& /Elements/Submit, Label => loc('Update Ticket'), Name => 'SubmitTicket' &>
</form>
</&>
@@ -183,7 +205,9 @@ if ($ARGS{'Attach'}) { # attachment?
}
# delete temporary storage entry to make WebUI clean
-unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) {
+unless ( keys %{ $session{'Attachments'} }
+ && ( exists $ARGS{'AddMoreAttach'} || exists $ARGS{'SubmitTicket'} ) )
+{
delete $session{'Attachments'};
}
commit 91a5c78eeb36ae1bccb81f944523b93fbd86d78a
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Jun 7 13:15:49 2011 +0800
attachments test for mobile ui
diff --git a/t/web/attachments.t b/t/web/attachments.t
index 6f175f6..8c75f6c 100644
--- a/t/web/attachments.t
+++ b/t/web/attachments.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;
-use RT::Test tests => 16;
+use RT::Test tests => 25;
use constant LogoFile => $RT::MasonComponentRoot .'/NoAuth/images/bpslogo.png';
use constant FaviconFile => $RT::MasonComponentRoot .'/NoAuth/images/favicon.png';
@@ -45,3 +45,31 @@ is($m->status, 200, "request successful");
$m->content_contains('Download bpslogo.png', 'page has file name');
$m->content_contains('Download favicon.png', 'page has file name');
+
+diag "test mobile ui";
+$m->get_ok( $baseurl . '/m/ticket/create?Queue=' . $qid );
+
+$m->form_name('TicketCreate');
+$m->field('Subject', 'Attachments test');
+$m->field('Attach', LogoFile);
+$m->field('Content', 'Some content');
+$m->submit;
+is($m->status, 200, "request successful");
+
+$m->content_contains('Attachments test', 'we have subject on the page');
+$m->content_contains('bpslogo.png', 'page has file name');
+
+$m->follow_link_ok({text => 'Reply'}, "reply to the ticket");
+$m->form_name('TicketUpdate');
+$m->field('Attach', LogoFile);
+$m->click('AddMoreAttach');
+is($m->status, 200, "request successful");
+
+$m->form_name('TicketUpdate');
+$m->field('Attach', FaviconFile);
+$m->field('UpdateContent', 'Message');
+$m->click('SubmitTicket');
+is($m->status, 200, "request successful");
+
+$m->content_contains('bpslogo.png', 'page has file name');
+$m->content_contains('favicon.png', 'page has file name');
commit d317de46ae3a22f0512b46686586969cd0b0806f
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Jun 7 13:33:00 2011 +0800
support gnupg on reply with mobile ui
diff --git a/share/html/m/ticket/reply b/share/html/m/ticket/reply
index 682270b..9199dd0 100644
--- a/share/html/m/ticket/reply
+++ b/share/html/m/ticket/reply
@@ -55,6 +55,10 @@
<input type="hidden" class="hidden" name="DefaultStatus" value="<% $DefaultStatus ||''%>" />
<input type="hidden" class="hidden" name="Action" value="<% $ARGS{Action}||'' %>" />
+% if ($gnupg_widget) {
+<& /Elements/GnuPG/SignEncryptWidget:ShowIssues, self => $gnupg_widget &>
+% }
+
<div class="entry"><span class="label"><&|/l&>Status</&>:</span>
<div class="value">
<& /Elements/SelectStatus, Name=>"Status", TicketObj => $t, DefaultLabel => loc("[_1] (Unchanged)", loc($t->Status)), Default => $ARGS{'Status'} || ($t->Status eq $DefaultStatus ? undef : $DefaultStatus)&>
@@ -131,6 +135,10 @@
</div>
</div>
+% if ( $gnupg_widget ) {
+%$m->scomp("/Elements/GnuPG/SignEncryptWidget", self => $gnupg_widget, QueueObj => $t->QueueObj )
+% }
+
<& /Elements/Submit, Label => loc('Update Ticket'), Name => 'SubmitTicket' &>
</form>
</&>
@@ -227,7 +235,18 @@ unless ( keys %{ $session{'Attachments'} }
}
}
+my $gnupg_widget = $m->comp('/Elements/GnuPG/SignEncryptWidget:new', Arguments => \%ARGS );
+$m->comp( '/Elements/GnuPG/SignEncryptWidget:Process',
+ self => $gnupg_widget,
+ TicketObj => $t,
+);
+
if ( !$checks_failure && exists $ARGS{SubmitTicket} ) {
+ my $status = $m->comp('/Elements/GnuPG/SignEncryptWidget:Check',
+ self => $gnupg_widget,
+ TicketObj => $t,
+ );
+ $checks_failure = 1 unless $status;
return $m->comp('/m/ticket/show', TicketObj => $t, %ARGS);
}
</%INIT>
commit 3c1d7ad1d95e475245ec4aea377704f4e2c54b1e
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Jun 7 13:56:44 2011 +0800
scomp does *not* print the returned string
diff --git a/share/html/m/ticket/create b/share/html/m/ticket/create
index d476739..fc28c00 100644
--- a/share/html/m/ticket/create
+++ b/share/html/m/ticket/create
@@ -362,7 +362,7 @@ $showrows->(
% if ( $gnupg_widget ) {
-%$m->scomp("/Elements/GnuPG/SignEncryptWidget", self => $gnupg_widget, QueueObj => $QueueObj )
+<& /Elements/GnuPG/SignEncryptWidget, self => $gnupg_widget, QueueObj => $QueueObj &>
% }
diff --git a/share/html/m/ticket/reply b/share/html/m/ticket/reply
index 9199dd0..81373d5 100644
--- a/share/html/m/ticket/reply
+++ b/share/html/m/ticket/reply
@@ -136,7 +136,7 @@
</div>
% if ( $gnupg_widget ) {
-%$m->scomp("/Elements/GnuPG/SignEncryptWidget", self => $gnupg_widget, QueueObj => $t->QueueObj )
+<& /Elements/GnuPG/SignEncryptWidget, self => $gnupg_widget, QueueObj => $t->QueueObj &>
% }
<& /Elements/Submit, Label => loc('Update Ticket'), Name => 'SubmitTicket' &>
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list