[Rt-commit] [rtir] 02/04: Upgrade existing select singles in older RTIRs to use dropdowns
Kevin Falcone
falcone at bestpractical.com
Fri Apr 26 18:03:42 EDT 2013
This is an automated email from the git hooks/post-receive script.
falcone pushed a commit to branch 2.9/cf-tweaks
in repository rtir.
commit dc4381df02ea583dca7f804499163fe32c613c75
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Fri Apr 19 18:36:42 2013 -0400
Upgrade existing select singles in older RTIRs to use dropdowns
---
etc/upgrade/3.0.0rc2/content | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/etc/upgrade/3.0.0rc2/content b/etc/upgrade/3.0.0rc2/content
new file mode 100644
index 0000000..33e5e03
--- /dev/null
+++ b/etc/upgrade/3.0.0rc2/content
@@ -0,0 +1,25 @@
+use strict;
+use warnings;
+
+our @Final = (
+
+ # fix our standard SelectSingle Custom Fields to use a more modern dropdown
+ sub {
+ for my $name ('Constituency', 'Resolution', 'Function', 'Classification', 'How Reported', 'Reporter Type', 'Customer') {
+ my $cf = RT::CustomField->new( RT->SystemUser );
+ # We have to be ugly here because Customers exists twice, once as a single value and once as a multiple
+ my ($ok, $msg) = $cf->LoadByCols(Name => $name, MaxValues => 1);
+ unless ($ok) {
+ RT->Logger->error("Unable to load a Single Value Select named $name: $msg - skipping update of Render Type");
+ next;
+ }
+
+ ($ok,$msg) = $cf->SetRenderType('Dropdown');
+ unless ($ok) {
+ RT->Logger->error("Unable to set Render Type to Dropdown for $name: $msg");
+ }
+ }
+ },
+);
+
+1;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Rt-commit
mailing list