[Rt-commit] [svn] r1432 - in rtir/branches/1.1/html/RTIR/Incident:
. Elements
leira at pallas.eruditorum.org
leira at pallas.eruditorum.org
Tue Sep 7 01:22:10 EDT 2004
Author: leira
Date: Tue Sep 7 01:22:09 2004
New Revision: 1432
Modified:
rtir/branches/1.1/html/RTIR/Incident/Elements/BulkLink
rtir/branches/1.1/html/RTIR/Incident/LinkChildren.html
Log:
Since only one file uses the things in Elements/BulkLink now, recombine them to make things simpler.
Modified: rtir/branches/1.1/html/RTIR/Incident/Elements/BulkLink
==============================================================================
--- rtir/branches/1.1/html/RTIR/Incident/Elements/BulkLink (original)
+++ rtir/branches/1.1/html/RTIR/Incident/Elements/BulkLink Tue Sep 7 01:22:09 2004
@@ -22,73 +22,8 @@
%#
%#
%# END LICENSE BLOCK
-<form action="Display.html" method=get>
-<input type=hidden name=id value=<%$id%>>
-<input type=hidden name=BulkLink value=1>
-
-Query: <%$Query%><br>
-<& /RTIR/Search/Elements/ShowResults,
- Queue => $Queue,
- Query => $Query,
- QueryString => $QueryString,
- BaseURL => $BaseURL,
- Format => $Format,
-&>
-
-<& /Elements/Submit, Name => "SubmitTicket", Caption => $SubmitCaption, Label => loc("Link") &>
-</form>
<%INIT>
-$Format = $RT::RTIRLinkSearchResultFormat;
-
-my $TicketObj = new RT::Ticket($session{'CurrentUser'});
-$TicketObj->Load($id);
-
-my ($Type, @states) = $m->comp('/RTIR/Elements/Type', Ticket => $id);
-
-my ($LinkType, @linkstates) = $m->comp('/RTIR/Elements/Type', Queue => $Queue);
-
-my ($title, $ticketcount);
-$session{'i'}++;
-$session{'tickets'} = RT::Tickets->new($session{'CurrentUser'}) unless ($session{'tickets'});
-$session{'tickets'}->FromSQL($Query) if ($Query);
-$session{'tickets'}->OrderBy(FIELD => $OrderBy, ORDER => $Order);
-
-if ($OrderBy ne $session{'CurrentSearchHash'}->{'OrderBy'}
- or $Order ne $session{'CurrentSearchHash'}->{'Order'}) {
- $session{'CurrentSearchHash'}->{'OrderBy'} = $OrderBy;
- $session{'CurrentSearchHash'}->{'Order'} = $Order;
- # Invalidate the ordering cache
- undef $session{'tickets'}->{'items_array'};
-}
-
-if ( $session{'tickets'}->Query()) {
- $ticketcount = $session{tickets}->CountAll();
- $title = loc('Found [quant,_1,ticket]', $ticketcount);
-} else {
- $title = loc("Find tickets");
-}
-
-$m->print("Original Query: $Query<br>");
-if (!$Query) {
- $Query = $m->comp('/RTIR/Elements/NewQuery', Queue => $Queue);
-}
-
-my $QueryString = "&".$m->comp('/Elements/QueryString',
- Query => $Query,
- Format => $Format,
- Rows => $Rows,
- OrderBy => $OrderBy,
- Order => $Order,
- Page => $Page);
-
-if (!$BaseQuery) {
- $BaseQuery = $m->comp('/RTIR/Elements/BaseQuery', Queue => $Queue);
-}
-
-$Query = "$BaseQuery AND ( $Query )";
-$ARGS{'Query'} = $Query;
-
</%INIT>
<%ARGS>
Modified: rtir/branches/1.1/html/RTIR/Incident/LinkChildren.html
==============================================================================
--- rtir/branches/1.1/html/RTIR/Incident/LinkChildren.html (original)
+++ rtir/branches/1.1/html/RTIR/Incident/LinkChildren.html Tue Sep 7 01:22:09 2004
@@ -34,24 +34,87 @@
Title => $title,
&>
-<& Elements/BulkLink,
- Query => $Query,
- SubmitCaption => $SubmitCaption,
- id => $id,
- Status => 'open',
- BaseURL => "/RTIR/Incident/LinkChildren.html",
+<form action="Display.html" method=get>
+<input type=hidden name=id value=<%$id%>>
+<input type=hidden name=BulkLink value=1>
+
+<& /RTIR/Search/Elements/ShowResults,
Queue => $Queue,
- &>
+ Query => $Query,
+ QueryString => $QueryString,
+ BaseURL => $BaseURL,
+ Format => $Format,
+&>
+
+<& /Elements/Submit, Name => "SubmitTicket", Caption => $SubmitCaption, Label => loc("Link") &>
+</form>
<%INIT>
my $IncidentObj = LoadTicket($id);
-my $title = loc("Link selected [_1] to Incident #[_2]", $Queue, $IncidentObj->Id);
my $SubmitCaption = loc("Link selected with Incident #[_1]", $IncidentObj->id);
+$Format = $RT::RTIRLinkSearchResultFormat;
+
+my $TicketObj = new RT::Ticket($session{'CurrentUser'});
+$TicketObj->Load($id);
+
+my ($Type, @states) = $m->comp('/RTIR/Elements/Type', Queue => $Queue);
+
+my ($LinkType, @linkstates) = $m->comp('/RTIR/Elements/Type', Queue => $Queue);
+
+my ($title, $ticketcount);
+$session{'i'}++;
+$session{'tickets'} = RT::Tickets->new($session{'CurrentUser'}) unless ($session{'tickets'});
+$session{'tickets'}->FromSQL($Query) if ($Query);
+$session{'tickets'}->OrderBy(FIELD => $OrderBy, ORDER => $Order);
+
+if ($OrderBy ne $session{'CurrentSearchHash'}->{'OrderBy'}
+ or $Order ne $session{'CurrentSearchHash'}->{'Order'}) {
+ $session{'CurrentSearchHash'}->{'OrderBy'} = $OrderBy;
+ $session{'CurrentSearchHash'}->{'Order'} = $Order;
+ # Invalidate the ordering cache
+ undef $session{'tickets'}->{'items_array'};
+}
+
+if ( $session{'tickets'}->Query()) {
+ $ticketcount = $session{tickets}->CountAll();
+ $title = loc("Found [quant,_1,$Type]", $ticketcount);
+} else {
+ $title = loc("Link selected [_1] to Incident #[_2]", $Queue, $IncidentObj->Id);
+}
+
+$m->print("original Query: $Query<br>");
+if (!$Query) {
+ $Query = $m->comp('/RTIR/Elements/NewQuery', Queue => $Queue);
+}
+
+my $QueryString = "&".$m->comp('/Elements/QueryString',
+ Query => $Query,
+ Format => $Format,
+ Rows => $Rows,
+ OrderBy => $OrderBy,
+ Order => $Order,
+ Page => $Page);
+
+if (!$BaseQuery) {
+ $BaseQuery = $m->comp('/RTIR/Elements/BaseQuery', Queue => $Queue);
+}
+
+$Query = "$BaseQuery AND ( $Query )";
+
</%INIT>
<%ARGS>
$id => undef
$Queue => undef
+$BaseURL => "/RTIR/Incident/LinkChildren.html"
+$Status => 'open',
+$BaseQuery => undef
$Query => undef
+$Format => undef
+$HideResults => 0
+$Rows => 50
+$Page => 1
+$OrderBy => 'id'
+$Order => 'ASC'
</%ARGS>
More information about the Rt-commit
mailing list