[Rt-commit] r7635 - in rt/branches/3.7-EXPERIMENTAL: .
ruz at bestpractical.com
ruz at bestpractical.com
Mon Apr 23 08:31:55 EDT 2007
Author: ruz
Date: Mon Apr 23 08:31:51 2007
New Revision: 7635
Modified:
rt/branches/3.7-EXPERIMENTAL/ (props changed)
rt/branches/3.7-EXPERIMENTAL/sbin/rt-setup-database.in
Log:
r5081 at cubic-pc: cubic | 2007-04-23 16:23:24 +0400
* apply CF by default only when we have no queues to apply to
Modified: rt/branches/3.7-EXPERIMENTAL/sbin/rt-setup-database.in
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/sbin/rt-setup-database.in (original)
+++ rt/branches/3.7-EXPERIMENTAL/sbin/rt-setup-database.in Mon Apr 23 08:31:51 2007
@@ -424,10 +424,10 @@
my $values = delete $item->{'Values'};
my @queues;
- if ( $item->{'Queue'} ) {
- my $queue_ref = delete $item->{'Queue'};
- @queues = ref $queue_ref ? @{$queue_ref} : ($queue_ref);
+ # if ref then it's list of queues, so we do things ourself
+ if ( exists $item->{'Queue'} && ref $item->{'Queue'} ) {
$item->{'LookupType'} = 'RT::Queue-RT::Ticket';
+ @queues = @{ delete $item->{'Queue'} };
}
my ( $return, $msg ) = $new_entry->Create(%$item);
@@ -438,8 +438,9 @@
print "(Error: $msg)\n" unless $return;
}
- if ($item->{LookupType}) { # enable by default
- my $ocf = RT::ObjectCustomField->new($CurrentUser);
+ # apply by default
+ if ( !@queues && !exists $item->{'Queue'} && $item->{LookupType} ) {
+ my $ocf = RT::ObjectCustomField->new( $CurrentUser );
$ocf->Create( CustomField => $new_entry->Id );
}
More information about the Rt-commit
mailing list