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