group invoice line items by location, show location address on invoice, option for...
[freeside.git] / FS / FS / Conf.pm
1 package FS::Conf;
2
3 use vars qw($base_dir @config_items @base_items @card_types $DEBUG);
4 use Carp;
5 use IO::File;
6 use File::Basename;
7 use MIME::Base64;
8 use FS::ConfItem;
9 use FS::ConfDefaults;
10 use FS::Conf_compat17;
11 use FS::payby;
12 use FS::conf;
13 use FS::Record qw(qsearch qsearchs);
14 use FS::UID qw(dbh datasrc use_confcompat);
15
16 $base_dir = '%%%FREESIDE_CONF%%%';
17
18 $DEBUG = 0;
19
20 =head1 NAME
21
22 FS::Conf - Freeside configuration values
23
24 =head1 SYNOPSIS
25
26   use FS::Conf;
27
28   $conf = new FS::Conf;
29
30   $value = $conf->config('key');
31   @list  = $conf->config('key');
32   $bool  = $conf->exists('key');
33
34   $conf->touch('key');
35   $conf->set('key' => 'value');
36   $conf->delete('key');
37
38   @config_items = $conf->config_items;
39
40 =head1 DESCRIPTION
41
42 Read and write Freeside configuration values.  Keys currently map to filenames,
43 but this may change in the future.
44
45 =head1 METHODS
46
47 =over 4
48
49 =item new
50
51 Create a new configuration object.
52
53 =cut
54
55 sub new {
56   my($proto) = @_;
57   my($class) = ref($proto) || $proto;
58   my($self) = { 'base_dir' => $base_dir };
59   bless ($self, $class);
60 }
61
62 =item base_dir
63
64 Returns the base directory.  By default this is /usr/local/etc/freeside.
65
66 =cut
67
68 sub base_dir {
69   my($self) = @_;
70   my $base_dir = $self->{base_dir};
71   -e $base_dir or die "FATAL: $base_dir doesn't exist!";
72   -d $base_dir or die "FATAL: $base_dir isn't a directory!";
73   -r $base_dir or die "FATAL: Can't read $base_dir!";
74   -x $base_dir or die "FATAL: $base_dir not searchable (executable)!";
75   $base_dir =~ /^(.*)$/;
76   $1;
77 }
78
79 =item conf KEY [ AGENTNUM [ NODEFAULT ] ]
80
81 Returns the L<FS::conf> record for the key and agent.
82
83 =cut
84
85 sub conf {
86   my $self = shift;
87   $self->_config(@_);
88 }
89
90 =item config KEY [ AGENTNUM [ NODEFAULT ] ]
91
92 Returns the configuration value or values (depending on context) for key.
93 The optional agent number selects an agent specific value instead of the
94 global default if one is present.  If NODEFAULT is true only the agent
95 specific value(s) is returned.
96
97 =cut
98
99 sub _usecompat {
100   my ($self, $method) = (shift, shift);
101   carp "NO CONFIGURATION RECORDS FOUND -- USING COMPATIBILITY MODE"
102     if use_confcompat;
103   my $compat = new FS::Conf_compat17 ("$base_dir/conf." . datasrc);
104   $compat->$method(@_);
105 }
106
107 sub _config {
108   my($self,$name,$agentnum,$agentonly)=@_;
109   my $hashref = { 'name' => $name };
110   $hashref->{agentnum} = $agentnum;
111   local $FS::Record::conf = undef;  # XXX evil hack prevents recursion
112   my $cv = FS::Record::qsearchs('conf', $hashref);
113   if (!$agentonly && !$cv && defined($agentnum) && $agentnum) {
114     $hashref->{agentnum} = '';
115     $cv = FS::Record::qsearchs('conf', $hashref);
116   }
117   return $cv;
118 }
119
120 sub config {
121   my $self = shift;
122   return $self->_usecompat('config', @_) if use_confcompat;
123
124   carp "FS::Conf->config(". join(', ', @_). ") called"
125     if $DEBUG > 1;
126
127   my $cv = $self->_config(@_) or return;
128
129   if ( wantarray ) {
130     my $v = $cv->value;
131     chomp $v;
132     (split "\n", $v, -1);
133   } else {
134     (split("\n", $cv->value))[0];
135   }
136 }
137
138 =item config_binary KEY [ AGENTNUM [ NODEFAULT ] ]
139
140 Returns the exact scalar value for key.
141
142 =cut
143
144 sub config_binary {
145   my $self = shift;
146   return $self->_usecompat('config_binary', @_) if use_confcompat;
147
148   my $cv = $self->_config(@_) or return;
149   length($cv->value) ? decode_base64($cv->value) : '';
150 }
151
152 =item exists KEY [ AGENTNUM [ NODEFAULT ] ]
153
154 Returns true if the specified key exists, even if the corresponding value
155 is undefined.
156
157 =cut
158
159 sub exists {
160   my $self = shift;
161   return $self->_usecompat('exists', @_) if use_confcompat;
162
163   my($name, $agentnum)=@_;
164
165   carp "FS::Conf->exists(". join(', ', @_). ") called"
166     if $DEBUG > 1;
167
168   defined($self->_config(@_));
169 }
170
171 =item config_orbase KEY SUFFIX
172
173 Returns the configuration value or values (depending on context) for 
174 KEY_SUFFIX, if it exists, otherwise for KEY
175
176 =cut
177
178 # outmoded as soon as we shift to agentnum based config values
179 # well, mostly.  still useful for e.g. late notices, etc. in that we want
180 # these to fall back to standard values
181 sub config_orbase {
182   my $self = shift;
183   return $self->_usecompat('config_orbase', @_) if use_confcompat;
184
185   my( $name, $suffix ) = @_;
186   if ( $self->exists("${name}_$suffix") ) {
187     $self->config("${name}_$suffix");
188   } else {
189     $self->config($name);
190   }
191 }
192
193 =item key_orbase KEY SUFFIX
194
195 If the config value KEY_SUFFIX exists, returns KEY_SUFFIX, otherwise returns
196 KEY.  Useful for determining which exact configuration option is returned by
197 config_orbase.
198
199 =cut
200
201 sub key_orbase {
202   my $self = shift;
203   #no compat for this...return $self->_usecompat('config_orbase', @_) if use_confcompat;
204
205   my( $name, $suffix ) = @_;
206   if ( $self->exists("${name}_$suffix") ) {
207     "${name}_$suffix";
208   } else {
209     $name;
210   }
211 }
212
213 =item invoice_templatenames
214
215 Returns all possible invoice template names.
216
217 =cut
218
219 sub invoice_templatenames {
220   my( $self ) = @_;
221
222   my %templatenames = ();
223   foreach my $item ( $self->config_items ) {
224     foreach my $base ( @base_items ) {
225       my( $main, $ext) = split(/\./, $base);
226       $ext = ".$ext" if $ext;
227       if ( $item->key =~ /^${main}_(.+)$ext$/ ) {
228       $templatenames{$1}++;
229       }
230     }
231   }
232   
233   map { $_ } #handle scalar context
234   sort keys %templatenames;
235
236 }
237
238 =item touch KEY [ AGENT ];
239
240 Creates the specified configuration key if it does not exist.
241
242 =cut
243
244 sub touch {
245   my $self = shift;
246   return $self->_usecompat('touch', @_) if use_confcompat;
247
248   my($name, $agentnum) = @_;
249   unless ( $self->exists($name, $agentnum) ) {
250     $self->set($name, '', $agentnum);
251   }
252 }
253
254 =item set KEY VALUE [ AGENTNUM ];
255
256 Sets the specified configuration key to the given value.
257
258 =cut
259
260 sub set {
261   my $self = shift;
262   return $self->_usecompat('set', @_) if use_confcompat;
263
264   my($name, $value, $agentnum) = @_;
265   $value =~ /^(.*)$/s;
266   $value = $1;
267
268   warn "[FS::Conf] SET $name\n" if $DEBUG;
269
270   my $old = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum});
271   my $new = new FS::conf { $old ? $old->hash 
272                                 : ('name' => $name, 'agentnum' => $agentnum)
273                          };
274   $new->value($value);
275
276   my $error;
277   if ($old) {
278     $error = $new->replace($old);
279   } else {
280     $error = $new->insert;
281   }
282
283   die "error setting configuration value: $error \n"
284     if $error;
285
286 }
287
288 =item set_binary KEY VALUE [ AGENTNUM ]
289
290 Sets the specified configuration key to an exact scalar value which
291 can be retrieved with config_binary.
292
293 =cut
294
295 sub set_binary {
296   my $self  = shift;
297   return if use_confcompat;
298
299   my($name, $value, $agentnum)=@_;
300   $self->set($name, encode_base64($value), $agentnum);
301 }
302
303 =item delete KEY [ AGENTNUM ];
304
305 Deletes the specified configuration key.
306
307 =cut
308
309 sub delete {
310   my $self = shift;
311   return $self->_usecompat('delete', @_) if use_confcompat;
312
313   my($name, $agentnum) = @_;
314   if ( my $cv = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum}) ) {
315     warn "[FS::Conf] DELETE $name\n";
316
317     my $oldAutoCommit = $FS::UID::AutoCommit;
318     local $FS::UID::AutoCommit = 0;
319     my $dbh = dbh;
320
321     my $error = $cv->delete;
322
323     if ( $error ) {
324       $dbh->rollback if $oldAutoCommit;
325       die "error setting configuration value: $error \n"
326     }
327
328     $dbh->commit or die $dbh->errstr if $oldAutoCommit;
329
330   }
331 }
332
333 =item import_config_item CONFITEM DIR 
334
335   Imports the item specified by the CONFITEM (see L<FS::ConfItem>) into
336 the database as a conf record (see L<FS::conf>).  Imports from the file
337 in the directory DIR.
338
339 =cut
340
341 sub import_config_item { 
342   my ($self,$item,$dir) = @_;
343   my $key = $item->key;
344   if ( -e "$dir/$key" && ! use_confcompat ) {
345     warn "Inserting $key\n" if $DEBUG;
346     local $/;
347     my $value = readline(new IO::File "$dir/$key");
348     if ($item->type =~ /^(binary|image)$/ ) {
349       $self->set_binary($key, $value);
350     }else{
351       $self->set($key, $value);
352     }
353   }else {
354     warn "Not inserting $key\n" if $DEBUG;
355   }
356 }
357
358 =item verify_config_item CONFITEM DIR 
359
360   Compares the item specified by the CONFITEM (see L<FS::ConfItem>) in
361 the database to the legacy file value in DIR.
362
363 =cut
364
365 sub verify_config_item { 
366   return '' if use_confcompat;
367   my ($self,$item,$dir) = @_;
368   my $key = $item->key;
369   my $type = $item->type;
370
371   my $compat = new FS::Conf_compat17 $dir;
372   my $error = '';
373   
374   $error .= "$key fails existential comparison; "
375     if $self->exists($key) xor $compat->exists($key);
376
377   if ( $type !~ /^(binary|image)$/ ) {
378
379     {
380       no warnings;
381       $error .= "$key fails scalar comparison; "
382         unless scalar($self->config($key)) eq scalar($compat->config($key));
383     }
384
385     my (@new) = $self->config($key);
386     my (@old) = $compat->config($key);
387     unless ( scalar(@new) == scalar(@old)) { 
388       $error .= "$key fails list comparison; ";
389     }else{
390       my $r=1;
391       foreach (@old) { $r=0 if ($_ cmp shift(@new)); }
392       $error .= "$key fails list comparison; "
393         unless $r;
394     }
395
396   } else {
397
398     $error .= "$key fails binary comparison; "
399       unless scalar($self->config_binary($key)) eq scalar($compat->config_binary($key));
400
401   }
402
403 #remove deprecated config on our own terms, not freeside-upgrade's
404 #  if ($error =~ /existential comparison/ && $item->section eq 'deprecated') {
405 #    my $proto;
406 #    for ( @config_items ) { $proto = $_; last if $proto->key eq $key;  }
407 #    unless ($proto->key eq $key) { 
408 #      warn "removed config item $error\n" if $DEBUG;
409 #      $error = '';
410 #    }
411 #  }
412
413   $error;
414 }
415
416 #item _orbase_items OPTIONS
417 #
418 #Returns all of the possible extensible config items as FS::ConfItem objects.
419 #See #L<FS::ConfItem>.  OPTIONS consists of name value pairs.  Possible
420 #options include
421 #
422 # dir - the directory to search for configuration option files instead
423 #       of using the conf records in the database
424 #
425 #cut
426
427 #quelle kludge
428 sub _orbase_items {
429   my ($self, %opt) = @_; 
430
431   my $listmaker = sub { my $v = shift;
432                         $v =~ s/_/!_/g;
433                         if ( $v =~ /\.(png|eps)$/ ) {
434                           $v =~ s/\./!_%./;
435                         }else{
436                           $v .= '!_%';
437                         }
438                         map { $_->name }
439                           FS::Record::qsearch( 'conf',
440                                                {},
441                                                '',
442                                                "WHERE name LIKE '$v' ESCAPE '!'"
443                                              );
444                       };
445
446   if (exists($opt{dir}) && $opt{dir}) {
447     $listmaker = sub { my $v = shift;
448                        if ( $v =~ /\.(png|eps)$/ ) {
449                          $v =~ s/\./_*./;
450                        }else{
451                          $v .= '_*';
452                        }
453                        map { basename $_ } glob($opt{dir}. "/$v" );
454                      };
455   }
456
457   ( map { 
458           my $proto;
459           my $base = $_;
460           for ( @config_items ) { $proto = $_; last if $proto->key eq $base;  }
461           die "don't know about $base items" unless $proto->key eq $base;
462
463           map { new FS::ConfItem { 
464                   'key'         => $_,
465                   'base_key'    => $proto->key,
466                   'section'     => $proto->section,
467                   'description' => 'Alternate ' . $proto->description . '  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Invoice_templates">billing documentation</a> for details.',
468                   'type'        => $proto->type,
469                 };
470               } &$listmaker($base);
471         } @base_items,
472   );
473 }
474
475 =item config_items
476
477 Returns all of the possible global/default configuration items as
478 FS::ConfItem objects.  See L<FS::ConfItem>.
479
480 =cut
481
482 sub config_items {
483   my $self = shift; 
484   return $self->_usecompat('config_items', @_) if use_confcompat;
485
486   ( @config_items, $self->_orbase_items(@_) );
487 }
488
489 =back
490
491 =head1 SUBROUTINES
492
493 =over 4
494
495 =item init-config DIR
496
497 Imports the configuration items from DIR (1.7 compatible)
498 to conf records in the database.
499
500 =cut
501
502 sub init_config {
503   my $dir = shift;
504
505   {
506     local $FS::UID::use_confcompat = 0;
507     my $conf = new FS::Conf;
508     foreach my $item ( $conf->config_items(dir => $dir) ) {
509       $conf->import_config_item($item, $dir);
510       my $error = $conf->verify_config_item($item, $dir);
511       return $error if $error;
512     }
513   
514     my $compat = new FS::Conf_compat17 $dir;
515     foreach my $item ( $compat->config_items ) {
516       my $error = $conf->verify_config_item($item, $dir);
517       return $error if $error;
518     }
519   }
520
521   $FS::UID::use_confcompat = 0;
522   '';  #success
523 }
524
525 =back
526
527 =head1 BUGS
528
529 If this was more than just crud that will never be useful outside Freeside I'd
530 worry that config_items is freeside-specific and icky.
531
532 =head1 SEE ALSO
533
534 "Configuration" in the web interface (config/config.cgi).
535
536 =cut
537
538 #Business::CreditCard
539 @card_types = (
540   "VISA card",
541   "MasterCard",
542   "Discover card",
543   "American Express card",
544   "Diner's Club/Carte Blanche",
545   "enRoute",
546   "JCB",
547   "BankCard",
548   "Switch",
549   "Solo",
550 );
551
552 @base_items = qw (
553                    invoice_template
554                    invoice_latex
555                    invoice_latexreturnaddress
556                    invoice_latexfooter
557                    invoice_latexsmallfooter
558                    invoice_latexnotes
559                    invoice_latexcoupon
560                    invoice_html
561                    invoice_htmlreturnaddress
562                    invoice_htmlfooter
563                    invoice_htmlnotes
564                    logo.png
565                    logo.eps
566                  );
567
568 @config_items = map { new FS::ConfItem $_ } (
569
570   {
571     'key'         => 'address',
572     'section'     => 'deprecated',
573     'description' => 'This configuration option is no longer used.  See <a href="#invoice_template">invoice_template</a> instead.',
574     'type'        => 'text',
575   },
576
577   {
578     'key'         => 'alert_expiration',
579     'section'     => 'billing',
580     'description' => 'Enable alerts about billing method expiration (i.e. expiring credit cards).',
581     'type'        => 'checkbox',
582     'per_agent'   => 1,
583   },
584
585   {
586     'key'         => 'alerter_template',
587     'section'     => 'billing',
588     'description' => 'Template file for billing method expiration alerts (i.e. expiring credit cards).  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Credit_cards_and_Electronic_checks">billing documentation</a> for details.',
589     'type'        => 'textarea',
590     'per_agent'   => 1,
591   },
592
593   {
594     'key'         => 'apacheip',
595     #not actually deprecated yet
596     #'section'     => 'deprecated',
597     #'description' => '<b>DEPRECATED</b>, add an <i>apache</i> <a href="../browse/part_export.cgi">export</a> instead.  Used to be the current IP address to assign to new virtual hosts',
598     'section'     => '',
599     'description' => 'IP address to assign to new virtual hosts',
600     'type'        => 'text',
601   },
602
603   {
604     'key'         => 'encryption',
605     'section'     => 'billing',
606     'description' => 'Enable encryption of credit cards.',
607     'type'        => 'checkbox',
608   },
609
610   {
611     'key'         => 'encryptionmodule',
612     'section'     => 'billing',
613     'description' => 'Use which module for encryption?',
614     'type'        => 'text',
615   },
616
617   {
618     'key'         => 'encryptionpublickey',
619     'section'     => 'billing',
620     'description' => 'Your RSA Public Key - Required if Encryption is turned on.',
621     'type'        => 'textarea',
622   },
623
624   {
625     'key'         => 'encryptionprivatekey',
626     'section'     => 'billing',
627     'description' => 'Your RSA Private Key - Including this will enable the "Bill Now" feature.  However if the system is compromised, a hacker can use this key to decode the stored credit card information.  This is generally not a good idea.',
628     'type'        => 'textarea',
629   },
630
631   {
632     'key'         => 'billco-url',
633     'section'     => 'billing',
634     'description' => 'The url to use for performing uploads to the invoice mailing service.',
635     'type'        => 'text',
636     'per_agent'   => 1,
637   },
638
639   {
640     'key'         => 'billco-username',
641     'section'     => 'billing',
642     'description' => 'The login name to use for uploads to the invoice mailing service.',
643     'type'        => 'text',
644     'per_agent'   => 1,
645     'agentonly'   => 1,
646   },
647
648   {
649     'key'         => 'billco-password',
650     'section'     => 'billing',
651     'description' => 'The password to use for uploads to the invoice mailing service.',
652     'type'        => 'text',
653     'per_agent'   => 1,
654     'agentonly'   => 1,
655   },
656
657   {
658     'key'         => 'billco-clicode',
659     'section'     => 'billing',
660     'description' => 'The clicode to use for uploads to the invoice mailing service.',
661     'type'        => 'text',
662     'per_agent'   => 1,
663   },
664
665   {
666     'key'         => 'business-onlinepayment',
667     'section'     => 'billing',
668     'description' => '<a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> support, at least three lines: processor, login, and password.  An optional fourth line specifies the action or actions (multiple actions are separated with `,\': for example: `Authorization Only, Post Authorization\').    Optional additional lines are passed to Business::OnlinePayment as %processor_options.',
669     'type'        => 'textarea',
670   },
671
672   {
673     'key'         => 'business-onlinepayment-ach',
674     'section'     => 'billing',
675     'description' => 'Alternate <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> support for ACH transactions (defaults to regular <b>business-onlinepayment</b>).  At least three lines: processor, login, and password.  An optional fourth line specifies the action or actions (multiple actions are separated with `,\': for example: `Authorization Only, Post Authorization\').    Optional additional lines are passed to Business::OnlinePayment as %processor_options.',
676     'type'        => 'textarea',
677   },
678
679   {
680     'key'         => 'business-onlinepayment-namespace',
681     'section'     => 'billing',
682     'description' => 'Specifies which perl module namespace (which group of collection routines) is used by default.',
683     'type'        => 'select',
684     'select_hash' => [
685                        'Business::OnlinePayment' => 'Direct API (Business::OnlinePayment)',
686                        'Business::OnlineThirdPartyPayment' => 'Web API (Business::ThirdPartyPayment)',
687                      ],
688   },
689
690   {
691     'key'         => 'business-onlinepayment-description',
692     'section'     => 'billing',
693     'description' => 'String passed as the description field to <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a>.  Evaluated as a double-quoted perl string, with the following variables available: <code>$agent</code> (the agent name), and <code>$pkgs</code> (a comma-separated list of packages for which these charges apply)',
694     'type'        => 'text',
695   },
696
697   {
698     'key'         => 'business-onlinepayment-email-override',
699     'section'     => 'billing',
700     'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
701     'type'        => 'text',
702   },
703
704   {
705     'key'         => 'business-onlinepayment-email_customer',
706     'section'     => 'billing',
707     'description' => 'Controls the "email_customer" flag used by some Business::OnlinePayment processors to enable customer receipts.',
708     'type'        => 'checkbox',
709   },
710
711   {
712     'key'         => 'countrydefault',
713     'section'     => 'UI',
714     'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
715     'type'        => 'text',
716   },
717
718   {
719     'key'         => 'date_format',
720     'section'     => 'UI',
721     'description' => 'Format for displaying dates',
722     'type'        => 'select',
723     'select_hash' => [
724                        '%m/%d/%Y' => 'MM/DD/YYYY',
725                        '%Y/%m/%d' => 'YYYY/MM/DD',
726                      ],
727   },
728
729   {
730     'key'         => 'deletecustomers',
731     'section'     => 'UI',
732     'description' => 'Enable customer deletions.  Be very careful!  Deleting a customer will remove all traces that the customer ever existed!  It should probably only be used when auditing a legacy database.  Normally, you cancel all of a customers\' packages if they cancel service.',
733     'type'        => 'checkbox',
734   },
735
736   {
737     'key'         => 'deleteinvoices',
738     'section'     => 'UI',
739     'description' => 'Enable invoices deletions.  Be very careful!  Deleting an invoice will remove all traces that the invoice ever existed!  Normally, you would apply a credit against the invoice instead.',  #invoice voiding?
740     'type'        => 'checkbox',
741   },
742
743   {
744     'key'         => 'deletepayments',
745     'section'     => 'billing',
746     'description' => 'Enable deletion of unclosed payments.  Really, with voids this is pretty much not recommended in any situation anymore.  Be very careful!  Only delete payments that were data-entry errors, not adjustments.  Optionally specify one or more comma-separated email addresses to be notified when a payment is deleted.',
747     'type'        => [qw( checkbox text )],
748   },
749
750   {
751     'key'         => 'deletecredits',
752     #not actually deprecated yet
753     #'section'     => 'deprecated',
754     #'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable deletion of unclosed credits.  Be very careful!  Only delete credits that were data-entry errors, not adjustments.  Optionally specify one or more comma-separated email addresses to be notified when a credit is deleted.',
755     'section'     => '',
756     'description' => 'One or more comma-separated email addresses to be notified when a credit is deleted.',
757     'type'        => [qw( checkbox text )],
758   },
759
760   {
761     'key'         => 'deleterefunds',
762     'section'     => 'billing',
763     'description' => 'Enable deletion of unclosed refunds.  Be very careful!  Only delete refunds that were data-entry errors, not adjustments.',
764     'type'        => 'checkbox',
765   },
766
767   {
768     'key'         => 'unapplypayments',
769     'section'     => 'deprecated',
770     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable "unapplication" of unclosed payments.',
771     'type'        => 'checkbox',
772   },
773
774   {
775     'key'         => 'unapplycredits',
776     'section'     => 'deprecated',
777     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to nable "unapplication" of unclosed credits.',
778     'type'        => 'checkbox',
779   },
780
781   {
782     'key'         => 'dirhash',
783     'section'     => 'shell',
784     'description' => 'Optional numeric value to control directory hashing.  If positive, hashes directories for the specified number of levels from the front of the username.  If negative, hashes directories for the specified number of levels from the end of the username.  Some examples: <ul><li>1: user -> <a href="#home">/home</a>/u/user<li>2: user -> <a href="#home">/home</a>/u/s/user<li>-1: user -> <a href="#home">/home</a>/r/user<li>-2: user -> <a href="#home">home</a>/r/e/user</ul>',
785     'type'        => 'text',
786   },
787
788   {
789     'key'         => 'disable_cust_attachment',
790     'section'     => '',
791     'description' => 'Disable customer file attachments',
792     'type'        => 'checkbox',
793   },
794
795   {
796     'key'         => 'max_attachment_size',
797     'section'     => '',
798     'description' => 'Maximum size for customer file attachments (leave blank for unlimited)',
799     'type'        => 'text',
800   },
801
802   {
803     'key'         => 'disable_customer_referrals',
804     'section'     => 'UI',
805     'description' => 'Disable new customer-to-customer referrals in the web interface',
806     'type'        => 'checkbox',
807   },
808
809   {
810     'key'         => 'editreferrals',
811     'section'     => 'UI',
812     'description' => 'Enable advertising source modification for existing customers',
813     'type'        => 'checkbox',
814   },
815
816   {
817     'key'         => 'emailinvoiceonly',
818     'section'     => 'billing',
819     'description' => 'Disables postal mail invoices',
820     'type'        => 'checkbox',
821   },
822
823   {
824     'key'         => 'disablepostalinvoicedefault',
825     'section'     => 'billing',
826     'description' => 'Disables postal mail invoices as the default option in the UI.  Be careful not to setup customers which are not sent invoices.  See <a href ="#emailinvoiceauto">emailinvoiceauto</a>.',
827     'type'        => 'checkbox',
828   },
829
830   {
831     'key'         => 'emailinvoiceauto',
832     'section'     => 'billing',
833     'description' => 'Automatically adds new accounts to the email invoice list',
834     'type'        => 'checkbox',
835   },
836
837   {
838     'key'         => 'emailinvoiceautoalways',
839     'section'     => 'billing',
840     'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses',
841     'type'        => 'checkbox',
842   },
843
844   {
845     'key'         => 'emailinvoice-apostrophe',
846     'section'     => 'billing',
847     'description' => 'Allows the apostrophe (single quote) character in the email addresses in the email invoice list.',
848     'type'        => 'checkbox',
849   },
850
851   {
852     'key'         => 'exclude_ip_addr',
853     'section'     => '',
854     'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
855     'type'        => 'textarea',
856   },
857   
858   {
859     'key'         => 'auto_router',
860     'section'     => '',
861     'description' => 'Automatically choose the correct router/block based on supplied ip address when possible while provisioning broadband services',
862     'type'        => 'checkbox',
863   },
864   
865   {
866     'key'         => 'hidecancelledpackages',
867     'section'     => 'UI',
868     'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
869     'type'        => 'checkbox',
870   },
871
872   {
873     'key'         => 'hidecancelledcustomers',
874     'section'     => 'UI',
875     'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
876     'type'        => 'checkbox',
877   },
878
879   {
880     'key'         => 'home',
881     'section'     => 'shell',
882     'description' => 'For new users, prefixed to username to create a directory name.  Should have a leading but not a trailing slash.',
883     'type'        => 'text',
884   },
885
886   {
887     'key'         => 'invoice_from',
888     'section'     => 'required',
889     'description' => 'Return address on email invoices',
890     'type'        => 'text',
891     'per_agent'   => 1,
892   },
893
894   {
895     'key'         => 'invoice_subject',
896     'section'     => 'billing',
897     'description' => 'Subject: header on email invoices.  Defaults to "Invoice".  The following substitutions are available: $name, $name_short, $invoice_number, and $invoice_date.',
898     'type'        => 'text',
899     'per_agent'   => 1,
900   },
901
902   {
903     'key'         => 'invoice_usesummary',
904     'section'     => 'billing',
905     'description' => 'Indicates that html and latex invoices should be in summary style and make use of invoice_latexsummary.',
906     'type'        => 'checkbox',
907   },
908
909   {
910     'key'         => 'invoice_template',
911     'section'     => 'billing',
912     'description' => 'Text template file for invoices.  Used if no invoice_html template is defined, and also seen by users using non-HTML capable mail clients.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Plaintext_invoice_templates">billing documentation</a> for details.',
913     'type'        => 'textarea',
914   },
915
916   {
917     'key'         => 'invoice_html',
918     'section'     => 'billing',
919     'description' => 'Optional HTML template for invoices.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#HTML_invoice_templates">billing documentation</a> for details.',
920
921     'type'        => 'textarea',
922   },
923
924   {
925     'key'         => 'invoice_htmlnotes',
926     'section'     => 'billing',
927     'description' => 'Notes section for HTML invoices.  Defaults to the same data in invoice_latexnotes if not specified.',
928     'type'        => 'textarea',
929     'per_agent'   => 1,
930   },
931
932   {
933     'key'         => 'invoice_htmlfooter',
934     'section'     => 'billing',
935     'description' => 'Footer for HTML invoices.  Defaults to the same data in invoice_latexfooter if not specified.',
936     'type'        => 'textarea',
937     'per_agent'   => 1,
938   },
939
940   {
941     'key'         => 'invoice_htmlsummary',
942     'section'     => 'billing',
943     'description' => 'Summary initial page for HTML invoices.',
944     'type'        => 'textarea',
945     'per_agent'   => 1,
946   },
947
948   {
949     'key'         => 'invoice_htmlreturnaddress',
950     'section'     => 'billing',
951     'description' => 'Return address for HTML invoices.  Defaults to the same data in invoice_latexreturnaddress if not specified.',
952     'type'        => 'textarea',
953   },
954
955   {
956     'key'         => 'invoice_latex',
957     'section'     => 'billing',
958     'description' => 'Optional LaTeX template for typeset PostScript invoices.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Typeset_.28LaTeX.29_invoice_templates">billing documentation</a> for details.',
959     'type'        => 'textarea',
960   },
961
962   {
963     'key'         => 'invoice_latexnotes',
964     'section'     => 'billing',
965     'description' => 'Notes section for LaTeX typeset PostScript invoices.',
966     'type'        => 'textarea',
967     'per_agent'   => 1,
968   },
969
970   {
971     'key'         => 'invoice_latexfooter',
972     'section'     => 'billing',
973     'description' => 'Footer for LaTeX typeset PostScript invoices.',
974     'type'        => 'textarea',
975     'per_agent'   => 1,
976   },
977
978   {
979     'key'         => 'invoice_latexsummary',
980     'section'     => 'billing',
981     'description' => 'Summary initial page for LaTeX typeset PostScript invoices.',
982     'type'        => 'textarea',
983     'per_agent'   => 1,
984   },
985
986   {
987     'key'         => 'invoice_latexcoupon',
988     'section'     => 'billing',
989     'description' => 'Remittance coupon for LaTeX typeset PostScript invoices.',
990     'type'        => 'textarea',
991     'per_agent'   => 1,
992   },
993
994   {
995     'key'         => 'invoice_latexreturnaddress',
996     'section'     => 'billing',
997     'description' => 'Return address for LaTeX typeset PostScript invoices.',
998     'type'        => 'textarea',
999   },
1000
1001   {
1002     'key'         => 'invoice_latexsmallfooter',
1003     'section'     => 'billing',
1004     'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
1005     'type'        => 'textarea',
1006     'per_agent'   => 1,
1007   },
1008
1009   {
1010     'key'         => 'invoice_email_pdf',
1011     'section'     => 'billing',
1012     'description' => 'Send PDF invoice as an attachment to emailed invoices.  By default, includes the plain text invoice as the email body, unless invoice_email_pdf_note is set.',
1013     'type'        => 'checkbox'
1014   },
1015
1016   {
1017     'key'         => 'invoice_email_pdf_note',
1018     'section'     => 'billing',
1019     'description' => 'If defined, this text will replace the default plain text invoice as the body of emailed PDF invoices.',
1020     'type'        => 'textarea'
1021   },
1022
1023
1024   { 
1025     'key'         => 'invoice_default_terms',
1026     'section'     => 'billing',
1027     'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
1028     'type'        => 'select',
1029     'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 20', 'Net 30', 'Net 45', 'Net 60' ],
1030   },
1031
1032   { 
1033     'key'         => 'invoice_show_prior_due_date',
1034     'section'     => 'billing',
1035     'description' => 'Show previous invoice due dates when showing prior balances.  Default is to show invoice date.',
1036     'type'        => 'checkbox',
1037   },
1038
1039   { 
1040     'key'         => 'invoice_include_aging',
1041     'section'     => 'billing',
1042     'description' => 'Show an aging line after the prior balance section.  Only valud when invoice_sections is enabled.',
1043     'type'        => 'checkbox',
1044   },
1045
1046   { 
1047     'key'         => 'invoice_sections',
1048     'section'     => 'billing',
1049     'description' => 'Split invoice into sections and label according to package category when enabled.',
1050     'type'        => 'checkbox',
1051   },
1052
1053   { 
1054     'key'         => 'usage_class_as_a_section',
1055     'section'     => 'billing',
1056     'description' => 'Split usage into sections and label according to usage class name when enabled.  Only valid when invoice_sections is enabled.',
1057     'type'        => 'checkbox',
1058   },
1059
1060   { 
1061     'key'         => 'svc_phone_sections',
1062     'section'     => 'billing',
1063     'description' => 'Create a section for each svc_phone when enabled.  Only valid when invoice_sections is enabled.',
1064     'type'        => 'checkbox',
1065   },
1066
1067   {
1068     'key'         => 'finance_pkgclass',
1069     'section'     => 'billing',
1070     'description' => 'The package class for finance charges',
1071     'type'        => 'select-pkg_class',
1072   },
1073
1074   { 
1075     'key'         => 'separate_usage',
1076     'section'     => 'billing',
1077     'description' => 'Split the rated call usage into a separate line from the recurring charges.',
1078     'type'        => 'checkbox',
1079   },
1080
1081   {
1082     'key'         => 'invoice_send_receipts',
1083     'section'     => 'deprecated',
1084     'description' => '<b>DEPRECATED</b>, this used to send an invoice copy on payments and credits.  See the payment_receipt_email and XXXX instead.',
1085     'type'        => 'checkbox',
1086   },
1087
1088   {
1089     'key'         => 'payment_receipt_email',
1090     'section'     => 'billing',
1091     'description' => 'Template file for payment receipts.  Payment receipts are sent to the customer email invoice destination(s) when a payment is received.  See the <a href="http://search.cpan.org/dist/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitution language.  The following variables are available: <ul><li><code>$date</code> <li><code>$name</code> <li><code>$paynum</code> - Freeside payment number <li><code>$paid</code> - Amount of payment <li><code>$payby</code> - Payment type (Card, Check, Electronic check, etc.) <li><code>$payinfo</code> - Masked credit card number or check number <li><code>$balance</code> - New balance<li><code>$pkg</code> - Package (requires payment_receipt-trigger set to "when payment is applied".)</ul>',
1092     'type'        => [qw( checkbox textarea )],
1093   },
1094
1095   {
1096     'key'         => 'payment_receipt-trigger',
1097     'section'     => 'billing',
1098     'description' => 'When payment receipts are triggered.  Defaults to when payment is made.',
1099     'type'        => 'select',
1100     'select_hash' => [
1101                        'cust_pay'          => 'When payment is made.',
1102                        'cust_bill_pay_pkg' => 'When payment is applied.',
1103                      ],
1104   },
1105
1106   {
1107     'key'         => 'lpr',
1108     'section'     => 'required',
1109     'description' => 'Print command for paper invoices, for example `lpr -h\'',
1110     'type'        => 'text',
1111   },
1112
1113   {
1114     'key'         => 'lpr-postscript_prefix',
1115     'section'     => 'billing',
1116     'description' => 'Raw printer commands prepended to the beginning of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
1117     'type'        => 'text',
1118   },
1119
1120   {
1121     'key'         => 'lpr-postscript_suffix',
1122     'section'     => 'billing',
1123     'description' => 'Raw printer commands added to the end of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
1124     'type'        => 'text',
1125   },
1126
1127   {
1128     'key'         => 'money_char',
1129     'section'     => '',
1130     'description' => 'Currency symbol - defaults to `$\'',
1131     'type'        => 'text',
1132   },
1133
1134   {
1135     'key'         => 'defaultrecords',
1136     'section'     => 'BIND',
1137     'description' => 'DNS entries to add automatically when creating a domain',
1138     'type'        => 'editlist',
1139     'editlist_parts' => [ { type=>'text' },
1140                           { type=>'immutable', value=>'IN' },
1141                           { type=>'select',
1142                             select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS TXT)} },
1143                           { type=> 'text' }, ],
1144   },
1145
1146   {
1147     'key'         => 'passwordmin',
1148     'section'     => 'password',
1149     'description' => 'Minimum password length (default 6)',
1150     'type'        => 'text',
1151   },
1152
1153   {
1154     'key'         => 'passwordmax',
1155     'section'     => 'password',
1156     'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
1157     'type'        => 'text',
1158   },
1159
1160   {
1161     'key'         => 'password-noampersand',
1162     'section'     => 'password',
1163     'description' => 'Disallow ampersands in passwords',
1164     'type'        => 'checkbox',
1165   },
1166
1167   {
1168     'key'         => 'password-noexclamation',
1169     'section'     => 'password',
1170     'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
1171     'type'        => 'checkbox',
1172   },
1173
1174   {
1175     'key'         => 'default-password-encoding',
1176     'section'     => 'password',
1177     'description' => 'Default storage format for passwords',
1178     'type'        => 'select',
1179     'select_hash' => [
1180       'plain'       => 'Plain text',
1181       'crypt-des'   => 'Unix password (DES encrypted)',
1182       'crypt-md5'   => 'Unix password (MD5 digest)',
1183       'ldap-plain'  => 'LDAP (plain text)',
1184       'ldap-crypt'  => 'LDAP (DES encrypted)',
1185       'ldap-md5'    => 'LDAP (MD5 digest)',
1186       'ldap-sha1'   => 'LDAP (SHA1 digest)',
1187       'legacy'      => 'Legacy mode',
1188     ],
1189   },
1190
1191   {
1192     'key'         => 'referraldefault',
1193     'section'     => 'UI',
1194     'description' => 'Default referral, specified by refnum',
1195     'type'        => 'text',
1196   },
1197
1198 #  {
1199 #    'key'         => 'registries',
1200 #    'section'     => 'required',
1201 #    'description' => 'Directory which contains domain registry information.  Each registry is a directory.',
1202 #  },
1203
1204   {
1205     'key'         => 'report_template',
1206     'section'     => 'deprecated',
1207     'description' => 'Deprecated template file for reports.',
1208     'type'        => 'textarea',
1209   },
1210
1211   {
1212     'key'         => 'maxsearchrecordsperpage',
1213     'section'     => 'UI',
1214     'description' => 'If set, number of search records to return per page.',
1215     'type'        => 'text',
1216   },
1217
1218   {
1219     'key'         => 'session-start',
1220     'section'     => 'session',
1221     'description' => 'If defined, the command which is executed on the Freeside machine when a session begins.  The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on.',
1222     'type'        => 'text',
1223   },
1224
1225   {
1226     'key'         => 'session-stop',
1227     'section'     => 'session',
1228     'description' => 'If defined, the command which is executed on the Freeside machine when a session ends.  The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on.',
1229     'type'        => 'text',
1230   },
1231
1232   {
1233     'key'         => 'shells',
1234     'section'     => 'shell',
1235     'description' => 'Legal shells (think /etc/shells).  You probably want to `cut -d: -f7 /etc/passwd | sort | uniq\' initially so that importing doesn\'t fail with `Illegal shell\' errors, then remove any special entries afterwords.  A blank line specifies that an empty shell is permitted.',
1236     'type'        => 'textarea',
1237   },
1238
1239   {
1240     'key'         => 'showpasswords',
1241     'section'     => 'UI',
1242     'description' => 'Display unencrypted user passwords in the backend (employee) web interface',
1243     'type'        => 'checkbox',
1244   },
1245
1246   {
1247     'key'         => 'signupurl',
1248     'section'     => 'UI',
1249     'description' => 'if you are using customer-to-customer referrals, and you enter the URL of your <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Self-Service_Installation">signup server CGI</a>, the customer view screen will display a customized link to the signup server with the appropriate customer as referral',
1250     'type'        => 'text',
1251   },
1252
1253   {
1254     'key'         => 'smtpmachine',
1255     'section'     => 'required',
1256     'description' => 'SMTP relay for Freeside\'s outgoing mail',
1257     'type'        => 'text',
1258   },
1259
1260   {
1261     'key'         => 'soadefaultttl',
1262     'section'     => 'BIND',
1263     'description' => 'SOA default TTL for new domains.',
1264     'type'        => 'text',
1265   },
1266
1267   {
1268     'key'         => 'soaemail',
1269     'section'     => 'BIND',
1270     'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
1271     'type'        => 'text',
1272   },
1273
1274   {
1275     'key'         => 'soaexpire',
1276     'section'     => 'BIND',
1277     'description' => 'SOA expire for new domains',
1278     'type'        => 'text',
1279   },
1280
1281   {
1282     'key'         => 'soamachine',
1283     'section'     => 'BIND',
1284     'description' => 'SOA machine for new domains, with trailing `.\'',
1285     'type'        => 'text',
1286   },
1287
1288   {
1289     'key'         => 'soarefresh',
1290     'section'     => 'BIND',
1291     'description' => 'SOA refresh for new domains',
1292     'type'        => 'text',
1293   },
1294
1295   {
1296     'key'         => 'soaretry',
1297     'section'     => 'BIND',
1298     'description' => 'SOA retry for new domains',
1299     'type'        => 'text',
1300   },
1301
1302   {
1303     'key'         => 'statedefault',
1304     'section'     => 'UI',
1305     'description' => 'Default state or province (if not supplied, the default is `CA\')',
1306     'type'        => 'text',
1307   },
1308
1309   {
1310     'key'         => 'unsuspendauto',
1311     'section'     => 'billing',
1312     'description' => 'Enables the automatic unsuspension of suspended packages when a customer\'s balance due changes from positive to zero or negative as the result of a payment or credit',
1313     'type'        => 'checkbox',
1314   },
1315
1316   {
1317     'key'         => 'unsuspend-always_adjust_next_bill_date',
1318     'section'     => 'billing',
1319     'description' => 'Global override that causes unsuspensions to always adjust the next bill date under any circumstances.  This is now controlled on a per-package bases - probably best not to use this option unless you are a legacy installation that requires this behaviour.',
1320     'type'        => 'checkbox',
1321   },
1322
1323   {
1324     'key'         => 'usernamemin',
1325     'section'     => 'username',
1326     'description' => 'Minimum username length (default 2)',
1327     'type'        => 'text',
1328   },
1329
1330   {
1331     'key'         => 'usernamemax',
1332     'section'     => 'username',
1333     'description' => 'Maximum username length',
1334     'type'        => 'text',
1335   },
1336
1337   {
1338     'key'         => 'username-ampersand',
1339     'section'     => 'username',
1340     'description' => 'Allow the ampersand character (&amp;) in usernames.  Be careful when using this option in conjunction with <a href="../browse/part_export.cgi">exports</a> which execute shell commands, as the ampersand will be interpreted by the shell if not quoted.',
1341     'type'        => 'checkbox',
1342   },
1343
1344   {
1345     'key'         => 'username-letter',
1346     'section'     => 'username',
1347     'description' => 'Usernames must contain at least one letter',
1348     'type'        => 'checkbox',
1349     'per_agent'   => 1,
1350   },
1351
1352   {
1353     'key'         => 'username-letterfirst',
1354     'section'     => 'username',
1355     'description' => 'Usernames must start with a letter',
1356     'type'        => 'checkbox',
1357   },
1358
1359   {
1360     'key'         => 'username-noperiod',
1361     'section'     => 'username',
1362     'description' => 'Disallow periods in usernames',
1363     'type'        => 'checkbox',
1364   },
1365
1366   {
1367     'key'         => 'username-nounderscore',
1368     'section'     => 'username',
1369     'description' => 'Disallow underscores in usernames',
1370     'type'        => 'checkbox',
1371   },
1372
1373   {
1374     'key'         => 'username-nodash',
1375     'section'     => 'username',
1376     'description' => 'Disallow dashes in usernames',
1377     'type'        => 'checkbox',
1378   },
1379
1380   {
1381     'key'         => 'username-uppercase',
1382     'section'     => 'username',
1383     'description' => 'Allow uppercase characters in usernames.  Not recommended for use with FreeRADIUS with MySQL backend, which is case-insensitive by default.',
1384     'type'        => 'checkbox',
1385   },
1386
1387   { 
1388     'key'         => 'username-percent',
1389     'section'     => 'username',
1390     'description' => 'Allow the percent character (%) in usernames.',
1391     'type'        => 'checkbox',
1392   },
1393
1394   { 
1395     'key'         => 'username-colon',
1396     'section'     => 'username',
1397     'description' => 'Allow the colon character (:) in usernames.',
1398     'type'        => 'checkbox',
1399   },
1400
1401   {
1402     'key'         => 'safe-part_bill_event',
1403     'section'     => 'UI',
1404     'description' => 'Validates invoice event expressions against a preset list.  Useful for webdemos, annoying to powerusers.',
1405     'type'        => 'checkbox',
1406   },
1407
1408   {
1409     'key'         => 'show_ss',
1410     'section'     => 'UI',
1411     'description' => 'Turns on display/collection of social security numbers in the web interface.  Sometimes required by electronic check (ACH) processors.',
1412     'type'        => 'checkbox',
1413   },
1414
1415   {
1416     'key'         => 'show_stateid',
1417     'section'     => 'UI',
1418     'description' => "Turns on display/collection of driver's license/state issued id numbers in the web interface.  Sometimes required by electronic check (ACH) processors.",
1419     'type'        => 'checkbox',
1420   },
1421
1422   {
1423     'key'         => 'show_bankstate',
1424     'section'     => 'UI',
1425     'description' => "Turns on display/collection of state for bank accounts in the web interface.  Sometimes required by electronic check (ACH) processors.",
1426     'type'        => 'checkbox',
1427   },
1428
1429   { 
1430     'key'         => 'agent_defaultpkg',
1431     'section'     => 'UI',
1432     'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
1433     'type'        => 'checkbox',
1434   },
1435
1436   {
1437     'key'         => 'legacy_link',
1438     'section'     => 'UI',
1439     'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
1440     'type'        => 'checkbox',
1441   },
1442
1443   {
1444     'key'         => 'legacy_link-steal',
1445     'section'     => 'UI',
1446     'description' => 'Allow "stealing" an already-audited service from one customer (or package) to another using the link function.',
1447     'type'        => 'checkbox',
1448   },
1449
1450   {
1451     'key'         => 'queue_dangerous_controls',
1452     'section'     => 'UI',
1453     'description' => 'Enable queue modification controls on account pages and for new jobs.  Unless you are a developer working on new export code, you should probably leave this off to avoid causing provisioning problems.',
1454     'type'        => 'checkbox',
1455   },
1456
1457   {
1458     'key'         => 'security_phrase',
1459     'section'     => 'password',
1460     'description' => 'Enable the tracking of a "security phrase" with each account.  Not recommended, as it is vulnerable to social engineering.',
1461     'type'        => 'checkbox',
1462   },
1463
1464   {
1465     'key'         => 'locale',
1466     'section'     => 'UI',
1467     'description' => 'Message locale',
1468     'type'        => 'select',
1469     'select_enum' => [ qw(en_US) ],
1470   },
1471
1472   {
1473     'key'         => 'signup_server-payby',
1474     'section'     => '',
1475     'description' => 'Acceptable payment types for the signup server',
1476     'type'        => 'selectmultiple',
1477     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
1478   },
1479
1480   {
1481     'key'         => 'signup_server-default_agentnum',
1482     'section'     => '',
1483     'description' => 'Default agent for the signup server',
1484     'type'        => 'select-sub',
1485     'options_sub' => sub { require FS::Record;
1486                            require FS::agent;
1487                            map { $_->agentnum => $_->agent }
1488                                FS::Record::qsearch('agent', { disabled=>'' } );
1489                          },
1490     'option_sub'  => sub { require FS::Record;
1491                            require FS::agent;
1492                            my $agent = FS::Record::qsearchs(
1493                              'agent', { 'agentnum'=>shift }
1494                            );
1495                            $agent ? $agent->agent : '';
1496                          },
1497   },
1498
1499   {
1500     'key'         => 'signup_server-default_refnum',
1501     'section'     => '',
1502     'description' => 'Default advertising source for the signup server',
1503     'type'        => 'select-sub',
1504     'options_sub' => sub { require FS::Record;
1505                            require FS::part_referral;
1506                            map { $_->refnum => $_->referral }
1507                                FS::Record::qsearch( 'part_referral', 
1508                                                     { 'disabled' => '' }
1509                                                   );
1510                          },
1511     'option_sub'  => sub { require FS::Record;
1512                            require FS::part_referral;
1513                            my $part_referral = FS::Record::qsearchs(
1514                              'part_referral', { 'refnum'=>shift } );
1515                            $part_referral ? $part_referral->referral : '';
1516                          },
1517   },
1518
1519   {
1520     'key'         => 'signup_server-default_pkgpart',
1521     'section'     => '',
1522     'description' => 'Default package for the signup server',
1523     'type'        => 'select-part_pkg',
1524   },
1525
1526   {
1527     'key'         => 'signup_server-default_svcpart',
1528     'section'     => '',
1529     'description' => 'Default service definition for the signup server - only necessary for services that trigger special provisioning widgets (such as DID provisioning).',
1530     'type'        => 'select-part_svc',
1531   },
1532
1533   {
1534     'key'         => 'signup_server-mac_addr_svcparts',
1535     'section'     => '',
1536     'description' => 'Service definitions which can receive mac addresses (current mapped to username for svc_acct).',
1537     'type'        => 'select-part_svc',
1538     'multiple'    => 1,
1539   },
1540
1541   {
1542     'key'         => 'signup_server-nomadix',
1543     'section'     => '',
1544     'description' => 'Signup page Nomadix integration',
1545     'type'        => 'checkbox',
1546   },
1547
1548   {
1549     'key'         => 'signup_server-service',
1550     'section'     => '',
1551     'description' => 'Service for the signup server - "Account (svc_acct)" is the default setting, or "Phone number (svc_phone)" for ITSP signup',
1552     'type'        => 'select',
1553     'select_hash' => [
1554                        'svc_acct'  => 'Account (svc_acct)',
1555                        'svc_phone' => 'Phone number (svc_phone)',
1556                      ],
1557   },
1558
1559   {
1560     'key'         => 'selfservice_server-base_url',
1561     'section'     => '',
1562     'description' => 'Base URL for the self-service web interface - necessary for some widgets to find their way, including retrieval of non-US state information and phone number provisioning.',
1563     'type'        => 'text',
1564   },
1565
1566   {
1567     'key'         => 'show-msgcat-codes',
1568     'section'     => 'UI',
1569     'description' => 'Show msgcat codes in error messages.  Turn this option on before reporting errors to the mailing list.',
1570     'type'        => 'checkbox',
1571   },
1572
1573   {
1574     'key'         => 'signup_server-realtime',
1575     'section'     => '',
1576     'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
1577     'type'        => 'checkbox',
1578   },
1579   {
1580     'key'         => 'signup_server-classnum2',
1581     'section'     => '',
1582     'description' => 'Package Class for first optional purchase',
1583     'type'        => 'select-pkg_class',
1584   },
1585
1586   {
1587     'key'         => 'signup_server-classnum3',
1588     'section'     => '',
1589     'description' => 'Package Class for second optional purchase',
1590     'type'        => 'select-pkg_class',
1591   },
1592
1593   {
1594     'key'         => 'backend-realtime',
1595     'section'     => '',
1596     'description' => 'Run billing for backend signups immediately.',
1597     'type'        => 'checkbox',
1598   },
1599
1600   {
1601     'key'         => 'declinetemplate',
1602     'section'     => 'billing',
1603     'description' => 'Template file for credit card and electronic check decline emails.',
1604     'type'        => 'textarea',
1605   },
1606
1607   {
1608     'key'         => 'emaildecline',
1609     'section'     => 'billing',
1610     'description' => 'Enable emailing of credit card and electronic check decline notices.',
1611     'type'        => 'checkbox',
1612   },
1613
1614   {
1615     'key'         => 'emaildecline-exclude',
1616     'section'     => 'billing',
1617     'description' => 'List of error messages that should not trigger email decline notices, one per line.',
1618     'type'        => 'textarea',
1619   },
1620
1621   {
1622     'key'         => 'cancelmessage',
1623     'section'     => 'billing',
1624     'description' => 'Template file for cancellation emails.',
1625     'type'        => 'textarea',
1626   },
1627
1628   {
1629     'key'         => 'cancelsubject',
1630     'section'     => 'billing',
1631     'description' => 'Subject line for cancellation emails.',
1632     'type'        => 'text',
1633   },
1634
1635   {
1636     'key'         => 'emailcancel',
1637     'section'     => 'billing',
1638     'description' => 'Enable emailing of cancellation notices.  Make sure to fill in the cancelmessage and cancelsubject configuration values as well.',
1639     'type'        => 'checkbox',
1640   },
1641
1642   {
1643     'key'         => 'bill_usage_on_cancel',
1644     'section'     => 'billing',
1645     'description' => 'Enable automatic generation of an invoice for usage when a package is cancelled.  Not all packages can do this.  Usage data must already be available.',
1646     'type'        => 'checkbox',
1647   },
1648
1649   {
1650     'key'         => 'require_cardname',
1651     'section'     => 'billing',
1652     'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
1653     'type'        => 'checkbox',
1654   },
1655
1656   {
1657     'key'         => 'enable_taxclasses',
1658     'section'     => 'billing',
1659     'description' => 'Enable per-package tax classes',
1660     'type'        => 'checkbox',
1661   },
1662
1663   {
1664     'key'         => 'require_taxclasses',
1665     'section'     => 'billing',
1666     'description' => 'Require a taxclass to be entered for every package',
1667     'type'        => 'checkbox',
1668   },
1669
1670   {
1671     'key'         => 'enable_taxproducts',
1672     'section'     => 'billing',
1673     'description' => 'Enable per-package mapping to vendor tax data from CCH or elsewhere.',
1674     'type'        => 'checkbox',
1675   },
1676
1677   {
1678     'key'         => 'taxdatadirectdownload',
1679     'section'     => 'billing',  #well
1680     'description' => 'Enable downloading tax data directly from the vendor site',
1681     'type'        => 'checkbox',
1682   },
1683
1684   {
1685     'key'         => 'ignore_incalculable_taxes',
1686     'section'     => 'billing',
1687     'description' => 'Prefer to invoice without tax over not billing at all',
1688     'type'        => 'checkbox',
1689   },
1690
1691   {
1692     'key'         => 'welcome_email',
1693     'section'     => '',
1694     'description' => 'Template file for welcome email.  Welcome emails are sent to the customer email invoice destination(s) each time a svc_acct record is created.  See the <a href="http://search.cpan.org/dist/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitution language.  The following variables are available<ul><li><code>$username</code> <li><code>$password</code> <li><code>$first</code> <li><code>$last</code> <li><code>$pkg</code></ul>',
1695     'type'        => 'textarea',
1696     'per_agent'   => 1,
1697   },
1698
1699   {
1700     'key'         => 'welcome_email-from',
1701     'section'     => '',
1702     'description' => 'From: address header for welcome email',
1703     'type'        => 'text',
1704     'per_agent'   => 1,
1705   },
1706
1707   {
1708     'key'         => 'welcome_email-subject',
1709     'section'     => '',
1710     'description' => 'Subject: header for welcome email',
1711     'type'        => 'text',
1712     'per_agent'   => 1,
1713   },
1714   
1715   {
1716     'key'         => 'welcome_email-mimetype',
1717     'section'     => '',
1718     'description' => 'MIME type for welcome email',
1719     'type'        => 'select',
1720     'select_enum' => [ 'text/plain', 'text/html' ],
1721     'per_agent'   => 1,
1722   },
1723
1724   {
1725     'key'         => 'welcome_letter',
1726     'section'     => '',
1727     'description' => 'Optional LaTex template file for a printed welcome letter.  A welcome letter is printed the first time a cust_pkg record is created.  See the <a href="http://search.cpan.org/dist/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation and the billing documentation for details on the template substitution language.  A variable exists for each fieldname in the customer record (<code>$first, $last, etc</code>).  The following additional variables are available<ul><li><code>$payby</code> - a friendler represenation of the field<li><code>$payinfo</code> - the masked payment information<li><code>$expdate</code> - the time at which the payment method expires (a UNIX timestamp)<li><code>$returnaddress</code> - the invoice return address for this customer\'s agent</ul>',
1728     'type'        => 'textarea',
1729   },
1730
1731   {
1732     'key'         => 'warning_email',
1733     'section'     => '',
1734     'description' => 'Template file for warning email.  Warning emails are sent to the customer email invoice destination(s) each time a svc_acct record has its usage drop below a threshold or 0.  See the <a href="http://search.cpan.org/dist/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitution language.  The following variables are available<ul><li><code>$username</code> <li><code>$password</code> <li><code>$first</code> <li><code>$last</code> <li><code>$pkg</code> <li><code>$column</code> <li><code>$amount</code> <li><code>$threshold</code></ul>',
1735     'type'        => 'textarea',
1736   },
1737
1738   {
1739     'key'         => 'warning_email-from',
1740     'section'     => '',
1741     'description' => 'From: address header for warning email',
1742     'type'        => 'text',
1743   },
1744
1745   {
1746     'key'         => 'warning_email-cc',
1747     'section'     => '',
1748     'description' => 'Additional recipient(s) (comma separated) for warning email when remaining usage reaches zero.',
1749     'type'        => 'text',
1750   },
1751
1752   {
1753     'key'         => 'warning_email-subject',
1754     'section'     => '',
1755     'description' => 'Subject: header for warning email',
1756     'type'        => 'text',
1757   },
1758   
1759   {
1760     'key'         => 'warning_email-mimetype',
1761     'section'     => '',
1762     'description' => 'MIME type for warning email',
1763     'type'        => 'select',
1764     'select_enum' => [ 'text/plain', 'text/html' ],
1765   },
1766
1767   {
1768     'key'         => 'payby',
1769     'section'     => 'billing',
1770     'description' => 'Available payment types.',
1771     'type'        => 'selectmultiple',
1772     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP) ],
1773   },
1774
1775   {
1776     'key'         => 'payby-default',
1777     'section'     => 'UI',
1778     'description' => 'Default payment type.  HIDE disables display of billing information and sets customers to BILL.',
1779     'type'        => 'select',
1780     'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP HIDE) ],
1781   },
1782
1783   {
1784     'key'         => 'paymentforcedtobatch',
1785     'section'     => 'deprecated',
1786     'description' => 'See batch-enable_payby and realtime-disable_payby.  Used to (for CHEK): Cause per customer payment entry to be forced to a batch processor rather than performed realtime.',
1787     'type'        => 'checkbox',
1788   },
1789
1790   {
1791     'key'         => 'svc_acct-notes',
1792     'section'     => 'UI',
1793     'description' => 'Extra HTML to be displayed on the Account View screen.',
1794     'type'        => 'textarea',
1795   },
1796
1797   {
1798     'key'         => 'radius-password',
1799     'section'     => '',
1800     'description' => 'RADIUS attribute for plain-text passwords.',
1801     'type'        => 'select',
1802     'select_enum' => [ 'Password', 'User-Password' ],
1803   },
1804
1805   {
1806     'key'         => 'radius-ip',
1807     'section'     => '',
1808     'description' => 'RADIUS attribute for IP addresses.',
1809     'type'        => 'select',
1810     'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
1811   },
1812
1813   #http://dev.coova.org/svn/coova-chilli/doc/dictionary.chillispot
1814   {
1815     'key'         => 'radius-chillispot-max',
1816     'section'     => '',
1817     'description' => 'Enable ChilliSpot (and CoovaChilli) Max attributes, specifically ChilliSpot-Max-{Input,Output,Total}-{Octets,Gigawords}.',
1818     'type'        => 'checkbox',
1819   },
1820
1821   {
1822     'key'         => 'svc_acct-alldomains',
1823     'section'     => '',
1824     'description' => 'Allow accounts to select any domain in the database.  Normally accounts can only select from the domain set in the service definition and those purchased by the customer.',
1825     'type'        => 'checkbox',
1826   },
1827
1828   {
1829     'key'         => 'dump-scpdest',
1830     'section'     => '',
1831     'description' => 'destination for scp database dumps: user@host:/path',
1832     'type'        => 'text',
1833   },
1834
1835   {
1836     'key'         => 'dump-pgpid',
1837     'section'     => '',
1838     'description' => "Optional PGP public key user or key id for database dumps.  The public key should exist on the freeside user's public keyring, and the gpg binary and GnuPG perl module should be installed.",
1839     'type'        => 'text',
1840   },
1841
1842   {
1843     'key'         => 'users-allow_comp',
1844     'section'     => 'deprecated',
1845     'description' => '<b>DEPRECATED</b>, enable the <i>Complimentary customer</i> access right instead.  Was: Usernames (Freeside users, created with <a href="../docs/man/bin/freeside-adduser.html">freeside-adduser</a>) which can create complimentary customers, one per line.  If no usernames are entered, all users can create complimentary accounts.',
1846     'type'        => 'textarea',
1847   },
1848
1849   {
1850     'key'         => 'credit_card-recurring_billing_flag',
1851     'section'     => 'billing',
1852     'description' => 'This controls when the system passes the "recurring_billing" flag on credit card transactions.  If supported by your processor (and the Business::OnlinePayment processor module), passing the flag indicates this is a recurring transaction and may turn off the CVV requirement. ',
1853     'type'        => 'select',
1854     'select_hash' => [
1855                        'actual_oncard' => 'Default/classic behavior: set the flag if a customer has actual previous charges on the card.',
1856                        'transaction_is_recur' => 'Set the flag if the transaction itself is recurring, irregardless of previous charges on the card.',
1857                      ],
1858   },
1859
1860   {
1861     'key'         => 'credit_card-recurring_billing_acct_code',
1862     'section'     => 'billing',
1863     'description' => 'When the "recurring billing" flag is set, also set the "acct_code" to "rebill".  Useful for reporting purposes with supported gateways (PlugNPay, others?)',
1864     'type'        => 'checkbox',
1865   },
1866
1867   {
1868     'key'         => 'cvv-save',
1869     'section'     => 'billing',
1870     'description' => 'Save CVV2 information after the initial transaction for the selected credit card types.  Enabling this option may be in violation of your merchant agreement(s), so please check them carefully before enabling this option for any credit card types.',
1871     'type'        => 'selectmultiple',
1872     'select_enum' => \@card_types,
1873   },
1874
1875   {
1876     'key'         => 'manual_process-pkgpart',
1877     'section'     => 'billing',
1878     'description' => 'Package to add to each manual credit card and ACH payments entered from the backend.  Enabling this option may be in violation of your merchant agreement(s), so please check them carefully before enabling this option.',
1879     'type'        => 'select-part_pkg',
1880   },
1881
1882   {
1883     'key'         => 'manual_process-display',
1884     'section'     => 'billing',
1885     'description' => 'When using manual_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
1886     'type'        => 'select',
1887     'select_hash' => [
1888                        'add'      => 'Add fee to amount entered',
1889                        'subtract' => 'Subtract fee from amount entered',
1890                      ],
1891   },
1892
1893   {
1894     'key'         => 'manual_process-skip_first',
1895     'section'     => 'billing',
1896     'description' => "When using manual_process-pkgpart, omit the fee if it is the customer's first payment.",
1897     'type'        => 'checkbox',
1898   },
1899
1900   {
1901     'key'         => 'allow_negative_charges',
1902     'section'     => 'billing',
1903     'description' => 'Allow negative charges.  Normally not used unless importing data from a legacy system that requires this.',
1904     'type'        => 'checkbox',
1905   },
1906   {
1907       'key'         => 'auto_unset_catchall',
1908       'section'     => '',
1909       'description' => 'When canceling a svc_acct that is the email catchall for one or more svc_domains, automatically set their catchall fields to null.  If this option is not set, the attempt will simply fail.',
1910       'type'        => 'checkbox',
1911   },
1912
1913   {
1914     'key'         => 'system_usernames',
1915     'section'     => 'username',
1916     'description' => 'A list of system usernames that cannot be edited or removed, one per line.  Use a bare username to prohibit modification/deletion of the username in any domain, or username@domain to prohibit modification/deletetion of a specific username and domain.',
1917     'type'        => 'textarea',
1918   },
1919
1920   {
1921     'key'         => 'cust_pkg-change_svcpart',
1922     'section'     => '',
1923     'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
1924     'type'        => 'checkbox',
1925   },
1926
1927   {
1928     'key'         => 'cust_pkg-change_pkgpart-bill_now',
1929     'section'     => '',
1930     'description' => "When changing packages, bill the new package immediately.  Useful for prepaid situations with RADIUS where an Expiration attribute base don the package must be present at all times.",
1931     'type'        => 'checkbox',
1932   },
1933
1934   {
1935     'key'         => 'disable_autoreverse',
1936     'section'     => 'BIND',
1937     'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
1938     'type'        => 'checkbox',
1939   },
1940
1941   {
1942     'key'         => 'svc_www-enable_subdomains',
1943     'section'     => '',
1944     'description' => 'Enable selection of specific subdomains for virtual host creation.',
1945     'type'        => 'checkbox',
1946   },
1947
1948   {
1949     'key'         => 'svc_www-usersvc_svcpart',
1950     'section'     => '',
1951     'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
1952     'type'        => 'select-part_svc',
1953     'multiple'    => 1,
1954   },
1955
1956   {
1957     'key'         => 'selfservice_server-primary_only',
1958     'section'     => '',
1959     'description' => 'Only allow primary accounts to access self-service functionality.',
1960     'type'        => 'checkbox',
1961   },
1962
1963   {
1964     'key'         => 'selfservice_server-phone_login',
1965     'section'     => '',
1966     'description' => 'Allow login to self-service with phone number and PIN.',
1967     'type'        => 'checkbox',
1968   },
1969
1970   {
1971     'key'         => 'selfservice_server-single_domain',
1972     'section'     => '',
1973     'description' => 'If specified, only use this one domain for self-service access.',
1974     'type'        => 'text',
1975   },
1976
1977   {
1978     'key'         => 'card_refund-days',
1979     'section'     => 'billing',
1980     'description' => 'After a payment, the number of days a refund link will be available for that payment.  Defaults to 120.',
1981     'type'        => 'text',
1982   },
1983
1984   {
1985     'key'         => 'agent-showpasswords',
1986     'section'     => '',
1987     'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
1988     'type'        => 'checkbox',
1989   },
1990
1991   {
1992     'key'         => 'global_unique-username',
1993     'section'     => 'username',
1994     'description' => 'Global username uniqueness control: none (usual setting - check uniqueness per exports), username (all usernames are globally unique, regardless of domain or exports), or username@domain (all username@domain pairs are globally unique, regardless of exports).  disabled turns off duplicate checking completely and is STRONGLY NOT RECOMMENDED unless you REALLY need to turn this off.',
1995     'type'        => 'select',
1996     'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
1997   },
1998
1999   {
2000     'key'         => 'global_unique-phonenum',
2001     'section'     => '',
2002     'description' => 'Global phone number uniqueness control: none (usual setting - check countrycode+phonenumun uniqueness per exports), or countrycode+phonenum (all countrycode+phonenum pairs are globally unique, regardless of exports).  disabled turns off duplicate checking completely and is STRONGLY NOT RECOMMENDED unless you REALLY need to turn this off.',
2003     'type'        => 'select',
2004     'select_enum' => [ 'none', 'countrycode+phonenum', 'disabled' ],
2005   },
2006
2007   {
2008     'key'         => 'svc_external-skip_manual',
2009     'section'     => 'UI',
2010     'description' => 'When provisioning svc_external services, skip manual entry of id and title fields in the UI.  Usually used in conjunction with an export that populates these fields (i.e. artera_turbo).',
2011     'type'        => 'checkbox',
2012   },
2013
2014   {
2015     'key'         => 'svc_external-display_type',
2016     'section'     => 'UI',
2017     'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
2018     'type'        => 'select',
2019     'select_enum' => [ 'generic', 'artera_turbo', ],
2020   },
2021
2022   {
2023     'key'         => 'ticket_system',
2024     'section'     => '',
2025     'description' => 'Ticketing system integration.  <b>RT_Internal</b> uses the built-in RT ticketing system (see the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:RT_Installation">integrated ticketing installation instructions</a>).   <b>RT_External</b> accesses an external RT installation in a separate database (local or remote).',
2026     'type'        => 'select',
2027     #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
2028     'select_enum' => [ '', qw(RT_Internal RT_External) ],
2029   },
2030
2031   {
2032     'key'         => 'ticket_system-default_queueid',
2033     'section'     => '',
2034     'description' => 'Default queue used when creating new customer tickets.',
2035     'type'        => 'select-sub',
2036     'options_sub' => sub {
2037                            my $conf = new FS::Conf;
2038                            if ( $conf->config('ticket_system') ) {
2039                              eval "use FS::TicketSystem;";
2040                              die $@ if $@;
2041                              FS::TicketSystem->queues();
2042                            } else {
2043                              ();
2044                            }
2045                          },
2046     'option_sub'  => sub { 
2047                            my $conf = new FS::Conf;
2048                            if ( $conf->config('ticket_system') ) {
2049                              eval "use FS::TicketSystem;";
2050                              die $@ if $@;
2051                              FS::TicketSystem->queue(shift);
2052                            } else {
2053                              '';
2054                            }
2055                          },
2056   },
2057
2058   {
2059     'key'         => 'ticket_system-priority_reverse',
2060     'section'     => '',
2061     'description' => 'Enable this to consider lower numbered priorities more important.  A bad habit we picked up somewhere.  You probably want to avoid it and use the default.',
2062     'type'        => 'checkbox',
2063   },
2064
2065   {
2066     'key'         => 'ticket_system-custom_priority_field',
2067     'section'     => '',
2068     'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
2069     'type'        => 'text',
2070   },
2071
2072   {
2073     'key'         => 'ticket_system-custom_priority_field-values',
2074     'section'     => '',
2075     'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
2076     'type'        => 'textarea',
2077   },
2078
2079   {
2080     'key'         => 'ticket_system-custom_priority_field_queue',
2081     'section'     => '',
2082     'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
2083     'type'        => 'text',
2084   },
2085
2086   {
2087     'key'         => 'ticket_system-rt_external_datasrc',
2088     'section'     => '',
2089     'description' => 'With external RT integration, the DBI data source for the external RT installation, for example, <code>DBI:Pg:user=rt_user;password=rt_word;host=rt.example.com;dbname=rt</code>',
2090     'type'        => 'text',
2091
2092   },
2093
2094   {
2095     'key'         => 'ticket_system-rt_external_url',
2096     'section'     => '',
2097     'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
2098     'type'        => 'text',
2099   },
2100
2101   {
2102     'key'         => 'company_name',
2103     'section'     => 'required',
2104     'description' => 'Your company name',
2105     'type'        => 'text',
2106     'per_agent'   => 1, #XXX just FS/FS/ClientAPI/Signup.pm
2107   },
2108
2109   {
2110     'key'         => 'company_address',
2111     'section'     => 'required',
2112     'description' => 'Your company address',
2113     'type'        => 'textarea',
2114     'per_agent'   => 1,
2115   },
2116
2117   {
2118     'key'         => 'echeck-void',
2119     'section'     => 'deprecated',
2120     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable local-only voiding of echeck payments in addition to refunds against the payment gateway',
2121     'type'        => 'checkbox',
2122   },
2123
2124   {
2125     'key'         => 'cc-void',
2126     'section'     => 'deprecated',
2127     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable local-only voiding of credit card payments in addition to refunds against the payment gateway',
2128     'type'        => 'checkbox',
2129   },
2130
2131   {
2132     'key'         => 'unvoid',
2133     'section'     => 'deprecated',
2134     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable unvoiding of voided payments',
2135     'type'        => 'checkbox',
2136   },
2137
2138   {
2139     'key'         => 'address1-search',
2140     'section'     => 'UI',
2141     'description' => 'Enable the ability to search the address1 field from customer search.',
2142     'type'        => 'checkbox',
2143   },
2144
2145   {
2146     'key'         => 'address2-search',
2147     'section'     => 'UI',
2148     'description' => 'Enable a "Unit" search box which searches the second address field.  Useful for multi-tenant applications.  See also: cust_main-require_address2',
2149     'type'        => 'checkbox',
2150   },
2151
2152   {
2153     'key'         => 'cust_main-require_address2',
2154     'section'     => 'UI',
2155     'description' => 'Second address field is required (on service address only, if billing and service addresses differ).  Also enables "Unit" labeling of address2 on customer view and edit pages.  Useful for multi-tenant applications.  See also: address2-search',
2156     'type'        => 'checkbox',
2157   },
2158
2159   {
2160     'key'         => 'agent-ship_address',
2161     'section'     => '',
2162     'description' => "Use the agent's master service address as the service address (only ship_address2 can be entered, if blank on the master address).  Useful for multi-tenant applications.",
2163     'type'        => 'checkbox',
2164   },
2165
2166   { 'key'         => 'referral_credit',
2167     'section'     => 'deprecated',
2168     'description' => "Used to enable one-time referral credits in the amount of one month <i>referred</i> customer's recurring fee (irregardless of frequency).  Replace with a billing event on appropriate packages.",
2169     'type'        => 'checkbox',
2170   },
2171
2172   { 'key'         => 'selfservice_server-cache_module',
2173     'section'     => '',
2174     'description' => 'Module used to store self-service session information.  All modules handle any number of self-service servers.  Cache::SharedMemoryCache is appropriate for a single database / single Freeside server.  Cache::FileCache is useful for multiple databases on a single server, or when IPC::ShareLite is not available (i.e. FreeBSD).', #  _Database stores session information in the database and is appropriate for multiple Freeside servers, but may be slower.',
2175     'type'        => 'select',
2176     'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
2177   },
2178
2179   {
2180     'key'         => 'hylafax',
2181     'section'     => 'billing',
2182     'description' => 'Options for a HylaFAX server to enable the FAX invoice destination.  They should be in the form of a space separated list of arguments to the Fax::Hylafax::Client::sendfax subroutine.  You probably shouldn\'t override things like \'docfile\'.  *Note* Only supported when using typeset invoices (see the invoice_latex configuration option).',
2183     'type'        => [qw( checkbox textarea )],
2184   },
2185
2186   {
2187     'key'         => 'cust_bill-ftpformat',
2188     'section'     => 'billing',
2189     'description' => 'Enable FTP of raw invoice data - format.',
2190     'type'        => 'select',
2191     'select_enum' => [ '', 'default', 'billco', ],
2192   },
2193
2194   {
2195     'key'         => 'cust_bill-ftpserver',
2196     'section'     => 'billing',
2197     'description' => 'Enable FTP of raw invoice data - server.',
2198     'type'        => 'text',
2199   },
2200
2201   {
2202     'key'         => 'cust_bill-ftpusername',
2203     'section'     => 'billing',
2204     'description' => 'Enable FTP of raw invoice data - server.',
2205     'type'        => 'text',
2206   },
2207
2208   {
2209     'key'         => 'cust_bill-ftppassword',
2210     'section'     => 'billing',
2211     'description' => 'Enable FTP of raw invoice data - server.',
2212     'type'        => 'text',
2213   },
2214
2215   {
2216     'key'         => 'cust_bill-ftpdir',
2217     'section'     => 'billing',
2218     'description' => 'Enable FTP of raw invoice data - server.',
2219     'type'        => 'text',
2220   },
2221
2222   {
2223     'key'         => 'cust_bill-spoolformat',
2224     'section'     => 'billing',
2225     'description' => 'Enable spooling of raw invoice data - format.',
2226     'type'        => 'select',
2227     'select_enum' => [ '', 'default', 'billco', ],
2228   },
2229
2230   {
2231     'key'         => 'cust_bill-spoolagent',
2232     'section'     => 'billing',
2233     'description' => 'Enable per-agent spooling of raw invoice data.',
2234     'type'        => 'checkbox',
2235   },
2236
2237   {
2238     'key'         => 'svc_acct-usage_suspend',
2239     'section'     => 'billing',
2240     'description' => 'Suspends the package an account belongs to when svc_acct.seconds or a bytecount is decremented to 0 or below (accounts with an empty seconds and up|down|totalbytes value are ignored).  Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd.',
2241     'type'        => 'checkbox',
2242   },
2243
2244   {
2245     'key'         => 'svc_acct-usage_unsuspend',
2246     'section'     => 'billing',
2247     'description' => 'Unuspends the package an account belongs to when svc_acct.seconds or a bytecount is incremented from 0 or below to a positive value (accounts with an empty seconds and up|down|totalbytes value are ignored).  Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd.',
2248     'type'        => 'checkbox',
2249   },
2250
2251   {
2252     'key'         => 'svc_acct-usage_threshold',
2253     'section'     => 'billing',
2254     'description' => 'The threshold (expressed as percentage) of acct.seconds or acct.up|down|totalbytes at which a warning message is sent to a service holder.  Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd.',
2255     'type'        => 'text',
2256   },
2257
2258   {
2259     'key'         => 'overlimit_groups',
2260     'section'     => '',
2261     'description' => 'RADIUS group (or comma-separated groups) to assign to svc_acct which has exceeded its bandwidth or time limit.',
2262     'type'        => 'text',
2263     'per_agent'   => 1,
2264   },
2265
2266   {
2267     'key'         => 'cust-fields',
2268     'section'     => 'UI',
2269     'description' => 'Which customer fields to display on reports by default',
2270     'type'        => 'select',
2271     'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
2272   },
2273
2274   {
2275     'key'         => 'cust_pkg-display_times',
2276     'section'     => 'UI',
2277     'description' => 'Display full timestamps (not just dates) for customer packages.  Useful if you are doing real-time things like hourly prepaid.',
2278     'type'        => 'checkbox',
2279   },
2280
2281   {
2282     'key'         => 'cust_pkg-always_show_location',
2283     'section'     => 'UI',
2284     'description' => "Always display package locations, even when they're all the default service address.",
2285     'type'        => 'checkbox',
2286   },
2287
2288   {
2289     'key'         => 'svc_acct-edit_uid',
2290     'section'     => 'shell',
2291     'description' => 'Allow UID editing.',
2292     'type'        => 'checkbox',
2293   },
2294
2295   {
2296     'key'         => 'svc_acct-edit_gid',
2297     'section'     => 'shell',
2298     'description' => 'Allow GID editing.',
2299     'type'        => 'checkbox',
2300   },
2301
2302   {
2303     'key'         => 'zone-underscore',
2304     'section'     => 'BIND',
2305     'description' => 'Allow underscores in zone names.  As underscores are illegal characters in zone names, this option is not recommended.',
2306     'type'        => 'checkbox',
2307   },
2308
2309   {
2310     'key'         => 'echeck-nonus',
2311     'section'     => 'billing',
2312     'description' => 'Disable ABA-format account checking for Electronic Check payment info',
2313     'type'        => 'checkbox',
2314   },
2315
2316   {
2317     'key'         => 'voip-cust_cdr_spools',
2318     'section'     => '',
2319     'description' => 'Enable the per-customer option for individual CDR spools.',
2320     'type'        => 'checkbox',
2321   },
2322
2323   {
2324     'key'         => 'voip-cust_cdr_squelch',
2325     'section'     => '',
2326     'description' => 'Enable the per-customer option for not printing CDR on invoices.',
2327     'type'        => 'checkbox',
2328   },
2329
2330   {
2331     'key'         => 'voip-cdr_email',
2332     'section'     => '',
2333     'description' => 'Include the call details on emailed invoices even if the customer is configured for not printing them on the invoices.',
2334     'type'        => 'checkbox',
2335   },
2336
2337   {
2338     'key'         => 'voip-cust_email_csv_cdr',
2339     'section'     => '',
2340     'description' => 'Enable the per-customer option for including CDR information as a CSV attachment on emailed invoices.',
2341     'type'        => 'checkbox',
2342   },
2343
2344   {
2345     'key'         => 'svc_forward-arbitrary_dst',
2346     'section'     => '',
2347     'description' => "Allow forwards to point to arbitrary strings that don't necessarily look like email addresses.  Only used when using forwards for weird, non-email things.",
2348     'type'        => 'checkbox',
2349   },
2350
2351   {
2352     'key'         => 'tax-ship_address',
2353     'section'     => 'billing',
2354     'description' => 'By default, tax calculations are done based on the billing address.  Enable this switch to calculate tax based on the shipping address instead.',
2355     'type'        => 'checkbox',
2356   }
2357 ,
2358   {
2359     'key'         => 'tax-pkg_address',
2360     'section'     => 'billing',
2361     'description' => 'By default, tax calculations are done based on the billing address.  Enable this switch to calculate tax based on the package address instead (when present).  Note that this option is currently incompatible with vendor data taxation enabled by enable_taxproducts.',
2362     'type'        => 'checkbox',
2363   },
2364
2365   {
2366     'key'         => 'invoice-ship_address',
2367     'section'     => 'billing',
2368     'description' => 'Include the shipping address on invoices.',
2369     'type'        => 'checkbox',
2370   },
2371
2372   {
2373     'key'         => 'invoice-unitprice',
2374     'section'     => 'billing',
2375     'description' => 'Enable unit pricing on invoices.',
2376     'type'        => 'checkbox',
2377   },
2378
2379   {
2380     'key'         => 'invoice-smallernotes',
2381     'section'     => 'billing',
2382     'description' => 'Display the notes section in a smaller font on invoices.',
2383     'type'        => 'checkbox',
2384   },
2385
2386   {
2387     'key'         => 'invoice-smallerfooter',
2388     'section'     => 'billing',
2389     'description' => 'Display footers in a smaller font on invoices.',
2390     'type'        => 'checkbox',
2391   },
2392
2393   {
2394     'key'         => 'postal_invoice-fee_pkgpart',
2395     'section'     => 'billing',
2396     'description' => 'This allows selection of a package to insert on invoices for customers with postal invoices selected.',
2397     'type'        => 'select-part_pkg',
2398   },
2399
2400   {
2401     'key'         => 'postal_invoice-recurring_only',
2402     'section'     => 'billing',
2403     'description' => 'The postal invoice fee is omitted on invoices without reucrring charges when this is set.',
2404     'type'        => 'checkbox',
2405   },
2406
2407   {
2408     'key'         => 'batch-enable',
2409     'section'     => 'deprecated', #make sure batch-enable_payby is set for
2410                                    #everyone before removing
2411     'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
2412     'type'        => 'checkbox',
2413   },
2414
2415   {
2416     'key'         => 'batch-enable_payby',
2417     'section'     => 'billing',
2418     'description' => 'Enable batch processing for the specified payment types.',
2419     'type'        => 'selectmultiple',
2420     'select_enum' => [qw( CARD CHEK )],
2421   },
2422
2423   {
2424     'key'         => 'realtime-disable_payby',
2425     'section'     => 'billing',
2426     'description' => 'Disable realtime processing for the specified payment types.',
2427     'type'        => 'selectmultiple',
2428     'select_enum' => [qw( CARD CHEK )],
2429   },
2430
2431   {
2432     'key'         => 'batch-default_format',
2433     'section'     => 'billing',
2434     'description' => 'Default format for batches.',
2435     'type'        => 'select',
2436     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch',
2437                        'csv-chase_canada-E-xactBatch', 'BoM', 'PAP',
2438                        'paymentech', 'ach-spiritone', 'RBC'
2439                     ]
2440   },
2441
2442   #lists could be auto-generated from pay_batch info
2443   {
2444     'key'         => 'batch-fixed_format-CARD',
2445     'section'     => 'billing',
2446     'description' => 'Fixed (unchangeable) format for credit card batches.',
2447     'type'        => 'select',
2448     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
2449                        'csv-chase_canada-E-xactBatch', 'paymentech' ]
2450   },
2451
2452   {
2453     'key'         => 'batch-fixed_format-CHEK',
2454     'section'     => 'billing',
2455     'description' => 'Fixed (unchangeable) format for electronic check batches.',
2456     'type'        => 'select',
2457     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP',
2458                        'paymentech', 'ach-spiritone', 'RBC'
2459                      ]
2460   },
2461
2462   {
2463     'key'         => 'batch-increment_expiration',
2464     'section'     => 'billing',
2465     'description' => 'Increment expiration date years in batches until cards are current.  Make sure this is acceptable to your batching provider before enabling.',
2466     'type'        => 'checkbox'
2467   },
2468
2469   {
2470     'key'         => 'batchconfig-BoM',
2471     'section'     => 'billing',
2472     'description' => 'Configuration for Bank of Montreal batching, seven lines: 1. Origin ID, 2. Datacenter, 3. Typecode, 4. Short name, 5. Long name, 6. Bank, 7. Bank account',
2473     'type'        => 'textarea',
2474   },
2475
2476   {
2477     'key'         => 'batchconfig-PAP',
2478     'section'     => 'billing',
2479     'description' => 'Configuration for PAP batching, seven lines: 1. Origin ID, 2. Datacenter, 3. Typecode, 4. Short name, 5. Long name, 6. Bank, 7. Bank account',
2480     'type'        => 'textarea',
2481   },
2482
2483   {
2484     'key'         => 'batchconfig-csv-chase_canada-E-xactBatch',
2485     'section'     => 'billing',
2486     'description' => 'Gateway ID for Chase Canada E-xact batching',
2487     'type'        => 'text',
2488   },
2489
2490   {
2491     'key'         => 'batchconfig-paymentech',
2492     'section'     => 'billing',
2493     'description' => 'Configuration for Chase Paymentech batching, five lines: 1. BIN, 2. Terminal ID, 3. Merchant ID, 4. Username, 5. Password (for batch uploads)',
2494     'type'        => 'textarea',
2495   },
2496
2497   {
2498     'key'         => 'batchconfig-RBC',
2499     'section'     => 'billing',
2500     'description' => 'Configuration for Royal Bank of Canada PDS batching, four lines: 1. Client number, 2. Short name, 3. Long name, 4. Transaction code.',
2501     'type'        => 'textarea',
2502   },
2503
2504   {
2505     'key'         => 'payment_history-years',
2506     'section'     => 'UI',
2507     'description' => 'Number of years of payment history to show by default.  Currently defaults to 2.',
2508     'type'        => 'text',
2509   },
2510
2511   {
2512     'key'         => 'change_history-years',
2513     'section'     => 'UI',
2514     'description' => 'Number of years of change history to show by default.  Currently defaults to 0.5.',
2515     'type'        => 'text',
2516   },
2517
2518   {
2519     'key'         => 'cust_main-packages-years',
2520     'section'     => 'UI',
2521     'description' => 'Number of years to show old (cancelled and one-time charge) packages by default.  Currently defaults to 2.',
2522     'type'        => 'text',
2523   },
2524
2525   {
2526     'key'         => 'cust_main-use_comments',
2527     'section'     => 'UI',
2528     'description' => 'Display free form comments on the customer edit screen.  Useful as a scratch pad.',
2529     'type'        => 'checkbox',
2530   },
2531
2532   {
2533     'key'         => 'cust_main-disable_notes',
2534     'section'     => 'UI',
2535     'description' => 'Disable new style customer notes - timestamped and user identified customer notes.  Useful in tracking who did what.',
2536     'type'        => 'checkbox',
2537   },
2538
2539   {
2540     'key'         => 'cust_main_note-display_times',
2541     'section'     => 'UI',
2542     'description' => 'Display full timestamps (not just dates) for customer notes.',
2543     'type'        => 'checkbox',
2544   },
2545
2546   {
2547     'key'         => 'cust_main-ticket_statuses',
2548     'section'     => 'UI',
2549     'description' => 'Show tickets with these statuses on the customer view page.',
2550     'type'        => 'selectmultiple',
2551     'select_enum' => [qw( new open stalled resolved rejected deleted )],
2552   },
2553
2554   {
2555     'key'         => 'cust_main-max_tickets',
2556     'section'     => 'UI',
2557     'description' => 'Maximum number of tickets to show on the customer view page.',
2558     'type'        => 'text',
2559   },
2560
2561   {
2562     'key'         => 'cust_main-skeleton_tables',
2563     'section'     => '',
2564     'description' => 'Tables which will have skeleton records inserted into them for each customer.  Syntax for specifying tables is unfortunately a tricky perl data structure for now.',
2565     'type'        => 'textarea',
2566   },
2567
2568   {
2569     'key'         => 'cust_main-skeleton_custnum',
2570     'section'     => '',
2571     'description' => 'Customer number specifying the source data to copy into skeleton tables for new customers.',
2572     'type'        => 'text',
2573   },
2574
2575   {
2576     'key'         => 'cust_main-enable_birthdate',
2577     'section'     => 'UI',
2578     'descritpion' => 'Enable tracking of a birth date with each customer record',
2579     'type'        => 'checkbox',
2580   },
2581
2582   {
2583     'key'         => 'support-key',
2584     'section'     => '',
2585     'description' => 'A support key enables access to commercial services delivered over the network, such as the payroll module, access to the internal ticket system, priority support and optional backups.',
2586     'type'        => 'text',
2587   },
2588
2589   {
2590     'key'         => 'card-types',
2591     'section'     => 'billing',
2592     'description' => 'Select one or more card types to enable only those card types.  If no card types are selected, all card types are available.',
2593     'type'        => 'selectmultiple',
2594     'select_enum' => \@card_types,
2595   },
2596
2597   {
2598     'key'         => 'disable-fuzzy',
2599     'section'     => 'UI',
2600     'description' => 'Disable fuzzy searching.  Speeds up searching for large sites, but only shows exact matches.',
2601     'type'        => 'checkbox',
2602   },
2603
2604   { 'key'         => 'pkg_referral',
2605     'section'     => '',
2606     'description' => 'Enable package-specific advertising sources.',
2607     'type'        => 'checkbox',
2608   },
2609
2610   { 'key'         => 'pkg_referral-multiple',
2611     'section'     => '',
2612     'description' => 'In addition, allow multiple advertising sources to be associated with a single package.',
2613     'type'        => 'checkbox',
2614   },
2615
2616   {
2617     'key'         => 'dashboard-install_welcome',
2618     'section'     => 'UI',
2619     'description' => 'New install welcome screen.',
2620     'type'        => 'select',
2621     'select_enum' => [ '', 'ITSP_fsinc_hosted', ],
2622   },
2623
2624   {
2625     'key'         => 'dashboard-toplist',
2626     'section'     => 'UI',
2627     'description' => 'List of items to display on the top of the front page',
2628     'type'        => 'textarea',
2629   },
2630
2631   {
2632     'key'         => 'impending_recur_template',
2633     'section'     => 'billing',
2634     'description' => 'Template file for alerts about looming first time recurrant billing.  See the <a href="http://search.cpan.org/dist/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitition language.  Also see packages with a <a href="../browse/part_pkg.cgi">flat price plan</a>  The following variables are available<ul><li><code>$packages</code> allowing <code>$packages->[0]</code> thru <code>$packages->[n]</code> <li><code>$package</code> the first package, same as <code>$packages->[0]</code> <li><code>$recurdates</code> allowing <code>$recurdates->[0]</code> thru <code>$recurdates->[n]</code> <li><code>$recurdate</code> the first recurdate, same as <code>$recurdate->[0]</code> <li><code>$first</code> <li><code>$last</code></ul>',
2635 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
2636     'type'        => 'textarea',
2637   },
2638
2639   {
2640     'key'         => 'logo.png',
2641     'section'     => 'billing',  #? 
2642     'description' => 'Company logo for HTML invoices and the backoffice interface, in PNG format.  Suggested size somewhere near 92x62.',
2643     'type'        => 'image',
2644     'per_agent'   => 1, #XXX just view/logo.cgi, which is for the global
2645                         #old-style editor anyway...?
2646   },
2647
2648   {
2649     'key'         => 'logo.eps',
2650     'section'     => 'billing',  #? 
2651     'description' => 'Company logo for printed and PDF invoices, in EPS format.',
2652     'type'        => 'image',
2653     'per_agent'   => 1, #XXX as above, kinda
2654   },
2655
2656   {
2657     'key'         => 'selfservice-ignore_quantity',
2658     'section'     => '',
2659     'description' => 'Ignores service quantity restrictions in self-service context.  Strongly not recommended - just set your quantities correctly in the first place.',
2660     'type'        => 'checkbox',
2661   },
2662
2663   {
2664     'key'         => 'selfservice-session_timeout',
2665     'section'     => '',
2666     'description' => 'Self-service session timeout.  Defaults to 1 hour.',
2667     'type'        => 'select',
2668     'select_enum' => [ '1 hour', '2 hours', '4 hours', '8 hours', '1 day', '1 week', ],
2669   },
2670
2671   {
2672     'key'         => 'disable_setup_suspended_pkgs',
2673     'section'     => 'billing',
2674     'description' => 'Disables charging of setup fees for suspended packages.',
2675     'type'        => 'checkbox',
2676   },
2677
2678   {
2679     'key'         => 'password-generated-allcaps',
2680     'section'     => 'password',
2681     'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
2682     'type'        => 'checkbox',
2683   },
2684
2685   {
2686     'key'         => 'datavolume-forcemegabytes',
2687     'section'     => 'UI',
2688     'description' => 'All data volumes are expressed in megabytes',
2689     'type'        => 'checkbox',
2690   },
2691
2692   {
2693     'key'         => 'datavolume-significantdigits',
2694     'section'     => 'UI',
2695     'description' => 'number of significant digits to use to represent data volumes',
2696     'type'        => 'text',
2697   },
2698
2699   {
2700     'key'         => 'disable_void_after',
2701     'section'     => 'billing',
2702     'description' => 'Number of seconds after which freeside won\'t attempt to VOID a payment first when performing a refund.',
2703     'type'        => 'text',
2704   },
2705
2706   {
2707     'key'         => 'disable_line_item_date_ranges',
2708     'section'     => 'billing',
2709     'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.',
2710     'type'        => 'checkbox',
2711   },
2712
2713   {
2714     'key'         => 'support_packages',
2715     'section'     => '',
2716     'description' => 'A list of packages eligible for RT ticket time transfer, one pkgpart per line.', #this should really be a select multiple, or specified in the packages themselves...
2717     'type'        => 'select-part_pkg',
2718     'multiple'    => 1,
2719   },
2720
2721   {
2722     'key'         => 'cust_main-require_phone',
2723     'section'     => '',
2724     'description' => 'Require daytime or night phone for all customer records.',
2725     'type'        => 'checkbox',
2726   },
2727
2728   {
2729     'key'         => 'cust_main-require_invoicing_list_email',
2730     'section'     => '',
2731     'description' => 'Email address field is required: require at least one invoicing email address for all customer records.',
2732     'type'        => 'checkbox',
2733   },
2734
2735   {
2736     'key'         => 'svc_acct-display_paid_time_remaining',
2737     'section'     => '',
2738     'description' => 'Show paid time remaining in addition to time remaining.',
2739     'type'        => 'checkbox',
2740   },
2741
2742   {
2743     'key'         => 'cancel_credit_type',
2744     'section'     => 'billing',
2745     'description' => 'The group to use for new, automatically generated credit reasons resulting from cancellation.',
2746     'type'        => 'select-sub',
2747     'options_sub' => sub { require FS::Record;
2748                            require FS::reason_type;
2749                            map { $_->typenum => $_->type }
2750                                FS::Record::qsearch('reason_type', { class=>'R' } );
2751                          },
2752     'option_sub'  => sub { require FS::Record;
2753                            require FS::reason_type;
2754                            my $reason_type = FS::Record::qsearchs(
2755                              'reason_type', { 'typenum' => shift }
2756                            );
2757                            $reason_type ? $reason_type->type : '';
2758                          },
2759   },
2760
2761   {
2762     'key'         => 'referral_credit_type',
2763     'section'     => 'deprecated',
2764     'description' => 'Used to be the group to use for new, automatically generated credit reasons resulting from referrals.  Now set in a package billing event for the referral.',
2765     'type'        => 'select-sub',
2766     'options_sub' => sub { require FS::Record;
2767                            require FS::reason_type;
2768                            map { $_->typenum => $_->type }
2769                                FS::Record::qsearch('reason_type', { class=>'R' } );
2770                          },
2771     'option_sub'  => sub { require FS::Record;
2772                            require FS::reason_type;
2773                            my $reason_type = FS::Record::qsearchs(
2774                              'reason_type', { 'typenum' => shift }
2775                            );
2776                            $reason_type ? $reason_type->type : '';
2777                          },
2778   },
2779
2780   {
2781     'key'         => 'signup_credit_type',
2782     'section'     => 'billing',
2783     'description' => 'The group to use for new, automatically generated credit reasons resulting from signup and self-service declines.',
2784     'type'        => 'select-sub',
2785     'options_sub' => sub { require FS::Record;
2786                            require FS::reason_type;
2787                            map { $_->typenum => $_->type }
2788                                FS::Record::qsearch('reason_type', { class=>'R' } );
2789                          },
2790     'option_sub'  => sub { require FS::Record;
2791                            require FS::reason_type;
2792                            my $reason_type = FS::Record::qsearchs(
2793                              'reason_type', { 'typenum' => shift }
2794                            );
2795                            $reason_type ? $reason_type->type : '';
2796                          },
2797   },
2798
2799   {
2800     'key'         => 'cust_main-agent_custid-format',
2801     'section'     => '',
2802     'description' => 'Enables searching of various formatted values in cust_main.agent_custid',
2803     'type'        => 'select',
2804     'select_hash' => [
2805                        ''      => 'Numeric only',
2806                        'ww?d+' => 'Numeric with one or two letter prefix',
2807                      ],
2808   },
2809
2810   {
2811     'key'         => 'card_masking_method',
2812     'section'     => 'UI',
2813     'description' => 'Digits to display when masking credit cards.  Note that the first six digits are necessary to canonically identify the credit card type (Visa/MC, Amex, Discover, Maestro, etc.) in all cases.  The first four digits can identify the most common credit card types in most cases (Visa/MC, Amex, and Discover).  The first two digits can distinguish between Visa/MC and Amex.  Note: You should manually remove stored paymasks if you change this value on an existing database, to avoid problems using stored cards.',
2814     'type'        => 'select',
2815     'select_hash' => [
2816                        ''            => '123456xxxxxx1234',
2817                        'first6last2' => '123456xxxxxxxx12',
2818                        'first4last4' => '1234xxxxxxxx1234',
2819                        'first4last2' => '1234xxxxxxxxxx12',
2820                        'first2last4' => '12xxxxxxxxxx1234',
2821                        'first2last2' => '12xxxxxxxxxxxx12',
2822                        'first0last4' => 'xxxxxxxxxxxx1234',
2823                        'first0last2' => 'xxxxxxxxxxxxxx12',
2824                      ],
2825   },
2826
2827   {
2828     'key'         => 'disable_previous_balance',
2829     'section'     => 'billing',
2830     'description' => 'Disable inclusion of previous balancem payment, and credit lines on invoices',
2831     'type'        => 'checkbox',
2832   },
2833
2834   {
2835     'key'         => 'previous_balance-summary_only',
2836     'section'     => 'billing',
2837     'description' => 'Only show a single line summarizing the total previous balance rather than one line per invoice.',
2838     'type'        => 'checkbox',
2839   },
2840
2841   {
2842     'key'         => 'usps_webtools-userid',
2843     'section'     => 'UI',
2844     'description' => 'Production UserID for USPS web tools.   Enables USPS address standardization.  See the <a href="http://www.usps.com/webtools/">USPS website</a>, register and agree not to use the tools for batch purposes.',
2845     'type'        => 'text',
2846   },
2847
2848   {
2849     'key'         => 'usps_webtools-password',
2850     'section'     => 'UI',
2851     'description' => 'Production password for USPS web tools.   Enables USPS address standardization.  See <a href="http://www.usps.com/webtools/">USPS website</a>, register and agree not to use the tools for batch purposes.',
2852     'type'        => 'text',
2853   },
2854
2855   {
2856     'key'         => 'cust_main-auto_standardize_address',
2857     'section'     => 'UI',
2858     'description' => 'When using USPS web tools, automatically standardize the address without asking.',
2859     'type'        => 'checkbox',
2860   },
2861
2862   {
2863     'key'         => 'cust_main-require_censustract',
2864     'section'     => 'UI',
2865     'description' => 'Customer is required to have a census tract.  Useful for FCC form 477 reports. See also: cust_main-auto_standardize_address',
2866     'type'        => 'checkbox',
2867   },
2868
2869   {
2870     'key'         => 'census_year',
2871     'section'     => 'UI',
2872     'description' => 'The year to use in census tract lookups',
2873     'type'        => 'select',
2874     'select_enum' => [ qw( 2009 2008 2007 2006 ) ],
2875   },
2876
2877   {
2878     'key'         => 'company_latitude',
2879     'section'     => 'UI',
2880     'description' => 'Your company latitude (-90 through 90)',
2881     'type'        => 'text',
2882   },
2883
2884   {
2885     'key'         => 'company_longitude',
2886     'section'     => 'UI',
2887     'description' => 'Your company longitude (-180 thru 180)',
2888     'type'        => 'text',
2889   },
2890
2891   {
2892     'key'         => 'disable_acl_changes',
2893     'section'     => '',
2894     'description' => 'Disable all ACL changes, for demos.',
2895     'type'        => 'checkbox',
2896   },
2897
2898   {
2899     'key'         => 'cust_main-edit_agent_custid',
2900     'section'     => 'UI',
2901     'description' => 'Enable editing of the agent_custid field.',
2902     'type'        => 'checkbox',
2903   },
2904
2905   {
2906     'key'         => 'cust_main-default_agent_custid',
2907     'section'     => 'UI',
2908     'description' => 'Display the agent_custid field when available instead of the custnum field.',
2909     'type'        => 'checkbox',
2910   },
2911
2912   {
2913     'key'         => 'cust_bill-default_agent_invid',
2914     'section'     => 'UI',
2915     'description' => 'Display the agent_invid field when available instead of the invnum field.',
2916     'type'        => 'checkbox',
2917   },
2918
2919   {
2920     'key'         => 'cust_main-auto_agent_custid',
2921     'section'     => 'UI',
2922     'description' => 'Automatically assign an agent_custid - select format',
2923     'type'        => 'select',
2924     'select_hash' => [ '' => 'No',
2925                        '1YMMXXXXXXXX' => '1YMMXXXXXXXX',
2926                      ],
2927   },
2928
2929   {
2930     'key'         => 'cust_main-default_areacode',
2931     'section'     => 'UI',
2932     'description' => 'Default area code for customers.',
2933     'type'        => 'text',
2934   },
2935
2936   {
2937     'key'         => 'mcp_svcpart',
2938     'section'     => '',
2939     'description' => 'Master Control Program svcpart.  Leave this blank.',
2940     'type'        => 'text', #select-part_svc
2941   },
2942
2943   {
2944     'key'         => 'cust_bill-max_same_services',
2945     'section'     => 'billing',
2946     'description' => 'Maximum number of the same service to list individually on invoices before condensing to a single line listing the number of services.  Defaults to 5.',
2947     'type'        => 'text',
2948   },
2949
2950   {
2951     'key'         => 'cust_bill-consolidate_services',
2952     'section'     => 'billing',
2953     'description' => 'Consolidate service display into fewer lines on invoices rather than one per service.',
2954     'type'        => 'checkbox',
2955   },
2956
2957   {
2958     'key'         => 'suspend_email_admin',
2959     'section'     => '',
2960     'description' => 'Destination admin email address to enable suspension notices',
2961     'type'        => 'text',
2962   },
2963
2964   {
2965     'key'         => 'email_report-subject',
2966     'section'     => '',
2967     'description' => 'Subject for reports emailed by freeside-fetch.  Defaults to "Freeside report".',
2968     'type'        => 'text',
2969   },
2970
2971   {
2972     'key'         => 'selfservice-head',
2973     'section'     => '',
2974     'description' => 'HTML for the HEAD section of the self-service interface, typically used for LINK stylesheet tags',
2975     'type'        => 'textarea', #htmlarea?
2976     'per_agent'   => 1,
2977   },
2978
2979
2980   {
2981     'key'         => 'selfservice-body_header',
2982     'section'     => '',
2983     'description' => 'HTML header for the self-service interface',
2984     'type'        => 'textarea', #htmlarea?
2985     'per_agent'   => 1,
2986   },
2987
2988   {
2989     'key'         => 'selfservice-body_footer',
2990     'section'     => '',
2991     'description' => 'HTML header for the self-service interface',
2992     'type'        => 'textarea', #htmlarea?
2993     'per_agent'   => 1,
2994   },
2995
2996
2997   {
2998     'key'         => 'selfservice-body_bgcolor',
2999     'section'     => '',
3000     'description' => 'HTML background color for the self-service interface, for example, #FFFFFF',
3001     'type'        => 'text',
3002     'per_agent'   => 1,
3003   },
3004
3005   {
3006     'key'         => 'selfservice-box_bgcolor',
3007     'section'     => '',
3008     'description' => 'HTML color for self-service interface input boxes, for example, #C0C0C0"',
3009     'type'        => 'text',
3010     'per_agent'   => 1,
3011   },
3012
3013   {
3014     'key'         => 'selfservice-bulk_format',
3015     'section'     => '',
3016     'description' => 'Parameter arrangement for selfservice bulk features',
3017     'type'        => 'select',
3018     'select_enum' => [ '', 'izoom-soap', 'izoom-ftp' ],
3019     'per_agent'   => 1,
3020   },
3021
3022   {
3023     'key'         => 'selfservice-bulk_ftp_dir',
3024     'section'     => '',
3025     'description' => 'Enable bulk ftp provisioning in this folder',
3026     'type'        => 'text',
3027     'per_agent'   => 1,
3028   },
3029
3030   {
3031     'key'         => 'signup-no_company',
3032     'section'     => '',
3033     'description' => "Don't display a field for company name on signup.",
3034     'type'        => 'checkbox',
3035   },
3036
3037   {
3038     'key'         => 'signup-recommend_email',
3039     'section'     => '',
3040     'description' => 'Encourage the entry of an invoicing email address on signup.',
3041     'type'        => 'checkbox',
3042   },
3043
3044   {
3045     'key'         => 'signup-recommend_daytime',
3046     'section'     => '',
3047     'description' => 'Encourage the entry of a daytime phone number  invoicing email address on signup.',
3048     'type'        => 'checkbox',
3049   },
3050
3051   {
3052     'key'         => 'svc_phone-radius-default_password',
3053     'section'     => '',
3054     'description' => 'Default password when exporting svc_phone records to RADIUS',
3055     'type'        => 'text',
3056   },
3057
3058   {
3059     'key'         => 'svc_phone-allow_alpha_phonenum',
3060     'section'     => '',
3061     'description' => 'Allow letters in phone numbers.',
3062     'type'        => 'checkbox',
3063   },
3064
3065   {
3066     'key'         => 'default_phone_countrycode',
3067     'section'     => '',
3068     'description' => 'Default countrcode',
3069     'type'        => 'text',
3070   },
3071
3072   {
3073     'key'         => 'cdr-charged_party-accountcode',
3074     'section'     => '',
3075     'description' => 'Set the charged_party field of CDRs to the accountcode.',
3076     'type'        => 'checkbox',
3077   },
3078
3079   {
3080     'key'         => 'cdr-charged_party-accountcode-trim_leading_0s',
3081     'section'     => '',
3082     'description' => 'When setting the charged_party field of CDRs to the accountcode, trim any leading zeros.',
3083     'type'        => 'checkbox',
3084   },
3085
3086 #  {
3087 #    'key'         => 'cdr-charged_party-truncate_prefix',
3088 #    'section'     => '',
3089 #    'description' => 'If the charged_party field has this prefix, truncate it to the length in cdr-charged_party-truncate_length.',
3090 #    'type'        => 'text',
3091 #  },
3092 #
3093 #  {
3094 #    'key'         => 'cdr-charged_party-truncate_length',
3095 #    'section'     => '',
3096 #    'description' => 'If the charged_party field has the prefix in cdr-charged_party-truncate_prefix, truncate it to this length.',
3097 #    'type'        => 'text',
3098 #  },
3099
3100   {
3101     'key'         => 'cdr-charged_party_rewrite',
3102     'section'     => '',
3103     'description' => 'Do charged party rewriting in the freeside-cdrrewrited daemon; useful if CDRs are being dropped off directly in the database and require special charged_party processing such as cdr-charged_party-accountcode or cdr-charged_party-truncate*.',
3104     'type'        => 'checkbox',
3105   },
3106
3107   {
3108     'key'         => 'cdr-taqua-da_rewrite',
3109     'section'     => '',
3110     'description' => 'For the Taqua CDR format, a comma-separated list of directory assistance 800 numbers.  Any CDRs with these numbers as "BilledNumber" will be rewritten to the "CallingPartyNumber" (and CallType "12") on import.',
3111     'type'        => 'text',
3112   },
3113
3114   {
3115     'key'         => 'cust_pkg-show_autosuspend',
3116     'section'     => 'UI',
3117     'description' => 'Show package auto-suspend dates.  Use with caution for now; can slow down customer view for large insallations.',
3118     'type'        => 'checkbox',
3119   },
3120
3121   {
3122     'key'         => 'cdr-asterisk_forward_rewrite',
3123     'section'     => '',
3124     'description' => 'Enable special processing for CDRs representing forwarded calls: For CDRs that have a dcontext that starts with "Local/" but does not match dst, set charged_party to dst, parse a new dst from dstchannel, and set amaflags to "2" ("BILL"/"BILLING").',
3125     'type'        => 'checkbox',
3126   },
3127
3128   {
3129     'key'         => 'sg-multicustomer_hack',
3130     'section'     => '',
3131     'description' => "Don't use this.",
3132     'type'        => 'checkbox',
3133   },
3134
3135   {
3136     'key'         => 'sg-ping_username',
3137     'section'     => '',
3138     'description' => "Don't use this.",
3139     'type'        => 'text',
3140   },
3141
3142   {
3143     'key'         => 'sg-ping_password',
3144     'section'     => '',
3145     'description' => "Don't use this.",
3146     'type'        => 'text',
3147   },
3148
3149   {
3150     'key'         => 'sg-login_username',
3151     'section'     => '',
3152     'description' => "Don't use this.",
3153     'type'        => 'text',
3154   },
3155
3156   {
3157     'key'         => 'disable-cust-pkg_class',
3158     'section'     => 'UI',
3159     'description' => 'Disable the two-step dropdown for selecting package class and package, and return to the classic single dropdown.',
3160     'type'        => 'checkbox',
3161   },
3162
3163   {
3164     'key'         => 'queued-max_kids',
3165     'section'     => '',
3166     'description' => 'Maximum number of queued processes.  Defaults to 10.',
3167     'type'        => 'text',
3168   },
3169
3170   {
3171     'key'         => 'cancelled_cust-noevents',
3172     'section'     => 'billing',
3173     'description' => "Don't run events for cancelled customers",
3174     'type'        => 'checkbox',
3175   },
3176
3177   {
3178     'key'         => 'agent-invoice_template',
3179     'section'     => 'billing',
3180     'description' => 'Enable display/edit of old-style per-agent invoice template selection',
3181     'type'        => 'checkbox',
3182   },
3183
3184   {
3185     'key'         => 'svc_broadband-manage_link',
3186     'section'     => 'UI',
3187     'description' => 'URL for svc_broadband "Manage Device" link.  The following substitutions are available: $ip_addr.',
3188     'type'        => 'text',
3189   },
3190
3191   #more fine-grained, service def-level control could be useful eventually?
3192   {
3193     'key'         => 'svc_broadband-allow_null_ip_addr',
3194     'section'     => '',
3195     'description' => '',
3196     'type'        => 'checkbox',
3197   },
3198
3199   {
3200     'key'         => 'tax-report_groups',
3201     'section'     => '',
3202     'description' => 'List of grouping possibilities for tax names on reports, one per line, "label op value" (op can be = or !=).',
3203     'type'        => 'textarea',
3204   },
3205
3206   {
3207     'key'         => 'tax-cust_exempt-groups',
3208     'section'     => '',
3209     'description' => 'List of grouping possibilities for tax names, for per-customer exemption purposes, one tax name per line.  For example, "GST" would indicate the ability to exempt customers individually from taxes named "GST" (but not other taxes).',
3210     'type'        => 'textarea',
3211   },
3212
3213   {
3214     'key'         => 'cust_main-default_view',
3215     'section'     => 'UI',
3216     'description' => 'Default customer view, for users who have not selected a default view in their preferences.',
3217     'type'        => 'select',
3218     'select_hash' => [
3219       #false laziness w/view/cust_main.cgi and pref/pref.html
3220       'basics'          => 'Basics',
3221       'notes'           => 'Notes',
3222       'tickets'         => 'Tickets',
3223       'packages'        => 'Packages',
3224       'payment_history' => 'Payment History',
3225       'change_history'  => 'Change History',
3226       'jumbo'           => 'Jumbo',
3227     ],
3228   },
3229
3230   {
3231     'key'         => 'enable_tax_adjustments',
3232     'section'     => 'billing',
3233     'description' => 'Enable the ability to add manual tax adjustments.',
3234     'type'        => 'checkbox',
3235   },
3236
3237   {
3238     'key'         => 'rt-crontool',
3239     'section'     => '',
3240     'description' => 'Enable the RT CronTool extension.',
3241     'type'        => 'checkbox',
3242   },
3243
3244   {
3245     'key'         => 'pkg-balances',
3246     'section'     => 'billing',
3247     'description' => 'Enable experimental package balances.  Not recommended for general use.',
3248     'type'        => 'checkbox',
3249   },
3250
3251   {
3252     'key'         => 'pkg-addon_classnum',
3253     'section'     => 'billing',
3254     'description' => 'Enable the ability to restrict additional package orders based on package class.',
3255     'type'        => 'checkbox',
3256   },
3257
3258   {
3259     'key'         => 'cust_main-edit_signupdate',
3260     'section'     => 'UI',
3261     'descritpion' => 'Enable manual editing of the signup date.',
3262     'type'        => 'checkbox',
3263   },
3264
3265   {
3266     'key'         => 'svc_acct-disable_access_number',
3267     'section'     => 'UI',
3268     'descritpion' => 'Disable access number selection.',
3269     'type'        => 'checkbox',
3270   },
3271
3272   {
3273     'key'         => 'cust_bill_pay_pkg-manual',
3274     'section'     => 'UI',
3275     'description' => 'Allow manual application of payments to line items.',
3276     'type'        => 'checkbox',
3277   },
3278
3279   {
3280     'key'         => 'cust_credit_bill_pkg-manual',
3281     'section'     => 'UI',
3282     'description' => 'Allow manual application of credits to line items.',
3283     'type'        => 'checkbox',
3284   },
3285
3286   {
3287     'key'         => 'breakage-days',
3288     'section'     => 'billing',
3289     'description' => 'If set to a number of days, after an account goes that long without activity, recognizes any outstanding payments and credits as "breakage" by creating a breakage charge and invoice.',
3290     'type'        => 'text',
3291     'per_agent'   => 1,
3292   },
3293
3294   {
3295     'key'         => 'breakage-pkg_class',
3296     'section'     => 'billing',
3297     'description' => 'Package class to use for breakage reconciliation.',
3298     'type'        => 'select-pkg_class',
3299   },
3300
3301   {
3302     'key'         => 'disable_cron_billing',
3303     'section'     => 'billing',
3304     'description' => 'Disable billing and collection from being run by freeside-daily and freeside-monthly, while still allowing other actions to run, such as notifications and backup.',
3305     'type'        => 'checkbox',
3306   },
3307
3308   { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3309   { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3310   { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3311   { key => "bindprimary", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3312   { key => "bindsecondaries", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3313   { key => "bsdshellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3314   { key => "cyrus", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3315   { key => "cp_app", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3316   { key => "erpcdmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3317   { key => "icradiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3318   { key => "icradius_mysqldest", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3319   { key => "icradius_mysqlsource", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3320   { key => "icradius_secrets", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3321   { key => "maildisablecatchall", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3322   { key => "mxmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3323   { key => "nsmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3324   { key => "arecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3325   { key => "cnamerecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3326   { key => "nismachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3327   { key => "qmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3328   { key => "radiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3329   { key => "sendmailconfigpath", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3330   { key => "sendmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3331   { key => "sendmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3332   { key => "shellmachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3333   { key => "shellmachine-useradd", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3334   { key => "shellmachine-userdel", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3335   { key => "shellmachine-usermod", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3336   { key => "shellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3337   { key => "radiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3338   { key => "textradiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3339   { key => "username_policy", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3340   { key => "vpopmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3341   { key => "vpopmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3342   { key => "safe-part_pkg", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3343   { key => "selfservice_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3344   { key => "signup_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3345   { key => "signup_server-email", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3346   { key => "vonage-username", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3347   { key => "vonage-password", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3348   { key => "vonage-fromnumber", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3349
3350 );
3351
3352 1;
3353