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