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