diff options
author | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
commit | c82d349f864e6bd9f96fd1156903bc1f7193a203 (patch) | |
tree | e117a87533656110b6acd56fc0ca64289892a9f5 /rt/etc/upgrade/3.8.8 | |
parent | 74e058c8a010ef6feb539248a550d0bb169c1e94 (diff) |
This commit was manufactured by cvs2svn to create tag 'TORRUS_1_0_9'.TORRUS_1_0_9
Diffstat (limited to 'rt/etc/upgrade/3.8.8')
-rw-r--r-- | rt/etc/upgrade/3.8.8/content | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/rt/etc/upgrade/3.8.8/content b/rt/etc/upgrade/3.8.8/content deleted file mode 100644 index ee1943304..000000000 --- a/rt/etc/upgrade/3.8.8/content +++ /dev/null @@ -1,38 +0,0 @@ -@Initial = ( - sub { - # make sure global CFs are not applied to local objects - my $ocfs = RT::ObjectCustomFields->new( $RT::SystemUser ); - $ocfs->Limit( FIELD => 'ObjectId', OPERATOR => '!=', VALUE => 0 ); - my $alias = $ocfs->Join( - FIELD1 => 'CustomField', - TABLE2 => 'ObjectCustomFields', - FIELD2 => 'CustomField', - ); - $ocfs->Limit( ALIAS => $alias, FIELD => 'ObjectId', VALUE => 0 ); - while ( my $ocf = $ocfs->Next ) { - $ocf->Delete; - } - }, - sub { - # sort SortOrder - my $sth = $RT::Handle->dbh->prepare( - "SELECT cfs.LookupType, ocfs.id" - ." FROM ObjectCustomFields ocfs, CustomFields cfs" - ." WHERE cfs.id = ocfs.CustomField" - ." ORDER BY cfs.LookupType, ocfs.SortOrder, cfs.Name" - ); - $sth->execute; - - my ($i, $prev_type) = (0, ''); - while ( my ($lt, $id) = $sth->fetchrow_array ) { - $i = 0 if $prev_type ne $lt; - my $ocf = RT::ObjectCustomField->new( $RT::SystemUser ); - $ocf->Load( $id ); - my ($status, $msg) = $ocf->SetSortOrder( $i++ ); - $RT::Logger->warning("Couldn't set SortOrder: $msg") - unless $status; - $prev_type = $lt; - } - }, -); - |