1d946a5e80439eda25f1640fe25604702f1696fb
[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 21', 'Net 30', 'Net 45', 'Net 60', 'Net 90' ],
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'         => 'username-slash',
1631     'section'     => 'username',
1632     'description' => 'Allow the slash character (/) in usernames.  When using, make sure to set "Home directory" to fixed and blank in all svc_acct service definitions.',
1633     'type'        => 'checkbox',
1634   },
1635
1636   { 
1637     'key'         => 'username-equals',
1638     'section'     => 'username',
1639     'description' => 'Allow the equal sign character (=) in usernames.',
1640     'type'        => 'checkbox',
1641   },
1642
1643   {
1644     'key'         => 'safe-part_bill_event',
1645     'section'     => 'UI',
1646     'description' => 'Validates invoice event expressions against a preset list.  Useful for webdemos, annoying to powerusers.',
1647     'type'        => 'checkbox',
1648   },
1649
1650   {
1651     'key'         => 'show_ss',
1652     'section'     => 'UI',
1653     'description' => 'Turns on display/collection of social security numbers in the web interface.  Sometimes required by electronic check (ACH) processors.',
1654     'type'        => 'checkbox',
1655   },
1656
1657   {
1658     'key'         => 'show_stateid',
1659     'section'     => 'UI',
1660     'description' => "Turns on display/collection of driver's license/state issued id numbers in the web interface.  Sometimes required by electronic check (ACH) processors.",
1661     'type'        => 'checkbox',
1662   },
1663
1664   {
1665     'key'         => 'show_bankstate',
1666     'section'     => 'UI',
1667     'description' => "Turns on display/collection of state for bank accounts in the web interface.  Sometimes required by electronic check (ACH) processors.",
1668     'type'        => 'checkbox',
1669   },
1670
1671   { 
1672     'key'         => 'agent_defaultpkg',
1673     'section'     => 'UI',
1674     'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
1675     'type'        => 'checkbox',
1676   },
1677
1678   {
1679     'key'         => 'legacy_link',
1680     'section'     => 'UI',
1681     'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
1682     'type'        => 'checkbox',
1683   },
1684
1685   {
1686     'key'         => 'legacy_link-steal',
1687     'section'     => 'UI',
1688     'description' => 'Allow "stealing" an already-audited service from one customer (or package) to another using the link function.',
1689     'type'        => 'checkbox',
1690   },
1691
1692   {
1693     'key'         => 'queue_dangerous_controls',
1694     'section'     => 'UI',
1695     '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.',
1696     'type'        => 'checkbox',
1697   },
1698
1699   {
1700     'key'         => 'security_phrase',
1701     'section'     => 'password',
1702     'description' => 'Enable the tracking of a "security phrase" with each account.  Not recommended, as it is vulnerable to social engineering.',
1703     'type'        => 'checkbox',
1704   },
1705
1706   {
1707     'key'         => 'locale',
1708     'section'     => 'UI',
1709     'description' => 'Message locale',
1710     'type'        => 'select',
1711     'select_enum' => [ qw(en_US) ],
1712   },
1713
1714   {
1715     'key'         => 'signup_server-payby',
1716     'section'     => 'self-service',
1717     'description' => 'Acceptable payment types for the signup server',
1718     'type'        => 'selectmultiple',
1719     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
1720   },
1721
1722   {
1723     'key'         => 'selfservice-save_unchecked',
1724     'section'     => 'self-service',
1725     'description' => 'In self-service, uncheck "Remember information" checkboxes by default (normally, they are checked by default).',
1726     'type'        => 'checkbox',
1727   },
1728
1729   {
1730     'key'         => 'signup_server-default_agentnum',
1731     'section'     => 'self-service',
1732     'description' => 'Default agent for the signup server',
1733     'type'        => 'select-sub',
1734     'options_sub' => sub { require FS::Record;
1735                            require FS::agent;
1736                            map { $_->agentnum => $_->agent }
1737                                FS::Record::qsearch('agent', { disabled=>'' } );
1738                          },
1739     'option_sub'  => sub { require FS::Record;
1740                            require FS::agent;
1741                            my $agent = FS::Record::qsearchs(
1742                              'agent', { 'agentnum'=>shift }
1743                            );
1744                            $agent ? $agent->agent : '';
1745                          },
1746   },
1747
1748   {
1749     'key'         => 'signup_server-default_refnum',
1750     'section'     => 'self-service',
1751     'description' => 'Default advertising source for the signup server',
1752     'type'        => 'select-sub',
1753     'options_sub' => sub { require FS::Record;
1754                            require FS::part_referral;
1755                            map { $_->refnum => $_->referral }
1756                                FS::Record::qsearch( 'part_referral', 
1757                                                     { 'disabled' => '' }
1758                                                   );
1759                          },
1760     'option_sub'  => sub { require FS::Record;
1761                            require FS::part_referral;
1762                            my $part_referral = FS::Record::qsearchs(
1763                              'part_referral', { 'refnum'=>shift } );
1764                            $part_referral ? $part_referral->referral : '';
1765                          },
1766   },
1767
1768   {
1769     'key'         => 'signup_server-default_pkgpart',
1770     'section'     => 'self-service',
1771     'description' => 'Default package for the signup server',
1772     'type'        => 'select-part_pkg',
1773   },
1774
1775   {
1776     'key'         => 'signup_server-default_svcpart',
1777     'section'     => 'self-service',
1778     'description' => 'Default service definition for the signup server - only necessary for services that trigger special provisioning widgets (such as DID provisioning).',
1779     'type'        => 'select-part_svc',
1780   },
1781
1782   {
1783     'key'         => 'signup_server-mac_addr_svcparts',
1784     'section'     => 'self-service',
1785     'description' => 'Service definitions which can receive mac addresses (current mapped to username for svc_acct).',
1786     'type'        => 'select-part_svc',
1787     'multiple'    => 1,
1788   },
1789
1790   {
1791     'key'         => 'signup_server-nomadix',
1792     'section'     => 'self-service',
1793     'description' => 'Signup page Nomadix integration',
1794     'type'        => 'checkbox',
1795   },
1796
1797   {
1798     'key'         => 'signup_server-service',
1799     'section'     => 'self-service',
1800     'description' => 'Service for the signup server - "Account (svc_acct)" is the default setting, or "Phone number (svc_phone)" for ITSP signup',
1801     'type'        => 'select',
1802     'select_hash' => [
1803                        'svc_acct'  => 'Account (svc_acct)',
1804                        'svc_phone' => 'Phone number (svc_phone)',
1805                        'svc_pbx'   => 'PBX (svc_pbx)',
1806                      ],
1807   },
1808
1809   {
1810     'key'         => 'selfservice_server-base_url',
1811     'section'     => 'self-service',
1812     '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.',
1813     'type'        => 'text',
1814   },
1815
1816   {
1817     'key'         => 'show-msgcat-codes',
1818     'section'     => 'UI',
1819     'description' => 'Show msgcat codes in error messages.  Turn this option on before reporting errors to the mailing list.',
1820     'type'        => 'checkbox',
1821   },
1822
1823   {
1824     'key'         => 'signup_server-realtime',
1825     'section'     => 'self-service',
1826     'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
1827     'type'        => 'checkbox',
1828   },
1829
1830   {
1831     'key'         => 'signup_server-classnum2',
1832     'section'     => 'self-service',
1833     'description' => 'Package Class for first optional purchase',
1834     'type'        => 'select-pkg_class',
1835   },
1836
1837   {
1838     'key'         => 'signup_server-classnum3',
1839     'section'     => 'self-service',
1840     'description' => 'Package Class for second optional purchase',
1841     'type'        => 'select-pkg_class',
1842   },
1843
1844   {
1845     'key'         => 'selfservice-xmlrpc',
1846     'section'     => 'self-service',
1847     'description' => 'Run a standalone self-service XML-RPC server on the backend (on port 8080).',
1848     'type'        => 'checkbox',
1849   },
1850
1851   {
1852     'key'         => 'backend-realtime',
1853     'section'     => 'billing',
1854     'description' => 'Run billing for backend signups immediately.',
1855     'type'        => 'checkbox',
1856   },
1857
1858   {
1859     'key'         => 'decline_msgnum',
1860     'section'     => 'notification',
1861     'description' => 'Template to use for credit card and electronic check decline messages.',
1862     %msg_template_options,
1863   },
1864
1865   {
1866     'key'         => 'declinetemplate',
1867     'section'     => 'deprecated',
1868     'description' => 'Template file for credit card and electronic check decline emails.',
1869     'type'        => 'textarea',
1870   },
1871
1872   {
1873     'key'         => 'emaildecline',
1874     'section'     => 'notification',
1875     'description' => 'Enable emailing of credit card and electronic check decline notices.',
1876     'type'        => 'checkbox',
1877   },
1878
1879   {
1880     'key'         => 'emaildecline-exclude',
1881     'section'     => 'notification',
1882     'description' => 'List of error messages that should not trigger email decline notices, one per line.',
1883     'type'        => 'textarea',
1884   },
1885
1886   {
1887     'key'         => 'cancel_msgnum',
1888     'section'     => 'notification',
1889     'description' => 'Template to use for cancellation emails.',
1890     %msg_template_options,
1891   },
1892
1893   {
1894     'key'         => 'cancelmessage',
1895     'section'     => 'deprecated',
1896     'description' => 'Template file for cancellation emails.',
1897     'type'        => 'textarea',
1898   },
1899
1900   {
1901     'key'         => 'cancelsubject',
1902     'section'     => 'deprecated',
1903     'description' => 'Subject line for cancellation emails.',
1904     'type'        => 'text',
1905   },
1906
1907   {
1908     'key'         => 'emailcancel',
1909     'section'     => 'notification',
1910     'description' => 'Enable emailing of cancellation notices.  Make sure to select the template in the cancel_msgnum option.',
1911     'type'        => 'checkbox',
1912   },
1913
1914   {
1915     'key'         => 'bill_usage_on_cancel',
1916     'section'     => 'billing',
1917     '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.',
1918     'type'        => 'checkbox',
1919   },
1920
1921   {
1922     'key'         => 'require_cardname',
1923     'section'     => 'billing',
1924     'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
1925     'type'        => 'checkbox',
1926   },
1927
1928   {
1929     'key'         => 'enable_taxclasses',
1930     'section'     => 'billing',
1931     'description' => 'Enable per-package tax classes',
1932     'type'        => 'checkbox',
1933   },
1934
1935   {
1936     'key'         => 'require_taxclasses',
1937     'section'     => 'billing',
1938     'description' => 'Require a taxclass to be entered for every package',
1939     'type'        => 'checkbox',
1940   },
1941
1942   {
1943     'key'         => 'enable_taxproducts',
1944     'section'     => 'billing',
1945     'description' => 'Enable per-package mapping to vendor tax data from CCH or elsewhere.',
1946     'type'        => 'checkbox',
1947   },
1948
1949   {
1950     'key'         => 'taxdatadirectdownload',
1951     'section'     => 'billing',  #well
1952     'description' => 'Enable downloading tax data directly from the vendor site. at least three lines: URL, username, and password.j',
1953     'type'        => 'textarea',
1954   },
1955
1956   {
1957     'key'         => 'ignore_incalculable_taxes',
1958     'section'     => 'billing',
1959     'description' => 'Prefer to invoice without tax over not billing at all',
1960     'type'        => 'checkbox',
1961   },
1962
1963   {
1964     'key'         => 'welcome_msgnum',
1965     'section'     => 'notification',
1966     'description' => 'Template to use for welcome messages when a svc_acct record is created.',
1967     %msg_template_options,
1968   },
1969
1970   {
1971     'key'         => 'welcome_email',
1972     'section'     => 'deprecated',
1973     '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.',
1974     'type'        => 'textarea',
1975     'per_agent'   => 1,
1976   },
1977
1978   {
1979     'key'         => 'welcome_email-from',
1980     'section'     => 'deprecated',
1981     'description' => 'From: address header for welcome email',
1982     'type'        => 'text',
1983     'per_agent'   => 1,
1984   },
1985
1986   {
1987     'key'         => 'welcome_email-subject',
1988     'section'     => 'deprecated',
1989     'description' => 'Subject: header for welcome email',
1990     'type'        => 'text',
1991     'per_agent'   => 1,
1992   },
1993   
1994   {
1995     'key'         => 'welcome_email-mimetype',
1996     'section'     => 'deprecated',
1997     'description' => 'MIME type for welcome email',
1998     'type'        => 'select',
1999     'select_enum' => [ 'text/plain', 'text/html' ],
2000     'per_agent'   => 1,
2001   },
2002
2003   {
2004     'key'         => 'welcome_letter',
2005     'section'     => '',
2006     '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>',
2007     'type'        => 'textarea',
2008   },
2009
2010 #  {
2011 #    'key'         => 'warning_msgnum',
2012 #    'section'     => 'notification',
2013 #    '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.',
2014 #    %msg_template_options,
2015 #  },
2016
2017   {
2018     'key'         => 'warning_email',
2019     'section'     => 'notification',
2020     '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>',
2021     'type'        => 'textarea',
2022   },
2023
2024   {
2025     'key'         => 'warning_email-from',
2026     'section'     => 'notification',
2027     'description' => 'From: address header for warning email',
2028     'type'        => 'text',
2029   },
2030
2031   {
2032     'key'         => 'warning_email-cc',
2033     'section'     => 'notification',
2034     'description' => 'Additional recipient(s) (comma separated) for warning email when remaining usage reaches zero.',
2035     'type'        => 'text',
2036   },
2037
2038   {
2039     'key'         => 'warning_email-subject',
2040     'section'     => 'notification',
2041     'description' => 'Subject: header for warning email',
2042     'type'        => 'text',
2043   },
2044   
2045   {
2046     'key'         => 'warning_email-mimetype',
2047     'section'     => 'notification',
2048     'description' => 'MIME type for warning email',
2049     'type'        => 'select',
2050     'select_enum' => [ 'text/plain', 'text/html' ],
2051   },
2052
2053   {
2054     'key'         => 'payby',
2055     'section'     => 'billing',
2056     'description' => 'Available payment types.',
2057     'type'        => 'selectmultiple',
2058     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP) ],
2059   },
2060
2061   {
2062     'key'         => 'payby-default',
2063     'section'     => 'UI',
2064     'description' => 'Default payment type.  HIDE disables display of billing information and sets customers to BILL.',
2065     'type'        => 'select',
2066     'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP HIDE) ],
2067   },
2068
2069   {
2070     'key'         => 'paymentforcedtobatch',
2071     'section'     => 'deprecated',
2072     '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.',
2073     'type'        => 'checkbox',
2074   },
2075
2076   {
2077     'key'         => 'svc_acct-notes',
2078     'section'     => 'deprecated',
2079     'description' => 'Extra HTML to be displayed on the Account View screen.',
2080     'type'        => 'textarea',
2081   },
2082
2083   {
2084     'key'         => 'radius-password',
2085     'section'     => '',
2086     'description' => 'RADIUS attribute for plain-text passwords.',
2087     'type'        => 'select',
2088     'select_enum' => [ 'Password', 'User-Password', 'Cleartext-Password' ],
2089   },
2090
2091   {
2092     'key'         => 'radius-ip',
2093     'section'     => '',
2094     'description' => 'RADIUS attribute for IP addresses.',
2095     'type'        => 'select',
2096     'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
2097   },
2098
2099   #http://dev.coova.org/svn/coova-chilli/doc/dictionary.chillispot
2100   {
2101     'key'         => 'radius-chillispot-max',
2102     'section'     => '',
2103     'description' => 'Enable ChilliSpot (and CoovaChilli) Max attributes, specifically ChilliSpot-Max-{Input,Output,Total}-{Octets,Gigawords}.',
2104     'type'        => 'checkbox',
2105   },
2106
2107   {
2108     'key'         => 'svc_acct-alldomains',
2109     'section'     => '',
2110     '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.',
2111     'type'        => 'checkbox',
2112   },
2113
2114   {
2115     'key'         => 'dump-scpdest',
2116     'section'     => '',
2117     'description' => 'destination for scp database dumps: user@host:/path',
2118     'type'        => 'text',
2119   },
2120
2121   {
2122     'key'         => 'dump-pgpid',
2123     'section'     => '',
2124     '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.",
2125     'type'        => 'text',
2126   },
2127
2128   {
2129     'key'         => 'users-allow_comp',
2130     'section'     => 'deprecated',
2131     '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.',
2132     'type'        => 'textarea',
2133   },
2134
2135   {
2136     'key'         => 'credit_card-recurring_billing_flag',
2137     'section'     => 'billing',
2138     '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. ',
2139     'type'        => 'select',
2140     'select_hash' => [
2141                        'actual_oncard' => 'Default/classic behavior: set the flag if a customer has actual previous charges on the card.',
2142                        'transaction_is_recur' => 'Set the flag if the transaction itself is recurring, irregardless of previous charges on the card.',
2143                      ],
2144   },
2145
2146   {
2147     'key'         => 'credit_card-recurring_billing_acct_code',
2148     'section'     => 'billing',
2149     'description' => 'When the "recurring billing" flag is set, also set the "acct_code" to "rebill".  Useful for reporting purposes with supported gateways (PlugNPay, others?)',
2150     'type'        => 'checkbox',
2151   },
2152
2153   {
2154     'key'         => 'cvv-save',
2155     'section'     => 'billing',
2156     '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.',
2157     'type'        => 'selectmultiple',
2158     'select_enum' => \@card_types,
2159   },
2160
2161   {
2162     'key'         => 'manual_process-pkgpart',
2163     'section'     => 'billing',
2164     '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.',
2165     'type'        => 'select-part_pkg',
2166   },
2167
2168   {
2169     'key'         => 'manual_process-display',
2170     'section'     => 'billing',
2171     'description' => 'When using manual_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
2172     'type'        => 'select',
2173     'select_hash' => [
2174                        'add'      => 'Add fee to amount entered',
2175                        'subtract' => 'Subtract fee from amount entered',
2176                      ],
2177   },
2178
2179   {
2180     'key'         => 'manual_process-skip_first',
2181     'section'     => 'billing',
2182     'description' => "When using manual_process-pkgpart, omit the fee if it is the customer's first payment.",
2183     'type'        => 'checkbox',
2184   },
2185
2186   {
2187     'key'         => 'allow_negative_charges',
2188     'section'     => 'billing',
2189     'description' => 'Allow negative charges.  Normally not used unless importing data from a legacy system that requires this.',
2190     'type'        => 'checkbox',
2191   },
2192   {
2193       'key'         => 'auto_unset_catchall',
2194       'section'     => '',
2195       '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.',
2196       'type'        => 'checkbox',
2197   },
2198
2199   {
2200     'key'         => 'system_usernames',
2201     'section'     => 'username',
2202     '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.',
2203     'type'        => 'textarea',
2204   },
2205
2206   {
2207     'key'         => 'cust_pkg-change_svcpart',
2208     'section'     => '',
2209     'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
2210     'type'        => 'checkbox',
2211   },
2212
2213   {
2214     'key'         => 'cust_pkg-change_pkgpart-bill_now',
2215     'section'     => '',
2216     '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.",
2217     'type'        => 'checkbox',
2218   },
2219
2220   {
2221     'key'         => 'disable_autoreverse',
2222     'section'     => 'BIND',
2223     'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
2224     'type'        => 'checkbox',
2225   },
2226
2227   {
2228     'key'         => 'svc_www-enable_subdomains',
2229     'section'     => '',
2230     'description' => 'Enable selection of specific subdomains for virtual host creation.',
2231     'type'        => 'checkbox',
2232   },
2233
2234   {
2235     'key'         => 'svc_www-usersvc_svcpart',
2236     'section'     => '',
2237     'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
2238     'type'        => 'select-part_svc',
2239     'multiple'    => 1,
2240   },
2241
2242   {
2243     'key'         => 'selfservice_server-primary_only',
2244     'section'     => 'self-service',
2245     'description' => 'Only allow primary accounts to access self-service functionality.',
2246     'type'        => 'checkbox',
2247   },
2248
2249   {
2250     'key'         => 'selfservice_server-phone_login',
2251     'section'     => 'self-service',
2252     'description' => 'Allow login to self-service with phone number and PIN.',
2253     'type'        => 'checkbox',
2254   },
2255
2256   {
2257     'key'         => 'selfservice_server-single_domain',
2258     'section'     => 'self-service',
2259     'description' => 'If specified, only use this one domain for self-service access.',
2260     'type'        => 'text',
2261   },
2262
2263   {
2264     'key'         => 'selfservice-agent_signup',
2265     'section'     => 'self-service',
2266     'description' => 'Allow agent signup via self-service.',
2267     'type'        => 'checkbox',
2268   },
2269
2270   {
2271     'key'         => 'selfservice-agent_signup-agent_type',
2272     'section'     => 'self-service',
2273     'description' => 'Agent type when allowing agent signup via self-service.',
2274     'type'        => 'select-sub',
2275     'options_sub' => sub { require FS::Record;
2276                            require FS::agent_type;
2277                            map { $_->typenum => $_->atype }
2278                                FS::Record::qsearch('agent_type', {} ); # disabled=>'' } );
2279                          },
2280     'option_sub'  => sub { require FS::Record;
2281                            require FS::agent_type;
2282                            my $agent = FS::Record::qsearchs(
2283                              'agent_type', { 'typenum'=>shift }
2284                            );
2285                            $agent_type ? $agent_type->atype : '';
2286                          },
2287   },
2288
2289   {
2290     'key'         => 'selfservice-agent_login',
2291     'section'     => 'self-service',
2292     'description' => 'Allow agent login via self-service.',
2293     'type'        => 'checkbox',
2294   },
2295
2296   {
2297     'key'         => 'card_refund-days',
2298     'section'     => 'billing',
2299     'description' => 'After a payment, the number of days a refund link will be available for that payment.  Defaults to 120.',
2300     'type'        => 'text',
2301   },
2302
2303   {
2304     'key'         => 'agent-showpasswords',
2305     'section'     => '',
2306     'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
2307     'type'        => 'checkbox',
2308   },
2309
2310   {
2311     'key'         => 'global_unique-username',
2312     'section'     => 'username',
2313     '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.',
2314     'type'        => 'select',
2315     'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
2316   },
2317
2318   {
2319     'key'         => 'global_unique-phonenum',
2320     'section'     => '',
2321     '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.',
2322     'type'        => 'select',
2323     'select_enum' => [ 'none', 'countrycode+phonenum', 'disabled' ],
2324   },
2325
2326   {
2327     'key'         => 'global_unique-pbx_title',
2328     'section'     => '',
2329     'description' => 'Global phone number uniqueness control: none (check uniqueness per exports), enabled (check across all services), or disabled (no duplicate checking).',
2330     'type'        => 'select',
2331     'select_enum' => [ 'enabled', 'disabled' ],
2332   },
2333
2334   {
2335     'key'         => 'global_unique-pbx_id',
2336     'section'     => '',
2337     'description' => 'Global PBX id uniqueness control: none (check uniqueness per exports), enabled (check across all services), or disabled (no duplicate checking).',
2338     'type'        => 'select',
2339     'select_enum' => [ 'enabled', 'disabled' ],
2340   },
2341
2342   {
2343     'key'         => 'svc_external-skip_manual',
2344     'section'     => 'UI',
2345     '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).',
2346     'type'        => 'checkbox',
2347   },
2348
2349   {
2350     'key'         => 'svc_external-display_type',
2351     'section'     => 'UI',
2352     'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
2353     'type'        => 'select',
2354     'select_enum' => [ 'generic', 'artera_turbo', ],
2355   },
2356
2357   {
2358     'key'         => 'ticket_system',
2359     'section'     => '',
2360     '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).',
2361     'type'        => 'select',
2362     #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
2363     'select_enum' => [ '', qw(RT_Internal RT_External) ],
2364   },
2365
2366   {
2367     'key'         => 'ticket_system-default_queueid',
2368     'section'     => '',
2369     'description' => 'Default queue used when creating new customer tickets.',
2370     'type'        => 'select-sub',
2371     'options_sub' => sub {
2372                            my $conf = new FS::Conf;
2373                            if ( $conf->config('ticket_system') ) {
2374                              eval "use FS::TicketSystem;";
2375                              die $@ if $@;
2376                              FS::TicketSystem->queues();
2377                            } else {
2378                              ();
2379                            }
2380                          },
2381     'option_sub'  => sub { 
2382                            my $conf = new FS::Conf;
2383                            if ( $conf->config('ticket_system') ) {
2384                              eval "use FS::TicketSystem;";
2385                              die $@ if $@;
2386                              FS::TicketSystem->queue(shift);
2387                            } else {
2388                              '';
2389                            }
2390                          },
2391   },
2392   {
2393     'key'         => 'ticket_system-force_default_queueid',
2394     'section'     => '',
2395     'description' => 'Disallow queue selection when creating new tickets from customer view.',
2396     'type'        => 'checkbox',
2397   },
2398   {
2399     'key'         => 'ticket_system-selfservice_queueid',
2400     'section'     => '',
2401     'description' => 'Queue used when creating new customer tickets from self-service.  Defautls to ticket_system-default_queueid if not specified.',
2402     #false laziness w/above
2403     'type'        => 'select-sub',
2404     'options_sub' => sub {
2405                            my $conf = new FS::Conf;
2406                            if ( $conf->config('ticket_system') ) {
2407                              eval "use FS::TicketSystem;";
2408                              die $@ if $@;
2409                              FS::TicketSystem->queues();
2410                            } else {
2411                              ();
2412                            }
2413                          },
2414     'option_sub'  => sub { 
2415                            my $conf = new FS::Conf;
2416                            if ( $conf->config('ticket_system') ) {
2417                              eval "use FS::TicketSystem;";
2418                              die $@ if $@;
2419                              FS::TicketSystem->queue(shift);
2420                            } else {
2421                              '';
2422                            }
2423                          },
2424   },
2425
2426   {
2427     'key'         => 'ticket_system-priority_reverse',
2428     'section'     => '',
2429     '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.',
2430     'type'        => 'checkbox',
2431   },
2432
2433   {
2434     'key'         => 'ticket_system-custom_priority_field',
2435     'section'     => '',
2436     'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
2437     'type'        => 'text',
2438   },
2439
2440   {
2441     'key'         => 'ticket_system-custom_priority_field-values',
2442     'section'     => '',
2443     'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
2444     'type'        => 'textarea',
2445   },
2446
2447   {
2448     'key'         => 'ticket_system-custom_priority_field_queue',
2449     'section'     => '',
2450     'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
2451     'type'        => 'text',
2452   },
2453
2454   {
2455     'key'         => 'ticket_system-rt_external_datasrc',
2456     'section'     => '',
2457     '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>',
2458     'type'        => 'text',
2459
2460   },
2461
2462   {
2463     'key'         => 'ticket_system-rt_external_url',
2464     'section'     => '',
2465     'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
2466     'type'        => 'text',
2467   },
2468
2469   {
2470     'key'         => 'company_name',
2471     'section'     => 'required',
2472     'description' => 'Your company name',
2473     'type'        => 'text',
2474     'per_agent'   => 1, #XXX just FS/FS/ClientAPI/Signup.pm
2475   },
2476
2477   {
2478     'key'         => 'company_address',
2479     'section'     => 'required',
2480     'description' => 'Your company address',
2481     'type'        => 'textarea',
2482     'per_agent'   => 1,
2483   },
2484
2485   {
2486     'key'         => 'echeck-void',
2487     'section'     => 'deprecated',
2488     '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',
2489     'type'        => 'checkbox',
2490   },
2491
2492   {
2493     'key'         => 'cc-void',
2494     'section'     => 'deprecated',
2495     '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',
2496     'type'        => 'checkbox',
2497   },
2498
2499   {
2500     'key'         => 'unvoid',
2501     'section'     => 'deprecated',
2502     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable unvoiding of voided payments',
2503     'type'        => 'checkbox',
2504   },
2505
2506   {
2507     'key'         => 'address1-search',
2508     'section'     => 'UI',
2509     'description' => 'Enable the ability to search the address1 field from the quick customer search.  Not recommended in most cases as it tends to bring up too many search results - use explicit address searching from the advanced customer search instead.',
2510     'type'        => 'checkbox',
2511   },
2512
2513   {
2514     'key'         => 'address2-search',
2515     'section'     => 'UI',
2516     'description' => 'Enable a "Unit" search box which searches the second address field.  Useful for multi-tenant applications.  See also: cust_main-require_address2',
2517     'type'        => 'checkbox',
2518   },
2519
2520   {
2521     'key'         => 'cust_main-require_address2',
2522     'section'     => 'UI',
2523     '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',
2524     'type'        => 'checkbox',
2525   },
2526
2527   {
2528     'key'         => 'agent-ship_address',
2529     'section'     => '',
2530     '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.",
2531     'type'        => 'checkbox',
2532   },
2533
2534   { 'key'         => 'referral_credit',
2535     'section'     => 'deprecated',
2536     '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.",
2537     'type'        => 'checkbox',
2538   },
2539
2540   { 'key'         => 'selfservice_server-cache_module',
2541     'section'     => 'self-service',
2542     '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.',
2543     'type'        => 'select',
2544     'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
2545   },
2546
2547   {
2548     'key'         => 'hylafax',
2549     'section'     => 'billing',
2550     '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).',
2551     'type'        => [qw( checkbox textarea )],
2552   },
2553
2554   {
2555     'key'         => 'cust_bill-ftpformat',
2556     'section'     => 'invoicing',
2557     'description' => 'Enable FTP of raw invoice data - format.',
2558     'type'        => 'select',
2559     'select_enum' => [ '', 'default', 'billco', ],
2560   },
2561
2562   {
2563     'key'         => 'cust_bill-ftpserver',
2564     'section'     => 'invoicing',
2565     'description' => 'Enable FTP of raw invoice data - server.',
2566     'type'        => 'text',
2567   },
2568
2569   {
2570     'key'         => 'cust_bill-ftpusername',
2571     'section'     => 'invoicing',
2572     'description' => 'Enable FTP of raw invoice data - server.',
2573     'type'        => 'text',
2574   },
2575
2576   {
2577     'key'         => 'cust_bill-ftppassword',
2578     'section'     => 'invoicing',
2579     'description' => 'Enable FTP of raw invoice data - server.',
2580     'type'        => 'text',
2581   },
2582
2583   {
2584     'key'         => 'cust_bill-ftpdir',
2585     'section'     => 'invoicing',
2586     'description' => 'Enable FTP of raw invoice data - server.',
2587     'type'        => 'text',
2588   },
2589
2590   {
2591     'key'         => 'cust_bill-spoolformat',
2592     'section'     => 'invoicing',
2593     'description' => 'Enable spooling of raw invoice data - format.',
2594     'type'        => 'select',
2595     'select_enum' => [ '', 'default', 'billco', ],
2596   },
2597
2598   {
2599     'key'         => 'cust_bill-spoolagent',
2600     'section'     => 'invoicing',
2601     'description' => 'Enable per-agent spooling of raw invoice data.',
2602     'type'        => 'checkbox',
2603   },
2604
2605   {
2606     'key'         => 'svc_acct-usage_suspend',
2607     'section'     => 'billing',
2608     '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.',
2609     'type'        => 'checkbox',
2610   },
2611
2612   {
2613     'key'         => 'svc_acct-usage_unsuspend',
2614     'section'     => 'billing',
2615     '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.',
2616     'type'        => 'checkbox',
2617   },
2618
2619   {
2620     'key'         => 'svc_acct-usage_threshold',
2621     'section'     => 'billing',
2622     '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.',
2623     'type'        => 'text',
2624   },
2625
2626   {
2627     'key'         => 'overlimit_groups',
2628     'section'     => '',
2629     'description' => 'RADIUS group (or comma-separated groups) to assign to svc_acct which has exceeded its bandwidth or time limit.',
2630     'type'        => 'text',
2631     'per_agent'   => 1,
2632   },
2633
2634   {
2635     'key'         => 'cust-fields',
2636     'section'     => 'UI',
2637     'description' => 'Which customer fields to display on reports by default',
2638     'type'        => 'select',
2639     'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
2640   },
2641
2642   {
2643     'key'         => 'cust_pkg-display_times',
2644     'section'     => 'UI',
2645     'description' => 'Display full timestamps (not just dates) for customer packages.  Useful if you are doing real-time things like hourly prepaid.',
2646     'type'        => 'checkbox',
2647   },
2648
2649   {
2650     'key'         => 'cust_pkg-always_show_location',
2651     'section'     => 'UI',
2652     'description' => "Always display package locations, even when they're all the default service address.",
2653     'type'        => 'checkbox',
2654   },
2655
2656   {
2657     'key'         => 'cust_pkg-show_fcc_voice_grade_equivalent',
2658     'section'     => 'UI',
2659     'description' => "Show a field on package definitions for assigning a DSO equivalency number suitable for use on FCC form 477.",
2660     'type'        => 'checkbox',
2661   },
2662
2663   {
2664     'key'         => 'cust_pkg-large_pkg_size',
2665     'section'     => 'UI',
2666     'description' => "In customer view, summarize packages with more than this many services.  Set to zero to never summarize packages.",
2667     'type'        => 'text',
2668   },
2669
2670   {
2671     'key'         => 'svc_acct-edit_uid',
2672     'section'     => 'shell',
2673     'description' => 'Allow UID editing.',
2674     'type'        => 'checkbox',
2675   },
2676
2677   {
2678     'key'         => 'svc_acct-edit_gid',
2679     'section'     => 'shell',
2680     'description' => 'Allow GID editing.',
2681     'type'        => 'checkbox',
2682   },
2683
2684   {
2685     'key'         => 'zone-underscore',
2686     'section'     => 'BIND',
2687     'description' => 'Allow underscores in zone names.  As underscores are illegal characters in zone names, this option is not recommended.',
2688     'type'        => 'checkbox',
2689   },
2690
2691   {
2692     'key'         => 'echeck-nonus',
2693     'section'     => 'billing',
2694     'description' => 'Disable ABA-format account checking for Electronic Check payment info',
2695     'type'        => 'checkbox',
2696   },
2697
2698   {
2699     'key'         => 'voip-cust_cdr_spools',
2700     'section'     => '',
2701     'description' => 'Enable the per-customer option for individual CDR spools.',
2702     'type'        => 'checkbox',
2703   },
2704
2705   {
2706     'key'         => 'voip-cust_cdr_squelch',
2707     'section'     => '',
2708     'description' => 'Enable the per-customer option for not printing CDR on invoices.',
2709     'type'        => 'checkbox',
2710   },
2711
2712   {
2713     'key'         => 'voip-cdr_email',
2714     'section'     => '',
2715     'description' => 'Include the call details on emailed invoices (and HTML invoices viewed in the backend), even if the customer is configured for not printing them on the invoices.',
2716     'type'        => 'checkbox',
2717   },
2718
2719   {
2720     'key'         => 'voip-cust_email_csv_cdr',
2721     'section'     => '',
2722     'description' => 'Enable the per-customer option for including CDR information as a CSV attachment on emailed invoices.',
2723     'type'        => 'checkbox',
2724   },
2725
2726   {
2727     'key'         => 'cgp_rule-domain_templates',
2728     'section'     => '',
2729     'description' => 'Communigate Pro rule templates for domains, one per line, "svcnum Name"',
2730     'type'        => 'textarea',
2731   },
2732
2733   {
2734     'key'         => 'svc_forward-no_srcsvc',
2735     'section'     => '',
2736     '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.",
2737     'type'        => 'checkbox',
2738   },
2739
2740   {
2741     'key'         => 'svc_forward-arbitrary_dst',
2742     'section'     => '',
2743     '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.",
2744     'type'        => 'checkbox',
2745   },
2746
2747   {
2748     'key'         => 'tax-ship_address',
2749     'section'     => 'billing',
2750     'description' => 'By default, tax calculations are done based on the billing address.  Enable this switch to calculate tax based on the shipping address instead.',
2751     'type'        => 'checkbox',
2752   }
2753 ,
2754   {
2755     'key'         => 'tax-pkg_address',
2756     'section'     => 'billing',
2757     '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).',
2758     'type'        => 'checkbox',
2759   },
2760
2761   {
2762     'key'         => 'invoice-ship_address',
2763     'section'     => 'invoicing',
2764     'description' => 'Include the shipping address on invoices.',
2765     'type'        => 'checkbox',
2766   },
2767
2768   {
2769     'key'         => 'invoice-unitprice',
2770     'section'     => 'invoicing',
2771     'description' => 'Enable unit pricing on invoices.',
2772     'type'        => 'checkbox',
2773   },
2774
2775   {
2776     'key'         => 'invoice-smallernotes',
2777     'section'     => 'invoicing',
2778     'description' => 'Display the notes section in a smaller font on invoices.',
2779     'type'        => 'checkbox',
2780   },
2781
2782   {
2783     'key'         => 'invoice-smallerfooter',
2784     'section'     => 'invoicing',
2785     'description' => 'Display footers in a smaller font on invoices.',
2786     'type'        => 'checkbox',
2787   },
2788
2789   {
2790     'key'         => 'postal_invoice-fee_pkgpart',
2791     'section'     => 'billing',
2792     'description' => 'This allows selection of a package to insert on invoices for customers with postal invoices selected.',
2793     'type'        => 'select-part_pkg',
2794   },
2795
2796   {
2797     'key'         => 'postal_invoice-recurring_only',
2798     'section'     => 'billing',
2799     'description' => 'The postal invoice fee is omitted on invoices without reucrring charges when this is set.',
2800     'type'        => 'checkbox',
2801   },
2802
2803   {
2804     'key'         => 'batch-enable',
2805     'section'     => 'deprecated', #make sure batch-enable_payby is set for
2806                                    #everyone before removing
2807     'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
2808     'type'        => 'checkbox',
2809   },
2810
2811   {
2812     'key'         => 'batch-enable_payby',
2813     'section'     => 'billing',
2814     'description' => 'Enable batch processing for the specified payment types.',
2815     'type'        => 'selectmultiple',
2816     'select_enum' => [qw( CARD CHEK )],
2817   },
2818
2819   {
2820     'key'         => 'realtime-disable_payby',
2821     'section'     => 'billing',
2822     'description' => 'Disable realtime processing for the specified payment types.',
2823     'type'        => 'selectmultiple',
2824     'select_enum' => [qw( CARD CHEK )],
2825   },
2826
2827   {
2828     'key'         => 'batch-default_format',
2829     'section'     => 'billing',
2830     'description' => 'Default format for batches.',
2831     'type'        => 'select',
2832     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch',
2833                        'csv-chase_canada-E-xactBatch', 'BoM', 'PAP',
2834                        'paymentech', 'ach-spiritone', 'RBC'
2835                     ]
2836   },
2837
2838   #lists could be auto-generated from pay_batch info
2839   {
2840     'key'         => 'batch-fixed_format-CARD',
2841     'section'     => 'billing',
2842     'description' => 'Fixed (unchangeable) format for credit card batches.',
2843     'type'        => 'select',
2844     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
2845                        'csv-chase_canada-E-xactBatch', 'paymentech' ]
2846   },
2847
2848   {
2849     'key'         => 'batch-fixed_format-CHEK',
2850     'section'     => 'billing',
2851     'description' => 'Fixed (unchangeable) format for electronic check batches.',
2852     'type'        => 'select',
2853     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP',
2854                        'paymentech', 'ach-spiritone', 'RBC'
2855                      ]
2856   },
2857
2858   {
2859     'key'         => 'batch-increment_expiration',
2860     'section'     => 'billing',
2861     'description' => 'Increment expiration date years in batches until cards are current.  Make sure this is acceptable to your batching provider before enabling.',
2862     'type'        => 'checkbox'
2863   },
2864
2865   {
2866     'key'         => 'batchconfig-BoM',
2867     'section'     => 'billing',
2868     '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',
2869     'type'        => 'textarea',
2870   },
2871
2872   {
2873     'key'         => 'batchconfig-PAP',
2874     'section'     => 'billing',
2875     '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',
2876     'type'        => 'textarea',
2877   },
2878
2879   {
2880     'key'         => 'batchconfig-csv-chase_canada-E-xactBatch',
2881     'section'     => 'billing',
2882     'description' => 'Gateway ID for Chase Canada E-xact batching',
2883     'type'        => 'text',
2884   },
2885
2886   {
2887     'key'         => 'batchconfig-paymentech',
2888     'section'     => 'billing',
2889     'description' => 'Configuration for Chase Paymentech batching, five lines: 1. BIN, 2. Terminal ID, 3. Merchant ID, 4. Username, 5. Password (for batch uploads)',
2890     'type'        => 'textarea',
2891   },
2892
2893   {
2894     'key'         => 'batchconfig-RBC',
2895     'section'     => 'billing',
2896     'description' => 'Configuration for Royal Bank of Canada PDS batching, four lines: 1. Client number, 2. Short name, 3. Long name, 4. Transaction code.',
2897     'type'        => 'textarea',
2898   },
2899
2900   {
2901     'key'         => 'batchconfig-td_eft1464',
2902     'section'     => 'billing',
2903     'description' => 'Configuration for TD Bank EFT1464 batching, five lines: 1. Originator ID, 2. Datacenter Code, 3. Short name, 4. Long name, 5. Returned payment branch number, 6. Returned payment account, 7. Transaction code.',
2904     'type'        => 'textarea',
2905   },
2906
2907   {
2908     'key'         => 'payment_history-years',
2909     'section'     => 'UI',
2910     'description' => 'Number of years of payment history to show by default.  Currently defaults to 2.',
2911     'type'        => 'text',
2912   },
2913
2914   {
2915     'key'         => 'change_history-years',
2916     'section'     => 'UI',
2917     'description' => 'Number of years of change history to show by default.  Currently defaults to 0.5.',
2918     'type'        => 'text',
2919   },
2920
2921   {
2922     'key'         => 'cust_main-packages-years',
2923     'section'     => 'UI',
2924     'description' => 'Number of years to show old (cancelled and one-time charge) packages by default.  Currently defaults to 2.',
2925     'type'        => 'text',
2926   },
2927
2928   {
2929     'key'         => 'cust_main-use_comments',
2930     'section'     => 'UI',
2931     'description' => 'Display free form comments on the customer edit screen.  Useful as a scratch pad.',
2932     'type'        => 'checkbox',
2933   },
2934
2935   {
2936     'key'         => 'cust_main-disable_notes',
2937     'section'     => 'UI',
2938     'description' => 'Disable new style customer notes - timestamped and user identified customer notes.  Useful in tracking who did what.',
2939     'type'        => 'checkbox',
2940   },
2941
2942   {
2943     'key'         => 'cust_main_note-display_times',
2944     'section'     => 'UI',
2945     'description' => 'Display full timestamps (not just dates) for customer notes.',
2946     'type'        => 'checkbox',
2947   },
2948
2949   {
2950     'key'         => 'cust_main-ticket_statuses',
2951     'section'     => 'UI',
2952     'description' => 'Show tickets with these statuses on the customer view page.',
2953     'type'        => 'selectmultiple',
2954     'select_enum' => [qw( new open stalled resolved rejected deleted )],
2955   },
2956
2957   {
2958     'key'         => 'cust_main-max_tickets',
2959     'section'     => 'UI',
2960     'description' => 'Maximum number of tickets to show on the customer view page.',
2961     'type'        => 'text',
2962   },
2963
2964   {
2965     'key'         => 'cust_main-skeleton_tables',
2966     'section'     => '',
2967     '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.',
2968     'type'        => 'textarea',
2969   },
2970
2971   {
2972     'key'         => 'cust_main-skeleton_custnum',
2973     'section'     => '',
2974     'description' => 'Customer number specifying the source data to copy into skeleton tables for new customers.',
2975     'type'        => 'text',
2976   },
2977
2978   {
2979     'key'         => 'cust_main-enable_birthdate',
2980     'section'     => 'UI',
2981     'descritpion' => 'Enable tracking of a birth date with each customer record',
2982     'type'        => 'checkbox',
2983   },
2984
2985   {
2986     'key'         => 'support-key',
2987     'section'     => '',
2988     '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.',
2989     'type'        => 'text',
2990   },
2991
2992   {
2993     'key'         => 'card-types',
2994     'section'     => 'billing',
2995     'description' => 'Select one or more card types to enable only those card types.  If no card types are selected, all card types are available.',
2996     'type'        => 'selectmultiple',
2997     'select_enum' => \@card_types,
2998   },
2999
3000   {
3001     'key'         => 'disable-fuzzy',
3002     'section'     => 'UI',
3003     'description' => 'Disable fuzzy searching.  Speeds up searching for large sites, but only shows exact matches.',
3004     'type'        => 'checkbox',
3005   },
3006
3007   { 'key'         => 'pkg_referral',
3008     'section'     => '',
3009     'description' => 'Enable package-specific advertising sources.',
3010     'type'        => 'checkbox',
3011   },
3012
3013   { 'key'         => 'pkg_referral-multiple',
3014     'section'     => '',
3015     'description' => 'In addition, allow multiple advertising sources to be associated with a single package.',
3016     'type'        => 'checkbox',
3017   },
3018
3019   {
3020     'key'         => 'dashboard-install_welcome',
3021     'section'     => 'UI',
3022     'description' => 'New install welcome screen.',
3023     'type'        => 'select',
3024     'select_enum' => [ '', 'ITSP_fsinc_hosted', ],
3025   },
3026
3027   {
3028     'key'         => 'dashboard-toplist',
3029     'section'     => 'UI',
3030     'description' => 'List of items to display on the top of the front page',
3031     'type'        => 'textarea',
3032   },
3033
3034   {
3035     'key'         => 'impending_recur_msgnum',
3036     'section'     => 'notification',
3037     'description' => 'Template to use for alerts about first-time recurring billing.',
3038     %msg_template_options,
3039   },
3040
3041   {
3042     'key'         => 'impending_recur_template',
3043     'section'     => 'deprecated',
3044     '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>',
3045 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
3046     'type'        => 'textarea',
3047   },
3048
3049   {
3050     'key'         => 'logo.png',
3051     'section'     => 'UI',  #'invoicing' ?
3052     'description' => 'Company logo for HTML invoices and the backoffice interface, in PNG format.  Suggested size somewhere near 92x62.',
3053     'type'        => 'image',
3054     'per_agent'   => 1, #XXX just view/logo.cgi, which is for the global
3055                         #old-style editor anyway...?
3056   },
3057
3058   {
3059     'key'         => 'logo.eps',
3060     'section'     => 'invoicing',
3061     'description' => 'Company logo for printed and PDF invoices, in EPS format.',
3062     'type'        => 'image',
3063     'per_agent'   => 1, #XXX as above, kinda
3064   },
3065
3066   {
3067     'key'         => 'selfservice-ignore_quantity',
3068     'section'     => 'self-service',
3069     'description' => 'Ignores service quantity restrictions in self-service context.  Strongly not recommended - just set your quantities correctly in the first place.',
3070     'type'        => 'checkbox',
3071   },
3072
3073   {
3074     'key'         => 'selfservice-session_timeout',
3075     'section'     => 'self-service',
3076     'description' => 'Self-service session timeout.  Defaults to 1 hour.',
3077     'type'        => 'select',
3078     'select_enum' => [ '1 hour', '2 hours', '4 hours', '8 hours', '1 day', '1 week', ],
3079   },
3080
3081   {
3082     'key'         => 'disable_setup_suspended_pkgs',
3083     'section'     => 'billing',
3084     'description' => 'Disables charging of setup fees for suspended packages.',
3085     'type'        => 'checkbox',
3086   },
3087
3088   {
3089     'key'         => 'password-generated-allcaps',
3090     'section'     => 'password',
3091     'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
3092     'type'        => 'checkbox',
3093   },
3094
3095   {
3096     'key'         => 'datavolume-forcemegabytes',
3097     'section'     => 'UI',
3098     'description' => 'All data volumes are expressed in megabytes',
3099     'type'        => 'checkbox',
3100   },
3101
3102   {
3103     'key'         => 'datavolume-significantdigits',
3104     'section'     => 'UI',
3105     'description' => 'number of significant digits to use to represent data volumes',
3106     'type'        => 'text',
3107   },
3108
3109   {
3110     'key'         => 'disable_void_after',
3111     'section'     => 'billing',
3112     'description' => 'Number of seconds after which freeside won\'t attempt to VOID a payment first when performing a refund.',
3113     'type'        => 'text',
3114   },
3115
3116   {
3117     'key'         => 'disable_line_item_date_ranges',
3118     'section'     => 'billing',
3119     'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.',
3120     'type'        => 'checkbox',
3121   },
3122
3123   {
3124     'key'         => 'support_packages',
3125     'section'     => '',
3126     '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...
3127     'type'        => 'select-part_pkg',
3128     'multiple'    => 1,
3129   },
3130
3131   {
3132     'key'         => 'cust_main-require_phone',
3133     'section'     => '',
3134     'description' => 'Require daytime or night phone for all customer records.',
3135     'type'        => 'checkbox',
3136   },
3137
3138   {
3139     'key'         => 'cust_main-require_invoicing_list_email',
3140     'section'     => '',
3141     'description' => 'Email address field is required: require at least one invoicing email address for all customer records.',
3142     'type'        => 'checkbox',
3143   },
3144
3145   {
3146     'key'         => 'svc_acct-display_paid_time_remaining',
3147     'section'     => '',
3148     'description' => 'Show paid time remaining in addition to time remaining.',
3149     'type'        => 'checkbox',
3150   },
3151
3152   {
3153     'key'         => 'cancel_credit_type',
3154     'section'     => 'billing',
3155     'description' => 'The group to use for new, automatically generated credit reasons resulting from cancellation.',
3156     'type'        => 'select-sub',
3157     'options_sub' => sub { require FS::Record;
3158                            require FS::reason_type;
3159                            map { $_->typenum => $_->type }
3160                                FS::Record::qsearch('reason_type', { class=>'R' } );
3161                          },
3162     'option_sub'  => sub { require FS::Record;
3163                            require FS::reason_type;
3164                            my $reason_type = FS::Record::qsearchs(
3165                              'reason_type', { 'typenum' => shift }
3166                            );
3167                            $reason_type ? $reason_type->type : '';
3168                          },
3169   },
3170
3171   {
3172     'key'         => 'referral_credit_type',
3173     'section'     => 'deprecated',
3174     '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.',
3175     'type'        => 'select-sub',
3176     'options_sub' => sub { require FS::Record;
3177                            require FS::reason_type;
3178                            map { $_->typenum => $_->type }
3179                                FS::Record::qsearch('reason_type', { class=>'R' } );
3180                          },
3181     'option_sub'  => sub { require FS::Record;
3182                            require FS::reason_type;
3183                            my $reason_type = FS::Record::qsearchs(
3184                              'reason_type', { 'typenum' => shift }
3185                            );
3186                            $reason_type ? $reason_type->type : '';
3187                          },
3188   },
3189
3190   {
3191     'key'         => 'signup_credit_type',
3192     'section'     => 'billing', #self-service?
3193     'description' => 'The group to use for new, automatically generated credit reasons resulting from signup and self-service declines.',
3194     'type'        => 'select-sub',
3195     'options_sub' => sub { require FS::Record;
3196                            require FS::reason_type;
3197                            map { $_->typenum => $_->type }
3198                                FS::Record::qsearch('reason_type', { class=>'R' } );
3199                          },
3200     'option_sub'  => sub { require FS::Record;
3201                            require FS::reason_type;
3202                            my $reason_type = FS::Record::qsearchs(
3203                              'reason_type', { 'typenum' => shift }
3204                            );
3205                            $reason_type ? $reason_type->type : '';
3206                          },
3207   },
3208
3209   {
3210     'key'         => 'prepayment_discounts-credit_type',
3211     'section'     => 'billing',
3212     'description' => 'Enables the offering of prepayment discounts and establishes the credit reason type.',
3213     'type'        => 'select-sub',
3214     'options_sub' => sub { require FS::Record;
3215                            require FS::reason_type;
3216                            map { $_->typenum => $_->type }
3217                                FS::Record::qsearch('reason_type', { class=>'R' } );
3218                          },
3219     'option_sub'  => sub { require FS::Record;
3220                            require FS::reason_type;
3221                            my $reason_type = FS::Record::qsearchs(
3222                              'reason_type', { 'typenum' => shift }
3223                            );
3224                            $reason_type ? $reason_type->type : '';
3225                          },
3226
3227   },
3228
3229   {
3230     'key'         => 'cust_main-agent_custid-format',
3231     'section'     => '',
3232     'description' => 'Enables searching of various formatted values in cust_main.agent_custid',
3233     'type'        => 'select',
3234     'select_hash' => [
3235                        ''      => 'Numeric only',
3236                        'ww?d+' => 'Numeric with one or two letter prefix',
3237                      ],
3238   },
3239
3240   {
3241     'key'         => 'card_masking_method',
3242     'section'     => 'UI',
3243     '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.',
3244     'type'        => 'select',
3245     'select_hash' => [
3246                        ''            => '123456xxxxxx1234',
3247                        'first6last2' => '123456xxxxxxxx12',
3248                        'first4last4' => '1234xxxxxxxx1234',
3249                        'first4last2' => '1234xxxxxxxxxx12',
3250                        'first2last4' => '12xxxxxxxxxx1234',
3251                        'first2last2' => '12xxxxxxxxxxxx12',
3252                        'first0last4' => 'xxxxxxxxxxxx1234',
3253                        'first0last2' => 'xxxxxxxxxxxxxx12',
3254                      ],
3255   },
3256
3257   {
3258     'key'         => 'disable_previous_balance',
3259     'section'     => 'invoicing',
3260     'description' => 'Disable inclusion of previous balance, payment, and credit lines on invoices',
3261     'type'        => 'checkbox',
3262   },
3263
3264   {
3265     'key'         => 'previous_balance-exclude_from_total',
3266     'section'     => 'invoicing',
3267     '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',
3268     'type'        => [ qw(checkbox text) ],
3269   },
3270
3271   {
3272     'key'         => 'previous_balance-summary_only',
3273     'section'     => 'invoicing',
3274     'description' => 'Only show a single line summarizing the total previous balance rather than one line per invoice.',
3275     'type'        => 'checkbox',
3276   },
3277
3278   {
3279     'key'         => 'balance_due_below_line',
3280     'section'     => 'invoicing',
3281     'description' => 'Place the balance due message below a line.  Only meaningful when when invoice_sections is false.',
3282     'type'        => 'checkbox',
3283   },
3284
3285   {
3286     'key'         => 'usps_webtools-userid',
3287     'section'     => 'UI',
3288     '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.',
3289     'type'        => 'text',
3290   },
3291
3292   {
3293     'key'         => 'usps_webtools-password',
3294     'section'     => 'UI',
3295     '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.',
3296     'type'        => 'text',
3297   },
3298
3299   {
3300     'key'         => 'cust_main-auto_standardize_address',
3301     'section'     => 'UI',
3302     'description' => 'When using USPS web tools, automatically standardize the address without asking.',
3303     'type'        => 'checkbox',
3304   },
3305
3306   {
3307     'key'         => 'cust_main-require_censustract',
3308     'section'     => 'UI',
3309     'description' => 'Customer is required to have a census tract.  Useful for FCC form 477 reports. See also: cust_main-auto_standardize_address',
3310     'type'        => 'checkbox',
3311   },
3312
3313   {
3314     'key'         => 'census_year',
3315     'section'     => 'UI',
3316     'description' => 'The year to use in census tract lookups',
3317     'type'        => 'select',
3318     'select_enum' => [ qw( 2010 2009 2008 ) ],
3319   },
3320
3321   {
3322     'key'         => 'company_latitude',
3323     'section'     => 'UI',
3324     'description' => 'Your company latitude (-90 through 90)',
3325     'type'        => 'text',
3326   },
3327
3328   {
3329     'key'         => 'company_longitude',
3330     'section'     => 'UI',
3331     'description' => 'Your company longitude (-180 thru 180)',
3332     'type'        => 'text',
3333   },
3334
3335   {
3336     'key'         => 'disable_acl_changes',
3337     'section'     => '',
3338     'description' => 'Disable all ACL changes, for demos.',
3339     'type'        => 'checkbox',
3340   },
3341
3342   {
3343     'key'         => 'disable_settings_changes',
3344     'section'     => '',
3345     'description' => 'Disable all settings changes, for demos, except for the usernames given in the comma-separated list.',
3346     'type'        => [qw( checkbox text )],
3347   },
3348
3349   {
3350     'key'         => 'cust_main-edit_agent_custid',
3351     'section'     => 'UI',
3352     'description' => 'Enable editing of the agent_custid field.',
3353     'type'        => 'checkbox',
3354   },
3355
3356   {
3357     'key'         => 'cust_main-default_agent_custid',
3358     'section'     => 'UI',
3359     'description' => 'Display the agent_custid field when available instead of the custnum field.',
3360     'type'        => 'checkbox',
3361   },
3362
3363   {
3364     'key'         => 'cust_main-title-display_custnum',
3365     'section'     => 'UI',
3366     'description' => 'Add the display_custom (agent_custid or custnum) to the title on customer view pages.',
3367     'type'        => 'checkbox',
3368   },
3369
3370   {
3371     'key'         => 'cust_bill-default_agent_invid',
3372     'section'     => 'UI',
3373     'description' => 'Display the agent_invid field when available instead of the invnum field.',
3374     'type'        => 'checkbox',
3375   },
3376
3377   {
3378     'key'         => 'cust_main-auto_agent_custid',
3379     'section'     => 'UI',
3380     'description' => 'Automatically assign an agent_custid - select format',
3381     'type'        => 'select',
3382     'select_hash' => [ '' => 'No',
3383                        '1YMMXXXXXXXX' => '1YMMXXXXXXXX',
3384                      ],
3385   },
3386
3387   {
3388     'key'         => 'cust_main-default_areacode',
3389     'section'     => 'UI',
3390     'description' => 'Default area code for customers.',
3391     'type'        => 'text',
3392   },
3393
3394   {
3395     'key'         => 'order_pkg-no_start_date',
3396     'section'     => 'UI',
3397     'description' => 'Don\'t set a default start date for new packages.',
3398     'type'        => 'checkbox',
3399   },
3400
3401   {
3402     'key'         => 'mcp_svcpart',
3403     'section'     => '',
3404     'description' => 'Master Control Program svcpart.  Leave this blank.',
3405     'type'        => 'text', #select-part_svc
3406   },
3407
3408   {
3409     'key'         => 'cust_bill-max_same_services',
3410     'section'     => 'invoicing',
3411     '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.',
3412     'type'        => 'text',
3413   },
3414
3415   {
3416     'key'         => 'cust_bill-consolidate_services',
3417     'section'     => 'invoicing',
3418     'description' => 'Consolidate service display into fewer lines on invoices rather than one per service.',
3419     'type'        => 'checkbox',
3420   },
3421
3422   {
3423     'key'         => 'suspend_email_admin',
3424     'section'     => '',
3425     'description' => 'Destination admin email address to enable suspension notices',
3426     'type'        => 'text',
3427   },
3428
3429   {
3430     'key'         => 'email_report-subject',
3431     'section'     => '',
3432     'description' => 'Subject for reports emailed by freeside-fetch.  Defaults to "Freeside report".',
3433     'type'        => 'text',
3434   },
3435
3436   {
3437     'key'         => 'selfservice-head',
3438     'section'     => 'self-service',
3439     'description' => 'HTML for the HEAD section of the self-service interface, typically used for LINK stylesheet tags',
3440     'type'        => 'textarea', #htmlarea?
3441     'per_agent'   => 1,
3442   },
3443
3444
3445   {
3446     'key'         => 'selfservice-body_header',
3447     'section'     => 'self-service',
3448     'description' => 'HTML header for the self-service interface',
3449     'type'        => 'textarea', #htmlarea?
3450     'per_agent'   => 1,
3451   },
3452
3453   {
3454     'key'         => 'selfservice-body_footer',
3455     'section'     => 'self-service',
3456     'description' => 'HTML footer for the self-service interface',
3457     'type'        => 'textarea', #htmlarea?
3458     'per_agent'   => 1,
3459   },
3460
3461
3462   {
3463     'key'         => 'selfservice-body_bgcolor',
3464     'section'     => 'self-service',
3465     'description' => 'HTML background color for the self-service interface, for example, #FFFFFF',
3466     'type'        => 'text',
3467     'per_agent'   => 1,
3468   },
3469
3470   {
3471     'key'         => 'selfservice-box_bgcolor',
3472     'section'     => 'self-service',
3473     'description' => 'HTML color for self-service interface input boxes, for example, #C0C0C0',
3474     'type'        => 'text',
3475     'per_agent'   => 1,
3476   },
3477
3478   {
3479     'key'         => 'selfservice-text_color',
3480     'section'     => 'self-service',
3481     'description' => 'HTML text color for the self-service interface, for example, #000000',
3482     'type'        => 'text',
3483     'per_agent'   => 1,
3484   },
3485
3486   {
3487     'key'         => 'selfservice-link_color',
3488     'section'     => 'self-service',
3489     'description' => 'HTML link color for the self-service interface, for example, #0000FF',
3490     'type'        => 'text',
3491     'per_agent'   => 1,
3492   },
3493
3494   {
3495     'key'         => 'selfservice-vlink_color',
3496     'section'     => 'self-service',
3497     'description' => 'HTML visited link color for the self-service interface, for example, #FF00FF',
3498     'type'        => 'text',
3499     'per_agent'   => 1,
3500   },
3501
3502   {
3503     'key'         => 'selfservice-hlink_color',
3504     'section'     => 'self-service',
3505     'description' => 'HTML hover link color for the self-service interface, for example, #808080',
3506     'type'        => 'text',
3507     'per_agent'   => 1,
3508   },
3509
3510   {
3511     'key'         => 'selfservice-alink_color',
3512     'section'     => 'self-service',
3513     'description' => 'HTML active (clicked) link color for the self-service interface, for example, #808080',
3514     'type'        => 'text',
3515     'per_agent'   => 1,
3516   },
3517
3518   {
3519     'key'         => 'selfservice-font',
3520     'section'     => 'self-service',
3521     'description' => 'HTML font CSS for the self-service interface, for example, 0.9em/1.5em Arial, Helvetica, Geneva, sans-serif',
3522     'type'        => 'text',
3523     'per_agent'   => 1,
3524   },
3525
3526   {
3527     'key'         => 'selfservice-title_color',
3528     'section'     => 'self-service',
3529     'description' => 'HTML color for the self-service title, for example, #000000',
3530     'type'        => 'text',
3531     'per_agent'   => 1,
3532   },
3533
3534   {
3535     'key'         => 'selfservice-title_align',
3536     'section'     => 'self-service',
3537     'description' => 'HTML alignment for the self-service title, for example, center',
3538     'type'        => 'text',
3539     'per_agent'   => 1,
3540   },
3541   {
3542     'key'         => 'selfservice-title_size',
3543     'section'     => 'self-service',
3544     'description' => 'HTML font size for the self-service title, for example, 3',
3545     'type'        => 'text',
3546     'per_agent'   => 1,
3547   },
3548
3549   {
3550     'key'         => 'selfservice-title_left_image',
3551     'section'     => 'self-service',
3552     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
3553     'type'        => 'image',
3554     'per_agent'   => 1,
3555   },
3556
3557   {
3558     'key'         => 'selfservice-title_right_image',
3559     'section'     => 'self-service',
3560     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
3561     'type'        => 'image',
3562     'per_agent'   => 1,
3563   },
3564
3565   {
3566     'key'         => 'selfservice-menu_skipblanks',
3567     'section'     => 'self-service',
3568     'description' => 'Skip blank (spacer) entries in the self-service menu',
3569     'type'        => 'checkbox',
3570     'per_agent'   => 1,
3571   },
3572
3573   {
3574     'key'         => 'selfservice-menu_skipheadings',
3575     'section'     => 'self-service',
3576     'description' => 'Skip the unclickable heading entries in the self-service menu',
3577     'type'        => 'checkbox',
3578     'per_agent'   => 1,
3579   },
3580
3581   {
3582     'key'         => 'selfservice-menu_bgcolor',
3583     'section'     => 'self-service',
3584     'description' => 'HTML color for the self-service menu, for example, #C0C0C0',
3585     'type'        => 'text',
3586     'per_agent'   => 1,
3587   },
3588
3589   {
3590     'key'         => 'selfservice-menu_fontsize',
3591     'section'     => 'self-service',
3592     'description' => 'HTML font size for the self-service menu, for example, -1',
3593     'type'        => 'text',
3594     'per_agent'   => 1,
3595   },
3596   {
3597     'key'         => 'selfservice-menu_nounderline',
3598     'section'     => 'self-service',
3599     'description' => 'Styles menu links in the self-service without underlining.',
3600     'type'        => 'checkbox',
3601     'per_agent'   => 1,
3602   },
3603
3604
3605   {
3606     'key'         => 'selfservice-menu_top_image',
3607     'section'     => 'self-service',
3608     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
3609     'type'        => 'image',
3610     'per_agent'   => 1,
3611   },
3612
3613   {
3614     'key'         => 'selfservice-menu_body_image',
3615     'section'     => 'self-service',
3616     'description' => 'Repeating image used for the body of the menu in the self-service interface, in PNG format.',
3617     'type'        => 'image',
3618     'per_agent'   => 1,
3619   },
3620
3621   {
3622     'key'         => 'selfservice-menu_bottom_image',
3623     'section'     => 'self-service',
3624     'description' => 'Image used for the bottom of the menu in the self-service interface, in PNG format.',
3625     'type'        => 'image',
3626     'per_agent'   => 1,
3627   },
3628
3629   {
3630     'key'         => 'selfservice-bulk_format',
3631     'section'     => 'deprecated',
3632     'description' => 'Parameter arrangement for selfservice bulk features',
3633     'type'        => 'select',
3634     'select_enum' => [ '', 'izoom-soap', 'izoom-ftp' ],
3635     'per_agent'   => 1,
3636   },
3637
3638   {
3639     'key'         => 'selfservice-bulk_ftp_dir',
3640     'section'     => 'deprecated',
3641     'description' => 'Enable bulk ftp provisioning in this folder',
3642     'type'        => 'text',
3643     'per_agent'   => 1,
3644   },
3645
3646   {
3647     'key'         => 'signup-no_company',
3648     'section'     => 'self-service',
3649     'description' => "Don't display a field for company name on signup.",
3650     'type'        => 'checkbox',
3651   },
3652
3653   {
3654     'key'         => 'signup-recommend_email',
3655     'section'     => 'self-service',
3656     'description' => 'Encourage the entry of an invoicing email address on signup.',
3657     'type'        => 'checkbox',
3658   },
3659
3660   {
3661     'key'         => 'signup-recommend_daytime',
3662     'section'     => 'self-service',
3663     'description' => 'Encourage the entry of a daytime phone number  invoicing email address on signup.',
3664     'type'        => 'checkbox',
3665   },
3666
3667   {
3668     'key'         => 'svc_phone-radius-default_password',
3669     'section'     => '',
3670     'description' => 'Default password when exporting svc_phone records to RADIUS',
3671     'type'        => 'text',
3672   },
3673
3674   {
3675     'key'         => 'svc_phone-allow_alpha_phonenum',
3676     'section'     => '',
3677     'description' => 'Allow letters in phone numbers.',
3678     'type'        => 'checkbox',
3679   },
3680
3681   {
3682     'key'         => 'svc_phone-domain',
3683     'section'     => '',
3684     'description' => 'Track an optional domain association with each phone service.',
3685     'type'        => 'checkbox',
3686   },
3687
3688   {
3689     'key'         => 'svc_phone-phone_name-max_length',
3690     'section'     => '',
3691     '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.',
3692     'type'        => 'text',
3693   },
3694
3695   {
3696     'key'         => 'default_phone_countrycode',
3697     'section'     => '',
3698     'description' => 'Default countrcode',
3699     'type'        => 'text',
3700   },
3701
3702   {
3703     'key'         => 'cdr-charged_party-field',
3704     'section'     => '',
3705     'description' => 'Set the charged_party field of CDRs to this field.',
3706     'type'        => 'select-sub',
3707     'options_sub' => sub { my $fields = FS::cdr->table_info->{'fields'};
3708                            map { $_ => $fields->{$_}||$_ }
3709                            grep { $_ !~ /^(acctid|charged_party)$/ }
3710                            FS::Schema::dbdef->table('cdr')->columns;
3711                          },
3712     'option_sub'  => sub { my $f = shift;
3713                            FS::cdr->table_info->{'fields'}{$f} || $f;
3714                          },
3715   },
3716
3717   #probably deprecate in favor of cdr-charged_party-field above
3718   {
3719     'key'         => 'cdr-charged_party-accountcode',
3720     'section'     => '',
3721     'description' => 'Set the charged_party field of CDRs to the accountcode.',
3722     'type'        => 'checkbox',
3723   },
3724
3725   {
3726     'key'         => 'cdr-charged_party-accountcode-trim_leading_0s',
3727     'section'     => '',
3728     'description' => 'When setting the charged_party field of CDRs to the accountcode, trim any leading zeros.',
3729     'type'        => 'checkbox',
3730   },
3731
3732 #  {
3733 #    'key'         => 'cdr-charged_party-truncate_prefix',
3734 #    'section'     => '',
3735 #    'description' => 'If the charged_party field has this prefix, truncate it to the length in cdr-charged_party-truncate_length.',
3736 #    'type'        => 'text',
3737 #  },
3738 #
3739 #  {
3740 #    'key'         => 'cdr-charged_party-truncate_length',
3741 #    'section'     => '',
3742 #    'description' => 'If the charged_party field has the prefix in cdr-charged_party-truncate_prefix, truncate it to this length.',
3743 #    'type'        => 'text',
3744 #  },
3745
3746   {
3747     'key'         => 'cdr-charged_party_rewrite',
3748     'section'     => '',
3749     '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*.',
3750     'type'        => 'checkbox',
3751   },
3752
3753   {
3754     'key'         => 'cdr-taqua-da_rewrite',
3755     'section'     => '',
3756     '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.',
3757     'type'        => 'text',
3758   },
3759
3760   {
3761     'key'         => 'cust_pkg-show_autosuspend',
3762     'section'     => 'UI',
3763     'description' => 'Show package auto-suspend dates.  Use with caution for now; can slow down customer view for large insallations.',
3764     'type'        => 'checkbox',
3765   },
3766
3767   {
3768     'key'         => 'cdr-asterisk_forward_rewrite',
3769     'section'     => '',
3770     '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").',
3771     'type'        => 'checkbox',
3772   },
3773
3774   {
3775     'key'         => 'sg-multicustomer_hack',
3776     'section'     => '',
3777     'description' => "Don't use this.",
3778     'type'        => 'checkbox',
3779   },
3780
3781   {
3782     'key'         => 'sg-ping_username',
3783     'section'     => '',
3784     'description' => "Don't use this.",
3785     'type'        => 'text',
3786   },
3787
3788   {
3789     'key'         => 'sg-ping_password',
3790     'section'     => '',
3791     'description' => "Don't use this.",
3792     'type'        => 'text',
3793   },
3794
3795   {
3796     'key'         => 'sg-login_username',
3797     'section'     => '',
3798     'description' => "Don't use this.",
3799     'type'        => 'text',
3800   },
3801
3802   {
3803     'key'         => 'mc-outbound_packages',
3804     'section'     => '',
3805     'description' => "Don't use this.",
3806     'type'        => 'select-part_pkg',
3807     'multiple'    => 1,
3808   },
3809
3810   {
3811     'key'         => 'disable-cust-pkg_class',
3812     'section'     => 'UI',
3813     'description' => 'Disable the two-step dropdown for selecting package class and package, and return to the classic single dropdown.',
3814     'type'        => 'checkbox',
3815   },
3816
3817   {
3818     'key'         => 'queued-max_kids',
3819     'section'     => '',
3820     'description' => 'Maximum number of queued processes.  Defaults to 10.',
3821     'type'        => 'text',
3822   },
3823
3824   {
3825     'key'         => 'queued-sleep_time',
3826     'section'     => '',
3827     '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.',
3828     'type'        => 'text',
3829   },
3830
3831   {
3832     'key'         => 'cancelled_cust-noevents',
3833     'section'     => 'billing',
3834     'description' => "Don't run events for cancelled customers",
3835     'type'        => 'checkbox',
3836   },
3837
3838   {
3839     'key'         => 'agent-invoice_template',
3840     'section'     => 'invoicing',
3841     'description' => 'Enable display/edit of old-style per-agent invoice template selection',
3842     'type'        => 'checkbox',
3843   },
3844
3845   {
3846     'key'         => 'svc_broadband-manage_link',
3847     'section'     => 'UI',
3848     'description' => 'URL for svc_broadband "Manage Device" link.  The following substitutions are available: $ip_addr.',
3849     'type'        => 'text',
3850   },
3851
3852   #more fine-grained, service def-level control could be useful eventually?
3853   {
3854     'key'         => 'svc_broadband-allow_null_ip_addr',
3855     'section'     => '',
3856     'description' => '',
3857     'type'        => 'checkbox',
3858   },
3859
3860   {
3861     'key'         => 'tax-report_groups',
3862     'section'     => '',
3863     'description' => 'List of grouping possibilities for tax names on reports, one per line, "label op value" (op can be = or !=).',
3864     'type'        => 'textarea',
3865   },
3866
3867   {
3868     'key'         => 'tax-cust_exempt-groups',
3869     'section'     => '',
3870     '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).',
3871     'type'        => 'textarea',
3872   },
3873
3874   {
3875     'key'         => 'cust_main-default_view',
3876     'section'     => 'UI',
3877     'description' => 'Default customer view, for users who have not selected a default view in their preferences.',
3878     'type'        => 'select',
3879     'select_hash' => [
3880       #false laziness w/view/cust_main.cgi and pref/pref.html
3881       'basics'          => 'Basics',
3882       'notes'           => 'Notes',
3883       'tickets'         => 'Tickets',
3884       'packages'        => 'Packages',
3885       'payment_history' => 'Payment History',
3886       'change_history'  => 'Change History',
3887       'jumbo'           => 'Jumbo',
3888     ],
3889   },
3890
3891   {
3892     'key'         => 'enable_tax_adjustments',
3893     'section'     => 'billing',
3894     'description' => 'Enable the ability to add manual tax adjustments.',
3895     'type'        => 'checkbox',
3896   },
3897
3898   {
3899     'key'         => 'rt-crontool',
3900     'section'     => '',
3901     'description' => 'Enable the RT CronTool extension.',
3902     'type'        => 'checkbox',
3903   },
3904
3905   {
3906     'key'         => 'pkg-balances',
3907     'section'     => 'billing',
3908     'description' => 'Enable experimental package balances.  Not recommended for general use.',
3909     'type'        => 'checkbox',
3910   },
3911
3912   {
3913     'key'         => 'pkg-addon_classnum',
3914     'section'     => 'billing',
3915     'description' => 'Enable the ability to restrict additional package orders based on package class.',
3916     'type'        => 'checkbox',
3917   },
3918
3919   {
3920     'key'         => 'cust_main-edit_signupdate',
3921     'section'     => 'UI',
3922     'descritpion' => 'Enable manual editing of the signup date.',
3923     'type'        => 'checkbox',
3924   },
3925
3926   {
3927     'key'         => 'svc_acct-disable_access_number',
3928     'section'     => 'UI',
3929     'descritpion' => 'Disable access number selection.',
3930     'type'        => 'checkbox',
3931   },
3932
3933   {
3934     'key'         => 'cust_bill_pay_pkg-manual',
3935     'section'     => 'UI',
3936     'description' => 'Allow manual application of payments to line items.',
3937     'type'        => 'checkbox',
3938   },
3939
3940   {
3941     'key'         => 'cust_credit_bill_pkg-manual',
3942     'section'     => 'UI',
3943     'description' => 'Allow manual application of credits to line items.',
3944     'type'        => 'checkbox',
3945   },
3946
3947   {
3948     'key'         => 'breakage-days',
3949     'section'     => 'billing',
3950     '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.',
3951     'type'        => 'text',
3952     'per_agent'   => 1,
3953   },
3954
3955   {
3956     'key'         => 'breakage-pkg_class',
3957     'section'     => 'billing',
3958     'description' => 'Package class to use for breakage reconciliation.',
3959     'type'        => 'select-pkg_class',
3960   },
3961
3962   {
3963     'key'         => 'disable_cron_billing',
3964     'section'     => 'billing',
3965     '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.',
3966     'type'        => 'checkbox',
3967   },
3968
3969   {
3970     'key'         => 'svc_domain-edit_domain',
3971     'section'     => '',
3972     'description' => 'Enable domain renaming',
3973     'type'        => 'checkbox',
3974   },
3975
3976   {
3977     'key'         => 'enable_legacy_prepaid_income',
3978     'section'     => '',
3979     '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.",
3980     'type'        => 'checkbox',
3981   },
3982
3983   {
3984     'key'         => 'cust_main-exports',
3985     'section'     => '',
3986     'description' => 'Export(s) to call on cust_main insert, modification and deletion.',
3987     'type'        => 'select-sub',
3988     'multiple'    => 1,
3989     'options_sub' => sub {
3990       require FS::Record;
3991       require FS::part_export;
3992       my @part_export =
3993         map { qsearch( 'part_export', {exporttype => $_ } ) }
3994           keys %{FS::part_export::export_info('cust_main')};
3995       map { $_->exportnum => $_->exporttype.' to '.$_->machine } @part_export;
3996     },
3997     'option_sub'  => sub {
3998       require FS::Record;
3999       require FS::part_export;
4000       my $part_export = FS::Record::qsearchs(
4001         'part_export', { 'exportnum' => shift }
4002       );
4003       $part_export
4004         ? $part_export->exporttype.' to '.$part_export->machine
4005         : '';
4006     },
4007   },
4008
4009   {
4010     'key'         => 'cust_tag-location',
4011     'section'     => 'UI',
4012     'description' => 'Location where customer tags are displayed.',
4013     'type'        => 'select',
4014     'select_enum' => [ 'misc_info', 'top' ],
4015   },
4016
4017   {
4018     'key'         => 'maestro-status_test',
4019     'section'     => 'UI',
4020     'description' => 'Display a link to the maestro status test page on the customer view page',
4021     'type'        => 'checkbox',
4022   },
4023
4024   {
4025     'key'         => 'cust_main-custom_link',
4026     'section'     => 'UI',
4027     'description' => 'URL to use as source for the "Custom" tab in the View Customer page.  The custnum will be appended.',
4028     'type'        => 'text',
4029   },
4030
4031   {
4032     'key'         => 'cust_main-custom_title',
4033     'section'     => 'UI',
4034     'description' => 'Title for the "Custom" tab in the View Customer page.',
4035     'type'        => 'text',
4036   },
4037
4038   {
4039     'key'         => 'part_pkg-default_suspend_bill',
4040     'section'     => 'billing',
4041     'description' => 'Default the "Continue recurring billing while suspended" flag to on for new package definitions.',
4042     'type'        => 'checkbox',
4043   },
4044
4045   { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4046   { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4047   { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4048   { key => "bindprimary", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4049   { key => "bindsecondaries", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4050   { key => "bsdshellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4051   { key => "cyrus", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4052   { key => "cp_app", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4053   { key => "erpcdmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4054   { key => "icradiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4055   { key => "icradius_mysqldest", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4056   { key => "icradius_mysqlsource", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4057   { key => "icradius_secrets", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4058   { key => "maildisablecatchall", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4059   { key => "mxmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4060   { key => "nsmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4061   { key => "arecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4062   { key => "cnamerecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4063   { key => "nismachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4064   { key => "qmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4065   { key => "radiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4066   { key => "sendmailconfigpath", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4067   { key => "sendmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4068   { key => "sendmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4069   { key => "shellmachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4070   { key => "shellmachine-useradd", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4071   { key => "shellmachine-userdel", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4072   { key => "shellmachine-usermod", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4073   { key => "shellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4074   { key => "radiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4075   { key => "textradiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4076   { key => "username_policy", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4077   { key => "vpopmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4078   { key => "vpopmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4079   { key => "safe-part_pkg", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4080   { key => "selfservice_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4081   { key => "signup_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4082   { key => "signup_server-email", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4083   { key => "vonage-username", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4084   { key => "vonage-password", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4085   { key => "vonage-fromnumber", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4086
4087 );
4088
4089 1;
4090