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