4e2139b5b2cb0d383a09d9112df94115f027c470
[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-single_invoice_amount',
2826     'section'     => 'billing',
2827     'description' => 'When entering manual credit card and ACH payments, amount will not autofill if the customer has more than one open invoice',
2828     'type'        => 'checkbox',
2829   },
2830
2831   {
2832     'key'         => 'manual_process-pkgpart',
2833     'section'     => 'billing',
2834     '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.',
2835     'type'        => 'select-part_pkg',
2836     'per_agent'   => 1,
2837   },
2838
2839   {
2840     'key'         => 'manual_process-display',
2841     'section'     => 'billing',
2842     'description' => 'When using manual_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
2843     'type'        => 'select',
2844     'select_hash' => [
2845                        'add'      => 'Add fee to amount entered',
2846                        'subtract' => 'Subtract fee from amount entered',
2847                      ],
2848   },
2849
2850   {
2851     'key'         => 'manual_process-skip_first',
2852     'section'     => 'billing',
2853     'description' => "When using manual_process-pkgpart, omit the fee if it is the customer's first payment.",
2854     'type'        => 'checkbox',
2855   },
2856
2857   {
2858     'key'         => 'selfservice_immutable-package',
2859     'section'     => 'self-service',
2860     'description' => 'Disable package changes in self-service interface.',
2861     'type'        => 'checkbox',
2862     'per_agent'   => 1,
2863   },
2864
2865   {
2866     'key'         => 'selfservice_hide-usage',
2867     'section'     => 'self-service',
2868     'description' => 'Hide usage data in self-service interface.',
2869     'type'        => 'checkbox',
2870     'per_agent'   => 1,
2871   },
2872
2873   {
2874     'key'         => 'selfservice_process-pkgpart',
2875     'section'     => 'billing',
2876     '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.',
2877     'type'        => 'select-part_pkg',
2878     'per_agent'   => 1,
2879   },
2880
2881   {
2882     'key'         => 'selfservice_process-display',
2883     'section'     => 'billing',
2884     'description' => 'When using selfservice_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
2885     'type'        => 'select',
2886     'select_hash' => [
2887                        'add'      => 'Add fee to amount entered',
2888                        'subtract' => 'Subtract fee from amount entered',
2889                      ],
2890   },
2891
2892   {
2893     'key'         => 'selfservice_process-skip_first',
2894     'section'     => 'billing',
2895     'description' => "When using selfservice_process-pkgpart, omit the fee if it is the customer's first payment.",
2896     'type'        => 'checkbox',
2897   },
2898
2899 #  {
2900 #    'key'         => 'auto_process-pkgpart',
2901 #    'section'     => 'billing',
2902 #    '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.',
2903 #    'type'        => 'select-part_pkg',
2904 #  },
2905 #
2906 ##  {
2907 ##    'key'         => 'auto_process-display',
2908 ##    'section'     => 'billing',
2909 ##    'description' => 'When using auto_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
2910 ##    'type'        => 'select',
2911 ##    'select_hash' => [
2912 ##                       'add'      => 'Add fee to amount entered',
2913 ##                       'subtract' => 'Subtract fee from amount entered',
2914 ##                     ],
2915 ##  },
2916 #
2917 #  {
2918 #    'key'         => 'auto_process-skip_first',
2919 #    'section'     => 'billing',
2920 #    'description' => "When using auto_process-pkgpart, omit the fee if it is the customer's first payment.",
2921 #    'type'        => 'checkbox',
2922 #  },
2923
2924   {
2925     'key'         => 'allow_negative_charges',
2926     'section'     => 'billing',
2927     'description' => 'Allow negative charges.  Normally not used unless importing data from a legacy system that requires this.',
2928     'type'        => 'checkbox',
2929   },
2930   {
2931       'key'         => 'auto_unset_catchall',
2932       'section'     => '',
2933       '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.',
2934       'type'        => 'checkbox',
2935   },
2936
2937   {
2938     'key'         => 'system_usernames',
2939     'section'     => 'username',
2940     '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.',
2941     'type'        => 'textarea',
2942   },
2943
2944   {
2945     'key'         => 'cust_pkg-change_svcpart',
2946     'section'     => '',
2947     'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
2948     'type'        => 'checkbox',
2949   },
2950
2951   {
2952     'key'         => 'cust_pkg-change_pkgpart-bill_now',
2953     'section'     => '',
2954     '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.",
2955     'type'        => 'checkbox',
2956   },
2957
2958   {
2959     'key'         => 'disable_autoreverse',
2960     'section'     => 'BIND',
2961     'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
2962     'type'        => 'checkbox',
2963   },
2964
2965   {
2966     'key'         => 'svc_www-enable_subdomains',
2967     'section'     => '',
2968     'description' => 'Enable selection of specific subdomains for virtual host creation.',
2969     'type'        => 'checkbox',
2970   },
2971
2972   {
2973     'key'         => 'svc_www-usersvc_svcpart',
2974     'section'     => '',
2975     'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
2976     'type'        => 'select-part_svc',
2977     'multiple'    => 1,
2978   },
2979
2980   {
2981     'key'         => 'selfservice_server-primary_only',
2982     'section'     => 'self-service',
2983     'description' => 'Only allow primary accounts to access self-service functionality.',
2984     'type'        => 'checkbox',
2985   },
2986
2987   {
2988     'key'         => 'selfservice_server-phone_login',
2989     'section'     => 'self-service',
2990     'description' => 'Allow login to self-service with phone number and PIN.',
2991     'type'        => 'checkbox',
2992   },
2993
2994   {
2995     'key'         => 'selfservice_server-single_domain',
2996     'section'     => 'self-service',
2997     'description' => 'If specified, only use this one domain for self-service access.',
2998     'type'        => 'text',
2999   },
3000
3001   {
3002     'key'         => 'selfservice_server-login_svcpart',
3003     'section'     => 'self-service',
3004     'description' => 'If specified, only allow the specified svcparts to login to self-service.',
3005     'type'        => 'select-part_svc',
3006     'multiple'    => 1,
3007   },
3008
3009   {
3010     'key'         => 'selfservice-svc_forward_svcpart',
3011     'section'     => 'self-service',
3012     'description' => 'Service for self-service forward editing.',
3013     'type'        => 'select-part_svc',
3014   },
3015
3016   {
3017     'key'         => 'selfservice-password_reset_verification',
3018     'section'     => 'self-service',
3019     'description' => 'If enabled, specifies the type of verification required for self-service password resets.',
3020     'type'        => 'select',
3021     'select_hash' => [ '' => 'Password reset disabled',
3022                        'email' => 'Click on a link in email',
3023                        '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',
3024                      ],
3025   },
3026
3027   {
3028     'key'         => 'selfservice-password_reset_msgnum',
3029     'section'     => 'self-service',
3030     'description' => 'Template to use for password reset emails.',
3031     %msg_template_options,
3032   },
3033
3034   {
3035     'key'         => 'selfservice-password_change_oldpass',
3036     'section'     => 'self-service',
3037     'description' => 'Require old password to be entered again for password changes (in addition to being logged in), at the API level.',
3038     'type'        => 'checkbox',
3039   },
3040
3041   {
3042     'key'         => 'selfservice-hide_invoices-taxclass',
3043     'section'     => 'self-service',
3044     '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.',
3045     'type'        => 'text',
3046   },
3047
3048   {
3049     'key'         => 'selfservice-recent-did-age',
3050     'section'     => 'self-service',
3051     'description' => 'If specified, defines "recent", in number of seconds, for "Download recently allocated DIDs" in self-service.',
3052     'type'        => 'text',
3053   },
3054
3055   {
3056     'key'         => 'selfservice_server-view-wholesale',
3057     'section'     => 'self-service',
3058     'description' => 'If enabled, use a wholesale package view in the self-service.',
3059     'type'        => 'checkbox',
3060   },
3061   
3062   {
3063     'key'         => 'selfservice-agent_signup',
3064     'section'     => 'self-service',
3065     'description' => 'Allow agent signup via self-service.',
3066     'type'        => 'checkbox',
3067   },
3068
3069   {
3070     'key'         => 'selfservice-agent_signup-agent_type',
3071     'section'     => 'self-service',
3072     'description' => 'Agent type when allowing agent signup via self-service.',
3073     'type'        => 'select-sub',
3074     'options_sub' => sub { require FS::Record;
3075                            require FS::agent_type;
3076                            map { $_->typenum => $_->atype }
3077                                FS::Record::qsearch('agent_type', {} ); # disabled=>'' } );
3078                          },
3079     'option_sub'  => sub { require FS::Record;
3080                            require FS::agent_type;
3081                            my $agent_type = FS::Record::qsearchs(
3082                              'agent_type', { 'typenum'=>shift }
3083                            );
3084                            $agent_type ? $agent_type->atype : '';
3085                          },
3086   },
3087
3088   {
3089     'key'         => 'selfservice-agent_login',
3090     'section'     => 'self-service',
3091     'description' => 'Allow agent login via self-service.',
3092     'type'        => 'checkbox',
3093   },
3094
3095   {
3096     'key'         => 'selfservice-self_suspend_reason',
3097     'section'     => 'self-service',
3098     'description' => 'Suspend reason when customers suspend their own packages. Set to nothing to disallow self-suspension.',
3099     'type'        => 'select-sub',
3100     #false laziness w/api_credit_reason
3101     'options_sub' => sub { require FS::Record;
3102                            require FS::reason;
3103                            my $type = qsearchs('reason_type', 
3104                              { class => 'S' }) 
3105                               or return ();
3106                            map { $_->reasonnum => $_->reason }
3107                                FS::Record::qsearch('reason', 
3108                                  { reason_type => $type->typenum } 
3109                                );
3110                          },
3111     'option_sub'  => sub { require FS::Record;
3112                            require FS::reason;
3113                            my $reason = FS::Record::qsearchs(
3114                              'reason', { 'reasonnum' => shift }
3115                            );
3116                            $reason ? $reason->reason : '';
3117                          },
3118
3119     'per_agent'   => 1,
3120   },
3121
3122   {
3123     'key'         => 'card_refund-days',
3124     'section'     => 'billing',
3125     'description' => 'After a payment, the number of days a refund link will be available for that payment.  Defaults to 120.',
3126     'type'        => 'text',
3127   },
3128
3129   {
3130     'key'         => 'agent-showpasswords',
3131     'section'     => '',
3132     'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
3133     'type'        => 'checkbox',
3134   },
3135
3136   {
3137     'key'         => 'global_unique-username',
3138     'section'     => 'username',
3139     '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.',
3140     'type'        => 'select',
3141     'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
3142   },
3143
3144   {
3145     'key'         => 'global_unique-phonenum',
3146     'section'     => '',
3147     '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.',
3148     'type'        => 'select',
3149     'select_enum' => [ 'none', 'countrycode+phonenum', 'disabled' ],
3150   },
3151
3152   {
3153     'key'         => 'global_unique-pbx_title',
3154     'section'     => '',
3155     'description' => 'Global phone number uniqueness control: none (check uniqueness per exports), enabled (check across all services), or disabled (no duplicate checking).',
3156     'type'        => 'select',
3157     'select_enum' => [ 'enabled', 'disabled' ],
3158   },
3159
3160   {
3161     'key'         => 'global_unique-pbx_id',
3162     'section'     => '',
3163     'description' => 'Global PBX id uniqueness control: none (check uniqueness per exports), enabled (check across all services), or disabled (no duplicate checking).',
3164     'type'        => 'select',
3165     'select_enum' => [ 'enabled', 'disabled' ],
3166   },
3167
3168   {
3169     'key'         => 'svc_external-skip_manual',
3170     'section'     => 'UI',
3171     '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).',
3172     'type'        => 'checkbox',
3173   },
3174
3175   {
3176     'key'         => 'svc_external-display_type',
3177     'section'     => 'UI',
3178     'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
3179     'type'        => 'select',
3180     'select_enum' => [ 'generic', 'artera_turbo', ],
3181   },
3182
3183   {
3184     'key'         => 'ticket_system',
3185     'section'     => 'ticketing',
3186     '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).',
3187     'type'        => 'select',
3188     #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
3189     'select_enum' => [ '', qw(RT_Internal RT_External) ],
3190   },
3191
3192   {
3193     'key'         => 'network_monitoring_system',
3194     'section'     => 'network_monitoring',
3195     '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>).',
3196     'type'        => 'select',
3197     'select_enum' => [ '', qw(Torrus_Internal) ],
3198   },
3199
3200   {
3201     'key'         => 'nms-auto_add-svc_ips',
3202     'section'     => 'network_monitoring',
3203     'description' => 'Automatically add (and remove) IP addresses from these service tables to the network monitoring system.',
3204     'type'        => 'selectmultiple',
3205     'select_enum' => [ 'svc_acct', 'svc_broadband', 'svc_dsl' ],
3206   },
3207
3208   {
3209     'key'         => 'nms-auto_add-community',
3210     'section'     => 'network_monitoring',
3211     'description' => 'SNMP community string to use when automatically adding IP addresses from these services to the network monitoring system.',
3212     'type'        => 'text',
3213   },
3214
3215   {
3216     'key'         => 'ticket_system-default_queueid',
3217     'section'     => 'ticketing',
3218     'description' => 'Default queue used when creating new customer tickets.',
3219     'type'        => 'select-sub',
3220     'options_sub' => sub {
3221                            my $conf = new FS::Conf;
3222                            if ( $conf->config('ticket_system') ) {
3223                              eval "use FS::TicketSystem;";
3224                              die $@ if $@;
3225                              FS::TicketSystem->queues();
3226                            } else {
3227                              ();
3228                            }
3229                          },
3230     'option_sub'  => sub { 
3231                            my $conf = new FS::Conf;
3232                            if ( $conf->config('ticket_system') ) {
3233                              eval "use FS::TicketSystem;";
3234                              die $@ if $@;
3235                              FS::TicketSystem->queue(shift);
3236                            } else {
3237                              '';
3238                            }
3239                          },
3240   },
3241   {
3242     'key'         => 'ticket_system-force_default_queueid',
3243     'section'     => 'ticketing',
3244     'description' => 'Disallow queue selection when creating new tickets from customer view.',
3245     'type'        => 'checkbox',
3246   },
3247   {
3248     'key'         => 'ticket_system-selfservice_queueid',
3249     'section'     => 'ticketing',
3250     'description' => 'Queue used when creating new customer tickets from self-service.  Defautls to ticket_system-default_queueid if not specified.',
3251     #false laziness w/above
3252     'type'        => 'select-sub',
3253     'options_sub' => sub {
3254                            my $conf = new FS::Conf;
3255                            if ( $conf->config('ticket_system') ) {
3256                              eval "use FS::TicketSystem;";
3257                              die $@ if $@;
3258                              FS::TicketSystem->queues();
3259                            } else {
3260                              ();
3261                            }
3262                          },
3263     'option_sub'  => sub { 
3264                            my $conf = new FS::Conf;
3265                            if ( $conf->config('ticket_system') ) {
3266                              eval "use FS::TicketSystem;";
3267                              die $@ if $@;
3268                              FS::TicketSystem->queue(shift);
3269                            } else {
3270                              '';
3271                            }
3272                          },
3273   },
3274
3275   {
3276     'key'         => 'ticket_system-requestor',
3277     'section'     => 'ticketing',
3278     'description' => 'Email address to use as the requestor for new tickets.  If blank, the customer\'s invoicing address(es) will be used.',
3279     'type'        => 'text',
3280   },
3281
3282   {
3283     'key'         => 'ticket_system-priority_reverse',
3284     'section'     => 'ticketing',
3285     '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.',
3286     'type'        => 'checkbox',
3287   },
3288
3289   {
3290     'key'         => 'ticket_system-custom_priority_field',
3291     'section'     => 'ticketing',
3292     'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
3293     'type'        => 'text',
3294   },
3295
3296   {
3297     'key'         => 'ticket_system-custom_priority_field-values',
3298     'section'     => 'ticketing',
3299     'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
3300     'type'        => 'textarea',
3301   },
3302
3303   {
3304     'key'         => 'ticket_system-custom_priority_field_queue',
3305     'section'     => 'ticketing',
3306     'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
3307     'type'        => 'text',
3308   },
3309
3310   {
3311     'key'         => 'ticket_system-selfservice_priority_field',
3312     'section'     => 'ticketing',
3313     'description' => 'Custom field from the ticket system to use as a customer-managed priority field.',
3314     'type'        => 'text',
3315   },
3316
3317   {
3318     'key'         => 'ticket_system-selfservice_edit_subject',
3319     'section'     => 'ticketing',
3320     'description' => 'Allow customers to edit ticket subjects through selfservice.',
3321     'type'        => 'checkbox',
3322   },
3323
3324   {
3325     'key'         => 'ticket_system-escalation',
3326     'section'     => 'ticketing',
3327     'description' => 'Enable priority escalation of tickets as part of daily batch processing.',
3328     'type'        => 'checkbox',
3329   },
3330
3331   {
3332     'key'         => 'ticket_system-rt_external_datasrc',
3333     'section'     => 'ticketing',
3334     '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>',
3335     'type'        => 'text',
3336
3337   },
3338
3339   {
3340     'key'         => 'ticket_system-rt_external_url',
3341     'section'     => 'ticketing',
3342     'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
3343     'type'        => 'text',
3344   },
3345
3346   {
3347     'key'         => 'company_name',
3348     'section'     => 'required',
3349     'description' => 'Your company name',
3350     'type'        => 'text',
3351     'per_agent'   => 1, #XXX just FS/FS/ClientAPI/Signup.pm
3352   },
3353
3354   {
3355     'key'         => 'company_url',
3356     'section'     => 'UI',
3357     'description' => 'Your company URL',
3358     'type'        => 'text',
3359     'per_agent'   => 1,
3360   },
3361
3362   {
3363     'key'         => 'company_address',
3364     'section'     => 'required',
3365     'description' => 'Your company address',
3366     'type'        => 'textarea',
3367     'per_agent'   => 1,
3368   },
3369
3370   {
3371     'key'         => 'company_phonenum',
3372     'section'     => 'notification',
3373     'description' => 'Your company phone number',
3374     'type'        => 'text',
3375     'per_agent'   => 1,
3376   },
3377
3378   {
3379     'key'         => 'echeck-void',
3380     'section'     => 'deprecated',
3381     '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',
3382     'type'        => 'checkbox',
3383   },
3384
3385   {
3386     'key'         => 'cc-void',
3387     'section'     => 'deprecated',
3388     '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',
3389     'type'        => 'checkbox',
3390   },
3391
3392   {
3393     'key'         => 'unvoid',
3394     'section'     => 'deprecated',
3395     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable unvoiding of voided payments',
3396     'type'        => 'checkbox',
3397   },
3398
3399   {
3400     'key'         => 'address1-search',
3401     'section'     => 'UI',
3402     '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.',
3403     'type'        => 'checkbox',
3404   },
3405
3406   {
3407     'key'         => 'address2-search',
3408     'section'     => 'UI',
3409     'description' => 'Enable a "Unit" search box which searches the second address field.  Useful for multi-tenant applications.  See also: cust_main-require_address2',
3410     'type'        => 'checkbox',
3411   },
3412
3413   {
3414     'key'         => 'cust_main-require_address2',
3415     'section'     => 'UI',
3416     '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',
3417     'type'        => 'checkbox',
3418   },
3419
3420   {
3421     'key'         => 'agent-ship_address',
3422     'section'     => '',
3423     '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.",
3424     'type'        => 'checkbox',
3425     'per_agent'   => 1,
3426   },
3427
3428   { 'key'         => 'referral_credit',
3429     'section'     => 'deprecated',
3430     '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.",
3431     'type'        => 'checkbox',
3432   },
3433
3434   { 'key'         => 'selfservice_server-cache_module',
3435     'section'     => 'self-service',
3436     '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.',
3437     'type'        => 'select',
3438     'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
3439   },
3440
3441   {
3442     'key'         => 'hylafax',
3443     'section'     => 'billing',
3444     '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).',
3445     'type'        => [qw( checkbox textarea )],
3446   },
3447
3448   {
3449     'key'         => 'cust_bill-ftpformat',
3450     'section'     => 'invoicing',
3451     'description' => 'Enable FTP of raw invoice data - format.',
3452     'type'        => 'select',
3453     'options'     => [ spool_formats() ],
3454   },
3455
3456   {
3457     'key'         => 'cust_bill-ftpserver',
3458     'section'     => 'invoicing',
3459     'description' => 'Enable FTP of raw invoice data - server.',
3460     'type'        => 'text',
3461   },
3462
3463   {
3464     'key'         => 'cust_bill-ftpusername',
3465     'section'     => 'invoicing',
3466     'description' => 'Enable FTP of raw invoice data - server.',
3467     'type'        => 'text',
3468   },
3469
3470   {
3471     'key'         => 'cust_bill-ftppassword',
3472     'section'     => 'invoicing',
3473     'description' => 'Enable FTP of raw invoice data - server.',
3474     'type'        => 'text',
3475   },
3476
3477   {
3478     'key'         => 'cust_bill-ftpdir',
3479     'section'     => 'invoicing',
3480     'description' => 'Enable FTP of raw invoice data - server.',
3481     'type'        => 'text',
3482   },
3483
3484   {
3485     'key'         => 'cust_bill-spoolformat',
3486     'section'     => 'invoicing',
3487     'description' => 'Enable spooling of raw invoice data - format.',
3488     'type'        => 'select',
3489     'options'     => [ spool_formats() ],
3490   },
3491
3492   {
3493     'key'         => 'cust_bill-spoolagent',
3494     'section'     => 'invoicing',
3495     'description' => 'Enable per-agent spooling of raw invoice data.',
3496     'type'        => 'checkbox',
3497   },
3498
3499   {
3500     'key'         => 'bridgestone-batch_counter',
3501     'section'     => '',
3502     'description' => 'Batch counter for spool files.  Increments every time a spool file is uploaded.',
3503     'type'        => 'text',
3504     'per_agent'   => 1,
3505   },
3506
3507   {
3508     'key'         => 'bridgestone-prefix',
3509     'section'     => '',
3510     'description' => 'Agent identifier for uploading to BABT printing service.',
3511     'type'        => 'text',
3512     'per_agent'   => 1,
3513   },
3514
3515   {
3516     'key'         => 'bridgestone-confirm_template',
3517     'section'     => '',
3518     '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.',
3519     # this could use a true message template, but it's hard to see how that
3520     # would make the world a better place
3521     'type'        => 'textarea',
3522     'per_agent'   => 1,
3523   },
3524
3525   {
3526     'key'         => 'ics-confirm_template',
3527     'section'     => '',
3528     'description' => 'Confirmation email template for uploading to ICS invoice printing.  Text::Template format, with variables "%count" and "%sum".',
3529     'type'        => 'textarea',
3530     'per_agent'   => 1,
3531   },
3532
3533   {
3534     'key'         => 'svc_acct-usage_suspend',
3535     'section'     => 'billing',
3536     '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.',
3537     'type'        => 'checkbox',
3538   },
3539
3540   {
3541     'key'         => 'svc_acct-usage_unsuspend',
3542     'section'     => 'billing',
3543     '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.',
3544     'type'        => 'checkbox',
3545   },
3546
3547   {
3548     'key'         => 'svc_acct-usage_threshold',
3549     'section'     => 'billing',
3550     '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.',
3551     'type'        => 'text',
3552   },
3553
3554   {
3555     'key'         => 'overlimit_groups',
3556     'section'     => '',
3557     'description' => 'RADIUS group(s) to assign to svc_acct which has exceeded its bandwidth or time limit.',
3558     'type'        => 'select-sub',
3559     'per_agent'   => 1,
3560     'multiple'    => 1,
3561     'options_sub' => sub { require FS::Record;
3562                            require FS::radius_group;
3563                            map { $_->groupnum => $_->long_description }
3564                                FS::Record::qsearch('radius_group', {} );
3565                          },
3566     'option_sub'  => sub { require FS::Record;
3567                            require FS::radius_group;
3568                            my $radius_group = FS::Record::qsearchs(
3569                              'radius_group', { 'groupnum' => shift }
3570                            );
3571                $radius_group ? $radius_group->long_description : '';
3572                          },
3573   },
3574
3575   {
3576     'key'         => 'cust-fields',
3577     'section'     => 'UI',
3578     'description' => 'Which customer fields to display on reports by default',
3579     'type'        => 'select',
3580     'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
3581   },
3582
3583   {
3584     'key'         => 'cust_location-label_prefix',
3585     'section'     => 'UI',
3586     'description' => 'Optional "site ID" to show in the location label',
3587     'type'        => 'select',
3588     'select_hash' => [ '' => '',
3589                        'CoStAg'    => 'CoStAgXXXXX (country, state, agent name, locationnum)',
3590                        '_location' => 'Manually defined per location',
3591                       ],
3592   },
3593
3594   {
3595     'key'         => 'cust_pkg-display_times',
3596     'section'     => 'UI',
3597     'description' => 'Display full timestamps (not just dates) for customer packages.  Useful if you are doing real-time things like hourly prepaid.',
3598     'type'        => 'checkbox',
3599   },
3600
3601   {
3602     'key'         => 'cust_pkg-always_show_location',
3603     'section'     => 'UI',
3604     'description' => "Always display package locations, even when they're all the default service address.",
3605     'type'        => 'checkbox',
3606   },
3607
3608   {
3609     'key'         => 'cust_pkg-group_by_location',
3610     'section'     => 'UI',
3611     'description' => "Group packages by location.",
3612     'type'        => 'checkbox',
3613   },
3614
3615   {
3616     'key'         => 'cust_pkg-large_pkg_size',
3617     'section'     => 'UI',
3618     'description' => "In customer view, summarize packages with more than this many services.  Set to zero to never summarize packages.",
3619     'type'        => 'text',
3620   },
3621
3622   {
3623     'key'         => 'cust_pkg-hide_discontinued-part_svc',
3624     'section'     => 'UI',
3625     '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.",
3626     'type'        => 'checkbox',
3627   },
3628
3629   {
3630     'key'         => 'part_pkg-show_fcc_options',
3631     'section'     => 'UI',
3632     'description' => "Show fields on package definitions for FCC Form 477 classification",
3633     'type'        => 'checkbox',
3634   },
3635
3636   {
3637     'key'         => 'svc_acct-edit_uid',
3638     'section'     => 'shell',
3639     'description' => 'Allow UID editing.',
3640     'type'        => 'checkbox',
3641   },
3642
3643   {
3644     'key'         => 'svc_acct-edit_gid',
3645     'section'     => 'shell',
3646     'description' => 'Allow GID editing.',
3647     'type'        => 'checkbox',
3648   },
3649
3650   {
3651     'key'         => 'svc_acct-no_edit_username',
3652     'section'     => 'shell',
3653     'description' => 'Disallow username editing.',
3654     'type'        => 'checkbox',
3655   },
3656
3657   {
3658     'key'         => 'zone-underscore',
3659     'section'     => 'BIND',
3660     'description' => 'Allow underscores in zone names.  As underscores are illegal characters in zone names, this option is not recommended.',
3661     'type'        => 'checkbox',
3662   },
3663
3664   {
3665     'key'         => 'echeck-nonus',
3666     'section'     => 'deprecated',
3667     'description' => 'Deprecated; see echeck-country instead.  Used to disable ABA-format account checking for Electronic Check payment info',
3668     'type'        => 'checkbox',
3669   },
3670
3671   {
3672     'key'         => 'echeck-country',
3673     'section'     => 'billing',
3674     'description' => 'Format electronic check information for the specified country.',
3675     'type'        => 'select',
3676     'select_hash' => [ 'US' => 'United States',
3677                        'CA' => 'Canada (enables branch)',
3678                        'XX' => 'Other',
3679                      ],
3680   },
3681
3682   {
3683     'key'         => 'voip-cust_accountcode_cdr',
3684     'section'     => 'telephony',
3685     'description' => 'Enable the per-customer option for CDR breakdown by accountcode.',
3686     'type'        => 'checkbox',
3687   },
3688
3689   {
3690     'key'         => 'voip-cust_cdr_spools',
3691     'section'     => 'telephony',
3692     'description' => 'Enable the per-customer option for individual CDR spools.',
3693     'type'        => 'checkbox',
3694   },
3695
3696   {
3697     'key'         => 'voip-cust_cdr_squelch',
3698     'section'     => 'telephony',
3699     'description' => 'Enable the per-customer option for not printing CDR on invoices.',
3700     'type'        => 'checkbox',
3701   },
3702
3703   {
3704     'key'         => 'voip-cdr_email',
3705     'section'     => 'telephony',
3706     '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.',
3707     'type'        => 'checkbox',
3708   },
3709
3710   {
3711     'key'         => 'voip-cust_email_csv_cdr',
3712     'section'     => 'telephony',
3713     'description' => 'Enable the per-customer option for including CDR information as a CSV attachment on emailed invoices.',
3714     'type'        => 'checkbox',
3715   },
3716
3717   {
3718     'key'         => 'cgp_rule-domain_templates',
3719     'section'     => '',
3720     'description' => 'Communigate Pro rule templates for domains, one per line, "svcnum Name"',
3721     'type'        => 'textarea',
3722   },
3723
3724   {
3725     'key'         => 'svc_forward-no_srcsvc',
3726     'section'     => '',
3727     '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.",
3728     'type'        => 'checkbox',
3729   },
3730
3731   {
3732     'key'         => 'svc_forward-arbitrary_dst',
3733     'section'     => '',
3734     '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.",
3735     'type'        => 'checkbox',
3736   },
3737
3738   {
3739     'key'         => 'tax-ship_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 shipping address instead.',
3742     'type'        => 'checkbox',
3743   }
3744 ,
3745   {
3746     'key'         => 'tax-pkg_address',
3747     'section'     => 'billing',
3748     '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).',
3749     'type'        => 'checkbox',
3750   },
3751
3752   {
3753     'key'         => 'invoice-ship_address',
3754     'section'     => 'invoicing',
3755     'description' => 'Include the shipping address on invoices.',
3756     'type'        => 'checkbox',
3757   },
3758
3759   {
3760     'key'         => 'invoice-unitprice',
3761     'section'     => 'invoicing',
3762     'description' => 'Enable unit pricing on invoices and quantities on packages.',
3763     'type'        => 'checkbox',
3764   },
3765
3766   {
3767     'key'         => 'invoice-smallernotes',
3768     'section'     => 'invoicing',
3769     'description' => 'Display the notes section in a smaller font on invoices.',
3770     'type'        => 'checkbox',
3771   },
3772
3773   {
3774     'key'         => 'invoice-smallerfooter',
3775     'section'     => 'invoicing',
3776     'description' => 'Display footers in a smaller font on invoices.',
3777     'type'        => 'checkbox',
3778   },
3779
3780   {
3781     'key'         => 'postal_invoice-fee_pkgpart',
3782     'section'     => 'billing',
3783     'description' => 'This allows selection of a package to insert on invoices for customers with postal invoices selected.',
3784     'type'        => 'select-part_pkg',
3785     'per_agent'   => 1,
3786   },
3787
3788   {
3789     'key'         => 'postal_invoice-recurring_only',
3790     'section'     => 'billing',
3791     'description' => 'The postal invoice fee is omitted on invoices without recurring charges when this is set.',
3792     'type'        => 'checkbox',
3793   },
3794
3795   {
3796     'key'         => 'batch-enable',
3797     'section'     => 'deprecated', #make sure batch-enable_payby is set for
3798                                    #everyone before removing
3799     'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
3800     'type'        => 'checkbox',
3801   },
3802
3803   {
3804     'key'         => 'batch-enable_payby',
3805     'section'     => 'billing',
3806     'description' => 'Enable batch processing for the specified payment types.',
3807     'type'        => 'selectmultiple',
3808     'select_enum' => [qw( CARD CHEK )],
3809   },
3810
3811   {
3812     'key'         => 'realtime-disable_payby',
3813     'section'     => 'billing',
3814     'description' => 'Disable realtime processing for the specified payment types.',
3815     'type'        => 'selectmultiple',
3816     'select_enum' => [qw( CARD CHEK )],
3817   },
3818
3819   {
3820     'key'         => 'batch-default_format',
3821     'section'     => 'billing',
3822     'description' => 'Default format for batches.',
3823     'type'        => 'select',
3824     'select_enum' => [ 'NACHA', 'csv-td_canada_trust-merchant_pc_batch',
3825                        'csv-chase_canada-E-xactBatch', 'BoM', 'PAP',
3826                        'paymentech', 'ach-spiritone', 'RBC', 'CIBC',
3827                     ]
3828   },
3829
3830   { 'key'         => 'batch-gateway-CARD',
3831     'section'     => 'billing',
3832     'description' => 'Business::BatchPayment gateway for credit card batches.',
3833     %batch_gateway_options,
3834   },
3835
3836   { 'key'         => 'batch-gateway-CHEK',
3837     'section'     => 'billing', 
3838     'description' => 'Business::BatchPayment gateway for check batches.',
3839     %batch_gateway_options,
3840   },
3841
3842   {
3843     'key'         => 'batch-reconsider',
3844     'section'     => 'billing',
3845     '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.',
3846     'type'        => 'checkbox',
3847   },
3848
3849   {
3850     'key'         => 'batch-auto_resolve_days',
3851     'section'     => 'billing',
3852     'description' => 'Automatically resolve payment batches this many days after they were first downloaded.',
3853     'type'        => 'text',
3854   },
3855
3856   {
3857     'key'         => 'batch-auto_resolve_status',
3858     'section'     => 'billing',
3859     'description' => 'When automatically resolving payment batches, take this action for payments of unknown status.',
3860     'type'        => 'select',
3861     'select_enum' => [ 'approve', 'decline' ],
3862   },
3863
3864   {
3865     'key'         => 'batch-errors_to',
3866     'section'     => 'billing',
3867     'description' => 'Email errors when processing batches to this address.  If unspecified, batch processing will stop immediately on error.',
3868     'type'        => 'text',
3869   },
3870
3871   #lists could be auto-generated from pay_batch info
3872   {
3873     'key'         => 'batch-fixed_format-CARD',
3874     'section'     => 'billing',
3875     'description' => 'Fixed (unchangeable) format for credit card batches.',
3876     'type'        => 'select',
3877     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
3878                        'csv-chase_canada-E-xactBatch', 'paymentech' ]
3879   },
3880
3881   {
3882     'key'         => 'batch-fixed_format-CHEK',
3883     'section'     => 'billing',
3884     'description' => 'Fixed (unchangeable) format for electronic check batches.',
3885     'type'        => 'select',
3886     'select_enum' => [ 'NACHA', 'csv-td_canada_trust-merchant_pc_batch', 'BoM',
3887                        'PAP', 'paymentech', 'ach-spiritone', 'RBC',
3888                        'td_eft1464', 'eft_canada', 'CIBC'
3889                      ]
3890   },
3891
3892   {
3893     'key'         => 'batch-increment_expiration',
3894     'section'     => 'billing',
3895     'description' => 'Increment expiration date years in batches until cards are current.  Make sure this is acceptable to your batching provider before enabling.',
3896     'type'        => 'checkbox'
3897   },
3898
3899   {
3900     'key'         => 'batchconfig-BoM',
3901     'section'     => 'billing',
3902     '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',
3903     'type'        => 'textarea',
3904   },
3905
3906 {
3907     'key'         => 'batchconfig-CIBC',
3908     'section'     => 'billing',
3909     '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',
3910     'type'        => 'textarea',
3911   },
3912
3913   {
3914     'key'         => 'batchconfig-PAP',
3915     'section'     => 'billing',
3916     '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',
3917     'type'        => 'textarea',
3918   },
3919
3920   {
3921     'key'         => 'batchconfig-csv-chase_canada-E-xactBatch',
3922     'section'     => 'billing',
3923     'description' => 'Gateway ID for Chase Canada E-xact batching',
3924     'type'        => 'text',
3925   },
3926
3927   {
3928     'key'         => 'batchconfig-paymentech',
3929     'section'     => 'billing',
3930     '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.',
3931     'type'        => 'textarea',
3932   },
3933
3934   {
3935     'key'         => 'batchconfig-RBC',
3936     'section'     => 'billing',
3937     '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.',
3938     'type'        => 'textarea',
3939   },
3940
3941   {
3942     'key'         => 'batchconfig-td_eft1464',
3943     'section'     => 'billing',
3944     '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.',
3945     'type'        => 'textarea',
3946   },
3947
3948   {
3949     'key'         => 'batchconfig-eft_canada',
3950     'section'     => 'billing',
3951     '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.',
3952     'type'        => 'textarea',
3953     'per_agent'   => 1,
3954   },
3955
3956   {
3957     'key'         => 'batchconfig-nacha-destination',
3958     'section'     => 'billing',
3959     'description' => 'Configuration for NACHA batching, Destination (9 digit transit routing number).',
3960     'type'        => 'text',
3961   },
3962
3963   {
3964     'key'         => 'batchconfig-nacha-destination_name',
3965     'section'     => 'billing',
3966     'description' => 'Configuration for NACHA batching, Destination (Bank Name, up to 23 characters).',
3967     'type'        => 'text',
3968   },
3969
3970   {
3971     'key'         => 'batchconfig-nacha-origin',
3972     'section'     => 'billing',
3973     'description' => 'Configuration for NACHA batching, Origin (your 10-digit company number, IRS tax ID recommended).',
3974     'type'        => 'text',
3975   },
3976
3977   {
3978     'key'         => 'batch-manual_approval',
3979     'section'     => 'billing',
3980     '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.',
3981     'type'        => 'checkbox',
3982   },
3983
3984   {
3985     'key'         => 'batch-spoolagent',
3986     'section'     => 'billing',
3987     'description' => 'Store payment batches per-agent.',
3988     'type'        => 'checkbox',
3989   },
3990
3991   {
3992     'key'         => 'payment_history-years',
3993     'section'     => 'UI',
3994     'description' => 'Number of years of payment history to show by default.  Currently defaults to 2.',
3995     'type'        => 'text',
3996   },
3997
3998   {
3999     'key'         => 'change_history-years',
4000     'section'     => 'UI',
4001     'description' => 'Number of years of change history to show by default.  Currently defaults to 0.5.',
4002     'type'        => 'text',
4003   },
4004
4005   {
4006     'key'         => 'cust_main-packages-years',
4007     'section'     => 'UI',
4008     'description' => 'Number of years to show old (cancelled and one-time charge) packages by default.  Currently defaults to 2.',
4009     'type'        => 'text',
4010   },
4011
4012   {
4013     'key'         => 'cust_main-use_comments',
4014     'section'     => 'UI',
4015     'description' => 'Display free form comments on the customer edit screen.  Useful as a scratch pad.',
4016     'type'        => 'checkbox',
4017   },
4018
4019   {
4020     'key'         => 'cust_main-disable_notes',
4021     'section'     => 'UI',
4022     'description' => 'Disable new style customer notes - timestamped and user identified customer notes.  Useful in tracking who did what.',
4023     'type'        => 'checkbox',
4024   },
4025
4026   {
4027     'key'         => 'cust_main_note-display_times',
4028     'section'     => 'UI',
4029     'description' => 'Display full timestamps (not just dates) for customer notes.',
4030     'type'        => 'checkbox',
4031   },
4032
4033   {
4034     'key'         => 'cust_main-ticket_statuses',
4035     'section'     => 'UI',
4036     'description' => 'Show tickets with these statuses on the customer view page.',
4037     'type'        => 'selectmultiple',
4038     'select_enum' => [qw( new open stalled resolved rejected deleted )],
4039   },
4040
4041   {
4042     'key'         => 'cust_main-max_tickets',
4043     'section'     => 'UI',
4044     'description' => 'Maximum number of tickets to show on the customer view page.',
4045     'type'        => 'text',
4046   },
4047
4048   {
4049     'key'         => 'cust_main-enable_birthdate',
4050     'section'     => 'UI',
4051     'description' => 'Enable tracking of a birth date with each customer record',
4052     'type'        => 'checkbox',
4053   },
4054
4055   {
4056     'key'         => 'cust_main-enable_spouse',
4057     'section'     => 'UI',
4058     'description' => 'Enable tracking of a spouse\'s name and date of birth with each customer record',
4059     'type'        => 'checkbox',
4060   },
4061
4062   {
4063     'key'         => 'cust_main-enable_anniversary_date',
4064     'section'     => 'UI',
4065     'description' => 'Enable tracking of an anniversary date with each customer record',
4066     'type'        => 'checkbox',
4067   },
4068
4069   {
4070     'key'         => 'cust_main-enable_order_package',
4071     'section'     => 'UI',
4072     'description' => 'Display order new package on the basic tab',
4073     'type'        => 'checkbox',
4074   },
4075
4076   {
4077     'key'         => 'cust_main-edit_calling_list_exempt',
4078     'section'     => 'UI',
4079     'description' => 'Display the "calling_list_exempt" checkbox on customer edit.',
4080     'type'        => 'checkbox',
4081   },
4082
4083   {
4084     'key'         => 'support-key',
4085     'section'     => '',
4086     '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.',
4087     'type'        => 'text',
4088   },
4089
4090   {
4091     'key'         => 'card-types',
4092     'section'     => 'billing',
4093     'description' => 'Select one or more card types to enable only those card types.  If no card types are selected, all card types are available.',
4094     'type'        => 'selectmultiple',
4095     'select_enum' => \@card_types,
4096   },
4097
4098   {
4099     'key'         => 'disable-fuzzy',
4100     'section'     => 'UI',
4101     'description' => 'Disable fuzzy searching.  Speeds up searching for large sites, but only shows exact matches.',
4102     'type'        => 'checkbox',
4103   },
4104
4105   {
4106     'key'         => 'fuzzy-fuzziness',
4107     'section'     => 'UI',
4108     'description' => 'Set the "fuzziness" of fuzzy searching (see the String::Approx manpage for details).  Defaults to 10%',
4109     'type'        => 'text',
4110   },
4111
4112   {
4113     'key'         => 'enable_fuzzy_on_exact',
4114     'section'     => 'UI',
4115     'description' => 'Enable approximate customer searching even when an exact match is found.',
4116     'type'        => 'checkbox',
4117   },
4118
4119   { 'key'         => 'pkg_referral',
4120     'section'     => '',
4121     'description' => 'Enable package-specific advertising sources.',
4122     'type'        => 'checkbox',
4123   },
4124
4125   { 'key'         => 'pkg_referral-multiple',
4126     'section'     => '',
4127     'description' => 'In addition, allow multiple advertising sources to be associated with a single package.',
4128     'type'        => 'checkbox',
4129   },
4130
4131   {
4132     'key'         => 'dashboard-install_welcome',
4133     'section'     => 'UI',
4134     'description' => 'New install welcome screen.',
4135     'type'        => 'select',
4136     'select_enum' => [ '', 'ITSP_fsinc_hosted', ],
4137   },
4138
4139   {
4140     'key'         => 'dashboard-toplist',
4141     'section'     => 'UI',
4142     'description' => 'List of items to display on the top of the front page',
4143     'type'        => 'textarea',
4144   },
4145
4146   {
4147     'key'         => 'impending_recur_msgnum',
4148     'section'     => 'notification',
4149     'description' => 'Template to use for alerts about first-time recurring billing.',
4150     %msg_template_options,
4151   },
4152
4153   {
4154     'key'         => 'impending_recur_template',
4155     'section'     => 'deprecated',
4156     '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>',
4157 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
4158     'type'        => 'textarea',
4159   },
4160
4161   {
4162     'key'         => 'logo.png',
4163     'section'     => 'UI',  #'invoicing' ?
4164     'description' => 'Company logo for HTML invoices and the backoffice interface, in PNG format.  Suggested size somewhere near 92x62.',
4165     'type'        => 'image',
4166     'per_agent'   => 1, #XXX just view/logo.cgi, which is for the global
4167                         #old-style editor anyway...?
4168     'per_locale'  => 1,
4169   },
4170
4171   {
4172     'key'         => 'logo.eps',
4173     'section'     => 'invoicing',
4174     'description' => 'Company logo for printed and PDF invoices, in EPS format.',
4175     'type'        => 'image',
4176     'per_agent'   => 1, #XXX as above, kinda
4177     'per_locale'  => 1,
4178   },
4179
4180   {
4181     'key'         => 'selfservice-ignore_quantity',
4182     'section'     => 'self-service',
4183     'description' => 'Ignores service quantity restrictions in self-service context.  Strongly not recommended - just set your quantities correctly in the first place.',
4184     'type'        => 'checkbox',
4185   },
4186
4187   {
4188     'key'         => 'selfservice-session_timeout',
4189     'section'     => 'self-service',
4190     'description' => 'Self-service session timeout.  Defaults to 1 hour.',
4191     'type'        => 'select',
4192     'select_enum' => [ '1 hour', '2 hours', '4 hours', '8 hours', '1 day', '1 week', ],
4193   },
4194
4195   {
4196     'key'         => 'password-generated-allcaps',
4197     'section'     => 'password',
4198     'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
4199     'type'        => 'checkbox',
4200   },
4201
4202   {
4203     'key'         => 'datavolume-forcemegabytes',
4204     'section'     => 'UI',
4205     'description' => 'All data volumes are expressed in megabytes',
4206     'type'        => 'checkbox',
4207   },
4208
4209   {
4210     'key'         => 'datavolume-significantdigits',
4211     'section'     => 'UI',
4212     'description' => 'number of significant digits to use to represent data volumes',
4213     'type'        => 'text',
4214   },
4215
4216   {
4217     'key'         => 'disable_void_after',
4218     'section'     => 'billing',
4219     'description' => 'Number of seconds after which freeside won\'t attempt to VOID a payment first when performing a refund.',
4220     'type'        => 'text',
4221   },
4222
4223   {
4224     'key'         => 'disable_line_item_date_ranges',
4225     'section'     => 'billing',
4226     'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.',
4227     'type'        => 'checkbox',
4228   },
4229
4230   {
4231     'key'         => 'cust_bill-line_item-date_style',
4232     'section'     => 'billing',
4233     'description' => 'Display format for line item date ranges on invoice line items.',
4234     'type'        => 'select',
4235     'select_hash' => [ ''           => 'STARTDATE-ENDDATE',
4236                        'month_of'   => 'Month of MONTHNAME',
4237                        'X_month'    => 'DATE_DESC MONTHNAME',
4238                      ],
4239     'per_agent'   => 1,
4240   },
4241
4242   {
4243     'key'         => 'cust_bill-line_item-date_style-non_monthly',
4244     'section'     => 'billing',
4245     'description' => 'If set, override cust_bill-line_item-date_style for non-monthly charges.',
4246     'type'        => 'select',
4247     'select_hash' => [ ''           => 'Default',
4248                        'start_end'  => 'STARTDATE-ENDDATE',
4249                        'month_of'   => 'Month of MONTHNAME',
4250                        'X_month'    => 'DATE_DESC MONTHNAME',
4251                      ],
4252     'per_agent'   => 1,
4253   },
4254
4255   {
4256     'key'         => 'cust_bill-line_item-date_description',
4257     'section'     => 'billing',
4258     'description' => 'Text to display for "DATE_DESC" when using cust_bill-line_item-date_style DATE_DESC MONTHNAME.',
4259     'type'        => 'text',
4260     'per_agent'   => 1,
4261   },
4262
4263   {
4264     'key'         => 'support_packages',
4265     'section'     => '',
4266     '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...
4267     'type'        => 'select-part_pkg',
4268     'multiple'    => 1,
4269   },
4270
4271   {
4272     'key'         => 'cust_main-require_phone',
4273     'section'     => '',
4274     'description' => 'Require daytime or night phone for all customer records.',
4275     'type'        => 'checkbox',
4276     'per_agent'   => 1,
4277   },
4278
4279   {
4280     'key'         => 'cust_main-require_invoicing_list_email',
4281     'section'     => '',
4282     'description' => 'Email address field is required: require at least one invoicing email address for all customer records.',
4283     'type'        => 'checkbox',
4284     'per_agent'   => 1,
4285   },
4286
4287   {
4288     'key'         => 'cust_main-check_unique',
4289     'section'     => '',
4290     'description' => 'Warn before creating a customer record where these fields duplicate another customer.',
4291     'type'        => 'select',
4292     'multiple'    => 1,
4293     'select_hash' => [ 
4294       'address' => 'Billing or service address',
4295     ],
4296   },
4297
4298   {
4299     'key'         => 'svc_acct-display_paid_time_remaining',
4300     'section'     => '',
4301     'description' => 'Show paid time remaining in addition to time remaining.',
4302     'type'        => 'checkbox',
4303   },
4304
4305   {
4306     'key'         => 'cancel_credit_type',
4307     'section'     => 'billing',
4308     'description' => 'The group to use for new, automatically generated credit reasons resulting from cancellation.',
4309     reason_type_options('R'),
4310   },
4311
4312   {
4313     'key'         => 'suspend_credit_type',
4314     'section'     => 'billing',
4315     'description' => 'The group to use for new, automatically generated credit reasons resulting from package suspension.',
4316     reason_type_options('R'),
4317   },
4318
4319   {
4320     'key'         => 'referral_credit_type',
4321     'section'     => 'deprecated',
4322     '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.',
4323     reason_type_options('R'),
4324   },
4325
4326   {
4327     'key'         => 'signup_credit_type',
4328     'section'     => 'billing', #self-service?
4329     'description' => 'The group to use for new, automatically generated credit reasons resulting from signup and self-service declines.',
4330     reason_type_options('R'),
4331   },
4332
4333   {
4334     'key'         => 'prepayment_discounts-credit_type',
4335     'section'     => 'billing',
4336     'description' => 'Enables the offering of prepayment discounts and establishes the credit reason type.',
4337     reason_type_options('R'),
4338   },
4339
4340   {
4341     'key'         => 'cust_main-agent_custid-format',
4342     'section'     => '',
4343     'description' => 'Enables searching of various formatted values in cust_main.agent_custid',
4344     'type'        => 'select',
4345     'select_hash' => [
4346                        ''       => 'Numeric only',
4347                        '\d{7}'  => 'Numeric only, exactly 7 digits',
4348                        'ww?d+'  => 'Numeric with one or two letter prefix',
4349                      ],
4350   },
4351
4352   {
4353     'key'         => 'card_masking_method',
4354     'section'     => 'UI',
4355     '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.',
4356     'type'        => 'select',
4357     'select_hash' => [
4358                        ''            => '123456xxxxxx1234',
4359                        'first6last2' => '123456xxxxxxxx12',
4360                        'first4last4' => '1234xxxxxxxx1234',
4361                        'first4last2' => '1234xxxxxxxxxx12',
4362                        'first2last4' => '12xxxxxxxxxx1234',
4363                        'first2last2' => '12xxxxxxxxxxxx12',
4364                        'first0last4' => 'xxxxxxxxxxxx1234',
4365                        'first0last2' => 'xxxxxxxxxxxxxx12',
4366                      ],
4367   },
4368
4369   {
4370     'key'         => 'disable_previous_balance',
4371     'section'     => 'invoicing',
4372     'description' => 'Disable inclusion of previous balance, payment, and credit lines on invoices.',
4373     'type'        => 'checkbox',
4374     'per_agent'   => 1,
4375   },
4376
4377   {
4378     'key'         => 'previous_balance-exclude_from_total',
4379     'section'     => 'invoicing',
4380     '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',
4381     'type'        => [ qw(checkbox text) ],
4382   },
4383
4384   {
4385     'key'         => 'previous_balance-section',
4386     'section'     => 'invoicing',
4387     'description' => 'Show previous invoice balances in a separate invoice section.  Does not require invoice_sections to be enabled.',
4388     'type'        => 'checkbox',
4389   },
4390
4391   {
4392     'key'         => 'previous_balance-summary_only',
4393     'section'     => 'invoicing',
4394     'description' => 'Only show a single line summarizing the total previous balance rather than one line per invoice.',
4395     'type'        => 'checkbox',
4396   },
4397
4398   {
4399     'key'         => 'previous_balance-show_credit',
4400     'section'     => 'invoicing',
4401     'description' => 'Show the customer\'s credit balance on invoices when applicable.',
4402     'type'        => 'checkbox',
4403   },
4404
4405   {
4406     'key'         => 'previous_balance-show_on_statements',
4407     'section'     => 'invoicing',
4408     'description' => 'Show previous invoices on statements, without itemized charges.',
4409     'type'        => 'checkbox',
4410   },
4411
4412   {
4413     'key'         => 'previous_balance-payments_since',
4414     'section'     => 'invoicing',
4415     'description' => 'Instead of showing payments (and credits) applied to the invoice, show those received since the previous invoice date.',
4416     'type'        => 'checkbox',
4417   },
4418
4419   {
4420     'key'         => 'previous_invoice_history',
4421     'section'     => 'invoicing',
4422     'description' => 'Show a month-by-month history of the customer\'s '.
4423                      'billing amounts.  This requires template '.
4424                      'modification and is currently not supported on the '.
4425                      'stock template.',
4426     'type'        => 'checkbox',
4427   },
4428
4429   {
4430     'key'         => 'balance_due_below_line',
4431     'section'     => 'invoicing',
4432     'description' => 'Place the balance due message below a line.  Only meaningful when when invoice_sections is false.',
4433     'type'        => 'checkbox',
4434   },
4435
4436   {
4437     'key'         => 'always_show_tax',
4438     'section'     => 'invoicing',
4439     'description' => 'Show a line for tax on the invoice even when the tax is zero.  Optionally provide text for the tax name to show.',
4440     'type'        => [ qw(checkbox text) ],
4441   },
4442
4443   {
4444     'key'         => 'address_standardize_method',
4445     'section'     => 'UI', #???
4446     'description' => 'Method for standardizing customer addresses.',
4447     'type'        => 'select',
4448     'select_hash' => [ '' => '', 
4449                        'usps'     => 'U.S. Postal Service',
4450                        'uscensus' => 'U.S. Census Bureau',
4451                        'ezlocate' => 'EZLocate',
4452                        'tomtom'   => 'TomTom',
4453                        'melissa'  => 'Melissa WebSmart',
4454                      ],
4455   },
4456
4457   {
4458     'key'         => 'usps_webtools-userid',
4459     'section'     => 'UI',
4460     '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.',
4461     'type'        => 'text',
4462   },
4463
4464   {
4465     'key'         => 'usps_webtools-password',
4466     'section'     => 'UI',
4467     '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.',
4468     'type'        => 'text',
4469   },
4470
4471   {
4472     'key'         => 'tomtom-userid',
4473     'section'     => 'UI',
4474     '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.',
4475     'type'        => 'text',
4476   },
4477
4478   {
4479     'key'         => 'ezlocate-userid',
4480     'section'     => 'UI',
4481     'description' => 'User ID for EZ-Locate service.  See <a href="http://www.geocode.com/">the TomTom website</a> for access and pricing information.',
4482     'type'        => 'text',
4483   },
4484
4485   {
4486     'key'         => 'ezlocate-password',
4487     'section'     => 'UI',
4488     'description' => 'Password for EZ-Locate service.',
4489     'type'        => 'text'
4490   },
4491
4492   {
4493     'key'         => 'melissa-userid',
4494     'section'     => 'UI', # it's really not...
4495     'description' => 'User ID for Melissa WebSmart service.  See <a href="http://www.melissadata.com/">the Melissa website</a> for access and pricing.',
4496     'type'        => 'text',
4497   },
4498
4499   {
4500     'key'         => 'melissa-enable_geocoding',
4501     'section'     => 'UI',
4502     'description' => 'Use the Melissa service for census tract and coordinate lookups.  Enable this only if your subscription includes geocoding access.',
4503     'type'        => 'checkbox',
4504   },
4505
4506   {
4507     'key'         => 'cust_main-auto_standardize_address',
4508     'section'     => 'UI',
4509     'description' => 'When using USPS web tools, automatically standardize the address without asking.',
4510     'type'        => 'checkbox',
4511   },
4512
4513   {
4514     'key'         => 'cust_main-require_censustract',
4515     'section'     => 'UI',
4516     'description' => 'Customer is required to have a census tract.  Useful for FCC form 477 reports. See also: cust_main-auto_standardize_address',
4517     'type'        => 'checkbox',
4518   },
4519
4520   {
4521     'key'         => 'census_year',
4522     'section'     => 'UI',
4523     '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.',
4524     'type'        => 'select',
4525     'select_enum' => [ qw( 2013 2012 2011 ) ],
4526   },
4527
4528   {
4529     'key'         => 'tax_district_method',
4530     'section'     => 'UI',
4531     'description' => 'The method to use to look up tax district codes.',
4532     'type'        => 'select',
4533     #'select_hash' => [ FS::Misc::Geo::get_district_methods() ],
4534     #after RT#13763, using FS::Misc::Geo here now causes a dependancy loop :/
4535     'select_hash' => [
4536                        ''         => '',
4537                        'wa_sales' => 'Washington sales tax',
4538                      ],
4539   },
4540
4541   {
4542     'key'         => 'company_latitude',
4543     'section'     => 'UI',
4544     'description' => 'Your company latitude (-90 through 90)',
4545     'type'        => 'text',
4546   },
4547
4548   {
4549     'key'         => 'company_longitude',
4550     'section'     => 'UI',
4551     'description' => 'Your company longitude (-180 thru 180)',
4552     'type'        => 'text',
4553   },
4554
4555   {
4556     'key'         => 'geocode_module',
4557     'section'     => '',
4558     'description' => 'Module to geocode (retrieve a latitude and longitude for) addresses',
4559     'type'        => 'select',
4560     'select_enum' => [ 'Geo::Coder::Googlev3' ],
4561   },
4562
4563   {
4564     'key'         => 'geocode-require_nw_coordinates',
4565     'section'     => 'UI',
4566     'description' => 'Require latitude and longitude in the North Western quadrant, e.g. for North American co-ordinates, etc.',
4567     'type'        => 'checkbox',
4568   },
4569
4570   {
4571     'key'         => 'disable_acl_changes',
4572     'section'     => '',
4573     'description' => 'Disable all ACL changes, for demos.',
4574     'type'        => 'checkbox',
4575   },
4576
4577   {
4578     'key'         => 'disable_settings_changes',
4579     'section'     => '',
4580     'description' => 'Disable all settings changes, for demos, except for the usernames given in the comma-separated list.',
4581     'type'        => [qw( checkbox text )],
4582   },
4583
4584   {
4585     'key'         => 'cust_main-edit_agent_custid',
4586     'section'     => 'UI',
4587     'description' => 'Enable editing of the agent_custid field.',
4588     'type'        => 'checkbox',
4589   },
4590
4591   {
4592     'key'         => 'cust_main-default_agent_custid',
4593     'section'     => 'UI',
4594     'description' => 'Display the agent_custid field when available instead of the custnum field.',
4595     'type'        => 'checkbox',
4596   },
4597
4598   {
4599     'key'         => 'cust_main-title-display_custnum',
4600     'section'     => 'UI',
4601     'description' => 'Add the display_custom (agent_custid or custnum) to the title on customer view pages.',
4602     'type'        => 'checkbox',
4603   },
4604
4605   {
4606     'key'         => 'cust_bill-default_agent_invid',
4607     'section'     => 'UI',
4608     'description' => 'Display the agent_invid field when available instead of the invnum field.',
4609     'type'        => 'checkbox',
4610   },
4611
4612   {
4613     'key'         => 'cust_main-auto_agent_custid',
4614     'section'     => 'UI',
4615     'description' => 'Automatically assign an agent_custid - select format',
4616     'type'        => 'select',
4617     'select_hash' => [ '' => 'No',
4618                        '1YMMXXXXXXXX' => '1YMMXXXXXXXX',
4619                      ],
4620   },
4621
4622   {
4623     'key'         => 'cust_main-custnum-display_prefix',
4624     'section'     => 'UI',
4625     'description' => 'Prefix the customer number with this string for display purposes.',
4626     'type'        => 'text',
4627     'per_agent'   => 1,
4628   },
4629
4630   {
4631     'key'         => 'cust_main-custnum-display_special',
4632     'section'     => 'UI',
4633     'description' => 'Use this customer number prefix format',
4634     'type'        => 'select',
4635     'select_hash' => [ '' => '',
4636                        'CoStAg' => 'CoStAg (country, state, agent name or display_prefix)',
4637                        'CoStCl' => 'CoStCl (country, state, class name)' ],
4638   },
4639
4640   {
4641     'key'         => 'cust_main-custnum-display_length',
4642     'section'     => 'UI',
4643     'description' => 'Zero fill the customer number to this many digits for display purposes.',
4644     'type'        => 'text',
4645   },
4646
4647   {
4648     'key'         => 'cust_main-default_areacode',
4649     'section'     => 'UI',
4650     'description' => 'Default area code for customers.',
4651     'type'        => 'text',
4652   },
4653
4654   {
4655     'key'         => 'order_pkg-no_start_date',
4656     'section'     => 'UI',
4657     'description' => 'Don\'t set a default start date for new packages.',
4658     'type'        => 'checkbox',
4659   },
4660
4661   {
4662     'key'         => 'part_pkg-delay_start',
4663     'section'     => '',
4664     'description' => 'Enabled "delayed start" option for packages.',
4665     'type'        => 'checkbox',
4666   },
4667
4668   {
4669     'key'         => 'part_pkg-delay_cancel-days',
4670     'section'     => '',
4671     'description' => 'Expire packages in this many days when using delay_cancel (default is 1)',
4672     'type'        => 'text',
4673     'validate'    => sub { (($_[0] =~ /^\d*$/) && (($_[0] eq '') || $_[0]))
4674                            ? 'Must specify an integer number of days'
4675                            : '' }
4676   },
4677
4678   {
4679     'key'         => 'mcp_svcpart',
4680     'section'     => '',
4681     'description' => 'Master Control Program svcpart.  Leave this blank.',
4682     'type'        => 'text', #select-part_svc
4683   },
4684
4685   {
4686     'key'         => 'cust_bill-max_same_services',
4687     'section'     => 'invoicing',
4688     '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.',
4689     'type'        => 'text',
4690   },
4691
4692   {
4693     'key'         => 'cust_bill-consolidate_services',
4694     'section'     => 'invoicing',
4695     'description' => 'Consolidate service display into fewer lines on invoices rather than one per service.',
4696     'type'        => 'checkbox',
4697   },
4698
4699   {
4700     'key'         => 'suspend_email_admin',
4701     'section'     => '',
4702     'description' => 'Destination admin email address to enable suspension notices',
4703     'type'        => 'text',
4704   },
4705
4706   {
4707     'key'         => 'unsuspend_email_admin',
4708     'section'     => '',
4709     'description' => 'Destination admin email address to enable unsuspension notices',
4710     'type'        => 'text',
4711   },
4712   
4713   {
4714     'key'         => 'email_report-subject',
4715     'section'     => '',
4716     'description' => 'Subject for reports emailed by freeside-fetch.  Defaults to "Freeside report".',
4717     'type'        => 'text',
4718   },
4719
4720   {
4721     'key'         => 'selfservice-head',
4722     'section'     => 'self-service',
4723     'description' => 'HTML for the HEAD section of the self-service interface, typically used for LINK stylesheet tags',
4724     'type'        => 'textarea', #htmlarea?
4725     'per_agent'   => 1,
4726   },
4727
4728
4729   {
4730     'key'         => 'selfservice-body_header',
4731     'section'     => 'self-service',
4732     'description' => 'HTML header for the self-service interface',
4733     'type'        => 'textarea', #htmlarea?
4734     'per_agent'   => 1,
4735   },
4736
4737   {
4738     'key'         => 'selfservice-body_footer',
4739     'section'     => 'self-service',
4740     'description' => 'HTML footer for the self-service interface',
4741     'type'        => 'textarea', #htmlarea?
4742     'per_agent'   => 1,
4743   },
4744
4745
4746   {
4747     'key'         => 'selfservice-body_bgcolor',
4748     'section'     => 'self-service',
4749     'description' => 'HTML background color for the self-service interface, for example, #FFFFFF',
4750     'type'        => 'text',
4751     'per_agent'   => 1,
4752   },
4753
4754   {
4755     'key'         => 'selfservice-box_bgcolor',
4756     'section'     => 'self-service',
4757     'description' => 'HTML color for self-service interface input boxes, for example, #C0C0C0',
4758     'type'        => 'text',
4759     'per_agent'   => 1,
4760   },
4761
4762   {
4763     'key'         => 'selfservice-stripe1_bgcolor',
4764     'section'     => 'self-service',
4765     'description' => 'HTML color for self-service interface lists (primary stripe), for example, #FFFFFF',
4766     'type'        => 'text',
4767     'per_agent'   => 1,
4768   },
4769
4770   {
4771     'key'         => 'selfservice-stripe2_bgcolor',
4772     'section'     => 'self-service',
4773     'description' => 'HTML color for self-service interface lists (alternate stripe), for example, #DDDDDD',
4774     'type'        => 'text',
4775     'per_agent'   => 1,
4776   },
4777
4778   {
4779     'key'         => 'selfservice-text_color',
4780     'section'     => 'self-service',
4781     'description' => 'HTML text color for the self-service interface, for example, #000000',
4782     'type'        => 'text',
4783     'per_agent'   => 1,
4784   },
4785
4786   {
4787     'key'         => 'selfservice-link_color',
4788     'section'     => 'self-service',
4789     'description' => 'HTML link color for the self-service interface, for example, #0000FF',
4790     'type'        => 'text',
4791     'per_agent'   => 1,
4792   },
4793
4794   {
4795     'key'         => 'selfservice-vlink_color',
4796     'section'     => 'self-service',
4797     'description' => 'HTML visited link color for the self-service interface, for example, #FF00FF',
4798     'type'        => 'text',
4799     'per_agent'   => 1,
4800   },
4801
4802   {
4803     'key'         => 'selfservice-hlink_color',
4804     'section'     => 'self-service',
4805     'description' => 'HTML hover link color for the self-service interface, for example, #808080',
4806     'type'        => 'text',
4807     'per_agent'   => 1,
4808   },
4809
4810   {
4811     'key'         => 'selfservice-alink_color',
4812     'section'     => 'self-service',
4813     'description' => 'HTML active (clicked) link color for the self-service interface, for example, #808080',
4814     'type'        => 'text',
4815     'per_agent'   => 1,
4816   },
4817
4818   {
4819     'key'         => 'selfservice-font',
4820     'section'     => 'self-service',
4821     'description' => 'HTML font CSS for the self-service interface, for example, 0.9em/1.5em Arial, Helvetica, Geneva, sans-serif',
4822     'type'        => 'text',
4823     'per_agent'   => 1,
4824   },
4825
4826   {
4827     'key'         => 'selfservice-no_logo',
4828     'section'     => 'self-service',
4829     'description' => 'Disable the logo in self-service',
4830     'type'        => 'checkbox',
4831     'per_agent'   => 1,
4832   },
4833
4834   {
4835     'key'         => 'selfservice-title_color',
4836     'section'     => 'self-service',
4837     'description' => 'HTML color for the self-service title, for example, #000000',
4838     'type'        => 'text',
4839     'per_agent'   => 1,
4840   },
4841
4842   {
4843     'key'         => 'selfservice-title_align',
4844     'section'     => 'self-service',
4845     'description' => 'HTML alignment for the self-service title, for example, center',
4846     'type'        => 'text',
4847     'per_agent'   => 1,
4848   },
4849   {
4850     'key'         => 'selfservice-title_size',
4851     'section'     => 'self-service',
4852     'description' => 'HTML font size for the self-service title, for example, 3',
4853     'type'        => 'text',
4854     'per_agent'   => 1,
4855   },
4856
4857   {
4858     'key'         => 'selfservice-title_left_image',
4859     'section'     => 'self-service',
4860     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
4861     'type'        => 'image',
4862     'per_agent'   => 1,
4863   },
4864
4865   {
4866     'key'         => 'selfservice-title_right_image',
4867     'section'     => 'self-service',
4868     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
4869     'type'        => 'image',
4870     'per_agent'   => 1,
4871   },
4872
4873   {
4874     'key'         => 'selfservice-menu_disable',
4875     'section'     => 'self-service',
4876     'description' => 'Disable the selected menu entries in the self-service menu',
4877     'type'        => 'selectmultiple',
4878     'select_enum' => [ #false laziness w/myaccount_menu.html
4879                        'Overview',
4880                        'Purchase',
4881                        'Purchase additional package',
4882                        'Recharge my account with a credit card',
4883                        'Recharge my account with a check',
4884                        'Recharge my account with a prepaid card',
4885                        'View my usage',
4886                        'Create a ticket',
4887                        'Setup my services',
4888                        'Change my information',
4889                        'Change billing address',
4890                        'Change service address',
4891                        'Change payment information',
4892                        'Change password(s)',
4893                        'Logout',
4894                      ],
4895     'per_agent'   => 1,
4896   },
4897
4898   {
4899     'key'         => 'selfservice-menu_skipblanks',
4900     'section'     => 'self-service',
4901     'description' => 'Skip blank (spacer) entries in the self-service menu',
4902     'type'        => 'checkbox',
4903     'per_agent'   => 1,
4904   },
4905
4906   {
4907     'key'         => 'selfservice-menu_skipheadings',
4908     'section'     => 'self-service',
4909     'description' => 'Skip the unclickable heading entries in the self-service menu',
4910     'type'        => 'checkbox',
4911     'per_agent'   => 1,
4912   },
4913
4914   {
4915     'key'         => 'selfservice-menu_bgcolor',
4916     'section'     => 'self-service',
4917     'description' => 'HTML color for the self-service menu, for example, #C0C0C0',
4918     'type'        => 'text',
4919     'per_agent'   => 1,
4920   },
4921
4922   {
4923     'key'         => 'selfservice-menu_fontsize',
4924     'section'     => 'self-service',
4925     'description' => 'HTML font size for the self-service menu, for example, -1',
4926     'type'        => 'text',
4927     'per_agent'   => 1,
4928   },
4929   {
4930     'key'         => 'selfservice-menu_nounderline',
4931     'section'     => 'self-service',
4932     'description' => 'Styles menu links in the self-service without underlining.',
4933     'type'        => 'checkbox',
4934     'per_agent'   => 1,
4935   },
4936
4937
4938   {
4939     'key'         => 'selfservice-menu_top_image',
4940     'section'     => 'self-service',
4941     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
4942     'type'        => 'image',
4943     'per_agent'   => 1,
4944   },
4945
4946   {
4947     'key'         => 'selfservice-menu_body_image',
4948     'section'     => 'self-service',
4949     'description' => 'Repeating image used for the body of the menu in the self-service interface, in PNG format.',
4950     'type'        => 'image',
4951     'per_agent'   => 1,
4952   },
4953
4954   {
4955     'key'         => 'selfservice-menu_bottom_image',
4956     'section'     => 'self-service',
4957     'description' => 'Image used for the bottom of the menu in the self-service interface, in PNG format.',
4958     'type'        => 'image',
4959     'per_agent'   => 1,
4960   },
4961   
4962   {
4963     'key'         => 'selfservice-view_usage_nodomain',
4964     'section'     => 'self-service',
4965     'description' => 'Show usernames without their domains in "View my usage" in the self-service interface.',
4966     'type'        => 'checkbox',
4967   },
4968
4969   {
4970     'key'         => 'selfservice-login_banner_image',
4971     'section'     => 'self-service',
4972     'description' => 'Banner image shown on the login page, in PNG format.',
4973     'type'        => 'image',
4974   },
4975
4976   {
4977     'key'         => 'selfservice-login_banner_url',
4978     'section'     => 'self-service',
4979     'description' => 'Link for the login banner.',
4980     'type'        => 'text',
4981   },
4982
4983   {
4984     'key'         => 'ng_selfservice-menu',
4985     'section'     => 'self-service',
4986     '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
4987     'type'        => 'textarea',
4988   },
4989
4990   {
4991     'key'         => 'signup-no_company',
4992     'section'     => 'self-service',
4993     'description' => "Don't display a field for company name on signup.",
4994     'type'        => 'checkbox',
4995   },
4996
4997   {
4998     'key'         => 'signup-recommend_email',
4999     'section'     => 'self-service',
5000     'description' => 'Encourage the entry of an invoicing email address on signup.',
5001     'type'        => 'checkbox',
5002   },
5003
5004   {
5005     'key'         => 'signup-recommend_daytime',
5006     'section'     => 'self-service',
5007     'description' => 'Encourage the entry of a daytime phone number on signup.',
5008     'type'        => 'checkbox',
5009   },
5010
5011   {
5012     'key'         => 'signup-duplicate_cc-warn_hours',
5013     'section'     => 'self-service',
5014     'description' => 'Issue a warning if the same credit card is used for multiple signups within this many hours.',
5015     'type'        => 'text',
5016   },
5017
5018   {
5019     'key'         => 'svc_phone-radius-password',
5020     'section'     => 'telephony',
5021     'description' => 'Password when exporting svc_phone records to RADIUS',
5022     'type'        => 'select',
5023     'select_hash' => [
5024       '' => 'Use default from svc_phone-radius-default_password config',
5025       'countrycode_phonenum' => 'Phone number (with country code)',
5026     ],
5027   },
5028
5029   {
5030     'key'         => 'svc_phone-radius-default_password',
5031     'section'     => 'telephony',
5032     'description' => 'Default password when exporting svc_phone records to RADIUS',
5033     'type'        => 'text',
5034   },
5035
5036   {
5037     'key'         => 'svc_phone-allow_alpha_phonenum',
5038     'section'     => 'telephony',
5039     'description' => 'Allow letters in phone numbers.',
5040     'type'        => 'checkbox',
5041   },
5042
5043   {
5044     'key'         => 'svc_phone-domain',
5045     'section'     => 'telephony',
5046     'description' => 'Track an optional domain association with each phone service.',
5047     'type'        => 'checkbox',
5048   },
5049
5050   {
5051     'key'         => 'svc_phone-phone_name-max_length',
5052     'section'     => 'telephony',
5053     '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.',
5054     'type'        => 'text',
5055   },
5056
5057   {
5058     'key'         => 'svc_phone-random_pin',
5059     'section'     => 'telephony',
5060     'description' => 'Number of random digits to generate in the "PIN" field, if empty.',
5061     'type'        => 'text',
5062   },
5063
5064   {
5065     'key'         => 'svc_phone-lnp',
5066     'section'     => 'telephony',
5067     'description' => 'Enables Number Portability features for svc_phone',
5068     'type'        => 'checkbox',
5069   },
5070
5071   {
5072     'key'         => 'svc_phone-bulk_provision_simple',
5073     'section'     => 'telephony',
5074     'description' => 'Bulk provision phone numbers with a simple number range instead of from DID vendor orders',
5075     'type'        => 'checkbox',
5076   },
5077
5078   {
5079     'key'         => 'default_phone_countrycode',
5080     'section'     => 'telephony',
5081     'description' => 'Default countrycode',
5082     'type'        => 'text',
5083   },
5084
5085   {
5086     'key'         => 'cdr-charged_party-field',
5087     'section'     => 'telephony',
5088     'description' => 'Set the charged_party field of CDRs to this field.',
5089     'type'        => 'select-sub',
5090     'options_sub' => sub { my $fields = FS::cdr->table_info->{'fields'};
5091                            map { $_ => $fields->{$_}||$_ }
5092                            grep { $_ !~ /^(acctid|charged_party)$/ }
5093                            FS::Schema::dbdef->table('cdr')->columns;
5094                          },
5095     'option_sub'  => sub { my $f = shift;
5096                            FS::cdr->table_info->{'fields'}{$f} || $f;
5097                          },
5098   },
5099
5100   #probably deprecate in favor of cdr-charged_party-field above
5101   {
5102     'key'         => 'cdr-charged_party-accountcode',
5103     'section'     => 'telephony',
5104     'description' => 'Set the charged_party field of CDRs to the accountcode.',
5105     'type'        => 'checkbox',
5106   },
5107
5108   {
5109     'key'         => 'cdr-charged_party-accountcode-trim_leading_0s',
5110     'section'     => 'telephony',
5111     'description' => 'When setting the charged_party field of CDRs to the accountcode, trim any leading zeros.',
5112     'type'        => 'checkbox',
5113   },
5114
5115 #  {
5116 #    'key'         => 'cdr-charged_party-truncate_prefix',
5117 #    'section'     => '',
5118 #    'description' => 'If the charged_party field has this prefix, truncate it to the length in cdr-charged_party-truncate_length.',
5119 #    'type'        => 'text',
5120 #  },
5121 #
5122 #  {
5123 #    'key'         => 'cdr-charged_party-truncate_length',
5124 #    'section'     => '',
5125 #    'description' => 'If the charged_party field has the prefix in cdr-charged_party-truncate_prefix, truncate it to this length.',
5126 #    'type'        => 'text',
5127 #  },
5128
5129   {
5130     'key'         => 'cdr-charged_party_rewrite',
5131     'section'     => 'telephony',
5132     '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*.',
5133     'type'        => 'checkbox',
5134   },
5135
5136   {
5137     'key'         => 'cdr-taqua-da_rewrite',
5138     'section'     => 'telephony',
5139     '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.',
5140     'type'        => 'text',
5141   },
5142
5143   {
5144     'key'         => 'cdr-taqua-accountcode_rewrite',
5145     'section'     => 'telephony',
5146     'description' => 'For the Taqua CDR format, pull accountcodes from secondary CDRs with matching sessionNumber.',
5147     'type'        => 'checkbox',
5148   },
5149
5150   {
5151     'key'         => 'cdr-taqua-callerid_rewrite',
5152     'section'     => 'telephony',
5153     'description' => 'For the Taqua CDR format, pull Caller ID blocking information from secondary CDRs.',
5154     'type'        => 'checkbox',
5155   },
5156
5157   {
5158     'key'         => 'cdr-asterisk_australia_rewrite',
5159     'section'     => 'telephony',
5160     'description' => 'For Asterisk CDRs, assign CDR type numbers based on Australian conventions.',
5161     'type'        => 'checkbox',
5162   },
5163
5164   {
5165     'key'         => 'cdr-gsm_tap3-sender',
5166     'section'     => 'telephony',
5167     'description' => 'GSM TAP3 Sender network (5 letter code)',
5168     'type'        => 'text',
5169   },
5170
5171   {
5172     'key'         => 'cust_pkg-show_autosuspend',
5173     'section'     => 'UI',
5174     'description' => 'Show package auto-suspend dates.  Use with caution for now; can slow down customer view for large insallations.',
5175     'type'        => 'checkbox',
5176   },
5177
5178   {
5179     'key'         => 'cdr-asterisk_forward_rewrite',
5180     'section'     => 'telephony',
5181     '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").',
5182     'type'        => 'checkbox',
5183   },
5184
5185   {
5186     'key'         => 'mc-outbound_packages',
5187     'section'     => '',
5188     'description' => "Don't use this.",
5189     'type'        => 'select-part_pkg',
5190     'multiple'    => 1,
5191   },
5192
5193   {
5194     'key'         => 'disable-cust-pkg_class',
5195     'section'     => 'UI',
5196     'description' => 'Disable the two-step dropdown for selecting package class and package, and return to the classic single dropdown.',
5197     'type'        => 'checkbox',
5198   },
5199
5200   {
5201     'key'         => 'queued-max_kids',
5202     'section'     => '',
5203     'description' => 'Maximum number of queued processes.  Defaults to 10.',
5204     'type'        => 'text',
5205   },
5206
5207   {
5208     'key'         => 'queued-sleep_time',
5209     'section'     => '',
5210     '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.',
5211     'type'        => 'text',
5212   },
5213
5214   {
5215     'key'         => 'queue-no_history',
5216     'section'     => '',
5217     '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.",
5218     'type'        => 'checkbox',
5219   },
5220
5221   {
5222     'key'         => 'cancelled_cust-noevents',
5223     'section'     => 'billing',
5224     'description' => "Don't run events for cancelled customers",
5225     'type'        => 'checkbox',
5226   },
5227
5228   {
5229     'key'         => 'agent-invoice_template',
5230     'section'     => 'invoicing',
5231     'description' => 'Enable display/edit of old-style per-agent invoice template selection',
5232     'type'        => 'checkbox',
5233   },
5234
5235   {
5236     'key'         => 'svc_broadband-manage_link',
5237     'section'     => 'UI',
5238     'description' => 'URL for svc_broadband "Manage Device" link.  The following substitutions are available: $ip_addr and $mac_addr.',
5239     'type'        => 'text',
5240   },
5241
5242   {
5243     'key'         => 'svc_broadband-manage_link_text',
5244     'section'     => 'UI',
5245     'description' => 'Label for "Manage Device" link',
5246     'type'        => 'text',
5247   },
5248
5249   {
5250     'key'         => 'svc_broadband-manage_link_loc',
5251     'section'     => 'UI',
5252     'description' => 'Location for "Manage Device" link',
5253     'type'        => 'select',
5254     'select_hash' => [
5255       'bottom' => 'Near Unprovision link',
5256       'right'  => 'With export-related links',
5257     ],
5258   },
5259
5260   {
5261     'key'         => 'svc_broadband-manage_link-new_window',
5262     'section'     => 'UI',
5263     'description' => 'Open the "Manage Device" link in a new window',
5264     'type'        => 'checkbox',
5265   },
5266
5267   #more fine-grained, service def-level control could be useful eventually?
5268   {
5269     'key'         => 'svc_broadband-allow_null_ip_addr',
5270     'section'     => '',
5271     'description' => '',
5272     'type'        => 'checkbox',
5273   },
5274
5275   {
5276     'key'         => 'svc_hardware-check_mac_addr',
5277     'section'     => '', #?
5278     'description' => 'Require the "hardware address" field in hardware services to be a valid MAC address.',
5279     'type'        => 'checkbox',
5280   },
5281
5282   {
5283     'key'         => 'tax-report_groups',
5284     'section'     => '',
5285     'description' => 'List of grouping possibilities for tax names on reports, one per line, "label op value" (op can be = or !=).',
5286     'type'        => 'textarea',
5287   },
5288
5289   {
5290     'key'         => 'tax-cust_exempt-groups',
5291     'section'     => 'billing',
5292     '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).',
5293     'type'        => 'textarea',
5294   },
5295
5296   {
5297     'key'         => 'tax-cust_exempt-groups-require_individual_nums',
5298     'section'     => 'deprecated',
5299     'description' => 'Deprecated: see tax-cust_exempt-groups-number_requirement',
5300     'type'        => 'checkbox',
5301   },
5302
5303   {
5304     'key'         => 'tax-cust_exempt-groups-num_req',
5305     'section'     => 'billing',
5306     'description' => 'When using tax-cust_exempt-groups, control whether individual tax exemption numbers are required for exemption from different taxes.',
5307     'type'        => 'select',
5308     'select_hash' => [ ''            => 'Not required',
5309                        'residential' => 'Required for residential customers only',
5310                        'all'         => 'Required for all customers',
5311                      ],
5312   },
5313
5314   {
5315     'key'         => 'cust_main-default_view',
5316     'section'     => 'UI',
5317     'description' => 'Default customer view, for users who have not selected a default view in their preferences.',
5318     'type'        => 'select',
5319     'select_hash' => [
5320       #false laziness w/view/cust_main.cgi and pref/pref.html
5321       'basics'          => 'Basics',
5322       'notes'           => 'Notes',
5323       'tickets'         => 'Tickets',
5324       'packages'        => 'Packages',
5325       'payment_history' => 'Payment History',
5326       'change_history'  => 'Change History',
5327       'jumbo'           => 'Jumbo',
5328     ],
5329   },
5330
5331   {
5332     'key'         => 'enable_tax_adjustments',
5333     'section'     => 'billing',
5334     'description' => 'Enable the ability to add manual tax adjustments.',
5335     'type'        => 'checkbox',
5336   },
5337
5338   {
5339     'key'         => 'rt-crontool',
5340     'section'     => '',
5341     'description' => 'Enable the RT CronTool extension.',
5342     'type'        => 'checkbox',
5343   },
5344
5345   {
5346     'key'         => 'pkg-balances',
5347     'section'     => 'billing',
5348     'description' => 'Enable per-package balances.',
5349     'type'        => 'checkbox',
5350   },
5351
5352   {
5353     'key'         => 'pkg-addon_classnum',
5354     'section'     => 'billing',
5355     'description' => 'Enable the ability to restrict additional package orders based on package class.',
5356     'type'        => 'checkbox',
5357   },
5358
5359   {
5360     'key'         => 'cust_main-edit_signupdate',
5361     'section'     => 'UI',
5362     'description' => 'Enable manual editing of the signup date.',
5363     'type'        => 'checkbox',
5364   },
5365
5366   {
5367     'key'         => 'svc_acct-disable_access_number',
5368     'section'     => 'UI',
5369     'description' => 'Disable access number selection.',
5370     'type'        => 'checkbox',
5371   },
5372
5373   {
5374     'key'         => 'cust_bill_pay_pkg-manual',
5375     'section'     => 'UI',
5376     'description' => 'Allow manual application of payments to line items.',
5377     'type'        => 'checkbox',
5378   },
5379
5380   {
5381     'key'         => 'cust_credit_bill_pkg-manual',
5382     'section'     => 'UI',
5383     'description' => 'Allow manual application of credits to line items.',
5384     'type'        => 'checkbox',
5385   },
5386
5387   {
5388     'key'         => 'breakage-days',
5389     'section'     => 'billing',
5390     '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.',
5391     'type'        => 'text',
5392     'per_agent'   => 1,
5393   },
5394
5395   {
5396     'key'         => 'breakage-pkg_class',
5397     'section'     => 'billing',
5398     'description' => 'Package class to use for breakage reconciliation.',
5399     'type'        => 'select-pkg_class',
5400   },
5401
5402   {
5403     'key'         => 'disable_cron_billing',
5404     'section'     => 'billing',
5405     '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.',
5406     'type'        => 'checkbox',
5407   },
5408
5409   {
5410     'key'         => 'svc_domain-edit_domain',
5411     'section'     => '',
5412     'description' => 'Enable domain renaming',
5413     'type'        => 'checkbox',
5414   },
5415
5416   {
5417     'key'         => 'enable_legacy_prepaid_income',
5418     'section'     => '',
5419     '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.",
5420     'type'        => 'checkbox',
5421   },
5422
5423   {
5424     'key'         => 'cust_main-exports',
5425     'section'     => '',
5426     'description' => 'Export(s) to call on cust_main insert, modification and deletion.',
5427     'type'        => 'select-sub',
5428     'multiple'    => 1,
5429     'options_sub' => sub {
5430       require FS::Record;
5431       require FS::part_export;
5432       my @part_export =
5433         map { qsearch( 'part_export', {exporttype => $_ } ) }
5434           keys %{FS::part_export::export_info('cust_main')};
5435       map { $_->exportnum => $_->exporttype.' to '.$_->machine } @part_export;
5436     },
5437     'option_sub'  => sub {
5438       require FS::Record;
5439       require FS::part_export;
5440       my $part_export = FS::Record::qsearchs(
5441         'part_export', { 'exportnum' => shift }
5442       );
5443       $part_export
5444         ? $part_export->exporttype.' to '.$part_export->machine
5445         : '';
5446     },
5447   },
5448
5449   #false laziness w/above options_sub and option_sub
5450   {
5451     'key'         => 'cust_location-exports',
5452     'section'     => '',
5453     'description' => 'Export(s) to call on cust_location insert, modification and deletion.',
5454     'type'        => 'select-sub',
5455     'multiple'    => 1,
5456     'options_sub' => sub {
5457       require FS::Record;
5458       require FS::part_export;
5459       my @part_export =
5460         map { qsearch( 'part_export', {exporttype => $_ } ) }
5461           keys %{FS::part_export::export_info('cust_location')};
5462       map { $_->exportnum => $_->exporttype.' to '.$_->machine } @part_export;
5463     },
5464     'option_sub'  => sub {
5465       require FS::Record;
5466       require FS::part_export;
5467       my $part_export = FS::Record::qsearchs(
5468         'part_export', { 'exportnum' => shift }
5469       );
5470       $part_export
5471         ? $part_export->exporttype.' to '.$part_export->machine
5472         : '';
5473     },
5474   },
5475
5476   {
5477     'key'         => 'cust_tag-location',
5478     'section'     => 'UI',
5479     'description' => 'Location where customer tags are displayed.',
5480     'type'        => 'select',
5481     'select_enum' => [ 'misc_info', 'top' ],
5482   },
5483
5484   {
5485     'key'         => 'cust_main-custom_link',
5486     'section'     => 'UI',
5487     '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.',
5488     'type'        => 'textarea',
5489   },
5490
5491   {
5492     'key'         => 'cust_main-custom_content',
5493     'section'     => 'UI',
5494     '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.',
5495     'type'        => 'textarea',
5496   },
5497
5498   {
5499     'key'         => 'cust_main-custom_title',
5500     'section'     => 'UI',
5501     'description' => 'Title for the "Custom" tab in the View Customer page.',
5502     'type'        => 'text',
5503   },
5504
5505   {
5506     'key'         => 'part_pkg-default_suspend_bill',
5507     'section'     => 'billing',
5508     'description' => 'Default the "Continue recurring billing while suspended" flag to on for new package definitions.',
5509     'type'        => 'checkbox',
5510   },
5511   
5512   {
5513     'key'         => 'qual-alt_address_format',
5514     'section'     => 'UI',
5515     'description' => 'Enable the alternate address format (location type, number, and kind) for qualifications.',
5516     'type'        => 'checkbox',
5517   },
5518
5519   {
5520     'key'         => 'prospect_main-alt_address_format',
5521     'section'     => 'UI',
5522     '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.',
5523     'type'        => 'checkbox',
5524   },
5525
5526   {
5527     'key'         => 'prospect_main-location_required',
5528     'section'     => 'UI',
5529     'description' => 'Require an address for prospects.  Recommended if the main use of propects is for qualifications.',
5530     'type'        => 'checkbox',
5531   },
5532
5533   {
5534     'key'         => 'note-classes',
5535     'section'     => 'UI',
5536     'description' => 'Use customer note classes',
5537     'type'        => 'select',
5538     'select_hash' => [
5539                        0 => 'Disabled',
5540                        1 => 'Enabled',
5541                        2 => 'Enabled, with tabs',
5542                      ],
5543   },
5544
5545   {
5546     'key'         => 'svc_acct-cf_privatekey-message',
5547     'section'     => '',
5548     'description' => 'For internal use: HTML displayed when cf_privatekey field is set.',
5549     'type'        => 'textarea',
5550   },
5551
5552   {
5553     'key'         => 'menu-prepend_links',
5554     'section'     => 'UI',
5555     'description' => 'Links to prepend to the main menu, one per line, with format "URL Link Label (optional ALT popup)".',
5556     'type'        => 'textarea',
5557   },
5558
5559   {
5560     'key'         => 'cust_main-external_links',
5561     'section'     => 'UI',
5562     'description' => 'External links available in customer view, one per line, with format "URL Link Label (optional ALT popup)".  The URL will have custnum appended.',
5563     'type'        => 'textarea',
5564   },
5565   
5566   {
5567     'key'         => 'svc_phone-did-summary',
5568     'section'     => 'invoicing',
5569     '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.',
5570     'type'        => 'checkbox',
5571   },
5572
5573   {
5574     'key'         => 'svc_acct-usage_seconds',
5575     'section'     => 'invoicing',
5576     'description' => 'Enable calculation of RADIUS usage time for invoices.  You must modify your template to display this information.',
5577     'type'        => 'checkbox',
5578   },
5579   
5580   {
5581     'key'         => 'opensips_gwlist',
5582     'section'     => 'telephony',
5583     'description' => 'For svc_phone OpenSIPS dr_rules export, gwlist column value, per-agent',
5584     'type'        => 'text',
5585     'per_agent'   => 1,
5586     'agentonly'   => 1,
5587   },
5588
5589   {
5590     'key'         => 'opensips_description',
5591     'section'     => 'telephony',
5592     'description' => 'For svc_phone OpenSIPS dr_rules export, description column value, per-agent',
5593     'type'        => 'text',
5594     'per_agent'   => 1,
5595     'agentonly'   => 1,
5596   },
5597   
5598   {
5599     'key'         => 'opensips_route',
5600     'section'     => 'telephony',
5601     'description' => 'For svc_phone OpenSIPS dr_rules export, routeid column value, per-agent',
5602     'type'        => 'text',
5603     'per_agent'   => 1,
5604     'agentonly'   => 1,
5605   },
5606
5607   {
5608     'key'         => 'cust_bill-no_recipients-error',
5609     'section'     => 'invoicing',
5610     '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.',
5611     'type'        => 'checkbox',
5612   },
5613
5614   {
5615     'key'         => 'cust_bill-latex_lineitem_maxlength',
5616     'section'     => 'invoicing',
5617     'description' => 'Truncate long line items to this number of characters on typeset invoices, to avoid losing things off the right margin.  Defaults to 50.  ',
5618     'type'        => 'text',
5619   },
5620
5621   {
5622     'key'         => 'invoice_payment_details',
5623     'section'     => 'invoicing',
5624     '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.',
5625     'type'        => 'checkbox',
5626   },
5627
5628   {
5629     'key'         => 'cust_main-status_module',
5630     'section'     => 'UI',
5631     '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?
5632     'type'        => 'select',
5633     'select_enum' => [ 'Classic', 'Recurring' ],
5634   },
5635
5636   { 
5637     'key'         => 'username-pound',
5638     'section'     => 'username',
5639     'description' => 'Allow the pound character (#) in usernames.',
5640     'type'        => 'checkbox',
5641   },
5642
5643   { 
5644     'key'         => 'username-exclamation',
5645     'section'     => 'username',
5646     'description' => 'Allow the exclamation character (!) in usernames.',
5647     'type'        => 'checkbox',
5648   },
5649
5650   {
5651     'key'         => 'ie-compatibility_mode',
5652     'section'     => 'UI',
5653     '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.",
5654     'type'        => 'select',
5655     'select_enum' => [ '', '7', 'EmulateIE7', '8', 'EmulateIE8' ],
5656   },
5657
5658   {
5659     'key'         => 'disable_payauto_default',
5660     'section'     => 'UI',
5661     'description' => 'Disable the "Charge future payments to this (card|check) automatically" checkbox from defaulting to checked.',
5662     'type'        => 'checkbox',
5663   },
5664   
5665   {
5666     'key'         => 'payment-history-report',
5667     'section'     => 'UI',
5668     'description' => 'Show a link to the raw database payment history report in the Reports menu.  DO NOT ENABLE THIS for modern installations.',
5669     'type'        => 'checkbox',
5670   },
5671   
5672   {
5673     'key'         => 'svc_broadband-require-nw-coordinates',
5674     'section'     => 'deprecated',
5675     'description' => 'Deprecated; see geocode-require_nw_coordinates instead',
5676     'type'        => 'checkbox',
5677   },
5678   
5679   {
5680     'key'         => 'cust-email-high-visibility',
5681     'section'     => 'UI',
5682     'description' => 'Move the invoicing e-mail address field to the top of the billing address section and highlight it.',
5683     'type'        => 'checkbox',
5684   },
5685   
5686   {
5687     'key'         => 'cust-edit-alt-field-order',
5688     'section'     => 'UI',
5689     'description' => 'An alternate ordering of fields for the New Customer and Edit Customer screens.',
5690     'type'        => 'checkbox',
5691   },
5692
5693   {
5694     'key'         => 'cust_bill-enable_promised_date',
5695     'section'     => 'UI',
5696     'description' => 'Enable display/editing of the "promised payment date" field on invoices.',
5697     'type'        => 'checkbox',
5698   },
5699   
5700   {
5701     'key'         => 'available-locales',
5702     'section'     => '',
5703     'description' => 'Limit available locales (employee preferences, per-customer locale selection, etc.) to a particular set.',
5704     'type'        => 'select-sub',
5705     'multiple'    => 1,
5706     'options_sub' => sub { 
5707       map { $_ => FS::Locales->description($_) }
5708       grep { $_ ne 'en_US' } 
5709       FS::Locales->locales;
5710     },
5711     'option_sub'  => sub { FS::Locales->description(shift) },
5712   },
5713
5714   {
5715     'key'         => 'cust_main-require_locale',
5716     'section'     => 'UI',
5717     'description' => 'Require an explicit locale to be chosen for new customers.',
5718     'type'        => 'checkbox',
5719   },
5720   
5721   {
5722     'key'         => 'translate-auto-insert',
5723     'section'     => '',
5724     '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.',
5725     'type'        => 'select',
5726     'multiple'    => 1,
5727     'select_enum' => [ grep { $_ ne 'en_US' } FS::Locales::locales ],
5728   },
5729
5730   {
5731     'key'         => 'svc_acct-tower_sector',
5732     'section'     => '',
5733     'description' => 'Track tower and sector for svc_acct (account) services.',
5734     'type'        => 'checkbox',
5735   },
5736
5737   {
5738     'key'         => 'cdr-prerate',
5739     'section'     => 'telephony',
5740     '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.',
5741     'type'        => 'checkbox',
5742   },
5743
5744   {
5745     'key'         => 'cdr-prerate-cdrtypenums',
5746     'section'     => 'telephony',
5747     'description' => 'When using cdr-prerate to rate CDRs immediately, limit processing to these CDR types.',
5748     'type'        => 'select-sub',
5749     'multiple'    => 1,
5750     'options_sub' => sub { require FS::Record;
5751                            require FS::cdr_type;
5752                            map { $_->cdrtypenum => $_->cdrtypename }
5753                                FS::Record::qsearch( 'cdr_type', 
5754                                                     {} #{ 'disabled' => '' }
5755                                                   );
5756                          },
5757     'option_sub'  => sub { require FS::Record;
5758                            require FS::cdr_type;
5759                            my $cdr_type = FS::Record::qsearchs(
5760                              'cdr_type', { 'cdrtypenum'=>shift } );
5761                            $cdr_type ? $cdr_type->cdrtypename : '';
5762                          },
5763   },
5764
5765   {
5766     'key'         => 'cdr-minutes_priority',
5767     'section'     => 'telephony',
5768     'description' => 'Priority rule for assigning included minutes to CDRs.',
5769     'type'        => 'select',
5770     'select_hash' => [
5771       ''          => 'No specific order',
5772       'time'      => 'Chronological',
5773       'rate_high' => 'Highest rate first',
5774       'rate_low'  => 'Lowest rate first',
5775     ],
5776   },
5777   
5778   {
5779     'key'         => 'brand-agent',
5780     'section'     => 'UI',
5781     '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.',
5782     'type'        => 'select-agent',
5783   },
5784
5785   {
5786     'key'         => 'cust_class-tax_exempt',
5787     'section'     => 'billing',
5788     'description' => 'Control the tax exemption flag per customer class rather than per indivual customer.',
5789     'type'        => 'checkbox',
5790   },
5791
5792   {
5793     'key'         => 'selfservice-billing_history-line_items',
5794     'section'     => 'self-service',
5795     'description' => 'Return line item billing detail for the self-service billing_history API call.',
5796     'type'        => 'checkbox',
5797   },
5798
5799   {
5800     'key'         => 'selfservice-default_cdr_format',
5801     'section'     => 'self-service',
5802     'description' => 'Format for showing outbound CDRs in self-service.  The per-package option overrides this.',
5803     'type'        => 'select',
5804     'select_hash' => \@cdr_formats,
5805   },
5806
5807   {
5808     'key'         => 'selfservice-default_inbound_cdr_format',
5809     'section'     => 'self-service',
5810     'description' => 'Format for showing inbound CDRs in self-service.  The per-package option overrides this.  Leave blank to avoid showing these CDRs.',
5811     'type'        => 'select',
5812     'select_hash' => \@cdr_formats,
5813   },
5814
5815   {
5816     'key'         => 'selfservice-hide_cdr_price',
5817     'section'     => 'self-service',
5818     'description' => 'Don\'t show the "Price" column on CDRs in self-service.',
5819     'type'        => 'checkbox',
5820   },
5821
5822   {
5823     'key'         => 'logout-timeout',
5824     'section'     => 'UI',
5825     'description' => 'If set, automatically log users out of the backoffice after this many minutes.',
5826     'type'       => 'text',
5827   },
5828   
5829   {
5830     'key'         => 'spreadsheet_format',
5831     'section'     => 'UI',
5832     'description' => 'Default format for spreadsheet download.',
5833     'type'        => 'select',
5834     'select_hash' => [
5835       'XLS' => 'XLS (Excel 97/2000/XP)',
5836       'XLSX' => 'XLSX (Excel 2007+)',
5837     ],
5838   },
5839
5840   {
5841     'key'         => 'agent-email_day',
5842     'section'     => '',
5843     '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.',
5844     'type'        => 'text',
5845   },
5846
5847   {
5848     'key'         => 'report-cust_pay-select_time',
5849     'section'     => 'UI',
5850     'description' => 'Enable time selection on payment and refund reports.',
5851     'type'        => 'checkbox',
5852   },
5853
5854   {
5855     'key'         => 'default_credit_limit',
5856     'section'     => 'billing',
5857     'description' => 'Default customer credit limit',
5858     'type'        => 'text',
5859   },
5860
5861   {
5862     'key'         => 'api_shared_secret',
5863     'section'     => 'API',
5864     'description' => 'Shared secret for back-office API authentication',
5865     'type'        => 'text',
5866   },
5867
5868   {
5869     'key'         => 'xmlrpc_api',
5870     'section'     => 'API',
5871     'description' => 'Enable the back-office API XML-RPC server (on port 8008).',
5872     'type'        => 'checkbox',
5873   },
5874
5875 #  {
5876 #    'key'         => 'jsonrpc_api',
5877 #    'section'     => 'API',
5878 #    'description' => 'Enable the back-office API JSON-RPC server (on port 8081).',
5879 #    'type'        => 'checkbox',
5880 #  },
5881
5882   {
5883     'key'         => 'api_credit_reason',
5884     'section'     => 'API',
5885     'description' => 'Default reason for back-office API credits',
5886     'type'        => 'select-sub',
5887     #false laziness w/api_credit_reason
5888     'options_sub' => sub { require FS::Record;
5889                            require FS::reason;
5890                            my $type = qsearchs('reason_type', 
5891                              { class => 'R' }) 
5892                               or return ();
5893                            map { $_->reasonnum => $_->reason }
5894                                FS::Record::qsearch('reason', 
5895                                  { reason_type => $type->typenum } 
5896                                );
5897                          },
5898     'option_sub'  => sub { require FS::Record;
5899                            require FS::reason;
5900                            my $reason = FS::Record::qsearchs(
5901                              'reason', { 'reasonnum' => shift }
5902                            );
5903                            $reason ? $reason->reason : '';
5904                          },
5905   },
5906
5907   {
5908     'key'         => 'part_pkg-term_discounts',
5909     'section'     => 'billing',
5910     'description' => 'Enable the term discounts feature.  Recommended to keep turned off unless actually using - not well optimized for large installations.',
5911     'type'        => 'checkbox',
5912   },
5913
5914   {
5915     'key'         => 'prepaid-never_renew',
5916     'section'     => 'billing',
5917     'description' => 'Prepaid packages never renew.',
5918     'type'        => 'checkbox',
5919   },
5920
5921   {
5922     'key'         => 'agent-disable_counts',
5923     'section'     => 'UI',
5924     '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.',
5925     'type'        => 'checkbox',
5926   },
5927
5928   {
5929     'key'         => 'tollfree-country',
5930     'section'     => 'telephony',
5931     'description' => 'Country / region for toll-free recognition',
5932     'type'        => 'select',
5933     'select_hash' => [ ''   => 'NANPA (US/Canada)',
5934                        'AU' => 'Australia',
5935                        'NZ' => 'New Zealand',
5936                      ],
5937   },
5938
5939   {
5940     'key'         => 'old_fcc_report',
5941     'section'     => '',
5942     'description' => 'Use the old (pre-2014) FCC Form 477 report format.',
5943     'type'        => 'checkbox',
5944   },
5945
5946   {
5947     'key'         => 'cust_main-default_commercial',
5948     'section'     => 'UI',
5949     'description' => 'Default for new customers is commercial rather than residential.',
5950     'type'        => 'checkbox',
5951   },
5952
5953   { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5954   { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5955   { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5956   { key => "bindprimary", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5957   { key => "bindsecondaries", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5958   { key => "bsdshellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5959   { key => "cyrus", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5960   { key => "cp_app", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5961   { key => "erpcdmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5962   { key => "icradiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5963   { key => "icradius_mysqldest", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5964   { key => "icradius_mysqlsource", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5965   { key => "icradius_secrets", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5966   { key => "maildisablecatchall", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5967   { key => "mxmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5968   { key => "nsmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5969   { key => "arecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5970   { key => "cnamerecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5971   { key => "nismachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5972   { key => "qmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5973   { key => "radiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5974   { key => "sendmailconfigpath", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5975   { key => "sendmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5976   { key => "sendmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5977   { key => "shellmachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5978   { key => "shellmachine-useradd", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5979   { key => "shellmachine-userdel", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5980   { key => "shellmachine-usermod", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5981   { key => "shellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5982   { key => "radiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5983   { key => "textradiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5984   { key => "username_policy", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5985   { key => "vpopmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5986   { key => "vpopmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5987   { key => "safe-part_pkg", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5988   { key => "selfservice_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5989   { key => "signup_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5990   { key => "signup_server-email", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5991   { key => "vonage-username", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5992   { key => "vonage-password", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5993   { key => "vonage-fromnumber", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5994
5995 );
5996
5997 1;
5998