Skip to content

Commit

Permalink
Merge branch '3.4/rt-4.4-compat' into 3.4/reimplement-constituencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dgx committed Oct 19, 2015
2 parents 095fb9b + a8364a7 commit 68b8207
Show file tree
Hide file tree
Showing 47 changed files with 73 additions and 27 deletions.
6 changes: 5 additions & 1 deletion html/RTIR/Elements/ShowDates
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@
<% $due->AsString %>
% }
% if ( !RT::IR->IsIncidentQueue($Ticket->QueueObj) && $Due ) {
% if ( $Due =~ /^\d+$/ ) {
[<a href="Display.html?Due_Date=now%20%2B%20<% $Due |u %>%20days&id=<% $Ticket->Id %>"><% loc("Set to [_1] days from now", $Due ) %></a>]
% } else {
[<a href="Display.html?Due_Date=now%20%2B%20<% $Due |u %>&id=<% $Ticket->Id %>"><% loc("Set to [_1] from now", $Due ) %></a>]
% }
% }
</td>
</tr>
Expand All @@ -84,5 +88,5 @@
$Ticket => undef
</%ARGS>
<%INIT>
my $Due = ( $Ticket->QueueObj->DefaultDueIn || (RT->Config->Get('OverdueAfter')) || 7 ) ;
my $Due = $Ticket->QueueObj->DefaultValue('Due') || RT->Config->Get('OverdueAfter') || 7;
</%INIT>
4 changes: 2 additions & 2 deletions html/RTIR/Incident/Create.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
Default =>
defined $ARGS{'InitialPriority'} && length $ARGS{'InitialPriority'}
? $ARGS{'InitialPriority'}
: $QueueObj->InitialPriority
: $QueueObj->DefaultValue('InitialPriority')
,
},
},
Expand All @@ -219,7 +219,7 @@
Default =>
defined $ARGS{'FinalPriority'} && length $ARGS{'FinalPriority'}
? $ARGS{'FinalPriority'}
: $QueueObj->InitialPriority
: $QueueObj->DefaultValue('FinalPriority')
,
},
},
Expand Down
19 changes: 0 additions & 19 deletions html/RTIR/Search/Elements/ProcessQuery
Original file line number Diff line number Diff line change
Expand Up @@ -164,30 +164,11 @@ foreach my $arg ( keys %ARGS ) {
for ( my $i = 0; $i < @ops; $i++ ) {
my ( $op, $value ) = ( $ops[$i], $values[$i] );
next if !defined $value || $value eq '';
my $rawvalue = $value;

if ( $value =~ /^NULL$/i && $op =~ /=/ ) {
if ( $op eq '=' ) {
$op = "IS";
}
elsif ( $op eq '!=' ) {
$op = "IS NOT";
}
}
elsif ($value =~ /\D/) {
$value =~ s/(['\\])/\\$1/g;
$value = "'$value'";
}

if ($keyword =~ s/(['\\])/\\$1/g or $keyword =~ /[^{}\w\.]/) {
$keyword = "'$keyword'";
}

my $clause = {
Key => $keyword,
Op => $op,
Value => $value,
RawValue => $rawvalue,
};

push @new_values, RT::Interface::Web::QueryBuilder::Tree->new($clause);
Expand Down
24 changes: 19 additions & 5 deletions html/RTIR/Update.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,25 @@

<div id="ticket-update-message">

<& /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('Recipients'), id => 'recipients' &>
</&>
<script type="text/javascript">
jQuery( function() {
var updateScrips = function() {
jQuery('#recipients div.titlebox-content').load( '<% RT->Config->Get('WebPath')%>/Helpers/ShowSimplifiedRecipients',
jQuery('form[name=TicketUpdate]').serialize(),
function() {
var txn_send_field = jQuery("#recipients input[name=TxnSendMailTo]");
txn_send_field.click( function () { setCheckbox(this) } );
jQuery("#recipients input[name=TxnSendMailToAll]").click( function() { setCheckbox(this, 'TxnSendMailTo'); } );
setCheckbox(txn_send_field);
}
);
};
updateScrips();
jQuery("#ticket-update-metadata :input, input[name^=UpdateCc], input[name^=UpdateBcc]").change( updateScrips );
});
</script>

<&|/Widgets/TitleBox, title => loc('Message'), class => 'messagedetails' &>
<table width="100%" border="0">
Expand Down
1 change: 1 addition & 0 deletions t/001-basic-RTIR.t
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ $agent->LinkChildToIncident( $report, $second_incident_id);



undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/002-test-reject.t
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,5 @@ diag "test that after bulk reject links to incidents are still there" if $ENV{'T
$agent->has_tag('a', "$id", 'we have link to ticket');
}

undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/003-resolve-IR-when-all-incidents-resolved.t
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ like(

ir_status('resolved');

undef $agent;
done_testing;

sub ir_status {
Expand Down
1 change: 1 addition & 0 deletions t/005-resolve-investigations.t
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ like($agent->content, qr/Status changed from \S*open\S* to \S*resolved\S*/, "sit
$agent->follow_link_ok({text => "Re-open"}, "Followed 'open' link");
like($agent->content, qr/Status changed from \S*resolved\S* to \S*open\S*/, "site says ticket got re-opened");

undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/006-saved-searches.t
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ is($agent->value('SavedSearchOwner'), "RT::Group-$DT_id", "privacy is correct");

# ... should also do tests for the RTIR "refine" thing, which is like QB.

undef $agent;
done_testing;
4 changes: 4 additions & 0 deletions t/009-attachments-processing.t
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ $agent->goto_create_rtir_ticket('Incident Reports');

$agent->goto_create_rtir_ticket('Incident Reports');

SKIP: {
skip "delete attach function is ajaxified, no checkbox anymore", 4;
# let's try to create new IR
# and add then delete attachment to see that it works as expected
{
Expand Down Expand Up @@ -113,6 +115,7 @@ $agent->goto_create_rtir_ticket('Incident Reports');

unlink $filename or die "couldn't delete file '$filename': $!";
}
}

$agent->goto_create_rtir_ticket('Incidents');

Expand Down Expand Up @@ -234,4 +237,5 @@ $agent->goto_create_rtir_ticket('Blocks');
unlink $filename or die "couldn't delete file '$filename': $!";
}

undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/010-bulk-reject.t
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ foreach( @irs ) {
$agent->ticket_status_is( $_, 'rejected', "Ticket #$_ is rejected" );
}

undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/011-merge.t
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,5 @@ diag "merge two IRs that are linked to different Incidents" if $ENV{'TEST_VERBOS
$agent->ticket_is_linked_to_inc( $ir1_id, [$inc1_id, $inc2_id] );
}

undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/015-make-clicky.t
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,6 @@ diag "utf8 caching " if $ENV{'TEST_VERBOSE'};

}

undef $agent;
done_testing;

1 change: 1 addition & 0 deletions t/019-watchers-on-create.t
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@ SKIP: {
$agent->has_watchers( $solo_inv, 'AdminCc');
}

undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/020-incident-and-investigation.t
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,5 @@ like( $agent->uri, qr/RTIR\/Create.html/, 'still in the create page' );
$agent->content_contains('Creation failed', 'failed to create');
$agent->content_contains('You must enter an Incident ID');

undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/030-redirect-on-login.t
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ for my $path (qw(Prefs/Other.html /Prefs/Other.html)) {



undef $agent;
done_testing;

#TODO
Expand Down
1 change: 1 addition & 0 deletions t/articles/basics.t
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ $agent->display_ticket( $ir_id);
$agent->follow_link_ok({text => $article_name}, "back to article");
$agent->content_like( qr/this is a summary/, "found the summary of the article");

undef $agent;
done_testing();
1 change: 1 addition & 0 deletions t/articles/on-create.t
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@ foreach ( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
}


undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/articles/on-update.t
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,5 @@ foreach my $queue ( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks'
like( $agent->field('UpdateContent'), qr/this is a content/ );
}

undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/block/pending-no-regexp.t
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ EOF
$agent->ticket_status_is( $block_id, 'removed');
}

undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/block/pending-regexp.t
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,5 @@ EOF
$agent->ticket_status_is( $block_id, 'removed');
}

undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/block/status-basics.t
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,5 @@ diag "test activation after reply using Edit page";
}


undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/block/status-editor-regression.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ $agent->goto_edit_block( $block);

$agent->content_unlike(qr{<option (?:value=.*)?>Use system default\(\)</option>}, "The option 'Use system default()' does not exist.");

undef $agent;
done_testing();
1 change: 1 addition & 0 deletions t/constituency/basics.t
Original file line number Diff line number Diff line change
Expand Up @@ -303,4 +303,5 @@ diag "check defaults when creating inc with inv";
}
}

undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/constituency/email.t
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,5 @@ EOF



undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/constituency/email_outgoing.t
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,5 @@ diag "GOV user creates an IR under EDUNET, check addresses";
}


undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/constituency/propagation-inherit.t
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,5 @@ diag "check that constituency propagates from a child to a parent after 'Edit',
}


undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/constituency/propagation-no.t
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,5 @@ diag "create an incident under GOVNET and create a new IR "
}


undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/constituency/propagation-reject.t
Original file line number Diff line number Diff line change
Expand Up @@ -306,4 +306,5 @@ diag "check that we can change constituency of an unlinked ticket using 'Edit' p
}


undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/custom-fields/defaults-config.t
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,5 @@ my $agent = default_agent();
}


undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/custom-fields/defaults-on-linking.t
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,5 @@ my $agent = default_agent();



undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/custom-fields/ip.t
Original file line number Diff line number Diff line change
Expand Up @@ -622,4 +622,5 @@ diag "merge ticket with the same IP";
}


undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/custom-fields/ipv6.t
Original file line number Diff line number Diff line change
Expand Up @@ -550,4 +550,5 @@ diag "merge ticket with the same IP";
is( $has[0], '0000:'x6 .'ac10:0001', "has value" );
}

undef $agent;
done_testing();
1 change: 1 addition & 0 deletions t/custom-fields/on-transactions.t
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,5 @@ foreach my $id ( @tickets ) {
}


undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/dates/started.t
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,5 @@ diag "started date of a block" if $ENV{'TEST_VERBOSE'};
}


undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/gnupg/on-create.t
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ diag "check encrypting of attachments";
check_text_emails( { Encrypt => 1, Attachment => 1 }, @mail );
}

undef $agent;
done_testing;

sub check_text_emails {
Expand Down
2 changes: 2 additions & 0 deletions t/gnupg/on-incident.t
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ diag "check that things don't work if there is no key";
$agent->form_number(3);
$agent->tick( SelectedReports => $ir_id );
$agent->tick( Encrypt => 1 );
$agent->field( UpdateContent => 'Some content' );
$agent->click('SubmitTicket');
$agent->content_like(
qr/You are going to encrypt outgoing email messages/i,
Expand All @@ -85,4 +86,5 @@ diag "check that things don't work if there is no key";
ok !@mail, 'there are no outgoing emails';
}

undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/gnupg/on-update.t
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ diag "check encrypting of attachments";
}


undef $agent;
done_testing;

sub check_text_emails {
Expand Down
1 change: 1 addition & 0 deletions t/incident/abandon.t
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ diag "abandon incident with resolved IR" if $ENV{'TEST_VERBOSE'};
is $agent->ticket_status( $ir_id), 'resolved', 'resolved ir';
}

undef $agent;
done_testing;


1 change: 1 addition & 0 deletions t/incident/bulk-abandon.t
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ foreach my $id (@invests) {
$agent->ticket_status_is( $id, 'resolved', 'correct status' );
}

undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/incident/split.t
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ my $rtir_user = rtir_user();
$agent->ticket_is_not_linked_to_inc( $inv_id, [$id]);
}

undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/mail/skip_notification.t
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ diag "create an IR and check that 'SkipNotification' feature works";
ok $recipient_ok, 'no emails to requestor';
}

undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/report/status.t
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ diag "link IR to Inc after create" if $ENV{'TEST_VERBOSE'};
is $agent->ticket_status($ir_id), 'open', 'auto open kicked in';
}

undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/searches/cf.t
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ $m->content_contains( 'Spam Incident', 'has spam incident' );
# we should only be finding Queue = 'Incidents' and CF.Classification = 'Spam'
$m->content_lacks( 'Ham Incident', 'has not found the ham incident' );

undef $m;
done_testing;
1 change: 1 addition & 0 deletions t/searches/menu.t
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,5 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
}
}

undef $m;
done_testing;
1 change: 1 addition & 0 deletions t/searches/simple.t
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ my $agent = default_agent();
is($agent->uri,$agent->rt_base_url."RTIR/Display.html?id=$ir_id","Directed to the Report Page");
}

undef $agent;
done_testing;
1 change: 1 addition & 0 deletions t/tools/lookup.t
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ SKIP:{

undef $agent;

undef $agent;
done_testing;

0 comments on commit 68b8207

Please sign in to comment.