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