[Rt-commit] [rtir] 01/02: add the same templates/scrips to new constituency queues
? sunnavy
sunnavy at bestpractical.com
Fri Mar 27 08:14:27 EDT 2015
This is an automated email from the git hooks/post-receive script.
sunnavy pushed a commit to branch 3.4/remove_old_constituencies_migration
in repository rtir.
commit 69208cf567934b3aaa8472fd1b1ce183bca39874
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Mar 27 19:50:30 2015 +0800
add the same templates/scrips to new constituency queues
---
bin/add_constituency.in | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/bin/add_constituency.in b/bin/add_constituency.in
index 3e509a0..9302066 100755
--- a/bin/add_constituency.in
+++ b/bin/add_constituency.in
@@ -456,6 +456,25 @@ sub create_or_load_queue {
$constituency_cf->AddToObject($queue);
$queue->AddCustomFieldValue(Field => $constituency_cf->id, Value => $constituency);
$whois_cf->AddToObject($queue);
+
+ my $templates = RT::Templates->new(RT->SystemUser);
+ $templates->LimitToQueue($basequeue->id);
+ while ( my $template = $templates->Next ) {
+ my $new_template = RT::Template->new( RT->SystemUser );
+ $new_template->Create(
+ Queue => $queue->id,
+ map { $_ => $template->$_ } qw/Name Description Type Content /,
+ );
+ }
+
+ my $scrips = RT::Scrips->new(RT->SystemUser);
+ $scrips->LimitToQueue($basequeue->id);
+ while ( my $scrip = $scrips->Next ) {
+ unless ( $scrip->IsAdded( $queue->id ) ) {
+ $scrip->AddToObject($queue->id);
+ }
+ }
+
die "Failed to create queue $name." unless $queue->id;
return $queue;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the rt-commit
mailing list