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