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