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