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