[Rt-commit] r8741 - rtir/branches/2.3-EXPERIMENTAL/etc
ruz at bestpractical.com
ruz at bestpractical.com
Mon Aug 27 09:33:55 EDT 2007
Author: ruz
Date: Mon Aug 27 09:33:54 2007
New Revision: 8741
Modified:
rtir/branches/2.3-EXPERIMENTAL/etc/add_constituency
Log:
* always ask for confirmation
* display a little more info about actions we're going to do
Modified: rtir/branches/2.3-EXPERIMENTAL/etc/add_constituency
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/etc/add_constituency (original)
+++ rtir/branches/2.3-EXPERIMENTAL/etc/add_constituency Mon Aug 27 09:33:54 2007
@@ -91,25 +91,31 @@
$RT::Handle->BeginTransaction;
-if ( cf_value_exists( $constituency ) ) {
- print <<END;
-Constituency '$constituency' already exists.
-
-If you continue then we'll...
-* create queues if they don't exist
-* create groups if they don't exist
-* grant basic set of rights
+my @queue_prefixes = ('Incidents', 'Incident Reports', 'Investigations', 'Blocks');
+
+my $exist = cf_value_exists( $constituency );
+
+print "\nIf you continue then we'll...\n";
+if ( $exist ) {
+ print "* WARNING: skip adding constituency value, already exists.\n";
+} else {
+ print "* add new constituency value: '$constituency'.\n";
+}
+foreach (@queue_prefixes) {
+ print "* create queue '$_ - $constituency' if it doesn't exist\n";
+}
+print <<END;
+* create group 'DutyTeam $constituency' if it don't exist
+* create group 'ReadOnly $constituency' if it don't exist
+* grant basic set of rights to the groups on the queues
END
- exit 0 unless prompt_yN( "Do you want to proceed?" );
-}
+exit 0 unless prompt_yN( "Do you want to proceed?" );
debug "Adding constituency $constituency";
add_cf_value( $constituency );
-my @queue_prefixes = ('Incidents', 'Incident Reports', 'Investigations', 'Blocks');
-
my %metaqueues;
my %mainqueues;
# Create our four new queues
More information about the Rt-commit
mailing list