[Rt-commit] r4024 - in rtir/branches/1.9-EXPERIMENTAL: . html/RTIR
html/RTIR/Block/Elements html/RTIR/Elements
html/RTIR/Incident html/RTIR/Incident/Elements
html/RTIR/Investigation/Elements html/RTIR/Report/Elements
html/RTIR/Search html/RTIR/Search/Elements html/RTIR/Tools/Elements
ruz at bestpractical.com
ruz at bestpractical.com
Thu Nov 3 16:46:08 EST 2005
Author: ruz
Date: Thu Nov 3 16:45:57 2005
New Revision: 4024
Modified:
rtir/branches/1.9-EXPERIMENTAL/ (props changed)
rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Block/Elements/Tabs
rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Create.html
rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/QueueTabs
rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/Tabs
rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Elements/LinkTabs
rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Elements/Tabs
rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Reply.html
rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Investigation/Elements/Tabs
rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Report/Elements/Tabs
rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/RefineTabs
rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Refine.html
rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Tools/Elements/Tabs
Log:
r258 at cubic-pc: cubic | 2005-11-03 16:49:27 +0300
r251 at cubic-pc: cubic | 2005-11-03 16:45:11 +0300
* Tabs handling review
* Query strings should be escaped by standard
* fixed several small bugs in Tabs
Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Block/Elements/Tabs
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Block/Elements/Tabs (original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Block/Elements/Tabs Thu Nov 3 16:45:57 2005
@@ -22,8 +22,4 @@
%#
%#
%# END LICENSE BLOCK
-<& /RTIR/Elements/QueueTabs,
- QueueName => 'Blocks',
- %ARGS
-&>
-
+<& /RTIR/Elements/QueueTabs, QueueName => 'Blocks', %ARGS &>
Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Create.html
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Create.html (original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Create.html Thu Nov 3 16:45:57 2005
@@ -23,24 +23,25 @@
%#
%# END LICENSE BLOCK
<& /RTIR/Elements/Header, Title => $Title &>
-% if ($Split) {
+% my $EscapedQueue = $m->comp('/Elements/QueryString', Queue => $Queue );
+% if ( $Split ) {
<& '/RTIR/'.$Type.'/Elements/Tabs',
Ticket => $TicketObj,
current_tab => "RTIR/Split.html?Ticket=".$TicketObj->Id,
current_subtab => "RTIR/Split.html?Ticket=".$TicketObj->Id,
Title => $Title &>
-% } elsif ($Incident) {
+% } elsif ( $Incident ) {
<& "/RTIR/Incident/Elements/LinkTabs",
Queue => $Queue,
Ticket => $IncidentObj,
- current_tab => "RTIR/Create.html?Incident=".$Incident."&Queue=".$Queue,
- current_subtab => "RTIR/Create.html?Incident=".$Incident."&Queue=".$Queue,
+ current_tab => "RTIR/Create.html?Incident=$Incident&$EscapedQueue",
+ current_subtab => "RTIR/Create.html?Incident=$Incident&$EscapedQueue",
Title => $Title &>
% } else {
<& "/RTIR/".$Type."/Elements/Tabs",
Ticket => $TicketObj,
- current_tab => "RTIR/Create.html?Queue=".$Queue,
- current_subtab => "RTIR/Create.html?Queue=".$Queue,
+ current_tab => "RTIR/Create.html?$EscapedQueue",
+ current_subtab => "RTIR/Create.html?$EscapedQueue",
Title => $Title &>
% }
Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/QueueTabs
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/QueueTabs (original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/QueueTabs Thu Nov 3 16:45:57 2005
@@ -35,216 +35,212 @@
<%INIT>
+if( $QueryString =~ s/^&// ) {
+ require Carp;
+ Carp::cluck("queue string had leading &");
+}
+
my ($Type, undef) = $m->comp('/RTIR/Elements/Type', Queue => $QueueName);
+my $EscapedQueueName = $m->comp('/Elements/QueryString', Queue => $QueueName );
+
my $tabs = {};
-my $current_toptab = 'RTIR/Search/Results.html?Queue=' . $QueueName;
+my $current_toptab = 'RTIR/Search/Results.html?'. $EscapedQueueName;
my ($actions, $mytab);
my $searchtabs = { } ;
-if ( $Ticket && $Ticket->QueueObj->Name eq $QueueName) {
-
- my $id = $Ticket->id();
- $mytab = "RTIR/Display.html?id=".$id;
-
- if ( defined $session{'tickets'} ) {
-
- my $item_map = $session{'tickets'}->ItemMap;
-
- # Don't display prev links if we're on the first ticket
-
- if ($item_map->{$Ticket->Id}->{prev}) {
- $searchtabs->{'_a'} = {
- class => "nav",
- path => "RTIR/Display.html?id=" . $item_map->{first},
- title => '<< ' . loc('First') };
- $searchtabs->{"_b"} = { class => "nav",
- path => "RTIR/Display.html?id=" . $item_map->{$Ticket->Id}->{prev},
- title => '< ' . loc('Prev') };
- }
-
-
+if ( $Ticket && $Ticket->QueueObj->Name eq $QueueName ) {
+
+ my $id = $Ticket->id;
+ $mytab = "RTIR/Display.html?id=$id";
+
+ if ( $session{'tickets'} ) {
+ my $item_map = $session{'tickets'}->ItemMap;
+
+ # Don't display prev links if we're on the first ticket
+ if ( $item_map->{ $id }->{'prev'} ) {
+ $searchtabs->{'_a'} = { class => "nav",
+ path => "RTIR/Display.html?id=" . $item_map->{'first'},
+ title => '<< ' . loc('First') };
+ $searchtabs->{"_b"} = { class => "nav",
+ path => "RTIR/Display.html?id=" . $item_map->{ $id }->{'prev'},
+ title => '< ' . loc('Prev') };
+ }
+
# Don't display next links if we're on the last ticket
- if ($item_map->{$Ticket->Id}->{next}) {
+ if ( $item_map->{ $id }->{'next'} ) {
$searchtabs->{'d'} = { class => "nav",
- path => "RTIR/Display.html?id=" . $item_map->{$Ticket->Id}->{next},
- title => loc('Next') . ' >' };
- $searchtabs->{'e'} = {
- class => "nav",
- path => "RTIR/Display.html?id=" . $item_map->{last},
- title => loc('Last') . ' >>' };
+ path => "RTIR/Display.html?id=". $item_map->{ $id }->{'next'},
+ title => loc('Next') . ' >' };
+ $searchtabs->{'e'} = { class => "nav",
+ path => "RTIR/Display.html?id=" . $item_map->{'last'},
+ title => loc('Last') . ' >>' };
}
}
- $tabs->{"this"} = { class => "currentnav",
- path => "RTIR/Display.html?id=" . $Ticket->id,
- title => loc("$Type #[_1]", $id),
- current_subtab => $current_subtab };
+ $tabs->{'this'} = { class => "currentnav",
+ path => "RTIR/Display.html?id=$id",
+ title => loc("$Type #[_1]", $id),
+ current_subtab => $current_subtab };
my $ticket_page_tabs = {
- _A => { title => loc('Display'),
- path => "RTIR/Display.html?id=" . $id, }
+ _A => { title => loc('Display'),
+ path => "RTIR/Display.html?id=$id" }
};
-# only show edit option if they can do it
-if ($Ticket->CurrentUserHasRight('ModifyTicket')) {
- $ticket_page_tabs->{'_E'} = { title => loc('Edit'),
- path => "RTIR/Edit.html?id=" . $id, };
-
- $ticket_page_tabs->{'_F'} = { title => loc('Split'),
- path => "RTIR/Split.html?Ticket=" . $id, };
-
- $ticket_page_tabs->{'_G'} = { title => loc('Merge'),
- path => "RTIR/Merge.html?id=$id$QueryString",
- separator => 1 };
-
- foreach my $key (keys %$appendtabs) {
- $ticket_page_tabs->{$key}->{'title'} = $appendtabs->{$key}->{'title'};
- $ticket_page_tabs->{$key}->{'path'} = $appendtabs->{$key}->{'path'};
+ # only show edit option if they can do it
+ if ( $Ticket->CurrentUserHasRight( 'ModifyTicket' ) ) {
+ $ticket_page_tabs->{'_E'} = { title => loc('Edit'),
+ path => "RTIR/Edit.html?id=$id" };
+
+ $ticket_page_tabs->{'_F'} = { title => loc('Split'),
+ path => "RTIR/Split.html?Ticket=$id" };
+
+ $ticket_page_tabs->{'_G'} = { title => loc('Merge'),
+ path => "RTIR/Merge.html?id=$id&$QueryString",
+ separator => 1 };
+
+ foreach my $key (keys %$appendtabs) {
+ $ticket_page_tabs->{ $key }->{'title'} = $appendtabs->{ $key }->{'title'};
+ $ticket_page_tabs->{ $key }->{'path'} = $appendtabs->{ $key }->{'path'};
+ }
}
-}
+ foreach my $tab ( sort keys %$ticket_page_tabs ) {
+ next unless $ticket_page_tabs->{ $tab }->{'path'} eq $current_subtab;
-foreach my $tab ( sort keys %{$ticket_page_tabs} ) {
- if ( $ticket_page_tabs->{$tab}->{'path'} eq $current_subtab ) {
- $ticket_page_tabs->{$tab}->{"subtabs"} = $subtabs;
- $tabs->{'this'}->{"current_subtab"} =
- $ticket_page_tabs->{$tab}->{"path"};
+ $ticket_page_tabs->{ $tab }->{'subtabs'} = $subtabs;
+ $tabs->{'this'}->{'current_subtab'} = $ticket_page_tabs->{ $tab }->{'path'};
}
-}
-$tabs->{'this'}->{"subtabs"} = $ticket_page_tabs;
+ $tabs->{'this'}->{'subtabs'} = $ticket_page_tabs;
-### Reply ###
-if ( $Ticket->CurrentUserHasRight('ModifyTicket')
- or $Ticket->CurrentUserHasRight('ReplyToTicket') ) {
- } if ($Type eq 'Incident') {
- $actions->{'A'} = { title => loc('Reply to Reporters'),
- path => "RTIR/Incident/Reply.html?DefaultStatus=stalled&ClearRestrictions=1&id=".$id,
- };
- $actions->{'Ab'} = { title => loc('Reply to All'),
- path => "RTIR/Incident/Reply.html?DefaultStatus=stalled&ClearRestrictions=1&id=".$id."&All=1",
- };
- } else {
- $actions->{'A'} = { title => loc('Reply'),
- path => "RTIR/Update.html?Action=Respond&DefaultStatus=stalled&id=" . $id,
- };
-}
+ ### Reply ###
+ if ( $Ticket->CurrentUserHasRight('ModifyTicket')
+ or $Ticket->CurrentUserHasRight('ReplyToTicket') ) {
+
+ if ($Type eq 'Incident') {
+ $actions->{'A'} = {
+ title => loc('Reply to Reporters'),
+ path => "RTIR/Incident/Reply.html?DefaultStatus=stalled&ClearRestrictions=1&id=$id",
+ };
+ $actions->{'Ab'} = {
+ title => loc('Reply to All'),
+ path => "RTIR/Incident/Reply.html?DefaultStatus=stalled&ClearRestrictions=1&id=$id&All=1",
+ };
+ } else {
+ $actions->{'A'} = {
+ title => loc('Reply'),
+ path => "RTIR/Update.html?Action=Respond&DefaultStatus=stalled&id=$id",
+ };
+ }
+ }
if ( $Ticket->CurrentUserHasRight('ModifyTicket') ) {
- if ($Type eq 'Report') {
- if ( $Ticket->Status ne 'resolved' and $Ticket->Status ne 'rejected' ) {
- my $state = $m->scomp("/RTIR/Elements/ShowRTIRField",
- Ticket => $Ticket, Name => 'State');
- $state =~ s/\s+$//;
- if ($state ne 'new') {
- $actions->{'Ac'} = {
-
- path =>
- "RTIR/Update.html?Action=Comment&DefaultStatus=resolved&id=" . $id,
- title => loc('Resolve') };
- }
- $actions->{'B'} = { path => "RTIR/Display.html?Status=rejected&id=" . $id,
- title => loc('Quick Reject') };
- $actions->{'Bb'} = {
-
- path =>
- "RTIR/Update.html?Action=Comment&DefaultStatus=rejected&id=" . $id,
- title => loc('Reject') };
- }
- } elsif ($Type eq 'Incident') {
-
- if ( $Ticket->Status ne 'resolved' ) {
- $actions->{'Ac'} = {
-
- path => "RTIR/Incident/Reply.html?Action=Comment&DefaultStatus=resolved&ClearRestrictions=1&id=".$id."&All=1",
-
- title => loc('Resolve') };
- $actions->{'B'} = {
- path => "RTIR/Incident/Reply.html?Action=Comment&DefaultStatus=rejected&ClearRestrictions=1&id=".$id."&All=1",
-
- title => loc('Abandon') };
- }
- }
-
- ### Open ###
- if ( $Ticket->Status eq 'resolved' or $Ticket->Status eq 'rejected' ) {
- $actions->{'C'} = { path => "RTIR/Display.html?Status=open&id=" . $id,
- title => loc('Open') };
- }
- }
-
-if ( $Ticket->CurrentUserHasRight('OwnTicket') ) {
- if ( $Ticket->Owner == $RT::Nobody->id ) {
- $actions->{'D'} = { path => "RTIR/Display.html?Action=Take&id=" . $id,
- title => loc('Take') };
- }
- elsif ( $Ticket->Owner != $session{CurrentUser}->id ) {
- $actions->{'E'} = {path => "RTIR/Display.html?Action=Steal&id=" . $id,
- title => loc('Steal') };
+ if ( $Type eq 'Report' ) {
+ if ( $Ticket->Status ne 'resolved' and $Ticket->Status ne 'rejected' ) {
+ my $state = $Ticket->FirstCustomFieldValue('_RTIR_State');
+ if ($state ne 'new') {
+ $actions->{'Ac'} = {
+ path => "RTIR/Update.html?Action=Comment&DefaultStatus=resolved&id=$id",
+ title => loc('Resolve'),
+ };
+ }
+ $actions->{'B'} = {
+ path => "RTIR/Display.html?Status=rejected&id=$id",
+ title => loc('Quick Reject'),
+ };
+ $actions->{'Bb'} = {
+ path => "RTIR/Update.html?Action=Comment&DefaultStatus=rejected&id=$id",
+ title => loc('Reject'),
+ };
+ }
+ }
+ elsif ( $Type eq 'Incident' ) {
+ if ( $Ticket->Status ne 'resolved' ) {
+ $actions->{'Ac'} = {
+ path => "RTIR/Incident/Reply.html?Action=Comment&DefaultStatus=resolved&ClearRestrictions=1&id=$id&All=1",
+ title => loc('Resolve'),
+ };
+ $actions->{'B'} = {
+ path => "RTIR/Incident/Reply.html?Action=Comment&DefaultStatus=rejected&ClearRestrictions=1&id=$id&All=1",
+ title => loc('Abandon'),
+ };
+ }
+ }
+
+ ### Open ###
+ if ( $Ticket->Status eq 'resolved' or $Ticket->Status eq 'rejected' ) {
+ $actions->{'C'} = { path => "RTIR/Display.html?Status=open&id=$id",
+ title => loc('Open') };
+ }
}
-}
-if ( $Ticket->CurrentUserHasRight('ModifyTicket')
- or $Ticket->CurrentUserHasRight('CommentOnTicket') ) {
- $actions->{'F'} = { title => loc('Comment'),
- path => "RTIR/Update.html?Action=Comment&id=" . $id,
- };
-}
+ if ( $Ticket->CurrentUserHasRight('OwnTicket') ) {
+ if ( $Ticket->Owner == $RT::Nobody->id ) {
+ $actions->{'D'} = { path => "RTIR/Display.html?Action=Take&id=$id",
+ title => loc('Take') };
+ }
+ elsif ( $Ticket->Owner != $session{CurrentUser}->id ) {
+ $actions->{'E'} = { path => "RTIR/Display.html?Action=Steal&id=$id",
+ title => loc('Steal') };
+ }
+ }
+
+ if ( $Ticket->CurrentUserHasRight('ModifyTicket')
+ or $Ticket->CurrentUserHasRight('CommentOnTicket') ) {
+ $actions->{'F'} = { title => loc('Comment'),
+ path => "RTIR/Update.html?Action=Comment&id=$id" };
+ }
} else {
- $mytab = $current_tab;
+ $mytab = $current_tab;
}
my $refinetabs = { };
-
$refinetabs->{'_a'} = {
class => "nav",
- path => 'RTIR/Search/Refine.html?ResultPage=/RTIR/Search/Results.html&Queue=' . $QueueName . $QueryString,
- title => loc('Refine')
+ path => "RTIR/Search/Refine.html?ResultPage=/RTIR/Search/Results.html&$EscapedQueueName&$QueryString",
+ title => loc('Refine'),
};
-$tabs->{"A"} = { path => 'RTIR/Create.html?Queue=' . $QueueName,
+$tabs->{"A"} = { path => "RTIR/Create.html?$EscapedQueueName",
title => loc("New $Type") };
-$tabs->{"g"} = { path => 'RTIR/Search/Results.html?Queue=' . $QueueName . $QueryString,
+$tabs->{"g"} = { path => "RTIR/Search/Results.html?$EscapedQueueName&$QueryString",
title => loc('Results'),
separator => 1,
subtabs => $refinetabs };
if ($Type eq 'Report') {
$tabs->{"h"} = { path => 'RTIR/Report/BulkReject.html',
- title => loc('Bulk Reject'),
- separator => 1 };
+ title => loc('Bulk Reject'),
+ separator => 1 };
if ( $tabs->{'h'}->{'path'} eq $current_tab ) {
- $tabs->{'h'}->{"subtabs"} = $subtabs;
+ $tabs->{'h'}->{'subtabs'} = $subtabs;
}
-
-} elsif ($Type eq 'Incident' && $Ticket &&
- $Ticket->QueueObj->Name ne 'Incidents') {
+}
+elsif ( $Type eq 'Incident' && $Ticket && $Ticket->QueueObj->Name ne 'Incidents') {
my $childq = $Ticket->QueueObj->Name;
- next if $childq eq 'Incidents';
my ($childtype, undef) = $m->comp('/RTIR/Elements/Type', Queue => $childq);
- $tabs->{'h'} = { title => loc('Link [_1] #[_2]', $childtype, $Ticket->Id),
- path => "RTIR/Incident/LinkToIncident.html?id=" . $Ticket->Id,
- separator => 1 };
+ $tabs->{'h'} = { title => loc( 'Link [_1] #[_2]', $childtype, $Ticket->Id ),
+ path => "RTIR/Incident/LinkToIncident.html?id=". $Ticket->Id,
+ separator => 1 };
if ( $tabs->{'h'}->{'path'} eq $current_tab ) {
- $tabs->{'h'}->{"subtabs"} = $subtabs;
+ $tabs->{'h'}->{'subtabs'} = $subtabs;
}
}
</%INIT>
-
-
<%ARGS>
$Ticket => undef
$subtabs => undef
$appendtabs => undef
$current_tab => undef
$current_subtab => undef
-$Title => undef
-$QueryString => undef
+$Title => ''
+$QueryString => ''
$QueueName => 'Incident Reports'
</%ARGS>
Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/Tabs
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/Tabs (original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/Tabs Thu Nov 3 16:45:57 2005
@@ -23,12 +23,12 @@
%#
%# END LICENSE BLOCK
<& /Elements/PageLayout,
- toptabs => $toptabs,
+ toptabs => $toptabs,
topactions => $topactions,
- tabs => $tabs,
- actions => $actions,
- current_tab => $current_tab,
- current_subtab => $current_subtab,
+ tabs => $tabs,
+ actions => $actions,
+ current_tab => $current_tab,
+ current_subtab => $current_subtab,
current_toptab => $current_toptab,
title => $Title,
AppName => $RT::rtirname &>
@@ -37,27 +37,25 @@
my $toptabs = {
A => { title => loc('RT'),
- path => '', },
+ path => '' },
B => { title => loc('RTIR Home'),
- path => 'RTIR/index.html',
- },
+ path => 'RTIR/index.html' },
C => { title => loc('Incidents'),
- path => 'RTIR/Search/Results.html?Queue=Incidents' },
+ path => 'RTIR/Search/Results.html?Queue=Incidents' },
D => { title => loc('Incident Reports'),
- path => 'RTIR/Search/Results.html?Queue=Incident Reports'},
+ path => 'RTIR/Search/Results.html?Queue=Incident%20Reports' },
E => { title => loc('Investigations'),
- path => 'RTIR/Search/Results.html?Queue=Investigations'},
+ path => 'RTIR/Search/Results.html?Queue=Investigations' },
F => { title => loc('Blocks'),
- path => 'RTIR/Search/Results.html?Queue=Blocks'},
+ path => 'RTIR/Search/Results.html?Queue=Blocks' },
G => { title => loc('Tools'),
- path => 'RTIR/Tools/Lookup.html',
- },
- };
+ path => 'RTIR/Tools/Lookup.html' },
+};
+
my $topactions = {
- A => { html => $m->scomp('/RTIR/Elements/SimpleSearch')
- }
+ A => { html => $m->scomp('/RTIR/Elements/SimpleSearch') }
};
-
+
</%INIT>
<%ARGS>
$current_toptab => undef
@@ -66,11 +64,4 @@
$tabs => undef
$actions => undef
$Title => undef
-$QueryString => undef
-$Query => undef
-$Format => undef
-$Rows => undef
-$OrderBy => undef
-$Order => undef
-$Page => undef
</%ARGS>
Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Elements/LinkTabs
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Elements/LinkTabs (original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Elements/LinkTabs Thu Nov 3 16:45:57 2005
@@ -22,43 +22,40 @@
%#
%#
%# END LICENSE BLOCK
-% if (defined $Ticket) {
+% if ( $Ticket ) {
<& /RTIR/Incident/Elements/Tabs,
appendtabs => $appendtabs,
- subtabs => $refinetabs,
+ subtabs => $refinetabs,
%ARGS &>
% } else {
-<& '/RTIR/' . $Type . '/Elements/Tabs',
- subtabs => $refinetabs,
+<& '/RTIR/' . $Type . '/Elements/Tabs',
+ subtabs => $refinetabs,
appendtabs => $appendtabs,
%ARGS &>
% }
<%INIT>
-my $appendtabs;
-my $refinetabs = { };
-my $Type;
-if ($Ticket && $Tab) {
- ($Type, undef) = $m->comp('/RTIR/Elements/Type', Queue => $Queue);
+my ($Type) = $m->comp('/RTIR/Elements/Type', Queue => $Queue);
- $appendtabs = {
- _I => { path => $current_subtab,
- title => $Tab },
+my ($appendtabs, $refinetabs);
+if ( $Ticket && $Tab ) {
+
+ $appendtabs->{'_I'} = {
+ path => $current_subtab,
+ title => $Tab,
};
$refinetabs->{'_a'} = {
- class => "nav",
- path => $current_subtab,
- title => loc('Refine') };
+ class => "nav",
+ path => $current_subtab,
+ title => loc('Refine'),
+ };
}
</%INIT>
-
<%ARGS>
$Ticket => undef
-$current_tab => undef
$current_subtab => undef
-$Title => undef
$Queue => undef
$Tab => undef
</%ARGS>
Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Elements/Tabs
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Elements/Tabs (original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Elements/Tabs Thu Nov 3 16:45:57 2005
@@ -22,14 +22,4 @@
%#
%#
%# END LICENSE BLOCK
-<& /RTIR/Elements/QueueTabs,
- QueueName => 'Incidents',
- current_tab => $current_tab,
- current_subtab => $current_subtab,
- %ARGS
-&>
-
-<%ARGS>
-$current_tab => undef
-$current_subtab => undef
-</%ARGS>
+<& /RTIR/Elements/QueueTabs, QueueName => 'Incidents', %ARGS &>
Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Reply.html
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Reply.html (original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Reply.html Thu Nov 3 16:45:57 2005
@@ -33,48 +33,49 @@
<& /Elements/ListActions, actions => \@results &>
-<form action="Reply.html" method=get>
-<input type=hidden name=id value=<%$id%>>
-<input type=hidden name=Status value=<%$ARGS{'DefaultStatus'}%>>
-<input type=hidden name=All value=<%$ARGS{'All'}%>>
-<input type=hidden name=Query value="<%$Query%>">
-<input type=hidden name=BaseQuery value="<%$BaseQuery%>">
+<form action="Reply.html" method="GET">
+<input type="hidden" name="id" value="<% $id %>">
+<input type="hidden" name="Status" value="<% $ARGS{'DefaultStatus'} %>">
+<input type="hidden" name="All" value="<% $ARGS{'All'} %>">
+<input type="hidden" name="Query" value="<% $Query %>">
+<input type="hidden" name="BaseQuery" value="<% $BaseQuery %>">
<h2>Reporters</h2>
<& /RTIR/Search/Elements/ShowResults,
- BaseQuery => $BaseQuery,
- Query => "($Query) AND Queue = 'Incident Reports'",
+ BaseQuery => $BaseQuery,
+ Query => "($Query) AND Queue = 'Incident Reports'",
QueryString => $QueryString,
- BaseURL => $BaseURL,
- Format => $Format,
- &>
+ BaseURL => $BaseURL,
+ Format => $Format,
+&>
<h2>Investigation Correspondents</h2>
-<& /RTIR/Search/Elements/ShowResults,
- BaseQuery => $BaseQuery,
- Query => "($Query) AND Queue = 'Investigations'",
+<& /RTIR/Search/Elements/ShowResults,
+ BaseQuery => $BaseQuery,
+ Query => "($Query) AND Queue = 'Investigations'",
QueryString => $QueryString,
- BaseURL => $BaseURL,
- Format => $Format,
- &>
+ BaseURL => $BaseURL,
+ Format => $Format,
+&>
<HR>
% my $i;
<& /Widgets/TitleBoxStart, title => loc('Reply to selected tickets') &>
-<table>
-<tr><td class="label">
+<table><tr><td class="label">
<&|/l&>Owner</&>:
</td><td>
-<& /Elements/SelectOwner,
+<& /Elements/SelectOwner,
Name=>"Owner",
- Default => ($ARGS{Owner}||$session{'CurrentUser'}->Id||undef),
- &>
-<&|/l&>Worked</&>: <input size=4 name="UpdateTimeWorked" value="<%
-$ARGS{UpdateTimeWorked}%>"> <&|/l&>minutes</&>
-</td></tr>
-<tr><td align=right><&|/l&>Update Type</&>:</td>
-<td><select name="UpdateType">
+ Default => ($ARGS{Owner}||$session{'CurrentUser'}->Id||undef),
+&>
+<&|/l&>Worked</&>:
+<input size=4 name="UpdateTimeWorked" value="<% $ARGS{UpdateTimeWorked} %>">
+<&|/l&>minutes</&>
+</td></tr><tr><td align=right>
+<&|/l&>Update Type</&>:
+</td><td>
+<select name="UpdateType">
<option value="private" <%$CommentDefault%>><&|/l&>Comments (Not sent to requestors)</&></option>
% if ($ARGS{Status} ne 'resolved' && $ARGS{Status} ne 'rejected') {
<option value="response" <%$ResponseDefault%>><&|/l&>Response to requestors</&></option>
@@ -177,23 +178,21 @@
#Iterate through each ticket we've been handed
while (my $Ticket = $MyTickets->Next) {
- my ($oldstate, $newstate);
- $oldstate = $Ticket->FirstCustomFieldValue('_RTIR_State');
+ my $oldstate = $Ticket->FirstCustomFieldValue('_RTIR_State');
if ($do_comment_reply) {
- next unless ($ARGS{"UpdateTicket".$Ticket->Id});
-
- ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef => \%ARGS, Actions => \@updateresults);
+ next unless ($ARGS{"UpdateTicket".$Ticket->Id});
+ ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef => \%ARGS, Actions => \@updateresults);
- @basicresults = ProcessTicketBasics(TicketObj => $Ticket, ARGSRef => \%ARGS);
+ @basicresults = ProcessTicketBasics(TicketObj => $Ticket, ARGSRef => \%ARGS);
- @watchresults = ProcessTicketWatchers(TicketObj => $Ticket, ARGSRef => \%ARGS);
- }
+ @watchresults = ProcessTicketWatchers(TicketObj => $Ticket, ARGSRef => \%ARGS);
+ }
my @dateresults = ProcessTicketDates(TicketObj => $Ticket, ARGSRef => \%ARGS);
my @tempresults = (@basicresults, @watchresults, @updateresults, @dateresults);
- $newstate = $Ticket->FirstCustomFieldValue('_RTIR_State');
+ my $newstate = $Ticket->FirstCustomFieldValue('_RTIR_State');
if ($newstate ne $oldstate) {
push (@tempresults, loc("State changed from [_1] to [_2]", $oldstate, $newstate));
}
Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Investigation/Elements/Tabs
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Investigation/Elements/Tabs (original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Investigation/Elements/Tabs Thu Nov 3 16:45:57 2005
@@ -22,8 +22,4 @@
%#
%#
%# END LICENSE BLOCK
-<& /RTIR/Elements/QueueTabs,
- QueueName => 'Investigations',
- %ARGS
-&>
-
+<& /RTIR/Elements/QueueTabs, QueueName => 'Investigations', %ARGS &>
Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Report/Elements/Tabs
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Report/Elements/Tabs (original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Report/Elements/Tabs Thu Nov 3 16:45:57 2005
@@ -22,8 +22,4 @@
%#
%#
%# END LICENSE BLOCK
-<& /RTIR/Elements/QueueTabs,
- QueueName => 'Incident Reports',
- %ARGS
-&>
-
+<& /RTIR/Elements/QueueTabs, QueueName => 'Incident Reports', %ARGS &>
Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/RefineTabs
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/RefineTabs (original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/RefineTabs Thu Nov 3 16:45:57 2005
@@ -4,14 +4,14 @@
&>
<%INIT>
-my ($Type, undef) = $m->comp("/RTIR/Elements/Type", Queue => $Queue);
+my ($Type) = $m->comp("/RTIR/Elements/Type", Queue => $Queue);
my $refinetabs = { };
-
$refinetabs->{'_a'} = {
class => "nav",
- path => $path,
- title => loc('Refine') };
+ path => $path,
+ title => loc('Refine'),
+};
</%INIT>
<%ARGS>
Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Refine.html
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Refine.html (original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Refine.html Thu Nov 3 16:45:57 2005
@@ -81,14 +81,14 @@
Page => $Page,
Order => $Order,
OrderBy => $OrderBy,
- &>
+&>
<%INIT>
my $SearchId;
-if (!$Ticket && $id) {
+if ( !$Ticket && $id ) {
$Ticket = new RT::Ticket($session{'CurrentUser'});
- $Ticket->Load($id);
+ $Ticket->Load( $id );
}
my %queues = ();
@@ -127,35 +127,43 @@
( $Query, $Format, $Order, $OrderBy, $Rows, $SearchId ) =
$m->comp('/RTIR/Search/Elements/ProcessQuery',
- queues => \%queues,
- results => \$results,
- optionlist => \$optionlist,
- search_hash => \$search_hash,
- dirty => \$dirty,
- AvailableColumns => \$AvailableColumns,
- CurrentFormat => \$CurrentFormat,
- BaseQuery => $BaseQuery,
- ResultPage => $ResultPage,
- id => $id,
- %ARGS);
+ queues => \%queues,
+ results => \$results,
+ optionlist => \$optionlist,
+ search_hash => \$search_hash,
+ dirty => \$dirty,
+ AvailableColumns => \$AvailableColumns,
+ CurrentFormat => \$CurrentFormat,
+ BaseQuery => $BaseQuery,
+ ResultPage => $ResultPage,
+ id => $id,
+ %ARGS);
my ($Type, @states) = $m->comp("/RTIR/Elements/Type", Queue => $Queue);
# {{{ Build a querystring for the tabs
-
- $QueryString = '&' . $m->comp('/Elements/QueryString',
- Query => $Query,
- Format => $Format,
- Order => $Order,
- OrderBy => $OrderBy,
- Rows => $Rows) if ($Query);
+$QueryString = $m->comp('/Elements/QueryString',
+ Query => $Query,
+ Format => $Format,
+ Order => $Order,
+ OrderBy => $OrderBy,
+ Rows => $Rows) if ($Query);
# }}}
-my $path = $BaseURL."?Queue=$Queue&id=".$id.$QueryString;
+my $path = $BaseURL;
+if( $path !~ /[?&]$/ ) {
+ $path .= ($path =~ /\?/)? '&': '?';
+}
+$path .= $m->comp( '/Elements/QueryString',
+ Queue => $Queue,
+ id => $id,
+ );
+$path .= "&$QueryString";
</%INIT>
<%ARGS>
+$id => undef
$Ticket => undef
$title => loc("Refine Search")
$ResultPage => undef
@@ -164,7 +172,6 @@
$Queue => undef
$Query => undef
$QueryString => undef
-$id => undef
$Format => undef
$HideResults => 0
$Rows => 50
Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Tools/Elements/Tabs
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Tools/Elements/Tabs (original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Tools/Elements/Tabs Thu Nov 3 16:45:57 2005
@@ -23,13 +23,14 @@
%#
%# END LICENSE BLOCK
<& /Elements/Callback, tabs => $tabs, %ARGS &>
-<& /RTIR/Elements/Tabs,
- tabs => $tabs,
- current_toptab => $current_toptab,
- current_tab => $current_tab,
+<& /RTIR/Elements/Tabs,
+ tabs => $tabs,
+ current_toptab => $current_toptab,
+ current_tab => $current_tab,
current_subtab => $current_subtab,
- subtabs => $script_tabs,
- Title => $Title &>
+ subtabs => $script_tabs,
+ Title => $Title,
+&>
<%INIT>
my $tabs = {};
@@ -37,26 +38,23 @@
my $script_tabs = {
_A => { title => loc('By Email address'),
- path => 'RTIR/Tools/ScriptedAction.html', },
+ path => 'RTIR/Tools/ScriptedAction.html' },
_B => { title => loc('By IP address'),
- path => 'RTIR/Tools/ScriptedAction.html?loop=IP', },
+ path => 'RTIR/Tools/ScriptedAction.html?loop=IP' },
};
$tabs->{"A"} = { path => 'RTIR/Tools/Lookup.html?NewSearch=1',
- title => loc('Lookup'),
- };
+ title => loc('Lookup') };
+
$tabs->{"B"} = { path => 'RTIR/Reporting/index.html',
- title => loc('Reporting'),
- };
-$tabs->{"C"} = { path => 'RTIR/Tools/ScriptedAction.html',
- title => loc('Scripted Action'),
- subtabs => $script_tabs,
- current_subtab => $current_subtab,
- };
+ title => loc('Reporting') };
+$tabs->{"C"} = { path => 'RTIR/Tools/ScriptedAction.html',
+ title => loc('Scripted Action'),
+ subtabs => $script_tabs,
+ current_subtab => $current_subtab };
</%INIT>
-
<%ARGS>
$subtabs => undef
$current_tab => undef
More information about the Rt-commit
mailing list