add back-office xmlrpc api and daemon, RT#27958
[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::Locales;
12 use FS::payby;
13 use FS::conf;
14 use FS::Record qw(qsearch qsearchs);
15 use FS::UID qw(dbh datasrc use_confcompat);
16 use FS::Misc::Geo;
17
18 $base_dir = '%%%FREESIDE_CONF%%%';
19
20 $DEBUG = 0;
21
22 =head1 NAME
23
24 FS::Conf - Freeside configuration values
25
26 =head1 SYNOPSIS
27
28   use FS::Conf;
29
30   $conf = new FS::Conf;
31
32   $value = $conf->config('key');
33   @list  = $conf->config('key');
34   $bool  = $conf->exists('key');
35
36   $conf->touch('key');
37   $conf->set('key' => 'value');
38   $conf->delete('key');
39
40   @config_items = $conf->config_items;
41
42 =head1 DESCRIPTION
43
44 Read and write Freeside configuration values.  Keys currently map to filenames,
45 but this may change in the future.
46
47 =head1 METHODS
48
49 =over 4
50
51 =item new [ HASHREF ]
52
53 Create a new configuration object.
54
55 HASHREF may contain options to set the configuration context.  Currently 
56 accepts C<locale>, and C<localeonly> to disable fallback to the null locale.
57
58 =cut
59
60 sub new {
61   my($proto) = shift;
62   my $opts = shift || {};
63   my($class) = ref($proto) || $proto;
64   my $self = {
65     'base_dir'    => $base_dir,
66     'locale'      => $opts->{locale},
67     'localeonly'  => $opts->{localeonly}, # for config-view.cgi ONLY
68   };
69   warn "FS::Conf created with no locale fallback.\n" if $self->{localeonly};
70   bless ($self, $class);
71 }
72
73 =item base_dir
74
75 Returns the base directory.  By default this is /usr/local/etc/freeside.
76
77 =cut
78
79 sub base_dir {
80   my($self) = @_;
81   my $base_dir = $self->{base_dir};
82   -e $base_dir or die "FATAL: $base_dir doesn't exist!";
83   -d $base_dir or die "FATAL: $base_dir isn't a directory!";
84   -r $base_dir or die "FATAL: Can't read $base_dir!";
85   -x $base_dir or die "FATAL: $base_dir not searchable (executable)!";
86   $base_dir =~ /^(.*)$/;
87   $1;
88 }
89
90 =item conf KEY [ AGENTNUM [ NODEFAULT ] ]
91
92 Returns the L<FS::conf> record for the key and agent.
93
94 =cut
95
96 sub conf {
97   my $self = shift;
98   $self->_config(@_);
99 }
100
101 =item config KEY [ AGENTNUM [ NODEFAULT ] ]
102
103 Returns the configuration value or values (depending on context) for key.
104 The optional agent number selects an agent specific value instead of the
105 global default if one is present.  If NODEFAULT is true only the agent
106 specific value(s) is returned.
107
108 =cut
109
110 sub _usecompat {
111   my ($self, $method) = (shift, shift);
112   carp "NO CONFIGURATION RECORDS FOUND -- USING COMPATIBILITY MODE"
113     if use_confcompat;
114   my $compat = new FS::Conf_compat17 ("$base_dir/conf." . datasrc);
115   $compat->$method(@_);
116 }
117
118 sub _config {
119   my($self,$name,$agentnum,$agentonly)=@_;
120   my $hashref = { 'name' => $name };
121   local $FS::Record::conf = undef;  # XXX evil hack prevents recursion
122   my $cv;
123   my @a = (
124     ($agentnum || ()),
125     ($agentonly && $agentnum ? () : '')
126   );
127   my @l = (
128     ($self->{locale} || ()),
129     ($self->{localeonly} && $self->{locale} ? () : '')
130   );
131   # try with the agentnum first, then fall back to no agentnum if allowed
132   foreach my $a (@a) {
133     $hashref->{agentnum} = $a;
134     foreach my $l (@l) {
135       $hashref->{locale} = $l;
136       $cv = FS::Record::qsearchs('conf', $hashref);
137       return $cv if $cv;
138     }
139   }
140   return undef;
141 }
142
143 sub config {
144   my $self = shift;
145   return $self->_usecompat('config', @_) if use_confcompat;
146
147   carp "FS::Conf->config(". join(', ', @_). ") called"
148     if $DEBUG > 1;
149
150   my $cv = $self->_config(@_) or return;
151
152   if ( wantarray ) {
153     my $v = $cv->value;
154     chomp $v;
155     (split "\n", $v, -1);
156   } else {
157     (split("\n", $cv->value))[0];
158   }
159 }
160
161 =item config_binary KEY [ AGENTNUM [ NODEFAULT ] ]
162
163 Returns the exact scalar value for key.
164
165 =cut
166
167 sub config_binary {
168   my $self = shift;
169   return $self->_usecompat('config_binary', @_) if use_confcompat;
170
171   my $cv = $self->_config(@_) or return;
172   length($cv->value) ? decode_base64($cv->value) : '';
173 }
174
175 =item exists KEY [ AGENTNUM [ NODEFAULT ] ]
176
177 Returns true if the specified key exists, even if the corresponding value
178 is undefined.
179
180 =cut
181
182 sub exists {
183   my $self = shift;
184   return $self->_usecompat('exists', @_) if use_confcompat;
185
186   #my($name, $agentnum)=@_;
187
188   carp "FS::Conf->exists(". join(', ', @_). ") called"
189     if $DEBUG > 1;
190
191   defined($self->_config(@_));
192 }
193
194 #maybe this should just be the new exists instead of getting a method of its
195 #own, but i wanted to avoid possible fallout
196
197 sub config_bool {
198   my $self = shift;
199   return $self->_usecompat('exists', @_) if use_confcompat;
200
201   my($name,$agentnum,$agentonly) = @_;
202
203   carp "FS::Conf->config_bool(". join(', ', @_). ") called"
204     if $DEBUG > 1;
205
206   #defined($self->_config(@_));
207
208   #false laziness w/_config
209   my $hashref = { 'name' => $name };
210   local $FS::Record::conf = undef;  # XXX evil hack prevents recursion
211   my $cv;
212   my @a = (
213     ($agentnum || ()),
214     ($agentonly && $agentnum ? () : '')
215   );
216   my @l = (
217     ($self->{locale} || ()),
218     ($self->{localeonly} && $self->{locale} ? () : '')
219   );
220   # try with the agentnum first, then fall back to no agentnum if allowed
221   foreach my $a (@a) {
222     $hashref->{agentnum} = $a;
223     foreach my $l (@l) {
224       $hashref->{locale} = $l;
225       $cv = FS::Record::qsearchs('conf', $hashref);
226       if ( $cv ) {
227         if ( $cv->value eq '0'
228                && ($hashref->{agentnum} || $hashref->{locale} )
229            ) 
230         {
231           return 0; #an explicit false override, don't continue looking
232         } else {
233           return 1;
234         }
235       }
236     }
237   }
238   return 0;
239
240 }
241
242 =item config_orbase KEY SUFFIX
243
244 Returns the configuration value or values (depending on context) for 
245 KEY_SUFFIX, if it exists, otherwise for KEY
246
247 =cut
248
249 # outmoded as soon as we shift to agentnum based config values
250 # well, mostly.  still useful for e.g. late notices, etc. in that we want
251 # these to fall back to standard values
252 sub config_orbase {
253   my $self = shift;
254   return $self->_usecompat('config_orbase', @_) if use_confcompat;
255
256   my( $name, $suffix ) = @_;
257   if ( $self->exists("${name}_$suffix") ) {
258     $self->config("${name}_$suffix");
259   } else {
260     $self->config($name);
261   }
262 }
263
264 =item key_orbase KEY SUFFIX
265
266 If the config value KEY_SUFFIX exists, returns KEY_SUFFIX, otherwise returns
267 KEY.  Useful for determining which exact configuration option is returned by
268 config_orbase.
269
270 =cut
271
272 sub key_orbase {
273   my $self = shift;
274   #no compat for this...return $self->_usecompat('config_orbase', @_) if use_confcompat;
275
276   my( $name, $suffix ) = @_;
277   if ( $self->exists("${name}_$suffix") ) {
278     "${name}_$suffix";
279   } else {
280     $name;
281   }
282 }
283
284 =item invoice_templatenames
285
286 Returns all possible invoice template names.
287
288 =cut
289
290 sub invoice_templatenames {
291   my( $self ) = @_;
292
293   my %templatenames = ();
294   foreach my $item ( $self->config_items ) {
295     foreach my $base ( @base_items ) {
296       my( $main, $ext) = split(/\./, $base);
297       $ext = ".$ext" if $ext;
298       if ( $item->key =~ /^${main}_(.+)$ext$/ ) {
299       $templatenames{$1}++;
300       }
301     }
302   }
303   
304   map { $_ } #handle scalar context
305   sort keys %templatenames;
306
307 }
308
309 =item touch KEY [ AGENT ];
310
311 Creates the specified configuration key if it does not exist.
312
313 =cut
314
315 sub touch {
316   my $self = shift;
317   return $self->_usecompat('touch', @_) if use_confcompat;
318
319   my($name, $agentnum) = @_;
320   #unless ( $self->exists($name, $agentnum) ) {
321   unless ( $self->config_bool($name, $agentnum) ) {
322     if ( $agentnum && $self->exists($name) && $self->config($name,$agentnum) eq '0' ) {
323       $self->delete($name, $agentnum);
324     } else {
325       $self->set($name, '', $agentnum);
326     }
327   }
328 }
329
330 =item set KEY VALUE [ AGENTNUM ];
331
332 Sets the specified configuration key to the given value.
333
334 =cut
335
336 sub set {
337   my $self = shift;
338   return $self->_usecompat('set', @_) if use_confcompat;
339
340   my($name, $value, $agentnum) = @_;
341   $value =~ /^(.*)$/s;
342   $value = $1;
343
344   warn "[FS::Conf] SET $name\n" if $DEBUG;
345
346   my $hashref = {
347     name => $name,
348     agentnum => $agentnum,
349     locale => $self->{locale}
350   };
351
352   my $old = FS::Record::qsearchs('conf', $hashref);
353   my $new = new FS::conf { $old ? $old->hash : %$hashref };
354   $new->value($value);
355
356   my $error;
357   if ($old) {
358     $error = $new->replace($old);
359   } else {
360     $error = $new->insert;
361   }
362
363   die "error setting configuration value: $error \n"
364     if $error;
365
366 }
367
368 =item set_binary KEY VALUE [ AGENTNUM ]
369
370 Sets the specified configuration key to an exact scalar value which
371 can be retrieved with config_binary.
372
373 =cut
374
375 sub set_binary {
376   my $self  = shift;
377   return if use_confcompat;
378
379   my($name, $value, $agentnum)=@_;
380   $self->set($name, encode_base64($value), $agentnum);
381 }
382
383 =item delete KEY [ AGENTNUM ];
384
385 Deletes the specified configuration key.
386
387 =cut
388
389 sub delete {
390   my $self = shift;
391   return $self->_usecompat('delete', @_) if use_confcompat;
392
393   my($name, $agentnum) = @_;
394   if ( my $cv = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum, locale => $self->{locale}}) ) {
395     warn "[FS::Conf] DELETE $name\n" if $DEBUG;
396
397     my $oldAutoCommit = $FS::UID::AutoCommit;
398     local $FS::UID::AutoCommit = 0;
399     my $dbh = dbh;
400
401     my $error = $cv->delete;
402
403     if ( $error ) {
404       $dbh->rollback if $oldAutoCommit;
405       die "error setting configuration value: $error \n"
406     }
407
408     $dbh->commit or die $dbh->errstr if $oldAutoCommit;
409
410   }
411 }
412
413 #maybe this should just be the new delete instead of getting a method of its
414 #own, but i wanted to avoid possible fallout
415
416 sub delete_bool {
417   my $self = shift;
418   return $self->_usecompat('delete', @_) if use_confcompat;
419
420   my($name, $agentnum) = @_;
421
422   warn "[FS::Conf] DELETE $name\n" if $DEBUG;
423
424   my $cv = FS::Record::qsearchs('conf', { name     => $name,
425                                           agentnum => $agentnum,
426                                           locale   => $self->{locale},
427                                         });
428
429   if ( $cv ) {
430     my $error = $cv->delete;
431     die $error if $error;
432   } elsif ( $agentnum ) {
433     $self->set($name, '0', $agentnum);
434   }
435
436 }
437
438 =item import_config_item CONFITEM DIR 
439
440   Imports the item specified by the CONFITEM (see L<FS::ConfItem>) into
441 the database as a conf record (see L<FS::conf>).  Imports from the file
442 in the directory DIR.
443
444 =cut
445
446 sub import_config_item { 
447   my ($self,$item,$dir) = @_;
448   my $key = $item->key;
449   if ( -e "$dir/$key" && ! use_confcompat ) {
450     warn "Inserting $key\n" if $DEBUG;
451     local $/;
452     my $value = readline(new IO::File "$dir/$key");
453     if ($item->type =~ /^(binary|image)$/ ) {
454       $self->set_binary($key, $value);
455     }else{
456       $self->set($key, $value);
457     }
458   }else {
459     warn "Not inserting $key\n" if $DEBUG;
460   }
461 }
462
463 =item verify_config_item CONFITEM DIR 
464
465   Compares the item specified by the CONFITEM (see L<FS::ConfItem>) in
466 the database to the legacy file value in DIR.
467
468 =cut
469
470 sub verify_config_item { 
471   return '' if use_confcompat;
472   my ($self,$item,$dir) = @_;
473   my $key = $item->key;
474   my $type = $item->type;
475
476   my $compat = new FS::Conf_compat17 $dir;
477   my $error = '';
478   
479   $error .= "$key fails existential comparison; "
480     if $self->exists($key) xor $compat->exists($key);
481
482   if ( $type !~ /^(binary|image)$/ ) {
483
484     {
485       no warnings;
486       $error .= "$key fails scalar comparison; "
487         unless scalar($self->config($key)) eq scalar($compat->config($key));
488     }
489
490     my (@new) = $self->config($key);
491     my (@old) = $compat->config($key);
492     unless ( scalar(@new) == scalar(@old)) { 
493       $error .= "$key fails list comparison; ";
494     }else{
495       my $r=1;
496       foreach (@old) { $r=0 if ($_ cmp shift(@new)); }
497       $error .= "$key fails list comparison; "
498         unless $r;
499     }
500
501   } else {
502
503     no warnings 'uninitialized';
504     $error .= "$key fails binary comparison; "
505       unless scalar($self->config_binary($key)) eq scalar($compat->config_binary($key));
506
507   }
508
509 #remove deprecated config on our own terms, not freeside-upgrade's
510 #  if ($error =~ /existential comparison/ && $item->section eq 'deprecated') {
511 #    my $proto;
512 #    for ( @config_items ) { $proto = $_; last if $proto->key eq $key;  }
513 #    unless ($proto->key eq $key) { 
514 #      warn "removed config item $error\n" if $DEBUG;
515 #      $error = '';
516 #    }
517 #  }
518
519   $error;
520 }
521
522 #item _orbase_items OPTIONS
523 #
524 #Returns all of the possible extensible config items as FS::ConfItem objects.
525 #See #L<FS::ConfItem>.  OPTIONS consists of name value pairs.  Possible
526 #options include
527 #
528 # dir - the directory to search for configuration option files instead
529 #       of using the conf records in the database
530 #
531 #cut
532
533 #quelle kludge
534 sub _orbase_items {
535   my ($self, %opt) = @_; 
536
537   my $listmaker = sub { my $v = shift;
538                         $v =~ s/_/!_/g;
539                         if ( $v =~ /\.(png|eps)$/ ) {
540                           $v =~ s/\./!_%./;
541                         }else{
542                           $v .= '!_%';
543                         }
544                         map { $_->name }
545                           FS::Record::qsearch( 'conf',
546                                                {},
547                                                '',
548                                                "WHERE name LIKE '$v' ESCAPE '!'"
549                                              );
550                       };
551
552   if (exists($opt{dir}) && $opt{dir}) {
553     $listmaker = sub { my $v = shift;
554                        if ( $v =~ /\.(png|eps)$/ ) {
555                          $v =~ s/\./_*./;
556                        }else{
557                          $v .= '_*';
558                        }
559                        map { basename $_ } glob($opt{dir}. "/$v" );
560                      };
561   }
562
563   ( map { 
564           my $proto;
565           my $base = $_;
566           for ( @config_items ) { $proto = $_; last if $proto->key eq $base;  }
567           die "don't know about $base items" unless $proto->key eq $base;
568
569           map { new FS::ConfItem { 
570                   'key'         => $_,
571                   'base_key'    => $proto->key,
572                   'section'     => $proto->section,
573                   'description' => 'Alternate ' . $proto->description . '  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Administration#Invoice_templates">billing documentation</a> for details.',
574                   'type'        => $proto->type,
575                 };
576               } &$listmaker($base);
577         } @base_items,
578   );
579 }
580
581 =item config_items
582
583 Returns all of the possible global/default configuration items as
584 FS::ConfItem objects.  See L<FS::ConfItem>.
585
586 =cut
587
588 sub config_items {
589   my $self = shift; 
590   return $self->_usecompat('config_items', @_) if use_confcompat;
591
592   ( @config_items, $self->_orbase_items(@_) );
593 }
594
595 =back
596
597 =head1 SUBROUTINES
598
599 =over 4
600
601 =item init-config DIR
602
603 Imports the configuration items from DIR (1.7 compatible)
604 to conf records in the database.
605
606 =cut
607
608 sub init_config {
609   my $dir = shift;
610
611   {
612     local $FS::UID::use_confcompat = 0;
613     my $conf = new FS::Conf;
614     foreach my $item ( $conf->config_items(dir => $dir) ) {
615       $conf->import_config_item($item, $dir);
616       my $error = $conf->verify_config_item($item, $dir);
617       return $error if $error;
618     }
619   
620     my $compat = new FS::Conf_compat17 $dir;
621     foreach my $item ( $compat->config_items ) {
622       my $error = $conf->verify_config_item($item, $dir);
623       return $error if $error;
624     }
625   }
626
627   $FS::UID::use_confcompat = 0;
628   '';  #success
629 }
630
631 =back
632
633 =head1 BUGS
634
635 If this was more than just crud that will never be useful outside Freeside I'd
636 worry that config_items is freeside-specific and icky.
637
638 =head1 SEE ALSO
639
640 "Configuration" in the web interface (config/config.cgi).
641
642 =cut
643
644 #Business::CreditCard
645 @card_types = (
646   "VISA card",
647   "MasterCard",
648   "Discover card",
649   "American Express card",
650   "Diner's Club/Carte Blanche",
651   "enRoute",
652   "JCB",
653   "BankCard",
654   "Switch",
655   "Solo",
656 );
657
658 @base_items = qw(
659 invoice_template
660 invoice_latex
661 invoice_latexreturnaddress
662 invoice_latexfooter
663 invoice_latexsmallfooter
664 invoice_latexnotes
665 invoice_latexcoupon
666 invoice_html
667 invoice_htmlreturnaddress
668 invoice_htmlfooter
669 invoice_htmlnotes
670 logo.png
671 logo.eps
672 );
673
674 my %msg_template_options = (
675   'type'        => 'select-sub',
676   'options_sub' => sub { 
677     my @templates = qsearch({
678         'table' => 'msg_template', 
679         'hashref' => { 'disabled' => '' },
680         'extra_sql' => ' AND '. 
681           $FS::CurrentUser::CurrentUser->agentnums_sql(null => 1),
682         });
683     map { $_->msgnum, $_->msgname } @templates;
684   },
685   'option_sub'  => sub { 
686                          my $msg_template = FS::msg_template->by_key(shift);
687                          $msg_template ? $msg_template->msgname : ''
688                        },
689   'per_agent' => 1,
690 );
691
692 my $_gateway_name = sub {
693   my $g = shift;
694   return '' if !$g;
695   ($g->gateway_username . '@' . $g->gateway_module);
696 };
697
698 my %payment_gateway_options = (
699   'type'        => 'select-sub',
700   'options_sub' => sub {
701     my @gateways = qsearch({
702         'table' => 'payment_gateway',
703         'hashref' => { 'disabled' => '' },
704       });
705     map { $_->gatewaynum, $_gateway_name->($_) } @gateways;
706   },
707   'option_sub'  => sub {
708     my $gateway = FS::payment_gateway->by_key(shift);
709     $_gateway_name->($gateway);
710   },
711 );
712
713 my @cdr_formats = (
714   '' => '',
715   'default' => 'Default',
716   'source_default' => 'Default with source',
717   'accountcode_default' => 'Default plus accountcode',
718   'description_default' => 'Default with description field as destination',
719   'basic' => 'Basic',
720   'simple' => 'Simple',
721   'simple2' => 'Simple with source',
722   'accountcode_simple' => 'Simple with accountcode',
723 );
724
725 #Billing (81 items)
726 #Invoicing (50 items)
727 #UI (69 items)
728 #Self-service (29 items)
729 #...
730 #Unclassified (77 items)
731
732 @config_items = map { new FS::ConfItem $_ } (
733
734   {
735     'key'         => 'address',
736     'section'     => 'deprecated',
737     'description' => 'This configuration option is no longer used.  See <a href="#invoice_template">invoice_template</a> instead.',
738     'type'        => 'text',
739   },
740
741   {
742     'key'         => 'event_log_level',
743     'section'     => 'notification',
744     'description' => 'Store events in the internal log if they are at least this severe.  "info" is the default, "debug" is very detailed and noisy.',
745     'type'        => 'select',
746     'select_enum' => [ '', 'debug', 'info', 'notice', 'warning', 'error', ],
747     # don't bother with higher levels
748   },
749
750   {
751     'key'         => 'log_sent_mail',
752     'section'     => 'notification',
753     'description' => 'Enable logging of template-generated email.',
754     'type'        => 'checkbox',
755   },
756
757   {
758     'key'         => 'alert_expiration',
759     'section'     => 'notification',
760     'description' => 'Enable alerts about billing method expiration (i.e. expiring credit cards).',
761     'type'        => 'checkbox',
762     'per_agent'   => 1,
763   },
764
765   {
766     'key'         => 'alerter_template',
767     'section'     => 'deprecated',
768     'description' => 'Template file for billing method expiration alerts (i.e. expiring credit cards).',
769     'type'        => 'textarea',
770     'per_agent'   => 1,
771   },
772   
773   {
774     'key'         => 'alerter_msgnum',
775     'section'     => 'notification',
776     'description' => 'Template to use for credit card expiration alerts.',
777     %msg_template_options,
778   },
779
780   {
781     'key'         => 'apacheip',
782     #not actually deprecated yet
783     #'section'     => 'deprecated',
784     #'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',
785     'section'     => '',
786     'description' => 'IP address to assign to new virtual hosts',
787     'type'        => 'text',
788   },
789   
790   {
791     'key'         => 'credits-auto-apply-disable',
792     'section'     => 'billing',
793     'description' => 'Disable the "Auto-Apply to invoices" UI option for new credits',
794     'type'        => 'checkbox',
795   },
796   
797   {
798     'key'         => 'credit-card-surcharge-percentage',
799     'section'     => 'billing',
800     'description' => 'Add a credit card surcharge to invoices, as a % of the invoice total. WARNING: this is usually prohibited by merchant account / other agreements and/or law, but is currently lawful in AU and UK.',
801     'type'        => 'text',
802   },
803
804   {
805     'key'         => 'discount-show-always',
806     'section'     => 'billing',
807     'description' => 'Generate a line item on an invoice even when a package is discounted 100%',
808     'type'        => 'checkbox',
809   },
810
811   {
812     'key'         => 'discount-show_available',
813     'section'     => 'billing',
814     'description' => 'Show available prepayment discounts on invoices.',
815     'type'        => 'checkbox',
816   },
817
818   {
819     'key'         => 'invoice-barcode',
820     'section'     => 'billing',
821     'description' => 'Display a barcode on HTML and PDF invoices',
822     'type'        => 'checkbox',
823   },
824   
825   {
826     'key'         => 'cust_main-select-billday',
827     'section'     => 'billing',
828     'description' => 'When used with a specific billing event, allows the selection of the day of month on which to charge credit card / bank account automatically, on a per-customer basis',
829     'type'        => 'checkbox',
830   },
831
832   {
833     'key'         => 'cust_main-select-prorate_day',
834     'section'     => 'billing',
835     'description' => 'When used with prorate or anniversary packages, allows the selection of the prorate day of month, on a per-customer basis',
836     'type'        => 'checkbox',
837   },
838
839   {
840     'key'         => 'anniversary-rollback',
841     'section'     => 'billing',
842     'description' => 'When billing an anniversary package ordered after the 28th, roll the anniversary date back to the 28th instead of forward into the following month.',
843     'type'        => 'checkbox',
844   },
845
846   {
847     'key'         => 'encryption',
848     'section'     => 'billing',
849     'description' => 'Enable encryption of credit cards and echeck numbers',
850     'type'        => 'checkbox',
851   },
852
853   {
854     'key'         => 'encryptionmodule',
855     'section'     => 'billing',
856     'description' => 'Use which module for encryption?',
857     'type'        => 'select',
858     'select_enum' => [ '', 'Crypt::OpenSSL::RSA', ],
859   },
860
861   {
862     'key'         => 'encryptionpublickey',
863     'section'     => 'billing',
864     'description' => 'Encryption public key',
865     'type'        => 'textarea',
866   },
867
868   {
869     'key'         => 'encryptionprivatekey',
870     'section'     => 'billing',
871     'description' => 'Encryption private key',
872     'type'        => 'textarea',
873   },
874
875   {
876     'key'         => 'billco-url',
877     'section'     => 'billing',
878     'description' => 'The url to use for performing uploads to the invoice mailing service.',
879     'type'        => 'text',
880     'per_agent'   => 1,
881   },
882
883   {
884     'key'         => 'billco-username',
885     'section'     => 'billing',
886     'description' => 'The login name to use for uploads to the invoice mailing service.',
887     'type'        => 'text',
888     'per_agent'   => 1,
889     'agentonly'   => 1,
890   },
891
892   {
893     'key'         => 'billco-password',
894     'section'     => 'billing',
895     'description' => 'The password to use for uploads to the invoice mailing service.',
896     'type'        => 'text',
897     'per_agent'   => 1,
898     'agentonly'   => 1,
899   },
900
901   {
902     'key'         => 'billco-clicode',
903     'section'     => 'billing',
904     'description' => 'The clicode to use for uploads to the invoice mailing service.',
905     'type'        => 'text',
906     'per_agent'   => 1,
907   },
908   
909   {
910     'key'         => 'next-bill-ignore-time',
911     'section'     => 'billing',
912     'description' => 'Ignore the time portion of next bill dates when billing, matching anything from 00:00:00 to 23:59:59 on the billing day.',
913     'type'        => 'checkbox',
914   },
915   
916   {
917     'key'         => 'business-onlinepayment',
918     'section'     => 'billing',
919     '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.',
920     'type'        => 'textarea',
921   },
922
923   {
924     'key'         => 'business-onlinepayment-ach',
925     'section'     => 'billing',
926     '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.',
927     'type'        => 'textarea',
928   },
929
930   {
931     'key'         => 'business-onlinepayment-namespace',
932     'section'     => 'billing',
933     'description' => 'Specifies which perl module namespace (which group of collection routines) is used by default.',
934     'type'        => 'select',
935     'select_hash' => [
936                        'Business::OnlinePayment' => 'Direct API (Business::OnlinePayment)',
937                        'Business::OnlineThirdPartyPayment' => 'Web API (Business::ThirdPartyPayment)',
938                      ],
939   },
940
941   {
942     'key'         => 'business-onlinepayment-description',
943     'section'     => 'billing',
944     '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)',
945     'type'        => 'text',
946   },
947
948   {
949     'key'         => 'business-onlinepayment-email-override',
950     'section'     => 'billing',
951     'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
952     'type'        => 'text',
953   },
954
955   {
956     'key'         => 'business-onlinepayment-email_customer',
957     'section'     => 'billing',
958     'description' => 'Controls the "email_customer" flag used by some Business::OnlinePayment processors to enable customer receipts.',
959     'type'        => 'checkbox',
960   },
961
962   {
963     'key'         => 'business-onlinepayment-test_transaction',
964     'section'     => 'billing',
965     '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.',
966     'type'        => 'checkbox',
967   },
968
969   {
970     'key'         => 'business-onlinepayment-currency',
971     'section'     => 'billing',
972     'description' => 'Currency parameter for Business::OnlinePayment transactions.',
973     'type'        => 'select',
974     'select_enum' => [ '', qw( USD AUD CAD DKK EUR GBP ILS JPY NZD ) ],
975   },
976
977   {
978     'key'         => 'countrydefault',
979     'section'     => 'UI',
980     'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
981     'type'        => 'text',
982   },
983
984   {
985     'key'         => 'date_format',
986     'section'     => 'UI',
987     'description' => 'Format for displaying dates',
988     'type'        => 'select',
989     'select_hash' => [
990                        '%m/%d/%Y' => 'MM/DD/YYYY',
991                        '%d/%m/%Y' => 'DD/MM/YYYY',
992                        '%Y/%m/%d' => 'YYYY/MM/DD',
993                      ],
994     'per_locale'  => 1,
995   },
996
997   {
998     'key'         => 'date_format_long',
999     'section'     => 'UI',
1000     'description' => 'Verbose format for displaying dates',
1001     'type'        => 'select',
1002     'select_hash' => [
1003                        '%b %o, %Y' => 'Mon DDth, YYYY',
1004                        '%e %b %Y'  => 'DD Mon YYYY',
1005                      ],
1006     'per_locale'  => 1,
1007   },
1008
1009   {
1010     'key'         => 'deletecustomers',
1011     'section'     => 'UI',
1012     '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.',
1013     'type'        => 'checkbox',
1014   },
1015
1016   {
1017     'key'         => 'deleteinvoices',
1018     'section'     => 'UI',
1019     '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?
1020     'type'        => 'checkbox',
1021   },
1022
1023   {
1024     'key'         => 'deletepayments',
1025     'section'     => 'billing',
1026     '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.',
1027     'type'        => [qw( checkbox text )],
1028   },
1029
1030   {
1031     'key'         => 'deletecredits',
1032     #not actually deprecated yet
1033     #'section'     => 'deprecated',
1034     #'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.',
1035     'section'     => '',
1036     'description' => 'One or more comma-separated email addresses to be notified when a credit is deleted.',
1037     'type'        => [qw( checkbox text )],
1038   },
1039
1040   {
1041     'key'         => 'deleterefunds',
1042     'section'     => 'billing',
1043     'description' => 'Enable deletion of unclosed refunds.  Be very careful!  Only delete refunds that were data-entry errors, not adjustments.',
1044     'type'        => 'checkbox',
1045   },
1046
1047   {
1048     'key'         => 'unapplypayments',
1049     'section'     => 'deprecated',
1050     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable "unapplication" of unclosed payments.',
1051     'type'        => 'checkbox',
1052   },
1053
1054   {
1055     'key'         => 'unapplycredits',
1056     'section'     => 'deprecated',
1057     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to nable "unapplication" of unclosed credits.',
1058     'type'        => 'checkbox',
1059   },
1060
1061   {
1062     'key'         => 'dirhash',
1063     'section'     => 'shell',
1064     '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>',
1065     'type'        => 'text',
1066   },
1067
1068   {
1069     'key'         => 'disable_cust_attachment',
1070     'section'     => '',
1071     'description' => 'Disable customer file attachments',
1072     'type'        => 'checkbox',
1073   },
1074
1075   {
1076     'key'         => 'max_attachment_size',
1077     'section'     => '',
1078     'description' => 'Maximum size for customer file attachments (leave blank for unlimited)',
1079     'type'        => 'text',
1080   },
1081
1082   {
1083     'key'         => 'disable_customer_referrals',
1084     'section'     => 'UI',
1085     'description' => 'Disable new customer-to-customer referrals in the web interface',
1086     'type'        => 'checkbox',
1087   },
1088
1089   {
1090     'key'         => 'editreferrals',
1091     'section'     => 'UI',
1092     'description' => 'Enable advertising source modification for existing customers',
1093     'type'        => 'checkbox',
1094   },
1095
1096   {
1097     'key'         => 'emailinvoiceonly',
1098     'section'     => 'invoicing',
1099     'description' => 'Disables postal mail invoices',
1100     'type'        => 'checkbox',
1101   },
1102
1103   {
1104     'key'         => 'disablepostalinvoicedefault',
1105     'section'     => 'invoicing',
1106     '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>.',
1107     'type'        => 'checkbox',
1108   },
1109
1110   {
1111     'key'         => 'emailinvoiceauto',
1112     'section'     => 'invoicing',
1113     'description' => 'Automatically adds new accounts to the email invoice list',
1114     'type'        => 'checkbox',
1115   },
1116
1117   {
1118     'key'         => 'emailinvoiceautoalways',
1119     'section'     => 'invoicing',
1120     'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses',
1121     'type'        => 'checkbox',
1122   },
1123
1124   {
1125     'key'         => 'emailinvoice-apostrophe',
1126     'section'     => 'invoicing',
1127     'description' => 'Allows the apostrophe (single quote) character in the email addresses in the email invoice list.',
1128     'type'        => 'checkbox',
1129   },
1130
1131   {
1132     'key'         => 'exclude_ip_addr',
1133     'section'     => '',
1134     'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
1135     'type'        => 'textarea',
1136   },
1137   
1138   {
1139     'key'         => 'auto_router',
1140     'section'     => '',
1141     'description' => 'Automatically choose the correct router/block based on supplied ip address when possible while provisioning broadband services',
1142     'type'        => 'checkbox',
1143   },
1144   
1145   {
1146     'key'         => 'hidecancelledpackages',
1147     'section'     => 'UI',
1148     'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
1149     'type'        => 'checkbox',
1150   },
1151
1152   {
1153     'key'         => 'hidecancelledcustomers',
1154     'section'     => 'UI',
1155     'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
1156     'type'        => 'checkbox',
1157   },
1158
1159   {
1160     'key'         => 'home',
1161     'section'     => 'shell',
1162     'description' => 'For new users, prefixed to username to create a directory name.  Should have a leading but not a trailing slash.',
1163     'type'        => 'text',
1164   },
1165
1166   {
1167     'key'         => 'invoice_from',
1168     'section'     => 'required',
1169     'description' => 'Return address on email invoices',
1170     'type'        => 'text',
1171     'per_agent'   => 1,
1172   },
1173
1174   {
1175     'key'         => 'invoice_subject',
1176     'section'     => 'invoicing',
1177     'description' => 'Subject: header on email invoices.  Defaults to "Invoice".  The following substitutions are available: $name, $name_short, $invoice_number, and $invoice_date.',
1178     'type'        => 'text',
1179     'per_agent'   => 1,
1180     'per_locale'  => 1,
1181   },
1182
1183   {
1184     'key'         => 'invoice_usesummary',
1185     'section'     => 'invoicing',
1186     'description' => 'Indicates that html and latex invoices should be in summary style and make use of invoice_latexsummary.',
1187     'type'        => 'checkbox',
1188   },
1189
1190   {
1191     'key'         => 'invoice_template',
1192     'section'     => 'invoicing',
1193     '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:2.1:Documentation:Administration#Plaintext_invoice_templates">billing documentation</a> for details.',
1194     'type'        => 'textarea',
1195   },
1196
1197   {
1198     'key'         => 'invoice_html',
1199     'section'     => 'invoicing',
1200     'description' => 'Optional HTML template for invoices.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Administration#HTML_invoice_templates">billing documentation</a> for details.',
1201
1202     'type'        => 'textarea',
1203   },
1204
1205   {
1206     'key'         => 'invoice_htmlnotes',
1207     'section'     => 'invoicing',
1208     'description' => 'Notes section for HTML invoices.  Defaults to the same data in invoice_latexnotes if not specified.',
1209     'type'        => 'textarea',
1210     'per_agent'   => 1,
1211     'per_locale'  => 1,
1212   },
1213
1214   {
1215     'key'         => 'invoice_htmlfooter',
1216     'section'     => 'invoicing',
1217     'description' => 'Footer for HTML invoices.  Defaults to the same data in invoice_latexfooter if not specified.',
1218     'type'        => 'textarea',
1219     'per_agent'   => 1,
1220     'per_locale'  => 1,
1221   },
1222
1223   {
1224     'key'         => 'invoice_htmlsummary',
1225     'section'     => 'invoicing',
1226     'description' => 'Summary initial page for HTML invoices.',
1227     'type'        => 'textarea',
1228     'per_agent'   => 1,
1229     'per_locale'  => 1,
1230   },
1231
1232   {
1233     'key'         => 'invoice_htmlreturnaddress',
1234     'section'     => 'invoicing',
1235     'description' => 'Return address for HTML invoices.  Defaults to the same data in invoice_latexreturnaddress if not specified.',
1236     'type'        => 'textarea',
1237     'per_locale'  => 1,
1238   },
1239
1240   {
1241     'key'         => 'invoice_latex',
1242     'section'     => 'invoicing',
1243     'description' => 'Optional LaTeX template for typeset PostScript invoices.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Administration#Typeset_.28LaTeX.29_invoice_templates">billing documentation</a> for details.',
1244     'type'        => 'textarea',
1245   },
1246
1247   {
1248     'key'         => 'invoice_latextopmargin',
1249     'section'     => 'invoicing',
1250     'description' => 'Optional LaTeX invoice topmargin setting. Include units.',
1251     'type'        => 'text',
1252     'per_agent'   => 1,
1253     'validate'    => sub { shift =~
1254                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1255                              ? '' : 'Invalid LaTex length';
1256                          },
1257   },
1258
1259   {
1260     'key'         => 'invoice_latexheadsep',
1261     'section'     => 'invoicing',
1262     'description' => 'Optional LaTeX invoice headsep setting. Include units.',
1263     'type'        => 'text',
1264     'per_agent'   => 1,
1265     'validate'    => sub { shift =~
1266                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1267                              ? '' : 'Invalid LaTex length';
1268                          },
1269   },
1270
1271   {
1272     'key'         => 'invoice_latexaddresssep',
1273     'section'     => 'invoicing',
1274     'description' => 'Optional LaTeX invoice separation between invoice header
1275 and customer address. Include units.',
1276     'type'        => 'text',
1277     'per_agent'   => 1,
1278     'validate'    => sub { shift =~
1279                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1280                              ? '' : 'Invalid LaTex length';
1281                          },
1282   },
1283
1284   {
1285     'key'         => 'invoice_latextextheight',
1286     'section'     => 'invoicing',
1287     'description' => 'Optional LaTeX invoice textheight setting. Include units.',
1288     'type'        => 'text',
1289     'per_agent'   => 1,
1290     'validate'    => sub { shift =~
1291                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1292                              ? '' : 'Invalid LaTex length';
1293                          },
1294   },
1295
1296   {
1297     'key'         => 'invoice_latexnotes',
1298     'section'     => 'invoicing',
1299     'description' => 'Notes section for LaTeX typeset PostScript invoices.',
1300     'type'        => 'textarea',
1301     'per_agent'   => 1,
1302     'per_locale'  => 1,
1303   },
1304
1305   {
1306     'key'         => 'invoice_latexfooter',
1307     'section'     => 'invoicing',
1308     'description' => 'Footer for LaTeX typeset PostScript invoices.',
1309     'type'        => 'textarea',
1310     'per_agent'   => 1,
1311     'per_locale'  => 1,
1312   },
1313
1314   {
1315     'key'         => 'invoice_latexsummary',
1316     'section'     => 'invoicing',
1317     'description' => 'Summary initial page for LaTeX typeset PostScript invoices.',
1318     'type'        => 'textarea',
1319     'per_agent'   => 1,
1320     'per_locale'  => 1,
1321   },
1322
1323   {
1324     'key'         => 'invoice_latexcoupon',
1325     'section'     => 'invoicing',
1326     'description' => 'Remittance coupon for LaTeX typeset PostScript invoices.',
1327     'type'        => 'textarea',
1328     'per_agent'   => 1,
1329     'per_locale'  => 1,
1330   },
1331
1332   {
1333     'key'         => 'invoice_latexextracouponspace',
1334     'section'     => 'invoicing',
1335     'description' => 'Optional LaTeX invoice textheight space to reserve for a tear off coupon.  Include units.  Default is 3.6cm',
1336     'type'        => 'text',
1337     'per_agent'   => 1,
1338     'validate'    => sub { shift =~
1339                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1340                              ? '' : 'Invalid LaTex length';
1341                          },
1342   },
1343
1344   {
1345     'key'         => 'invoice_latexcouponfootsep',
1346     'section'     => 'invoicing',
1347     'description' => 'Optional LaTeX invoice separation between tear off coupon and footer. Include units.',
1348     'type'        => 'text',
1349     'per_agent'   => 1,
1350     'validate'    => sub { shift =~
1351                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1352                              ? '' : 'Invalid LaTex length';
1353                          },
1354   },
1355
1356   {
1357     'key'         => 'invoice_latexcouponamountenclosedsep',
1358     'section'     => 'invoicing',
1359     'description' => 'Optional LaTeX invoice separation between total due and amount enclosed line. Include units.',
1360     'type'        => 'text',
1361     'per_agent'   => 1,
1362     'validate'    => sub { shift =~
1363                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1364                              ? '' : 'Invalid LaTex length';
1365                          },
1366   },
1367   {
1368     'key'         => 'invoice_latexcoupontoaddresssep',
1369     'section'     => 'invoicing',
1370     'description' => 'Optional LaTeX invoice separation between invoice data and the to address (usually invoice_latexreturnaddress).  Include units.',
1371     'type'        => 'text',
1372     'per_agent'   => 1,
1373     'validate'    => sub { shift =~
1374                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1375                              ? '' : 'Invalid LaTex length';
1376                          },
1377   },
1378
1379   {
1380     'key'         => 'invoice_latexreturnaddress',
1381     'section'     => 'invoicing',
1382     'description' => 'Return address for LaTeX typeset PostScript invoices.',
1383     'type'        => 'textarea',
1384   },
1385
1386   {
1387     'key'         => 'invoice_latexverticalreturnaddress',
1388     'section'     => 'invoicing',
1389     'description' => 'Place the return address under the company logo rather than beside it.',
1390     'type'        => 'checkbox',
1391     'per_agent'   => 1,
1392   },
1393
1394   {
1395     'key'         => 'invoice_latexcouponaddcompanytoaddress',
1396     'section'     => 'invoicing',
1397     'description' => 'Add the company name to the To address on the remittance coupon because the return address does not contain it.',
1398     'type'        => 'checkbox',
1399     'per_agent'   => 1,
1400   },
1401
1402   {
1403     'key'         => 'invoice_latexsmallfooter',
1404     'section'     => 'invoicing',
1405     'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
1406     'type'        => 'textarea',
1407     'per_agent'   => 1,
1408     'per_locale'  => 1,
1409   },
1410
1411   {
1412     'key'         => 'invoice_email_pdf',
1413     'section'     => 'invoicing',
1414     '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.',
1415     'type'        => 'checkbox'
1416   },
1417
1418   {
1419     'key'         => 'invoice_email_pdf_note',
1420     'section'     => 'invoicing',
1421     'description' => 'If defined, this text will replace the default plain text invoice as the body of emailed PDF invoices.',
1422     'type'        => 'textarea'
1423   },
1424
1425   {
1426     'key'         => 'invoice_print_pdf',
1427     'section'     => 'invoicing',
1428     'description' => 'For all invoice print operations, store postal invoices for download in PDF format rather than printing them directly.',
1429     'type'        => 'checkbox',
1430   },
1431
1432   {
1433     'key'         => 'invoice_print_pdf-spoolagent',
1434     'section'     => 'invoicing',
1435     'description' => 'Store postal invoices PDF downloads in per-agent spools.',
1436     'type'        => 'checkbox',
1437   },
1438
1439   { 
1440     'key'         => 'invoice_default_terms',
1441     'section'     => 'invoicing',
1442     'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
1443     'type'        => 'select',
1444     'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 3', 'Net 9', 'Net 10', 'Net 15', 'Net 20', 'Net 21', 'Net 30', 'Net 45', 'Net 60', 'Net 90' ],
1445   },
1446
1447   { 
1448     'key'         => 'invoice_show_prior_due_date',
1449     'section'     => 'invoicing',
1450     'description' => 'Show previous invoice due dates when showing prior balances.  Default is to show invoice date.',
1451     'type'        => 'checkbox',
1452   },
1453
1454   { 
1455     'key'         => 'invoice_include_aging',
1456     'section'     => 'invoicing',
1457     'description' => 'Show an aging line after the prior balance section.  Only valud when invoice_sections is enabled.',
1458     'type'        => 'checkbox',
1459   },
1460
1461   { 
1462     'key'         => 'invoice_sections',
1463     'section'     => 'invoicing',
1464     'description' => 'Split invoice into sections and label according to package category when enabled.',
1465     'type'        => 'checkbox',
1466   },
1467
1468   { 
1469     'key'         => 'usage_class_as_a_section',
1470     'section'     => 'invoicing',
1471     'description' => 'Split usage into sections and label according to usage class name when enabled.  Only valid when invoice_sections is enabled.',
1472     'type'        => 'checkbox',
1473   },
1474
1475   { 
1476     'key'         => 'phone_usage_class_summary',
1477     'section'     => 'invoicing',
1478     'description' => 'Summarize usage per DID by usage class and display all CDRs together regardless of usage class. Only valid when svc_phone_sections is enabled.',
1479     'type'        => 'checkbox',
1480   },
1481
1482   { 
1483     'key'         => 'svc_phone_sections',
1484     'section'     => 'invoicing',
1485     'description' => 'Create a section for each svc_phone when enabled.  Only valid when invoice_sections is enabled.',
1486     'type'        => 'checkbox',
1487   },
1488
1489   {
1490     'key'         => 'finance_pkgclass',
1491     'section'     => 'billing',
1492     'description' => 'The default package class for late fee charges, used if the fee event does not specify a package class itself.',
1493     'type'        => 'select-pkg_class',
1494   },
1495
1496   { 
1497     'key'         => 'separate_usage',
1498     'section'     => 'invoicing',
1499     'description' => 'Split the rated call usage into a separate line from the recurring charges.',
1500     'type'        => 'checkbox',
1501   },
1502
1503   {
1504     'key'         => 'invoice_send_receipts',
1505     'section'     => 'deprecated',
1506     'description' => '<b>DEPRECATED</b>, this used to send an invoice copy on payments and credits.  See the payment_receipt_email and XXXX instead.',
1507     'type'        => 'checkbox',
1508   },
1509
1510   {
1511     'key'         => 'payment_receipt',
1512     'section'     => 'notification',
1513     'description' => 'Send payment receipts.',
1514     'type'        => 'checkbox',
1515     'per_agent'   => 1,
1516     'agent_bool'  => 1,
1517   },
1518
1519   {
1520     'key'         => 'payment_receipt_msgnum',
1521     'section'     => 'notification',
1522     'description' => 'Template to use for payment receipts.',
1523     %msg_template_options,
1524   },
1525   
1526   {
1527     'key'         => 'payment_receipt_from',
1528     'section'     => 'notification',
1529     'description' => 'From: address for payment receipts, if not specified in the template.',
1530     'type'        => 'text',
1531     'per_agent'   => 1,
1532   },
1533
1534   {
1535     'key'         => 'payment_receipt_email',
1536     'section'     => 'deprecated',
1537     'description' => 'Template file for payment receipts.  Payment receipts are sent to the customer email invoice destination(s) when a payment is received.',
1538     'type'        => [qw( checkbox textarea )],
1539   },
1540
1541   {
1542     'key'         => 'payment_receipt-trigger',
1543     'section'     => 'notification',
1544     'description' => 'When payment receipts are triggered.  Defaults to when payment is made.',
1545     'type'        => 'select',
1546     'select_hash' => [
1547                        'cust_pay'          => 'When payment is made.',
1548                        'cust_bill_pay_pkg' => 'When payment is applied.',
1549                      ],
1550     'per_agent'   => 1,
1551   },
1552
1553   {
1554     'key'         => 'trigger_export_insert_on_payment',
1555     'section'     => 'billing',
1556     'description' => 'Enable exports on payment application.',
1557     'type'        => 'checkbox',
1558   },
1559
1560   {
1561     'key'         => 'lpr',
1562     'section'     => 'required',
1563     'description' => 'Print command for paper invoices, for example `lpr -h\'',
1564     'type'        => 'text',
1565     'per_agent'   => 1,
1566   },
1567
1568   {
1569     'key'         => 'lpr-postscript_prefix',
1570     'section'     => 'billing',
1571     'description' => 'Raw printer commands prepended to the beginning of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
1572     'type'        => 'text',
1573   },
1574
1575   {
1576     'key'         => 'lpr-postscript_suffix',
1577     'section'     => 'billing',
1578     'description' => 'Raw printer commands added to the end of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
1579     'type'        => 'text',
1580   },
1581
1582   {
1583     'key'         => 'money_char',
1584     'section'     => '',
1585     'description' => 'Currency symbol - defaults to `$\'',
1586     'type'        => 'text',
1587   },
1588
1589   {
1590     'key'         => 'defaultrecords',
1591     'section'     => 'BIND',
1592     'description' => 'DNS entries to add automatically when creating a domain',
1593     'type'        => 'editlist',
1594     'editlist_parts' => [ { type=>'text' },
1595                           { type=>'immutable', value=>'IN' },
1596                           { type=>'select',
1597                             select_enum => {
1598                               map { $_=>$_ }
1599                                   #@{ FS::domain_record->rectypes }
1600                                   qw(A AAAA CNAME MX NS PTR SPF SRV TXT)
1601                             },
1602                           },
1603                           { type=> 'text' }, ],
1604   },
1605
1606   {
1607     'key'         => 'passwordmin',
1608     'section'     => 'password',
1609     'description' => 'Minimum password length (default 6)',
1610     'type'        => 'text',
1611   },
1612
1613   {
1614     'key'         => 'passwordmax',
1615     'section'     => 'password',
1616     'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
1617     'type'        => 'text',
1618   },
1619
1620   {
1621     'key'         => 'sip_passwordmin',
1622     'section'     => 'telephony',
1623     'description' => 'Minimum SIP password length (default 6)',
1624     'type'        => 'text',
1625   },
1626
1627   {
1628     'key'         => 'sip_passwordmax',
1629     'section'     => 'telephony',
1630     'description' => 'Maximum SIP password length (default 80)',
1631     'type'        => 'text',
1632   },
1633
1634
1635   {
1636     'key'         => 'password-noampersand',
1637     'section'     => 'password',
1638     'description' => 'Disallow ampersands in passwords',
1639     'type'        => 'checkbox',
1640   },
1641
1642   {
1643     'key'         => 'password-noexclamation',
1644     'section'     => 'password',
1645     'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
1646     'type'        => 'checkbox',
1647   },
1648
1649   {
1650     'key'         => 'default-password-encoding',
1651     'section'     => 'password',
1652     'description' => 'Default storage format for passwords',
1653     'type'        => 'select',
1654     'select_hash' => [
1655       'plain'       => 'Plain text',
1656       'crypt-des'   => 'Unix password (DES encrypted)',
1657       'crypt-md5'   => 'Unix password (MD5 digest)',
1658       'ldap-plain'  => 'LDAP (plain text)',
1659       'ldap-crypt'  => 'LDAP (DES encrypted)',
1660       'ldap-md5'    => 'LDAP (MD5 digest)',
1661       'ldap-sha1'   => 'LDAP (SHA1 digest)',
1662       'legacy'      => 'Legacy mode',
1663     ],
1664   },
1665
1666   {
1667     'key'         => 'referraldefault',
1668     'section'     => 'UI',
1669     'description' => 'Default referral, specified by refnum',
1670     'type'        => 'select-sub',
1671     'options_sub' => sub { require FS::Record;
1672                            require FS::part_referral;
1673                            map { $_->refnum => $_->referral }
1674                                FS::Record::qsearch( 'part_referral', 
1675                                                     { 'disabled' => '' }
1676                                                   );
1677                          },
1678     'option_sub'  => sub { require FS::Record;
1679                            require FS::part_referral;
1680                            my $part_referral = FS::Record::qsearchs(
1681                              'part_referral', { 'refnum'=>shift } );
1682                            $part_referral ? $part_referral->referral : '';
1683                          },
1684   },
1685
1686 #  {
1687 #    'key'         => 'registries',
1688 #    'section'     => 'required',
1689 #    'description' => 'Directory which contains domain registry information.  Each registry is a directory.',
1690 #  },
1691
1692   {
1693     'key'         => 'report_template',
1694     'section'     => 'deprecated',
1695     'description' => 'Deprecated template file for reports.',
1696     'type'        => 'textarea',
1697   },
1698
1699   {
1700     'key'         => 'maxsearchrecordsperpage',
1701     'section'     => 'UI',
1702     'description' => 'If set, number of search records to return per page.',
1703     'type'        => 'text',
1704   },
1705
1706   {
1707     'key'         => 'disable_maxselect',
1708     'section'     => 'UI',
1709     'description' => 'Prevent changing the number of records per page.',
1710     'type'        => 'checkbox',
1711   },
1712
1713   {
1714     'key'         => 'session-start',
1715     'section'     => 'session',
1716     '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.',
1717     'type'        => 'text',
1718   },
1719
1720   {
1721     'key'         => 'session-stop',
1722     'section'     => 'session',
1723     '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.',
1724     'type'        => 'text',
1725   },
1726
1727   {
1728     'key'         => 'shells',
1729     'section'     => 'shell',
1730     '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.',
1731     'type'        => 'textarea',
1732   },
1733
1734   {
1735     'key'         => 'showpasswords',
1736     'section'     => 'UI',
1737     'description' => 'Display unencrypted user passwords in the backend (employee) web interface',
1738     'type'        => 'checkbox',
1739   },
1740
1741   {
1742     'key'         => 'report-showpasswords',
1743     'section'     => 'UI',
1744     'description' => 'This is a terrible idea.  Do not enable it.  STRONGLY NOT RECOMMENDED.  Enables display of passwords on services reports.',
1745     'type'        => 'checkbox',
1746   },
1747
1748   {
1749     'key'         => 'signupurl',
1750     'section'     => 'UI',
1751     '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:2.1: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',
1752     'type'        => 'text',
1753   },
1754
1755   {
1756     'key'         => 'smtpmachine',
1757     'section'     => 'required',
1758     'description' => 'SMTP relay for Freeside\'s outgoing mail',
1759     'type'        => 'text',
1760   },
1761
1762   {
1763     'key'         => 'smtp-username',
1764     'section'     => '',
1765     'description' => 'Optional SMTP username for Freeside\'s outgoing mail',
1766     'type'        => 'text',
1767   },
1768
1769   {
1770     'key'         => 'smtp-password',
1771     'section'     => '',
1772     'description' => 'Optional SMTP password for Freeside\'s outgoing mail',
1773     'type'        => 'text',
1774   },
1775
1776   {
1777     'key'         => 'smtp-encryption',
1778     'section'     => '',
1779     'description' => 'Optional SMTP encryption method.  The STARTTLS methods require smtp-username and smtp-password to be set.',
1780     'type'        => 'select',
1781     'select_hash' => [ '25'           => 'None (port 25)',
1782                        '25-starttls'  => 'STARTTLS (port 25)',
1783                        '587-starttls' => 'STARTTLS / submission (port 587)',
1784                        '465-tls'      => 'SMTPS (SSL) (port 465)',
1785                      ],
1786   },
1787
1788   {
1789     'key'         => 'soadefaultttl',
1790     'section'     => 'BIND',
1791     'description' => 'SOA default TTL for new domains.',
1792     'type'        => 'text',
1793   },
1794
1795   {
1796     'key'         => 'soaemail',
1797     'section'     => 'BIND',
1798     'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
1799     'type'        => 'text',
1800   },
1801
1802   {
1803     'key'         => 'soaexpire',
1804     'section'     => 'BIND',
1805     'description' => 'SOA expire for new domains',
1806     'type'        => 'text',
1807   },
1808
1809   {
1810     'key'         => 'soamachine',
1811     'section'     => 'BIND',
1812     'description' => 'SOA machine for new domains, with trailing `.\'',
1813     'type'        => 'text',
1814   },
1815
1816   {
1817     'key'         => 'soarefresh',
1818     'section'     => 'BIND',
1819     'description' => 'SOA refresh for new domains',
1820     'type'        => 'text',
1821   },
1822
1823   {
1824     'key'         => 'soaretry',
1825     'section'     => 'BIND',
1826     'description' => 'SOA retry for new domains',
1827     'type'        => 'text',
1828   },
1829
1830   {
1831     'key'         => 'statedefault',
1832     'section'     => 'UI',
1833     'description' => 'Default state or province (if not supplied, the default is `CA\')',
1834     'type'        => 'text',
1835   },
1836
1837   {
1838     'key'         => 'unsuspendauto',
1839     'section'     => 'billing',
1840     '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',
1841     'type'        => 'checkbox',
1842   },
1843
1844   {
1845     'key'         => 'unsuspend-always_adjust_next_bill_date',
1846     'section'     => 'billing',
1847     '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.',
1848     'type'        => 'checkbox',
1849   },
1850
1851   {
1852     'key'         => 'usernamemin',
1853     'section'     => 'username',
1854     'description' => 'Minimum username length (default 2)',
1855     'type'        => 'text',
1856   },
1857
1858   {
1859     'key'         => 'usernamemax',
1860     'section'     => 'username',
1861     'description' => 'Maximum username length',
1862     'type'        => 'text',
1863   },
1864
1865   {
1866     'key'         => 'username-ampersand',
1867     'section'     => 'username',
1868     '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.',
1869     'type'        => 'checkbox',
1870   },
1871
1872   {
1873     'key'         => 'username-letter',
1874     'section'     => 'username',
1875     'description' => 'Usernames must contain at least one letter',
1876     'type'        => 'checkbox',
1877     'per_agent'   => 1,
1878   },
1879
1880   {
1881     'key'         => 'username-letterfirst',
1882     'section'     => 'username',
1883     'description' => 'Usernames must start with a letter',
1884     'type'        => 'checkbox',
1885   },
1886
1887   {
1888     'key'         => 'username-noperiod',
1889     'section'     => 'username',
1890     'description' => 'Disallow periods in usernames',
1891     'type'        => 'checkbox',
1892   },
1893
1894   {
1895     'key'         => 'username-nounderscore',
1896     'section'     => 'username',
1897     'description' => 'Disallow underscores in usernames',
1898     'type'        => 'checkbox',
1899   },
1900
1901   {
1902     'key'         => 'username-nodash',
1903     'section'     => 'username',
1904     'description' => 'Disallow dashes in usernames',
1905     'type'        => 'checkbox',
1906   },
1907
1908   {
1909     'key'         => 'username-uppercase',
1910     'section'     => 'username',
1911     'description' => 'Allow uppercase characters in usernames.  Not recommended for use with FreeRADIUS with MySQL backend, which is case-insensitive by default.',
1912     'type'        => 'checkbox',
1913     'per_agent'   => 1,
1914   },
1915
1916   { 
1917     'key'         => 'username-percent',
1918     'section'     => 'username',
1919     'description' => 'Allow the percent character (%) in usernames.',
1920     'type'        => 'checkbox',
1921   },
1922
1923   { 
1924     'key'         => 'username-colon',
1925     'section'     => 'username',
1926     'description' => 'Allow the colon character (:) in usernames.',
1927     'type'        => 'checkbox',
1928   },
1929
1930   { 
1931     'key'         => 'username-slash',
1932     'section'     => 'username',
1933     'description' => 'Allow the slash character (/) in usernames.  When using, make sure to set "Home directory" to fixed and blank in all svc_acct service definitions.',
1934     'type'        => 'checkbox',
1935   },
1936
1937   { 
1938     'key'         => 'username-equals',
1939     'section'     => 'username',
1940     'description' => 'Allow the equal sign character (=) in usernames.',
1941     'type'        => 'checkbox',
1942   },
1943
1944   {
1945     'key'         => 'safe-part_bill_event',
1946     'section'     => 'UI',
1947     'description' => 'Validates invoice event expressions against a preset list.  Useful for webdemos, annoying to powerusers.',
1948     'type'        => 'checkbox',
1949   },
1950
1951   {
1952     'key'         => 'show_ss',
1953     'section'     => 'UI',
1954     'description' => 'Turns on display/collection of social security numbers in the web interface.  Sometimes required by electronic check (ACH) processors.',
1955     'type'        => 'checkbox',
1956   },
1957
1958   {
1959     'key'         => 'unmask_ss',
1960     'section'     => 'UI',
1961     'description' => "Don't mask social security numbers in the web interface.",
1962     'type'        => 'checkbox',
1963   },
1964
1965   {
1966     'key'         => 'show_stateid',
1967     'section'     => 'UI',
1968     'description' => "Turns on display/collection of driver's license/state issued id numbers in the web interface.  Sometimes required by electronic check (ACH) processors.",
1969     'type'        => 'checkbox',
1970   },
1971
1972   {
1973     'key'         => 'national_id-country',
1974     'section'     => 'UI',
1975     'description' => 'Track a national identification number, for specific countries.',
1976     'type'        => 'select',
1977     'select_enum' => [ '', 'MY' ],
1978   },
1979
1980   {
1981     'key'         => 'show_bankstate',
1982     'section'     => 'UI',
1983     'description' => "Turns on display/collection of state for bank accounts in the web interface.  Sometimes required by electronic check (ACH) processors.",
1984     'type'        => 'checkbox',
1985   },
1986
1987   { 
1988     'key'         => 'agent_defaultpkg',
1989     'section'     => 'UI',
1990     'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
1991     'type'        => 'checkbox',
1992   },
1993
1994   {
1995     'key'         => 'legacy_link',
1996     'section'     => 'UI',
1997     'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
1998     'type'        => 'checkbox',
1999   },
2000
2001   {
2002     'key'         => 'legacy_link-steal',
2003     'section'     => 'UI',
2004     'description' => 'Allow "stealing" an already-audited service from one customer (or package) to another using the link function.',
2005     'type'        => 'checkbox',
2006   },
2007
2008   {
2009     'key'         => 'queue_dangerous_controls',
2010     'section'     => 'UI',
2011     '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.',
2012     'type'        => 'checkbox',
2013   },
2014
2015   {
2016     'key'         => 'security_phrase',
2017     'section'     => 'password',
2018     'description' => 'Enable the tracking of a "security phrase" with each account.  Not recommended, as it is vulnerable to social engineering.',
2019     'type'        => 'checkbox',
2020   },
2021
2022   {
2023     'key'         => 'locale',
2024     'section'     => 'UI',
2025     'description' => 'Default locale',
2026     'type'        => 'select-sub',
2027     'options_sub' => sub {
2028       map { $_ => FS::Locales->description($_) } FS::Locales->locales;
2029     },
2030     'option_sub'  => sub {
2031       FS::Locales->description(shift)
2032     },
2033   },
2034
2035   {
2036     'key'         => 'signup_server-payby',
2037     'section'     => 'self-service',
2038     'description' => 'Acceptable payment types for the signup server',
2039     'type'        => 'selectmultiple',
2040     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
2041   },
2042
2043   {
2044     'key'         => 'selfservice-payment_gateway',
2045     'section'     => 'self-service',
2046     'description' => 'Force the use of this payment gateway for self-service.',
2047     %payment_gateway_options,
2048   },
2049
2050   {
2051     'key'         => 'selfservice-save_unchecked',
2052     'section'     => 'self-service',
2053     'description' => 'In self-service, uncheck "Remember information" checkboxes by default (normally, they are checked by default).',
2054     'type'        => 'checkbox',
2055   },
2056
2057   {
2058     'key'         => 'default_agentnum',
2059     'section'     => 'UI',
2060     'description' => 'Default agent for the backoffice',
2061     'type'        => 'select-agent',
2062   },
2063
2064   {
2065     'key'         => 'signup_server-default_agentnum',
2066     'section'     => 'self-service',
2067     'description' => 'Default agent for the signup server',
2068     'type'        => 'select-agent',
2069   },
2070
2071   {
2072     'key'         => 'signup_server-default_refnum',
2073     'section'     => 'self-service',
2074     'description' => 'Default advertising source for the signup server',
2075     'type'        => 'select-sub',
2076     'options_sub' => sub { require FS::Record;
2077                            require FS::part_referral;
2078                            map { $_->refnum => $_->referral }
2079                                FS::Record::qsearch( 'part_referral', 
2080                                                     { 'disabled' => '' }
2081                                                   );
2082                          },
2083     'option_sub'  => sub { require FS::Record;
2084                            require FS::part_referral;
2085                            my $part_referral = FS::Record::qsearchs(
2086                              'part_referral', { 'refnum'=>shift } );
2087                            $part_referral ? $part_referral->referral : '';
2088                          },
2089   },
2090
2091   {
2092     'key'         => 'signup_server-default_pkgpart',
2093     'section'     => 'self-service',
2094     'description' => 'Default package for the signup server',
2095     'type'        => 'select-part_pkg',
2096   },
2097
2098   {
2099     'key'         => 'signup_server-default_svcpart',
2100     'section'     => 'self-service',
2101     'description' => 'Default service definition for the signup server - only necessary for services that trigger special provisioning widgets (such as DID provisioning).',
2102     'type'        => 'select-part_svc',
2103   },
2104
2105   {
2106     'key'         => 'signup_server-mac_addr_svcparts',
2107     'section'     => 'self-service',
2108     'description' => 'Service definitions which can receive mac addresses (current mapped to username for svc_acct).',
2109     'type'        => 'select-part_svc',
2110     'multiple'    => 1,
2111   },
2112
2113   {
2114     'key'         => 'signup_server-nomadix',
2115     'section'     => 'self-service',
2116     'description' => 'Signup page Nomadix integration',
2117     'type'        => 'checkbox',
2118   },
2119
2120   {
2121     'key'         => 'signup_server-service',
2122     'section'     => 'self-service',
2123     'description' => 'Service for the signup server - "Account (svc_acct)" is the default setting, or "Phone number (svc_phone)" for ITSP signup',
2124     'type'        => 'select',
2125     'select_hash' => [
2126                        'svc_acct'  => 'Account (svc_acct)',
2127                        'svc_phone' => 'Phone number (svc_phone)',
2128                        'svc_pbx'   => 'PBX (svc_pbx)',
2129                      ],
2130   },
2131   
2132   {
2133     'key'         => 'signup_server-prepaid-template-custnum',
2134     'section'     => 'self-service',
2135     'description' => 'When the signup server is used with prepaid cards and customer info is not required for signup, the contact/address info will be copied from this customer, if specified',
2136     'type'        => 'text',
2137   },
2138
2139   {
2140     'key'         => 'signup_server-terms_of_service',
2141     'section'     => 'self-service',
2142     'description' => 'Terms of Service for the signup server.  May contain HTML.',
2143     'type'        => 'textarea',
2144     'per_agent'   => 1,
2145   },
2146
2147   {
2148     'key'         => 'selfservice_server-base_url',
2149     'section'     => 'self-service',
2150     '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.',
2151     'type'        => 'text',
2152   },
2153
2154   {
2155     'key'         => 'show-msgcat-codes',
2156     'section'     => 'UI',
2157     'description' => 'Show msgcat codes in error messages.  Turn this option on before reporting errors to the mailing list.',
2158     'type'        => 'checkbox',
2159   },
2160
2161   {
2162     'key'         => 'signup_server-realtime',
2163     'section'     => 'self-service',
2164     'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
2165     'type'        => 'checkbox',
2166   },
2167
2168   {
2169     'key'         => 'signup_server-classnum2',
2170     'section'     => 'self-service',
2171     'description' => 'Package Class for first optional purchase',
2172     'type'        => 'select-pkg_class',
2173   },
2174
2175   {
2176     'key'         => 'signup_server-classnum3',
2177     'section'     => 'self-service',
2178     'description' => 'Package Class for second optional purchase',
2179     'type'        => 'select-pkg_class',
2180   },
2181
2182   {
2183     'key'         => 'signup_server-third_party_as_card',
2184     'section'     => 'self-service',
2185     'description' => 'Allow customer payment type to be set to CARD even when using third-party credit card billing.',
2186     'type'        => 'checkbox',
2187   },
2188
2189   {
2190     'key'         => 'selfservice-xmlrpc',
2191     'section'     => 'self-service',
2192     'description' => 'Run a standalone self-service XML-RPC server on the backend (on port 8080).',
2193     'type'        => 'checkbox',
2194   },
2195
2196   {
2197     'key'         => 'backend-realtime',
2198     'section'     => 'billing',
2199     'description' => 'Run billing for backend signups immediately.',
2200     'type'        => 'checkbox',
2201   },
2202
2203   {
2204     'key'         => 'decline_msgnum',
2205     'section'     => 'notification',
2206     'description' => 'Template to use for credit card and electronic check decline messages.',
2207     %msg_template_options,
2208   },
2209
2210   {
2211     'key'         => 'declinetemplate',
2212     'section'     => 'deprecated',
2213     'description' => 'Template file for credit card and electronic check decline emails.',
2214     'type'        => 'textarea',
2215   },
2216
2217   {
2218     'key'         => 'emaildecline',
2219     'section'     => 'notification',
2220     'description' => 'Enable emailing of credit card and electronic check decline notices.',
2221     'type'        => 'checkbox',
2222     'per_agent'   => 1,
2223   },
2224
2225   {
2226     'key'         => 'emaildecline-exclude',
2227     'section'     => 'notification',
2228     'description' => 'List of error messages that should not trigger email decline notices, one per line.',
2229     'type'        => 'textarea',
2230     'per_agent'   => 1,
2231   },
2232
2233   {
2234     'key'         => 'cancel_msgnum',
2235     'section'     => 'notification',
2236     'description' => 'Template to use for cancellation emails.',
2237     %msg_template_options,
2238   },
2239
2240   {
2241     'key'         => 'cancelmessage',
2242     'section'     => 'deprecated',
2243     'description' => 'Template file for cancellation emails.',
2244     'type'        => 'textarea',
2245   },
2246
2247   {
2248     'key'         => 'cancelsubject',
2249     'section'     => 'deprecated',
2250     'description' => 'Subject line for cancellation emails.',
2251     'type'        => 'text',
2252   },
2253
2254   {
2255     'key'         => 'emailcancel',
2256     'section'     => 'notification',
2257     'description' => 'Enable emailing of cancellation notices.  Make sure to select the template in the cancel_msgnum option.',
2258     'type'        => 'checkbox',
2259     'per_agent'   => 1,
2260   },
2261
2262   {
2263     'key'         => 'bill_usage_on_cancel',
2264     'section'     => 'billing',
2265     '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.',
2266     'type'        => 'checkbox',
2267   },
2268
2269   {
2270     'key'         => 'require_cardname',
2271     'section'     => 'billing',
2272     'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
2273     'type'        => 'checkbox',
2274   },
2275
2276   {
2277     'key'         => 'enable_taxclasses',
2278     'section'     => 'billing',
2279     'description' => 'Enable per-package tax classes',
2280     'type'        => 'checkbox',
2281   },
2282
2283   {
2284     'key'         => 'require_taxclasses',
2285     'section'     => 'billing',
2286     'description' => 'Require a taxclass to be entered for every package',
2287     'type'        => 'checkbox',
2288   },
2289
2290   {
2291     'key'         => 'enable_taxproducts',
2292     'section'     => 'billing',
2293     'description' => 'Enable per-package mapping to vendor tax data from CCH or elsewhere.',
2294     'type'        => 'checkbox',
2295   },
2296
2297   {
2298     'key'         => 'taxdatadirectdownload',
2299     'section'     => 'billing',  #well
2300     'description' => 'Enable downloading tax data directly from the vendor site. at least three lines: URL, username, and password.j',
2301     'type'        => 'textarea',
2302   },
2303
2304   {
2305     'key'         => 'ignore_incalculable_taxes',
2306     'section'     => 'billing',
2307     'description' => 'Prefer to invoice without tax over not billing at all',
2308     'type'        => 'checkbox',
2309   },
2310
2311   {
2312     'key'         => 'welcome_msgnum',
2313     'section'     => 'notification',
2314     'description' => 'Template to use for welcome messages when a svc_acct record is created.',
2315     %msg_template_options,
2316   },
2317   
2318   {
2319     'key'         => 'svc_acct_welcome_exclude',
2320     'section'     => 'notification',
2321     'description' => 'A list of svc_acct services for which no welcome email is to be sent.',
2322     'type'        => 'select-part_svc',
2323     'multiple'    => 1,
2324   },
2325
2326   {
2327     'key'         => 'welcome_email',
2328     'section'     => 'deprecated',
2329     '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.',
2330     'type'        => 'textarea',
2331     'per_agent'   => 1,
2332   },
2333
2334   {
2335     'key'         => 'welcome_email-from',
2336     'section'     => 'deprecated',
2337     'description' => 'From: address header for welcome email',
2338     'type'        => 'text',
2339     'per_agent'   => 1,
2340   },
2341
2342   {
2343     'key'         => 'welcome_email-subject',
2344     'section'     => 'deprecated',
2345     'description' => 'Subject: header for welcome email',
2346     'type'        => 'text',
2347     'per_agent'   => 1,
2348   },
2349   
2350   {
2351     'key'         => 'welcome_email-mimetype',
2352     'section'     => 'deprecated',
2353     'description' => 'MIME type for welcome email',
2354     'type'        => 'select',
2355     'select_enum' => [ 'text/plain', 'text/html' ],
2356     'per_agent'   => 1,
2357   },
2358
2359   {
2360     'key'         => 'welcome_letter',
2361     'section'     => '',
2362     '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>',
2363     'type'        => 'textarea',
2364   },
2365
2366 #  {
2367 #    'key'         => 'warning_msgnum',
2368 #    'section'     => 'notification',
2369 #    '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.',
2370 #    %msg_template_options,
2371 #  },
2372
2373   {
2374     'key'         => 'warning_email',
2375     'section'     => 'notification',
2376     '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>',
2377     'type'        => 'textarea',
2378   },
2379
2380   {
2381     'key'         => 'warning_email-from',
2382     'section'     => 'notification',
2383     'description' => 'From: address header for warning email',
2384     'type'        => 'text',
2385   },
2386
2387   {
2388     'key'         => 'warning_email-cc',
2389     'section'     => 'notification',
2390     'description' => 'Additional recipient(s) (comma separated) for warning email when remaining usage reaches zero.',
2391     'type'        => 'text',
2392   },
2393
2394   {
2395     'key'         => 'warning_email-subject',
2396     'section'     => 'notification',
2397     'description' => 'Subject: header for warning email',
2398     'type'        => 'text',
2399   },
2400   
2401   {
2402     'key'         => 'warning_email-mimetype',
2403     'section'     => 'notification',
2404     'description' => 'MIME type for warning email',
2405     'type'        => 'select',
2406     'select_enum' => [ 'text/plain', 'text/html' ],
2407   },
2408
2409   {
2410     'key'         => 'payby',
2411     'section'     => 'billing',
2412     'description' => 'Available payment types.',
2413     'type'        => 'selectmultiple',
2414     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP) ],
2415   },
2416
2417   {
2418     'key'         => 'payby-default',
2419     'section'     => 'UI',
2420     'description' => 'Default payment type.  HIDE disables display of billing information and sets customers to BILL.',
2421     'type'        => 'select',
2422     'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP HIDE) ],
2423   },
2424
2425   {
2426     'key'         => 'require_cash_deposit_info',
2427     'section'     => 'billing',
2428     'description' => 'When recording cash payments, display bank deposit information fields.',
2429     'type'        => 'checkbox',
2430   },
2431
2432   {
2433     'key'         => 'paymentforcedtobatch',
2434     'section'     => 'deprecated',
2435     '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.',
2436     'type'        => 'checkbox',
2437   },
2438
2439   {
2440     'key'         => 'svc_acct-notes',
2441     'section'     => 'deprecated',
2442     'description' => 'Extra HTML to be displayed on the Account View screen.',
2443     'type'        => 'textarea',
2444   },
2445
2446   {
2447     'key'         => 'radius-password',
2448     'section'     => '',
2449     'description' => 'RADIUS attribute for plain-text passwords.',
2450     'type'        => 'select',
2451     'select_enum' => [ 'Password', 'User-Password', 'Cleartext-Password' ],
2452   },
2453
2454   {
2455     'key'         => 'radius-ip',
2456     'section'     => '',
2457     'description' => 'RADIUS attribute for IP addresses.',
2458     'type'        => 'select',
2459     'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
2460   },
2461
2462   #http://dev.coova.org/svn/coova-chilli/doc/dictionary.chillispot
2463   {
2464     'key'         => 'radius-chillispot-max',
2465     'section'     => '',
2466     'description' => 'Enable ChilliSpot (and CoovaChilli) Max attributes, specifically ChilliSpot-Max-{Input,Output,Total}-{Octets,Gigawords}.',
2467     'type'        => 'checkbox',
2468   },
2469
2470   {
2471     'key'         => 'svc_broadband-radius',
2472     'section'     => '',
2473     'description' => 'Enable RADIUS groups for broadband services.',
2474     'type'        => 'checkbox',
2475   },
2476
2477   {
2478     'key'         => 'svc_acct-alldomains',
2479     'section'     => '',
2480     '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.',
2481     'type'        => 'checkbox',
2482   },
2483
2484   {
2485     'key'         => 'dump-localdest',
2486     'section'     => '',
2487     'description' => 'Destination for local database dumps (full path)',
2488     'type'        => 'text',
2489   },
2490
2491   {
2492     'key'         => 'dump-scpdest',
2493     'section'     => '',
2494     'description' => 'Destination for scp database dumps: user@host:/path',
2495     'type'        => 'text',
2496   },
2497
2498   {
2499     'key'         => 'dump-pgpid',
2500     'section'     => '',
2501     '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.",
2502     'type'        => 'text',
2503   },
2504
2505   {
2506     'key'         => 'users-allow_comp',
2507     'section'     => 'deprecated',
2508     '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.',
2509     'type'        => 'textarea',
2510   },
2511
2512   {
2513     'key'         => 'credit_card-recurring_billing_flag',
2514     'section'     => 'billing',
2515     '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. ',
2516     'type'        => 'select',
2517     'select_hash' => [
2518                        'actual_oncard' => 'Default/classic behavior: set the flag if a customer has actual previous charges on the card.',
2519                        'transaction_is_recur' => 'Set the flag if the transaction itself is recurring, irregardless of previous charges on the card.',
2520                      ],
2521   },
2522
2523   {
2524     'key'         => 'credit_card-recurring_billing_acct_code',
2525     'section'     => 'billing',
2526     'description' => 'When the "recurring billing" flag is set, also set the "acct_code" to "rebill".  Useful for reporting purposes with supported gateways (PlugNPay, others?)',
2527     'type'        => 'checkbox',
2528   },
2529
2530   {
2531     'key'         => 'cvv-save',
2532     'section'     => 'billing',
2533     '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.',
2534     'type'        => 'selectmultiple',
2535     'select_enum' => \@card_types,
2536   },
2537
2538   {
2539     'key'         => 'manual_process-pkgpart',
2540     'section'     => 'billing',
2541     'description' => 'Package to add to each manual credit card and ACH payment entered by employees from the backend.  Enabling this option may be in violation of your merchant agreement(s), so please check it(/them) carefully before enabling this option.',
2542     'type'        => 'select-part_pkg',
2543     'per_agent'   => 1,
2544   },
2545
2546   {
2547     'key'         => 'manual_process-display',
2548     'section'     => 'billing',
2549     'description' => 'When using manual_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
2550     'type'        => 'select',
2551     'select_hash' => [
2552                        'add'      => 'Add fee to amount entered',
2553                        'subtract' => 'Subtract fee from amount entered',
2554                      ],
2555   },
2556
2557   {
2558     'key'         => 'manual_process-skip_first',
2559     'section'     => 'billing',
2560     'description' => "When using manual_process-pkgpart, omit the fee if it is the customer's first payment.",
2561     'type'        => 'checkbox',
2562   },
2563
2564   {
2565     'key'         => 'selfservice_process-pkgpart',
2566     'section'     => 'billing',
2567     'description' => 'Package to add to each manual credit card and ACH payment entered by the customer themselves in the self-service interface.  Enabling this option may be in violation of your merchant agreement(s), so please check it(/them) carefully before enabling this option.',
2568     'type'        => 'select-part_pkg',
2569     'per_agent'   => 1,
2570   },
2571
2572   {
2573     'key'         => 'selfservice_process-display',
2574     'section'     => 'billing',
2575     'description' => 'When using selfservice_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
2576     'type'        => 'select',
2577     'select_hash' => [
2578                        'add'      => 'Add fee to amount entered',
2579                        'subtract' => 'Subtract fee from amount entered',
2580                      ],
2581   },
2582
2583   {
2584     'key'         => 'selfservice_process-skip_first',
2585     'section'     => 'billing',
2586     'description' => "When using selfservice_process-pkgpart, omit the fee if it is the customer's first payment.",
2587     'type'        => 'checkbox',
2588   },
2589
2590 #  {
2591 #    'key'         => 'auto_process-pkgpart',
2592 #    'section'     => 'billing',
2593 #    'description' => 'Package to add to each automatic credit card and ACH payment processed by billing events.  Enabling this option may be in violation of your merchant agreement(s), so please check them carefully before enabling this option.',
2594 #    'type'        => 'select-part_pkg',
2595 #  },
2596 #
2597 ##  {
2598 ##    'key'         => 'auto_process-display',
2599 ##    'section'     => 'billing',
2600 ##    'description' => 'When using auto_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
2601 ##    'type'        => 'select',
2602 ##    'select_hash' => [
2603 ##                       'add'      => 'Add fee to amount entered',
2604 ##                       'subtract' => 'Subtract fee from amount entered',
2605 ##                     ],
2606 ##  },
2607 #
2608 #  {
2609 #    'key'         => 'auto_process-skip_first',
2610 #    'section'     => 'billing',
2611 #    'description' => "When using auto_process-pkgpart, omit the fee if it is the customer's first payment.",
2612 #    'type'        => 'checkbox',
2613 #  },
2614
2615   {
2616     'key'         => 'allow_negative_charges',
2617     'section'     => 'billing',
2618     'description' => 'Allow negative charges.  Normally not used unless importing data from a legacy system that requires this.',
2619     'type'        => 'checkbox',
2620   },
2621   {
2622       'key'         => 'auto_unset_catchall',
2623       'section'     => '',
2624       '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.',
2625       'type'        => 'checkbox',
2626   },
2627
2628   {
2629     'key'         => 'system_usernames',
2630     'section'     => 'username',
2631     '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.',
2632     'type'        => 'textarea',
2633   },
2634
2635   {
2636     'key'         => 'cust_pkg-change_svcpart',
2637     'section'     => '',
2638     'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
2639     'type'        => 'checkbox',
2640   },
2641
2642   {
2643     'key'         => 'cust_pkg-change_pkgpart-bill_now',
2644     'section'     => '',
2645     '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.",
2646     'type'        => 'checkbox',
2647   },
2648
2649   {
2650     'key'         => 'disable_autoreverse',
2651     'section'     => 'BIND',
2652     'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
2653     'type'        => 'checkbox',
2654   },
2655
2656   {
2657     'key'         => 'svc_www-enable_subdomains',
2658     'section'     => '',
2659     'description' => 'Enable selection of specific subdomains for virtual host creation.',
2660     'type'        => 'checkbox',
2661   },
2662
2663   {
2664     'key'         => 'svc_www-usersvc_svcpart',
2665     'section'     => '',
2666     'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
2667     'type'        => 'select-part_svc',
2668     'multiple'    => 1,
2669   },
2670
2671   {
2672     'key'         => 'selfservice_server-primary_only',
2673     'section'     => 'self-service',
2674     'description' => 'Only allow primary accounts to access self-service functionality.',
2675     'type'        => 'checkbox',
2676   },
2677
2678   {
2679     'key'         => 'selfservice_server-phone_login',
2680     'section'     => 'self-service',
2681     'description' => 'Allow login to self-service with phone number and PIN.',
2682     'type'        => 'checkbox',
2683   },
2684
2685   {
2686     'key'         => 'selfservice_server-single_domain',
2687     'section'     => 'self-service',
2688     'description' => 'If specified, only use this one domain for self-service access.',
2689     'type'        => 'text',
2690   },
2691
2692   {
2693     'key'         => 'selfservice_server-login_svcpart',
2694     'section'     => 'self-service',
2695     'description' => 'If specified, only allow the specified svcparts to login to self-service.',
2696     'type'        => 'select-part_svc',
2697     'multiple'    => 1,
2698   },
2699
2700   {
2701     'key'         => 'selfservice-svc_forward_svcpart',
2702     'section'     => 'self-service',
2703     'description' => 'Service for self-service forward editing.',
2704     'type'        => 'select-part_svc',
2705   },
2706
2707   {
2708     'key'         => 'selfservice-password_reset_verification',
2709     'section'     => 'self-service',
2710     'description' => 'If enabled, specifies the type of verification required for self-service password resets.',
2711     'type'        => 'select',
2712     'select_hash' => [ '' => 'Password reset disabled',
2713                        'paymask,amount,zip' => 'Verify with credit card (or bank account) last 4 digits, payment amount and zip code',
2714                      ],
2715   },
2716
2717   {
2718     'key'         => 'selfservice-password_reset_msgnum',
2719     'section'     => 'self-service',
2720     'description' => 'Template to use for password reset emails.',
2721     %msg_template_options,
2722   },
2723
2724   {
2725     'key'         => 'selfservice-hide_invoices-taxclass',
2726     'section'     => 'self-service',
2727     'description' => 'Hide invoices with only this package tax class from self-service and supress sending (emailing, printing, faxing) them.  Typically set to something like "Previous balance" and used when importing legacy invoices into legacy_cust_bill.',
2728     'type'        => 'text',
2729   },
2730
2731   {
2732     'key'         => 'selfservice-recent-did-age',
2733     'section'     => 'self-service',
2734     'description' => 'If specified, defines "recent", in number of seconds, for "Download recently allocated DIDs" in self-service.',
2735     'type'        => 'text',
2736   },
2737
2738   {
2739     'key'         => 'selfservice_server-view-wholesale',
2740     'section'     => 'self-service',
2741     'description' => 'If enabled, use a wholesale package view in the self-service.',
2742     'type'        => 'checkbox',
2743   },
2744   
2745   {
2746     'key'         => 'selfservice-agent_signup',
2747     'section'     => 'self-service',
2748     'description' => 'Allow agent signup via self-service.',
2749     'type'        => 'checkbox',
2750   },
2751
2752   {
2753     'key'         => 'selfservice-agent_signup-agent_type',
2754     'section'     => 'self-service',
2755     'description' => 'Agent type when allowing agent signup via self-service.',
2756     'type'        => 'select-sub',
2757     'options_sub' => sub { require FS::Record;
2758                            require FS::agent_type;
2759                            map { $_->typenum => $_->atype }
2760                                FS::Record::qsearch('agent_type', {} ); # disabled=>'' } );
2761                          },
2762     'option_sub'  => sub { require FS::Record;
2763                            require FS::agent_type;
2764                            my $agent = FS::Record::qsearchs(
2765                              'agent_type', { 'typenum'=>shift }
2766                            );
2767                            $agent_type ? $agent_type->atype : '';
2768                          },
2769   },
2770
2771   {
2772     'key'         => 'selfservice-agent_login',
2773     'section'     => 'self-service',
2774     'description' => 'Allow agent login via self-service.',
2775     'type'        => 'checkbox',
2776   },
2777
2778   {
2779     'key'         => 'selfservice-self_suspend_reason',
2780     'section'     => 'self-service',
2781     'description' => 'Suspend reason when customers suspend their own packages. Set to nothing to disallow self-suspension.',
2782     'type'        => 'select-sub',
2783     'options_sub' => sub { require FS::Record;
2784                            require FS::reason;
2785                            my $type = qsearchs('reason_type', 
2786                              { class => 'S' }) 
2787                               or return ();
2788                            map { $_->reasonnum => $_->reason }
2789                                FS::Record::qsearch('reason', 
2790                                  { reason_type => $type->typenum } 
2791                                );
2792                          },
2793     'option_sub'  => sub { require FS::Record;
2794                            require FS::reason;
2795                            my $reason = FS::Record::qsearchs(
2796                              'reason', { 'reasonnum' => shift }
2797                            );
2798                            $reason ? $reason->reason : '';
2799                          },
2800
2801     'per_agent'   => 1,
2802   },
2803
2804   {
2805     'key'         => 'card_refund-days',
2806     'section'     => 'billing',
2807     'description' => 'After a payment, the number of days a refund link will be available for that payment.  Defaults to 120.',
2808     'type'        => 'text',
2809   },
2810
2811   {
2812     'key'         => 'agent-showpasswords',
2813     'section'     => '',
2814     'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
2815     'type'        => 'checkbox',
2816   },
2817
2818   {
2819     'key'         => 'global_unique-username',
2820     'section'     => 'username',
2821     '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.',
2822     'type'        => 'select',
2823     'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
2824   },
2825
2826   {
2827     'key'         => 'global_unique-phonenum',
2828     'section'     => '',
2829     '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.',
2830     'type'        => 'select',
2831     'select_enum' => [ 'none', 'countrycode+phonenum', 'disabled' ],
2832   },
2833
2834   {
2835     'key'         => 'global_unique-pbx_title',
2836     'section'     => '',
2837     'description' => 'Global phone number uniqueness control: none (check uniqueness per exports), enabled (check across all services), or disabled (no duplicate checking).',
2838     'type'        => 'select',
2839     'select_enum' => [ 'enabled', 'disabled' ],
2840   },
2841
2842   {
2843     'key'         => 'global_unique-pbx_id',
2844     'section'     => '',
2845     'description' => 'Global PBX id uniqueness control: none (check uniqueness per exports), enabled (check across all services), or disabled (no duplicate checking).',
2846     'type'        => 'select',
2847     'select_enum' => [ 'enabled', 'disabled' ],
2848   },
2849
2850   {
2851     'key'         => 'svc_external-skip_manual',
2852     'section'     => 'UI',
2853     '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).',
2854     'type'        => 'checkbox',
2855   },
2856
2857   {
2858     'key'         => 'svc_external-display_type',
2859     'section'     => 'UI',
2860     'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
2861     'type'        => 'select',
2862     'select_enum' => [ 'generic', 'artera_turbo', ],
2863   },
2864
2865   {
2866     'key'         => 'ticket_system',
2867     'section'     => 'ticketing',
2868     '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:2.1:Documentation:RT_Installation">integrated ticketing installation instructions</a>).   <b>RT_External</b> accesses an external RT installation in a separate database (local or remote).',
2869     'type'        => 'select',
2870     #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
2871     'select_enum' => [ '', qw(RT_Internal RT_External) ],
2872   },
2873
2874   {
2875     'key'         => 'network_monitoring_system',
2876     'section'     => 'network_monitoring',
2877     'description' => 'Networking monitoring system (NMS) integration.  <b>Torrus_Internal</b> uses the built-in Torrus ticketing system (see the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Torrus_Installation">integrated networking monitoring system installation instructions</a>).',
2878     'type'        => 'select',
2879     'select_enum' => [ '', qw(Torrus_Internal) ],
2880   },
2881
2882   {
2883     'key'         => 'nms-auto_add-svc_ips',
2884     'section'     => 'network_monitoring',
2885     'description' => 'Automatically add (and remove) IP addresses from these service tables to the network monitoring system.',
2886     'type'        => 'selectmultiple',
2887     'select_enum' => [ 'svc_acct', 'svc_broadband', 'svc_dsl' ],
2888   },
2889
2890   {
2891     'key'         => 'nms-auto_add-community',
2892     'section'     => 'network_monitoring',
2893     'description' => 'SNMP community string to use when automatically adding IP addresses from these services to the network monitoring system.',
2894     'type'        => 'text',
2895   },
2896
2897   {
2898     'key'         => 'ticket_system-default_queueid',
2899     'section'     => 'ticketing',
2900     'description' => 'Default queue used when creating new customer tickets.',
2901     'type'        => 'select-sub',
2902     'options_sub' => sub {
2903                            my $conf = new FS::Conf;
2904                            if ( $conf->config('ticket_system') ) {
2905                              eval "use FS::TicketSystem;";
2906                              die $@ if $@;
2907                              FS::TicketSystem->queues();
2908                            } else {
2909                              ();
2910                            }
2911                          },
2912     'option_sub'  => sub { 
2913                            my $conf = new FS::Conf;
2914                            if ( $conf->config('ticket_system') ) {
2915                              eval "use FS::TicketSystem;";
2916                              die $@ if $@;
2917                              FS::TicketSystem->queue(shift);
2918                            } else {
2919                              '';
2920                            }
2921                          },
2922   },
2923   {
2924     'key'         => 'ticket_system-force_default_queueid',
2925     'section'     => 'ticketing',
2926     'description' => 'Disallow queue selection when creating new tickets from customer view.',
2927     'type'        => 'checkbox',
2928   },
2929   {
2930     'key'         => 'ticket_system-selfservice_queueid',
2931     'section'     => 'ticketing',
2932     'description' => 'Queue used when creating new customer tickets from self-service.  Defautls to ticket_system-default_queueid if not specified.',
2933     #false laziness w/above
2934     'type'        => 'select-sub',
2935     'options_sub' => sub {
2936                            my $conf = new FS::Conf;
2937                            if ( $conf->config('ticket_system') ) {
2938                              eval "use FS::TicketSystem;";
2939                              die $@ if $@;
2940                              FS::TicketSystem->queues();
2941                            } else {
2942                              ();
2943                            }
2944                          },
2945     'option_sub'  => sub { 
2946                            my $conf = new FS::Conf;
2947                            if ( $conf->config('ticket_system') ) {
2948                              eval "use FS::TicketSystem;";
2949                              die $@ if $@;
2950                              FS::TicketSystem->queue(shift);
2951                            } else {
2952                              '';
2953                            }
2954                          },
2955   },
2956
2957   {
2958     'key'         => 'ticket_system-requestor',
2959     'section'     => 'ticketing',
2960     'description' => 'Email address to use as the requestor for new tickets.  If blank, the customer\'s invoicing address(es) will be used.',
2961     'type'        => 'text',
2962   },
2963
2964   {
2965     'key'         => 'ticket_system-priority_reverse',
2966     'section'     => 'ticketing',
2967     '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.',
2968     'type'        => 'checkbox',
2969   },
2970
2971   {
2972     'key'         => 'ticket_system-custom_priority_field',
2973     'section'     => 'ticketing',
2974     'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
2975     'type'        => 'text',
2976   },
2977
2978   {
2979     'key'         => 'ticket_system-custom_priority_field-values',
2980     'section'     => 'ticketing',
2981     'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
2982     'type'        => 'textarea',
2983   },
2984
2985   {
2986     'key'         => 'ticket_system-custom_priority_field_queue',
2987     'section'     => 'ticketing',
2988     'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
2989     'type'        => 'text',
2990   },
2991
2992   {
2993     'key'         => 'ticket_system-selfservice_priority_field',
2994     'section'     => 'ticketing',
2995     'description' => 'Custom field from the ticket system to use as a customer-managed priority field.',
2996     'type'        => 'text',
2997   },
2998
2999   {
3000     'key'         => 'ticket_system-selfservice_edit_subject',
3001     'section'     => 'ticketing',
3002     'description' => 'Allow customers to edit ticket subjects through selfservice.',
3003     'type'        => 'checkbox',
3004   },
3005
3006   {
3007     'key'         => 'ticket_system-escalation',
3008     'section'     => 'ticketing',
3009     'description' => 'Enable priority escalation of tickets as part of daily batch processing.',
3010     'type'        => 'checkbox',
3011   },
3012
3013   {
3014     'key'         => 'ticket_system-rt_external_datasrc',
3015     'section'     => 'ticketing',
3016     '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>',
3017     'type'        => 'text',
3018
3019   },
3020
3021   {
3022     'key'         => 'ticket_system-rt_external_url',
3023     'section'     => 'ticketing',
3024     'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
3025     'type'        => 'text',
3026   },
3027
3028   {
3029     'key'         => 'company_name',
3030     'section'     => 'required',
3031     'description' => 'Your company name',
3032     'type'        => 'text',
3033     'per_agent'   => 1, #XXX just FS/FS/ClientAPI/Signup.pm
3034   },
3035
3036   {
3037     'key'         => 'company_url',
3038     'section'     => 'UI',
3039     'description' => 'Your company URL',
3040     'type'        => 'text',
3041     'per_agent'   => 1,
3042   },
3043
3044   {
3045     'key'         => 'company_address',
3046     'section'     => 'required',
3047     'description' => 'Your company address',
3048     'type'        => 'textarea',
3049     'per_agent'   => 1,
3050   },
3051
3052   {
3053     'key'         => 'company_phonenum',
3054     'section'     => 'notification',
3055     'description' => 'Your company phone number',
3056     'type'        => 'text',
3057     'per_agent'   => 1,
3058   },
3059
3060   {
3061     'key'         => 'echeck-void',
3062     'section'     => 'deprecated',
3063     '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',
3064     'type'        => 'checkbox',
3065   },
3066
3067   {
3068     'key'         => 'cc-void',
3069     'section'     => 'deprecated',
3070     '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',
3071     'type'        => 'checkbox',
3072   },
3073
3074   {
3075     'key'         => 'unvoid',
3076     'section'     => 'deprecated',
3077     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable unvoiding of voided payments',
3078     'type'        => 'checkbox',
3079   },
3080
3081   {
3082     'key'         => 'address1-search',
3083     'section'     => 'UI',
3084     'description' => 'Enable the ability to search the address1 field from the quick customer search.  Not recommended in most cases as it tends to bring up too many search results - use explicit address searching from the advanced customer search instead.',
3085     'type'        => 'checkbox',
3086   },
3087
3088   {
3089     'key'         => 'address2-search',
3090     'section'     => 'UI',
3091     'description' => 'Enable a "Unit" search box which searches the second address field.  Useful for multi-tenant applications.  See also: cust_main-require_address2',
3092     'type'        => 'checkbox',
3093   },
3094
3095   {
3096     'key'         => 'cust_main-require_address2',
3097     'section'     => 'UI',
3098     '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',
3099     'type'        => 'checkbox',
3100   },
3101
3102   {
3103     'key'         => 'agent-ship_address',
3104     'section'     => '',
3105     '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.",
3106     'type'        => 'checkbox',
3107     'per_agent'   => 1,
3108   },
3109
3110   { 'key'         => 'referral_credit',
3111     'section'     => 'deprecated',
3112     '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.",
3113     'type'        => 'checkbox',
3114   },
3115
3116   { 'key'         => 'selfservice_server-cache_module',
3117     'section'     => 'self-service',
3118     '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.',
3119     'type'        => 'select',
3120     'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
3121   },
3122
3123   {
3124     'key'         => 'hylafax',
3125     'section'     => 'billing',
3126     '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).',
3127     'type'        => [qw( checkbox textarea )],
3128   },
3129
3130   {
3131     'key'         => 'cust_bill-ftpformat',
3132     'section'     => 'invoicing',
3133     'description' => 'Enable FTP of raw invoice data - format.',
3134     'type'        => 'select',
3135     'select_enum' => [ '', 'default', 'oneline', 'billco', ],
3136   },
3137
3138   {
3139     'key'         => 'cust_bill-ftpserver',
3140     'section'     => 'invoicing',
3141     'description' => 'Enable FTP of raw invoice data - server.',
3142     'type'        => 'text',
3143   },
3144
3145   {
3146     'key'         => 'cust_bill-ftpusername',
3147     'section'     => 'invoicing',
3148     'description' => 'Enable FTP of raw invoice data - login.',
3149     'type'        => 'text',
3150   },
3151
3152   {
3153     'key'         => 'cust_bill-ftppassword',
3154     'section'     => 'invoicing',
3155     'description' => 'Enable FTP of raw invoice data - password.',
3156     'type'        => 'text',
3157   },
3158
3159   {
3160     'key'         => 'cust_bill-ftpdir',
3161     'section'     => 'invoicing',
3162     'description' => 'Enable FTP of raw invoice data - path.',
3163     'type'        => 'text',
3164   },
3165
3166   {
3167     'key'         => 'cust_bill-spoolformat',
3168     'section'     => 'invoicing',
3169     'description' => 'Enable spooling of raw invoice data - format.',
3170     'type'        => 'select',
3171     'select_enum' => [ '', 'default', 'oneline', 'billco', ],
3172   },
3173
3174   {
3175     'key'         => 'cust_bill-spoolagent',
3176     'section'     => 'invoicing',
3177     'description' => 'Enable per-agent spooling of raw invoice data.',
3178     'type'        => 'checkbox',
3179   },
3180
3181     {
3182     'key'         => 'cust_bill-ftp_spool',
3183     'section'     => 'invoicing',
3184     'description' => 'Enable FTP upload of the invoice spool during daily processing',
3185     'type'        => 'checkbox',
3186   },
3187
3188 {
3189     'key'         => 'svc_acct-usage_suspend',
3190     'section'     => 'billing',
3191     '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.',
3192     'type'        => 'checkbox',
3193   },
3194
3195   {
3196     'key'         => 'svc_acct-usage_unsuspend',
3197     'section'     => 'billing',
3198     '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.',
3199     'type'        => 'checkbox',
3200   },
3201
3202   {
3203     'key'         => 'svc_acct-usage_threshold',
3204     'section'     => 'billing',
3205     '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.',
3206     'type'        => 'text',
3207   },
3208
3209   {
3210     'key'         => 'overlimit_groups',
3211     'section'     => '',
3212     'description' => 'RADIUS group(s) to assign to svc_acct which has exceeded its bandwidth or time limit.',
3213     'type'        => 'select-sub',
3214     'per_agent'   => 1,
3215     'multiple'    => 1,
3216     'options_sub' => sub { require FS::Record;
3217                            require FS::radius_group;
3218                            map { $_->groupnum => $_->long_description }
3219                                FS::Record::qsearch('radius_group', {} );
3220                          },
3221     'option_sub'  => sub { require FS::Record;
3222                            require FS::radius_group;
3223                            my $radius_group = FS::Record::qsearchs(
3224                              'radius_group', { 'groupnum' => shift }
3225                            );
3226                $radius_group ? $radius_group->long_description : '';
3227                          },
3228   },
3229
3230   {
3231     'key'         => 'cust-fields',
3232     'section'     => 'UI',
3233     'description' => 'Which customer fields to display on reports by default',
3234     'type'        => 'select',
3235     'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
3236   },
3237
3238   {
3239     'key'         => 'cust_location-label_prefix',
3240     'section'     => 'UI',
3241     'description' => 'Optional "site ID" to show in the location label',
3242     'type'        => 'select',
3243     'select_hash' => [ '' => '',
3244                        'CoStAg' => 'CoStAgXXXXX (country, state, agent name, locationnum)',
3245                       ],
3246   },
3247
3248   {
3249     'key'         => 'cust_pkg-display_times',
3250     'section'     => 'UI',
3251     'description' => 'Display full timestamps (not just dates) for customer packages.  Useful if you are doing real-time things like hourly prepaid.',
3252     'type'        => 'checkbox',
3253   },
3254
3255   {
3256     'key'         => 'cust_pkg-always_show_location',
3257     'section'     => 'UI',
3258     'description' => "Always display package locations, even when they're all the default service address.",
3259     'type'        => 'checkbox',
3260   },
3261
3262   {
3263     'key'         => 'cust_pkg-group_by_location',
3264     'section'     => 'UI',
3265     'description' => "Group packages by location.",
3266     'type'        => 'checkbox',
3267   },
3268
3269   {
3270     'key'         => 'cust_pkg-show_fcc_voice_grade_equivalent',
3271     'section'     => 'UI',
3272     'description' => "Show fields on package definitions for FCC Form 477 classification",
3273     'type'        => 'checkbox',
3274   },
3275
3276   {
3277     'key'         => 'cust_pkg-large_pkg_size',
3278     'section'     => 'UI',
3279     'description' => "In customer view, summarize packages with more than this many services.  Set to zero to never summarize packages.",
3280     'type'        => 'text',
3281   },
3282
3283   {
3284     'key'         => 'svc_acct-edit_uid',
3285     'section'     => 'shell',
3286     'description' => 'Allow UID editing.',
3287     'type'        => 'checkbox',
3288   },
3289
3290   {
3291     'key'         => 'svc_acct-edit_gid',
3292     'section'     => 'shell',
3293     'description' => 'Allow GID editing.',
3294     'type'        => 'checkbox',
3295   },
3296
3297   {
3298     'key'         => 'svc_acct-no_edit_username',
3299     'section'     => 'shell',
3300     'description' => 'Disallow username editing.',
3301     'type'        => 'checkbox',
3302   },
3303
3304   {
3305     'key'         => 'zone-underscore',
3306     'section'     => 'BIND',
3307     'description' => 'Allow underscores in zone names.  As underscores are illegal characters in zone names, this option is not recommended.',
3308     'type'        => 'checkbox',
3309   },
3310
3311   {
3312     'key'         => 'echeck-nonus',
3313     'section'     => 'billing',
3314     'description' => 'Disable ABA-format account checking for Electronic Check payment info',
3315     'type'        => 'checkbox',
3316   },
3317
3318   {
3319     'key'         => 'echeck-country',
3320     'section'     => 'billing',
3321     'description' => 'Format electronic check information for the specified country.',
3322     'type'        => 'select',
3323     'select_hash' => [ 'US' => 'United States',
3324                        'CA' => 'Canada (enables branch)',
3325                        'XX' => 'Other',
3326                      ],
3327   },
3328
3329   {
3330     'key'         => 'voip-cust_accountcode_cdr',
3331     'section'     => 'telephony',
3332     'description' => 'Enable the per-customer option for CDR breakdown by accountcode.',
3333     'type'        => 'checkbox',
3334   },
3335
3336   {
3337     'key'         => 'voip-cust_cdr_spools',
3338     'section'     => 'telephony',
3339     'description' => 'Enable the per-customer option for individual CDR spools.',
3340     'type'        => 'checkbox',
3341   },
3342
3343   {
3344     'key'         => 'voip-cust_cdr_squelch',
3345     'section'     => 'telephony',
3346     'description' => 'Enable the per-customer option for not printing CDR on invoices.',
3347     'type'        => 'checkbox',
3348   },
3349
3350   {
3351     'key'         => 'voip-cdr_email',
3352     'section'     => 'telephony',
3353     'description' => 'Include the call details on emailed invoices (and HTML invoices viewed in the backend), even if the customer is configured for not printing them on the invoices.',
3354     'type'        => 'checkbox',
3355   },
3356
3357   {
3358     'key'         => 'voip-cust_email_csv_cdr',
3359     'section'     => 'telephony',
3360     'description' => 'Enable the per-customer option for including CDR information as a CSV attachment on emailed invoices.',
3361     'type'        => 'checkbox',
3362   },
3363
3364   {
3365     'key'         => 'cgp_rule-domain_templates',
3366     'section'     => '',
3367     'description' => 'Communigate Pro rule templates for domains, one per line, "svcnum Name"',
3368     'type'        => 'textarea',
3369   },
3370
3371   {
3372     'key'         => 'svc_forward-no_srcsvc',
3373     'section'     => '',
3374     '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.",
3375     'type'        => 'checkbox',
3376   },
3377
3378   {
3379     'key'         => 'svc_forward-arbitrary_dst',
3380     'section'     => '',
3381     '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.",
3382     'type'        => 'checkbox',
3383   },
3384
3385   {
3386     'key'         => 'tax-ship_address',
3387     'section'     => 'billing',
3388     'description' => 'By default, tax calculations are done based on the billing address.  Enable this switch to calculate tax based on the shipping address instead.',
3389     'type'        => 'checkbox',
3390   }
3391 ,
3392   {
3393     'key'         => 'tax-pkg_address',
3394     'section'     => 'billing',
3395     '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).',
3396     'type'        => 'checkbox',
3397   },
3398
3399   {
3400     'key'         => 'invoice-ship_address',
3401     'section'     => 'invoicing',
3402     'description' => 'Include the shipping address on invoices.',
3403     'type'        => 'checkbox',
3404   },
3405
3406   {
3407     'key'         => 'invoice-unitprice',
3408     'section'     => 'invoicing',
3409     'description' => 'Enable unit pricing on invoices.',
3410     'type'        => 'checkbox',
3411   },
3412
3413   {
3414     'key'         => 'invoice-smallernotes',
3415     'section'     => 'invoicing',
3416     'description' => 'Display the notes section in a smaller font on invoices.',
3417     'type'        => 'checkbox',
3418   },
3419
3420   {
3421     'key'         => 'invoice-smallerfooter',
3422     'section'     => 'invoicing',
3423     'description' => 'Display footers in a smaller font on invoices.',
3424     'type'        => 'checkbox',
3425   },
3426
3427   {
3428     'key'         => 'postal_invoice-fee_pkgpart',
3429     'section'     => 'billing',
3430     'description' => 'This allows selection of a package to insert on invoices for customers with postal invoices selected.',
3431     'type'        => 'select-part_pkg',
3432     'per_agent'   => 1,
3433   },
3434
3435   {
3436     'key'         => 'postal_invoice-recurring_only',
3437     'section'     => 'billing',
3438     'description' => 'The postal invoice fee is omitted on invoices without recurring charges when this is set.',
3439     'type'        => 'checkbox',
3440   },
3441
3442   {
3443     'key'         => 'batch-enable',
3444     'section'     => 'deprecated', #make sure batch-enable_payby is set for
3445                                    #everyone before removing
3446     'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
3447     'type'        => 'checkbox',
3448   },
3449
3450   {
3451     'key'         => 'batch-enable_payby',
3452     'section'     => 'billing',
3453     'description' => 'Enable batch processing for the specified payment types.',
3454     'type'        => 'selectmultiple',
3455     'select_enum' => [qw( CARD CHEK )],
3456   },
3457
3458   {
3459     'key'         => 'realtime-disable_payby',
3460     'section'     => 'billing',
3461     'description' => 'Disable realtime processing for the specified payment types.',
3462     'type'        => 'selectmultiple',
3463     'select_enum' => [qw( CARD CHEK )],
3464   },
3465
3466   {
3467     'key'         => 'batch-default_format',
3468     'section'     => 'billing',
3469     'description' => 'Default format for batches.',
3470     'type'        => 'select',
3471     'select_enum' => [ 'NACHA', 'csv-td_canada_trust-merchant_pc_batch',
3472                        'csv-chase_canada-E-xactBatch', 'BoM', 'PAP',
3473                        'paymentech', 'ach-spiritone', 'RBC'
3474                     ]
3475   },
3476
3477   #lists could be auto-generated from pay_batch info
3478   {
3479     'key'         => 'batch-fixed_format-CARD',
3480     'section'     => 'billing',
3481     'description' => 'Fixed (unchangeable) format for credit card batches.',
3482     'type'        => 'select',
3483     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
3484                        'csv-chase_canada-E-xactBatch', 'paymentech' ]
3485   },
3486
3487   {
3488     'key'         => 'batch-fixed_format-CHEK',
3489     'section'     => 'billing',
3490     'description' => 'Fixed (unchangeable) format for electronic check batches.',
3491     'type'        => 'select',
3492     'select_enum' => [ 'NACHA', 'csv-td_canada_trust-merchant_pc_batch', 'BoM',
3493                        'PAP', 'paymentech', 'ach-spiritone', 'RBC',
3494                        'td_eft1464', 'eft_canada'
3495                      ]
3496   },
3497
3498   {
3499     'key'         => 'batch-increment_expiration',
3500     'section'     => 'billing',
3501     'description' => 'Increment expiration date years in batches until cards are current.  Make sure this is acceptable to your batching provider before enabling.',
3502     'type'        => 'checkbox'
3503   },
3504
3505   {
3506     'key'         => 'batchconfig-BoM',
3507     'section'     => 'billing',
3508     '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',
3509     'type'        => 'textarea',
3510   },
3511
3512   {
3513     'key'         => 'batchconfig-PAP',
3514     'section'     => 'billing',
3515     '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',
3516     'type'        => 'textarea',
3517   },
3518
3519   {
3520     'key'         => 'batchconfig-csv-chase_canada-E-xactBatch',
3521     'section'     => 'billing',
3522     'description' => 'Gateway ID for Chase Canada E-xact batching',
3523     'type'        => 'text',
3524   },
3525
3526   {
3527     'key'         => 'batchconfig-paymentech',
3528     'section'     => 'billing',
3529     'description' => 'Configuration for Chase Paymentech batching, six lines: 1. BIN, 2. Terminal ID, 3. Merchant ID, 4. Username, 5. Password (for batch uploads), 6. Flag to send recurring indicator.',
3530     'type'        => 'textarea',
3531   },
3532
3533   {
3534     'key'         => 'batchconfig-RBC',
3535     'section'     => 'billing',
3536     'description' => 'Configuration for Royal Bank of Canada PDS batching, four lines: 1. Client number, 2. Short name, 3. Long name, 4. Transaction code.',
3537     'type'        => 'textarea',
3538   },
3539
3540   {
3541     'key'         => 'batchconfig-td_eft1464',
3542     'section'     => 'billing',
3543     'description' => 'Configuration for TD Bank EFT1464 batching, seven lines: 1. Originator ID, 2. Datacenter Code, 3. Short name, 4. Long name, 5. Returned payment branch number, 6. Returned payment account, 7. Transaction code.',
3544     'type'        => 'textarea',
3545   },
3546
3547   {
3548     'key'         => 'batchconfig-eft_canada',
3549     'section'     => 'billing',
3550     'description' => 'Configuration for EFT Canada batching, four lines: 1. SFTP username, 2. SFTP password, 3. Transaction code, 4. Number of days to delay process date.',
3551     'type'        => 'textarea',
3552     'per_agent'   => 1,
3553   },
3554
3555   {
3556     'key'         => 'batchconfig-nacha-destination',
3557     'section'     => 'billing',
3558     'description' => 'Configuration for NACHA batching, Destination (9 digit transit routing number).',
3559     'type'        => 'text',
3560   },
3561
3562   {
3563     'key'         => 'batchconfig-nacha-destination_name',
3564     'section'     => 'billing',
3565     'description' => 'Configuration for NACHA batching, Destination (Bank Name, up to 23 characters).',
3566     'type'        => 'text',
3567   },
3568
3569   {
3570     'key'         => 'batchconfig-nacha-origin',
3571     'section'     => 'billing',
3572     'description' => 'Configuration for NACHA batching, Origin (your 10-digit company number, IRS tax ID recommended).',
3573     'type'        => 'text',
3574   },
3575
3576   {
3577     'key'         => 'batch-manual_approval',
3578     'section'     => 'billing',
3579     'description' => 'Allow manual batch closure, which will approve all payments that do not yet have a status.  This is not advised unless needed for specific payment processors that provide a report of rejected rather than approved payments.',
3580     'type'        => 'checkbox',
3581   },
3582
3583   {
3584     'key'         => 'batch-spoolagent',
3585     'section'     => 'billing',
3586     'description' => 'Store payment batches per-agent.',
3587     'type'        => 'checkbox',
3588   },
3589
3590   {
3591     'key'         => 'payment_history-years',
3592     'section'     => 'UI',
3593     'description' => 'Number of years of payment history to show by default.  Currently defaults to 2.',
3594     'type'        => 'text',
3595   },
3596
3597   {
3598     'key'         => 'change_history-years',
3599     'section'     => 'UI',
3600     'description' => 'Number of years of change history to show by default.  Currently defaults to 0.5.',
3601     'type'        => 'text',
3602   },
3603
3604   {
3605     'key'         => 'cust_main-packages-years',
3606     'section'     => 'UI',
3607     'description' => 'Number of years to show old (cancelled and one-time charge) packages by default.  Currently defaults to 2.',
3608     'type'        => 'text',
3609   },
3610
3611   {
3612     'key'         => 'cust_main-use_comments',
3613     'section'     => 'UI',
3614     'description' => 'Display free form comments on the customer edit screen.  Useful as a scratch pad.',
3615     'type'        => 'checkbox',
3616   },
3617
3618   {
3619     'key'         => 'cust_main-disable_notes',
3620     'section'     => 'UI',
3621     'description' => 'Disable new style customer notes - timestamped and user identified customer notes.  Useful in tracking who did what.',
3622     'type'        => 'checkbox',
3623   },
3624
3625   {
3626     'key'         => 'cust_main_note-display_times',
3627     'section'     => 'UI',
3628     'description' => 'Display full timestamps (not just dates) for customer notes.',
3629     'type'        => 'checkbox',
3630   },
3631
3632   {
3633     'key'         => 'cust_main-ticket_statuses',
3634     'section'     => 'UI',
3635     'description' => 'Show tickets with these statuses on the customer view page.',
3636     'type'        => 'selectmultiple',
3637     'select_enum' => [qw( new open stalled resolved rejected deleted )],
3638   },
3639
3640   {
3641     'key'         => 'cust_main-max_tickets',
3642     'section'     => 'UI',
3643     'description' => 'Maximum number of tickets to show on the customer view page.',
3644     'type'        => 'text',
3645   },
3646
3647   {
3648     'key'         => 'cust_main-skeleton_tables',
3649     'section'     => '',
3650     '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.',
3651     'type'        => 'textarea',
3652   },
3653
3654   {
3655     'key'         => 'cust_main-skeleton_custnum',
3656     'section'     => '',
3657     'description' => 'Customer number specifying the source data to copy into skeleton tables for new customers.',
3658     'type'        => 'text',
3659   },
3660
3661   {
3662     'key'         => 'cust_main-enable_birthdate',
3663     'section'     => 'UI',
3664     'description' => 'Enable tracking of a birth date with each customer record',
3665     'type'        => 'checkbox',
3666   },
3667
3668   {
3669     'key'         => 'cust_main-enable_spouse_birthdate',
3670     'section'     => 'UI',
3671     'description' => 'Enable tracking of a spouse birth date with each customer record',
3672     'type'        => 'checkbox',
3673   },
3674
3675   {
3676     'key'         => 'cust_main-enable_anniversary_date',
3677     'section'     => 'UI',
3678     'description' => 'Enable tracking of an anniversary date with each customer record',
3679     'type'        => 'checkbox',
3680   },
3681
3682   {
3683     'key'         => 'cust_main-edit_calling_list_exempt',
3684     'section'     => 'UI',
3685     'description' => 'Display the "calling_list_exempt" checkbox on customer edit.',
3686     'type'        => 'checkbox',
3687   },
3688
3689   {
3690     'key'         => 'support-key',
3691     'section'     => '',
3692     '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.',
3693     'type'        => 'text',
3694   },
3695
3696   {
3697     'key'         => 'card-types',
3698     'section'     => 'billing',
3699     'description' => 'Select one or more card types to enable only those card types.  If no card types are selected, all card types are available.',
3700     'type'        => 'selectmultiple',
3701     'select_enum' => \@card_types,
3702   },
3703
3704   {
3705     'key'         => 'disable-fuzzy',
3706     'section'     => 'UI',
3707     'description' => 'Disable fuzzy searching.  Speeds up searching for large sites, but only shows exact matches.',
3708     'type'        => 'checkbox',
3709   },
3710
3711   {
3712     'key'         => 'enable_fuzzy_on_exact',
3713     'section'     => 'UI',
3714     'description' => 'Enable approximate customer searching even when an exact match is found.',
3715     'type'        => 'checkbox',
3716   },
3717
3718   { 'key'         => 'pkg_referral',
3719     'section'     => '',
3720     'description' => 'Enable package-specific advertising sources.',
3721     'type'        => 'checkbox',
3722   },
3723
3724   { 'key'         => 'pkg_referral-multiple',
3725     'section'     => '',
3726     'description' => 'In addition, allow multiple advertising sources to be associated with a single package.',
3727     'type'        => 'checkbox',
3728   },
3729
3730   {
3731     'key'         => 'dashboard-install_welcome',
3732     'section'     => 'UI',
3733     'description' => 'New install welcome screen.',
3734     'type'        => 'select',
3735     'select_enum' => [ '', 'ITSP_fsinc_hosted', ],
3736   },
3737
3738   {
3739     'key'         => 'dashboard-toplist',
3740     'section'     => 'UI',
3741     'description' => 'List of items to display on the top of the front page',
3742     'type'        => 'textarea',
3743   },
3744
3745   {
3746     'key'         => 'impending_recur_msgnum',
3747     'section'     => 'notification',
3748     'description' => 'Template to use for alerts about first-time recurring billing.',
3749     %msg_template_options,
3750   },
3751
3752   {
3753     'key'         => 'impending_recur_template',
3754     'section'     => 'deprecated',
3755     '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>',
3756 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
3757     'type'        => 'textarea',
3758   },
3759
3760   {
3761     'key'         => 'logo.png',
3762     'section'     => 'UI',  #'invoicing' ?
3763     'description' => 'Company logo for HTML invoices and the backoffice interface, in PNG format.  Suggested size somewhere near 92x62.',
3764     'type'        => 'image',
3765     'per_agent'   => 1, #XXX just view/logo.cgi, which is for the global
3766                         #old-style editor anyway...?
3767     'per_locale'  => 1,
3768   },
3769
3770   {
3771     'key'         => 'logo.eps',
3772     'section'     => 'invoicing',
3773     'description' => 'Company logo for printed and PDF invoices, in EPS format.',
3774     'type'        => 'image',
3775     'per_agent'   => 1, #XXX as above, kinda
3776     'per_locale'  => 1,
3777   },
3778
3779   {
3780     'key'         => 'selfservice-ignore_quantity',
3781     'section'     => 'self-service',
3782     'description' => 'Ignores service quantity restrictions in self-service context.  Strongly not recommended - just set your quantities correctly in the first place.',
3783     'type'        => 'checkbox',
3784   },
3785
3786   {
3787     'key'         => 'selfservice-session_timeout',
3788     'section'     => 'self-service',
3789     'description' => 'Self-service session timeout.  Defaults to 1 hour.',
3790     'type'        => 'select',
3791     'select_enum' => [ '1 hour', '2 hours', '4 hours', '8 hours', '1 day', '1 week', ],
3792   },
3793
3794   {
3795     'key'         => 'disable_setup_suspended_pkgs',
3796     'section'     => 'billing',
3797     'description' => 'Disables charging of setup fees for suspended packages.',
3798     'type'        => 'checkbox',
3799   },
3800
3801   {
3802     'key'         => 'password-generated-allcaps',
3803     'section'     => 'password',
3804     'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
3805     'type'        => 'checkbox',
3806   },
3807
3808   {
3809     'key'         => 'datavolume-forcemegabytes',
3810     'section'     => 'UI',
3811     'description' => 'All data volumes are expressed in megabytes',
3812     'type'        => 'checkbox',
3813   },
3814
3815   {
3816     'key'         => 'datavolume-significantdigits',
3817     'section'     => 'UI',
3818     'description' => 'number of significant digits to use to represent data volumes',
3819     'type'        => 'text',
3820   },
3821
3822   {
3823     'key'         => 'disable_void_after',
3824     'section'     => 'billing',
3825     'description' => 'Number of seconds after which freeside won\'t attempt to VOID a payment first when performing a refund.',
3826     'type'        => 'text',
3827   },
3828
3829   {
3830     'key'         => 'disable_line_item_date_ranges',
3831     'section'     => 'billing',
3832     'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.',
3833     'type'        => 'checkbox',
3834   },
3835
3836   {
3837     'key'         => 'cust_bill-line_item-date_style',
3838     'section'     => 'billing',
3839     'description' => 'Display format for line item date ranges on invoice line items.',
3840     'type'        => 'select',
3841     'select_hash' => [ ''           => 'STARTDATE-ENDDATE',
3842                        'month_of'   => 'Month of MONTHNAME',
3843                        'X_month'    => 'DATE_DESC MONTHNAME',
3844                      ],
3845     'per_agent'   => 1,
3846   },
3847
3848   {
3849     'key'         => 'cust_bill-line_item-date_style-non_monthly',
3850     'section'     => 'billing',
3851     'description' => 'If set, override cust_bill-line_item-date_style for non-monthly charges.',
3852     'type'        => 'select',
3853     'select_hash' => [ ''           => 'Default',
3854                        'start_end'  => 'STARTDATE-ENDDATE',
3855                        'month_of'   => 'Month of MONTHNAME',
3856                        'X_month'    => 'DATE_DESC MONTHNAME',
3857                      ],
3858     'per_agent'   => 1,
3859   },
3860
3861   {
3862     'key'         => 'cust_bill-line_item-date_description',
3863     'section'     => 'billing',
3864     'description' => 'Text to display for "DATE_DESC" when using cust_bill-line_item-date_style DATE_DESC MONTHNAME.',
3865     'type'        => 'text',
3866     'per_agent'   => 1,
3867   },
3868
3869   {
3870     'key'         => 'support_packages',
3871     'section'     => '',
3872     '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...
3873     'type'        => 'select-part_pkg',
3874     'multiple'    => 1,
3875   },
3876
3877   {
3878     'key'         => 'cust_main-require_phone',
3879     'section'     => '',
3880     'description' => 'Require daytime or night phone for all customer records.',
3881     'type'        => 'checkbox',
3882     'per_agent'   => 1,
3883   },
3884
3885   {
3886     'key'         => 'cust_main-require_invoicing_list_email',
3887     'section'     => '',
3888     'description' => 'Email address field is required: require at least one invoicing email address for all customer records.',
3889     'type'        => 'checkbox',
3890     'per_agent'   => 1,
3891   },
3892
3893   {
3894     'key'         => 'cust_main-check_unique',
3895     'section'     => '',
3896     'description' => 'Warn before creating a customer record where these fields duplicate another customer.',
3897     'type'        => 'select',
3898     'multiple'    => 1,
3899     'select_hash' => [ 
3900       'address1' => 'Billing address',
3901     ],
3902   },
3903
3904   {
3905     'key'         => 'svc_acct-display_paid_time_remaining',
3906     'section'     => '',
3907     'description' => 'Show paid time remaining in addition to time remaining.',
3908     'type'        => 'checkbox',
3909   },
3910
3911   {
3912     'key'         => 'cancel_credit_type',
3913     'section'     => 'billing',
3914     'description' => 'The group to use for new, automatically generated credit reasons resulting from cancellation.',
3915     'type'        => 'select-sub',
3916     'options_sub' => sub { require FS::Record;
3917                            require FS::reason_type;
3918                            map { $_->typenum => $_->type }
3919                                FS::Record::qsearch('reason_type', { class=>'R' } );
3920                          },
3921     'option_sub'  => sub { require FS::Record;
3922                            require FS::reason_type;
3923                            my $reason_type = FS::Record::qsearchs(
3924                              'reason_type', { 'typenum' => shift }
3925                            );
3926                            $reason_type ? $reason_type->type : '';
3927                          },
3928   },
3929
3930   {
3931     'key'         => 'referral_credit_type',
3932     'section'     => 'deprecated',
3933     '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.',
3934     'type'        => 'select-sub',
3935     'options_sub' => sub { require FS::Record;
3936                            require FS::reason_type;
3937                            map { $_->typenum => $_->type }
3938                                FS::Record::qsearch('reason_type', { class=>'R' } );
3939                          },
3940     'option_sub'  => sub { require FS::Record;
3941                            require FS::reason_type;
3942                            my $reason_type = FS::Record::qsearchs(
3943                              'reason_type', { 'typenum' => shift }
3944                            );
3945                            $reason_type ? $reason_type->type : '';
3946                          },
3947   },
3948
3949   {
3950     'key'         => 'signup_credit_type',
3951     'section'     => 'billing', #self-service?
3952     'description' => 'The group to use for new, automatically generated credit reasons resulting from signup and self-service declines.',
3953     'type'        => 'select-sub',
3954     'options_sub' => sub { require FS::Record;
3955                            require FS::reason_type;
3956                            map { $_->typenum => $_->type }
3957                                FS::Record::qsearch('reason_type', { class=>'R' } );
3958                          },
3959     'option_sub'  => sub { require FS::Record;
3960                            require FS::reason_type;
3961                            my $reason_type = FS::Record::qsearchs(
3962                              'reason_type', { 'typenum' => shift }
3963                            );
3964                            $reason_type ? $reason_type->type : '';
3965                          },
3966   },
3967
3968   {
3969     'key'         => 'prepayment_discounts-credit_type',
3970     'section'     => 'billing',
3971     'description' => 'Enables the offering of prepayment discounts and establishes the credit reason type.',
3972     'type'        => 'select-sub',
3973     'options_sub' => sub { require FS::Record;
3974                            require FS::reason_type;
3975                            map { $_->typenum => $_->type }
3976                                FS::Record::qsearch('reason_type', { class=>'R' } );
3977                          },
3978     'option_sub'  => sub { require FS::Record;
3979                            require FS::reason_type;
3980                            my $reason_type = FS::Record::qsearchs(
3981                              'reason_type', { 'typenum' => shift }
3982                            );
3983                            $reason_type ? $reason_type->type : '';
3984                          },
3985
3986   },
3987
3988   {
3989     'key'         => 'cust_main-agent_custid-format',
3990     'section'     => '',
3991     'description' => 'Enables searching of various formatted values in cust_main.agent_custid',
3992     'type'        => 'select',
3993     'select_hash' => [
3994                        ''       => 'Numeric only',
3995                        '\d{7}'  => 'Numeric only, exactly 7 digits',
3996                        'ww?d+'  => 'Numeric with one or two letter prefix',
3997                      ],
3998   },
3999
4000   {
4001     'key'         => 'card_masking_method',
4002     'section'     => 'UI',
4003     '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.',
4004     'type'        => 'select',
4005     'select_hash' => [
4006                        ''            => '123456xxxxxx1234',
4007                        'first6last2' => '123456xxxxxxxx12',
4008                        'first4last4' => '1234xxxxxxxx1234',
4009                        'first4last2' => '1234xxxxxxxxxx12',
4010                        'first2last4' => '12xxxxxxxxxx1234',
4011                        'first2last2' => '12xxxxxxxxxxxx12',
4012                        'first0last4' => 'xxxxxxxxxxxx1234',
4013                        'first0last2' => 'xxxxxxxxxxxxxx12',
4014                      ],
4015   },
4016
4017   {
4018     'key'         => 'disable_previous_balance',
4019     'section'     => 'invoicing',
4020     'description' => 'Disable inclusion of previous balance, payment, and credit lines on invoices.',
4021     'type'        => 'checkbox',
4022     'per_agent'   => 1,
4023   },
4024
4025   {
4026     'key'         => 'previous_balance-exclude_from_total',
4027     'section'     => 'invoicing',
4028     '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',
4029     'type'        => [ qw(checkbox text) ],
4030   },
4031
4032   {
4033     'key'         => 'previous_balance-summary_only',
4034     'section'     => 'invoicing',
4035     'description' => 'Only show a single line summarizing the total previous balance rather than one line per invoice.',
4036     'type'        => 'checkbox',
4037   },
4038
4039   {
4040     'key'         => 'previous_balance-show_credit',
4041     'section'     => 'invoicing',
4042     'description' => 'Show the customer\'s credit balance on invoices when applicable.',
4043     'type'        => 'checkbox',
4044   },
4045
4046   {
4047     'key'         => 'previous_balance-show_on_statements',
4048     'section'     => 'invoicing',
4049     'description' => 'Show previous invoices on statements, without itemized charges.',
4050     'type'        => 'checkbox',
4051   },
4052
4053   {
4054     'key'         => 'previous_balance-payments_since',
4055     'section'     => 'invoicing',
4056     'description' => 'Instead of showing payments (and credits) applied to the invoice, show those received since the previous invoice date.',
4057     'type'        => 'checkbox',
4058   },
4059
4060   {
4061     'key'         => 'balance_due_below_line',
4062     'section'     => 'invoicing',
4063     'description' => 'Place the balance due message below a line.  Only meaningful when when invoice_sections is false.',
4064     'type'        => 'checkbox',
4065   },
4066
4067   {
4068     'key'         => 'usps_webtools-userid',
4069     'section'     => 'UI',
4070     '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.',
4071     'type'        => 'text',
4072   },
4073
4074   {
4075     'key'         => 'usps_webtools-password',
4076     'section'     => 'UI',
4077     '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.',
4078     'type'        => 'text',
4079   },
4080
4081   {
4082     'key'         => 'cust_main-auto_standardize_address',
4083     'section'     => 'UI',
4084     'description' => 'When using USPS web tools, automatically standardize the address without asking.',
4085     'type'        => 'checkbox',
4086   },
4087
4088   {
4089     'key'         => 'cust_main-require_censustract',
4090     'section'     => 'UI',
4091     'description' => 'Customer is required to have a census tract.  Useful for FCC form 477 reports. See also: cust_main-auto_standardize_address',
4092     'type'        => 'checkbox',
4093   },
4094
4095   {
4096     'key'         => 'census_year',
4097     'section'     => 'UI',
4098     'description' => 'The year to use in census tract lookups.  NOTE: you need to select 2012 or 2013 for Year 2010 Census tract codes.  A selection of 2011 provides Year 2000 Census tract codes.  Use the freeside-censustract-update tool if exisitng customers need to be changed.',
4099     'type'        => 'select',
4100     'select_enum' => [ qw( 2013 2012 2011 ) ],
4101   },
4102
4103   {
4104     'key'         => 'tax_district_method',
4105     'section'     => 'UI',
4106     'description' => 'The method to use to look up tax district codes.',
4107     'type'        => 'select',
4108     'select_hash' => [ FS::Misc::Geo::get_district_methods() ],
4109   },
4110
4111   {
4112     'key'         => 'company_latitude',
4113     'section'     => 'UI',
4114     'description' => 'Your company latitude (-90 through 90)',
4115     'type'        => 'text',
4116   },
4117
4118   {
4119     'key'         => 'company_longitude',
4120     'section'     => 'UI',
4121     'description' => 'Your company longitude (-180 thru 180)',
4122     'type'        => 'text',
4123   },
4124
4125   {
4126     'key'         => 'disable_acl_changes',
4127     'section'     => '',
4128     'description' => 'Disable all ACL changes, for demos.',
4129     'type'        => 'checkbox',
4130   },
4131
4132   {
4133     'key'         => 'disable_settings_changes',
4134     'section'     => '',
4135     'description' => 'Disable all settings changes, for demos, except for the usernames given in the comma-separated list.',
4136     'type'        => [qw( checkbox text )],
4137   },
4138
4139   {
4140     'key'         => 'cust_main-edit_agent_custid',
4141     'section'     => 'UI',
4142     'description' => 'Enable editing of the agent_custid field.',
4143     'type'        => 'checkbox',
4144   },
4145
4146   {
4147     'key'         => 'cust_main-default_agent_custid',
4148     'section'     => 'UI',
4149     'description' => 'Display the agent_custid field when available instead of the custnum field.',
4150     'type'        => 'checkbox',
4151   },
4152
4153   {
4154     'key'         => 'cust_main-title-display_custnum',
4155     'section'     => 'UI',
4156     'description' => 'Add the display_custom (agent_custid or custnum) to the title on customer view pages.',
4157     'type'        => 'checkbox',
4158   },
4159
4160   {
4161     'key'         => 'cust_bill-default_agent_invid',
4162     'section'     => 'UI',
4163     'description' => 'Display the agent_invid field when available instead of the invnum field.',
4164     'type'        => 'checkbox',
4165   },
4166
4167   {
4168     'key'         => 'cust_main-auto_agent_custid',
4169     'section'     => 'UI',
4170     'description' => 'Automatically assign an agent_custid - select format',
4171     'type'        => 'select',
4172     'select_hash' => [ '' => 'No',
4173                        '1YMMXXXXXXXX' => '1YMMXXXXXXXX',
4174                      ],
4175   },
4176
4177   {
4178     'key'         => 'cust_main-custnum-display_prefix',
4179     'section'     => 'UI',
4180     'description' => 'Prefix the customer number with this string for display purposes.',
4181     'type'        => 'text',
4182     'per_agent'   => 1,
4183   },
4184
4185   {
4186     'key'         => 'cust_main-custnum-display_special',
4187     'section'     => 'UI',
4188     'description' => 'Use this customer number prefix format',
4189     'type'        => 'select',
4190     'select_hash' => [ '' => '',
4191                        'CoStAg' => 'CoStAg (country, state, agent name or display_prefix)',
4192                        'CoStCl' => 'CoStCl (country, state, class name)' ],
4193   },
4194
4195   {
4196     'key'         => 'cust_main-custnum-display_length',
4197     'section'     => 'UI',
4198     'description' => 'Zero fill the customer number to this many digits for display purposes.',
4199     'type'        => 'text',
4200   },
4201
4202   {
4203     'key'         => 'cust_main-default_areacode',
4204     'section'     => 'UI',
4205     'description' => 'Default area code for customers.',
4206     'type'        => 'text',
4207   },
4208
4209   {
4210     'key'         => 'order_pkg-no_start_date',
4211     'section'     => 'UI',
4212     'description' => 'Don\'t set a default start date for new packages.',
4213     'type'        => 'checkbox',
4214   },
4215
4216   {
4217     'key'         => 'part_pkg-delay_start',
4218     'section'     => '',
4219     'description' => 'Enabled "delayed start" option for packages.',
4220     'type'        => 'checkbox',
4221   },
4222
4223   {
4224     'key'         => 'mcp_svcpart',
4225     'section'     => '',
4226     'description' => 'Master Control Program svcpart.  Leave this blank.',
4227     'type'        => 'text', #select-part_svc
4228   },
4229
4230   {
4231     'key'         => 'cust_bill-max_same_services',
4232     'section'     => 'invoicing',
4233     '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.',
4234     'type'        => 'text',
4235   },
4236
4237   {
4238     'key'         => 'cust_bill-consolidate_services',
4239     'section'     => 'invoicing',
4240     'description' => 'Consolidate service display into fewer lines on invoices rather than one per service.',
4241     'type'        => 'checkbox',
4242   },
4243
4244   {
4245     'key'         => 'suspend_email_admin',
4246     'section'     => '',
4247     'description' => 'Destination admin email address to enable suspension notices',
4248     'type'        => 'text',
4249   },
4250
4251   {
4252     'key'         => 'unsuspend_email_admin',
4253     'section'     => '',
4254     'description' => 'Destination admin email address to enable unsuspension notices',
4255     'type'        => 'text',
4256   },
4257   
4258   {
4259     'key'         => 'email_report-subject',
4260     'section'     => '',
4261     'description' => 'Subject for reports emailed by freeside-fetch.  Defaults to "Freeside report".',
4262     'type'        => 'text',
4263   },
4264
4265   {
4266     'key'         => 'selfservice-head',
4267     'section'     => 'self-service',
4268     'description' => 'HTML for the HEAD section of the self-service interface, typically used for LINK stylesheet tags',
4269     'type'        => 'textarea', #htmlarea?
4270     'per_agent'   => 1,
4271   },
4272
4273
4274   {
4275     'key'         => 'selfservice-body_header',
4276     'section'     => 'self-service',
4277     'description' => 'HTML header for the self-service interface',
4278     'type'        => 'textarea', #htmlarea?
4279     'per_agent'   => 1,
4280   },
4281
4282   {
4283     'key'         => 'selfservice-body_footer',
4284     'section'     => 'self-service',
4285     'description' => 'HTML footer for the self-service interface',
4286     'type'        => 'textarea', #htmlarea?
4287     'per_agent'   => 1,
4288   },
4289
4290
4291   {
4292     'key'         => 'selfservice-body_bgcolor',
4293     'section'     => 'self-service',
4294     'description' => 'HTML background color for the self-service interface, for example, #FFFFFF',
4295     'type'        => 'text',
4296     'per_agent'   => 1,
4297   },
4298
4299   {
4300     'key'         => 'selfservice-box_bgcolor',
4301     'section'     => 'self-service',
4302     'description' => 'HTML color for self-service interface input boxes, for example, #C0C0C0',
4303     'type'        => 'text',
4304     'per_agent'   => 1,
4305   },
4306
4307   {
4308     'key'         => 'selfservice-stripe1_bgcolor',
4309     'section'     => 'self-service',
4310     'description' => 'HTML color for self-service interface lists (primary stripe), for example, #FFFFFF',
4311     'type'        => 'text',
4312     'per_agent'   => 1,
4313   },
4314
4315   {
4316     'key'         => 'selfservice-stripe2_bgcolor',
4317     'section'     => 'self-service',
4318     'description' => 'HTML color for self-service interface lists (alternate stripe), for example, #DDDDDD',
4319     'type'        => 'text',
4320     'per_agent'   => 1,
4321   },
4322
4323   {
4324     'key'         => 'selfservice-text_color',
4325     'section'     => 'self-service',
4326     'description' => 'HTML text color for the self-service interface, for example, #000000',
4327     'type'        => 'text',
4328     'per_agent'   => 1,
4329   },
4330
4331   {
4332     'key'         => 'selfservice-link_color',
4333     'section'     => 'self-service',
4334     'description' => 'HTML link color for the self-service interface, for example, #0000FF',
4335     'type'        => 'text',
4336     'per_agent'   => 1,
4337   },
4338
4339   {
4340     'key'         => 'selfservice-vlink_color',
4341     'section'     => 'self-service',
4342     'description' => 'HTML visited link color for the self-service interface, for example, #FF00FF',
4343     'type'        => 'text',
4344     'per_agent'   => 1,
4345   },
4346
4347   {
4348     'key'         => 'selfservice-hlink_color',
4349     'section'     => 'self-service',
4350     'description' => 'HTML hover link color for the self-service interface, for example, #808080',
4351     'type'        => 'text',
4352     'per_agent'   => 1,
4353   },
4354
4355   {
4356     'key'         => 'selfservice-alink_color',
4357     'section'     => 'self-service',
4358     'description' => 'HTML active (clicked) link color for the self-service interface, for example, #808080',
4359     'type'        => 'text',
4360     'per_agent'   => 1,
4361   },
4362
4363   {
4364     'key'         => 'selfservice-font',
4365     'section'     => 'self-service',
4366     'description' => 'HTML font CSS for the self-service interface, for example, 0.9em/1.5em Arial, Helvetica, Geneva, sans-serif',
4367     'type'        => 'text',
4368     'per_agent'   => 1,
4369   },
4370
4371   {
4372     'key'         => 'selfservice-no_logo',
4373     'section'     => 'self-service',
4374     'description' => 'Disable the logo in self-service',
4375     'type'        => 'checkbox',
4376     'per_agent'   => 1,
4377   },
4378
4379   {
4380     'key'         => 'selfservice-title_color',
4381     'section'     => 'self-service',
4382     'description' => 'HTML color for the self-service title, for example, #000000',
4383     'type'        => 'text',
4384     'per_agent'   => 1,
4385   },
4386
4387   {
4388     'key'         => 'selfservice-title_align',
4389     'section'     => 'self-service',
4390     'description' => 'HTML alignment for the self-service title, for example, center',
4391     'type'        => 'text',
4392     'per_agent'   => 1,
4393   },
4394   {
4395     'key'         => 'selfservice-title_size',
4396     'section'     => 'self-service',
4397     'description' => 'HTML font size for the self-service title, for example, 3',
4398     'type'        => 'text',
4399     'per_agent'   => 1,
4400   },
4401
4402   {
4403     'key'         => 'selfservice-title_left_image',
4404     'section'     => 'self-service',
4405     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
4406     'type'        => 'image',
4407     'per_agent'   => 1,
4408   },
4409
4410   {
4411     'key'         => 'selfservice-title_right_image',
4412     'section'     => 'self-service',
4413     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
4414     'type'        => 'image',
4415     'per_agent'   => 1,
4416   },
4417
4418   {
4419     'key'         => 'selfservice-menu_disable',
4420     'section'     => 'self-service',
4421     'description' => 'Disable the selected menu entries in the self-service menu',
4422     'type'        => 'selectmultiple',
4423     'select_enum' => [ #false laziness w/myaccount_menu.html
4424                        'Overview',
4425                        'Purchase',
4426                        'Purchase additional package',
4427                        'Recharge my account with a credit card',
4428                        'Recharge my account with a check',
4429                        'Recharge my account with a prepaid card',
4430                        'View my usage',
4431                        'Create a ticket',
4432                        'Setup my services',
4433                        'Change my information',
4434                        'Change billing address',
4435                        'Change service address',
4436                        'Change payment information',
4437                        'Change password(s)',
4438                        'Logout',
4439                      ],
4440     'per_agent'   => 1,
4441   },
4442
4443   {
4444     'key'         => 'selfservice-menu_skipblanks',
4445     'section'     => 'self-service',
4446     'description' => 'Skip blank (spacer) entries in the self-service menu',
4447     'type'        => 'checkbox',
4448     'per_agent'   => 1,
4449   },
4450
4451   {
4452     'key'         => 'selfservice-menu_skipheadings',
4453     'section'     => 'self-service',
4454     'description' => 'Skip the unclickable heading entries in the self-service menu',
4455     'type'        => 'checkbox',
4456     'per_agent'   => 1,
4457   },
4458
4459   {
4460     'key'         => 'selfservice-menu_bgcolor',
4461     'section'     => 'self-service',
4462     'description' => 'HTML color for the self-service menu, for example, #C0C0C0',
4463     'type'        => 'text',
4464     'per_agent'   => 1,
4465   },
4466
4467   {
4468     'key'         => 'selfservice-menu_fontsize',
4469     'section'     => 'self-service',
4470     'description' => 'HTML font size for the self-service menu, for example, -1',
4471     'type'        => 'text',
4472     'per_agent'   => 1,
4473   },
4474   {
4475     'key'         => 'selfservice-menu_nounderline',
4476     'section'     => 'self-service',
4477     'description' => 'Styles menu links in the self-service without underlining.',
4478     'type'        => 'checkbox',
4479     'per_agent'   => 1,
4480   },
4481
4482
4483   {
4484     'key'         => 'selfservice-menu_top_image',
4485     'section'     => 'self-service',
4486     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
4487     'type'        => 'image',
4488     'per_agent'   => 1,
4489   },
4490
4491   {
4492     'key'         => 'selfservice-menu_body_image',
4493     'section'     => 'self-service',
4494     'description' => 'Repeating image used for the body of the menu in the self-service interface, in PNG format.',
4495     'type'        => 'image',
4496     'per_agent'   => 1,
4497   },
4498
4499   {
4500     'key'         => 'selfservice-menu_bottom_image',
4501     'section'     => 'self-service',
4502     'description' => 'Image used for the bottom of the menu in the self-service interface, in PNG format.',
4503     'type'        => 'image',
4504     'per_agent'   => 1,
4505   },
4506   
4507   {
4508     'key'         => 'selfservice-view_usage_nodomain',
4509     'section'     => 'self-service',
4510     'description' => 'Show usernames without their domains in "View my usage" in the self-service interface.',
4511     'type'        => 'checkbox',
4512   },
4513
4514   {
4515     'key'         => 'selfservice-login_banner_image',
4516     'section'     => 'self-service',
4517     'description' => 'Banner image shown on the login page, in PNG format.',
4518     'type'        => 'image',
4519   },
4520
4521   {
4522     'key'         => 'selfservice-login_banner_url',
4523     'section'     => 'self-service',
4524     'description' => 'Link for the login banner.',
4525     'type'        => 'text',
4526   },
4527
4528   {
4529     'key'         => 'selfservice-bulk_format',
4530     'section'     => 'deprecated',
4531     'description' => 'Parameter arrangement for selfservice bulk features',
4532     'type'        => 'select',
4533     'select_enum' => [ '', 'izoom-soap', 'izoom-ftp' ],
4534     'per_agent'   => 1,
4535   },
4536
4537   {
4538     'key'         => 'selfservice-bulk_ftp_dir',
4539     'section'     => 'deprecated',
4540     'description' => 'Enable bulk ftp provisioning in this folder',
4541     'type'        => 'text',
4542     'per_agent'   => 1,
4543   },
4544
4545   {
4546     'key'         => 'signup-no_company',
4547     'section'     => 'self-service',
4548     'description' => "Don't display a field for company name on signup.",
4549     'type'        => 'checkbox',
4550   },
4551
4552   {
4553     'key'         => 'signup-recommend_email',
4554     'section'     => 'self-service',
4555     'description' => 'Encourage the entry of an invoicing email address on signup.',
4556     'type'        => 'checkbox',
4557   },
4558
4559   {
4560     'key'         => 'signup-recommend_daytime',
4561     'section'     => 'self-service',
4562     'description' => 'Encourage the entry of a daytime phone number on signup.',
4563     'type'        => 'checkbox',
4564   },
4565
4566   {
4567     'key'         => 'signup-duplicate_cc-warn_hours',
4568     'section'     => 'self-service',
4569     'description' => 'Issue a warning if the same credit card is used for multiple signups within this many hours.',
4570     'type'        => 'text',
4571   },
4572
4573   {
4574     'key'         => 'svc_phone-radius-default_password',
4575     'section'     => 'telephony',
4576     'description' => 'Default password when exporting svc_phone records to RADIUS',
4577     'type'        => 'text',
4578   },
4579
4580   {
4581     'key'         => 'svc_phone-allow_alpha_phonenum',
4582     'section'     => 'telephony',
4583     'description' => 'Allow letters in phone numbers.',
4584     'type'        => 'checkbox',
4585   },
4586
4587   {
4588     'key'         => 'svc_phone-domain',
4589     'section'     => 'telephony',
4590     'description' => 'Track an optional domain association with each phone service.',
4591     'type'        => 'checkbox',
4592   },
4593
4594   {
4595     'key'         => 'svc_phone-phone_name-max_length',
4596     'section'     => 'telephony',
4597     '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.',
4598     'type'        => 'text',
4599   },
4600
4601   {
4602     'key'         => 'svc_phone-random_pin',
4603     'section'     => 'telephony',
4604     'description' => 'Number of random digits to generate in the "PIN" field, if empty.',
4605     'type'        => 'text',
4606   },
4607
4608   {
4609     'key'         => 'svc_phone-lnp',
4610     'section'     => 'telephony',
4611     'description' => 'Enables Number Portability features for svc_phone',
4612     'type'        => 'checkbox',
4613   },
4614
4615   {
4616     'key'         => 'default_phone_countrycode',
4617     'section'     => '',
4618     'description' => 'Default countrcode',
4619     'type'        => 'text',
4620   },
4621
4622   {
4623     'key'         => 'cdr-charged_party-field',
4624     'section'     => 'telephony',
4625     'description' => 'Set the charged_party field of CDRs to this field.',
4626     'type'        => 'select-sub',
4627     'options_sub' => sub { my $fields = FS::cdr->table_info->{'fields'};
4628                            map { $_ => $fields->{$_}||$_ }
4629                            grep { $_ !~ /^(acctid|charged_party)$/ }
4630                            FS::Schema::dbdef->table('cdr')->columns;
4631                          },
4632     'option_sub'  => sub { my $f = shift;
4633                            FS::cdr->table_info->{'fields'}{$f} || $f;
4634                          },
4635   },
4636
4637   #probably deprecate in favor of cdr-charged_party-field above
4638   {
4639     'key'         => 'cdr-charged_party-accountcode',
4640     'section'     => 'telephony',
4641     'description' => 'Set the charged_party field of CDRs to the accountcode.',
4642     'type'        => 'checkbox',
4643   },
4644
4645   {
4646     'key'         => 'cdr-charged_party-accountcode-trim_leading_0s',
4647     'section'     => 'telephony',
4648     'description' => 'When setting the charged_party field of CDRs to the accountcode, trim any leading zeros.',
4649     'type'        => 'checkbox',
4650   },
4651
4652 #  {
4653 #    'key'         => 'cdr-charged_party-truncate_prefix',
4654 #    'section'     => '',
4655 #    'description' => 'If the charged_party field has this prefix, truncate it to the length in cdr-charged_party-truncate_length.',
4656 #    'type'        => 'text',
4657 #  },
4658 #
4659 #  {
4660 #    'key'         => 'cdr-charged_party-truncate_length',
4661 #    'section'     => '',
4662 #    'description' => 'If the charged_party field has the prefix in cdr-charged_party-truncate_prefix, truncate it to this length.',
4663 #    'type'        => 'text',
4664 #  },
4665
4666   {
4667     'key'         => 'cdr-charged_party_rewrite',
4668     'section'     => 'telephony',
4669     '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*.',
4670     'type'        => 'checkbox',
4671   },
4672
4673   {
4674     'key'         => 'cdr-taqua-da_rewrite',
4675     'section'     => 'telephony',
4676     '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.',
4677     'type'        => 'text',
4678   },
4679
4680   {
4681     'key'         => 'cdr-taqua-accountcode_rewrite',
4682     'section'     => 'telephony',
4683     'description' => 'For the Taqua CDR format, pull accountcodes from secondary CDRs with matching sessionNumber.',
4684     'type'        => 'checkbox',
4685   },
4686
4687   {
4688     'key'         => 'cdr-taqua-callerid_rewrite',
4689     'section'     => 'telephony',
4690     'description' => 'For the Taqua CDR format, pull Caller ID blocking information from secondary CDRs.',
4691     'type'        => 'checkbox',
4692   },
4693
4694   {
4695     'key'         => 'cust_pkg-show_autosuspend',
4696     'section'     => 'UI',
4697     'description' => 'Show package auto-suspend dates.  Use with caution for now; can slow down customer view for large insallations.',
4698     'type'        => 'checkbox',
4699   },
4700
4701   {
4702     'key'         => 'cdr-asterisk_forward_rewrite',
4703     'section'     => 'telephony',
4704     '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").',
4705     'type'        => 'checkbox',
4706   },
4707
4708   {
4709     'key'         => 'sg-multicustomer_hack',
4710     'section'     => '',
4711     'description' => "Don't use this.",
4712     'type'        => 'checkbox',
4713   },
4714
4715   {
4716     'key'         => 'sg-ping_username',
4717     'section'     => '',
4718     'description' => "Don't use this.",
4719     'type'        => 'text',
4720   },
4721
4722   {
4723     'key'         => 'sg-ping_password',
4724     'section'     => '',
4725     'description' => "Don't use this.",
4726     'type'        => 'text',
4727   },
4728
4729   {
4730     'key'         => 'sg-login_username',
4731     'section'     => '',
4732     'description' => "Don't use this.",
4733     'type'        => 'text',
4734   },
4735
4736   {
4737     'key'         => 'mc-outbound_packages',
4738     'section'     => '',
4739     'description' => "Don't use this.",
4740     'type'        => 'select-part_pkg',
4741     'multiple'    => 1,
4742   },
4743
4744   {
4745     'key'         => 'disable-cust-pkg_class',
4746     'section'     => 'UI',
4747     'description' => 'Disable the two-step dropdown for selecting package class and package, and return to the classic single dropdown.',
4748     'type'        => 'checkbox',
4749   },
4750
4751   {
4752     'key'         => 'queued-max_kids',
4753     'section'     => '',
4754     'description' => 'Maximum number of queued processes.  Defaults to 10.',
4755     'type'        => 'text',
4756   },
4757
4758   {
4759     'key'         => 'queued-sleep_time',
4760     'section'     => '',
4761     '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.',
4762     'type'        => 'text',
4763   },
4764
4765   {
4766     'key'         => 'cancelled_cust-noevents',
4767     'section'     => 'billing',
4768     'description' => "Don't run events for cancelled customers",
4769     'type'        => 'checkbox',
4770   },
4771
4772   {
4773     'key'         => 'agent-invoice_template',
4774     'section'     => 'invoicing',
4775     'description' => 'Enable display/edit of old-style per-agent invoice template selection',
4776     'type'        => 'checkbox',
4777   },
4778
4779   {
4780     'key'         => 'svc_broadband-manage_link',
4781     'section'     => 'UI',
4782     'description' => 'URL for svc_broadband "Manage Device" link.  The following substitutions are available: $ip_addr and $mac_addr.',
4783     'type'        => 'text',
4784   },
4785
4786   {
4787     'key'         => 'svc_broadband-manage_link_text',
4788     'section'     => 'UI',
4789     'description' => 'Label for "Manage Device" link',
4790     'type'        => 'text',
4791   },
4792
4793   {
4794     'key'         => 'svc_broadband-manage_link_loc',
4795     'section'     => 'UI',
4796     'description' => 'Location for "Manage Device" link',
4797     'type'        => 'select',
4798     'select_hash' => [
4799       'bottom' => 'Near Unprovision link',
4800       'right'  => 'With export-related links',
4801     ],
4802   },
4803
4804   {
4805     'key'         => 'svc_broadband-manage_link-new_window',
4806     'section'     => 'UI',
4807     'description' => 'Open the "Manage Device" link in a new window',
4808     'type'        => 'checkbox',
4809   },
4810
4811   #more fine-grained, service def-level control could be useful eventually?
4812   {
4813     'key'         => 'svc_broadband-allow_null_ip_addr',
4814     'section'     => '',
4815     'description' => '',
4816     'type'        => 'checkbox',
4817   },
4818
4819   {
4820     'key'         => 'svc_hardware-check_mac_addr',
4821     'section'     => '', #?
4822     'description' => 'Require the "hardware address" field in hardware services to be a valid MAC address.',
4823     'type'        => 'checkbox',
4824   },
4825
4826   {
4827     'key'         => 'tax-report_groups',
4828     'section'     => '',
4829     'description' => 'List of grouping possibilities for tax names on reports, one per line, "label op value" (op can be = or !=).',
4830     'type'        => 'textarea',
4831   },
4832
4833   {
4834     'key'         => 'tax-cust_exempt-groups',
4835     'section'     => '',
4836     '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).',
4837     'type'        => 'textarea',
4838   },
4839
4840   {
4841     'key'         => 'tax-cust_exempt-groups-require_individual_nums',
4842     'section'     => '',
4843     'description' => 'When using tax-cust_exempt-groups, require an individual tax exemption number for each exemption from different taxes.',
4844     'type'        => 'checkbox',
4845   },
4846
4847   {
4848     'key'         => 'cust_main-default_view',
4849     'section'     => 'UI',
4850     'description' => 'Default customer view, for users who have not selected a default view in their preferences.',
4851     'type'        => 'select',
4852     'select_hash' => [
4853       #false laziness w/view/cust_main.cgi and pref/pref.html
4854       'basics'          => 'Basics',
4855       'notes'           => 'Notes',
4856       'tickets'         => 'Tickets',
4857       'packages'        => 'Packages',
4858       'payment_history' => 'Payment History',
4859       'change_history'  => 'Change History',
4860       'jumbo'           => 'Jumbo',
4861     ],
4862   },
4863
4864   {
4865     'key'         => 'enable_tax_adjustments',
4866     'section'     => 'billing',
4867     'description' => 'Enable the ability to add manual tax adjustments.',
4868     'type'        => 'checkbox',
4869   },
4870
4871   {
4872     'key'         => 'rt-crontool',
4873     'section'     => '',
4874     'description' => 'Enable the RT CronTool extension.',
4875     'type'        => 'checkbox',
4876   },
4877
4878   {
4879     'key'         => 'pkg-balances',
4880     'section'     => 'billing',
4881     'description' => 'Enable experimental package balances.  Not recommended for general use.',
4882     'type'        => 'checkbox',
4883   },
4884
4885   {
4886     'key'         => 'pkg-addon_classnum',
4887     'section'     => 'billing',
4888     'description' => 'Enable the ability to restrict additional package orders based on package class.',
4889     'type'        => 'checkbox',
4890   },
4891
4892   {
4893     'key'         => 'cust_main-edit_signupdate',
4894     'section'     => 'UI',
4895     'description' => 'Enable manual editing of the signup date.',
4896     'type'        => 'checkbox',
4897   },
4898
4899   {
4900     'key'         => 'svc_acct-disable_access_number',
4901     'section'     => 'UI',
4902     'description' => 'Disable access number selection.',
4903     'type'        => 'checkbox',
4904   },
4905
4906   {
4907     'key'         => 'cust_bill_pay_pkg-manual',
4908     'section'     => 'UI',
4909     'description' => 'Allow manual application of payments to line items.',
4910     'type'        => 'checkbox',
4911   },
4912
4913   {
4914     'key'         => 'cust_credit_bill_pkg-manual',
4915     'section'     => 'UI',
4916     'description' => 'Allow manual application of credits to line items.',
4917     'type'        => 'checkbox',
4918   },
4919
4920   {
4921     'key'         => 'breakage-days',
4922     'section'     => 'billing',
4923     '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.',
4924     'type'        => 'text',
4925     'per_agent'   => 1,
4926   },
4927
4928   {
4929     'key'         => 'breakage-pkg_class',
4930     'section'     => 'billing',
4931     'description' => 'Package class to use for breakage reconciliation.',
4932     'type'        => 'select-pkg_class',
4933   },
4934
4935   {
4936     'key'         => 'disable_cron_billing',
4937     'section'     => 'billing',
4938     '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.',
4939     'type'        => 'checkbox',
4940   },
4941
4942   {
4943     'key'         => 'svc_domain-edit_domain',
4944     'section'     => '',
4945     'description' => 'Enable domain renaming',
4946     'type'        => 'checkbox',
4947   },
4948
4949   {
4950     'key'         => 'enable_legacy_prepaid_income',
4951     'section'     => '',
4952     '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.",
4953     'type'        => 'checkbox',
4954   },
4955
4956   {
4957     'key'         => 'cust_main-exports',
4958     'section'     => '',
4959     'description' => 'Export(s) to call on cust_main insert, modification and deletion.',
4960     'type'        => 'select-sub',
4961     'multiple'    => 1,
4962     'options_sub' => sub {
4963       require FS::Record;
4964       require FS::part_export;
4965       my @part_export =
4966         map { qsearch( 'part_export', {exporttype => $_ } ) }
4967           keys %{FS::part_export::export_info('cust_main')};
4968       map { $_->exportnum => $_->exporttype.' to '.$_->machine } @part_export;
4969     },
4970     'option_sub'  => sub {
4971       require FS::Record;
4972       require FS::part_export;
4973       my $part_export = FS::Record::qsearchs(
4974         'part_export', { 'exportnum' => shift }
4975       );
4976       $part_export
4977         ? $part_export->exporttype.' to '.$part_export->machine
4978         : '';
4979     },
4980   },
4981
4982   {
4983     'key'         => 'cust_tag-location',
4984     'section'     => 'UI',
4985     'description' => 'Location where customer tags are displayed.',
4986     'type'        => 'select',
4987     'select_enum' => [ 'misc_info', 'top' ],
4988   },
4989
4990   {
4991     'key'         => 'maestro-status_test',
4992     'section'     => 'UI',
4993     'description' => 'Display a link to the maestro status test page on the customer view page',
4994     'type'        => 'checkbox',
4995   },
4996
4997   {
4998     'key'         => 'cust_main-custom_link',
4999     'section'     => 'UI',
5000     'description' => 'URL to use as source for the "Custom" tab in the View Customer page.  The customer number will be appended, or you can insert "$custnum" to have it inserted elsewhere.  "$agentnum" will be replaced with the agent number, and "$usernum" will be replaced with the employee number.',
5001     'type'        => 'textarea',
5002   },
5003
5004   {
5005     'key'         => 'cust_main-custom_content',
5006     'section'     => 'UI',
5007     'description' => 'As an alternative to cust_main-custom_link (leave it blank), the contant to display on this customer page, one item per line.  Available iems are: small_custview, birthdate, spouse_birthdate, svc_acct, svc_phone and svc_external.',
5008     'type'        => 'textarea',
5009   },
5010
5011   {
5012     'key'         => 'cust_main-custom_title',
5013     'section'     => 'UI',
5014     'description' => 'Title for the "Custom" tab in the View Customer page.',
5015     'type'        => 'text',
5016   },
5017
5018   {
5019     'key'         => 'part_pkg-default_suspend_bill',
5020     'section'     => 'billing',
5021     'description' => 'Default the "Continue recurring billing while suspended" flag to on for new package definitions.',
5022     'type'        => 'checkbox',
5023   },
5024   
5025   {
5026     'key'         => 'qual-alt_address_format',
5027     'section'     => 'UI',
5028     'description' => 'Enable the alternate address format (location type, number, and kind) for qualifications.',
5029     'type'        => 'checkbox',
5030   },
5031
5032   {
5033     'key'         => 'prospect_main-alt_address_format',
5034     'section'     => 'UI',
5035     'description' => 'Enable the alternate address format (location type, number, and kind) for prospects.  Recommended if qual-alt_address_format is set and the main use of propects is for qualifications.',
5036     'type'        => 'checkbox',
5037   },
5038
5039   {
5040     'key'         => 'prospect_main-location_required',
5041     'section'     => 'UI',
5042     'description' => 'Require an address for prospects.  Recommended if the main use of propects is for qualifications.',
5043     'type'        => 'checkbox',
5044   },
5045
5046   {
5047     'key'         => 'note-classes',
5048     'section'     => 'UI',
5049     'description' => 'Use customer note classes',
5050     'type'        => 'select',
5051     'select_hash' => [
5052                        0 => 'Disabled',
5053                        1 => 'Enabled',
5054                        2 => 'Enabled, with tabs',
5055                      ],
5056   },
5057
5058   {
5059     'key'         => 'svc_acct-cf_privatekey-message',
5060     'section'     => '',
5061     'description' => 'For internal use: HTML displayed when cf_privatekey field is set.',
5062     'type'        => 'textarea',
5063   },
5064
5065   {
5066     'key'         => 'menu-prepend_links',
5067     'section'     => 'UI',
5068     'description' => 'Links to prepend to the main menu, one per line, with format "URL Link Label (optional ALT popup)".',
5069     'type'        => 'textarea',
5070   },
5071
5072   {
5073     'key'         => 'cust_main-external_links',
5074     'section'     => 'UI',
5075     'description' => 'External links available in customer view, one per line, with format "URL Link Label (optional ALT popup)".  The URL will have custnum appended.',
5076     'type'        => 'textarea',
5077   },
5078   
5079   {
5080     'key'         => 'svc_phone-did-summary',
5081     'section'     => 'invoicing',
5082     'description' => 'Experimental feature to enable DID activity summary on invoices, showing # DIDs activated/deactivated/ported-in/ported-out and total minutes usage, covering period since last invoice.',
5083     'type'        => 'checkbox',
5084   },
5085
5086   {
5087     'key'         => 'svc_acct-usage_seconds',
5088     'section'     => 'invoicing',
5089     'description' => 'Enable calculation of RADIUS usage time for invoices.  You must modify your template to display this information.',
5090     'type'        => 'checkbox',
5091   },
5092   
5093   {
5094     'key'         => 'opensips_gwlist',
5095     'section'     => 'telephony',
5096     'description' => 'For svc_phone OpenSIPS dr_rules export, gwlist column value, per-agent',
5097     'type'        => 'text',
5098     'per_agent'   => 1,
5099     'agentonly'   => 1,
5100   },
5101
5102   {
5103     'key'         => 'opensips_description',
5104     'section'     => 'telephony',
5105     'description' => 'For svc_phone OpenSIPS dr_rules export, description column value, per-agent',
5106     'type'        => 'text',
5107     'per_agent'   => 1,
5108     'agentonly'   => 1,
5109   },
5110   
5111   {
5112     'key'         => 'opensips_route',
5113     'section'     => 'telephony',
5114     'description' => 'For svc_phone OpenSIPS dr_rules export, routeid column value, per-agent',
5115     'type'        => 'text',
5116     'per_agent'   => 1,
5117     'agentonly'   => 1,
5118   },
5119
5120   {
5121     'key'         => 'cust_bill-no_recipients-error',
5122     'section'     => 'invoicing',
5123     'description' => 'For customers with no invoice recipients, throw a job queue error rather than the default behavior of emailing the invoice to the invoice_from address.',
5124     'type'        => 'checkbox',
5125   },
5126
5127   {
5128     'key'         => 'cust_bill-latex_lineitem_maxlength',
5129     'section'     => 'invoicing',
5130     'description' => 'Truncate long line items to this number of characters on typeset invoices, to avoid losing things off the right margin.  Defaults to 50.  ',
5131     'type'        => 'text',
5132   },
5133
5134   {
5135     'key'         => 'invoice_payment_details',
5136     'section'     => 'invoicing',
5137     'description' => 'When displaying payments on an invoice, show the payment method used, including the check or credit card number.  Credit card numbers will be masked.',
5138     'type'        => 'checkbox',
5139   },
5140
5141   {
5142     'key'         => 'cust_main-status_module',
5143     'section'     => 'UI',
5144     'description' => 'Which module to use for customer status display.  The "Classic" module (the default) considers accounts with cancelled recurring packages but un-cancelled one-time charges Inactive.  The "Recurring" module considers those customers Cancelled.  Similarly for customers with suspended recurring packages but one-time charges.', #other differences?
5145     'type'        => 'select',
5146     'select_enum' => [ 'Classic', 'Recurring' ],
5147   },
5148
5149   {
5150     'key'         => 'cust_main-print_statement_link',
5151     'section'     => 'UI',
5152     'description' => 'Show a link to download a current statement for the customer.',
5153     'type'        => 'checkbox',
5154   },
5155
5156   { 
5157     'key'         => 'username-pound',
5158     'section'     => 'username',
5159     'description' => 'Allow the pound character (#) in usernames.',
5160     'type'        => 'checkbox',
5161   },
5162
5163   { 
5164     'key'         => 'username-exclamation',
5165     'section'     => 'username',
5166     'description' => 'Allow the exclamation character (!) in usernames.',
5167     'type'        => 'checkbox',
5168   },
5169
5170   {
5171     'key'         => 'ie-compatibility_mode',
5172     'section'     => 'UI',
5173     'description' => "Compatibility mode META tag for Internet Explorer, used on the customer view page.  Not necessary in normal operation unless custom content (notes, cust_main-custom_link) is included on customer view that is incompatibile with newer IE verisons.",
5174     'type'        => 'select',
5175     'select_enum' => [ '', '7', 'EmulateIE7', '8', 'EmulateIE8' ],
5176   },
5177
5178   {
5179     'key'         => 'disable_payauto_default',
5180     'section'     => 'UI',
5181     'description' => 'Disable the "Charge future payments to this (card|check) automatically" checkbox from defaulting to checked.',
5182     'type'        => 'checkbox',
5183   },
5184   
5185   {
5186     'key'         => 'payment-history-report',
5187     'section'     => 'UI',
5188     'description' => 'Show a link to the raw database payment history report in the Reports menu.  DO NOT ENABLE THIS for modern installations.',
5189     'type'        => 'checkbox',
5190   },
5191   
5192   {
5193     'key'         => 'svc_broadband-require-nw-coordinates',
5194     'section'     => 'UI',
5195     'description' => 'On svc_broadband add/edit, require latitude and longitude in the North Western quadrant, e.g. for North American co-ordinates, etc.',
5196     'type'        => 'checkbox',
5197   },
5198   
5199   {
5200     'key'         => 'cust-email-high-visibility',
5201     'section'     => 'UI',
5202     'description' => 'Move the invoicing e-mail address field to the top of the billing address section and highlight it.',
5203     'type'        => 'checkbox',
5204   },
5205   
5206   {
5207     'key'         => 'cust-edit-alt-field-order',
5208     'section'     => 'UI',
5209     'description' => 'An alternate ordering of fields for the New Customer and Edit Customer screens.',
5210     'type'        => 'checkbox',
5211   },
5212
5213   {
5214     'key'         => 'cust_bill-enable_promised_date',
5215     'section'     => 'UI',
5216     'description' => 'Enable display/editing of the "promised payment date" field on invoices.',
5217     'type'        => 'checkbox',
5218   },
5219   
5220   {
5221     'key'         => 'available-locales',
5222     'section'     => '',
5223     'description' => 'Limit available locales (employee preferences, per-customer locale selection, etc.) to a particular set.',
5224     'type'        => 'select-sub',
5225     'multiple'    => 1,
5226     'options_sub' => sub { 
5227       map { $_ => FS::Locales->description($_) }
5228       grep { $_ ne 'en_US' } 
5229       FS::Locales->locales;
5230     },
5231     'option_sub'  => sub { FS::Locales->description(shift) },
5232   },
5233
5234   {
5235     'key'         => 'cust_main-require_locale',
5236     'section'     => 'UI',
5237     'description' => 'Require an explicit locale to be chosen for new customers.',
5238     'type'        => 'checkbox',
5239   },
5240   
5241   {
5242     'key'         => 'translate-auto-insert',
5243     'section'     => '',
5244     'description' => 'Auto-insert untranslated strings for selected non-en_US locales with their default/en_US values.  Do not turn this on unless translating the interface into a new language.',
5245     'type'        => 'select',
5246     'multiple'    => 1,
5247     'select_enum' => [ grep { $_ ne 'en_US' } FS::Locales::locales ],
5248   },
5249
5250   {
5251     'key'         => 'svc_acct-tower_sector',
5252     'section'     => '',
5253     'description' => 'Track tower and sector for svc_acct (account) services.',
5254     'type'        => 'checkbox',
5255   },
5256
5257   {
5258     'key'         => 'brand-agent',
5259     'section'     => 'UI',
5260     'description' => 'Brand the backoffice interface (currently Help->About) using the company_name, company_url and logo.png configuration settings of the selected agent.  Typically used when selling or bundling hosted access to the backoffice interface.  NOTE: The AGPL software license has specific requirements for source code availability in this situation.',
5261     'type'        => 'select-agent',
5262   },
5263
5264
5265   {
5266     'key'         => 'selfservice-billing_history-line_items',
5267     'section'     => 'self-service',
5268     'description' => 'Return line item billing detail for the self-service billing_history API call.',
5269     'type'        => 'checkbox',
5270   },
5271
5272   {
5273     'key'         => 'selfservice-default_cdr_format',
5274     'section'     => 'self-service',
5275     'description' => 'Format for showing outbound CDRs in self-service.  The per-package option overrides this.',
5276     'type'        => 'select',
5277     'select_hash' => \@cdr_formats,
5278   },
5279
5280   {
5281     'key'         => 'selfservice-default_inbound_cdr_format',
5282     'section'     => 'self-service',
5283     'description' => 'Format for showing inbound CDRs in self-service.  The per-package option overrides this.  Leave blank to avoid showing these CDRs.',
5284     'type'        => 'select',
5285     'select_hash' => \@cdr_formats,
5286   },
5287
5288   {
5289     'key'         => 'logout-timeout',
5290     'section'     => 'UI',
5291     'description' => 'If set, automatically log users out of the backoffice after this many minutes.',
5292     'type'       => 'text',
5293   },
5294   
5295   {
5296     'key'         => 'spreadsheet_format',
5297     'section'     => 'UI',
5298     'description' => 'Default format for spreadsheet download.',
5299     'type'        => 'select',
5300     'select_hash' => [
5301       'XLS' => 'XLS (Excel 97/2000/XP)',
5302       'XLSX' => 'XLSX (Excel 2007+)',
5303     ],
5304   },
5305
5306   {
5307     'key'         => 'agent-email_day',
5308     'section'     => '',
5309     'description' => 'On this day of each month, agents with master customer records containing email addresses will be emailed a list of their customers and balances.',
5310     'type'        => 'text',
5311   },
5312
5313   {
5314     'key'         => 'report-cust_pay-select_time',
5315     'section'     => 'UI',
5316     'description' => 'Enable time selection on payment and refund reports.',
5317     'type'        => 'checkbox',
5318   },
5319
5320   {
5321     'key'         => 'api_shared_secret',
5322     'section'     => 'API',
5323     'description' => 'Shared secret for back-office API authentication',
5324     'type'        => 'text',
5325   },
5326
5327   {
5328     'key'         => 'xmlrpc_api',
5329     'section'     => 'API',
5330     'description' => 'Enable the back-office API XML-RPC server (on port 8008).',
5331     'type'        => 'checkbox',
5332   },
5333
5334 #  {
5335 #    'key'         => 'jsonrpc_api',
5336 #    'section'     => 'API',
5337 #    'description' => 'Enable the back-office API JSON-RPC server (on port 8081).',
5338 #    'type'        => 'checkbox',
5339 #  },
5340
5341   { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5342   { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5343   { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5344   { key => "bindprimary", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5345   { key => "bindsecondaries", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5346   { key => "bsdshellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5347   { key => "cyrus", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5348   { key => "cp_app", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5349   { key => "erpcdmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5350   { key => "icradiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5351   { key => "icradius_mysqldest", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5352   { key => "icradius_mysqlsource", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5353   { key => "icradius_secrets", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5354   { key => "maildisablecatchall", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5355   { key => "mxmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5356   { key => "nsmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5357   { key => "arecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5358   { key => "cnamerecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5359   { key => "nismachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5360   { key => "qmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5361   { key => "radiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5362   { key => "sendmailconfigpath", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5363   { key => "sendmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5364   { key => "sendmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5365   { key => "shellmachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5366   { key => "shellmachine-useradd", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5367   { key => "shellmachine-userdel", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5368   { key => "shellmachine-usermod", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5369   { key => "shellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5370   { key => "radiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5371   { key => "textradiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5372   { key => "username_policy", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5373   { key => "vpopmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5374   { key => "vpopmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5375   { key => "safe-part_pkg", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5376   { key => "selfservice_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5377   { key => "signup_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5378   { key => "signup_server-email", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5379   { key => "vonage-username", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5380   { key => "vonage-password", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5381   { key => "vonage-fromnumber", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5382
5383 );
5384
5385 1;
5386