[Rt-commit] rtir branch, 3.0/history-in-click, created. 2.6.1rc1-260-g0f3addc
Ruslan Zakirov
ruz at bestpractical.com
Tue Aug 16 19:45:41 EDT 2011
The branch, 3.0/history-in-click has been created
at 0f3addc853cef80364c2e680e80586146b309b0f (commit)
- Log -----------------------------------------------------------------
commit 67bb3f52e20e8d745c8586e2e884521225af1ece
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Tue Aug 16 21:23:02 2011 +0400
put all txn recipients into the form
diff --git a/html/RTIR/Update.html b/html/RTIR/Update.html
index e4b82f6..400a695 100644
--- a/html/RTIR/Update.html
+++ b/html/RTIR/Update.html
@@ -92,6 +92,10 @@
<& /Ticket/Elements/ShowSimplifiedRecipients, %ARGS, TicketObj => $Ticket &>
+% if (my $recips = $m->notes("DryRun-Recipients-".$Ticket->Id)) {
+<input type="hidden" name="TxnRecipients" value="<% join ",",sort keys %{$recips} %>" />
+% }
+
<&|/Widgets/TitleBox, title => loc('Message'), class => 'messagedetails' &>
<table width="100%" border="0">
@@ -174,7 +178,7 @@ if ( $ARGS{'SubmitTicket'} ) {
if ( !$checks_failure && exists $ARGS{SubmitTicket} ) {
my %checked = map {$_ => 1} grep {defined} @TxnSendMailTo;
- my @squelchlist = grep {not $checked{$_}} split /,/, ($ARGS{'TxnRecipients'}||'');
+ my @squelchlist = grep {not $checked{$_}} split /,/, $TxnRecipients;
$ARGS{'SquelchMailTo'} = \@squelchlist if @squelchlist;
}
@@ -191,4 +195,5 @@ $id => undef
$DefaultStatus => undef
$Action => undef
@TxnSendMailTo => ()
+$TxnRecipients => ''
</%ARGS>
commit f47fe57d56bdbc306fa65592d047a7fd659db449
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Tue Aug 16 23:17:20 2011 +0400
align custom fields with other basics
diff --git a/html/RTIR/Display.html b/html/RTIR/Display.html
index 573020d..2b045ea 100644
--- a/html/RTIR/Display.html
+++ b/html/RTIR/Display.html
@@ -55,9 +55,10 @@
<td class="label"><&|/l&>Time Worked</&>:</td>
<td class="value"><%loc('[_1] min', $TimeWorked)%></td>
</tr>
-</table>
-<& /Elements/ShowCustomFields, Object => $Ticket &>
+ <& /Elements/ShowCustomFields, Object => $Ticket, Table => 0 &>
+
+</table>
</&>
diff --git a/html/RTIR/Incident/Display.html b/html/RTIR/Incident/Display.html
index 90a6c1c..21fc05c 100644
--- a/html/RTIR/Incident/Display.html
+++ b/html/RTIR/Incident/Display.html
@@ -61,9 +61,10 @@
<td class="label"><&|/l&>Time Worked</&>:</td>
<td class="value"><%loc('[_1] min', $TimeWorked)%></td>
</tr>
-</table>
-<& /Elements/ShowCustomFields, Object => $TicketObj &>
+ <& /Elements/ShowCustomFields, Object => $TicketObj, Table => 0 &>
+
+</table>
</&>
commit 977f4e279c0c7eb31ded44270288d9e328898b6d
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Wed Aug 17 01:56:49 2011 +0400
move actions into title box's top right corner
It's looks much nicer. Code is ugly, it should really
use Menu class and render as <ul> list.
diff --git a/html/RTIR/Display.html b/html/RTIR/Display.html
index 2b045ea..714e59f 100644
--- a/html/RTIR/Display.html
+++ b/html/RTIR/Display.html
@@ -62,20 +62,27 @@
</&>
+<%PERL>
+my $articles_actions = '';
+if ( $Ticket->CurrentUserHasRight('ModifyTicket') ) {
+ my $web_path = RT->Config->Get('WebPath');
+ my $qs = $m->comp("/Elements/QueryString",
+ "RefersTo-new" => "t:$id",
+ next => $web_path."/RTIR/Display.html?id=$id"
+ );
+ $articles_actions = join ' 'x3,
+ qq{<a href="$web_path/Articles/Article/PreCreate.html?$qs">}. loc('New') .q{</a>},
+ qq{<a href="$web_path/RTIR/Incident/LinkArticles.html?id=$id">}. loc('Link') .q{</a>},
+ ;
+}
+</%PERL>
<&| /Widgets/TitleBox,
title => loc("Articles"),
title_href => RT->Config->Get('WebPath') ."/RTIR/Advanced.html?id=".$id,
+ titleright_raw => $articles_actions,
class=> 'ticket-info-articles',
&>
-% if ($Ticket->CurrentUserHasRight('ModifyTicket')) {
-% my $qs = $m->comp("/Elements/QueryString", "RefersTo-new" => "t:$id", next => RT->Config->Get('WebPath')."/RTIR/Display.html?id=$id");
- <table width="100%"><tr><td align="right"><font size="-1">
- | <a href="<%RT->Config->Get('WebPath')%>/Articles/Article/PreCreate.html?<% $qs |n%>"><%loc('New')%></a>
- | <a href="<%RT->Config->Get('WebPath')%>/RTIR/Incident/LinkArticles.html?id=<%$id%>"><%loc("Link")%></a> |
- </font></td></tr></table>
-% }
-
<ul>
% while (my $Link = $Ticket->RefersTo->Next) {
% next unless UNIVERSAL::isa($Link->TargetURI->Object, "RT::Article");
diff --git a/html/RTIR/Incident/Display.html b/html/RTIR/Incident/Display.html
index 21fc05c..cfc23d9 100644
--- a/html/RTIR/Incident/Display.html
+++ b/html/RTIR/Incident/Display.html
@@ -107,20 +107,27 @@
</td><td class="boxcontainer" valign="top">
+<%PERL>
+my $articles_actions = '';
+if ( $TicketObj->CurrentUserHasRight('ModifyTicket') ) {
+ my $web_path = RT->Config->Get('WebPath');
+ my $qs = $m->comp("/Elements/QueryString",
+ "RefersTo-new" => "t:$id",
+ next => $web_path."/RTIR/Display.html?id=$id"
+ );
+ $articles_actions = join ' 'x3,
+ qq{<a href="$web_path/Articles/Article/PreCreate.html?$qs">}. loc('New') .q{</a>},
+ qq{<a href="$web_path/RTIR/Incident/LinkArticles.html?id=$id">}. loc('Link') .q{</a>},
+ ;
+}
+</%PERL>
<&| /Widgets/TitleBox,
title => loc("Articles"),
title_href => RT->Config->Get('WebPath') ."/RTIR/Advanced.html?id=".$id,
+ titleright_raw => $articles_actions,
class=> 'ticket-info-articles',
&>
-% if ($TicketObj->CurrentUserHasRight('ModifyTicket')) {
-% my $qs = $m->comp("/Elements/QueryString", "RefersTo-new" => "t:$id", next => RT->Config->Get('WebPath')."/RTIR/Display.html?id=$id");
- <table width="100%"><tr><td align="right"><font size="-1">
- | <a href="<%RT->Config->Get('WebPath')%>/Articles/Article/PreCreate.html?<% $qs |n%>"><%loc('New')%></a>
- | <a href="<%RT->Config->Get('WebPath')%>/RTIR/Incident/LinkArticles.html?id=<%$id%>"><%loc("Link")%></a> |
- </font></td></tr></table>
-% }
-
<ul>
% while (my $Link = $TicketObj->RefersTo->Next) {
% next unless UNIVERSAL::isa($Link->TargetURI->Object, "RT::Article");
diff --git a/html/RTIR/Incident/Elements/ShowChildren b/html/RTIR/Incident/Elements/ShowChildren
index e634518..b50c471 100644
--- a/html/RTIR/Incident/Elements/ShowChildren
+++ b/html/RTIR/Incident/Elements/ShowChildren
@@ -1,23 +1,10 @@
<&| /Widgets/TitleBox,
title => loc( $Queue ),
title_href => RT->Config->Get('WebPath') ."/RTIR/Incident/Children/?Queue=". $EscapedQueue ."&id=".$id,
- ( $total_count > $Rows
- ? ( titleright => loc("More... ([_1] total)", $total_count),
- titleright_href => RT->Config->Get('WebPath') ."/RTIR/Incident/Children/?Queue=". $EscapedQueue ."&id=".$id )
- : (),
- ),
+ titleright_raw => $box_actions,
class => 'tickets-list-'. lc(RT::IR::TicketType( Queue => $Queue )),
&>
-% if ( $IncidentObj->CurrentUserHasRight('ModifyTicket') ) {
- <table width="100%"><tr><td align="right"><font size="-1">
-% if ( $QueueObj->Id and $QueueObj->CurrentUserHasRight('CreateTicket') ) {
- | <a href="<%RT->Config->Get('WebPath')%>/RTIR/Create.html?Incident=<% $id %>&Queue=<% $Queue |u %>"><% $new_caption %></a>
-% }
- | <a href="<%RT->Config->Get('WebPath')%>/RTIR/Link/FromIncident/?id=<% $id %>&Queue=<% $Queue |u %>"><%loc("Link")%></a> |
- </font></td></tr></table>
-% }
-
<& /RTIR/Elements/ShowChildren,
Ticket => $IncidentObj,
Queue => $Queue,
@@ -48,7 +35,6 @@ $Rows => 8
return if $Queue eq 'Blocks' && RT->Config->Get('RTIR_DisableBlocksQueue');
my $id = $IncidentObj->id;
-my $new_caption = $Queue ne 'Investigations'? loc('New') : loc('Launch');
my $EscapedQueue = $m->interp->apply_escapes( $Queue, 'u' );
my @active_states = RT::IR::States( Queue => $Queue );
@@ -77,4 +63,29 @@ my $total_count = $active->CountAll + $inactive->CountAll;
my $QueueObj = RT::Queue->new($session{CurrentUser});
$QueueObj->Load($Queue);
+my @box_actions;
+if ( $IncidentObj->CurrentUserHasRight('ModifyTicket') ) {
+ if ( $QueueObj->Id and $QueueObj->CurrentUserHasRight('CreateTicket') ) {
+ push @box_actions, {
+ title => $QueueObj->Name ne 'Investigations'? loc('New') : loc('Launch'),
+ path => "/RTIR/Create.html?Incident=$id&Queue=$EscapedQueue",
+ };
+ }
+ push @box_actions, {
+ title => loc('Link'),
+ path => "/RTIR/Link/FromIncident/?id=$id&Queue=$EscapedQueue",
+ };
+}
+
+if ( $total_count > $Rows ) {
+ push @box_actions, {
+ title => loc("More... ([_1] total)", $total_count),
+ path => '/RTIR/Incident/Children/?Queue='. $EscapedQueue .'&id='. $id
+ };
+}
+my $box_actions = join ' 'x3,
+ map qq{<a href="}. RT->Config->Get('WebPath') . $_->{'path'} .q{">}
+ . $m->interp->apply_escapes( $_->{title}, 'h' ) . q{</a>},
+ @box_actions;
+
</%INIT>
commit 1f412a2374eeb04a2398da4adaf67a408ba30f13
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Wed Aug 17 02:11:45 2011 +0400
extract repeated code into ShowArticles
diff --git a/html/RTIR/Display.html b/html/RTIR/Display.html
index 714e59f..d46e2b7 100644
--- a/html/RTIR/Display.html
+++ b/html/RTIR/Display.html
@@ -62,35 +62,8 @@
</&>
-<%PERL>
-my $articles_actions = '';
-if ( $Ticket->CurrentUserHasRight('ModifyTicket') ) {
- my $web_path = RT->Config->Get('WebPath');
- my $qs = $m->comp("/Elements/QueryString",
- "RefersTo-new" => "t:$id",
- next => $web_path."/RTIR/Display.html?id=$id"
- );
- $articles_actions = join ' 'x3,
- qq{<a href="$web_path/Articles/Article/PreCreate.html?$qs">}. loc('New') .q{</a>},
- qq{<a href="$web_path/RTIR/Incident/LinkArticles.html?id=$id">}. loc('Link') .q{</a>},
- ;
-}
-</%PERL>
-<&| /Widgets/TitleBox,
- title => loc("Articles"),
- title_href => RT->Config->Get('WebPath') ."/RTIR/Advanced.html?id=".$id,
- titleright_raw => $articles_actions,
- class=> 'ticket-info-articles',
-&>
-
-<ul>
-% while (my $Link = $Ticket->RefersTo->Next) {
-% next unless UNIVERSAL::isa($Link->TargetURI->Object, "RT::Article");
-<li><a href="<%$Link->TargetURI->Resolver->HREF%>"><% $Link->TargetURI->Object->Name %></a></li>
-% }
-</ul>
+<& /RTIR/Elements/ShowArticles, Ticket => $Ticket &>
-</&>
</td> <td class="boxcontainer" valign="top">
% $m->callback( %ARGS, Ticket => $Ticket, CallbackName => 'RightColumnStart' );
diff --git a/html/RTIR/Elements/ShowArticles b/html/RTIR/Elements/ShowArticles
new file mode 100644
index 0000000..c736094
--- /dev/null
+++ b/html/RTIR/Elements/ShowArticles
@@ -0,0 +1,34 @@
+<&| /Widgets/TitleBox,
+ title => loc("Articles"),
+ title_href => RT->Config->Get('WebPath') ."/RTIR/Advanced.html?id=".$id,
+ titleright_raw => $box_actions,
+ class => 'ticket-info-articles',
+&>
+
+<ul>
+% while (my $Link = $Ticket->RefersTo->Next) {
+% next unless UNIVERSAL::isa($Link->TargetURI->Object, "RT::Article");
+<li><a href="<%$Link->TargetURI->Resolver->HREF%>"><% $Link->TargetURI->Object->Name %></a></li>
+% }
+</ul>
+
+</&>
+<%ARGS>
+$Ticket
+</%ARGS>
+<%INIT>
+my $id = $Ticket->id;
+
+my $box_actions = '';
+if ( $Ticket->CurrentUserHasRight('ModifyTicket') ) {
+ my $web_path = RT->Config->Get('WebPath');
+ my $qs = $m->comp("/Elements/QueryString",
+ "RefersTo-new" => "t:$id",
+ next => $web_path."/RTIR/Display.html?id=$id"
+ );
+ $box_actions = join ' 'x3,
+ qq{<a href="$web_path/Articles/Article/PreCreate.html?$qs">}. loc('New') .q{</a>},
+ qq{<a href="$web_path/RTIR/Incident/LinkArticles.html?id=$id">}. loc('Link') .q{</a>},
+ ;
+}
+</%INIT>
diff --git a/html/RTIR/Incident/Display.html b/html/RTIR/Incident/Display.html
index cfc23d9..7f2c78f 100644
--- a/html/RTIR/Incident/Display.html
+++ b/html/RTIR/Incident/Display.html
@@ -107,35 +107,8 @@
</td><td class="boxcontainer" valign="top">
-<%PERL>
-my $articles_actions = '';
-if ( $TicketObj->CurrentUserHasRight('ModifyTicket') ) {
- my $web_path = RT->Config->Get('WebPath');
- my $qs = $m->comp("/Elements/QueryString",
- "RefersTo-new" => "t:$id",
- next => $web_path."/RTIR/Display.html?id=$id"
- );
- $articles_actions = join ' 'x3,
- qq{<a href="$web_path/Articles/Article/PreCreate.html?$qs">}. loc('New') .q{</a>},
- qq{<a href="$web_path/RTIR/Incident/LinkArticles.html?id=$id">}. loc('Link') .q{</a>},
- ;
-}
-</%PERL>
-<&| /Widgets/TitleBox,
- title => loc("Articles"),
- title_href => RT->Config->Get('WebPath') ."/RTIR/Advanced.html?id=".$id,
- titleright_raw => $articles_actions,
- class=> 'ticket-info-articles',
-&>
-
-<ul>
-% while (my $Link = $TicketObj->RefersTo->Next) {
-% next unless UNIVERSAL::isa($Link->TargetURI->Object, "RT::Article");
-<li><a href="<%$Link->TargetURI->Resolver->HREF%>"><% $Link->TargetURI->Object->Name %></a></li>
-% }
-</ul>
+<& /RTIR/Elements/ShowArticles, Ticket => $TicketObj &>
-</&>
</td></tr></table>
<& /Ticket/Elements/ShowHistory,
commit a55da1c70f1aa4fba65b156df28152c9b4e73a49
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Wed Aug 17 02:28:08 2011 +0400
use CollectionList for articles
diff --git a/html/RTIR/Elements/ShowArticles b/html/RTIR/Elements/ShowArticles
index c736094..9008b99 100644
--- a/html/RTIR/Elements/ShowArticles
+++ b/html/RTIR/Elements/ShowArticles
@@ -5,12 +5,11 @@
class => 'ticket-info-articles',
&>
-<ul>
-% while (my $Link = $Ticket->RefersTo->Next) {
-% next unless UNIVERSAL::isa($Link->TargetURI->Object, "RT::Article");
-<li><a href="<%$Link->TargetURI->Resolver->HREF%>"><% $Link->TargetURI->Object->Name %></a></li>
-% }
-</ul>
+<& /Elements/CollectionList,
+ Collection => $articles,
+ Format => $format,
+ ShowHeader => 0,
+&>
</&>
<%ARGS>
@@ -19,6 +18,15 @@ $Ticket
<%INIT>
my $id = $Ticket->id;
+my $articles = RT::Articles->new( $session{'CurrentUser'} );
+$articles->LimitReferredToBy( $Ticket->URI );
+
+my $format = q{
+ '<a href="__WebPath__/Articles/Article/Display.html?id=__id__">__id__</a>/TITLE:#',
+ '<a href="__WebPath__/Articles/Article/Display.html?id=__id__">__Name__</a>/TITLE:Name',
+ __Summary__,
+};
+
my $box_actions = '';
if ( $Ticket->CurrentUserHasRight('ModifyTicket') ) {
my $web_path = RT->Config->Get('WebPath');
commit 49673620b60712c77c638afa53490f13c05eb4ea
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Wed Aug 17 03:14:16 2011 +0400
don't align boxes in columns on Incidents' Display.html
we don't in RT, we don't for IRs, Invs and Blocks
diff --git a/html/RTIR/Incident/Display.html b/html/RTIR/Incident/Display.html
index 7f2c78f..6bab492 100644
--- a/html/RTIR/Incident/Display.html
+++ b/html/RTIR/Incident/Display.html
@@ -65,33 +65,8 @@
<& /Elements/ShowCustomFields, Object => $TicketObj, Table => 0 &>
</table>
-
</&>
-</td><td class="boxcontainer" valign="top">
-% $m->callback( %ARGS, Ticket => $TicketObj, CallbackName => 'RightColumnStart' );
-
-<& /RTIR/Incident/Elements/ShowChildren,
- IncidentObj => $TicketObj,
- Queue => 'Incident Reports',
-&>
-
-</td></tr><tr><td class="boxcontainer" valign="top">
-
-<& /RTIR/Incident/Elements/ShowChildren,
- IncidentObj => $TicketObj,
- Queue => 'Investigations',
-&>
-
-</td><td class="boxcontainer" valign="top">
-
-<& /RTIR/Incident/Elements/ShowChildren,
- IncidentObj => $TicketObj,
- Queue => 'Blocks',
-&>
-
-</td></tr><tr><td class="boxcontainer" valign="top">
-
<&| /Widgets/TitleBox,
title => loc("Dates"),
title_href => RT->Config->Get('WebPath') ."/RTIR/Edit.html?id=".$id,
@@ -100,12 +75,19 @@
<& /RTIR/Elements/ShowDates, Ticket => $TicketObj &>
</&>
-<br />
<& /Ticket/Elements/ShowAttachments, Ticket => $TicketObj, Attachments => $attachments &>
<& /Ticket/Elements/ShowRequestor, Ticket => $TicketObj, DisplayPath => "/RTIR/Display.html" &>
</td><td class="boxcontainer" valign="top">
+% $m->callback( %ARGS, Ticket => $TicketObj, CallbackName => 'RightColumnStart' );
+
+% foreach my $queue ( 'Incident Reports', 'Investigations', 'Blocks' ) {
+<& /RTIR/Incident/Elements/ShowChildren,
+ IncidentObj => $TicketObj,
+ Queue => $Queue,
+&>
+% }
<& /RTIR/Elements/ShowArticles, Ticket => $TicketObj &>
commit 03c2456781cd106f6723bdec74737c3383a4c15a
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Wed Aug 17 03:18:25 2011 +0400
wrap summary into 'Ticket metadata' box like in RT
diff --git a/html/RTIR/Display.html b/html/RTIR/Display.html
index d46e2b7..0c16e4f 100644
--- a/html/RTIR/Display.html
+++ b/html/RTIR/Display.html
@@ -28,6 +28,9 @@
% $m->callback(CallbackName => 'BeforeActionList', %ARGS, Actions => \@results, ARGSRef => \%ARGS, Ticket => $Ticket);
<& /Elements/ListActions, actions => \@results &>
+
+<div class="summary"><&| /Widgets/TitleBox, title => loc('Ticket metadata') &>
+
<table class="ticket-summary" width="100%">
<tr>
<td class="boxcontainer" valign="top">
@@ -94,6 +97,9 @@
</td>
</tr>
</table>
+
+</&></div>
+
<& /Ticket/Elements/ShowHistory,
Ticket => $Ticket,
Collapsed => $ARGS{'Collapsed'},
diff --git a/html/RTIR/Incident/Display.html b/html/RTIR/Incident/Display.html
index 6bab492..21322b9 100644
--- a/html/RTIR/Incident/Display.html
+++ b/html/RTIR/Incident/Display.html
@@ -29,6 +29,7 @@
% $m->callback(CallbackName => 'BeforeActionList', %ARGS, Actions => \@results, ARGSRef => \%ARGS, Ticket => $TicketObj);
<& /Elements/ListActions, actions => \@results &>
+<div class="summary"><&| /Widgets/TitleBox, title => loc('Ticket metadata') &>
<table class="ticket-summary" width="100%"><tr><td class="boxcontainer" valign="top">
% $m->callback( %ARGS, Ticket => $TicketObj, CallbackName => 'LeftColumnStart' );
@@ -93,6 +94,8 @@
</td></tr></table>
+</&></div>
+
<& /Ticket/Elements/ShowHistory,
Ticket => $TicketObj,
Collapsed => $ARGS{'Collapsed'},
commit 0f3addc853cef80364c2e680e80586146b309b0f
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Wed Aug 17 03:43:39 2011 +0400
stab at support DeferTransactionLoading
RT is not ready. Helpers/TicketHistory has no callback
diff --git a/html/RTIR/Display.html b/html/RTIR/Display.html
index 0c16e4f..2b1efba 100644
--- a/html/RTIR/Display.html
+++ b/html/RTIR/Display.html
@@ -100,6 +100,11 @@
</&></div>
+% if (RT->Config->Get( 'DeferTransactionLoading', $session{'CurrentUser'} )) {
+ <& /Ticket/Elements/ClickToShowHistory,
+ Ticket => $Ticket,
+ &>
+% } else {
<& /Ticket/Elements/ShowHistory,
Ticket => $Ticket,
Collapsed => $ARGS{'Collapsed'},
@@ -110,6 +115,7 @@
EncryptionPath => RT->Config->Get('WebPath') ."/RTIR/GnuPG.html",
WarnUnsigned => 1,
&>
+% }
<%INIT>
my ($name);
my $Ticket = new RT::Ticket( $session{'CurrentUser'} );
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list