Commit b98cf379 authored by Ruslan Zakirov's avatar Ruslan Zakirov
Browse files

make sure we can not change template's queue

moving templates between queues gonna be too
complicated
parent 2544c3a6
......@@ -632,6 +632,17 @@ sub CurrentUserHasQueueRight {
return ( $self->QueueObj->CurrentUserHasRight(@_) );
}
=head2 SetQueue
Changing queue is not implemented.
=cut
sub SetQueue {
my $self = shift;
return ( undef, $self->loc('Changing queue is not implemented') );
}
=head2 SetName
Change name of the template.
......
......@@ -9,6 +9,9 @@ use_ok('RT::Template');
my $queue = RT::Test->load_or_create_queue( Name => 'Templates' );
ok $queue && $queue->id, "loaded or created a queue";
my $alt_queue = RT::Test->load_or_create_queue( Name => 'Alternative' );
ok $alt_queue && $alt_queue->id, 'loaded or created queue';
{
my $template = RT::Template->new(RT->SystemUser);
isa_ok($template, 'RT::Template');
......@@ -93,6 +96,17 @@ note "can not change name to duplicate";
ok($val,$msg);
}
note "changing queue of template is not implemented";
{
clean_templates( Queue => $queue->id );
my $template = RT::Template->new( RT->SystemUser );
my ($val,$msg) = $template->Create( Queue => $queue->id, Name => 'Test' );
ok($val,$msg);
($val,$msg) = $template->SetQueue( $alt_queue->id );
ok(!$val,$msg);
}
{
my $t = RT::Template->new(RT->SystemUser);
$t->Create(Name => "Foo", Queue => $queue->id);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment