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