[Rt-commit] r10488 - in rtir/branches/2.3-EXPERIMENTAL/html/RTIR: .
ruz at bestpractical.com
ruz at bestpractical.com
Thu Jan 24 20:13:36 EST 2008
Author: ruz
Date: Thu Jan 24 20:13:31 2008
New Revision: 10488
Added:
rtir/branches/2.3-EXPERIMENTAL/html/RTIR/GnuPG.html
Modified:
rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Display.html
rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Display.html
Log:
* add html/RTIR/GnuPG.html
Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Display.html
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Display.html (original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Display.html Thu Jan 24 20:13:31 2008
@@ -198,13 +198,14 @@
</tr>
</table>
<& /Ticket/Elements/ShowHistory,
- Ticket => $Ticket,
- Collapsed => $ARGS{'Collapsed'},
- ShowHeaders => $ARGS{'ShowHeaders'},
- DisplayPath => RT->Config->Get('WebPath') ."/RTIR/Display.html?id=$id",
- UpdatePath => RT->Config->Get('WebPath') ."/RTIR/Update.html",
- ForwardPath => RT->Config->Get('WebPath') ."/RTIR/Forward.html",
- WarnUnsigned => 1,
+ Ticket => $Ticket,
+ Collapsed => $ARGS{'Collapsed'},
+ ShowHeaders => $ARGS{'ShowHeaders'},
+ DisplayPath => RT->Config->Get('WebPath') ."/RTIR/Display.html?id=$id",
+ UpdatePath => RT->Config->Get('WebPath') ."/RTIR/Update.html",
+ ForwardPath => RT->Config->Get('WebPath') ."/RTIR/Forward.html",
+ EncryptionPath => RT->Config->Get('WebPath') ."/RTIR/GnuPG.html",
+ WarnUnsigned => 1,
&>
<%INIT>
my ($name);
Added: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/GnuPG.html
==============================================================================
--- (empty file)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/GnuPG.html Thu Jan 24 20:13:31 2008
@@ -0,0 +1,63 @@
+<& /RTIR/Elements/Header, Title => $title &>
+<& "/RTIR/".$Type."/Elements/Tabs",
+ Ticket => $ticket,
+ current_tab => 'RTIR/Display.html?id='.$ticket->id,
+ current_subtab => 'RTIR/Display.html?id='.$ticket->id,
+ Title => $title,
+&>
+
+% $m->callback( CallbackName => 'BeforeActionList', %ARGS, Actions => \@results, ARGSRef => \%ARGS );
+<& /Elements/ListActions, actions => \@results &>
+<form method="post" action="<% RT->Config->Get('WebPath') . $m->request_comp->path %>">
+<a href="<% RT->Config->Get('WebURL') %>/RTIR/Display.html?id=<% $ticket->id %>#txn-<% $id %>">
+<% loc('Return back to the ticket') %>
+</a>
+<& /Elements/Submit,
+ Label => ($encrypted? loc('Decrypt'): loc('Encrypt')),
+ Name => ($encrypted? 'Decrypt': 'Encrypt'),
+&>
+</form>
+<%ARGS>
+$id => undef
+$Encrypt => 0
+$Decrypt => 0
+</%ARGS>
+<%INIT>
+my $txn = RT::Transaction->new( $session{'CurrentUser'} );
+$txn->Load( $id );
+unless ( $txn->id ) {
+ Abort(loc("Couldn't load transaction #[_1]", $id));
+}
+$id = $txn->id;
+
+my $ticket = $txn->TicketObj;
+
+my $Type = RT::IR::TicketType( Ticket => $ticket );
+return $m->comp( '/Ticket/GnuPG.html', %ARGS ) unless $Type;
+
+my @results;
+
+my $encrypted = 0;
+
+my $attachments = $txn->Attachments;
+while ( my $attachment = $attachments->Next ) {
+ next unless $attachment->ContentType =~ m{^x-application-rt/gpg-encrypted\b};
+ $encrypted = 1;
+ last;
+}
+$attachments->GotoFirstItem;
+
+if ( $Encrypt || $Decrypt ) {
+ my $done = 1;
+ while ( my $attachment = $attachments->Next ) {
+ my ($status, $msg) = $Decrypt? $attachment->Decrypt : $attachment->Encrypt;
+ push @results, $msg;
+ unless ( $status ) {
+ $done = 0; last;
+ }
+ }
+ $encrypted = !$encrypted if $done;
+}
+
+my $title = loc("Encrypt/Decrypt transaction #[_1] of ticket #[_2]", $id, $ticket->id);
+</%INIT>
Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Display.html
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Display.html (original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Display.html Thu Jan 24 20:13:31 2008
@@ -184,12 +184,13 @@
</td></tr></table>
<& /Ticket/Elements/ShowHistory,
- Ticket => $TicketObj,
- Collapsed => $ARGS{'Collapsed'},
- ShowHeaders => $ARGS{'ShowHeaders'},
- DisplayPath => RT->Config->Get('WebPath') ."/RTIR/Display.html?id=$id",
- UpdatePath => RT->Config->Get('WebPath') ."/RTIR/Update.html",
- ForwardPath => RT->Config->Get('WebPath') ."/RTIR/Forward.html",
+ Ticket => $TicketObj,
+ Collapsed => $ARGS{'Collapsed'},
+ ShowHeaders => $ARGS{'ShowHeaders'},
+ DisplayPath => RT->Config->Get('WebPath') ."/RTIR/Display.html?id=$id",
+ UpdatePath => RT->Config->Get('WebPath') ."/RTIR/Update.html",
+ ForwardPath => RT->Config->Get('WebPath') ."/RTIR/Forward.html",
+ EncryptionPath => RT->Config->Get('WebPath') ."/RTIR/GnuPG.html",
&>
<%INIT>
More information about the Rt-commit
mailing list