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