Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Commit
rt branch, 4.2/disallow-ticket-creation-disabled-queue, created. rt-4.0.5-283-g2986e94
 

Index | Next | Previous | View Flat


alexmv at bestpractical

Mar 13, 2012, 7:07 AM


Views: 137
Permalink
rt branch, 4.2/disallow-ticket-creation-disabled-queue, created. rt-4.0.5-283-g2986e94

The branch, 4.2/disallow-ticket-creation-disabled-queue has been created
at 2986e94f3aec84fc4d3583ebfda8725422276552 (commit)

- Log -----------------------------------------------------------------
commit 8c0e1b680013119ac083d011b1ffa36747d6ab5e
Author: Alex Vandiver <alexmv [at] bestpractical>
Date: Tue Mar 13 10:01:43 2012 -0400

Fix the error message (copied from users) on queue disable

diff --git a/lib/RT/Queue.pm b/lib/RT/Queue.pm
index 84e2621..edc64a4 100644
--- a/lib/RT/Queue.pm
+++ b/lib/RT/Queue.pm
@@ -475,7 +475,7 @@ sub SetDisabled {
my $set_err = $self->_Set( Field =>'Disabled', Value => $val);
unless ($set_err) {
$RT::Handle->Rollback();
- $RT::Logger->warning("Couldn't ".($val == 1) ? "disable" : "enable"." queue ".$self->PrincipalObj->Id);
+ $RT::Logger->warning("Couldn't ".($val == 1) ? "disable" : "enable"." queue ".$self->Name);
return (undef);
}
$self->_NewTransaction( Type => ($val == 1) ? "Disabled" : "Enabled" );

commit 2986e94f3aec84fc4d3583ebfda8725422276552
Author: Alex Vandiver <alexmv [at] bestpractical>
Date: Tue Mar 13 10:02:29 2012 -0400

Prohibit creating tickets in disabled queues

We check if ->Disabled != 1 because ___Approvals are Disabled == 2, but
must allow tickets to be created in them. See 2e6dd76 and 0d17c8d.

diff --git a/lib/RT/Ticket.pm b/lib/RT/Ticket.pm
index 1cd3c7d..93e0b81 100644
--- a/lib/RT/Ticket.pm
+++ b/lib/RT/Ticket.pm
@@ -285,7 +285,7 @@ sub Create {
$self->CurrentUser->HasRight(
Right => 'CreateTicket',
Object => $QueueObj
- )
+ ) and $QueueObj->Disabled != 1
)
{
return (
@@ -1704,7 +1704,8 @@ sub SetQueue {
if ( $NewQueueObj->Id == $self->QueueObj->Id ) {
return ( 0, $self->loc('That is the same value') );
}
- unless ( $self->CurrentUser->HasRight( Right => 'CreateTicket', Object => $NewQueueObj)) {
+ unless ( $self->CurrentUser->HasRight( Right => 'CreateTicket', Object => $NewQueueObj)
+ and $NewQueueObj->Disabled != 1) {
return ( 0, $self->loc("You may not create requests in that queue.") );
}


-----------------------------------------------------------------------
_______________________________________________
Rt-commit mailing list
Rt-commit [at] lists
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-commit

Subject User Time
rt branch, 4.2/disallow-ticket-creation-disabled-queue, created. rt-4.0.5-283-g2986e94 alexmv at bestpractical Mar 13, 2012, 7:07 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.