628462ef4a6482ed5239b5a49fd34f6bac86e27c
[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 my %msg_template_options = (
569   'type'        => 'select-sub',
570   'options_sub' => sub { require FS::Record;
571                          require FS::agent;
572                          require FS::msg_template;
573                          map { $_->msgnum, $_->msgname } 
574                             qsearch('msg_template', { disabled => '' });
575                        },
576   'option_sub'  => sub { require FS::msg_template;
577                          my $msg_template = FS::msg_template->by_key(shift);
578                          $msg_template ? $msg_template->msgname : ''
579                        },
580 );
581
582
583 #Billing (81 items)
584 #Invoicing (50 items)
585 #UI (69 items)
586 #Self-service (29 items)
587 #...
588 #Unclassified (77 items)
589
590 @config_items = map { new FS::ConfItem $_ } (
591
592   {
593     'key'         => 'address',
594     'section'     => 'deprecated',
595     'description' => 'This configuration option is no longer used.  See <a href="#invoice_template">invoice_template</a> instead.',
596     'type'        => 'text',
597   },
598
599   {
600     'key'         => 'alert_expiration',
601     'section'     => 'notification',
602     'description' => 'Enable alerts about billing method expiration (i.e. expiring credit cards).',
603     'type'        => 'checkbox',
604     'per_agent'   => 1,
605   },
606
607   {
608     'key'         => 'alerter_template',
609     'section'     => 'deprecated',
610     'description' => 'Template file for billing method expiration alerts (i.e. expiring credit cards).',
611     'type'        => 'textarea',
612     'per_agent'   => 1,
613   },
614   
615   {
616     'key'         => 'alerter_msgnum',
617     'section'     => 'notification',
618     'description' => 'Template to use for credit card expiration alerts.',
619     %msg_template_options,
620   },
621
622   {
623     'key'         => 'apacheip',
624     #not actually deprecated yet
625     #'section'     => 'deprecated',
626     #'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',
627     'section'     => '',
628     'description' => 'IP address to assign to new virtual hosts',
629     'type'        => 'text',
630   },
631
632   {
633     'key'         => 'encryption',
634     'section'     => 'billing',
635     'description' => 'Enable encryption of credit cards.',
636     'type'        => 'checkbox',
637   },
638
639   {
640     'key'         => 'encryptionmodule',
641     'section'     => 'billing',
642     'description' => 'Use which module for encryption?',
643     'type'        => 'text',
644   },
645
646   {
647     'key'         => 'encryptionpublickey',
648     'section'     => 'billing',
649     'description' => 'Your RSA Public Key - Required if Encryption is turned on.',
650     'type'        => 'textarea',
651   },
652
653   {
654     'key'         => 'encryptionprivatekey',
655     'section'     => 'billing',
656     '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.',
657     'type'        => 'textarea',
658   },
659
660   {
661     'key'         => 'billco-url',
662     'section'     => 'billing',
663     'description' => 'The url to use for performing uploads to the invoice mailing service.',
664     'type'        => 'text',
665     'per_agent'   => 1,
666   },
667
668   {
669     'key'         => 'billco-username',
670     'section'     => 'billing',
671     'description' => 'The login name to use for uploads to the invoice mailing service.',
672     'type'        => 'text',
673     'per_agent'   => 1,
674     'agentonly'   => 1,
675   },
676
677   {
678     'key'         => 'billco-password',
679     'section'     => 'billing',
680     'description' => 'The password to use for uploads to the invoice mailing service.',
681     'type'        => 'text',
682     'per_agent'   => 1,
683     'agentonly'   => 1,
684   },
685
686   {
687     'key'         => 'billco-clicode',
688     'section'     => 'billing',
689     'description' => 'The clicode to use for uploads to the invoice mailing service.',
690     'type'        => 'text',
691     'per_agent'   => 1,
692   },
693
694   {
695     'key'         => 'business-onlinepayment',
696     'section'     => 'billing',
697     '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.',
698     'type'        => 'textarea',
699   },
700
701   {
702     'key'         => 'business-onlinepayment-ach',
703     'section'     => 'billing',
704     '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.',
705     'type'        => 'textarea',
706   },
707
708   {
709     'key'         => 'business-onlinepayment-namespace',
710     'section'     => 'billing',
711     'description' => 'Specifies which perl module namespace (which group of collection routines) is used by default.',
712     'type'        => 'select',
713     'select_hash' => [
714                        'Business::OnlinePayment' => 'Direct API (Business::OnlinePayment)',
715                        'Business::OnlineThirdPartyPayment' => 'Web API (Business::ThirdPartyPayment)',
716                      ],
717   },
718
719   {
720     'key'         => 'business-onlinepayment-description',
721     'section'     => 'billing',
722     '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 - not available in all situations)',
723     'type'        => 'text',
724   },
725
726   {
727     'key'         => 'business-onlinepayment-email-override',
728     'section'     => 'billing',
729     'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
730     'type'        => 'text',
731   },
732
733   {
734     'key'         => 'business-onlinepayment-email_customer',
735     'section'     => 'billing',
736     'description' => 'Controls the "email_customer" flag used by some Business::OnlinePayment processors to enable customer receipts.',
737     'type'        => 'checkbox',
738   },
739
740   {
741     'key'         => 'business-onlinepayment-test_transaction',
742     'section'     => 'billing',
743     'description' => 'Turns on the Business::OnlinePayment test_transaction flag.  Note that not all gateway modules support this flag; if yours does not, transactions will still be sent live.',
744     'type'        => 'checkbox',
745   },
746
747   {
748     'key'         => 'countrydefault',
749     'section'     => 'UI',
750     'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
751     'type'        => 'text',
752   },
753
754   {
755     'key'         => 'date_format',
756     'section'     => 'UI',
757     'description' => 'Format for displaying dates',
758     'type'        => 'select',
759     'select_hash' => [
760                        '%m/%d/%Y' => 'MM/DD/YYYY',
761                        '%d/%m/%Y' => 'DD/MM/YYYY',
762                        '%Y/%m/%d' => 'YYYY/MM/DD',
763                      ],
764   },
765
766   {
767     'key'         => 'deletecustomers',
768     'section'     => 'UI',
769     '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.',
770     'type'        => 'checkbox',
771   },
772
773   {
774     'key'         => 'deleteinvoices',
775     'section'     => 'UI',
776     '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?
777     'type'        => 'checkbox',
778   },
779
780   {
781     'key'         => 'deletepayments',
782     'section'     => 'billing',
783     '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.',
784     'type'        => [qw( checkbox text )],
785   },
786
787   {
788     'key'         => 'deletecredits',
789     #not actually deprecated yet
790     #'section'     => 'deprecated',
791     #'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.',
792     'section'     => '',
793     'description' => 'One or more comma-separated email addresses to be notified when a credit is deleted.',
794     'type'        => [qw( checkbox text )],
795   },
796
797   {
798     'key'         => 'deleterefunds',
799     'section'     => 'billing',
800     'description' => 'Enable deletion of unclosed refunds.  Be very careful!  Only delete refunds that were data-entry errors, not adjustments.',
801     'type'        => 'checkbox',
802   },
803
804   {
805     'key'         => 'unapplypayments',
806     'section'     => 'deprecated',
807     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable "unapplication" of unclosed payments.',
808     'type'        => 'checkbox',
809   },
810
811   {
812     'key'         => 'unapplycredits',
813     'section'     => 'deprecated',
814     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to nable "unapplication" of unclosed credits.',
815     'type'        => 'checkbox',
816   },
817
818   {
819     'key'         => 'dirhash',
820     'section'     => 'shell',
821     '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>',
822     'type'        => 'text',
823   },
824
825   {
826     'key'         => 'disable_cust_attachment',
827     'section'     => '',
828     'description' => 'Disable customer file attachments',
829     'type'        => 'checkbox',
830   },
831
832   {
833     'key'         => 'max_attachment_size',
834     'section'     => '',
835     'description' => 'Maximum size for customer file attachments (leave blank for unlimited)',
836     'type'        => 'text',
837   },
838
839   {
840     'key'         => 'disable_customer_referrals',
841     'section'     => 'UI',
842     'description' => 'Disable new customer-to-customer referrals in the web interface',
843     'type'        => 'checkbox',
844   },
845
846   {
847     'key'         => 'editreferrals',
848     'section'     => 'UI',
849     'description' => 'Enable advertising source modification for existing customers',
850     'type'        => 'checkbox',
851   },
852
853   {
854     'key'         => 'emailinvoiceonly',
855     'section'     => 'invoicing',
856     'description' => 'Disables postal mail invoices',
857     'type'        => 'checkbox',
858   },
859
860   {
861     'key'         => 'disablepostalinvoicedefault',
862     'section'     => 'invoicing',
863     '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>.',
864     'type'        => 'checkbox',
865   },
866
867   {
868     'key'         => 'emailinvoiceauto',
869     'section'     => 'invoicing',
870     'description' => 'Automatically adds new accounts to the email invoice list',
871     'type'        => 'checkbox',
872   },
873
874   {
875     'key'         => 'emailinvoiceautoalways',
876     'section'     => 'invoicing',
877     'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses',
878     'type'        => 'checkbox',
879   },
880
881   {
882     'key'         => 'emailinvoice-apostrophe',
883     'section'     => 'invoicing',
884     'description' => 'Allows the apostrophe (single quote) character in the email addresses in the email invoice list.',
885     'type'        => 'checkbox',
886   },
887
888   {
889     'key'         => 'exclude_ip_addr',
890     'section'     => '',
891     'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
892     'type'        => 'textarea',
893   },
894   
895   {
896     'key'         => 'auto_router',
897     'section'     => '',
898     'description' => 'Automatically choose the correct router/block based on supplied ip address when possible while provisioning broadband services',
899     'type'        => 'checkbox',
900   },
901   
902   {
903     'key'         => 'hidecancelledpackages',
904     'section'     => 'UI',
905     'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
906     'type'        => 'checkbox',
907   },
908
909   {
910     'key'         => 'hidecancelledcustomers',
911     'section'     => 'UI',
912     'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
913     'type'        => 'checkbox',
914   },
915
916   {
917     'key'         => 'home',
918     'section'     => 'shell',
919     'description' => 'For new users, prefixed to username to create a directory name.  Should have a leading but not a trailing slash.',
920     'type'        => 'text',
921   },
922
923   {
924     'key'         => 'invoice_from',
925     'section'     => 'required',
926     'description' => 'Return address on email invoices',
927     'type'        => 'text',
928     'per_agent'   => 1,
929   },
930
931   {
932     'key'         => 'invoice_subject',
933     'section'     => 'invoicing',
934     'description' => 'Subject: header on email invoices.  Defaults to "Invoice".  The following substitutions are available: $name, $name_short, $invoice_number, and $invoice_date.',
935     'type'        => 'text',
936     'per_agent'   => 1,
937   },
938
939   {
940     'key'         => 'invoice_usesummary',
941     'section'     => 'invoicing',
942     'description' => 'Indicates that html and latex invoices should be in summary style and make use of invoice_latexsummary.',
943     'type'        => 'checkbox',
944   },
945
946   {
947     'key'         => 'invoice_template',
948     'section'     => 'invoicing',
949     '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.',
950     'type'        => 'textarea',
951   },
952
953   {
954     'key'         => 'invoice_html',
955     'section'     => 'invoicing',
956     '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.',
957
958     'type'        => 'textarea',
959   },
960
961   {
962     'key'         => 'invoice_htmlnotes',
963     'section'     => 'invoicing',
964     'description' => 'Notes section for HTML invoices.  Defaults to the same data in invoice_latexnotes if not specified.',
965     'type'        => 'textarea',
966     'per_agent'   => 1,
967   },
968
969   {
970     'key'         => 'invoice_htmlfooter',
971     'section'     => 'invoicing',
972     'description' => 'Footer for HTML invoices.  Defaults to the same data in invoice_latexfooter if not specified.',
973     'type'        => 'textarea',
974     'per_agent'   => 1,
975   },
976
977   {
978     'key'         => 'invoice_htmlsummary',
979     'section'     => 'invoicing',
980     'description' => 'Summary initial page for HTML invoices.',
981     'type'        => 'textarea',
982     'per_agent'   => 1,
983   },
984
985   {
986     'key'         => 'invoice_htmlreturnaddress',
987     'section'     => 'invoicing',
988     'description' => 'Return address for HTML invoices.  Defaults to the same data in invoice_latexreturnaddress if not specified.',
989     'type'        => 'textarea',
990   },
991
992   {
993     'key'         => 'invoice_latex',
994     'section'     => 'invoicing',
995     '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.',
996     'type'        => 'textarea',
997   },
998
999   {
1000     'key'         => 'invoice_latextopmargin',
1001     'section'     => 'invoicing',
1002     'description' => 'Optional LaTeX invoice topmargin setting. Include units.',
1003     'type'        => 'text',
1004     'per_agent'   => 1,
1005     'validate'    => sub { shift =~
1006                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1007                              ? '' : 'Invalid LaTex length';
1008                          },
1009   },
1010
1011   {
1012     'key'         => 'invoice_latexheadsep',
1013     'section'     => 'invoicing',
1014     'description' => 'Optional LaTeX invoice headsep setting. Include units.',
1015     'type'        => 'text',
1016     'per_agent'   => 1,
1017     'validate'    => sub { shift =~
1018                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1019                              ? '' : 'Invalid LaTex length';
1020                          },
1021   },
1022
1023   {
1024     'key'         => 'invoice_latexaddresssep',
1025     'section'     => 'invoicing',
1026     'description' => 'Optional LaTeX invoice separation between invoice header
1027 and customer address. Include units.',
1028     'type'        => 'text',
1029     'per_agent'   => 1,
1030     'validate'    => sub { shift =~
1031                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1032                              ? '' : 'Invalid LaTex length';
1033                          },
1034   },
1035
1036   {
1037     'key'         => 'invoice_latextextheight',
1038     'section'     => 'invoicing',
1039     'description' => 'Optional LaTeX invoice textheight setting. Include units.',
1040     'type'        => 'text',
1041     'per_agent'   => 1,
1042     'validate'    => sub { shift =~
1043                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1044                              ? '' : 'Invalid LaTex length';
1045                          },
1046   },
1047
1048   {
1049     'key'         => 'invoice_latexnotes',
1050     'section'     => 'invoicing',
1051     'description' => 'Notes section for LaTeX typeset PostScript invoices.',
1052     'type'        => 'textarea',
1053     'per_agent'   => 1,
1054   },
1055
1056   {
1057     'key'         => 'invoice_latexfooter',
1058     'section'     => 'invoicing',
1059     'description' => 'Footer for LaTeX typeset PostScript invoices.',
1060     'type'        => 'textarea',
1061     'per_agent'   => 1,
1062   },
1063
1064   {
1065     'key'         => 'invoice_latexsummary',
1066     'section'     => 'invoicing',
1067     'description' => 'Summary initial page for LaTeX typeset PostScript invoices.',
1068     'type'        => 'textarea',
1069     'per_agent'   => 1,
1070   },
1071
1072   {
1073     'key'         => 'invoice_latexcoupon',
1074     'section'     => 'invoicing',
1075     'description' => 'Remittance coupon for LaTeX typeset PostScript invoices.',
1076     'type'        => 'textarea',
1077     'per_agent'   => 1,
1078   },
1079
1080   {
1081     'key'         => 'invoice_latexextracouponspace',
1082     'section'     => 'invoicing',
1083     'description' => 'Optional LaTeX invoice textheight space to reserve for a tear off coupon. Include units.',
1084     'type'        => 'text',
1085     'per_agent'   => 1,
1086     'validate'    => sub { shift =~
1087                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1088                              ? '' : 'Invalid LaTex length';
1089                          },
1090   },
1091
1092   {
1093     'key'         => 'invoice_latexcouponfootsep',
1094     'section'     => 'invoicing',
1095     'description' => 'Optional LaTeX invoice separation between tear off coupon and footer. Include units.',
1096     'type'        => 'text',
1097     'per_agent'   => 1,
1098     'validate'    => sub { shift =~
1099                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1100                              ? '' : 'Invalid LaTex length';
1101                          },
1102   },
1103
1104   {
1105     'key'         => 'invoice_latexcouponamountenclosedsep',
1106     'section'     => 'invoicing',
1107     'description' => 'Optional LaTeX invoice separation between total due and amount enclosed line. Include units.',
1108     'type'        => 'text',
1109     'per_agent'   => 1,
1110     'validate'    => sub { shift =~
1111                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1112                              ? '' : 'Invalid LaTex length';
1113                          },
1114   },
1115   {
1116     'key'         => 'invoice_latexcoupontoaddresssep',
1117     'section'     => 'invoicing',
1118     'description' => 'Optional LaTeX invoice separation between invoice data and the to address (usually invoice_latexreturnaddress).  Include units.',
1119     'type'        => 'text',
1120     'per_agent'   => 1,
1121     'validate'    => sub { shift =~
1122                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1123                              ? '' : 'Invalid LaTex length';
1124                          },
1125   },
1126
1127   {
1128     'key'         => 'invoice_latexreturnaddress',
1129     'section'     => 'invoicing',
1130     'description' => 'Return address for LaTeX typeset PostScript invoices.',
1131     'type'        => 'textarea',
1132   },
1133
1134   {
1135     'key'         => 'invoice_latexverticalreturnaddress',
1136     'section'     => 'invoicing',
1137     'description' => 'Place the return address under the company logo rather than beside it.',
1138     'type'        => 'checkbox',
1139     'per_agent'   => 1,
1140   },
1141
1142   {
1143     'key'         => 'invoice_latexcouponaddcompanytoaddress',
1144     'section'     => 'invoicing',
1145     'description' => 'Add the company name to the To address on the remittance coupon because the return address does not contain it.',
1146     'type'        => 'checkbox',
1147     'per_agent'   => 1,
1148   },
1149
1150   {
1151     'key'         => 'invoice_latexsmallfooter',
1152     'section'     => 'invoicing',
1153     'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
1154     'type'        => 'textarea',
1155     'per_agent'   => 1,
1156   },
1157
1158   {
1159     'key'         => 'invoice_email_pdf',
1160     'section'     => 'invoicing',
1161     '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.',
1162     'type'        => 'checkbox'
1163   },
1164
1165   {
1166     'key'         => 'invoice_email_pdf_note',
1167     'section'     => 'invoicing',
1168     'description' => 'If defined, this text will replace the default plain text invoice as the body of emailed PDF invoices.',
1169     'type'        => 'textarea'
1170   },
1171
1172   {
1173     'key'         => 'invoice_print_pdf',
1174     'section'     => 'invoicing',
1175     'description' => 'Store postal invoices for download in PDF format rather than printing them directly.',
1176     'type'        => 'checkbox',
1177   },
1178
1179   { 
1180     'key'         => 'invoice_default_terms',
1181     'section'     => 'invoicing',
1182     'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
1183     'type'        => 'select',
1184     'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 20', 'Net 30', 'Net 45', 'Net 60' ],
1185   },
1186
1187   { 
1188     'key'         => 'invoice_show_prior_due_date',
1189     'section'     => 'invoicing',
1190     'description' => 'Show previous invoice due dates when showing prior balances.  Default is to show invoice date.',
1191     'type'        => 'checkbox',
1192   },
1193
1194   { 
1195     'key'         => 'invoice_include_aging',
1196     'section'     => 'invoicing',
1197     'description' => 'Show an aging line after the prior balance section.  Only valud when invoice_sections is enabled.',
1198     'type'        => 'checkbox',
1199   },
1200
1201   { 
1202     'key'         => 'invoice_sections',
1203     'section'     => 'invoicing',
1204     'description' => 'Split invoice into sections and label according to package category when enabled.',
1205     'type'        => 'checkbox',
1206   },
1207
1208   { 
1209     'key'         => 'usage_class_as_a_section',
1210     'section'     => 'invoicing',
1211     'description' => 'Split usage into sections and label according to usage class name when enabled.  Only valid when invoice_sections is enabled.',
1212     'type'        => 'checkbox',
1213   },
1214
1215   { 
1216     'key'         => 'svc_phone_sections',
1217     'section'     => 'invoicing',
1218     'description' => 'Create a section for each svc_phone when enabled.  Only valid when invoice_sections is enabled.',
1219     'type'        => 'checkbox',
1220   },
1221
1222   {
1223     'key'         => 'finance_pkgclass',
1224     'section'     => 'billing',
1225     'description' => 'The default package class for late fee charges, used if the fee event does not specify a package class itself.',
1226     'type'        => 'select-pkg_class',
1227   },
1228
1229   { 
1230     'key'         => 'separate_usage',
1231     'section'     => 'invoicing',
1232     'description' => 'Split the rated call usage into a separate line from the recurring charges.',
1233     'type'        => 'checkbox',
1234   },
1235
1236   {
1237     'key'         => 'invoice_send_receipts',
1238     'section'     => 'deprecated',
1239     'description' => '<b>DEPRECATED</b>, this used to send an invoice copy on payments and credits.  See the payment_receipt_email and XXXX instead.',
1240     'type'        => 'checkbox',
1241   },
1242
1243   {
1244     'key'         => 'payment_receipt',
1245     'section'     => 'notification',
1246     'description' => 'Send payment receipts.',
1247     'type'        => 'checkbox',
1248   },
1249
1250   {
1251     'key'         => 'payment_receipt_msgnum',
1252     'section'     => 'notification',
1253     'description' => 'Template to use for payment receipts.',
1254     %msg_template_options,
1255   },
1256
1257   {
1258     'key'         => 'payment_receipt_email',
1259     'section'     => 'deprecated',
1260     'description' => 'Template file for payment receipts.  Payment receipts are sent to the customer email invoice destination(s) when a payment is received.',
1261     'type'        => [qw( checkbox textarea )],
1262   },
1263
1264   {
1265     'key'         => 'payment_receipt-trigger',
1266     'section'     => 'notification',
1267     'description' => 'When payment receipts are triggered.  Defaults to when payment is made.',
1268     'type'        => 'select',
1269     'select_hash' => [
1270                        'cust_pay'          => 'When payment is made.',
1271                        'cust_bill_pay_pkg' => 'When payment is applied.',
1272                      ],
1273   },
1274
1275   {
1276     'key'         => 'trigger_export_insert_on_payment',
1277     'section'     => 'billing',
1278     'description' => 'Enable exports on payment application.',
1279     'type'        => 'checkbox',
1280   },
1281
1282   {
1283     'key'         => 'lpr',
1284     'section'     => 'required',
1285     'description' => 'Print command for paper invoices, for example `lpr -h\'',
1286     'type'        => 'text',
1287   },
1288
1289   {
1290     'key'         => 'lpr-postscript_prefix',
1291     'section'     => 'billing',
1292     'description' => 'Raw printer commands prepended to the beginning of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
1293     'type'        => 'text',
1294   },
1295
1296   {
1297     'key'         => 'lpr-postscript_suffix',
1298     'section'     => 'billing',
1299     'description' => 'Raw printer commands added to the end of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
1300     'type'        => 'text',
1301   },
1302
1303   {
1304     'key'         => 'money_char',
1305     'section'     => '',
1306     'description' => 'Currency symbol - defaults to `$\'',
1307     'type'        => 'text',
1308   },
1309
1310   {
1311     'key'         => 'defaultrecords',
1312     'section'     => 'BIND',
1313     'description' => 'DNS entries to add automatically when creating a domain',
1314     'type'        => 'editlist',
1315     'editlist_parts' => [ { type=>'text' },
1316                           { type=>'immutable', value=>'IN' },
1317                           { type=>'select',
1318                             select_enum => {
1319                               map { $_=>$_ }
1320                                   #@{ FS::domain_record->rectypes }
1321                                   qw(A AAAA CNAME MX NS PTR SPF SRV TXT)
1322                             },
1323                           },
1324                           { type=> 'text' }, ],
1325   },
1326
1327   {
1328     'key'         => 'passwordmin',
1329     'section'     => 'password',
1330     'description' => 'Minimum password length (default 6)',
1331     'type'        => 'text',
1332   },
1333
1334   {
1335     'key'         => 'passwordmax',
1336     'section'     => 'password',
1337     'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
1338     'type'        => 'text',
1339   },
1340
1341   {
1342     'key'         => 'password-noampersand',
1343     'section'     => 'password',
1344     'description' => 'Disallow ampersands in passwords',
1345     'type'        => 'checkbox',
1346   },
1347
1348   {
1349     'key'         => 'password-noexclamation',
1350     'section'     => 'password',
1351     'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
1352     'type'        => 'checkbox',
1353   },
1354
1355   {
1356     'key'         => 'default-password-encoding',
1357     'section'     => 'password',
1358     'description' => 'Default storage format for passwords',
1359     'type'        => 'select',
1360     'select_hash' => [
1361       'plain'       => 'Plain text',
1362       'crypt-des'   => 'Unix password (DES encrypted)',
1363       'crypt-md5'   => 'Unix password (MD5 digest)',
1364       'ldap-plain'  => 'LDAP (plain text)',
1365       'ldap-crypt'  => 'LDAP (DES encrypted)',
1366       'ldap-md5'    => 'LDAP (MD5 digest)',
1367       'ldap-sha1'   => 'LDAP (SHA1 digest)',
1368       'legacy'      => 'Legacy mode',
1369     ],
1370   },
1371
1372   {
1373     'key'         => 'referraldefault',
1374     'section'     => 'UI',
1375     'description' => 'Default referral, specified by refnum',
1376     'type'        => 'select-sub',
1377     'options_sub' => sub { require FS::Record;
1378                            require FS::part_referral;
1379                            map { $_->refnum => $_->referral }
1380                                FS::Record::qsearch( 'part_referral', 
1381                                                     { 'disabled' => '' }
1382                                                   );
1383                          },
1384     'option_sub'  => sub { require FS::Record;
1385                            require FS::part_referral;
1386                            my $part_referral = FS::Record::qsearchs(
1387                              'part_referral', { 'refnum'=>shift } );
1388                            $part_referral ? $part_referral->referral : '';
1389                          },
1390   },
1391
1392 #  {
1393 #    'key'         => 'registries',
1394 #    'section'     => 'required',
1395 #    'description' => 'Directory which contains domain registry information.  Each registry is a directory.',
1396 #  },
1397
1398   {
1399     'key'         => 'report_template',
1400     'section'     => 'deprecated',
1401     'description' => 'Deprecated template file for reports.',
1402     'type'        => 'textarea',
1403   },
1404
1405   {
1406     'key'         => 'maxsearchrecordsperpage',
1407     'section'     => 'UI',
1408     'description' => 'If set, number of search records to return per page.',
1409     'type'        => 'text',
1410   },
1411
1412   {
1413     'key'         => 'session-start',
1414     'section'     => 'session',
1415     '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.',
1416     'type'        => 'text',
1417   },
1418
1419   {
1420     'key'         => 'session-stop',
1421     'section'     => 'session',
1422     '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.',
1423     'type'        => 'text',
1424   },
1425
1426   {
1427     'key'         => 'shells',
1428     'section'     => 'shell',
1429     '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.',
1430     'type'        => 'textarea',
1431   },
1432
1433   {
1434     'key'         => 'showpasswords',
1435     'section'     => 'UI',
1436     'description' => 'Display unencrypted user passwords in the backend (employee) web interface',
1437     'type'        => 'checkbox',
1438   },
1439
1440   {
1441     'key'         => 'report-showpasswords',
1442     'section'     => 'UI',
1443     'description' => 'This is a terrible idea.  Do not enable it.  STRONGLY NOT RECOMMENDED.  Enables display of passwords on services reports.',
1444     'type'        => 'checkbox',
1445   },
1446
1447   {
1448     'key'         => 'signupurl',
1449     'section'     => 'UI',
1450     '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',
1451     'type'        => 'text',
1452   },
1453
1454   {
1455     'key'         => 'smtpmachine',
1456     'section'     => 'required',
1457     'description' => 'SMTP relay for Freeside\'s outgoing mail',
1458     'type'        => 'text',
1459   },
1460
1461   {
1462     'key'         => 'smtp-username',
1463     'section'     => '',
1464     'description' => 'Optional SMTP username for Freeside\'s outgoing mail',
1465     'type'        => 'text',
1466   },
1467
1468   {
1469     'key'         => 'smtp-password',
1470     'section'     => '',
1471     'description' => 'Optional SMTP password for Freeside\'s outgoing mail',
1472     'type'        => 'text',
1473   },
1474
1475   {
1476     'key'         => 'smtp-encryption',
1477     'section'     => '',
1478     'description' => 'Optional SMTP encryption method.  The STARTTLS methods require smtp-username and smtp-password to be set.',
1479     'type'        => 'select',
1480     'select_hash' => [ '25'           => 'None (port 25)',
1481                        '25-starttls'  => 'STARTTLS (port 25)',
1482                        '587-starttls' => 'STARTTLS / submission (port 587)',
1483                        '465-tls'      => 'SMTPS (SSL) (port 465)',
1484                      ],
1485   },
1486
1487   {
1488     'key'         => 'soadefaultttl',
1489     'section'     => 'BIND',
1490     'description' => 'SOA default TTL for new domains.',
1491     'type'        => 'text',
1492   },
1493
1494   {
1495     'key'         => 'soaemail',
1496     'section'     => 'BIND',
1497     'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
1498     'type'        => 'text',
1499   },
1500
1501   {
1502     'key'         => 'soaexpire',
1503     'section'     => 'BIND',
1504     'description' => 'SOA expire for new domains',
1505     'type'        => 'text',
1506   },
1507
1508   {
1509     'key'         => 'soamachine',
1510     'section'     => 'BIND',
1511     'description' => 'SOA machine for new domains, with trailing `.\'',
1512     'type'        => 'text',
1513   },
1514
1515   {
1516     'key'         => 'soarefresh',
1517     'section'     => 'BIND',
1518     'description' => 'SOA refresh for new domains',
1519     'type'        => 'text',
1520   },
1521
1522   {
1523     'key'         => 'soaretry',
1524     'section'     => 'BIND',
1525     'description' => 'SOA retry for new domains',
1526     'type'        => 'text',
1527   },
1528
1529   {
1530     'key'         => 'statedefault',
1531     'section'     => 'UI',
1532     'description' => 'Default state or province (if not supplied, the default is `CA\')',
1533     'type'        => 'text',
1534   },
1535
1536   {
1537     'key'         => 'unsuspendauto',
1538     'section'     => 'billing',
1539     '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',
1540     'type'        => 'checkbox',
1541   },
1542
1543   {
1544     'key'         => 'unsuspend-always_adjust_next_bill_date',
1545     'section'     => 'billing',
1546     '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.',
1547     'type'        => 'checkbox',
1548   },
1549
1550   {
1551     'key'         => 'usernamemin',
1552     'section'     => 'username',
1553     'description' => 'Minimum username length (default 2)',
1554     'type'        => 'text',
1555   },
1556
1557   {
1558     'key'         => 'usernamemax',
1559     'section'     => 'username',
1560     'description' => 'Maximum username length',
1561     'type'        => 'text',
1562   },
1563
1564   {
1565     'key'         => 'username-ampersand',
1566     'section'     => 'username',
1567     '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.',
1568     'type'        => 'checkbox',
1569   },
1570
1571   {
1572     'key'         => 'username-letter',
1573     'section'     => 'username',
1574     'description' => 'Usernames must contain at least one letter',
1575     'type'        => 'checkbox',
1576     'per_agent'   => 1,
1577   },
1578
1579   {
1580     'key'         => 'username-letterfirst',
1581     'section'     => 'username',
1582     'description' => 'Usernames must start with a letter',
1583     'type'        => 'checkbox',
1584   },
1585
1586   {
1587     'key'         => 'username-noperiod',
1588     'section'     => 'username',
1589     'description' => 'Disallow periods in usernames',
1590     'type'        => 'checkbox',
1591   },
1592
1593   {
1594     'key'         => 'username-nounderscore',
1595     'section'     => 'username',
1596     'description' => 'Disallow underscores in usernames',
1597     'type'        => 'checkbox',
1598   },
1599
1600   {
1601     'key'         => 'username-nodash',
1602     'section'     => 'username',
1603     'description' => 'Disallow dashes in usernames',
1604     'type'        => 'checkbox',
1605   },
1606
1607   {
1608     'key'         => 'username-uppercase',
1609     'section'     => 'username',
1610     'description' => 'Allow uppercase characters in usernames.  Not recommended for use with FreeRADIUS with MySQL backend, which is case-insensitive by default.',
1611     'type'        => 'checkbox',
1612   },
1613
1614   { 
1615     'key'         => 'username-percent',
1616     'section'     => 'username',
1617     'description' => 'Allow the percent character (%) in usernames.',
1618     'type'        => 'checkbox',
1619   },
1620
1621   { 
1622     'key'         => 'username-colon',
1623     'section'     => 'username',
1624     'description' => 'Allow the colon character (:) in usernames.',
1625     'type'        => 'checkbox',
1626   },
1627
1628   {
1629     'key'         => 'safe-part_bill_event',
1630     'section'     => 'UI',
1631     'description' => 'Validates invoice event expressions against a preset list.  Useful for webdemos, annoying to powerusers.',
1632     'type'        => 'checkbox',
1633   },
1634
1635   {
1636     'key'         => 'show_ss',
1637     'section'     => 'UI',
1638     'description' => 'Turns on display/collection of social security numbers in the web interface.  Sometimes required by electronic check (ACH) processors.',
1639     'type'        => 'checkbox',
1640   },
1641
1642   {
1643     'key'         => 'show_stateid',
1644     'section'     => 'UI',
1645     'description' => "Turns on display/collection of driver's license/state issued id numbers in the web interface.  Sometimes required by electronic check (ACH) processors.",
1646     'type'        => 'checkbox',
1647   },
1648
1649   {
1650     'key'         => 'show_bankstate',
1651     'section'     => 'UI',
1652     'description' => "Turns on display/collection of state for bank accounts in the web interface.  Sometimes required by electronic check (ACH) processors.",
1653     'type'        => 'checkbox',
1654   },
1655
1656   { 
1657     'key'         => 'agent_defaultpkg',
1658     'section'     => 'UI',
1659     'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
1660     'type'        => 'checkbox',
1661   },
1662
1663   {
1664     'key'         => 'legacy_link',
1665     'section'     => 'UI',
1666     'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
1667     'type'        => 'checkbox',
1668   },
1669
1670   {
1671     'key'         => 'legacy_link-steal',
1672     'section'     => 'UI',
1673     'description' => 'Allow "stealing" an already-audited service from one customer (or package) to another using the link function.',
1674     'type'        => 'checkbox',
1675   },
1676
1677   {
1678     'key'         => 'queue_dangerous_controls',
1679     'section'     => 'UI',
1680     '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.',
1681     'type'        => 'checkbox',
1682   },
1683
1684   {
1685     'key'         => 'security_phrase',
1686     'section'     => 'password',
1687     'description' => 'Enable the tracking of a "security phrase" with each account.  Not recommended, as it is vulnerable to social engineering.',
1688     'type'        => 'checkbox',
1689   },
1690
1691   {
1692     'key'         => 'locale',
1693     'section'     => 'UI',
1694     'description' => 'Message locale',
1695     'type'        => 'select',
1696     'select_enum' => [ qw(en_US) ],
1697   },
1698
1699   {
1700     'key'         => 'signup_server-payby',
1701     'section'     => 'self-service',
1702     'description' => 'Acceptable payment types for the signup server',
1703     'type'        => 'selectmultiple',
1704     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
1705   },
1706
1707   {
1708     'key'         => 'selfservice-save_unchecked',
1709     'section'     => 'self-service',
1710     'description' => 'In self-service, uncheck "Remember information" checkboxes by default (normally, they are checked by default).',
1711     'type'        => 'checkbox',
1712   },
1713
1714   {
1715     'key'         => 'signup_server-default_agentnum',
1716     'section'     => 'self-service',
1717     'description' => 'Default agent for the signup server',
1718     'type'        => 'select-sub',
1719     'options_sub' => sub { require FS::Record;
1720                            require FS::agent;
1721                            map { $_->agentnum => $_->agent }
1722                                FS::Record::qsearch('agent', { disabled=>'' } );
1723                          },
1724     'option_sub'  => sub { require FS::Record;
1725                            require FS::agent;
1726                            my $agent = FS::Record::qsearchs(
1727                              'agent', { 'agentnum'=>shift }
1728                            );
1729                            $agent ? $agent->agent : '';
1730                          },
1731   },
1732
1733   {
1734     'key'         => 'signup_server-default_refnum',
1735     'section'     => 'self-service',
1736     'description' => 'Default advertising source for the signup server',
1737     'type'        => 'select-sub',
1738     'options_sub' => sub { require FS::Record;
1739                            require FS::part_referral;
1740                            map { $_->refnum => $_->referral }
1741                                FS::Record::qsearch( 'part_referral', 
1742                                                     { 'disabled' => '' }
1743                                                   );
1744                          },
1745     'option_sub'  => sub { require FS::Record;
1746                            require FS::part_referral;
1747                            my $part_referral = FS::Record::qsearchs(
1748                              'part_referral', { 'refnum'=>shift } );
1749                            $part_referral ? $part_referral->referral : '';
1750                          },
1751   },
1752
1753   {
1754     'key'         => 'signup_server-default_pkgpart',
1755     'section'     => 'self-service',
1756     'description' => 'Default package for the signup server',
1757     'type'        => 'select-part_pkg',
1758   },
1759
1760   {
1761     'key'         => 'signup_server-default_svcpart',
1762     'section'     => 'self-service',
1763     'description' => 'Default service definition for the signup server - only necessary for services that trigger special provisioning widgets (such as DID provisioning).',
1764     'type'        => 'select-part_svc',
1765   },
1766
1767   {
1768     'key'         => 'signup_server-mac_addr_svcparts',
1769     'section'     => 'self-service',
1770     'description' => 'Service definitions which can receive mac addresses (current mapped to username for svc_acct).',
1771     'type'        => 'select-part_svc',
1772     'multiple'    => 1,
1773   },
1774
1775   {
1776     'key'         => 'signup_server-nomadix',
1777     'section'     => 'self-service',
1778     'description' => 'Signup page Nomadix integration',
1779     'type'        => 'checkbox',
1780   },
1781
1782   {
1783     'key'         => 'signup_server-service',
1784     'section'     => 'self-service',
1785     'description' => 'Service for the signup server - "Account (svc_acct)" is the default setting, or "Phone number (svc_phone)" for ITSP signup',
1786     'type'        => 'select',
1787     'select_hash' => [
1788                        'svc_acct'  => 'Account (svc_acct)',
1789                        'svc_phone' => 'Phone number (svc_phone)',
1790                      ],
1791   },
1792
1793   {
1794     'key'         => 'selfservice_server-base_url',
1795     'section'     => 'self-service',
1796     '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.',
1797     'type'        => 'text',
1798   },
1799
1800   {
1801     'key'         => 'show-msgcat-codes',
1802     'section'     => 'UI',
1803     'description' => 'Show msgcat codes in error messages.  Turn this option on before reporting errors to the mailing list.',
1804     'type'        => 'checkbox',
1805   },
1806
1807   {
1808     'key'         => 'signup_server-realtime',
1809     'section'     => 'self-service',
1810     'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
1811     'type'        => 'checkbox',
1812   },
1813
1814   {
1815     'key'         => 'signup_server-classnum2',
1816     'section'     => 'self-service',
1817     'description' => 'Package Class for first optional purchase',
1818     'type'        => 'select-pkg_class',
1819   },
1820
1821   {
1822     'key'         => 'signup_server-classnum3',
1823     'section'     => 'self-service',
1824     'description' => 'Package Class for second optional purchase',
1825     'type'        => 'select-pkg_class',
1826   },
1827
1828   {
1829     'key'         => 'selfservice-xmlrpc',
1830     'section'     => 'self-service',
1831     'description' => 'Run a standalone self-service XML-RPC server on the backend (on port 8080).',
1832     'type'        => 'checkbox',
1833   },
1834
1835   {
1836     'key'         => 'backend-realtime',
1837     'section'     => 'billing',
1838     'description' => 'Run billing for backend signups immediately.',
1839     'type'        => 'checkbox',
1840   },
1841
1842   {
1843     'key'         => 'decline_msgnum',
1844     'section'     => 'notification',
1845     'description' => 'Template to use for credit card and electronic check decline messages.',
1846     %msg_template_options,
1847   },
1848
1849   {
1850     'key'         => 'declinetemplate',
1851     'section'     => 'deprecated',
1852     'description' => 'Template file for credit card and electronic check decline emails.',
1853     'type'        => 'textarea',
1854   },
1855
1856   {
1857     'key'         => 'emaildecline',
1858     'section'     => 'notification',
1859     'description' => 'Enable emailing of credit card and electronic check decline notices.',
1860     'type'        => 'checkbox',
1861   },
1862
1863   {
1864     'key'         => 'emaildecline-exclude',
1865     'section'     => 'notification',
1866     'description' => 'List of error messages that should not trigger email decline notices, one per line.',
1867     'type'        => 'textarea',
1868   },
1869
1870   {
1871     'key'         => 'cancel_msgnum',
1872     'section'     => 'notification',
1873     'description' => 'Template to use for cancellation emails.',
1874     %msg_template_options,
1875   },
1876
1877   {
1878     'key'         => 'cancelmessage',
1879     'section'     => 'deprecated',
1880     'description' => 'Template file for cancellation emails.',
1881     'type'        => 'textarea',
1882   },
1883
1884   {
1885     'key'         => 'cancelsubject',
1886     'section'     => 'deprecated',
1887     'description' => 'Subject line for cancellation emails.',
1888     'type'        => 'text',
1889   },
1890
1891   {
1892     'key'         => 'emailcancel',
1893     'section'     => 'notification',
1894     'description' => 'Enable emailing of cancellation notices.  Make sure to select the template in the cancel_msgnum option.',
1895     'type'        => 'checkbox',
1896   },
1897
1898   {
1899     'key'         => 'bill_usage_on_cancel',
1900     'section'     => 'billing',
1901     '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.',
1902     'type'        => 'checkbox',
1903   },
1904
1905   {
1906     'key'         => 'require_cardname',
1907     'section'     => 'billing',
1908     'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
1909     'type'        => 'checkbox',
1910   },
1911
1912   {
1913     'key'         => 'enable_taxclasses',
1914     'section'     => 'billing',
1915     'description' => 'Enable per-package tax classes',
1916     'type'        => 'checkbox',
1917   },
1918
1919   {
1920     'key'         => 'require_taxclasses',
1921     'section'     => 'billing',
1922     'description' => 'Require a taxclass to be entered for every package',
1923     'type'        => 'checkbox',
1924   },
1925
1926   {
1927     'key'         => 'enable_taxproducts',
1928     'section'     => 'billing',
1929     'description' => 'Enable per-package mapping to vendor tax data from CCH or elsewhere.',
1930     'type'        => 'checkbox',
1931   },
1932
1933   {
1934     'key'         => 'taxdatadirectdownload',
1935     'section'     => 'billing',  #well
1936     'description' => 'Enable downloading tax data directly from the vendor site. at least three lines: URL, username, and password.j',
1937     'type'        => 'textarea',
1938   },
1939
1940   {
1941     'key'         => 'ignore_incalculable_taxes',
1942     'section'     => 'billing',
1943     'description' => 'Prefer to invoice without tax over not billing at all',
1944     'type'        => 'checkbox',
1945   },
1946
1947   {
1948     'key'         => 'welcome_msgnum',
1949     'section'     => 'notification',
1950     'description' => 'Template to use for welcome messages when a svc_acct record is created.',
1951     %msg_template_options,
1952   },
1953
1954   {
1955     'key'         => 'welcome_email',
1956     'section'     => 'deprecated',
1957     '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.',
1958     'type'        => 'textarea',
1959     'per_agent'   => 1,
1960   },
1961
1962   {
1963     'key'         => 'welcome_email-from',
1964     'section'     => 'deprecated',
1965     'description' => 'From: address header for welcome email',
1966     'type'        => 'text',
1967     'per_agent'   => 1,
1968   },
1969
1970   {
1971     'key'         => 'welcome_email-subject',
1972     'section'     => 'deprecated',
1973     'description' => 'Subject: header for welcome email',
1974     'type'        => 'text',
1975     'per_agent'   => 1,
1976   },
1977   
1978   {
1979     'key'         => 'welcome_email-mimetype',
1980     'section'     => 'deprecated',
1981     'description' => 'MIME type for welcome email',
1982     'type'        => 'select',
1983     'select_enum' => [ 'text/plain', 'text/html' ],
1984     'per_agent'   => 1,
1985   },
1986
1987   {
1988     'key'         => 'welcome_letter',
1989     'section'     => '',
1990     '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>',
1991     'type'        => 'textarea',
1992   },
1993
1994 #  {
1995 #    'key'         => 'warning_msgnum',
1996 #    'section'     => 'notification',
1997 #    'description' => 'Template to use for warning messages, sent to the customer email invoice destination(s) when a svc_acct record has its usage drop below a threshold.',
1998 #    %msg_template_options,
1999 #  },
2000
2001   {
2002     'key'         => 'warning_email',
2003     'section'     => 'notification',
2004     '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>',
2005     'type'        => 'textarea',
2006   },
2007
2008   {
2009     'key'         => 'warning_email-from',
2010     'section'     => 'notification',
2011     'description' => 'From: address header for warning email',
2012     'type'        => 'text',
2013   },
2014
2015   {
2016     'key'         => 'warning_email-cc',
2017     'section'     => 'notification',
2018     'description' => 'Additional recipient(s) (comma separated) for warning email when remaining usage reaches zero.',
2019     'type'        => 'text',
2020   },
2021
2022   {
2023     'key'         => 'warning_email-subject',
2024     'section'     => 'notification',
2025     'description' => 'Subject: header for warning email',
2026     'type'        => 'text',
2027   },
2028   
2029   {
2030     'key'         => 'warning_email-mimetype',
2031     'section'     => 'notification',
2032     'description' => 'MIME type for warning email',
2033     'type'        => 'select',
2034     'select_enum' => [ 'text/plain', 'text/html' ],
2035   },
2036
2037   {
2038     'key'         => 'payby',
2039     'section'     => 'billing',
2040     'description' => 'Available payment types.',
2041     'type'        => 'selectmultiple',
2042     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP) ],
2043   },
2044
2045   {
2046     'key'         => 'payby-default',
2047     'section'     => 'UI',
2048     'description' => 'Default payment type.  HIDE disables display of billing information and sets customers to BILL.',
2049     'type'        => 'select',
2050     'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP HIDE) ],
2051   },
2052
2053   {
2054     'key'         => 'paymentforcedtobatch',
2055     'section'     => 'deprecated',
2056     '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.',
2057     'type'        => 'checkbox',
2058   },
2059
2060   {
2061     'key'         => 'svc_acct-notes',
2062     'section'     => 'deprecated',
2063     'description' => 'Extra HTML to be displayed on the Account View screen.',
2064     'type'        => 'textarea',
2065   },
2066
2067   {
2068     'key'         => 'radius-password',
2069     'section'     => '',
2070     'description' => 'RADIUS attribute for plain-text passwords.',
2071     'type'        => 'select',
2072     'select_enum' => [ 'Password', 'User-Password', 'Cleartext-Password' ],
2073   },
2074
2075   {
2076     'key'         => 'radius-ip',
2077     'section'     => '',
2078     'description' => 'RADIUS attribute for IP addresses.',
2079     'type'        => 'select',
2080     'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
2081   },
2082
2083   #http://dev.coova.org/svn/coova-chilli/doc/dictionary.chillispot
2084   {
2085     'key'         => 'radius-chillispot-max',
2086     'section'     => '',
2087     'description' => 'Enable ChilliSpot (and CoovaChilli) Max attributes, specifically ChilliSpot-Max-{Input,Output,Total}-{Octets,Gigawords}.',
2088     'type'        => 'checkbox',
2089   },
2090
2091   {
2092     'key'         => 'svc_acct-alldomains',
2093     'section'     => '',
2094     '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.',
2095     'type'        => 'checkbox',
2096   },
2097
2098   {
2099     'key'         => 'dump-scpdest',
2100     'section'     => '',
2101     'description' => 'destination for scp database dumps: user@host:/path',
2102     'type'        => 'text',
2103   },
2104
2105   {
2106     'key'         => 'dump-pgpid',
2107     'section'     => '',
2108     '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.",
2109     'type'        => 'text',
2110   },
2111
2112   {
2113     'key'         => 'users-allow_comp',
2114     'section'     => 'deprecated',
2115     '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.',
2116     'type'        => 'textarea',
2117   },
2118
2119   {
2120     'key'         => 'credit_card-recurring_billing_flag',
2121     'section'     => 'billing',
2122     '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. ',
2123     'type'        => 'select',
2124     'select_hash' => [
2125                        'actual_oncard' => 'Default/classic behavior: set the flag if a customer has actual previous charges on the card.',
2126                        'transaction_is_recur' => 'Set the flag if the transaction itself is recurring, irregardless of previous charges on the card.',
2127                      ],
2128   },
2129
2130   {
2131     'key'         => 'credit_card-recurring_billing_acct_code',
2132     'section'     => 'billing',
2133     'description' => 'When the "recurring billing" flag is set, also set the "acct_code" to "rebill".  Useful for reporting purposes with supported gateways (PlugNPay, others?)',
2134     'type'        => 'checkbox',
2135   },
2136
2137   {
2138     'key'         => 'cvv-save',
2139     'section'     => 'billing',
2140     '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.',
2141     'type'        => 'selectmultiple',
2142     'select_enum' => \@card_types,
2143   },
2144
2145   {
2146     'key'         => 'manual_process-pkgpart',
2147     'section'     => 'billing',
2148     '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.',
2149     'type'        => 'select-part_pkg',
2150   },
2151
2152   {
2153     'key'         => 'manual_process-display',
2154     'section'     => 'billing',
2155     'description' => 'When using manual_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
2156     'type'        => 'select',
2157     'select_hash' => [
2158                        'add'      => 'Add fee to amount entered',
2159                        'subtract' => 'Subtract fee from amount entered',
2160                      ],
2161   },
2162
2163   {
2164     'key'         => 'manual_process-skip_first',
2165     'section'     => 'billing',
2166     'description' => "When using manual_process-pkgpart, omit the fee if it is the customer's first payment.",
2167     'type'        => 'checkbox',
2168   },
2169
2170   {
2171     'key'         => 'allow_negative_charges',
2172     'section'     => 'billing',
2173     'description' => 'Allow negative charges.  Normally not used unless importing data from a legacy system that requires this.',
2174     'type'        => 'checkbox',
2175   },
2176   {
2177       'key'         => 'auto_unset_catchall',
2178       'section'     => '',
2179       '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.',
2180       'type'        => 'checkbox',
2181   },
2182
2183   {
2184     'key'         => 'system_usernames',
2185     'section'     => 'username',
2186     '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.',
2187     'type'        => 'textarea',
2188   },
2189
2190   {
2191     'key'         => 'cust_pkg-change_svcpart',
2192     'section'     => '',
2193     'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
2194     'type'        => 'checkbox',
2195   },
2196
2197   {
2198     'key'         => 'cust_pkg-change_pkgpart-bill_now',
2199     'section'     => '',
2200     'description' => "When changing packages, bill the new package immediately.  Useful for prepaid situations with RADIUS where an Expiration attribute based on the package must be present at all times.",
2201     'type'        => 'checkbox',
2202   },
2203
2204   {
2205     'key'         => 'disable_autoreverse',
2206     'section'     => 'BIND',
2207     'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
2208     'type'        => 'checkbox',
2209   },
2210
2211   {
2212     'key'         => 'svc_www-enable_subdomains',
2213     'section'     => '',
2214     'description' => 'Enable selection of specific subdomains for virtual host creation.',
2215     'type'        => 'checkbox',
2216   },
2217
2218   {
2219     'key'         => 'svc_www-usersvc_svcpart',
2220     'section'     => '',
2221     'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
2222     'type'        => 'select-part_svc',
2223     'multiple'    => 1,
2224   },
2225
2226   {
2227     'key'         => 'selfservice_server-primary_only',
2228     'section'     => 'self-service',
2229     'description' => 'Only allow primary accounts to access self-service functionality.',
2230     'type'        => 'checkbox',
2231   },
2232
2233   {
2234     'key'         => 'selfservice_server-phone_login',
2235     'section'     => 'self-service',
2236     'description' => 'Allow login to self-service with phone number and PIN.',
2237     'type'        => 'checkbox',
2238   },
2239
2240   {
2241     'key'         => 'selfservice_server-single_domain',
2242     'section'     => 'self-service',
2243     'description' => 'If specified, only use this one domain for self-service access.',
2244     'type'        => 'text',
2245   },
2246
2247   {
2248     'key'         => 'selfservice-agent_signup',
2249     'section'     => 'self-service',
2250     'description' => 'Allow agent signup via self-service.',
2251     'type'        => 'checkbox',
2252   },
2253
2254   {
2255     'key'         => 'selfservice-agent_signup-agent_type',
2256     'section'     => 'self-service',
2257     'description' => 'Agent type when allowing agent signup via self-service.',
2258     'type'        => 'select-sub',
2259     'options_sub' => sub { require FS::Record;
2260                            require FS::agent_type;
2261                            map { $_->typenum => $_->atype }
2262                                FS::Record::qsearch('agent_type', {} ); # disabled=>'' } );
2263                          },
2264     'option_sub'  => sub { require FS::Record;
2265                            require FS::agent_type;
2266                            my $agent = FS::Record::qsearchs(
2267                              'agent_type', { 'typenum'=>shift }
2268                            );
2269                            $agent_type ? $agent_type->atype : '';
2270                          },
2271   },
2272
2273   {
2274     'key'         => 'card_refund-days',
2275     'section'     => 'billing',
2276     'description' => 'After a payment, the number of days a refund link will be available for that payment.  Defaults to 120.',
2277     'type'        => 'text',
2278   },
2279
2280   {
2281     'key'         => 'agent-showpasswords',
2282     'section'     => '',
2283     'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
2284     'type'        => 'checkbox',
2285   },
2286
2287   {
2288     'key'         => 'global_unique-username',
2289     'section'     => 'username',
2290     '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.',
2291     'type'        => 'select',
2292     'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
2293   },
2294
2295   {
2296     'key'         => 'global_unique-phonenum',
2297     'section'     => '',
2298     '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.',
2299     'type'        => 'select',
2300     'select_enum' => [ 'none', 'countrycode+phonenum', 'disabled' ],
2301   },
2302
2303   {
2304     'key'         => 'global_unique-pbx_title',
2305     'section'     => '',
2306     'description' => 'Global phone number uniqueness control: enabled (usual setting - svc_pbx.title must be unique), or disabled turns off duplicate checking for this field.',
2307     'type'        => 'select',
2308     'select_enum' => [ 'enabled', 'disabled' ],
2309   },
2310
2311   {
2312     'key'         => 'svc_external-skip_manual',
2313     'section'     => 'UI',
2314     '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).',
2315     'type'        => 'checkbox',
2316   },
2317
2318   {
2319     'key'         => 'svc_external-display_type',
2320     'section'     => 'UI',
2321     'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
2322     'type'        => 'select',
2323     'select_enum' => [ 'generic', 'artera_turbo', ],
2324   },
2325
2326   {
2327     'key'         => 'ticket_system',
2328     'section'     => '',
2329     '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).',
2330     'type'        => 'select',
2331     #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
2332     'select_enum' => [ '', qw(RT_Internal RT_External) ],
2333   },
2334
2335   {
2336     'key'         => 'ticket_system-default_queueid',
2337     'section'     => '',
2338     'description' => 'Default queue used when creating new customer tickets.',
2339     'type'        => 'select-sub',
2340     'options_sub' => sub {
2341                            my $conf = new FS::Conf;
2342                            if ( $conf->config('ticket_system') ) {
2343                              eval "use FS::TicketSystem;";
2344                              die $@ if $@;
2345                              FS::TicketSystem->queues();
2346                            } else {
2347                              ();
2348                            }
2349                          },
2350     'option_sub'  => sub { 
2351                            my $conf = new FS::Conf;
2352                            if ( $conf->config('ticket_system') ) {
2353                              eval "use FS::TicketSystem;";
2354                              die $@ if $@;
2355                              FS::TicketSystem->queue(shift);
2356                            } else {
2357                              '';
2358                            }
2359                          },
2360   },
2361   {
2362     'key'         => 'ticket_system-force_default_queueid',
2363     'section'     => '',
2364     'description' => 'Disallow queue selection when creating new tickets from customer view.',
2365     'type'        => 'checkbox',
2366   },
2367   {
2368     'key'         => 'ticket_system-selfservice_queueid',
2369     'section'     => '',
2370     'description' => 'Queue used when creating new customer tickets from self-service.  Defautls to ticket_system-default_queueid if not specified.',
2371     #false laziness w/above
2372     'type'        => 'select-sub',
2373     'options_sub' => sub {
2374                            my $conf = new FS::Conf;
2375                            if ( $conf->config('ticket_system') ) {
2376                              eval "use FS::TicketSystem;";
2377                              die $@ if $@;
2378                              FS::TicketSystem->queues();
2379                            } else {
2380                              ();
2381                            }
2382                          },
2383     'option_sub'  => sub { 
2384                            my $conf = new FS::Conf;
2385                            if ( $conf->config('ticket_system') ) {
2386                              eval "use FS::TicketSystem;";
2387                              die $@ if $@;
2388                              FS::TicketSystem->queue(shift);
2389                            } else {
2390                              '';
2391                            }
2392                          },
2393   },
2394
2395   {
2396     'key'         => 'ticket_system-priority_reverse',
2397     'section'     => '',
2398     '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.',
2399     'type'        => 'checkbox',
2400   },
2401
2402   {
2403     'key'         => 'ticket_system-custom_priority_field',
2404     'section'     => '',
2405     'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
2406     'type'        => 'text',
2407   },
2408
2409   {
2410     'key'         => 'ticket_system-custom_priority_field-values',
2411     'section'     => '',
2412     'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
2413     'type'        => 'textarea',
2414   },
2415
2416   {
2417     'key'         => 'ticket_system-custom_priority_field_queue',
2418     'section'     => '',
2419     'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
2420     'type'        => 'text',
2421   },
2422
2423   {
2424     'key'         => 'ticket_system-rt_external_datasrc',
2425     'section'     => '',
2426     '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>',
2427     'type'        => 'text',
2428
2429   },
2430
2431   {
2432     'key'         => 'ticket_system-rt_external_url',
2433     'section'     => '',
2434     'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
2435     'type'        => 'text',
2436   },
2437
2438   {
2439     'key'         => 'company_name',
2440     'section'     => 'required',
2441     'description' => 'Your company name',
2442     'type'        => 'text',
2443     'per_agent'   => 1, #XXX just FS/FS/ClientAPI/Signup.pm
2444   },
2445
2446   {
2447     'key'         => 'company_address',
2448     'section'     => 'required',
2449     'description' => 'Your company address',
2450     'type'        => 'textarea',
2451     'per_agent'   => 1,
2452   },
2453
2454   {
2455     'key'         => 'echeck-void',
2456     'section'     => 'deprecated',
2457     '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',
2458     'type'        => 'checkbox',
2459   },
2460
2461   {
2462     'key'         => 'cc-void',
2463     'section'     => 'deprecated',
2464     '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',
2465     'type'        => 'checkbox',
2466   },
2467
2468   {
2469     'key'         => 'unvoid',
2470     'section'     => 'deprecated',
2471     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable unvoiding of voided payments',
2472     'type'        => 'checkbox',
2473   },
2474
2475   {
2476     'key'         => 'address1-search',
2477     'section'     => 'UI',
2478     'description' => 'Enable the ability to search the address1 field from customer search.',
2479     'type'        => 'checkbox',
2480   },
2481
2482   {
2483     'key'         => 'address2-search',
2484     'section'     => 'UI',
2485     'description' => 'Enable a "Unit" search box which searches the second address field.  Useful for multi-tenant applications.  See also: cust_main-require_address2',
2486     'type'        => 'checkbox',
2487   },
2488
2489   {
2490     'key'         => 'cust_main-require_address2',
2491     'section'     => 'UI',
2492     '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',
2493     'type'        => 'checkbox',
2494   },
2495
2496   {
2497     'key'         => 'agent-ship_address',
2498     'section'     => '',
2499     '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.",
2500     'type'        => 'checkbox',
2501   },
2502
2503   { 'key'         => 'referral_credit',
2504     'section'     => 'deprecated',
2505     '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.",
2506     'type'        => 'checkbox',
2507   },
2508
2509   { 'key'         => 'selfservice_server-cache_module',
2510     'section'     => 'self-service',
2511     '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.',
2512     'type'        => 'select',
2513     'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
2514   },
2515
2516   {
2517     'key'         => 'hylafax',
2518     'section'     => 'billing',
2519     '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).',
2520     'type'        => [qw( checkbox textarea )],
2521   },
2522
2523   {
2524     'key'         => 'cust_bill-ftpformat',
2525     'section'     => 'invoicing',
2526     'description' => 'Enable FTP of raw invoice data - format.',
2527     'type'        => 'select',
2528     'select_enum' => [ '', 'default', 'billco', ],
2529   },
2530
2531   {
2532     'key'         => 'cust_bill-ftpserver',
2533     'section'     => 'invoicing',
2534     'description' => 'Enable FTP of raw invoice data - server.',
2535     'type'        => 'text',
2536   },
2537
2538   {
2539     'key'         => 'cust_bill-ftpusername',
2540     'section'     => 'invoicing',
2541     'description' => 'Enable FTP of raw invoice data - server.',
2542     'type'        => 'text',
2543   },
2544
2545   {
2546     'key'         => 'cust_bill-ftppassword',
2547     'section'     => 'invoicing',
2548     'description' => 'Enable FTP of raw invoice data - server.',
2549     'type'        => 'text',
2550   },
2551
2552   {
2553     'key'         => 'cust_bill-ftpdir',
2554     'section'     => 'invoicing',
2555     'description' => 'Enable FTP of raw invoice data - server.',
2556     'type'        => 'text',
2557   },
2558
2559   {
2560     'key'         => 'cust_bill-spoolformat',
2561     'section'     => 'invoicing',
2562     'description' => 'Enable spooling of raw invoice data - format.',
2563     'type'        => 'select',
2564     'select_enum' => [ '', 'default', 'billco', ],
2565   },
2566
2567   {
2568     'key'         => 'cust_bill-spoolagent',
2569     'section'     => 'invoicing',
2570     'description' => 'Enable per-agent spooling of raw invoice data.',
2571     'type'        => 'checkbox',
2572   },
2573
2574   {
2575     'key'         => 'svc_acct-usage_suspend',
2576     'section'     => 'billing',
2577     '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.',
2578     'type'        => 'checkbox',
2579   },
2580
2581   {
2582     'key'         => 'svc_acct-usage_unsuspend',
2583     'section'     => 'billing',
2584     '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.',
2585     'type'        => 'checkbox',
2586   },
2587
2588   {
2589     'key'         => 'svc_acct-usage_threshold',
2590     'section'     => 'billing',
2591     '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.',
2592     'type'        => 'text',
2593   },
2594
2595   {
2596     'key'         => 'overlimit_groups',
2597     'section'     => '',
2598     'description' => 'RADIUS group (or comma-separated groups) to assign to svc_acct which has exceeded its bandwidth or time limit.',
2599     'type'        => 'text',
2600     'per_agent'   => 1,
2601   },
2602
2603   {
2604     'key'         => 'cust-fields',
2605     'section'     => 'UI',
2606     'description' => 'Which customer fields to display on reports by default',
2607     'type'        => 'select',
2608     'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
2609   },
2610
2611   {
2612     'key'         => 'cust_pkg-display_times',
2613     'section'     => 'UI',
2614     'description' => 'Display full timestamps (not just dates) for customer packages.  Useful if you are doing real-time things like hourly prepaid.',
2615     'type'        => 'checkbox',
2616   },
2617
2618   {
2619     'key'         => 'cust_pkg-always_show_location',
2620     'section'     => 'UI',
2621     'description' => "Always display package locations, even when they're all the default service address.",
2622     'type'        => 'checkbox',
2623   },
2624
2625   {
2626     'key'         => 'cust_pkg-show_fcc_voice_grade_equivalent',
2627     'section'     => 'UI',
2628     'description' => "Show a field on package definitions for assigning a DSO equivalency number suitable for use on FCC form 477.",
2629     'type'        => 'checkbox',
2630   },
2631
2632   {
2633     'key'         => 'svc_acct-edit_uid',
2634     'section'     => 'shell',
2635     'description' => 'Allow UID editing.',
2636     'type'        => 'checkbox',
2637   },
2638
2639   {
2640     'key'         => 'svc_acct-edit_gid',
2641     'section'     => 'shell',
2642     'description' => 'Allow GID editing.',
2643     'type'        => 'checkbox',
2644   },
2645
2646   {
2647     'key'         => 'zone-underscore',
2648     'section'     => 'BIND',
2649     'description' => 'Allow underscores in zone names.  As underscores are illegal characters in zone names, this option is not recommended.',
2650     'type'        => 'checkbox',
2651   },
2652
2653   {
2654     'key'         => 'echeck-nonus',
2655     'section'     => 'billing',
2656     'description' => 'Disable ABA-format account checking for Electronic Check payment info',
2657     'type'        => 'checkbox',
2658   },
2659
2660   {
2661     'key'         => 'voip-cust_cdr_spools',
2662     'section'     => '',
2663     'description' => 'Enable the per-customer option for individual CDR spools.',
2664     'type'        => 'checkbox',
2665   },
2666
2667   {
2668     'key'         => 'voip-cust_cdr_squelch',
2669     'section'     => '',
2670     'description' => 'Enable the per-customer option for not printing CDR on invoices.',
2671     'type'        => 'checkbox',
2672   },
2673
2674   {
2675     'key'         => 'voip-cdr_email',
2676     'section'     => '',
2677     'description' => 'Include the call details on emailed invoices even if the customer is configured for not printing them on the invoices.',
2678     'type'        => 'checkbox',
2679   },
2680
2681   {
2682     'key'         => 'voip-cust_email_csv_cdr',
2683     'section'     => '',
2684     'description' => 'Enable the per-customer option for including CDR information as a CSV attachment on emailed invoices.',
2685     'type'        => 'checkbox',
2686   },
2687
2688   {
2689     'key'         => 'cgp_rule-domain_templates',
2690     'section'     => '',
2691     'description' => 'Communigate Pro rule templates for domains, one per line, "svcnum Name"',
2692     'type'        => 'textarea',
2693   },
2694
2695   {
2696     'key'         => 'svc_forward-no_srcsvc',
2697     'section'     => '',
2698     'description' => "Don't allow forwards from existing accounts, only arbitrary addresses.  Useful when exporting to systems such as Communigate Pro which treat forwards in this fashion.",
2699     'type'        => 'checkbox',
2700   },
2701
2702   {
2703     'key'         => 'svc_forward-arbitrary_dst',
2704     'section'     => '',
2705     '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.",
2706     'type'        => 'checkbox',
2707   },
2708
2709   {
2710     'key'         => 'tax-ship_address',
2711     'section'     => 'billing',
2712     'description' => 'By default, tax calculations are done based on the billing address.  Enable this switch to calculate tax based on the shipping address instead.',
2713     'type'        => 'checkbox',
2714   }
2715 ,
2716   {
2717     'key'         => 'tax-pkg_address',
2718     'section'     => 'billing',
2719     '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.',
2720     'type'        => 'checkbox',
2721   },
2722
2723   {
2724     'key'         => 'invoice-ship_address',
2725     'section'     => 'invoicing',
2726     'description' => 'Include the shipping address on invoices.',
2727     'type'        => 'checkbox',
2728   },
2729
2730   {
2731     'key'         => 'invoice-unitprice',
2732     'section'     => 'invoicing',
2733     'description' => 'Enable unit pricing on invoices.',
2734     'type'        => 'checkbox',
2735   },
2736
2737   {
2738     'key'         => 'invoice-smallernotes',
2739     'section'     => 'invoicing',
2740     'description' => 'Display the notes section in a smaller font on invoices.',
2741     'type'        => 'checkbox',
2742   },
2743
2744   {
2745     'key'         => 'invoice-smallerfooter',
2746     'section'     => 'invoicing',
2747     'description' => 'Display footers in a smaller font on invoices.',
2748     'type'        => 'checkbox',
2749   },
2750
2751   {
2752     'key'         => 'postal_invoice-fee_pkgpart',
2753     'section'     => 'billing',
2754     'description' => 'This allows selection of a package to insert on invoices for customers with postal invoices selected.',
2755     'type'        => 'select-part_pkg',
2756   },
2757
2758   {
2759     'key'         => 'postal_invoice-recurring_only',
2760     'section'     => 'billing',
2761     'description' => 'The postal invoice fee is omitted on invoices without reucrring charges when this is set.',
2762     'type'        => 'checkbox',
2763   },
2764
2765   {
2766     'key'         => 'batch-enable',
2767     'section'     => 'deprecated', #make sure batch-enable_payby is set for
2768                                    #everyone before removing
2769     'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
2770     'type'        => 'checkbox',
2771   },
2772
2773   {
2774     'key'         => 'batch-enable_payby',
2775     'section'     => 'billing',
2776     'description' => 'Enable batch processing for the specified payment types.',
2777     'type'        => 'selectmultiple',
2778     'select_enum' => [qw( CARD CHEK )],
2779   },
2780
2781   {
2782     'key'         => 'realtime-disable_payby',
2783     'section'     => 'billing',
2784     'description' => 'Disable realtime processing for the specified payment types.',
2785     'type'        => 'selectmultiple',
2786     'select_enum' => [qw( CARD CHEK )],
2787   },
2788
2789   {
2790     'key'         => 'batch-default_format',
2791     'section'     => 'billing',
2792     'description' => 'Default format for batches.',
2793     'type'        => 'select',
2794     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch',
2795                        'csv-chase_canada-E-xactBatch', 'BoM', 'PAP',
2796                        'paymentech', 'ach-spiritone', 'RBC'
2797                     ]
2798   },
2799
2800   #lists could be auto-generated from pay_batch info
2801   {
2802     'key'         => 'batch-fixed_format-CARD',
2803     'section'     => 'billing',
2804     'description' => 'Fixed (unchangeable) format for credit card batches.',
2805     'type'        => 'select',
2806     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
2807                        'csv-chase_canada-E-xactBatch', 'paymentech' ]
2808   },
2809
2810   {
2811     'key'         => 'batch-fixed_format-CHEK',
2812     'section'     => 'billing',
2813     'description' => 'Fixed (unchangeable) format for electronic check batches.',
2814     'type'        => 'select',
2815     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP',
2816                        'paymentech', 'ach-spiritone', 'RBC'
2817                      ]
2818   },
2819
2820   {
2821     'key'         => 'batch-increment_expiration',
2822     'section'     => 'billing',
2823     'description' => 'Increment expiration date years in batches until cards are current.  Make sure this is acceptable to your batching provider before enabling.',
2824     'type'        => 'checkbox'
2825   },
2826
2827   {
2828     'key'         => 'batchconfig-BoM',
2829     'section'     => 'billing',
2830     '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',
2831     'type'        => 'textarea',
2832   },
2833
2834   {
2835     'key'         => 'batchconfig-PAP',
2836     'section'     => 'billing',
2837     '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',
2838     'type'        => 'textarea',
2839   },
2840
2841   {
2842     'key'         => 'batchconfig-csv-chase_canada-E-xactBatch',
2843     'section'     => 'billing',
2844     'description' => 'Gateway ID for Chase Canada E-xact batching',
2845     'type'        => 'text',
2846   },
2847
2848   {
2849     'key'         => 'batchconfig-paymentech',
2850     'section'     => 'billing',
2851     'description' => 'Configuration for Chase Paymentech batching, five lines: 1. BIN, 2. Terminal ID, 3. Merchant ID, 4. Username, 5. Password (for batch uploads)',
2852     'type'        => 'textarea',
2853   },
2854
2855   {
2856     'key'         => 'batchconfig-RBC',
2857     'section'     => 'billing',
2858     'description' => 'Configuration for Royal Bank of Canada PDS batching, four lines: 1. Client number, 2. Short name, 3. Long name, 4. Transaction code.',
2859     'type'        => 'textarea',
2860   },
2861
2862   {
2863     'key'         => 'payment_history-years',
2864     'section'     => 'UI',
2865     'description' => 'Number of years of payment history to show by default.  Currently defaults to 2.',
2866     'type'        => 'text',
2867   },
2868
2869   {
2870     'key'         => 'change_history-years',
2871     'section'     => 'UI',
2872     'description' => 'Number of years of change history to show by default.  Currently defaults to 0.5.',
2873     'type'        => 'text',
2874   },
2875
2876   {
2877     'key'         => 'cust_main-packages-years',
2878     'section'     => 'UI',
2879     'description' => 'Number of years to show old (cancelled and one-time charge) packages by default.  Currently defaults to 2.',
2880     'type'        => 'text',
2881   },
2882
2883   {
2884     'key'         => 'cust_main-use_comments',
2885     'section'     => 'UI',
2886     'description' => 'Display free form comments on the customer edit screen.  Useful as a scratch pad.',
2887     'type'        => 'checkbox',
2888   },
2889
2890   {
2891     'key'         => 'cust_main-disable_notes',
2892     'section'     => 'UI',
2893     'description' => 'Disable new style customer notes - timestamped and user identified customer notes.  Useful in tracking who did what.',
2894     'type'        => 'checkbox',
2895   },
2896
2897   {
2898     'key'         => 'cust_main_note-display_times',
2899     'section'     => 'UI',
2900     'description' => 'Display full timestamps (not just dates) for customer notes.',
2901     'type'        => 'checkbox',
2902   },
2903
2904   {
2905     'key'         => 'cust_main-ticket_statuses',
2906     'section'     => 'UI',
2907     'description' => 'Show tickets with these statuses on the customer view page.',
2908     'type'        => 'selectmultiple',
2909     'select_enum' => [qw( new open stalled resolved rejected deleted )],
2910   },
2911
2912   {
2913     'key'         => 'cust_main-max_tickets',
2914     'section'     => 'UI',
2915     'description' => 'Maximum number of tickets to show on the customer view page.',
2916     'type'        => 'text',
2917   },
2918
2919   {
2920     'key'         => 'cust_main-skeleton_tables',
2921     'section'     => '',
2922     '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.',
2923     'type'        => 'textarea',
2924   },
2925
2926   {
2927     'key'         => 'cust_main-skeleton_custnum',
2928     'section'     => '',
2929     'description' => 'Customer number specifying the source data to copy into skeleton tables for new customers.',
2930     'type'        => 'text',
2931   },
2932
2933   {
2934     'key'         => 'cust_main-enable_birthdate',
2935     'section'     => 'UI',
2936     'descritpion' => 'Enable tracking of a birth date with each customer record',
2937     'type'        => 'checkbox',
2938   },
2939
2940   {
2941     'key'         => 'support-key',
2942     'section'     => '',
2943     '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.',
2944     'type'        => 'text',
2945   },
2946
2947   {
2948     'key'         => 'card-types',
2949     'section'     => 'billing',
2950     'description' => 'Select one or more card types to enable only those card types.  If no card types are selected, all card types are available.',
2951     'type'        => 'selectmultiple',
2952     'select_enum' => \@card_types,
2953   },
2954
2955   {
2956     'key'         => 'disable-fuzzy',
2957     'section'     => 'UI',
2958     'description' => 'Disable fuzzy searching.  Speeds up searching for large sites, but only shows exact matches.',
2959     'type'        => 'checkbox',
2960   },
2961
2962   { 'key'         => 'pkg_referral',
2963     'section'     => '',
2964     'description' => 'Enable package-specific advertising sources.',
2965     'type'        => 'checkbox',
2966   },
2967
2968   { 'key'         => 'pkg_referral-multiple',
2969     'section'     => '',
2970     'description' => 'In addition, allow multiple advertising sources to be associated with a single package.',
2971     'type'        => 'checkbox',
2972   },
2973
2974   {
2975     'key'         => 'dashboard-install_welcome',
2976     'section'     => 'UI',
2977     'description' => 'New install welcome screen.',
2978     'type'        => 'select',
2979     'select_enum' => [ '', 'ITSP_fsinc_hosted', ],
2980   },
2981
2982   {
2983     'key'         => 'dashboard-toplist',
2984     'section'     => 'UI',
2985     'description' => 'List of items to display on the top of the front page',
2986     'type'        => 'textarea',
2987   },
2988
2989   {
2990     'key'         => 'impending_recur_msgnum',
2991     'section'     => 'notification',
2992     'description' => 'Template to use for alerts about first-time recurring billing.',
2993     %msg_template_options,
2994   },
2995
2996   {
2997     'key'         => 'impending_recur_template',
2998     'section'     => 'deprecated',
2999     '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>',
3000 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
3001     'type'        => 'textarea',
3002   },
3003
3004   {
3005     'key'         => 'logo.png',
3006     'section'     => 'UI',  #'invoicing' ?
3007     'description' => 'Company logo for HTML invoices and the backoffice interface, in PNG format.  Suggested size somewhere near 92x62.',
3008     'type'        => 'image',
3009     'per_agent'   => 1, #XXX just view/logo.cgi, which is for the global
3010                         #old-style editor anyway...?
3011   },
3012
3013   {
3014     'key'         => 'logo.eps',
3015     'section'     => 'invoicing',
3016     'description' => 'Company logo for printed and PDF invoices, in EPS format.',
3017     'type'        => 'image',
3018     'per_agent'   => 1, #XXX as above, kinda
3019   },
3020
3021   {
3022     'key'         => 'selfservice-ignore_quantity',
3023     'section'     => 'self-service',
3024     'description' => 'Ignores service quantity restrictions in self-service context.  Strongly not recommended - just set your quantities correctly in the first place.',
3025     'type'        => 'checkbox',
3026   },
3027
3028   {
3029     'key'         => 'selfservice-session_timeout',
3030     'section'     => 'self-service',
3031     'description' => 'Self-service session timeout.  Defaults to 1 hour.',
3032     'type'        => 'select',
3033     'select_enum' => [ '1 hour', '2 hours', '4 hours', '8 hours', '1 day', '1 week', ],
3034   },
3035
3036   {
3037     'key'         => 'disable_setup_suspended_pkgs',
3038     'section'     => 'billing',
3039     'description' => 'Disables charging of setup fees for suspended packages.',
3040     'type'        => 'checkbox',
3041   },
3042
3043   {
3044     'key'         => 'password-generated-allcaps',
3045     'section'     => 'password',
3046     'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
3047     'type'        => 'checkbox',
3048   },
3049
3050   {
3051     'key'         => 'datavolume-forcemegabytes',
3052     'section'     => 'UI',
3053     'description' => 'All data volumes are expressed in megabytes',
3054     'type'        => 'checkbox',
3055   },
3056
3057   {
3058     'key'         => 'datavolume-significantdigits',
3059     'section'     => 'UI',
3060     'description' => 'number of significant digits to use to represent data volumes',
3061     'type'        => 'text',
3062   },
3063
3064   {
3065     'key'         => 'disable_void_after',
3066     'section'     => 'billing',
3067     'description' => 'Number of seconds after which freeside won\'t attempt to VOID a payment first when performing a refund.',
3068     'type'        => 'text',
3069   },
3070
3071   {
3072     'key'         => 'disable_line_item_date_ranges',
3073     'section'     => 'billing',
3074     'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.',
3075     'type'        => 'checkbox',
3076   },
3077
3078   {
3079     'key'         => 'support_packages',
3080     'section'     => '',
3081     '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...
3082     'type'        => 'select-part_pkg',
3083     'multiple'    => 1,
3084   },
3085
3086   {
3087     'key'         => 'cust_main-require_phone',
3088     'section'     => '',
3089     'description' => 'Require daytime or night phone for all customer records.',
3090     'type'        => 'checkbox',
3091   },
3092
3093   {
3094     'key'         => 'cust_main-require_invoicing_list_email',
3095     'section'     => '',
3096     'description' => 'Email address field is required: require at least one invoicing email address for all customer records.',
3097     'type'        => 'checkbox',
3098   },
3099
3100   {
3101     'key'         => 'svc_acct-display_paid_time_remaining',
3102     'section'     => '',
3103     'description' => 'Show paid time remaining in addition to time remaining.',
3104     'type'        => 'checkbox',
3105   },
3106
3107   {
3108     'key'         => 'cancel_credit_type',
3109     'section'     => 'billing',
3110     'description' => 'The group to use for new, automatically generated credit reasons resulting from cancellation.',
3111     'type'        => 'select-sub',
3112     'options_sub' => sub { require FS::Record;
3113                            require FS::reason_type;
3114                            map { $_->typenum => $_->type }
3115                                FS::Record::qsearch('reason_type', { class=>'R' } );
3116                          },
3117     'option_sub'  => sub { require FS::Record;
3118                            require FS::reason_type;
3119                            my $reason_type = FS::Record::qsearchs(
3120                              'reason_type', { 'typenum' => shift }
3121                            );
3122                            $reason_type ? $reason_type->type : '';
3123                          },
3124   },
3125
3126   {
3127     'key'         => 'referral_credit_type',
3128     'section'     => 'deprecated',
3129     '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.',
3130     'type'        => 'select-sub',
3131     'options_sub' => sub { require FS::Record;
3132                            require FS::reason_type;
3133                            map { $_->typenum => $_->type }
3134                                FS::Record::qsearch('reason_type', { class=>'R' } );
3135                          },
3136     'option_sub'  => sub { require FS::Record;
3137                            require FS::reason_type;
3138                            my $reason_type = FS::Record::qsearchs(
3139                              'reason_type', { 'typenum' => shift }
3140                            );
3141                            $reason_type ? $reason_type->type : '';
3142                          },
3143   },
3144
3145   {
3146     'key'         => 'signup_credit_type',
3147     'section'     => 'billing', #self-service?
3148     'description' => 'The group to use for new, automatically generated credit reasons resulting from signup and self-service declines.',
3149     'type'        => 'select-sub',
3150     'options_sub' => sub { require FS::Record;
3151                            require FS::reason_type;
3152                            map { $_->typenum => $_->type }
3153                                FS::Record::qsearch('reason_type', { class=>'R' } );
3154                          },
3155     'option_sub'  => sub { require FS::Record;
3156                            require FS::reason_type;
3157                            my $reason_type = FS::Record::qsearchs(
3158                              'reason_type', { 'typenum' => shift }
3159                            );
3160                            $reason_type ? $reason_type->type : '';
3161                          },
3162   },
3163
3164   {
3165     'key'         => 'prepayment_discounts-credit_type',
3166     'section'     => 'billing',
3167     'description' => 'Enables the offering of prepayment discounts and establishes the credit reason type.',
3168     'type'        => 'select-sub',
3169     'options_sub' => sub { require FS::Record;
3170                            require FS::reason_type;
3171                            map { $_->typenum => $_->type }
3172                                FS::Record::qsearch('reason_type', { class=>'R' } );
3173                          },
3174     'option_sub'  => sub { require FS::Record;
3175                            require FS::reason_type;
3176                            my $reason_type = FS::Record::qsearchs(
3177                              'reason_type', { 'typenum' => shift }
3178                            );
3179                            $reason_type ? $reason_type->type : '';
3180                          },
3181
3182   },
3183
3184   {
3185     'key'         => 'cust_main-agent_custid-format',
3186     'section'     => '',
3187     'description' => 'Enables searching of various formatted values in cust_main.agent_custid',
3188     'type'        => 'select',
3189     'select_hash' => [
3190                        ''      => 'Numeric only',
3191                        'ww?d+' => 'Numeric with one or two letter prefix',
3192                      ],
3193   },
3194
3195   {
3196     'key'         => 'card_masking_method',
3197     'section'     => 'UI',
3198     '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.',
3199     'type'        => 'select',
3200     'select_hash' => [
3201                        ''            => '123456xxxxxx1234',
3202                        'first6last2' => '123456xxxxxxxx12',
3203                        'first4last4' => '1234xxxxxxxx1234',
3204                        'first4last2' => '1234xxxxxxxxxx12',
3205                        'first2last4' => '12xxxxxxxxxx1234',
3206                        'first2last2' => '12xxxxxxxxxxxx12',
3207                        'first0last4' => 'xxxxxxxxxxxx1234',
3208                        'first0last2' => 'xxxxxxxxxxxxxx12',
3209                      ],
3210   },
3211
3212   {
3213     'key'         => 'disable_previous_balance',
3214     'section'     => 'invoicing',
3215     'description' => 'Disable inclusion of previous balance, payment, and credit lines on invoices',
3216     'type'        => 'checkbox',
3217   },
3218
3219   {
3220     'key'         => 'previous_balance-exclude_from_total',
3221     'section'     => 'invoicing',
3222     'description' => 'Do not include previous balance in the \'Total\' line.  Only meaningful when invoice_sections is false.  Optionally provide text to override the Total New Charges description',
3223     'type'        => [ qw(checkbox text) ],
3224   },
3225
3226   {
3227     'key'         => 'previous_balance-summary_only',
3228     'section'     => 'invoicing',
3229     'description' => 'Only show a single line summarizing the total previous balance rather than one line per invoice.',
3230     'type'        => 'checkbox',
3231   },
3232
3233   {
3234     'key'         => 'balance_due_below_line',
3235     'section'     => 'invoicing',
3236     'description' => 'Place the balance due message below a line.  Only meaningful when when invoice_sections is false.',
3237     'type'        => 'checkbox',
3238   },
3239
3240   {
3241     'key'         => 'usps_webtools-userid',
3242     'section'     => 'UI',
3243     '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.',
3244     'type'        => 'text',
3245   },
3246
3247   {
3248     'key'         => 'usps_webtools-password',
3249     'section'     => 'UI',
3250     '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.',
3251     'type'        => 'text',
3252   },
3253
3254   {
3255     'key'         => 'cust_main-auto_standardize_address',
3256     'section'     => 'UI',
3257     'description' => 'When using USPS web tools, automatically standardize the address without asking.',
3258     'type'        => 'checkbox',
3259   },
3260
3261   {
3262     'key'         => 'cust_main-require_censustract',
3263     'section'     => 'UI',
3264     'description' => 'Customer is required to have a census tract.  Useful for FCC form 477 reports. See also: cust_main-auto_standardize_address',
3265     'type'        => 'checkbox',
3266   },
3267
3268   {
3269     'key'         => 'census_year',
3270     'section'     => 'UI',
3271     'description' => 'The year to use in census tract lookups',
3272     'type'        => 'select',
3273     'select_enum' => [ qw( 2010 2009 2008 ) ],
3274   },
3275
3276   {
3277     'key'         => 'company_latitude',
3278     'section'     => 'UI',
3279     'description' => 'Your company latitude (-90 through 90)',
3280     'type'        => 'text',
3281   },
3282
3283   {
3284     'key'         => 'company_longitude',
3285     'section'     => 'UI',
3286     'description' => 'Your company longitude (-180 thru 180)',
3287     'type'        => 'text',
3288   },
3289
3290   {
3291     'key'         => 'disable_acl_changes',
3292     'section'     => '',
3293     'description' => 'Disable all ACL changes, for demos.',
3294     'type'        => 'checkbox',
3295   },
3296
3297   {
3298     'key'         => 'disable_settings_changes',
3299     'section'     => '',
3300     'description' => 'Disable all settings changes, for demos, except for the usernames given in the comma-separated list.',
3301     'type'        => [qw( checkbox text )],
3302   },
3303
3304   {
3305     'key'         => 'cust_main-edit_agent_custid',
3306     'section'     => 'UI',
3307     'description' => 'Enable editing of the agent_custid field.',
3308     'type'        => 'checkbox',
3309   },
3310
3311   {
3312     'key'         => 'cust_main-default_agent_custid',
3313     'section'     => 'UI',
3314     'description' => 'Display the agent_custid field when available instead of the custnum field.',
3315     'type'        => 'checkbox',
3316   },
3317
3318   {
3319     'key'         => 'cust_main-title-display_custnum',
3320     'section'     => 'UI',
3321     'description' => 'Add the display_custom (agent_custid or custnum) to the title on customer view pages.',
3322     'type'        => 'checkbox',
3323   },
3324
3325   {
3326     'key'         => 'cust_bill-default_agent_invid',
3327     'section'     => 'UI',
3328     'description' => 'Display the agent_invid field when available instead of the invnum field.',
3329     'type'        => 'checkbox',
3330   },
3331
3332   {
3333     'key'         => 'cust_main-auto_agent_custid',
3334     'section'     => 'UI',
3335     'description' => 'Automatically assign an agent_custid - select format',
3336     'type'        => 'select',
3337     'select_hash' => [ '' => 'No',
3338                        '1YMMXXXXXXXX' => '1YMMXXXXXXXX',
3339                      ],
3340   },
3341
3342   {
3343     'key'         => 'cust_main-default_areacode',
3344     'section'     => 'UI',
3345     'description' => 'Default area code for customers.',
3346     'type'        => 'text',
3347   },
3348
3349   {
3350     'key'         => 'order_pkg-no_start_date',
3351     'section'     => 'UI',
3352     'description' => 'Don\'t set a default start date for new packages.',
3353     'type'        => 'checkbox',
3354   },
3355
3356   {
3357     'key'         => 'mcp_svcpart',
3358     'section'     => '',
3359     'description' => 'Master Control Program svcpart.  Leave this blank.',
3360     'type'        => 'text', #select-part_svc
3361   },
3362
3363   {
3364     'key'         => 'cust_bill-max_same_services',
3365     'section'     => 'invoicing',
3366     '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.',
3367     'type'        => 'text',
3368   },
3369
3370   {
3371     'key'         => 'cust_bill-consolidate_services',
3372     'section'     => 'invoicing',
3373     'description' => 'Consolidate service display into fewer lines on invoices rather than one per service.',
3374     'type'        => 'checkbox',
3375   },
3376
3377   {
3378     'key'         => 'suspend_email_admin',
3379     'section'     => '',
3380     'description' => 'Destination admin email address to enable suspension notices',
3381     'type'        => 'text',
3382   },
3383
3384   {
3385     'key'         => 'email_report-subject',
3386     'section'     => '',
3387     'description' => 'Subject for reports emailed by freeside-fetch.  Defaults to "Freeside report".',
3388     'type'        => 'text',
3389   },
3390
3391   {
3392     'key'         => 'selfservice-head',
3393     'section'     => 'self-service',
3394     'description' => 'HTML for the HEAD section of the self-service interface, typically used for LINK stylesheet tags',
3395     'type'        => 'textarea', #htmlarea?
3396     'per_agent'   => 1,
3397   },
3398
3399
3400   {
3401     'key'         => 'selfservice-body_header',
3402     'section'     => 'self-service',
3403     'description' => 'HTML header for the self-service interface',
3404     'type'        => 'textarea', #htmlarea?
3405     'per_agent'   => 1,
3406   },
3407
3408   {
3409     'key'         => 'selfservice-body_footer',
3410     'section'     => 'self-service',
3411     'description' => 'HTML footer for the self-service interface',
3412     'type'        => 'textarea', #htmlarea?
3413     'per_agent'   => 1,
3414   },
3415
3416
3417   {
3418     'key'         => 'selfservice-body_bgcolor',
3419     'section'     => 'self-service',
3420     'description' => 'HTML background color for the self-service interface, for example, #FFFFFF',
3421     'type'        => 'text',
3422     'per_agent'   => 1,
3423   },
3424
3425   {
3426     'key'         => 'selfservice-box_bgcolor',
3427     'section'     => 'self-service',
3428     'description' => 'HTML color for self-service interface input boxes, for example, #C0C0C0',
3429     'type'        => 'text',
3430     'per_agent'   => 1,
3431   },
3432
3433   {
3434     'key'         => 'selfservice-text_color',
3435     'section'     => 'self-service',
3436     'description' => 'HTML text color for the self-service interface, for example, #000000',
3437     'type'        => 'text',
3438     'per_agent'   => 1,
3439   },
3440
3441   {
3442     'key'         => 'selfservice-link_color',
3443     'section'     => 'self-service',
3444     'description' => 'HTML link color for the self-service interface, for example, #0000FF',
3445     'type'        => 'text',
3446     'per_agent'   => 1,
3447   },
3448
3449   {
3450     'key'         => 'selfservice-vlink_color',
3451     'section'     => 'self-service',
3452     'description' => 'HTML visited link color for the self-service interface, for example, #FF00FF',
3453     'type'        => 'text',
3454     'per_agent'   => 1,
3455   },
3456
3457   {
3458     'key'         => 'selfservice-hlink_color',
3459     'section'     => 'self-service',
3460     'description' => 'HTML hover link color for the self-service interface, for example, #808080',
3461     'type'        => 'text',
3462     'per_agent'   => 1,
3463   },
3464
3465   {
3466     'key'         => 'selfservice-alink_color',
3467     'section'     => 'self-service',
3468     'description' => 'HTML active (clicked) link color for the self-service interface, for example, #808080',
3469     'type'        => 'text',
3470     'per_agent'   => 1,
3471   },
3472
3473   {
3474     'key'         => 'selfservice-font',
3475     'section'     => 'self-service',
3476     'description' => 'HTML font CSS for the self-service interface, for example, 0.9em/1.5em Arial, Helvetica, Geneva, sans-serif',
3477     'type'        => 'text',
3478     'per_agent'   => 1,
3479   },
3480
3481   {
3482     'key'         => 'selfservice-title_color',
3483     'section'     => 'self-service',
3484     'description' => 'HTML color for the self-service title, for example, #000000',
3485     'type'        => 'text',
3486     'per_agent'   => 1,
3487   },
3488
3489   {
3490     'key'         => 'selfservice-title_align',
3491     'section'     => 'self-service',
3492     'description' => 'HTML alignment for the self-service title, for example, center',
3493     'type'        => 'text',
3494     'per_agent'   => 1,
3495   },
3496   {
3497     'key'         => 'selfservice-title_size',
3498     'section'     => 'self-service',
3499     'description' => 'HTML font size for the self-service title, for example, 3',
3500     'type'        => 'text',
3501     'per_agent'   => 1,
3502   },
3503
3504   {
3505     'key'         => 'selfservice-title_left_image',
3506     'section'     => 'self-service',
3507     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
3508     'type'        => 'image',
3509     'per_agent'   => 1,
3510   },
3511
3512   {
3513     'key'         => 'selfservice-title_right_image',
3514     'section'     => 'self-service',
3515     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
3516     'type'        => 'image',
3517     'per_agent'   => 1,
3518   },
3519
3520   {
3521     'key'         => 'selfservice-menu_skipblanks',
3522     'section'     => 'self-service',
3523     'description' => 'Skip blank (spacer) entries in the self-service menu',
3524     'type'        => 'checkbox',
3525     'per_agent'   => 1,
3526   },
3527
3528   {
3529     'key'         => 'selfservice-menu_skipheadings',
3530     'section'     => 'self-service',
3531     'description' => 'Skip the unclickable heading entries in the self-service menu',
3532     'type'        => 'checkbox',
3533     'per_agent'   => 1,
3534   },
3535
3536   {
3537     'key'         => 'selfservice-menu_bgcolor',
3538     'section'     => 'self-service',
3539     'description' => 'HTML color for the self-service menu, for example, #C0C0C0',
3540     'type'        => 'text',
3541     'per_agent'   => 1,
3542   },
3543
3544   {
3545     'key'         => 'selfservice-menu_fontsize',
3546     'section'     => 'self-service',
3547     'description' => 'HTML font size for the self-service menu, for example, -1',
3548     'type'        => 'text',
3549     'per_agent'   => 1,
3550   },
3551   {
3552     'key'         => 'selfservice-menu_nounderline',
3553     'section'     => 'self-service',
3554     'description' => 'Styles menu links in the self-service without underlining.',
3555     'type'        => 'checkbox',
3556     'per_agent'   => 1,
3557   },
3558
3559
3560   {
3561     'key'         => 'selfservice-menu_top_image',
3562     'section'     => 'self-service',
3563     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
3564     'type'        => 'image',
3565     'per_agent'   => 1,
3566   },
3567
3568   {
3569     'key'         => 'selfservice-menu_body_image',
3570     'section'     => 'self-service',
3571     'description' => 'Repeating image used for the body of the menu in the self-service interface, in PNG format.',
3572     'type'        => 'image',
3573     'per_agent'   => 1,
3574   },
3575
3576   {
3577     'key'         => 'selfservice-menu_bottom_image',
3578     'section'     => 'self-service',
3579     'description' => 'Image used for the bottom of the menu in the self-service interface, in PNG format.',
3580     'type'        => 'image',
3581     'per_agent'   => 1,
3582   },
3583
3584   {
3585     'key'         => 'selfservice-bulk_format',
3586     'section'     => 'deprecated',
3587     'description' => 'Parameter arrangement for selfservice bulk features',
3588     'type'        => 'select',
3589     'select_enum' => [ '', 'izoom-soap', 'izoom-ftp' ],
3590     'per_agent'   => 1,
3591   },
3592
3593   {
3594     'key'         => 'selfservice-bulk_ftp_dir',
3595     'section'     => 'deprecated',
3596     'description' => 'Enable bulk ftp provisioning in this folder',
3597     'type'        => 'text',
3598     'per_agent'   => 1,
3599   },
3600
3601   {
3602     'key'         => 'signup-no_company',
3603     'section'     => 'self-service',
3604     'description' => "Don't display a field for company name on signup.",
3605     'type'        => 'checkbox',
3606   },
3607
3608   {
3609     'key'         => 'signup-recommend_email',
3610     'section'     => 'self-service',
3611     'description' => 'Encourage the entry of an invoicing email address on signup.',
3612     'type'        => 'checkbox',
3613   },
3614
3615   {
3616     'key'         => 'signup-recommend_daytime',
3617     'section'     => 'self-service',
3618     'description' => 'Encourage the entry of a daytime phone number  invoicing email address on signup.',
3619     'type'        => 'checkbox',
3620   },
3621
3622   {
3623     'key'         => 'svc_phone-radius-default_password',
3624     'section'     => '',
3625     'description' => 'Default password when exporting svc_phone records to RADIUS',
3626     'type'        => 'text',
3627   },
3628
3629   {
3630     'key'         => 'svc_phone-allow_alpha_phonenum',
3631     'section'     => '',
3632     'description' => 'Allow letters in phone numbers.',
3633     'type'        => 'checkbox',
3634   },
3635
3636   {
3637     'key'         => 'svc_phone-domain',
3638     'section'     => '',
3639     'description' => 'Track an optional domain association with each phone service.',
3640     'type'        => 'checkbox',
3641   },
3642
3643   {
3644     'key'         => 'svc_phone-phone_name-max_length',
3645     'section'     => '',
3646     'description' => 'Maximum length of the phone service "Name" field (svc_phone.phone_name).  Sometimes useful to limit this (to 15?) when exporting as Caller ID data.',
3647     'type'        => 'text',
3648   },
3649
3650   {
3651     'key'         => 'default_phone_countrycode',
3652     'section'     => '',
3653     'description' => 'Default countrcode',
3654     'type'        => 'text',
3655   },
3656
3657   {
3658     'key'         => 'cdr-charged_party-field',
3659     'section'     => '',
3660     'description' => 'Set the charged_party field of CDRs to this field.',
3661     'type'        => 'select-sub',
3662     'options_sub' => sub { my $fields = FS::cdr->table_info->{'fields'};
3663                            map { $_ => $fields->{$_}||$_ }
3664                            grep { $_ !~ /^(acctid|charged_party)$/ }
3665                            FS::Schema::dbdef->table('cdr')->columns;
3666                          },
3667     'option_sub'  => sub { my $f = shift;
3668                            FS::cdr->table_info->{'fields'}{$f} || $f;
3669                          },
3670   },
3671
3672   #probably deprecate in favor of cdr-charged_party-field above
3673   {
3674     'key'         => 'cdr-charged_party-accountcode',
3675     'section'     => '',
3676     'description' => 'Set the charged_party field of CDRs to the accountcode.',
3677     'type'        => 'checkbox',
3678   },
3679
3680   {
3681     'key'         => 'cdr-charged_party-accountcode-trim_leading_0s',
3682     'section'     => '',
3683     'description' => 'When setting the charged_party field of CDRs to the accountcode, trim any leading zeros.',
3684     'type'        => 'checkbox',
3685   },
3686
3687 #  {
3688 #    'key'         => 'cdr-charged_party-truncate_prefix',
3689 #    'section'     => '',
3690 #    'description' => 'If the charged_party field has this prefix, truncate it to the length in cdr-charged_party-truncate_length.',
3691 #    'type'        => 'text',
3692 #  },
3693 #
3694 #  {
3695 #    'key'         => 'cdr-charged_party-truncate_length',
3696 #    'section'     => '',
3697 #    'description' => 'If the charged_party field has the prefix in cdr-charged_party-truncate_prefix, truncate it to this length.',
3698 #    'type'        => 'text',
3699 #  },
3700
3701   {
3702     'key'         => 'cdr-charged_party_rewrite',
3703     'section'     => '',
3704     '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*.',
3705     'type'        => 'checkbox',
3706   },
3707
3708   {
3709     'key'         => 'cdr-taqua-da_rewrite',
3710     'section'     => '',
3711     '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.',
3712     'type'        => 'text',
3713   },
3714
3715   {
3716     'key'         => 'cust_pkg-show_autosuspend',
3717     'section'     => 'UI',
3718     'description' => 'Show package auto-suspend dates.  Use with caution for now; can slow down customer view for large insallations.',
3719     'type'        => 'checkbox',
3720   },
3721
3722   {
3723     'key'         => 'cdr-asterisk_forward_rewrite',
3724     'section'     => '',
3725     '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").',
3726     'type'        => 'checkbox',
3727   },
3728
3729   {
3730     'key'         => 'sg-multicustomer_hack',
3731     'section'     => '',
3732     'description' => "Don't use this.",
3733     'type'        => 'checkbox',
3734   },
3735
3736   {
3737     'key'         => 'sg-ping_username',
3738     'section'     => '',
3739     'description' => "Don't use this.",
3740     'type'        => 'text',
3741   },
3742
3743   {
3744     'key'         => 'sg-ping_password',
3745     'section'     => '',
3746     'description' => "Don't use this.",
3747     'type'        => 'text',
3748   },
3749
3750   {
3751     'key'         => 'sg-login_username',
3752     'section'     => '',
3753     'description' => "Don't use this.",
3754     'type'        => 'text',
3755   },
3756
3757   {
3758     'key'         => 'mc-outbound_packages',
3759     'section'     => '',
3760     'description' => "Don't use this.",
3761     'type'        => 'select-part_pkg',
3762     'multiple'    => 1,
3763   },
3764
3765   {
3766     'key'         => 'disable-cust-pkg_class',
3767     'section'     => 'UI',
3768     'description' => 'Disable the two-step dropdown for selecting package class and package, and return to the classic single dropdown.',
3769     'type'        => 'checkbox',
3770   },
3771
3772   {
3773     'key'         => 'queued-max_kids',
3774     'section'     => '',
3775     'description' => 'Maximum number of queued processes.  Defaults to 10.',
3776     'type'        => 'text',
3777   },
3778
3779   {
3780     'key'         => 'queued-sleep_time',
3781     'section'     => '',
3782     'description' => 'Time to sleep between attempts to find new jobs to process in the queue.  Defaults to 10.  Installations doing real-time CDR processing for prepaid may want to set it lower.',
3783     'type'        => 'text',
3784   },
3785
3786   {
3787     'key'         => 'cancelled_cust-noevents',
3788     'section'     => 'billing',
3789     'description' => "Don't run events for cancelled customers",
3790     'type'        => 'checkbox',
3791   },
3792
3793   {
3794     'key'         => 'agent-invoice_template',
3795     'section'     => 'invoicing',
3796     'description' => 'Enable display/edit of old-style per-agent invoice template selection',
3797     'type'        => 'checkbox',
3798   },
3799
3800   {
3801     'key'         => 'svc_broadband-manage_link',
3802     'section'     => 'UI',
3803     'description' => 'URL for svc_broadband "Manage Device" link.  The following substitutions are available: $ip_addr.',
3804     'type'        => 'text',
3805   },
3806
3807   #more fine-grained, service def-level control could be useful eventually?
3808   {
3809     'key'         => 'svc_broadband-allow_null_ip_addr',
3810     'section'     => '',
3811     'description' => '',
3812     'type'        => 'checkbox',
3813   },
3814
3815   {
3816     'key'         => 'tax-report_groups',
3817     'section'     => '',
3818     'description' => 'List of grouping possibilities for tax names on reports, one per line, "label op value" (op can be = or !=).',
3819     'type'        => 'textarea',
3820   },
3821
3822   {
3823     'key'         => 'tax-cust_exempt-groups',
3824     'section'     => '',
3825     '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).',
3826     'type'        => 'textarea',
3827   },
3828
3829   {
3830     'key'         => 'cust_main-default_view',
3831     'section'     => 'UI',
3832     'description' => 'Default customer view, for users who have not selected a default view in their preferences.',
3833     'type'        => 'select',
3834     'select_hash' => [
3835       #false laziness w/view/cust_main.cgi and pref/pref.html
3836       'basics'          => 'Basics',
3837       'notes'           => 'Notes',
3838       'tickets'         => 'Tickets',
3839       'packages'        => 'Packages',
3840       'payment_history' => 'Payment History',
3841       'change_history'  => 'Change History',
3842       'jumbo'           => 'Jumbo',
3843     ],
3844   },
3845
3846   {
3847     'key'         => 'enable_tax_adjustments',
3848     'section'     => 'billing',
3849     'description' => 'Enable the ability to add manual tax adjustments.',
3850     'type'        => 'checkbox',
3851   },
3852
3853   {
3854     'key'         => 'rt-crontool',
3855     'section'     => '',
3856     'description' => 'Enable the RT CronTool extension.',
3857     'type'        => 'checkbox',
3858   },
3859
3860   {
3861     'key'         => 'pkg-balances',
3862     'section'     => 'billing',
3863     'description' => 'Enable experimental package balances.  Not recommended for general use.',
3864     'type'        => 'checkbox',
3865   },
3866
3867   {
3868     'key'         => 'pkg-addon_classnum',
3869     'section'     => 'billing',
3870     'description' => 'Enable the ability to restrict additional package orders based on package class.',
3871     'type'        => 'checkbox',
3872   },
3873
3874   {
3875     'key'         => 'cust_main-edit_signupdate',
3876     'section'     => 'UI',
3877     'descritpion' => 'Enable manual editing of the signup date.',
3878     'type'        => 'checkbox',
3879   },
3880
3881   {
3882     'key'         => 'svc_acct-disable_access_number',
3883     'section'     => 'UI',
3884     'descritpion' => 'Disable access number selection.',
3885     'type'        => 'checkbox',
3886   },
3887
3888   {
3889     'key'         => 'cust_bill_pay_pkg-manual',
3890     'section'     => 'UI',
3891     'description' => 'Allow manual application of payments to line items.',
3892     'type'        => 'checkbox',
3893   },
3894
3895   {
3896     'key'         => 'cust_credit_bill_pkg-manual',
3897     'section'     => 'UI',
3898     'description' => 'Allow manual application of credits to line items.',
3899     'type'        => 'checkbox',
3900   },
3901
3902   {
3903     'key'         => 'breakage-days',
3904     'section'     => 'billing',
3905     '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.',
3906     'type'        => 'text',
3907     'per_agent'   => 1,
3908   },
3909
3910   {
3911     'key'         => 'breakage-pkg_class',
3912     'section'     => 'billing',
3913     'description' => 'Package class to use for breakage reconciliation.',
3914     'type'        => 'select-pkg_class',
3915   },
3916
3917   {
3918     'key'         => 'disable_cron_billing',
3919     'section'     => 'billing',
3920     '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.',
3921     'type'        => 'checkbox',
3922   },
3923
3924   {
3925     'key'         => 'svc_domain-edit_domain',
3926     'section'     => '',
3927     'description' => 'Enable domain renaming',
3928     'type'        => 'checkbox',
3929   },
3930
3931   {
3932     'key'         => 'enable_legacy_prepaid_income',
3933     'section'     => '',
3934     'description' => "Enable legacy prepaid income reporting.  Only useful when you have imported pre-Freeside packages with longer-than-monthly duration, and need to do prepaid income reporting on them before they've been invoiced the first time.",
3935     'type'        => 'checkbox',
3936   },
3937
3938   {
3939     'key'         => 'cust_main-exports',
3940     'section'     => '',
3941     'description' => 'Export(s) to call on cust_main insert, modification and deletion.',
3942     'type'        => 'select-sub',
3943     'multiple'    => 1,
3944     'options_sub' => sub {
3945       require FS::Record;
3946       require FS::part_export;
3947       my @part_export =
3948         map { qsearch( 'part_export', {exporttype => $_ } ) }
3949           keys %{FS::part_export::export_info('cust_main')};
3950       map { $_->exportnum => $_->exporttype.' to '.$_->machine } @part_export;
3951     },
3952     'option_sub'  => sub {
3953       require FS::Record;
3954       require FS::part_export;
3955       my $part_export = FS::Record::qsearchs(
3956         'part_export', { 'exportnum' => shift }
3957       );
3958       $part_export
3959         ? $part_export->exporttype.' to '.$part_export->machine
3960         : '';
3961     },
3962   },
3963
3964   {
3965     'key'         => 'cust_tag-location',
3966     'section'     => 'UI',
3967     'description' => 'Location where customer tags are displayed.',
3968     'type'        => 'select',
3969     'select_enum' => [ 'misc_info', 'top' ],
3970   },
3971
3972   {
3973     'key'         => 'maestro-status_test',
3974     'section'     => 'UI',
3975     'description' => 'Display a link to the maestro status test page on the customer view page',
3976     'type'        => 'checkbox',
3977   },
3978
3979   {
3980     'key'         => 'cust_main-custom_link',
3981     'section'     => 'UI',
3982     'description' => 'URL to use as source for the "Custom" tab in the View Customer page.  The custnum will be appended.',
3983     'type'        => 'text',
3984   },
3985
3986   {
3987     'key'         => 'cust_main-custom_title',
3988     'section'     => 'UI',
3989     'description' => 'Title for the "Custom" tab in the View Customer page.',
3990     'type'        => 'text',
3991   },
3992
3993   { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3994   { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3995   { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3996   { key => "bindprimary", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3997   { key => "bindsecondaries", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3998   { key => "bsdshellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3999   { key => "cyrus", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4000   { key => "cp_app", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4001   { key => "erpcdmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4002   { key => "icradiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4003   { key => "icradius_mysqldest", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4004   { key => "icradius_mysqlsource", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4005   { key => "icradius_secrets", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4006   { key => "maildisablecatchall", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4007   { key => "mxmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4008   { key => "nsmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4009   { key => "arecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4010   { key => "cnamerecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4011   { key => "nismachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4012   { key => "qmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4013   { key => "radiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4014   { key => "sendmailconfigpath", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4015   { key => "sendmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4016   { key => "sendmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4017   { key => "shellmachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4018   { key => "shellmachine-useradd", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4019   { key => "shellmachine-userdel", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4020   { key => "shellmachine-usermod", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4021   { key => "shellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4022   { key => "radiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4023   { key => "textradiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4024   { key => "username_policy", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4025   { key => "vpopmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4026   { key => "vpopmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4027   { key => "safe-part_pkg", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4028   { key => "selfservice_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4029   { key => "signup_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4030   { key => "signup_server-email", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4031   { key => "vonage-username", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4032   { key => "vonage-password", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4033   { key => "vonage-fromnumber", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4034
4035 );
4036
4037 1;
4038