[Rt-commit] rtir branch, 2.9-trunk, updated. 2.6.1rc1-367-g3be4273
Ruslan Zakirov
ruz at bestpractical.com
Fri Aug 26 23:14:42 EDT 2011
The branch, 2.9-trunk has been updated
via 3be42737b47dd740d5e30c64184e97710847ef41 (commit)
via e9ab035af7d6416037850cd12dced0cd24a1815f (commit)
via b6b97066020c117dd9088dbcce9dd026f5db924f (commit)
via 378d409795f758e2e78a956079080afea223b6bf (commit)
via 40f30579dad7294a290372b374e7761df4217be0 (commit)
via 5118a387d57acd1f232c60f1ad5fc3bed344f9ec (commit)
via 66b2a431c0f7bb691a51fa364cf338039cf6b5fa (commit)
via 26a666f978272393d8c53c2ebc2e160a38a20916 (commit)
via 8486b730ae46b9bc35da6ae2a3380089a3581696 (commit)
via 1ca5575ba4f358021a49f6423f24819fc061ec34 (commit)
via 5dc5a0a80245f1726d0b3b4a3cfd17511a8df27c (commit)
via 66eb3ef2546b8b6f3da8b5a06056b7f550f73c91 (commit)
via e1660f22b1a61f30426ec1342909e073bad7cd20 (commit)
via a3a2347913067b8e3dab23d4834cf0bf2941f04c (commit)
via 83243c2b29d473e3b2cc83ae83f37c7d2bca665f (commit)
via c30ec9d24bc761e018aa99f3e3700d0abe89982c (commit)
via e9cf7e12e4e8d80e3db313d7b1fbe655d5034aa7 (commit)
via 2fe30eb1eaed2bd571f53abd53f5b8dea0f3b836 (commit)
via bc7b9159fa793fc0c9b74237f3ec258e0103416a (commit)
via 84ef014559000f29b3bf4af543b2c51d838a2228 (commit)
via ec2dc75a3cecede57ca11ce3fa16a90c8cf70cfa (commit)
via 597477b56cb6c5a1db1efd51a96f08275d4a0cb5 (commit)
via a3ad9735273c84739220a1b8d6866ed0b06443d1 (commit)
via c951ffbb888aa0ea1129f380fc250c57e77c9873 (commit)
via aa444e1879629a1e3e1efcda760474afed117129 (commit)
via 0bda6831cd4dbb6bed7fbd2ed4d0fab0b56b13aa (commit)
via dcac345ca8ae4a5cef2ba29aeb68460d75f47d9d (commit)
via 6c720c7752bcf7ab67fb4b44645cf6cc8664efb5 (commit)
from d4e8086550cf963168d87f3cdd3b80d116421625 (commit)
Summary of changes:
TODO.porting_over_RT4 | 17 ++--
etc/initialdata | 4 +-
etc/upgrade/2.9.0/content | 32 ++++++
html/RTIR/Create.html | 8 ++
html/RTIR/Edit.html | 149 ++++++++++++++-----------
html/RTIR/Elements/EditDates | 53 ++++++---
html/RTIR/Elements/IncidentSummary | 2 +-
html/RTIR/Elements/ShowArticles | 2 +-
html/RTIR/Incident/Create.html | 18 +++
html/RTIR/Incident/Edit.html | 178 ------------------------------
html/RTIR/Incident/Elements/ShowChildren | 2 +-
html/RTIR/Update.html | 20 +++-
lib/RT/IR.pm | 23 ++++
13 files changed, 230 insertions(+), 278 deletions(-)
delete mode 100644 html/RTIR/Incident/Edit.html
- Log -----------------------------------------------------------------
commit 6c720c7752bcf7ab67fb4b44645cf6cc8664efb5
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Fri Aug 26 22:06:51 2011 +0400
review upgrade script, some scrips were missing
diff --git a/TODO.porting_over_RT4 b/TODO.porting_over_RT4
index ef031fb..d51ff6b 100644
--- a/TODO.porting_over_RT4
+++ b/TODO.porting_over_RT4
@@ -17,8 +17,6 @@
* make sure we release DBIx::SB with cud-from-select branch
merged and depend on it
-* upgrade script that inserts new actions, conditions and scrips
-
* upgrade script that renames wrongly named scrips, we have
a few scrips that named wrongly
diff --git a/etc/upgrade/2.9.0/content b/etc/upgrade/2.9.0/content
index 190fcdc..2a8e927 100644
--- a/etc/upgrade/2.9.0/content
+++ b/etc/upgrade/2.9.0/content
@@ -20,6 +20,10 @@ our @ScripConditions = (
);
our @ScripActions = (
+ { Name => 'RTIR Set Block Status', # loc
+ Description => 'Set the status of a Block' , # loc
+ ExecModule => 'RTIR_SetBlockStatus',
+ },
{ Name => 'RTIR Activate Ticket', # loc
Description => 'Set status to first active possible', # loc
ExecModule => 'RTIR_Activate',
@@ -27,6 +31,16 @@ our @ScripActions = (
);
our @Scrips = (
+ { Description => "On Correspond Change Status of the Block",
+ Queue => 'Blocks',
+ ScripCondition => 'On Correspond',
+ ScripAction => 'RTIR Set Block Status',
+ Template => 'Blank', },
+ { Description => "On Linking To Incident Activate Report",
+ Queue => 'Incident Reports',
+ ScripCondition => 'RTIR Linking To Incident',
+ ScripAction => 'RTIR Activate Ticket',
+ Template => 'Blank' },
{ Description => "On Correspond (not every) Activate Report",
Queue => 'Incident Reports',
ScripCondition => 'RTIR Require IRs Activation',
commit dcac345ca8ae4a5cef2ba29aeb68460d75f47d9d
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Fri Aug 26 22:25:15 2011 +0400
rename wrongly named scrip
diff --git a/TODO.porting_over_RT4 b/TODO.porting_over_RT4
index d51ff6b..8f63afc 100644
--- a/TODO.porting_over_RT4
+++ b/TODO.porting_over_RT4
@@ -17,9 +17,6 @@
* make sure we release DBIx::SB with cud-from-select branch
merged and depend on it
-* upgrade script that renames wrongly named scrips, we have
- a few scrips that named wrongly
-
=== BRINGING UP TO DATE
* Some pages with forms need new nice layouts like in RT, reply
diff --git a/etc/initialdata b/etc/initialdata
index 5cf8f12..b46d14d 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -405,9 +405,7 @@
ScripAction => 'RTIR Activate Ticket',
Template => 'Blank' },
-
-# XXX: description is duplication, but set Due of the incident
- { Description => "SetRTIRState",
+ { Description => "Set Due Date On Incident",
Queue => ['Incident Reports', 'Investigations', 'Blocks' ],
ScripCondition => 'RTIR Require Due Change',
ScripAction => 'RTIR Set Incident Due',
diff --git a/etc/upgrade/2.9.0/content b/etc/upgrade/2.9.0/content
index 2a8e927..860d28b 100644
--- a/etc/upgrade/2.9.0/content
+++ b/etc/upgrade/2.9.0/content
@@ -347,6 +347,24 @@ our @Final = (
}
}
},
+
+ sub {
+ my $scrips = RT::Scrips->new( RT->SystemUser );
+ my $alias = $scrips->Join(
+ FIELD1 => 'ScripAction',
+ TABLE2 => 'ScripActions',
+ FIELD2 => 'id',
+ );
+ $scrips->Limit( FIELD => 'ExecModule', VALUE => 'RTIR_SetDueIncident' );
+ while ( my $scrip = $scrips->Next ) {
+ my $value = 'Set Due Date On Incident';
+ next if $scrip->Name eq $value;
+
+ my ($status, $msg) = $scrip->SetName( $value );
+ $RT::Logger->error("Couldn't set scrip's name: $msg")
+ unless $status;
+ }
+ },
);
commit 0bda6831cd4dbb6bed7fbd2ed4d0fab0b56b13aa
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 00:22:58 2011 +0400
s/loc('New')/loc('Create')/
'new' matches status, we don't have l18n contexts, so it's
not traslated really well
diff --git a/html/RTIR/Elements/IncidentSummary b/html/RTIR/Elements/IncidentSummary
index 8420ce5..509caf2 100644
--- a/html/RTIR/Elements/IncidentSummary
+++ b/html/RTIR/Elements/IncidentSummary
@@ -66,7 +66,7 @@
<tr>
<td colspan="5">
% if ($Type eq 'Report' or $Type eq 'Investigation' or $Type eq 'Block') {
-[<a href="<%RT->Config->Get('WebPath')%>/RTIR/Create.html?Child=<% $ticket %>&Queue=Incidents"><b><% loc('New') %></b></a>]
+[<a href="<%RT->Config->Get('WebPath')%>/RTIR/Create.html?Child=<% $ticket %>&Queue=Incidents"><b><% loc('Create') %></b></a>]
% }
[<a href="<%RT->Config->Get('WebPath')%>/RTIR/Search/Results.html?Queue=Incidents&<% $QueryString %>"><% loc("Refine Search") %></a>]
</td>
diff --git a/html/RTIR/Elements/ShowArticles b/html/RTIR/Elements/ShowArticles
index 9008b99..f062925 100644
--- a/html/RTIR/Elements/ShowArticles
+++ b/html/RTIR/Elements/ShowArticles
@@ -35,7 +35,7 @@ if ( $Ticket->CurrentUserHasRight('ModifyTicket') ) {
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/Articles/Article/PreCreate.html?$qs">}. loc('Create') .q{</a>},
qq{<a href="$web_path/RTIR/Incident/LinkArticles.html?id=$id">}. loc('Link') .q{</a>},
;
}
diff --git a/html/RTIR/Incident/Elements/ShowChildren b/html/RTIR/Incident/Elements/ShowChildren
index d1844a1..fb5d545 100644
--- a/html/RTIR/Incident/Elements/ShowChildren
+++ b/html/RTIR/Incident/Elements/ShowChildren
@@ -63,7 +63,7 @@ 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'),
+ title => $QueueObj->Name ne 'Investigations'? loc('Create') : loc('Launch'),
path => "/RTIR/Create.html?Incident=$id&Queue=$EscapedQueue",
};
}
commit aa444e1879629a1e3e1efcda760474afed117129
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 02:32:09 2011 +0400
drop unused code
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index ef7d635..0d38fdd 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -149,13 +149,6 @@ if ($Type eq 'Report') {
$name = $Type;
}
-my ($CanRespond, $CanComment) = ( 0, 0 );
-$CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or
- $Ticket->CurrentUserHasRight('ModifyTicket') );
-
-$CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or
- $Ticket->CurrentUserHasRight('ModifyTicket') );
-
my $constituency_cf = RT::IR->CustomFields( Constituency => Ticket => $Ticket );
my $constituency_propagation = RT->Config->Get('_RTIR_Constituency_Propagation');
commit c951ffbb888aa0ea1129f380fc250c57e77c9873
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 02:34:57 2011 +0400
move code lower, we don't need it during update
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index 0d38fdd..a599798 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -142,21 +142,6 @@ if ( $m->comp_exists("/RTIR/$Type/Edit.html") ) {
my @results;
-my $name;
-if ($Type eq 'Report') {
- $name = "Incident Report";
-} else {
- $name = $Type;
-}
-
-my $constituency_cf = RT::IR->CustomFields( Constituency => Ticket => $Ticket );
-my $constituency_propagation = RT->Config->Get('_RTIR_Constituency_Propagation');
-
-my $has_parent = 0;
-if ( $constituency_propagation eq 'reject' ) {
- $has_parent = RT::IR->Incidents( $Ticket )->Count;
-}
-
if ( $SaveChanges && !$OnlySearchForPeople ) {
my $checks_failure = 0;
push @results, ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS );
@@ -187,7 +172,22 @@ if ( $SaveChanges && !$OnlySearchForPeople ) {
return $m->comp("/RTIR/Display.html", %ARGS, id => $id);
}
}
-
+
+my $name;
+if ($Type eq 'Report') {
+ $name = "Incident Report";
+} else {
+ $name = $Type;
+}
+
+my $constituency_cf = RT::IR->CustomFields( Constituency => Ticket => $Ticket );
+my $constituency_propagation = RT->Config->Get('_RTIR_Constituency_Propagation');
+
+my $has_parent = 0;
+if ( $constituency_propagation eq 'reject' ) {
+ $has_parent = RT::IR->Incidents( $Ticket )->Count;
+}
+
# If they've gone and moved the ticket to somewhere they can't see, etc...
# TODO: display the results, even if we can't display the ticket.
commit a3ad9735273c84739220a1b8d6866ed0b06443d1
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 02:50:46 2011 +0400
variable for $TicketObj->QueueObj->Name chain
diff --git a/html/RTIR/Elements/EditDates b/html/RTIR/Elements/EditDates
index a21515c..8a2679e 100644
--- a/html/RTIR/Elements/EditDates
+++ b/html/RTIR/Elements/EditDates
@@ -36,9 +36,7 @@
<& /Elements/SelectDate, menu_prefix => 'Told', current => 0 &> (<% $TicketObj->ToldObj->AsString %>)
</td>
</tr>
-% if ($TicketObj->QueueObj->Name eq 'Incident Reports' ||
-% $TicketObj->QueueObj->Name eq 'Investigations' ||
-% $TicketObj->QueueObj->Name eq 'Blocks') {
+% if ($qname eq 'Incident Reports' || $qname eq 'Investigations' || $qname eq 'Blocks') {
<tr>
<td class="label"><&|/l&>Started</&>:</td>
<td class="entry">
@@ -46,7 +44,7 @@
</td>
</tr>
% }
-% if ($TicketObj->QueueObj->Name ne 'Incidents') {
+% if ($qname ne 'Incidents') {
<tr>
<td class="label"><&|/l&>Due</&>:</td>
<td class="entry">
@@ -60,4 +58,6 @@
<%ARGS>
$TicketObj => undef
</%ARGS>
-
+<%INIT>
+my $qname = $TicketObj->QueueObj->Name;
+</%INIT>
commit 597477b56cb6c5a1db1efd51a96f08275d4a0cb5
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 03:12:25 2011 +0400
EditDates: show defaults if passed in
diff --git a/html/RTIR/Elements/EditDates b/html/RTIR/Elements/EditDates
index 8a2679e..f6dbcef 100644
--- a/html/RTIR/Elements/EditDates
+++ b/html/RTIR/Elements/EditDates
@@ -25,22 +25,20 @@
<table>
<tr>
<td class="label"><&|/l&>Starts</&>:</td>
- <td class="entry"><& /Elements/SelectDate, menu_prefix => 'Starts', current => 0 &>
+ <td class="entry"><& /Elements/SelectDate, menu_prefix => 'Starts', Default => $Starts_Date &>
(<% $TicketObj->StartsObj->AsString %>)</td>
</tr>
<tr>
- <td class="label">
- <&|/l&>Last Contact</&>:
- </td>
+ <td class="label"><&|/l&>Last Contact</&>:</td>
<td class="entry">
- <& /Elements/SelectDate, menu_prefix => 'Told', current => 0 &> (<% $TicketObj->ToldObj->AsString %>)
+ <& /Elements/SelectDate, menu_prefix => 'Told', Default => $Told_Date &> (<% $TicketObj->ToldObj->AsString %>)
</td>
</tr>
% if ($qname eq 'Incident Reports' || $qname eq 'Investigations' || $qname eq 'Blocks') {
<tr>
<td class="label"><&|/l&>Started</&>:</td>
<td class="entry">
- <& /Elements/SelectDate, menu_prefix => 'Started', current => 0 &> (<% $TicketObj->DueObj->AsString %>)
+ <& /Elements/SelectDate, menu_prefix => 'Started', Default => $Started_Date &> (<% $TicketObj->DueObj->AsString %>)
</td>
</tr>
% }
@@ -48,7 +46,7 @@
<tr>
<td class="label"><&|/l&>Due</&>:</td>
<td class="entry">
- <& /Elements/SelectDate, menu_prefix => 'Due', current => 0 &> (<% $TicketObj->DueObj->AsString %>)
+ <& /Elements/SelectDate, menu_prefix => 'Due', Default => $Due_Date &> (<% $TicketObj->DueObj->AsString %>)
</td>
</tr>
% }
@@ -57,6 +55,11 @@
</table>
<%ARGS>
$TicketObj => undef
+
+$Starts_Date => undef
+$Told_Date => undef
+$Started_Date => undef
+$Due_Date => undef
</%ARGS>
<%INIT>
my $qname = $TicketObj->QueueObj->Name;
commit ec2dc75a3cecede57ca11ce3fa16a90c8cf70cfa
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 03:13:12 2011 +0400
EditDates: put started after starts like in RT
diff --git a/html/RTIR/Elements/EditDates b/html/RTIR/Elements/EditDates
index f6dbcef..b1ad644 100644
--- a/html/RTIR/Elements/EditDates
+++ b/html/RTIR/Elements/EditDates
@@ -28,12 +28,6 @@
<td class="entry"><& /Elements/SelectDate, menu_prefix => 'Starts', Default => $Starts_Date &>
(<% $TicketObj->StartsObj->AsString %>)</td>
</tr>
- <tr>
- <td class="label"><&|/l&>Last Contact</&>:</td>
- <td class="entry">
- <& /Elements/SelectDate, menu_prefix => 'Told', Default => $Told_Date &> (<% $TicketObj->ToldObj->AsString %>)
- </td>
- </tr>
% if ($qname eq 'Incident Reports' || $qname eq 'Investigations' || $qname eq 'Blocks') {
<tr>
<td class="label"><&|/l&>Started</&>:</td>
@@ -42,6 +36,12 @@
</td>
</tr>
% }
+ <tr>
+ <td class="label"><&|/l&>Last Contact</&>:</td>
+ <td class="entry">
+ <& /Elements/SelectDate, menu_prefix => 'Told', Default => $Told_Date &> (<% $TicketObj->ToldObj->AsString %>)
+ </td>
+ </tr>
% if ($qname ne 'Incidents') {
<tr>
<td class="label"><&|/l&>Due</&>:</td>
commit 84ef014559000f29b3bf4af543b2c51d838a2228
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 03:13:53 2011 +0400
use class="value" instead of entry
diff --git a/html/RTIR/Elements/EditDates b/html/RTIR/Elements/EditDates
index b1ad644..98f91f7 100644
--- a/html/RTIR/Elements/EditDates
+++ b/html/RTIR/Elements/EditDates
@@ -25,27 +25,27 @@
<table>
<tr>
<td class="label"><&|/l&>Starts</&>:</td>
- <td class="entry"><& /Elements/SelectDate, menu_prefix => 'Starts', Default => $Starts_Date &>
+ <td class="value"><& /Elements/SelectDate, menu_prefix => 'Starts', Default => $Starts_Date &>
(<% $TicketObj->StartsObj->AsString %>)</td>
</tr>
% if ($qname eq 'Incident Reports' || $qname eq 'Investigations' || $qname eq 'Blocks') {
<tr>
<td class="label"><&|/l&>Started</&>:</td>
- <td class="entry">
+ <td class="value">
<& /Elements/SelectDate, menu_prefix => 'Started', Default => $Started_Date &> (<% $TicketObj->DueObj->AsString %>)
</td>
</tr>
% }
<tr>
<td class="label"><&|/l&>Last Contact</&>:</td>
- <td class="entry">
+ <td class="value">
<& /Elements/SelectDate, menu_prefix => 'Told', Default => $Told_Date &> (<% $TicketObj->ToldObj->AsString %>)
</td>
</tr>
% if ($qname ne 'Incidents') {
<tr>
<td class="label"><&|/l&>Due</&>:</td>
- <td class="entry">
+ <td class="value">
<& /Elements/SelectDate, menu_prefix => 'Due', Default => $Due_Date &> (<% $TicketObj->DueObj->AsString %>)
</td>
</tr>
commit bc7b9159fa793fc0c9b74237f3ec258e0103416a
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 03:30:39 2011 +0400
mason tidy EditDates
diff --git a/html/RTIR/Elements/EditDates b/html/RTIR/Elements/EditDates
index 98f91f7..cfb3e1f 100644
--- a/html/RTIR/Elements/EditDates
+++ b/html/RTIR/Elements/EditDates
@@ -25,28 +25,37 @@
<table>
<tr>
<td class="label"><&|/l&>Starts</&>:</td>
- <td class="value"><& /Elements/SelectDate, menu_prefix => 'Starts', Default => $Starts_Date &>
- (<% $TicketObj->StartsObj->AsString %>)</td>
+ <td class="value"><& /Elements/SelectDate,
+ menu_prefix => 'Starts',
+ Default => $Starts_Date,
+ &> (<% $TicketObj->StartsObj->AsString %>)
+ </td>
</tr>
% if ($qname eq 'Incident Reports' || $qname eq 'Investigations' || $qname eq 'Blocks') {
<tr>
<td class="label"><&|/l&>Started</&>:</td>
- <td class="value">
- <& /Elements/SelectDate, menu_prefix => 'Started', Default => $Started_Date &> (<% $TicketObj->DueObj->AsString %>)
+ <td class="value"><& /Elements/SelectDate,
+ menu_prefix => 'Started',
+ Default => $Started_Date,
+ &> (<% $TicketObj->DueObj->AsString %>)
</td>
</tr>
% }
<tr>
<td class="label"><&|/l&>Last Contact</&>:</td>
- <td class="value">
- <& /Elements/SelectDate, menu_prefix => 'Told', Default => $Told_Date &> (<% $TicketObj->ToldObj->AsString %>)
+ <td class="value"><& /Elements/SelectDate,
+ menu_prefix => 'Told',
+ Default => $Told_Date,
+ &> (<% $TicketObj->ToldObj->AsString %>)
</td>
</tr>
% if ($qname ne 'Incidents') {
<tr>
<td class="label"><&|/l&>Due</&>:</td>
- <td class="value">
- <& /Elements/SelectDate, menu_prefix => 'Due', Default => $Due_Date &> (<% $TicketObj->DueObj->AsString %>)
+ <td class="value"><& /Elements/SelectDate,
+ menu_prefix => 'Due',
+ Default => $Due_Date,
+ &> (<% $TicketObj->DueObj->AsString %>)
</td>
</tr>
% }
commit 2fe30eb1eaed2bd571f53abd53f5b8dea0f3b836
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 03:31:17 2011 +0400
long if condition equivalent to "queue ne Incidents"
diff --git a/html/RTIR/Elements/EditDates b/html/RTIR/Elements/EditDates
index cfb3e1f..cd04fd1 100644
--- a/html/RTIR/Elements/EditDates
+++ b/html/RTIR/Elements/EditDates
@@ -31,7 +31,8 @@
&> (<% $TicketObj->StartsObj->AsString %>)
</td>
</tr>
-% if ($qname eq 'Incident Reports' || $qname eq 'Investigations' || $qname eq 'Blocks') {
+
+% if ($qname ne 'Incidents') {
<tr>
<td class="label"><&|/l&>Started</&>:</td>
<td class="value"><& /Elements/SelectDate,
commit e9cf7e12e4e8d80e3db313d7b1fbe655d5034aa7
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 03:32:09 2011 +0400
Due date was shown next to input for Started
diff --git a/html/RTIR/Elements/EditDates b/html/RTIR/Elements/EditDates
index cd04fd1..a4febae 100644
--- a/html/RTIR/Elements/EditDates
+++ b/html/RTIR/Elements/EditDates
@@ -38,7 +38,7 @@
<td class="value"><& /Elements/SelectDate,
menu_prefix => 'Started',
Default => $Started_Date,
- &> (<% $TicketObj->DueObj->AsString %>)
+ &> (<% $TicketObj->StartedObj->AsString %>)
</td>
</tr>
% }
commit c30ec9d24bc761e018aa99f3e3700d0abe89982c
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 03:33:01 2011 +0400
make sure SelectDate is not filled wiht NOW
diff --git a/html/RTIR/Elements/EditDates b/html/RTIR/Elements/EditDates
index a4febae..9f2df76 100644
--- a/html/RTIR/Elements/EditDates
+++ b/html/RTIR/Elements/EditDates
@@ -28,6 +28,7 @@
<td class="value"><& /Elements/SelectDate,
menu_prefix => 'Starts',
Default => $Starts_Date,
+ current => 0,
&> (<% $TicketObj->StartsObj->AsString %>)
</td>
</tr>
@@ -38,6 +39,7 @@
<td class="value"><& /Elements/SelectDate,
menu_prefix => 'Started',
Default => $Started_Date,
+ current => 0,
&> (<% $TicketObj->StartedObj->AsString %>)
</td>
</tr>
@@ -47,6 +49,7 @@
<td class="value"><& /Elements/SelectDate,
menu_prefix => 'Told',
Default => $Told_Date,
+ current => 0,
&> (<% $TicketObj->ToldObj->AsString %>)
</td>
</tr>
@@ -56,6 +59,7 @@
<td class="value"><& /Elements/SelectDate,
menu_prefix => 'Due',
Default => $Due_Date,
+ current => 0,
&> (<% $TicketObj->DueObj->AsString %>)
</td>
</tr>
@@ -66,10 +70,10 @@
<%ARGS>
$TicketObj => undef
-$Starts_Date => undef
-$Told_Date => undef
-$Started_Date => undef
-$Due_Date => undef
+$Starts_Date => ''
+$Told_Date => ''
+$Started_Date => ''
+$Due_Date => ''
</%ARGS>
<%INIT>
my $qname = $TicketObj->QueueObj->Name;
commit 83243c2b29d473e3b2cc83ae83f37c7d2bca665f
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 04:08:45 2011 +0400
use defaults from ARGS in Edit.html
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index a599798..a45dd75 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -56,19 +56,19 @@
Name => 'Status',
QueueObj => $Ticket->QueueObj,
DefaultValue => 0,
- Default => $Ticket->Status,
+ Default => $ARGS{'Status'} || $Ticket->Status,
&>
% }
</td>
</tr>
<tr>
<td class="label"><&|/l&>Subject</&>:</td>
- <td class="value"><input type="text" name="Subject" value="<%$Ticket->Subject|h%>" size="50" /></td>
+ <td class="value"><input type="text" name="Subject" value="<% $ARGS{'Subject'} || $Ticket->Subject %>" size="50" /></td>
</tr>
<tr>
<td class="label"><&|/l&>Owner</&>:</td>
<td><& /Elements/SelectOwner,
- Name => 'Owner', Default => $Ticket->Owner,
+ Name => 'Owner', Default => $ARGS{'Owner'} || $Ticket->Owner,
TicketObj => $Ticket, QueueObj => $Ticket->QueueObj,
&></td>
</tr>
@@ -106,7 +106,7 @@
<td valign="top" width="50%">
<&| /Widgets/TitleBox, title => loc('Dates'), width => "100%", class => 'ticket-info-dates' &>
-<& /RTIR/Elements/EditDates, TicketObj => $Ticket &>
+<& /RTIR/Elements/EditDates, %ARGS, TicketObj => $Ticket &>
</&>
</td>
@@ -116,7 +116,7 @@
<&| /Widgets/TitleBox, title => loc('People'),width => "100%", class => 'ticket-info-people' &>
-<& /RTIR/Elements/EditPeople, Ticket => $Ticket, UserField => $UserField, UserString => $UserString, UserOp => $UserOp &>
+<& /RTIR/Elements/EditPeople, %ARGS, Ticket => $Ticket &>
</&>
<br />
@@ -204,8 +204,4 @@ $id => undef
$SaveChanges => 0
$OnlySearchForPeople => undef
-
-$UserField => undef
-$UserOp => undef
-$UserString => undef
</%ARGS>
commit a3a2347913067b8e3dab23d4834cf0bf2941f04c
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 04:31:01 2011 +0400
don't process most things if checks failed
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index a45dd75..8e34755 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -141,11 +141,23 @@ if ( $m->comp_exists("/RTIR/$Type/Edit.html") ) {
}
my @results;
+my $checks_failure = 0;
+if ( $SaveChanges ) {
+ my $status = $m->comp('/Elements/ValidateCustomFields',
+ CustomFields => $Ticket->QueueObj->TicketCustomFields,
+ NamePrefix => "Object-RT::Ticket-$id-CustomField-",
+ ARGSRef => \%ARGS,
+ );
+ $checks_failure = 1 unless $status;
+}
+
+# XXX: process even if checks failed as EditPeople doesn't preserve state
if ( $SaveChanges && !$OnlySearchForPeople ) {
- my $checks_failure = 0;
push @results, ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS );
+}
+if ( $SaveChanges && !$checks_failure && !$OnlySearchForPeople ) {
my $strict_acl = RT->Config->Set( StrictLinkACL => 0 );
push @results, ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS );
RT->Config->Set( StrictLinkACL => $strict_acl );
@@ -157,16 +169,9 @@ if ( $SaveChanges && !$OnlySearchForPeople ) {
push @results, ProcessUpdateMessage( TicketObj => $Ticket, ARGSRef=>\%ARGS );
push @results, ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS );
- my ($status, @msg) = $m->comp('/Elements/ValidateCustomFields',
- CustomFields => $Ticket->QueueObj->TicketCustomFields,
- NamePrefix => "Object-RT::Ticket-$id-CustomField-",
- ARGSRef => \%ARGS,
- );
- # we don't use messages as later ProcessTicketCustomFieldUpdates do that for us
- $checks_failure = 1 unless $status;
push @results, ProcessTicketCustomFieldUpdates( ARGSRef => \%ARGS );
- if ( !$checks_failure && RT->Config->Get('DisplayAfterEdit', $session{'CurrentUser'}) ) {
+ if ( RT->Config->Get('DisplayAfterEdit', $session{'CurrentUser'}) ) {
$m->callback(CallbackName => 'BeforeDisplay', ARGSRef => \%ARGS, Ticket => $Ticket);
push @{ $session{'Actions'}{''} ||= [] }, @results;
return $m->comp("/RTIR/Display.html", %ARGS, id => $id);
commit e1660f22b1a61f30426ec1342909e073bad7cd20
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 04:47:22 2011 +0400
workaround annoying error message from ProcessTicketWatchers
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index 8e34755..025d853 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -154,6 +154,14 @@ if ( $SaveChanges ) {
# XXX: process even if checks failed as EditPeople doesn't preserve state
if ( $SaveChanges && !$OnlySearchForPeople ) {
+
+ # XXX: ProcessTicketWatchers doesn't like WatcherTypeEmailX with
+ # empty WatcherAddressEmailX
+ delete $ARGS{"WatcherTypeEmail$_"} foreach
+ grep !$ARGS{"WatcherAddressEmail$_"} && $ARGS{"WatcherTypeEmail$_"},
+ 1..3
+ ;
+
push @results, ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS );
}
commit 66eb3ef2546b8b6f3da8b5a06056b7f550f73c91
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 04:52:09 2011 +0400
filter out RT's addresses from watchers/recipients
diff --git a/TODO.porting_over_RT4 b/TODO.porting_over_RT4
index 8f63afc..4aaf7e9 100644
--- a/TODO.porting_over_RT4
+++ b/TODO.porting_over_RT4
@@ -29,9 +29,6 @@
* tranasaction custom fields
-* protection from mail loops by filtering watchers' email addresses on
- Create/PeopleModify, like we have in RT
-
=== FIXES
* Don't see Articles on IR's Update.html
diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index 35fef8f..720a84d 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -426,6 +426,14 @@ unless ( $skip_create ) {
}
}
+unless ( $skip_create ) {
+ $checks_failure += RT::IR->FilterRTAddresses(
+ ARGSRef => \%ARGS,
+ Fields => { Requestors => 'Requestor', Cc => 'Cc', AdminCc => 'AdminCc' },
+ results => \@results,
+ );
+}
+
# for RTFM and other things
$m->callback(
CallbackName => 'BeforeCreate', CallbackPage => '/Ticket/Create.html',
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index 025d853..b7380c2 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -152,6 +152,17 @@ if ( $SaveChanges ) {
$checks_failure = 1 unless $status;
}
+if ( $SaveChanges ) {
+ $checks_failure += RT::IR->FilterRTAddresses(
+ ARGSRef => \%ARGS,
+ Fields => {
+ map { ("WatcherAddressEmail$_" => $ARGS{"WatcherTypeEmail$_"}) }
+ grep $ARGS{"WatcherTypeEmail$_"}, 1..3
+ },
+ results => \@results,
+ );
+}
+
# XXX: process even if checks failed as EditPeople doesn't preserve state
if ( $SaveChanges && !$OnlySearchForPeople ) {
diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index dfe0720..a8d304e 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -343,6 +343,24 @@ if ( $CreateIncident ) {
$checks_failure = 1;
}
+ $checks_failure += RT::IR->FilterRTAddresses(
+ ARGSRef => \%ARGS,
+ Fields => { Requestors => 'Requestor', Cc => 'Cc', AdminCc => 'AdminCc' },
+ results => \@results,
+ );
+
+ if ( $CreateWithInvestigation ) {
+ $checks_failure += RT::IR->FilterRTAddresses(
+ ARGSRef => \%ARGS,
+ Fields => {
+ InvestigationRequestors => 'Requestor',
+ InvestigationCc => 'Cc',
+ InvestigationAdminCc => 'AdminCc',
+ },
+ results => \@results,
+ );
+ }
+
if ( $CreateWithInvestigation && !$ARGS{'InvestigationRequestors'} ) {
push @results, loc( "You must enter a correspondent for the investigation" );
$checks_failure = 1;
diff --git a/html/RTIR/Update.html b/html/RTIR/Update.html
index 7060ab0..9783522 100644
--- a/html/RTIR/Update.html
+++ b/html/RTIR/Update.html
@@ -26,6 +26,8 @@
<& /Elements/Tabs &>
% $m->callback(CallbackName => 'BeforeActionList', ARGSRef => \%ARGS, Ticket => $Ticket);
+<& /Elements/ListActions, actions => \@results &>
+
<form action="Update.html" name="TicketUpdate" method="post" enctype="multipart/form-data">
<input type="hidden" name="id" value="<% $id %>" />
<input type="hidden" name="QuoteTransaction" value="<% $ARGS{'QuoteTransaction'} || '' %>" />
@@ -154,14 +156,14 @@ $CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or
$m->comp( '/RTIR/Create.html:ProcessAttachments', %ARGS );
-my $checks_failure;
+my (@results, $checks_failure);
my $gnupg_widget = $m->comp('/Elements/GnuPG/SignEncryptWidget:new', Arguments => \%ARGS );
$m->comp( '/Elements/GnuPG/SignEncryptWidget:Process',
self => $gnupg_widget,
TicketObj => $Ticket,
);
-if ( $ARGS{'SubmitTicket'} ) {
+if ( $SubmitTicket ) {
my $status = $m->comp('/Elements/GnuPG/SignEncryptWidget:Check',
self => $gnupg_widget,
TicketObj => $Ticket,
@@ -169,13 +171,21 @@ if ( $ARGS{'SubmitTicket'} ) {
$checks_failure = 1 unless $status;
}
-if ( !$checks_failure && exists $ARGS{SubmitTicket} ) {
+if ( $SubmitTicket ) {
+ $checks_failure += RT::IR->FilterRTAddresses(
+ ARGSRef => \%ARGS,
+ Fields => { UpdateCc => 'Cc', UpdateBcc => 'Bcc' },
+ results => \@results,
+ );
+}
+
+if ( !$checks_failure && $SubmitTicket ) {
my %checked = map {$_ => 1} grep {defined} @TxnSendMailTo;
my @squelchlist = grep {not $checked{$_}} split /,/, $TxnRecipients;
$ARGS{'SquelchMailTo'} = \@squelchlist if @squelchlist;
}
-if ( !$checks_failure && exists $ARGS{SubmitTicket} ) {
+if ( !$checks_failure && $SubmitTicket ) {
$m->callback(CallbackName => 'BeforeDisplay', ARGSRef => \%ARGS, Ticket => $Ticket);
return $m->comp('/RTIR/Display.html', %ARGS);
@@ -189,4 +199,6 @@ $Status => undef
$Action => undef
@TxnSendMailTo => ()
$TxnRecipients => ''
+
+$SubmitTicket => undef
</%ARGS>
diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 350525e..e404535 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -531,6 +531,29 @@ sub _FlushCustomFieldsCache {
%cache = ()
} }
+
+sub FilterRTAddresses {
+ my $self = shift;
+ my %args = (ARGSRef => undef, Fields => {}, results => [], @_);
+
+ my $cu = do { no warnings 'once'; $HTML::Mason::Commands::session{'CurrentUser'} };
+
+ my $found = 0;
+ while ( my ($field, $display) = each %{ $args{'Fields'} } ) {
+ my $value = $args{'ARGSRef'}{ $field };
+ next unless defined $value && length $value;
+
+ my @emails = Email::Address->parse( $value );
+ foreach my $email ( grep RT::EmailParser->IsRTAddress($_->address), @emails ) {
+ push @{ $args{'results'} }, $cu->loc("[_1] is an address RT receives mail at. Adding it as a '[_2]' would create a mail loop", $email->format, $cu->loc($display) );
+ $found = 1;
+ $email = undef;
+ }
+ $args{'ARGSRef'}{ $field } = join ', ', map $_->format, grep defined, @emails;
+ }
+ return $found;
+}
+
{ my $cache;
sub HasConstituency {
return $cache if defined $cache;
commit 5dc5a0a80245f1726d0b3b4a3cfd17511a8df27c
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 05:12:36 2011 +0400
TitleBox has no width argument
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index b7380c2..4880a0c 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -39,11 +39,7 @@
<table border="0" cellspacing="2" cellpadding="0" width="100%">
<tr>
<td valign="top" width="50%">
-<&| /Widgets/TitleBox,
- title => loc("The Basics"),
- class => 'ticket-info-basics',
- width => "100%",
-&>
+<&| /Widgets/TitleBox, title => loc("The Basics"), class => 'ticket-info-basics' &>
<table>
<tr>
@@ -105,7 +101,7 @@
<tr>
<td valign="top" width="50%">
-<&| /Widgets/TitleBox, title => loc('Dates'), width => "100%", class => 'ticket-info-dates' &>
+<&| /Widgets/TitleBox, title => loc('Dates'), class => 'ticket-info-dates' &>
<& /RTIR/Elements/EditDates, %ARGS, TicketObj => $Ticket &>
</&>
@@ -115,7 +111,7 @@
<br />
-<&| /Widgets/TitleBox, title => loc('People'),width => "100%", class => 'ticket-info-people' &>
+<&| /Widgets/TitleBox, title => loc('People'), class => 'ticket-info-people' &>
<& /RTIR/Elements/EditPeople, %ARGS, Ticket => $Ticket &>
</&>
commit 1ca5575ba4f358021a49f6423f24819fc061ec34
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 05:28:18 2011 +0400
drop not used code
diff --git a/html/RTIR/Incident/Edit.html b/html/RTIR/Incident/Edit.html
index 10d48aa..d762b3e 100644
--- a/html/RTIR/Incident/Edit.html
+++ b/html/RTIR/Incident/Edit.html
@@ -106,21 +106,10 @@
<%INIT>
my $Ticket = LoadTicket($id);
-
$id = $ARGS{'id'} = $Ticket->Id;
-
$m->callback(CallbackName => 'Initial', %ARGS, Ticket => $Ticket);
-my $CanRespond = 0;
-my $CanComment = 0;
-
-$CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or
- $Ticket->CurrentUserHasRight('ModifyTicket') );
-
-$CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or
- $Ticket->CurrentUserHasRight('ModifyTicket') );
-
my $constituency_cf = RT::IR->CustomFields( Constituency => Ticket => $Ticket );
my $constituency_propagation = RT->Config->Get('_RTIR_Constituency_Propagation');
my $has_children = 0;
commit 8486b730ae46b9bc35da6ae2a3380089a3581696
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 05:29:58 2011 +0400
we should use return in html pages
aborting means that footer is not showed
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index 4880a0c..705994f 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -30,7 +30,7 @@
% if (!$Ticket->CurrentUserHasRight('ModifyTicket')) {
<%loc("You are not allowed to edit this [_1].", $name)%>
-% $m->abort();
+% return;
% }
<form method="post" action="Edit.html" enctype="multipart/form-data">
commit 26a666f978272393d8c53c2ebc2e160a38a20916
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 05:31:15 2011 +0400
minor tweaks: element class, tidy
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index 705994f..3bc6899 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -28,13 +28,13 @@
% $m->callback(CallbackName => 'BeforeActionList', Actions => \@results, ARGSRef => \%ARGS, Ticket => $Ticket);
<& /Elements/ListActions, actions => \@results &>
-% if (!$Ticket->CurrentUserHasRight('ModifyTicket')) {
-<%loc("You are not allowed to edit this [_1].", $name)%>
+% unless ($Ticket->CurrentUserHasRight('ModifyTicket')) {
+<% loc("You are not allowed to edit this [_1].", $name) %>
% return;
% }
<form method="post" action="Edit.html" enctype="multipart/form-data">
-<input type="hidden" name="id" value="<%$Ticket->Id%>" />
+<input type="hidden" name="id" value="<% $id %>" />
<table border="0" cellspacing="2" cellpadding="0" width="100%">
<tr>
@@ -81,7 +81,7 @@
</tr>
% if ( $constituency_cf && ($constituency_propagation ne 'reject' || !$has_parent) ) {
<tr>
- <td class="labeltop"><&|/l&>Constituency</&>:</td>
+ <td class="label"><&|/l&>Constituency</&>:</td>
<td class="value">
<& /RTIR/Elements/EditRTIRField,
TicketObj => $Ticket,
commit 66b2a431c0f7bb691a51fa364cf338039cf6b5fa
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 05:32:01 2011 +0400
missing localization
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index 3bc6899..2211ce7 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -46,7 +46,7 @@
<td class="label"><&|/l&>Status</&>:</td>
<td class="value" colspan="2">
% unless ( $Type eq 'Block' ) {
- <% $Ticket->Status %>
+ <% loc($Ticket->Status) %>
% } else {
<& /Elements/SelectStatus,
Name => 'Status',
commit 5118a387d57acd1f232c60f1ad5fc3bed344f9ec
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 05:50:30 2011 +0400
minor changes
required for further commits to make them clearer
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index 2211ce7..32e70e3 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -22,7 +22,9 @@
%#
%#
%# END LICENSE BLOCK
-<& /RTIR/Elements/Header, Title => $Title &>
+<& /RTIR/Elements/Header,
+ Title => loc("Edit [_1] #[_2]: [_3]", $name, $Ticket->Id, $Ticket->Subject),
+&>
<& /Elements/Tabs &>
% $m->callback(CallbackName => 'BeforeActionList', Actions => \@results, ARGSRef => \%ARGS, Ticket => $Ticket);
@@ -79,13 +81,14 @@
Default => $ARGS{'TimeWorked'} || $Ticket->TimeWorked || '',
&></td>
</tr>
-% if ( $constituency_cf && ($constituency_propagation ne 'reject' || !$has_parent) ) {
+% if ( $constituency_cf && ( $constituency_propagation ne 'reject' || !$has_parent ) ) {
<tr>
<td class="label"><&|/l&>Constituency</&>:</td>
<td class="value">
<& /RTIR/Elements/EditRTIRField,
TicketObj => $Ticket,
- Name => 'Constituency' &>
+ Name => 'Constituency',
+ &>
</td>
</tr>
% }
@@ -115,9 +118,9 @@
<& /RTIR/Elements/EditPeople, %ARGS, Ticket => $Ticket &>
</&>
-<br />
-
-<& /Elements/Submit, Name => 'SaveChanges', Label => loc('Save Changes'), Caption => loc("If you've updated anything above, be sure to"), color => "#333399" &>
+<& /Elements/Submit, Name => 'SaveChanges', Label => loc('Save Changes'),
+ Caption => loc("If you've updated anything above, be sure to"), color => "#333399",
+&>
</form>
<%INIT>
@@ -214,9 +217,6 @@ if ( $constituency_propagation eq 'reject' ) {
unless ($Ticket->CurrentUserHasRight('ShowTicket')) {
Abort("No permission to view ticket");
}
-
-my $Title = loc("Edit [_1] #[_2]: [_3]", $name, $Ticket->Id, $Ticket->Subject);
-
</%INIT>
<%ARGS>
commit 40f30579dad7294a290372b374e7761df4217be0
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 06:04:35 2011 +0400
use value class for TD
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index 32e70e3..294adcf 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -65,7 +65,7 @@
</tr>
<tr>
<td class="label"><&|/l&>Owner</&>:</td>
- <td><& /Elements/SelectOwner,
+ <td class="value"><& /Elements/SelectOwner,
Name => 'Owner', Default => $ARGS{'Owner'} || $Ticket->Owner,
TicketObj => $Ticket, QueueObj => $Ticket->QueueObj,
&></td>
commit 378d409795f758e2e78a956079080afea223b6bf
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 06:10:50 2011 +0400
order fields in editor like they are in RT
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index 294adcf..ee3ab03 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -45,6 +45,10 @@
<table>
<tr>
+ <td class="label"><&|/l&>Subject</&>:</td>
+ <td class="value"><input type="text" name="Subject" value="<% $ARGS{'Subject'} || $Ticket->Subject %>" size="50" /></td>
+ </tr>
+ <tr>
<td class="label"><&|/l&>Status</&>:</td>
<td class="value" colspan="2">
% unless ( $Type eq 'Block' ) {
@@ -60,10 +64,6 @@
</td>
</tr>
<tr>
- <td class="label"><&|/l&>Subject</&>:</td>
- <td class="value"><input type="text" name="Subject" value="<% $ARGS{'Subject'} || $Ticket->Subject %>" size="50" /></td>
- </tr>
- <tr>
<td class="label"><&|/l&>Owner</&>:</td>
<td class="value"><& /Elements/SelectOwner,
Name => 'Owner', Default => $ARGS{'Owner'} || $Ticket->Owner,
commit b6b97066020c117dd9088dbcce9dd026f5db924f
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 06:12:00 2011 +0400
refactoring of RTIR/Incident/Edit.html for merge
repeat recent changes in RTIR/Edit.html to show that
Incident's version actually is not that different
from generic one and we can merge them.
Now difference is minimal to make merge
diff --git a/html/RTIR/Incident/Edit.html b/html/RTIR/Incident/Edit.html
index d762b3e..ccb933c 100644
--- a/html/RTIR/Incident/Edit.html
+++ b/html/RTIR/Incident/Edit.html
@@ -22,7 +22,9 @@
%#
%#
%# END LICENSE BLOCK
-<& /RTIR/Elements/Header, Title => loc("Edit Incident #[_1]: [_2]", $Ticket->Id, $Ticket->Subject) &>
+<& /RTIR/Elements/Header,
+ Title => loc("Edit Incident #[_1]: [_2]", $Ticket->Id, $Ticket->Subject),
+&>
<& /Elements/Tabs &>
% $m->callback(CallbackName => 'BeforeActionList', Actions => \@results, ARGSRef => \%ARGS, Ticket => $Ticket);
@@ -39,26 +41,23 @@
<table border="0" cellspacing="2" cellpadding="0" width="100%">
<tr>
<td valign="top" width="50%">
-<&| /Widgets/TitleBox, title => loc('Modify incident # [_1]', $Ticket->Id), class => 'ticket-info-basics' &>
+<&| /Widgets/TitleBox, title => loc("The Basics"), class => 'ticket-info-basics' &>
<table>
<tr>
- <td class="label"><&|/l&>Status</&>:</td>
- <td><% loc($Ticket->Status) %></td></tr>
- </tr>
- <tr>
- <td class="label"><&|/l&>Owner</&>:</td>
- <td class="value">
- <& /Elements/SelectOwner, Name => 'Owner', QueueObj => $Ticket->QueueObj, TicketObj => $Ticket, Default => $Ticket->Owner &>
- </td>
+ <td class="label"><&|/l&>Subject</&>:</td>
+ <td class="value"><input type="text" name="Subject" value="<% $ARGS{'Subject'} || $Ticket->Subject %>" size="50" /></td>
</tr>
<tr>
- <td class="label"><&|/l&>Subject</&>:</td>
- <td class="value"><input type="text" name="Subject" value="<%$Ticket->Subject|h%>" size="50" /></td>
+ <td class="label"><&|/l&>Status</&>:</td>
+ <td><% loc($Ticket->Status) %></td>
</tr>
<tr>
- <td class="label"><&|/l&>Priority</&>:</td>
- <td class="value"><&/Elements/SelectPriority, Name=>"Priority", Default=>$Ticket->Priority &></td>
+ <td class="label"><&|/l&>Owner</&>:</td>
+ <td class="value"><& /Elements/SelectOwner,
+ Name => 'Owner', Default => $ARGS{'Owner'} || $Ticket->Owner,
+ TicketObj => $Ticket, QueueObj => $Ticket->QueueObj,
+ &></td>
</tr>
<tr>
<td class="label"><&|/l&>Time Worked</&>:</td>
@@ -67,14 +66,19 @@
Default => $ARGS{'TimeWorked'} || $Ticket->TimeWorked || '',
&></td>
</tr>
-% if ( $constituency_cf && ( $constituency_propagation ne 'reject' || !$has_children )) {
+ <tr>
+ <td class="label"><&|/l&>Priority</&>:</td>
+ <td class="value"><&/Elements/SelectPriority, Name=>"Priority", Default=>$Ticket->Priority &></td>
+ </tr>
+% if ( $constituency_cf && ( $constituency_propagation ne 'reject' || !$has_children ) ) {
<tr>
<td class="label"><&|/l&>Constituency</&>:</td>
<td class="value">
<& /RTIR/Elements/EditRTIRField,
TicketObj => $Ticket,
- Name => 'Constituency',
- Rows => 1 &>
+ Name => 'Constituency',
+ Rows => 1,
+ &>
</td>
</tr>
% }
@@ -91,7 +95,7 @@
<td valign="top" width="50%">
<&| /Widgets/TitleBox, title => loc('Dates'), class => 'ticket-info-dates' &>
-<& /RTIR/Elements/EditDates, TicketObj => $Ticket &>
+<& /RTIR/Elements/EditDates, %ARGS, TicketObj => $Ticket &>
</&>
</td>
@@ -110,46 +114,70 @@ $id = $ARGS{'id'} = $Ticket->Id;
$m->callback(CallbackName => 'Initial', %ARGS, Ticket => $Ticket);
-my $constituency_cf = RT::IR->CustomFields( Constituency => Ticket => $Ticket );
-my $constituency_propagation = RT->Config->Get('_RTIR_Constituency_Propagation');
-my $has_children = 0;
-if ( $constituency_cf && $constituency_propagation eq 'reject' ) {
- $has_children = RT::IR->IncidentChildren( $Ticket )->Count;
-}
-
my @results;
-if ( $SaveChanges && !$OnlySearchForPeople ) {
- my $checks_failure = 0;
- push @results, ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS);
- push @results, ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS);
+my $checks_failure = 0;
- my ($status, @msg) = $m->comp('/Elements/ValidateCustomFields',
+if ( $SaveChanges ) {
+ my $status = $m->comp('/Elements/ValidateCustomFields',
CustomFields => $Ticket->QueueObj->TicketCustomFields,
NamePrefix => "Object-RT::Ticket-$id-CustomField-",
ARGSRef => \%ARGS,
);
- # we don't use messages as later ProcessTicketCustomFieldUpdates do that for us
$checks_failure = 1 unless $status;
- push @results, ProcessTicketCustomFieldUpdates(ARGSRef => \%ARGS);
+}
- push @results, ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS);
+if ( $SaveChanges ) {
+ $checks_failure += RT::IR->FilterRTAddresses(
+ ARGSRef => \%ARGS,
+ Fields => {
+ map { ("WatcherAddressEmail$_" => $ARGS{"WatcherTypeEmail$_"}) }
+ grep $ARGS{"WatcherTypeEmail$_"}, 1..3
+ },
+ results => \@results,
+ );
+}
+
+# XXX: process even if checks failed as EditPeople doesn't preserve state
+if ( $SaveChanges && !$OnlySearchForPeople ) {
+
+ # XXX: ProcessTicketWatchers doesn't like WatcherTypeEmailX with
+ # empty WatcherAddressEmailX
+ delete $ARGS{"WatcherTypeEmail$_"} foreach
+ grep !$ARGS{"WatcherAddressEmail$_"} && $ARGS{"WatcherTypeEmail$_"},
+ 1..3
+ ;
+
+ push @results, ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS );
+}
+if ( $SaveChanges && !$checks_failure && !$OnlySearchForPeople ) {
my $strict_acl = RT->Config->Set( StrictLinkACL => 0 );
push @results, ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS);
RT->Config->Set( StrictLinkACL => $strict_acl );
- $ARGS{UpdateAttachments} = $session{'Attachments'};
- push @results, ProcessUpdateMessage( TicketObj => $Ticket, ARGSRef=>\%ARGS );
+ push @results, ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS);
- if ( !$checks_failure && RT->Config->Get('DisplayAfterEdit', $session{'CurrentUser'}) ) {
- $m->callback(CallbackName => 'BeforeDisplay', ARGSRef => \%ARGS, Ticket => $Ticket);
+ $ARGS{UpdateAttachments} = delete $session{'Attachments'};
+ push @results, ProcessUpdateMessage( TicketObj => $Ticket, ARGSRef=>\%ARGS );
+ push @results, ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS);
- push @{ $session{'Actions'}{''} ||= [] }, @results;
+ push @results, ProcessTicketCustomFieldUpdates(ARGSRef => \%ARGS);
+ if ( RT->Config->Get('DisplayAfterEdit', $session{'CurrentUser'}) ) {
+ $m->callback(CallbackName => 'BeforeDisplay', ARGSRef => \%ARGS, Ticket => $Ticket);
+ push @{ $session{'Actions'}{''} ||= [] }, @results;
return $m->comp("/RTIR/Incident/Display.html", %ARGS, id => $id );
}
}
+my $constituency_cf = RT::IR->CustomFields( Constituency => Ticket => $Ticket );
+my $constituency_propagation = RT->Config->Get('_RTIR_Constituency_Propagation');
+
+my $has_children = 0;
+if ( $constituency_cf && $constituency_propagation eq 'reject' ) {
+ $has_children = RT::IR->IncidentChildren( $Ticket )->Count;
+}
+
# If they've gone and moved the ticket to somewhere they can't see, etc...
# TODO: display the results, even if we can't display the ticket.
@@ -159,9 +187,9 @@ unless ($Ticket->CurrentUserHasRight('ShowTicket')) {
</%INIT>
<%ARGS>
-$OnlySearchForPeople => undef
-$SaveChanges => undef
-
$id => undef
+
+$SaveChanges => undef
+$OnlySearchForPeople => undef
</%ARGS>
commit e9ab035af7d6416037850cd12dced0cd24a1815f
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 06:46:33 2011 +0400
merge Incident/Edit.html -> Edit.html
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index ee3ab03..82c5beb 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -70,10 +70,12 @@
TicketObj => $Ticket, QueueObj => $Ticket->QueueObj,
&></td>
</tr>
+% if ( $Type ne 'Incident' ) {
<tr>
<td class="label"><%loc("Incident")%>:</td>
<td class="value"><& /RTIR/Elements/ShowIncidents, Ticket => $Ticket &></td>
</tr>
+% }
<tr>
<td class="label"><&|/l&>Time Worked</&>:</td>
<td class="value"><& /Elements/EditTimeValue,
@@ -81,7 +83,13 @@
Default => $ARGS{'TimeWorked'} || $Ticket->TimeWorked || '',
&></td>
</tr>
-% if ( $constituency_cf && ( $constituency_propagation ne 'reject' || !$has_parent ) ) {
+% if ( $Type eq 'Incident' ) {
+ <tr>
+ <td class="label"><&|/l&>Priority</&>:</td>
+ <td class="value"><&/Elements/SelectPriority, Name => 'Priority', Default => $ARGS{'Priority'} || $Ticket->Priority &></td>
+ </tr>
+% }
+% if ( $constituency_cf && ( $constituency_propagation ne 'reject' || !$is_linked ) ) {
<tr>
<td class="label"><&|/l&>Constituency</&>:</td>
<td class="value">
@@ -113,10 +121,11 @@
</table>
<br />
-
+% if ( $Type ne 'Incident' ) {
<&| /Widgets/TitleBox, title => loc('People'), class => 'ticket-info-people' &>
<& /RTIR/Elements/EditPeople, %ARGS, Ticket => $Ticket &>
</&>
+% }
<& /Elements/Submit, Name => 'SaveChanges', Label => loc('Save Changes'),
Caption => loc("If you've updated anything above, be sure to"), color => "#333399",
@@ -206,9 +215,12 @@ if ($Type eq 'Report') {
my $constituency_cf = RT::IR->CustomFields( Constituency => Ticket => $Ticket );
my $constituency_propagation = RT->Config->Get('_RTIR_Constituency_Propagation');
-my $has_parent = 0;
-if ( $constituency_propagation eq 'reject' ) {
- $has_parent = RT::IR->Incidents( $Ticket )->Count;
+my $is_linked = 0;
+if ( $constituency_cf && $constituency_propagation eq 'reject' ) {
+ $is_linked = $Type eq 'Incident'
+ ? RT::IR->IncidentChildren( $Ticket )->Count
+ : RT::IR->Incidents( $Ticket )->Count
+ ;
}
# If they've gone and moved the ticket to somewhere they can't see, etc...
diff --git a/html/RTIR/Incident/Edit.html b/html/RTIR/Incident/Edit.html
deleted file mode 100644
index ccb933c..0000000
--- a/html/RTIR/Incident/Edit.html
+++ /dev/null
@@ -1,195 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%#
-%# Copyright (c) 1996-2002 Jesse Vincent <jesse at bestpractical.com>
-%#
-%# (Except where explictly superceded by other copyright notices)
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-%# General Public License for more details.
-%#
-%#
-%# Unless otherwise specified, all modifications, corrections or
-%# extensions to this work which alter its source code become the
-%# property of Best Practical Solutions, LLC when submitted for
-%# inclusion in the work.
-%#
-%#
-%# END LICENSE BLOCK
-<& /RTIR/Elements/Header,
- Title => loc("Edit Incident #[_1]: [_2]", $Ticket->Id, $Ticket->Subject),
-&>
-<& /Elements/Tabs &>
-
-% $m->callback(CallbackName => 'BeforeActionList', Actions => \@results, ARGSRef => \%ARGS, Ticket => $Ticket);
-<& /Elements/ListActions, actions => \@results &>
-
-% unless ( $Ticket->CurrentUserHasRight('ModifyTicket') ) {
-<&|/l&>You are not allowed to edit this Incident.</&>
-% return;
-% }
-
-<form method="post" action="Edit.html" enctype="multipart/form-data">
-<input type="hidden" name="id" value="<% $id %>" />
-
-<table border="0" cellspacing="2" cellpadding="0" width="100%">
-<tr>
-<td valign="top" width="50%">
-<&| /Widgets/TitleBox, title => loc("The Basics"), class => 'ticket-info-basics' &>
-
-<table>
- <tr>
- <td class="label"><&|/l&>Subject</&>:</td>
- <td class="value"><input type="text" name="Subject" value="<% $ARGS{'Subject'} || $Ticket->Subject %>" size="50" /></td>
- </tr>
- <tr>
- <td class="label"><&|/l&>Status</&>:</td>
- <td><% loc($Ticket->Status) %></td>
- </tr>
- <tr>
- <td class="label"><&|/l&>Owner</&>:</td>
- <td class="value"><& /Elements/SelectOwner,
- Name => 'Owner', Default => $ARGS{'Owner'} || $Ticket->Owner,
- TicketObj => $Ticket, QueueObj => $Ticket->QueueObj,
- &></td>
- </tr>
- <tr>
- <td class="label"><&|/l&>Time Worked</&>:</td>
- <td class="value"><& /Elements/EditTimeValue,
- Name => 'TimeWorked',
- Default => $ARGS{'TimeWorked'} || $Ticket->TimeWorked || '',
- &></td>
- </tr>
- <tr>
- <td class="label"><&|/l&>Priority</&>:</td>
- <td class="value"><&/Elements/SelectPriority, Name=>"Priority", Default=>$Ticket->Priority &></td>
- </tr>
-% if ( $constituency_cf && ( $constituency_propagation ne 'reject' || !$has_children ) ) {
- <tr>
- <td class="label"><&|/l&>Constituency</&>:</td>
- <td class="value">
- <& /RTIR/Elements/EditRTIRField,
- TicketObj => $Ticket,
- Name => 'Constituency',
- Rows => 1,
- &>
- </td>
- </tr>
-% }
-
- <& /RTIR/Elements/EditCustomFields, %ARGS, TicketObj => $Ticket &>
-
-</table>
-
-</&>
-
-</td>
-</tr>
-<tr>
-<td valign="top" width="50%">
-
-<&| /Widgets/TitleBox, title => loc('Dates'), class => 'ticket-info-dates' &>
-<& /RTIR/Elements/EditDates, %ARGS, TicketObj => $Ticket &>
-</&>
-
-</td>
-</tr>
-</table>
-<br />
-
-<& /Elements/Submit, Name => 'SaveChanges', Label => loc('Save Changes'),
- Caption => loc("If you've updated anything above, be sure to"), color => "#333399",
-&>
-</form>
-
-<%INIT>
-my $Ticket = LoadTicket($id);
-$id = $ARGS{'id'} = $Ticket->Id;
-
-$m->callback(CallbackName => 'Initial', %ARGS, Ticket => $Ticket);
-
-my @results;
-my $checks_failure = 0;
-
-if ( $SaveChanges ) {
- my $status = $m->comp('/Elements/ValidateCustomFields',
- CustomFields => $Ticket->QueueObj->TicketCustomFields,
- NamePrefix => "Object-RT::Ticket-$id-CustomField-",
- ARGSRef => \%ARGS,
- );
- $checks_failure = 1 unless $status;
-}
-
-if ( $SaveChanges ) {
- $checks_failure += RT::IR->FilterRTAddresses(
- ARGSRef => \%ARGS,
- Fields => {
- map { ("WatcherAddressEmail$_" => $ARGS{"WatcherTypeEmail$_"}) }
- grep $ARGS{"WatcherTypeEmail$_"}, 1..3
- },
- results => \@results,
- );
-}
-
-# XXX: process even if checks failed as EditPeople doesn't preserve state
-if ( $SaveChanges && !$OnlySearchForPeople ) {
-
- # XXX: ProcessTicketWatchers doesn't like WatcherTypeEmailX with
- # empty WatcherAddressEmailX
- delete $ARGS{"WatcherTypeEmail$_"} foreach
- grep !$ARGS{"WatcherAddressEmail$_"} && $ARGS{"WatcherTypeEmail$_"},
- 1..3
- ;
-
- push @results, ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS );
-}
-
-if ( $SaveChanges && !$checks_failure && !$OnlySearchForPeople ) {
- my $strict_acl = RT->Config->Set( StrictLinkACL => 0 );
- push @results, ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS);
- RT->Config->Set( StrictLinkACL => $strict_acl );
-
- push @results, ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS);
-
- $ARGS{UpdateAttachments} = delete $session{'Attachments'};
- push @results, ProcessUpdateMessage( TicketObj => $Ticket, ARGSRef=>\%ARGS );
- push @results, ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS);
-
- push @results, ProcessTicketCustomFieldUpdates(ARGSRef => \%ARGS);
-
- if ( RT->Config->Get('DisplayAfterEdit', $session{'CurrentUser'}) ) {
- $m->callback(CallbackName => 'BeforeDisplay', ARGSRef => \%ARGS, Ticket => $Ticket);
- push @{ $session{'Actions'}{''} ||= [] }, @results;
- return $m->comp("/RTIR/Incident/Display.html", %ARGS, id => $id );
- }
-}
-
-my $constituency_cf = RT::IR->CustomFields( Constituency => Ticket => $Ticket );
-my $constituency_propagation = RT->Config->Get('_RTIR_Constituency_Propagation');
-
-my $has_children = 0;
-if ( $constituency_cf && $constituency_propagation eq 'reject' ) {
- $has_children = RT::IR->IncidentChildren( $Ticket )->Count;
-}
-
-# If they've gone and moved the ticket to somewhere they can't see, etc...
-# TODO: display the results, even if we can't display the ticket.
-
-unless ($Ticket->CurrentUserHasRight('ShowTicket')) {
- Abort("No permission to view ticket");
-}
-</%INIT>
-
-<%ARGS>
-$id => undef
-
-$SaveChanges => undef
-$OnlySearchForPeople => undef
-</%ARGS>
-
commit 3be42737b47dd740d5e30c64184e97710847ef41
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Aug 27 07:14:10 2011 +0400
update TODO
diff --git a/TODO.porting_over_RT4 b/TODO.porting_over_RT4
index 4aaf7e9..52a42ce 100644
--- a/TODO.porting_over_RT4
+++ b/TODO.porting_over_RT4
@@ -73,3 +73,12 @@
* add tests to make sure attachments attached to all selected Children when
replying via Incident
+Test Summary Report
+-------------------
+t/004-rtfm-in-rtir.t (Wstat: 1280 Tests: 20 Failed: 5)
+ Failed tests: 15-16, 18-20
+ Non-zero exit status: 5
+Files=38, Tests=2505, 986 wallclock secs ( 0.79 usr 0.22 sys + 413.24 cusr 27.77 csys = 442.02 CPU)
+Result: FAIL
+Failed 1/38 test programs. 5/2505 subtests failed.
+
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list