make sure config still works if no ticket system is configured...
authorivan <ivan>
Sat, 15 Oct 2005 13:40:30 +0000 (13:40 +0000)
committerivan <ivan>
Sat, 15 Oct 2005 13:40:30 +0000 (13:40 +0000)
FS/FS/Conf.pm

index 75e1645..fc10b13 100644 (file)
@@ -1474,18 +1474,21 @@ httemplate/docs/config.html
     'section'     => '',
     'description' => 'Default queue used when creating new customer tickets.',
     'type'        => 'select-sub',
-    'options_sub' => sub { eval "use FS::TicketSystem;";
-                           die $@ if $@;
+    'options_sub' => sub {
                            my $conf = new FS::Conf;
                            if ( $conf->config('ticket_system') ) {
+                             eval "use FS::TicketSystem;";
+                             die $@ if $@;
                              FS::TicketSystem->queues();
                            } else {
                              ();
                            }
                          },
-    'option_sub'  => sub { eval "use FS::TicketSystem;";
-                           die $@ if $@;
+    'option_sub'  => sub { 
+                           my $conf = new FS::Conf;
                            if ( $conf->config('ticket_system') ) {
+                             eval "use FS::TicketSystem;";
+                             die $@ if $@;
                              FS::TicketSystem->queue(shift);
                            } else {
                              '';