summaryrefslogtreecommitdiff
path: root/rt/etc/upgrade/4.1.1/content
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-07-09 22:32:26 -0700
committerIvan Kohler <ivan@freeside.biz>2015-07-09 22:32:26 -0700
commit026dc7ad72ba972f230b6709e31fa64397d75ad4 (patch)
treec5af1a7ac9154744afc3660e9a9405892f2bb50b /rt/etc/upgrade/4.1.1/content
parent07b4bc84d1078f7390221d766cdb3142513db4b0 (diff)
parent1c538bfabc2cd31f27067505f0c3d1a46cba6ef0 (diff)
merge RT 4.2.11 and Header changes to disable RT javascript, RT#34237
Diffstat (limited to 'rt/etc/upgrade/4.1.1/content')
-rw-r--r--rt/etc/upgrade/4.1.1/content36
1 files changed, 36 insertions, 0 deletions
diff --git a/rt/etc/upgrade/4.1.1/content b/rt/etc/upgrade/4.1.1/content
new file mode 100644
index 000000000..f3580bdc0
--- /dev/null
+++ b/rt/etc/upgrade/4.1.1/content
@@ -0,0 +1,36 @@
+use strict;
+use warnings;
+
+our @Initial = (
+ sub {
+ require RT::ObjectScrips;
+ foreach my $stage ('TransactionCreate', 'TransactionBatch') {
+ my $applications = RT::ObjectScrips->new( RT->SystemUser );
+ $applications->Limit( FIELD => 'Stage', VALUE => $stage );
+ my $alias = $applications->Join(
+ FIELD1 => 'Scrip',
+ TABLE2 => 'Scrips', FIELD2 => 'id'
+ );
+ $applications->OrderByCols(
+ { ALIAS => $alias, FIELD => 'Description', ORDER => 'ASC' },
+ );
+ my %h; my $top_so = $h{0} = 0;
+ while ( my $record = $applications->Next ) {
+ my $oid = $record->ObjectId || 0;
+
+ my $so;
+ unless ( $oid ) {
+ %h = (); $h{0} = $so = ++$top_so;
+ }
+ else {
+ $so = $h{ $oid } = ($h{$oid}||$h{0}) + 1;
+ }
+ next if $record->SortOrder == $so;
+
+ my ($status, $msg) = $record->SetSortOrder($so);
+ RT->Logger->error("Couldn't set sort order: $msg")
+ unless $status;
+ }
+ }
+ },
+);