finish username-slash and username-equals, RT#10452
[freeside.git] / FS / FS / Conf.pm
1 package FS::Conf;
2
3 use vars qw($base_dir @config_items @base_items @card_types $DEBUG);
4 use Carp;
5 use IO::File;
6 use File::Basename;
7 use MIME::Base64;
8 use FS::ConfItem;
9 use FS::ConfDefaults;
10 use FS::Conf_compat17;
11 use FS::payby;
12 use FS::conf;
13 use FS::Record qw(qsearch qsearchs);
14 use FS::UID qw(dbh datasrc use_confcompat);
15
16 $base_dir = '%%%FREESIDE_CONF%%%';
17
18 $DEBUG = 0;
19
20 =head1 NAME
21
22 FS::Conf - Freeside configuration values
23
24 =head1 SYNOPSIS
25
26   use FS::Conf;
27
28   $conf = new FS::Conf;
29
30   $value = $conf->config('key');
31   @list  = $conf->config('key');
32   $bool  = $conf->exists('key');
33
34   $conf->touch('key');
35   $conf->set('key' => 'value');
36   $conf->delete('key');
37
38   @config_items = $conf->config_items;
39
40 =head1 DESCRIPTION
41
42 Read and write Freeside configuration values.  Keys currently map to filenames,
43 but this may change in the future.
44
45 =head1 METHODS
46
47 =over 4
48
49 =item new
50
51 Create a new configuration object.
52
53 =cut
54
55 sub new {
56   my($proto) = @_;
57   my($class) = ref($proto) || $proto;
58   my($self) = { 'base_dir' => $base_dir };
59   bless ($self, $class);
60 }
61
62 =item base_dir
63
64 Returns the base directory.  By default this is /usr/local/etc/freeside.
65
66 =cut
67
68 sub base_dir {
69   my($self) = @_;
70   my $base_dir = $self->{base_dir};
71   -e $base_dir or die "FATAL: $base_dir doesn't exist!";
72   -d $base_dir or die "FATAL: $base_dir isn't a directory!";
73   -r $base_dir or die "FATAL: Can't read $base_dir!";
74   -x $base_dir or die "FATAL: $base_dir not searchable (executable)!";
75   $base_dir =~ /^(.*)$/;
76   $1;
77 }
78
79 =item conf KEY [ AGENTNUM [ NODEFAULT ] ]
80
81 Returns the L<FS::conf> record for the key and agent.
82
83 =cut
84
85 sub conf {
86   my $self = shift;
87   $self->_config(@_);
88 }
89
90 =item config KEY [ AGENTNUM [ NODEFAULT ] ]
91
92 Returns the configuration value or values (depending on context) for key.
93 The optional agent number selects an agent specific value instead of the
94 global default if one is present.  If NODEFAULT is true only the agent
95 specific value(s) is returned.
96
97 =cut
98
99 sub _usecompat {
100   my ($self, $method) = (shift, shift);
101   carp "NO CONFIGURATION RECORDS FOUND -- USING COMPATIBILITY MODE"
102     if use_confcompat;
103   my $compat = new FS::Conf_compat17 ("$base_dir/conf." . datasrc);
104   $compat->$method(@_);
105 }
106
107 sub _config {
108   my($self,$name,$agentnum,$agentonly)=@_;
109   my $hashref = { 'name' => $name };
110   $hashref->{agentnum} = $agentnum;
111   local $FS::Record::conf = undef;  # XXX evil hack prevents recursion
112   my $cv = FS::Record::qsearchs('conf', $hashref);
113   if (!$agentonly && !$cv && defined($agentnum) && $agentnum) {
114     $hashref->{agentnum} = '';
115     $cv = FS::Record::qsearchs('conf', $hashref);
116   }
117   return $cv;
118 }
119
120 sub config {
121   my $self = shift;
122   return $self->_usecompat('config', @_) if use_confcompat;
123
124   carp "FS::Conf->config(". join(', ', @_). ") called"
125     if $DEBUG > 1;
126
127   my $cv = $self->_config(@_) or return;
128
129   if ( wantarray ) {
130     my $v = $cv->value;
131     chomp $v;
132     (split "\n", $v, -1);
133   } else {
134     (split("\n", $cv->value))[0];
135   }
136 }
137
138 =item config_binary KEY [ AGENTNUM [ NODEFAULT ] ]
139
140 Returns the exact scalar value for key.
141
142 =cut
143
144 sub config_binary {
145   my $self = shift;
146   return $self->_usecompat('config_binary', @_) if use_confcompat;
147
148   my $cv = $self->_config(@_) or return;
149   length($cv->value) ? decode_base64($cv->value) : '';
150 }
151
152 =item exists KEY [ AGENTNUM [ NODEFAULT ] ]
153
154 Returns true if the specified key exists, even if the corresponding value
155 is undefined.
156
157 =cut
158
159 sub exists {
160   my $self = shift;
161   return $self->_usecompat('exists', @_) if use_confcompat;
162
163   my($name, $agentnum)=@_;
164
165   carp "FS::Conf->exists(". join(', ', @_). ") called"
166     if $DEBUG > 1;
167
168   defined($self->_config(@_));
169 }
170
171 =item config_orbase KEY SUFFIX
172
173 Returns the configuration value or values (depending on context) for 
174 KEY_SUFFIX, if it exists, otherwise for KEY
175
176 =cut
177
178 # outmoded as soon as we shift to agentnum based config values
179 # well, mostly.  still useful for e.g. late notices, etc. in that we want
180 # these to fall back to standard values
181 sub config_orbase {
182   my $self = shift;
183   return $self->_usecompat('config_orbase', @_) if use_confcompat;
184
185   my( $name, $suffix ) = @_;
186   if ( $self->exists("${name}_$suffix") ) {
187     $self->config("${name}_$suffix");
188   } else {
189     $self->config($name);
190   }
191 }
192
193 =item key_orbase KEY SUFFIX
194
195 If the config value KEY_SUFFIX exists, returns KEY_SUFFIX, otherwise returns
196 KEY.  Useful for determining which exact configuration option is returned by
197 config_orbase.
198
199 =cut
200
201 sub key_orbase {
202   my $self = shift;
203   #no compat for this...return $self->_usecompat('config_orbase', @_) if use_confcompat;
204
205   my( $name, $suffix ) = @_;
206   if ( $self->exists("${name}_$suffix") ) {
207     "${name}_$suffix";
208   } else {
209     $name;
210   }
211 }
212
213 =item invoice_templatenames
214
215 Returns all possible invoice template names.
216
217 =cut
218
219 sub invoice_templatenames {
220   my( $self ) = @_;
221
222   my %templatenames = ();
223   foreach my $item ( $self->config_items ) {
224     foreach my $base ( @base_items ) {
225       my( $main, $ext) = split(/\./, $base);
226       $ext = ".$ext" if $ext;
227       if ( $item->key =~ /^${main}_(.+)$ext$/ ) {
228       $templatenames{$1}++;
229       }
230     }
231   }
232   
233   map { $_ } #handle scalar context
234   sort keys %templatenames;
235
236 }
237
238 =item touch KEY [ AGENT ];
239
240 Creates the specified configuration key if it does not exist.
241
242 =cut
243
244 sub touch {
245   my $self = shift;
246   return $self->_usecompat('touch', @_) if use_confcompat;
247
248   my($name, $agentnum) = @_;
249   unless ( $self->exists($name, $agentnum) ) {
250     $self->set($name, '', $agentnum);
251   }
252 }
253
254 =item set KEY VALUE [ AGENTNUM ];
255
256 Sets the specified configuration key to the given value.
257
258 =cut
259
260 sub set {
261   my $self = shift;
262   return $self->_usecompat('set', @_) if use_confcompat;
263
264   my($name, $value, $agentnum) = @_;
265   $value =~ /^(.*)$/s;
266   $value = $1;
267
268   warn "[FS::Conf] SET $name\n" if $DEBUG;
269
270   my $old = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum});
271   my $new = new FS::conf { $old ? $old->hash 
272                                 : ('name' => $name, 'agentnum' => $agentnum)
273                          };
274   $new->value($value);
275
276   my $error;
277   if ($old) {
278     $error = $new->replace($old);
279   } else {
280     $error = $new->insert;
281   }
282
283   die "error setting configuration value: $error \n"
284     if $error;
285
286 }
287
288 =item set_binary KEY VALUE [ AGENTNUM ]
289
290 Sets the specified configuration key to an exact scalar value which
291 can be retrieved with config_binary.
292
293 =cut
294
295 sub set_binary {
296   my $self  = shift;
297   return if use_confcompat;
298
299   my($name, $value, $agentnum)=@_;
300   $self->set($name, encode_base64($value), $agentnum);
301 }
302
303 =item delete KEY [ AGENTNUM ];
304
305 Deletes the specified configuration key.
306
307 =cut
308
309 sub delete {
310   my $self = shift;
311   return $self->_usecompat('delete', @_) if use_confcompat;
312
313   my($name, $agentnum) = @_;
314   if ( my $cv = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum}) ) {
315     warn "[FS::Conf] DELETE $name\n";
316
317     my $oldAutoCommit = $FS::UID::AutoCommit;
318     local $FS::UID::AutoCommit = 0;
319     my $dbh = dbh;
320
321     my $error = $cv->delete;
322
323     if ( $error ) {
324       $dbh->rollback if $oldAutoCommit;
325       die "error setting configuration value: $error \n"
326     }
327
328     $dbh->commit or die $dbh->errstr if $oldAutoCommit;
329
330   }
331 }
332
333 =item import_config_item CONFITEM DIR 
334
335   Imports the item specified by the CONFITEM (see L<FS::ConfItem>) into
336 the database as a conf record (see L<FS::conf>).  Imports from the file
337 in the directory DIR.
338
339 =cut
340
341 sub import_config_item { 
342   my ($self,$item,$dir) = @_;
343   my $key = $item->key;
344   if ( -e "$dir/$key" && ! use_confcompat ) {
345     warn "Inserting $key\n" if $DEBUG;
346     local $/;
347     my $value = readline(new IO::File "$dir/$key");
348     if ($item->type =~ /^(binary|image)$/ ) {
349       $self->set_binary($key, $value);
350     }else{
351       $self->set($key, $value);
352     }
353   }else {
354     warn "Not inserting $key\n" if $DEBUG;
355   }
356 }
357
358 =item verify_config_item CONFITEM DIR 
359
360   Compares the item specified by the CONFITEM (see L<FS::ConfItem>) in
361 the database to the legacy file value in DIR.
362
363 =cut
364
365 sub verify_config_item { 
366   return '' if use_confcompat;
367   my ($self,$item,$dir) = @_;
368   my $key = $item->key;
369   my $type = $item->type;
370
371   my $compat = new FS::Conf_compat17 $dir;
372   my $error = '';
373   
374   $error .= "$key fails existential comparison; "
375     if $self->exists($key) xor $compat->exists($key);
376
377   if ( $type !~ /^(binary|image)$/ ) {
378
379     {
380       no warnings;
381       $error .= "$key fails scalar comparison; "
382         unless scalar($self->config($key)) eq scalar($compat->config($key));
383     }
384
385     my (@new) = $self->config($key);
386     my (@old) = $compat->config($key);
387     unless ( scalar(@new) == scalar(@old)) { 
388       $error .= "$key fails list comparison; ";
389     }else{
390       my $r=1;
391       foreach (@old) { $r=0 if ($_ cmp shift(@new)); }
392       $error .= "$key fails list comparison; "
393         unless $r;
394     }
395
396   } else {
397
398     no warnings 'uninitialized';
399     $error .= "$key fails binary comparison; "
400       unless scalar($self->config_binary($key)) eq scalar($compat->config_binary($key));
401
402   }
403
404 #remove deprecated config on our own terms, not freeside-upgrade's
405 #  if ($error =~ /existential comparison/ && $item->section eq 'deprecated') {
406 #    my $proto;
407 #    for ( @config_items ) { $proto = $_; last if $proto->key eq $key;  }
408 #    unless ($proto->key eq $key) { 
409 #      warn "removed config item $error\n" if $DEBUG;
410 #      $error = '';
411 #    }
412 #  }
413
414   $error;
415 }
416
417 #item _orbase_items OPTIONS
418 #
419 #Returns all of the possible extensible config items as FS::ConfItem objects.
420 #See #L<FS::ConfItem>.  OPTIONS consists of name value pairs.  Possible
421 #options include
422 #
423 # dir - the directory to search for configuration option files instead
424 #       of using the conf records in the database
425 #
426 #cut
427
428 #quelle kludge
429 sub _orbase_items {
430   my ($self, %opt) = @_; 
431
432   my $listmaker = sub { my $v = shift;
433                         $v =~ s/_/!_/g;
434                         if ( $v =~ /\.(png|eps)$/ ) {
435                           $v =~ s/\./!_%./;
436                         }else{
437                           $v .= '!_%';
438                         }
439                         map { $_->name }
440                           FS::Record::qsearch( 'conf',
441                                                {},
442                                                '',
443                                                "WHERE name LIKE '$v' ESCAPE '!'"
444                                              );
445                       };
446
447   if (exists($opt{dir}) && $opt{dir}) {
448     $listmaker = sub { my $v = shift;
449                        if ( $v =~ /\.(png|eps)$/ ) {
450                          $v =~ s/\./_*./;
451                        }else{
452                          $v .= '_*';
453                        }
454                        map { basename $_ } glob($opt{dir}. "/$v" );
455                      };
456   }
457
458   ( map { 
459           my $proto;
460           my $base = $_;
461           for ( @config_items ) { $proto = $_; last if $proto->key eq $base;  }
462           die "don't know about $base items" unless $proto->key eq $base;
463
464           map { new FS::ConfItem { 
465                   'key'         => $_,
466                   'base_key'    => $proto->key,
467                   'section'     => $proto->section,
468                   'description' => 'Alternate ' . $proto->description . '  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Invoice_templates">billing documentation</a> for details.',
469                   'type'        => $proto->type,
470                 };
471               } &$listmaker($base);
472         } @base_items,
473   );
474 }
475
476 =item config_items
477
478 Returns all of the possible global/default configuration items as
479 FS::ConfItem objects.  See L<FS::ConfItem>.
480
481 =cut
482
483 sub config_items {
484   my $self = shift; 
485   return $self->_usecompat('config_items', @_) if use_confcompat;
486
487   ( @config_items, $self->_orbase_items(@_) );
488 }
489
490 =back
491
492 =head1 SUBROUTINES
493
494 =over 4
495
496 =item init-config DIR
497
498 Imports the configuration items from DIR (1.7 compatible)
499 to conf records in the database.
500
501 =cut
502
503 sub init_config {
504   my $dir = shift;
505
506   {
507     local $FS::UID::use_confcompat = 0;
508     my $conf = new FS::Conf;
509     foreach my $item ( $conf->config_items(dir => $dir) ) {
510       $conf->import_config_item($item, $dir);
511       my $error = $conf->verify_config_item($item, $dir);
512       return $error if $error;
513     }
514   
515     my $compat = new FS::Conf_compat17 $dir;
516     foreach my $item ( $compat->config_items ) {
517       my $error = $conf->verify_config_item($item, $dir);
518       return $error if $error;
519     }
520   }
521
522   $FS::UID::use_confcompat = 0;
523   '';  #success
524 }
525
526 =back
527
528 =head1 BUGS
529
530 If this was more than just crud that will never be useful outside Freeside I'd
531 worry that config_items is freeside-specific and icky.
532
533 =head1 SEE ALSO
534
535 "Configuration" in the web interface (config/config.cgi).
536
537 =cut
538
539 #Business::CreditCard
540 @card_types = (
541   "VISA card",
542   "MasterCard",
543   "Discover card",
544   "American Express card",
545   "Diner's Club/Carte Blanche",
546   "enRoute",
547   "JCB",
548   "BankCard",
549   "Switch",
550   "Solo",
551 );
552
553 @base_items = qw(
554 invoice_template
555 invoice_latex
556 invoice_latexreturnaddress
557 invoice_latexfooter
558 invoice_latexsmallfooter
559 invoice_latexnotes
560 invoice_latexcoupon
561 invoice_html
562 invoice_htmlreturnaddress
563 invoice_htmlfooter
564 invoice_htmlnotes
565 logo.png
566 logo.eps
567 );
568
569 my %msg_template_options = (
570   'type'        => 'select-sub',
571   'options_sub' => sub { require FS::Record;
572                          require FS::agent;
573                          require FS::msg_template;
574                          map { $_->msgnum, $_->msgname } 
575                             qsearch('msg_template', { disabled => '' });
576                        },
577   'option_sub'  => sub { require FS::msg_template;
578                          my $msg_template = FS::msg_template->by_key(shift);
579                          $msg_template ? $msg_template->msgname : ''
580                        },
581 );
582
583
584 #Billing (81 items)
585 #Invoicing (50 items)
586 #UI (69 items)
587 #Self-service (29 items)
588 #...
589 #Unclassified (77 items)
590
591 @config_items = map { new FS::ConfItem $_ } (
592
593   {
594     'key'         => 'address',
595     'section'     => 'deprecated',
596     'description' => 'This configuration option is no longer used.  See <a href="#invoice_template">invoice_template</a> instead.',
597     'type'        => 'text',
598   },
599
600   {
601     'key'         => 'alert_expiration',
602     'section'     => 'notification',
603     'description' => 'Enable alerts about billing method expiration (i.e. expiring credit cards).',
604     'type'        => 'checkbox',
605     'per_agent'   => 1,
606   },
607
608   {
609     'key'         => 'alerter_template',
610     'section'     => 'deprecated',
611     'description' => 'Template file for billing method expiration alerts (i.e. expiring credit cards).',
612     'type'        => 'textarea',
613     'per_agent'   => 1,
614   },
615   
616   {
617     'key'         => 'alerter_msgnum',
618     'section'     => 'notification',
619     'description' => 'Template to use for credit card expiration alerts.',
620     %msg_template_options,
621   },
622
623   {
624     'key'         => 'apacheip',
625     #not actually deprecated yet
626     #'section'     => 'deprecated',
627     #'description' => '<b>DEPRECATED</b>, add an <i>apache</i> <a href="../browse/part_export.cgi">export</a> instead.  Used to be the current IP address to assign to new virtual hosts',
628     'section'     => '',
629     'description' => 'IP address to assign to new virtual hosts',
630     'type'        => 'text',
631   },
632
633   {
634     'key'         => 'encryption',
635     'section'     => 'billing',
636     'description' => 'Enable encryption of credit cards.',
637     'type'        => 'checkbox',
638   },
639
640   {
641     'key'         => 'encryptionmodule',
642     'section'     => 'billing',
643     'description' => 'Use which module for encryption?',
644     'type'        => 'text',
645   },
646
647   {
648     'key'         => 'encryptionpublickey',
649     'section'     => 'billing',
650     'description' => 'Your RSA Public Key - Required if Encryption is turned on.',
651     'type'        => 'textarea',
652   },
653
654   {
655     'key'         => 'encryptionprivatekey',
656     'section'     => 'billing',
657     'description' => 'Your RSA Private Key - Including this will enable the "Bill Now" feature.  However if the system is compromised, a hacker can use this key to decode the stored credit card information.  This is generally not a good idea.',
658     'type'        => 'textarea',
659   },
660
661   {
662     'key'         => 'billco-url',
663     'section'     => 'billing',
664     'description' => 'The url to use for performing uploads to the invoice mailing service.',
665     'type'        => 'text',
666     'per_agent'   => 1,
667   },
668
669   {
670     'key'         => 'billco-username',
671     'section'     => 'billing',
672     'description' => 'The login name to use for uploads to the invoice mailing service.',
673     'type'        => 'text',
674     'per_agent'   => 1,
675     'agentonly'   => 1,
676   },
677
678   {
679     'key'         => 'billco-password',
680     'section'     => 'billing',
681     'description' => 'The password to use for uploads to the invoice mailing service.',
682     'type'        => 'text',
683     'per_agent'   => 1,
684     'agentonly'   => 1,
685   },
686
687   {
688     'key'         => 'billco-clicode',
689     'section'     => 'billing',
690     'description' => 'The clicode to use for uploads to the invoice mailing service.',
691     'type'        => 'text',
692     'per_agent'   => 1,
693   },
694
695   {
696     'key'         => 'business-onlinepayment',
697     'section'     => 'billing',
698     'description' => '<a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> support, at least three lines: processor, login, and password.  An optional fourth line specifies the action or actions (multiple actions are separated with `,\': for example: `Authorization Only, Post Authorization\').    Optional additional lines are passed to Business::OnlinePayment as %processor_options.',
699     'type'        => 'textarea',
700   },
701
702   {
703     'key'         => 'business-onlinepayment-ach',
704     'section'     => 'billing',
705     'description' => 'Alternate <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> support for ACH transactions (defaults to regular <b>business-onlinepayment</b>).  At least three lines: processor, login, and password.  An optional fourth line specifies the action or actions (multiple actions are separated with `,\': for example: `Authorization Only, Post Authorization\').    Optional additional lines are passed to Business::OnlinePayment as %processor_options.',
706     'type'        => 'textarea',
707   },
708
709   {
710     'key'         => 'business-onlinepayment-namespace',
711     'section'     => 'billing',
712     'description' => 'Specifies which perl module namespace (which group of collection routines) is used by default.',
713     'type'        => 'select',
714     'select_hash' => [
715                        'Business::OnlinePayment' => 'Direct API (Business::OnlinePayment)',
716                        'Business::OnlineThirdPartyPayment' => 'Web API (Business::ThirdPartyPayment)',
717                      ],
718   },
719
720   {
721     'key'         => 'business-onlinepayment-description',
722     'section'     => 'billing',
723     'description' => 'String passed as the description field to <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a>.  Evaluated as a double-quoted perl string, with the following variables available: <code>$agent</code> (the agent name), and <code>$pkgs</code> (a comma-separated list of packages for which these charges apply - not available in all situations)',
724     'type'        => 'text',
725   },
726
727   {
728     'key'         => 'business-onlinepayment-email-override',
729     'section'     => 'billing',
730     'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
731     'type'        => 'text',
732   },
733
734   {
735     'key'         => 'business-onlinepayment-email_customer',
736     'section'     => 'billing',
737     'description' => 'Controls the "email_customer" flag used by some Business::OnlinePayment processors to enable customer receipts.',
738     'type'        => 'checkbox',
739   },
740
741   {
742     'key'         => 'business-onlinepayment-test_transaction',
743     'section'     => 'billing',
744     'description' => 'Turns on the Business::OnlinePayment test_transaction flag.  Note that not all gateway modules support this flag; if yours does not, transactions will still be sent live.',
745     'type'        => 'checkbox',
746   },
747
748   {
749     'key'         => 'countrydefault',
750     'section'     => 'UI',
751     'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
752     'type'        => 'text',
753   },
754
755   {
756     'key'         => 'date_format',
757     'section'     => 'UI',
758     'description' => 'Format for displaying dates',
759     'type'        => 'select',
760     'select_hash' => [
761                        '%m/%d/%Y' => 'MM/DD/YYYY',
762                        '%d/%m/%Y' => 'DD/MM/YYYY',
763                        '%Y/%m/%d' => 'YYYY/MM/DD',
764                      ],
765   },
766
767   {
768     'key'         => 'deletecustomers',
769     'section'     => 'UI',
770     'description' => 'Enable customer deletions.  Be very careful!  Deleting a customer will remove all traces that the customer ever existed!  It should probably only be used when auditing a legacy database.  Normally, you cancel all of a customers\' packages if they cancel service.',
771     'type'        => 'checkbox',
772   },
773
774   {
775     'key'         => 'deleteinvoices',
776     'section'     => 'UI',
777     'description' => 'Enable invoices deletions.  Be very careful!  Deleting an invoice will remove all traces that the invoice ever existed!  Normally, you would apply a credit against the invoice instead.',  #invoice voiding?
778     'type'        => 'checkbox',
779   },
780
781   {
782     'key'         => 'deletepayments',
783     'section'     => 'billing',
784     'description' => 'Enable deletion of unclosed payments.  Really, with voids this is pretty much not recommended in any situation anymore.  Be very careful!  Only delete payments that were data-entry errors, not adjustments.  Optionally specify one or more comma-separated email addresses to be notified when a payment is deleted.',
785     'type'        => [qw( checkbox text )],
786   },
787
788   {
789     'key'         => 'deletecredits',
790     #not actually deprecated yet
791     #'section'     => 'deprecated',
792     #'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable deletion of unclosed credits.  Be very careful!  Only delete credits that were data-entry errors, not adjustments.  Optionally specify one or more comma-separated email addresses to be notified when a credit is deleted.',
793     'section'     => '',
794     'description' => 'One or more comma-separated email addresses to be notified when a credit is deleted.',
795     'type'        => [qw( checkbox text )],
796   },
797
798   {
799     'key'         => 'deleterefunds',
800     'section'     => 'billing',
801     'description' => 'Enable deletion of unclosed refunds.  Be very careful!  Only delete refunds that were data-entry errors, not adjustments.',
802     'type'        => 'checkbox',
803   },
804
805   {
806     'key'         => 'unapplypayments',
807     'section'     => 'deprecated',
808     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable "unapplication" of unclosed payments.',
809     'type'        => 'checkbox',
810   },
811
812   {
813     'key'         => 'unapplycredits',
814     'section'     => 'deprecated',
815     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to nable "unapplication" of unclosed credits.',
816     'type'        => 'checkbox',
817   },
818
819   {
820     'key'         => 'dirhash',
821     'section'     => 'shell',
822     'description' => 'Optional numeric value to control directory hashing.  If positive, hashes directories for the specified number of levels from the front of the username.  If negative, hashes directories for the specified number of levels from the end of the username.  Some examples: <ul><li>1: user -> <a href="#home">/home</a>/u/user<li>2: user -> <a href="#home">/home</a>/u/s/user<li>-1: user -> <a href="#home">/home</a>/r/user<li>-2: user -> <a href="#home">home</a>/r/e/user</ul>',
823     'type'        => 'text',
824   },
825
826   {
827     'key'         => 'disable_cust_attachment',
828     'section'     => '',
829     'description' => 'Disable customer file attachments',
830     'type'        => 'checkbox',
831   },
832
833   {
834     'key'         => 'max_attachment_size',
835     'section'     => '',
836     'description' => 'Maximum size for customer file attachments (leave blank for unlimited)',
837     'type'        => 'text',
838   },
839
840   {
841     'key'         => 'disable_customer_referrals',
842     'section'     => 'UI',
843     'description' => 'Disable new customer-to-customer referrals in the web interface',
844     'type'        => 'checkbox',
845   },
846
847   {
848     'key'         => 'editreferrals',
849     'section'     => 'UI',
850     'description' => 'Enable advertising source modification for existing customers',
851     'type'        => 'checkbox',
852   },
853
854   {
855     'key'         => 'emailinvoiceonly',
856     'section'     => 'invoicing',
857     'description' => 'Disables postal mail invoices',
858     'type'        => 'checkbox',
859   },
860
861   {
862     'key'         => 'disablepostalinvoicedefault',
863     'section'     => 'invoicing',
864     'description' => 'Disables postal mail invoices as the default option in the UI.  Be careful not to setup customers which are not sent invoices.  See <a href ="#emailinvoiceauto">emailinvoiceauto</a>.',
865     'type'        => 'checkbox',
866   },
867
868   {
869     'key'         => 'emailinvoiceauto',
870     'section'     => 'invoicing',
871     'description' => 'Automatically adds new accounts to the email invoice list',
872     'type'        => 'checkbox',
873   },
874
875   {
876     'key'         => 'emailinvoiceautoalways',
877     'section'     => 'invoicing',
878     'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses',
879     'type'        => 'checkbox',
880   },
881
882   {
883     'key'         => 'emailinvoice-apostrophe',
884     'section'     => 'invoicing',
885     'description' => 'Allows the apostrophe (single quote) character in the email addresses in the email invoice list.',
886     'type'        => 'checkbox',
887   },
888
889   {
890     'key'         => 'exclude_ip_addr',
891     'section'     => '',
892     'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
893     'type'        => 'textarea',
894   },
895   
896   {
897     'key'         => 'auto_router',
898     'section'     => '',
899     'description' => 'Automatically choose the correct router/block based on supplied ip address when possible while provisioning broadband services',
900     'type'        => 'checkbox',
901   },
902   
903   {
904     'key'         => 'hidecancelledpackages',
905     'section'     => 'UI',
906     'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
907     'type'        => 'checkbox',
908   },
909
910   {
911     'key'         => 'hidecancelledcustomers',
912     'section'     => 'UI',
913     'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
914     'type'        => 'checkbox',
915   },
916
917   {
918     'key'         => 'home',
919     'section'     => 'shell',
920     'description' => 'For new users, prefixed to username to create a directory name.  Should have a leading but not a trailing slash.',
921     'type'        => 'text',
922   },
923
924   {
925     'key'         => 'invoice_from',
926     'section'     => 'required',
927     'description' => 'Return address on email invoices',
928     'type'        => 'text',
929     'per_agent'   => 1,
930   },
931
932   {
933     'key'         => 'invoice_subject',
934     'section'     => 'invoicing',
935     'description' => 'Subject: header on email invoices.  Defaults to "Invoice".  The following substitutions are available: $name, $name_short, $invoice_number, and $invoice_date.',
936     'type'        => 'text',
937     'per_agent'   => 1,
938   },
939
940   {
941     'key'         => 'invoice_usesummary',
942     'section'     => 'invoicing',
943     'description' => 'Indicates that html and latex invoices should be in summary style and make use of invoice_latexsummary.',
944     'type'        => 'checkbox',
945   },
946
947   {
948     'key'         => 'invoice_template',
949     'section'     => 'invoicing',
950     'description' => 'Text template file for invoices.  Used if no invoice_html template is defined, and also seen by users using non-HTML capable mail clients.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Plaintext_invoice_templates">billing documentation</a> for details.',
951     'type'        => 'textarea',
952   },
953
954   {
955     'key'         => 'invoice_html',
956     'section'     => 'invoicing',
957     'description' => 'Optional HTML template for invoices.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#HTML_invoice_templates">billing documentation</a> for details.',
958
959     'type'        => 'textarea',
960   },
961
962   {
963     'key'         => 'invoice_htmlnotes',
964     'section'     => 'invoicing',
965     'description' => 'Notes section for HTML invoices.  Defaults to the same data in invoice_latexnotes if not specified.',
966     'type'        => 'textarea',
967     'per_agent'   => 1,
968   },
969
970   {
971     'key'         => 'invoice_htmlfooter',
972     'section'     => 'invoicing',
973     'description' => 'Footer for HTML invoices.  Defaults to the same data in invoice_latexfooter if not specified.',
974     'type'        => 'textarea',
975     'per_agent'   => 1,
976   },
977
978   {
979     'key'         => 'invoice_htmlsummary',
980     'section'     => 'invoicing',
981     'description' => 'Summary initial page for HTML invoices.',
982     'type'        => 'textarea',
983     'per_agent'   => 1,
984   },
985
986   {
987     'key'         => 'invoice_htmlreturnaddress',
988     'section'     => 'invoicing',
989     'description' => 'Return address for HTML invoices.  Defaults to the same data in invoice_latexreturnaddress if not specified.',
990     'type'        => 'textarea',
991   },
992
993   {
994     'key'         => 'invoice_latex',
995     'section'     => 'invoicing',
996     'description' => 'Optional LaTeX template for typeset PostScript invoices.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Typeset_.28LaTeX.29_invoice_templates">billing documentation</a> for details.',
997     'type'        => 'textarea',
998   },
999
1000   {
1001     'key'         => 'invoice_latextopmargin',
1002     'section'     => 'invoicing',
1003     'description' => 'Optional LaTeX invoice topmargin setting. Include units.',
1004     'type'        => 'text',
1005     'per_agent'   => 1,
1006     'validate'    => sub { shift =~
1007                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1008                              ? '' : 'Invalid LaTex length';
1009                          },
1010   },
1011
1012   {
1013     'key'         => 'invoice_latexheadsep',
1014     'section'     => 'invoicing',
1015     'description' => 'Optional LaTeX invoice headsep setting. Include units.',
1016     'type'        => 'text',
1017     'per_agent'   => 1,
1018     'validate'    => sub { shift =~
1019                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1020                              ? '' : 'Invalid LaTex length';
1021                          },
1022   },
1023
1024   {
1025     'key'         => 'invoice_latexaddresssep',
1026     'section'     => 'invoicing',
1027     'description' => 'Optional LaTeX invoice separation between invoice header
1028 and customer address. Include units.',
1029     'type'        => 'text',
1030     'per_agent'   => 1,
1031     'validate'    => sub { shift =~
1032                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1033                              ? '' : 'Invalid LaTex length';
1034                          },
1035   },
1036
1037   {
1038     'key'         => 'invoice_latextextheight',
1039     'section'     => 'invoicing',
1040     'description' => 'Optional LaTeX invoice textheight setting. Include units.',
1041     'type'        => 'text',
1042     'per_agent'   => 1,
1043     'validate'    => sub { shift =~
1044                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1045                              ? '' : 'Invalid LaTex length';
1046                          },
1047   },
1048
1049   {
1050     'key'         => 'invoice_latexnotes',
1051     'section'     => 'invoicing',
1052     'description' => 'Notes section for LaTeX typeset PostScript invoices.',
1053     'type'        => 'textarea',
1054     'per_agent'   => 1,
1055   },
1056
1057   {
1058     'key'         => 'invoice_latexfooter',
1059     'section'     => 'invoicing',
1060     'description' => 'Footer for LaTeX typeset PostScript invoices.',
1061     'type'        => 'textarea',
1062     'per_agent'   => 1,
1063   },
1064
1065   {
1066     'key'         => 'invoice_latexsummary',
1067     'section'     => 'invoicing',
1068     'description' => 'Summary initial page for LaTeX typeset PostScript invoices.',
1069     'type'        => 'textarea',
1070     'per_agent'   => 1,
1071   },
1072
1073   {
1074     'key'         => 'invoice_latexcoupon',
1075     'section'     => 'invoicing',
1076     'description' => 'Remittance coupon for LaTeX typeset PostScript invoices.',
1077     'type'        => 'textarea',
1078     'per_agent'   => 1,
1079   },
1080
1081   {
1082     'key'         => 'invoice_latexextracouponspace',
1083     'section'     => 'invoicing',
1084     'description' => 'Optional LaTeX invoice textheight space to reserve for a tear off coupon. Include units.',
1085     'type'        => 'text',
1086     'per_agent'   => 1,
1087     'validate'    => sub { shift =~
1088                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1089                              ? '' : 'Invalid LaTex length';
1090                          },
1091   },
1092
1093   {
1094     'key'         => 'invoice_latexcouponfootsep',
1095     'section'     => 'invoicing',
1096     'description' => 'Optional LaTeX invoice separation between tear off coupon and footer. Include units.',
1097     'type'        => 'text',
1098     'per_agent'   => 1,
1099     'validate'    => sub { shift =~
1100                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1101                              ? '' : 'Invalid LaTex length';
1102                          },
1103   },
1104
1105   {
1106     'key'         => 'invoice_latexcouponamountenclosedsep',
1107     'section'     => 'invoicing',
1108     'description' => 'Optional LaTeX invoice separation between total due and amount enclosed line. Include units.',
1109     'type'        => 'text',
1110     'per_agent'   => 1,
1111     'validate'    => sub { shift =~
1112                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1113                              ? '' : 'Invalid LaTex length';
1114                          },
1115   },
1116   {
1117     'key'         => 'invoice_latexcoupontoaddresssep',
1118     'section'     => 'invoicing',
1119     'description' => 'Optional LaTeX invoice separation between invoice data and the to address (usually invoice_latexreturnaddress).  Include units.',
1120     'type'        => 'text',
1121     'per_agent'   => 1,
1122     'validate'    => sub { shift =~
1123                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1124                              ? '' : 'Invalid LaTex length';
1125                          },
1126   },
1127
1128   {
1129     'key'         => 'invoice_latexreturnaddress',
1130     'section'     => 'invoicing',
1131     'description' => 'Return address for LaTeX typeset PostScript invoices.',
1132     'type'        => 'textarea',
1133   },
1134
1135   {
1136     'key'         => 'invoice_latexverticalreturnaddress',
1137     'section'     => 'invoicing',
1138     'description' => 'Place the return address under the company logo rather than beside it.',
1139     'type'        => 'checkbox',
1140     'per_agent'   => 1,
1141   },
1142
1143   {
1144     'key'         => 'invoice_latexcouponaddcompanytoaddress',
1145     'section'     => 'invoicing',
1146     'description' => 'Add the company name to the To address on the remittance coupon because the return address does not contain it.',
1147     'type'        => 'checkbox',
1148     'per_agent'   => 1,
1149   },
1150
1151   {
1152     'key'         => 'invoice_latexsmallfooter',
1153     'section'     => 'invoicing',
1154     'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
1155     'type'        => 'textarea',
1156     'per_agent'   => 1,
1157   },
1158
1159   {
1160     'key'         => 'invoice_email_pdf',
1161     'section'     => 'invoicing',
1162     'description' => 'Send PDF invoice as an attachment to emailed invoices.  By default, includes the plain text invoice as the email body, unless invoice_email_pdf_note is set.',
1163     'type'        => 'checkbox'
1164   },
1165
1166   {
1167     'key'         => 'invoice_email_pdf_note',
1168     'section'     => 'invoicing',
1169     'description' => 'If defined, this text will replace the default plain text invoice as the body of emailed PDF invoices.',
1170     'type'        => 'textarea'
1171   },
1172
1173   {
1174     'key'         => 'invoice_print_pdf',
1175     'section'     => 'invoicing',
1176     'description' => 'Store postal invoices for download in PDF format rather than printing them directly.',
1177     'type'        => 'checkbox',
1178   },
1179
1180   { 
1181     'key'         => 'invoice_default_terms',
1182     'section'     => 'invoicing',
1183     'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
1184     'type'        => 'select',
1185     'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 20', 'Net 30', 'Net 45', 'Net 60', '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'         => 'card_refund-days',
2291     'section'     => 'billing',
2292     'description' => 'After a payment, the number of days a refund link will be available for that payment.  Defaults to 120.',
2293     'type'        => 'text',
2294   },
2295
2296   {
2297     'key'         => 'agent-showpasswords',
2298     'section'     => '',
2299     'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
2300     'type'        => 'checkbox',
2301   },
2302
2303   {
2304     'key'         => 'global_unique-username',
2305     'section'     => 'username',
2306     '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.',
2307     'type'        => 'select',
2308     'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
2309   },
2310
2311   {
2312     'key'         => 'global_unique-phonenum',
2313     'section'     => '',
2314     '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.',
2315     'type'        => 'select',
2316     'select_enum' => [ 'none', 'countrycode+phonenum', 'disabled' ],
2317   },
2318
2319   {
2320     'key'         => 'global_unique-pbx_title',
2321     'section'     => '',
2322     'description' => 'Global phone number uniqueness control: none (check uniqueness per exports), enabled (check across all services), or disabled (no duplicate checking).',
2323     'type'        => 'select',
2324     'select_enum' => [ 'enabled', 'disabled' ],
2325   },
2326
2327   {
2328     'key'         => 'global_unique-pbx_id',
2329     'section'     => '',
2330     'description' => 'Global PBX id uniqueness control: none (check uniqueness per exports), enabled (check across all services), or disabled (no duplicate checking).',
2331     'type'        => 'select',
2332     'select_enum' => [ 'enabled', 'disabled' ],
2333   },
2334
2335   {
2336     'key'         => 'svc_external-skip_manual',
2337     'section'     => 'UI',
2338     '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).',
2339     'type'        => 'checkbox',
2340   },
2341
2342   {
2343     'key'         => 'svc_external-display_type',
2344     'section'     => 'UI',
2345     'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
2346     'type'        => 'select',
2347     'select_enum' => [ 'generic', 'artera_turbo', ],
2348   },
2349
2350   {
2351     'key'         => 'ticket_system',
2352     'section'     => '',
2353     '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).',
2354     'type'        => 'select',
2355     #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
2356     'select_enum' => [ '', qw(RT_Internal RT_External) ],
2357   },
2358
2359   {
2360     'key'         => 'ticket_system-default_queueid',
2361     'section'     => '',
2362     'description' => 'Default queue used when creating new customer tickets.',
2363     'type'        => 'select-sub',
2364     'options_sub' => sub {
2365                            my $conf = new FS::Conf;
2366                            if ( $conf->config('ticket_system') ) {
2367                              eval "use FS::TicketSystem;";
2368                              die $@ if $@;
2369                              FS::TicketSystem->queues();
2370                            } else {
2371                              ();
2372                            }
2373                          },
2374     'option_sub'  => sub { 
2375                            my $conf = new FS::Conf;
2376                            if ( $conf->config('ticket_system') ) {
2377                              eval "use FS::TicketSystem;";
2378                              die $@ if $@;
2379                              FS::TicketSystem->queue(shift);
2380                            } else {
2381                              '';
2382                            }
2383                          },
2384   },
2385   {
2386     'key'         => 'ticket_system-force_default_queueid',
2387     'section'     => '',
2388     'description' => 'Disallow queue selection when creating new tickets from customer view.',
2389     'type'        => 'checkbox',
2390   },
2391   {
2392     'key'         => 'ticket_system-selfservice_queueid',
2393     'section'     => '',
2394     'description' => 'Queue used when creating new customer tickets from self-service.  Defautls to ticket_system-default_queueid if not specified.',
2395     #false laziness w/above
2396     'type'        => 'select-sub',
2397     'options_sub' => sub {
2398                            my $conf = new FS::Conf;
2399                            if ( $conf->config('ticket_system') ) {
2400                              eval "use FS::TicketSystem;";
2401                              die $@ if $@;
2402                              FS::TicketSystem->queues();
2403                            } else {
2404                              ();
2405                            }
2406                          },
2407     'option_sub'  => sub { 
2408                            my $conf = new FS::Conf;
2409                            if ( $conf->config('ticket_system') ) {
2410                              eval "use FS::TicketSystem;";
2411                              die $@ if $@;
2412                              FS::TicketSystem->queue(shift);
2413                            } else {
2414                              '';
2415                            }
2416                          },
2417   },
2418
2419   {
2420     'key'         => 'ticket_system-priority_reverse',
2421     'section'     => '',
2422     '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.',
2423     'type'        => 'checkbox',
2424   },
2425
2426   {
2427     'key'         => 'ticket_system-custom_priority_field',
2428     'section'     => '',
2429     'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
2430     'type'        => 'text',
2431   },
2432
2433   {
2434     'key'         => 'ticket_system-custom_priority_field-values',
2435     'section'     => '',
2436     'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
2437     'type'        => 'textarea',
2438   },
2439
2440   {
2441     'key'         => 'ticket_system-custom_priority_field_queue',
2442     'section'     => '',
2443     'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
2444     'type'        => 'text',
2445   },
2446
2447   {
2448     'key'         => 'ticket_system-rt_external_datasrc',
2449     'section'     => '',
2450     '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>',
2451     'type'        => 'text',
2452
2453   },
2454
2455   {
2456     'key'         => 'ticket_system-rt_external_url',
2457     'section'     => '',
2458     'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
2459     'type'        => 'text',
2460   },
2461
2462   {
2463     'key'         => 'company_name',
2464     'section'     => 'required',
2465     'description' => 'Your company name',
2466     'type'        => 'text',
2467     'per_agent'   => 1, #XXX just FS/FS/ClientAPI/Signup.pm
2468   },
2469
2470   {
2471     'key'         => 'company_address',
2472     'section'     => 'required',
2473     'description' => 'Your company address',
2474     'type'        => 'textarea',
2475     'per_agent'   => 1,
2476   },
2477
2478   {
2479     'key'         => 'echeck-void',
2480     'section'     => 'deprecated',
2481     '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',
2482     'type'        => 'checkbox',
2483   },
2484
2485   {
2486     'key'         => 'cc-void',
2487     'section'     => 'deprecated',
2488     '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',
2489     'type'        => 'checkbox',
2490   },
2491
2492   {
2493     'key'         => 'unvoid',
2494     'section'     => 'deprecated',
2495     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable unvoiding of voided payments',
2496     'type'        => 'checkbox',
2497   },
2498
2499   {
2500     'key'         => 'address1-search',
2501     'section'     => 'UI',
2502     '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.',
2503     'type'        => 'checkbox',
2504   },
2505
2506   {
2507     'key'         => 'address2-search',
2508     'section'     => 'UI',
2509     'description' => 'Enable a "Unit" search box which searches the second address field.  Useful for multi-tenant applications.  See also: cust_main-require_address2',
2510     'type'        => 'checkbox',
2511   },
2512
2513   {
2514     'key'         => 'cust_main-require_address2',
2515     'section'     => 'UI',
2516     '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',
2517     'type'        => 'checkbox',
2518   },
2519
2520   {
2521     'key'         => 'agent-ship_address',
2522     'section'     => '',
2523     '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.",
2524     'type'        => 'checkbox',
2525   },
2526
2527   { 'key'         => 'referral_credit',
2528     'section'     => 'deprecated',
2529     '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.",
2530     'type'        => 'checkbox',
2531   },
2532
2533   { 'key'         => 'selfservice_server-cache_module',
2534     'section'     => 'self-service',
2535     '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.',
2536     'type'        => 'select',
2537     'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
2538   },
2539
2540   {
2541     'key'         => 'hylafax',
2542     'section'     => 'billing',
2543     '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).',
2544     'type'        => [qw( checkbox textarea )],
2545   },
2546
2547   {
2548     'key'         => 'cust_bill-ftpformat',
2549     'section'     => 'invoicing',
2550     'description' => 'Enable FTP of raw invoice data - format.',
2551     'type'        => 'select',
2552     'select_enum' => [ '', 'default', 'billco', ],
2553   },
2554
2555   {
2556     'key'         => 'cust_bill-ftpserver',
2557     'section'     => 'invoicing',
2558     'description' => 'Enable FTP of raw invoice data - server.',
2559     'type'        => 'text',
2560   },
2561
2562   {
2563     'key'         => 'cust_bill-ftpusername',
2564     'section'     => 'invoicing',
2565     'description' => 'Enable FTP of raw invoice data - server.',
2566     'type'        => 'text',
2567   },
2568
2569   {
2570     'key'         => 'cust_bill-ftppassword',
2571     'section'     => 'invoicing',
2572     'description' => 'Enable FTP of raw invoice data - server.',
2573     'type'        => 'text',
2574   },
2575
2576   {
2577     'key'         => 'cust_bill-ftpdir',
2578     'section'     => 'invoicing',
2579     'description' => 'Enable FTP of raw invoice data - server.',
2580     'type'        => 'text',
2581   },
2582
2583   {
2584     'key'         => 'cust_bill-spoolformat',
2585     'section'     => 'invoicing',
2586     'description' => 'Enable spooling of raw invoice data - format.',
2587     'type'        => 'select',
2588     'select_enum' => [ '', 'default', 'billco', ],
2589   },
2590
2591   {
2592     'key'         => 'cust_bill-spoolagent',
2593     'section'     => 'invoicing',
2594     'description' => 'Enable per-agent spooling of raw invoice data.',
2595     'type'        => 'checkbox',
2596   },
2597
2598   {
2599     'key'         => 'svc_acct-usage_suspend',
2600     'section'     => 'billing',
2601     '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.',
2602     'type'        => 'checkbox',
2603   },
2604
2605   {
2606     'key'         => 'svc_acct-usage_unsuspend',
2607     'section'     => 'billing',
2608     '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.',
2609     'type'        => 'checkbox',
2610   },
2611
2612   {
2613     'key'         => 'svc_acct-usage_threshold',
2614     'section'     => 'billing',
2615     '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.',
2616     'type'        => 'text',
2617   },
2618
2619   {
2620     'key'         => 'overlimit_groups',
2621     'section'     => '',
2622     'description' => 'RADIUS group (or comma-separated groups) to assign to svc_acct which has exceeded its bandwidth or time limit.',
2623     'type'        => 'text',
2624     'per_agent'   => 1,
2625   },
2626
2627   {
2628     'key'         => 'cust-fields',
2629     'section'     => 'UI',
2630     'description' => 'Which customer fields to display on reports by default',
2631     'type'        => 'select',
2632     'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
2633   },
2634
2635   {
2636     'key'         => 'cust_pkg-display_times',
2637     'section'     => 'UI',
2638     'description' => 'Display full timestamps (not just dates) for customer packages.  Useful if you are doing real-time things like hourly prepaid.',
2639     'type'        => 'checkbox',
2640   },
2641
2642   {
2643     'key'         => 'cust_pkg-always_show_location',
2644     'section'     => 'UI',
2645     'description' => "Always display package locations, even when they're all the default service address.",
2646     'type'        => 'checkbox',
2647   },
2648
2649   {
2650     'key'         => 'cust_pkg-show_fcc_voice_grade_equivalent',
2651     'section'     => 'UI',
2652     'description' => "Show a field on package definitions for assigning a DSO equivalency number suitable for use on FCC form 477.",
2653     'type'        => 'checkbox',
2654   },
2655
2656   {
2657     'key'         => 'cust_pkg-large_pkg_size',
2658     'section'     => 'UI',
2659     'description' => "In customer view, summarize packages with more than this many services.  Set to zero to never summarize packages.",
2660     'type'        => 'text',
2661   },
2662
2663   {
2664     'key'         => 'svc_acct-edit_uid',
2665     'section'     => 'shell',
2666     'description' => 'Allow UID editing.',
2667     'type'        => 'checkbox',
2668   },
2669
2670   {
2671     'key'         => 'svc_acct-edit_gid',
2672     'section'     => 'shell',
2673     'description' => 'Allow GID editing.',
2674     'type'        => 'checkbox',
2675   },
2676
2677   {
2678     'key'         => 'zone-underscore',
2679     'section'     => 'BIND',
2680     'description' => 'Allow underscores in zone names.  As underscores are illegal characters in zone names, this option is not recommended.',
2681     'type'        => 'checkbox',
2682   },
2683
2684   {
2685     'key'         => 'echeck-nonus',
2686     'section'     => 'billing',
2687     'description' => 'Disable ABA-format account checking for Electronic Check payment info',
2688     'type'        => 'checkbox',
2689   },
2690
2691   {
2692     'key'         => 'voip-cust_cdr_spools',
2693     'section'     => '',
2694     'description' => 'Enable the per-customer option for individual CDR spools.',
2695     'type'        => 'checkbox',
2696   },
2697
2698   {
2699     'key'         => 'voip-cust_cdr_squelch',
2700     'section'     => '',
2701     'description' => 'Enable the per-customer option for not printing CDR on invoices.',
2702     'type'        => 'checkbox',
2703   },
2704
2705   {
2706     'key'         => 'voip-cdr_email',
2707     'section'     => '',
2708     '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.',
2709     'type'        => 'checkbox',
2710   },
2711
2712   {
2713     'key'         => 'voip-cust_email_csv_cdr',
2714     'section'     => '',
2715     'description' => 'Enable the per-customer option for including CDR information as a CSV attachment on emailed invoices.',
2716     'type'        => 'checkbox',
2717   },
2718
2719   {
2720     'key'         => 'cgp_rule-domain_templates',
2721     'section'     => '',
2722     'description' => 'Communigate Pro rule templates for domains, one per line, "svcnum Name"',
2723     'type'        => 'textarea',
2724   },
2725
2726   {
2727     'key'         => 'svc_forward-no_srcsvc',
2728     'section'     => '',
2729     '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.",
2730     'type'        => 'checkbox',
2731   },
2732
2733   {
2734     'key'         => 'svc_forward-arbitrary_dst',
2735     'section'     => '',
2736     '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.",
2737     'type'        => 'checkbox',
2738   },
2739
2740   {
2741     'key'         => 'tax-ship_address',
2742     'section'     => 'billing',
2743     'description' => 'By default, tax calculations are done based on the billing address.  Enable this switch to calculate tax based on the shipping address instead.',
2744     'type'        => 'checkbox',
2745   }
2746 ,
2747   {
2748     'key'         => 'tax-pkg_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 package address instead (when present).',
2751     'type'        => 'checkbox',
2752   },
2753
2754   {
2755     'key'         => 'invoice-ship_address',
2756     'section'     => 'invoicing',
2757     'description' => 'Include the shipping address on invoices.',
2758     'type'        => 'checkbox',
2759   },
2760
2761   {
2762     'key'         => 'invoice-unitprice',
2763     'section'     => 'invoicing',
2764     'description' => 'Enable unit pricing on invoices.',
2765     'type'        => 'checkbox',
2766   },
2767
2768   {
2769     'key'         => 'invoice-smallernotes',
2770     'section'     => 'invoicing',
2771     'description' => 'Display the notes section in a smaller font on invoices.',
2772     'type'        => 'checkbox',
2773   },
2774
2775   {
2776     'key'         => 'invoice-smallerfooter',
2777     'section'     => 'invoicing',
2778     'description' => 'Display footers in a smaller font on invoices.',
2779     'type'        => 'checkbox',
2780   },
2781
2782   {
2783     'key'         => 'postal_invoice-fee_pkgpart',
2784     'section'     => 'billing',
2785     'description' => 'This allows selection of a package to insert on invoices for customers with postal invoices selected.',
2786     'type'        => 'select-part_pkg',
2787   },
2788
2789   {
2790     'key'         => 'postal_invoice-recurring_only',
2791     'section'     => 'billing',
2792     'description' => 'The postal invoice fee is omitted on invoices without reucrring charges when this is set.',
2793     'type'        => 'checkbox',
2794   },
2795
2796   {
2797     'key'         => 'batch-enable',
2798     'section'     => 'deprecated', #make sure batch-enable_payby is set for
2799                                    #everyone before removing
2800     'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
2801     'type'        => 'checkbox',
2802   },
2803
2804   {
2805     'key'         => 'batch-enable_payby',
2806     'section'     => 'billing',
2807     'description' => 'Enable batch processing for the specified payment types.',
2808     'type'        => 'selectmultiple',
2809     'select_enum' => [qw( CARD CHEK )],
2810   },
2811
2812   {
2813     'key'         => 'realtime-disable_payby',
2814     'section'     => 'billing',
2815     'description' => 'Disable realtime processing for the specified payment types.',
2816     'type'        => 'selectmultiple',
2817     'select_enum' => [qw( CARD CHEK )],
2818   },
2819
2820   {
2821     'key'         => 'batch-default_format',
2822     'section'     => 'billing',
2823     'description' => 'Default format for batches.',
2824     'type'        => 'select',
2825     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch',
2826                        'csv-chase_canada-E-xactBatch', 'BoM', 'PAP',
2827                        'paymentech', 'ach-spiritone', 'RBC'
2828                     ]
2829   },
2830
2831   #lists could be auto-generated from pay_batch info
2832   {
2833     'key'         => 'batch-fixed_format-CARD',
2834     'section'     => 'billing',
2835     'description' => 'Fixed (unchangeable) format for credit card batches.',
2836     'type'        => 'select',
2837     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
2838                        'csv-chase_canada-E-xactBatch', 'paymentech' ]
2839   },
2840
2841   {
2842     'key'         => 'batch-fixed_format-CHEK',
2843     'section'     => 'billing',
2844     'description' => 'Fixed (unchangeable) format for electronic check batches.',
2845     'type'        => 'select',
2846     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP',
2847                        'paymentech', 'ach-spiritone', 'RBC'
2848                      ]
2849   },
2850
2851   {
2852     'key'         => 'batch-increment_expiration',
2853     'section'     => 'billing',
2854     'description' => 'Increment expiration date years in batches until cards are current.  Make sure this is acceptable to your batching provider before enabling.',
2855     'type'        => 'checkbox'
2856   },
2857
2858   {
2859     'key'         => 'batchconfig-BoM',
2860     'section'     => 'billing',
2861     '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',
2862     'type'        => 'textarea',
2863   },
2864
2865   {
2866     'key'         => 'batchconfig-PAP',
2867     'section'     => 'billing',
2868     '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',
2869     'type'        => 'textarea',
2870   },
2871
2872   {
2873     'key'         => 'batchconfig-csv-chase_canada-E-xactBatch',
2874     'section'     => 'billing',
2875     'description' => 'Gateway ID for Chase Canada E-xact batching',
2876     'type'        => 'text',
2877   },
2878
2879   {
2880     'key'         => 'batchconfig-paymentech',
2881     'section'     => 'billing',
2882     'description' => 'Configuration for Chase Paymentech batching, five lines: 1. BIN, 2. Terminal ID, 3. Merchant ID, 4. Username, 5. Password (for batch uploads)',
2883     'type'        => 'textarea',
2884   },
2885
2886   {
2887     'key'         => 'batchconfig-RBC',
2888     'section'     => 'billing',
2889     'description' => 'Configuration for Royal Bank of Canada PDS batching, four lines: 1. Client number, 2. Short name, 3. Long name, 4. Transaction code.',
2890     'type'        => 'textarea',
2891   },
2892
2893   {
2894     'key'         => 'payment_history-years',
2895     'section'     => 'UI',
2896     'description' => 'Number of years of payment history to show by default.  Currently defaults to 2.',
2897     'type'        => 'text',
2898   },
2899
2900   {
2901     'key'         => 'change_history-years',
2902     'section'     => 'UI',
2903     'description' => 'Number of years of change history to show by default.  Currently defaults to 0.5.',
2904     'type'        => 'text',
2905   },
2906
2907   {
2908     'key'         => 'cust_main-packages-years',
2909     'section'     => 'UI',
2910     'description' => 'Number of years to show old (cancelled and one-time charge) packages by default.  Currently defaults to 2.',
2911     'type'        => 'text',
2912   },
2913
2914   {
2915     'key'         => 'cust_main-use_comments',
2916     'section'     => 'UI',
2917     'description' => 'Display free form comments on the customer edit screen.  Useful as a scratch pad.',
2918     'type'        => 'checkbox',
2919   },
2920
2921   {
2922     'key'         => 'cust_main-disable_notes',
2923     'section'     => 'UI',
2924     'description' => 'Disable new style customer notes - timestamped and user identified customer notes.  Useful in tracking who did what.',
2925     'type'        => 'checkbox',
2926   },
2927
2928   {
2929     'key'         => 'cust_main_note-display_times',
2930     'section'     => 'UI',
2931     'description' => 'Display full timestamps (not just dates) for customer notes.',
2932     'type'        => 'checkbox',
2933   },
2934
2935   {
2936     'key'         => 'cust_main-ticket_statuses',
2937     'section'     => 'UI',
2938     'description' => 'Show tickets with these statuses on the customer view page.',
2939     'type'        => 'selectmultiple',
2940     'select_enum' => [qw( new open stalled resolved rejected deleted )],
2941   },
2942
2943   {
2944     'key'         => 'cust_main-max_tickets',
2945     'section'     => 'UI',
2946     'description' => 'Maximum number of tickets to show on the customer view page.',
2947     'type'        => 'text',
2948   },
2949
2950   {
2951     'key'         => 'cust_main-skeleton_tables',
2952     'section'     => '',
2953     '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.',
2954     'type'        => 'textarea',
2955   },
2956
2957   {
2958     'key'         => 'cust_main-skeleton_custnum',
2959     'section'     => '',
2960     'description' => 'Customer number specifying the source data to copy into skeleton tables for new customers.',
2961     'type'        => 'text',
2962   },
2963
2964   {
2965     'key'         => 'cust_main-enable_birthdate',
2966     'section'     => 'UI',
2967     'descritpion' => 'Enable tracking of a birth date with each customer record',
2968     'type'        => 'checkbox',
2969   },
2970
2971   {
2972     'key'         => 'support-key',
2973     'section'     => '',
2974     '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.',
2975     'type'        => 'text',
2976   },
2977
2978   {
2979     'key'         => 'card-types',
2980     'section'     => 'billing',
2981     'description' => 'Select one or more card types to enable only those card types.  If no card types are selected, all card types are available.',
2982     'type'        => 'selectmultiple',
2983     'select_enum' => \@card_types,
2984   },
2985
2986   {
2987     'key'         => 'disable-fuzzy',
2988     'section'     => 'UI',
2989     'description' => 'Disable fuzzy searching.  Speeds up searching for large sites, but only shows exact matches.',
2990     'type'        => 'checkbox',
2991   },
2992
2993   { 'key'         => 'pkg_referral',
2994     'section'     => '',
2995     'description' => 'Enable package-specific advertising sources.',
2996     'type'        => 'checkbox',
2997   },
2998
2999   { 'key'         => 'pkg_referral-multiple',
3000     'section'     => '',
3001     'description' => 'In addition, allow multiple advertising sources to be associated with a single package.',
3002     'type'        => 'checkbox',
3003   },
3004
3005   {
3006     'key'         => 'dashboard-install_welcome',
3007     'section'     => 'UI',
3008     'description' => 'New install welcome screen.',
3009     'type'        => 'select',
3010     'select_enum' => [ '', 'ITSP_fsinc_hosted', ],
3011   },
3012
3013   {
3014     'key'         => 'dashboard-toplist',
3015     'section'     => 'UI',
3016     'description' => 'List of items to display on the top of the front page',
3017     'type'        => 'textarea',
3018   },
3019
3020   {
3021     'key'         => 'impending_recur_msgnum',
3022     'section'     => 'notification',
3023     'description' => 'Template to use for alerts about first-time recurring billing.',
3024     %msg_template_options,
3025   },
3026
3027   {
3028     'key'         => 'impending_recur_template',
3029     'section'     => 'deprecated',
3030     '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>',
3031 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
3032     'type'        => 'textarea',
3033   },
3034
3035   {
3036     'key'         => 'logo.png',
3037     'section'     => 'UI',  #'invoicing' ?
3038     'description' => 'Company logo for HTML invoices and the backoffice interface, in PNG format.  Suggested size somewhere near 92x62.',
3039     'type'        => 'image',
3040     'per_agent'   => 1, #XXX just view/logo.cgi, which is for the global
3041                         #old-style editor anyway...?
3042   },
3043
3044   {
3045     'key'         => 'logo.eps',
3046     'section'     => 'invoicing',
3047     'description' => 'Company logo for printed and PDF invoices, in EPS format.',
3048     'type'        => 'image',
3049     'per_agent'   => 1, #XXX as above, kinda
3050   },
3051
3052   {
3053     'key'         => 'selfservice-ignore_quantity',
3054     'section'     => 'self-service',
3055     'description' => 'Ignores service quantity restrictions in self-service context.  Strongly not recommended - just set your quantities correctly in the first place.',
3056     'type'        => 'checkbox',
3057   },
3058
3059   {
3060     'key'         => 'selfservice-session_timeout',
3061     'section'     => 'self-service',
3062     'description' => 'Self-service session timeout.  Defaults to 1 hour.',
3063     'type'        => 'select',
3064     'select_enum' => [ '1 hour', '2 hours', '4 hours', '8 hours', '1 day', '1 week', ],
3065   },
3066
3067   {
3068     'key'         => 'disable_setup_suspended_pkgs',
3069     'section'     => 'billing',
3070     'description' => 'Disables charging of setup fees for suspended packages.',
3071     'type'        => 'checkbox',
3072   },
3073
3074   {
3075     'key'         => 'password-generated-allcaps',
3076     'section'     => 'password',
3077     'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
3078     'type'        => 'checkbox',
3079   },
3080
3081   {
3082     'key'         => 'datavolume-forcemegabytes',
3083     'section'     => 'UI',
3084     'description' => 'All data volumes are expressed in megabytes',
3085     'type'        => 'checkbox',
3086   },
3087
3088   {
3089     'key'         => 'datavolume-significantdigits',
3090     'section'     => 'UI',
3091     'description' => 'number of significant digits to use to represent data volumes',
3092     'type'        => 'text',
3093   },
3094
3095   {
3096     'key'         => 'disable_void_after',
3097     'section'     => 'billing',
3098     'description' => 'Number of seconds after which freeside won\'t attempt to VOID a payment first when performing a refund.',
3099     'type'        => 'text',
3100   },
3101
3102   {
3103     'key'         => 'disable_line_item_date_ranges',
3104     'section'     => 'billing',
3105     'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.',
3106     'type'        => 'checkbox',
3107   },
3108
3109   {
3110     'key'         => 'support_packages',
3111     'section'     => '',
3112     '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...
3113     'type'        => 'select-part_pkg',
3114     'multiple'    => 1,
3115   },
3116
3117   {
3118     'key'         => 'cust_main-require_phone',
3119     'section'     => '',
3120     'description' => 'Require daytime or night phone for all customer records.',
3121     'type'        => 'checkbox',
3122   },
3123
3124   {
3125     'key'         => 'cust_main-require_invoicing_list_email',
3126     'section'     => '',
3127     'description' => 'Email address field is required: require at least one invoicing email address for all customer records.',
3128     'type'        => 'checkbox',
3129   },
3130
3131   {
3132     'key'         => 'svc_acct-display_paid_time_remaining',
3133     'section'     => '',
3134     'description' => 'Show paid time remaining in addition to time remaining.',
3135     'type'        => 'checkbox',
3136   },
3137
3138   {
3139     'key'         => 'cancel_credit_type',
3140     'section'     => 'billing',
3141     'description' => 'The group to use for new, automatically generated credit reasons resulting from cancellation.',
3142     'type'        => 'select-sub',
3143     'options_sub' => sub { require FS::Record;
3144                            require FS::reason_type;
3145                            map { $_->typenum => $_->type }
3146                                FS::Record::qsearch('reason_type', { class=>'R' } );
3147                          },
3148     'option_sub'  => sub { require FS::Record;
3149                            require FS::reason_type;
3150                            my $reason_type = FS::Record::qsearchs(
3151                              'reason_type', { 'typenum' => shift }
3152                            );
3153                            $reason_type ? $reason_type->type : '';
3154                          },
3155   },
3156
3157   {
3158     'key'         => 'referral_credit_type',
3159     'section'     => 'deprecated',
3160     '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.',
3161     'type'        => 'select-sub',
3162     'options_sub' => sub { require FS::Record;
3163                            require FS::reason_type;
3164                            map { $_->typenum => $_->type }
3165                                FS::Record::qsearch('reason_type', { class=>'R' } );
3166                          },
3167     'option_sub'  => sub { require FS::Record;
3168                            require FS::reason_type;
3169                            my $reason_type = FS::Record::qsearchs(
3170                              'reason_type', { 'typenum' => shift }
3171                            );
3172                            $reason_type ? $reason_type->type : '';
3173                          },
3174   },
3175
3176   {
3177     'key'         => 'signup_credit_type',
3178     'section'     => 'billing', #self-service?
3179     'description' => 'The group to use for new, automatically generated credit reasons resulting from signup and self-service declines.',
3180     'type'        => 'select-sub',
3181     'options_sub' => sub { require FS::Record;
3182                            require FS::reason_type;
3183                            map { $_->typenum => $_->type }
3184                                FS::Record::qsearch('reason_type', { class=>'R' } );
3185                          },
3186     'option_sub'  => sub { require FS::Record;
3187                            require FS::reason_type;
3188                            my $reason_type = FS::Record::qsearchs(
3189                              'reason_type', { 'typenum' => shift }
3190                            );
3191                            $reason_type ? $reason_type->type : '';
3192                          },
3193   },
3194
3195   {
3196     'key'         => 'prepayment_discounts-credit_type',
3197     'section'     => 'billing',
3198     'description' => 'Enables the offering of prepayment discounts and establishes the credit reason type.',
3199     'type'        => 'select-sub',
3200     'options_sub' => sub { require FS::Record;
3201                            require FS::reason_type;
3202                            map { $_->typenum => $_->type }
3203                                FS::Record::qsearch('reason_type', { class=>'R' } );
3204                          },
3205     'option_sub'  => sub { require FS::Record;
3206                            require FS::reason_type;
3207                            my $reason_type = FS::Record::qsearchs(
3208                              'reason_type', { 'typenum' => shift }
3209                            );
3210                            $reason_type ? $reason_type->type : '';
3211                          },
3212
3213   },
3214
3215   {
3216     'key'         => 'cust_main-agent_custid-format',
3217     'section'     => '',
3218     'description' => 'Enables searching of various formatted values in cust_main.agent_custid',
3219     'type'        => 'select',
3220     'select_hash' => [
3221                        ''      => 'Numeric only',
3222                        'ww?d+' => 'Numeric with one or two letter prefix',
3223                      ],
3224   },
3225
3226   {
3227     'key'         => 'card_masking_method',
3228     'section'     => 'UI',
3229     '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.',
3230     'type'        => 'select',
3231     'select_hash' => [
3232                        ''            => '123456xxxxxx1234',
3233                        'first6last2' => '123456xxxxxxxx12',
3234                        'first4last4' => '1234xxxxxxxx1234',
3235                        'first4last2' => '1234xxxxxxxxxx12',
3236                        'first2last4' => '12xxxxxxxxxx1234',
3237                        'first2last2' => '12xxxxxxxxxxxx12',
3238                        'first0last4' => 'xxxxxxxxxxxx1234',
3239                        'first0last2' => 'xxxxxxxxxxxxxx12',
3240                      ],
3241   },
3242
3243   {
3244     'key'         => 'disable_previous_balance',
3245     'section'     => 'invoicing',
3246     'description' => 'Disable inclusion of previous balance, payment, and credit lines on invoices',
3247     'type'        => 'checkbox',
3248   },
3249
3250   {
3251     'key'         => 'previous_balance-exclude_from_total',
3252     'section'     => 'invoicing',
3253     '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',
3254     'type'        => [ qw(checkbox text) ],
3255   },
3256
3257   {
3258     'key'         => 'previous_balance-summary_only',
3259     'section'     => 'invoicing',
3260     'description' => 'Only show a single line summarizing the total previous balance rather than one line per invoice.',
3261     'type'        => 'checkbox',
3262   },
3263
3264   {
3265     'key'         => 'balance_due_below_line',
3266     'section'     => 'invoicing',
3267     'description' => 'Place the balance due message below a line.  Only meaningful when when invoice_sections is false.',
3268     'type'        => 'checkbox',
3269   },
3270
3271   {
3272     'key'         => 'usps_webtools-userid',
3273     'section'     => 'UI',
3274     '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.',
3275     'type'        => 'text',
3276   },
3277
3278   {
3279     'key'         => 'usps_webtools-password',
3280     'section'     => 'UI',
3281     '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.',
3282     'type'        => 'text',
3283   },
3284
3285   {
3286     'key'         => 'cust_main-auto_standardize_address',
3287     'section'     => 'UI',
3288     'description' => 'When using USPS web tools, automatically standardize the address without asking.',
3289     'type'        => 'checkbox',
3290   },
3291
3292   {
3293     'key'         => 'cust_main-require_censustract',
3294     'section'     => 'UI',
3295     'description' => 'Customer is required to have a census tract.  Useful for FCC form 477 reports. See also: cust_main-auto_standardize_address',
3296     'type'        => 'checkbox',
3297   },
3298
3299   {
3300     'key'         => 'census_year',
3301     'section'     => 'UI',
3302     'description' => 'The year to use in census tract lookups',
3303     'type'        => 'select',
3304     'select_enum' => [ qw( 2010 2009 2008 ) ],
3305   },
3306
3307   {
3308     'key'         => 'company_latitude',
3309     'section'     => 'UI',
3310     'description' => 'Your company latitude (-90 through 90)',
3311     'type'        => 'text',
3312   },
3313
3314   {
3315     'key'         => 'company_longitude',
3316     'section'     => 'UI',
3317     'description' => 'Your company longitude (-180 thru 180)',
3318     'type'        => 'text',
3319   },
3320
3321   {
3322     'key'         => 'disable_acl_changes',
3323     'section'     => '',
3324     'description' => 'Disable all ACL changes, for demos.',
3325     'type'        => 'checkbox',
3326   },
3327
3328   {
3329     'key'         => 'disable_settings_changes',
3330     'section'     => '',
3331     'description' => 'Disable all settings changes, for demos, except for the usernames given in the comma-separated list.',
3332     'type'        => [qw( checkbox text )],
3333   },
3334
3335   {
3336     'key'         => 'cust_main-edit_agent_custid',
3337     'section'     => 'UI',
3338     'description' => 'Enable editing of the agent_custid field.',
3339     'type'        => 'checkbox',
3340   },
3341
3342   {
3343     'key'         => 'cust_main-default_agent_custid',
3344     'section'     => 'UI',
3345     'description' => 'Display the agent_custid field when available instead of the custnum field.',
3346     'type'        => 'checkbox',
3347   },
3348
3349   {
3350     'key'         => 'cust_main-title-display_custnum',
3351     'section'     => 'UI',
3352     'description' => 'Add the display_custom (agent_custid or custnum) to the title on customer view pages.',
3353     'type'        => 'checkbox',
3354   },
3355
3356   {
3357     'key'         => 'cust_bill-default_agent_invid',
3358     'section'     => 'UI',
3359     'description' => 'Display the agent_invid field when available instead of the invnum field.',
3360     'type'        => 'checkbox',
3361   },
3362
3363   {
3364     'key'         => 'cust_main-auto_agent_custid',
3365     'section'     => 'UI',
3366     'description' => 'Automatically assign an agent_custid - select format',
3367     'type'        => 'select',
3368     'select_hash' => [ '' => 'No',
3369                        '1YMMXXXXXXXX' => '1YMMXXXXXXXX',
3370                      ],
3371   },
3372
3373   {
3374     'key'         => 'cust_main-default_areacode',
3375     'section'     => 'UI',
3376     'description' => 'Default area code for customers.',
3377     'type'        => 'text',
3378   },
3379
3380   {
3381     'key'         => 'order_pkg-no_start_date',
3382     'section'     => 'UI',
3383     'description' => 'Don\'t set a default start date for new packages.',
3384     'type'        => 'checkbox',
3385   },
3386
3387   {
3388     'key'         => 'mcp_svcpart',
3389     'section'     => '',
3390     'description' => 'Master Control Program svcpart.  Leave this blank.',
3391     'type'        => 'text', #select-part_svc
3392   },
3393
3394   {
3395     'key'         => 'cust_bill-max_same_services',
3396     'section'     => 'invoicing',
3397     '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.',
3398     'type'        => 'text',
3399   },
3400
3401   {
3402     'key'         => 'cust_bill-consolidate_services',
3403     'section'     => 'invoicing',
3404     'description' => 'Consolidate service display into fewer lines on invoices rather than one per service.',
3405     'type'        => 'checkbox',
3406   },
3407
3408   {
3409     'key'         => 'suspend_email_admin',
3410     'section'     => '',
3411     'description' => 'Destination admin email address to enable suspension notices',
3412     'type'        => 'text',
3413   },
3414
3415   {
3416     'key'         => 'email_report-subject',
3417     'section'     => '',
3418     'description' => 'Subject for reports emailed by freeside-fetch.  Defaults to "Freeside report".',
3419     'type'        => 'text',
3420   },
3421
3422   {
3423     'key'         => 'selfservice-head',
3424     'section'     => 'self-service',
3425     'description' => 'HTML for the HEAD section of the self-service interface, typically used for LINK stylesheet tags',
3426     'type'        => 'textarea', #htmlarea?
3427     'per_agent'   => 1,
3428   },
3429
3430
3431   {
3432     'key'         => 'selfservice-body_header',
3433     'section'     => 'self-service',
3434     'description' => 'HTML header for the self-service interface',
3435     'type'        => 'textarea', #htmlarea?
3436     'per_agent'   => 1,
3437   },
3438
3439   {
3440     'key'         => 'selfservice-body_footer',
3441     'section'     => 'self-service',
3442     'description' => 'HTML footer for the self-service interface',
3443     'type'        => 'textarea', #htmlarea?
3444     'per_agent'   => 1,
3445   },
3446
3447
3448   {
3449     'key'         => 'selfservice-body_bgcolor',
3450     'section'     => 'self-service',
3451     'description' => 'HTML background color for the self-service interface, for example, #FFFFFF',
3452     'type'        => 'text',
3453     'per_agent'   => 1,
3454   },
3455
3456   {
3457     'key'         => 'selfservice-box_bgcolor',
3458     'section'     => 'self-service',
3459     'description' => 'HTML color for self-service interface input boxes, for example, #C0C0C0',
3460     'type'        => 'text',
3461     'per_agent'   => 1,
3462   },
3463
3464   {
3465     'key'         => 'selfservice-text_color',
3466     'section'     => 'self-service',
3467     'description' => 'HTML text color for the self-service interface, for example, #000000',
3468     'type'        => 'text',
3469     'per_agent'   => 1,
3470   },
3471
3472   {
3473     'key'         => 'selfservice-link_color',
3474     'section'     => 'self-service',
3475     'description' => 'HTML link color for the self-service interface, for example, #0000FF',
3476     'type'        => 'text',
3477     'per_agent'   => 1,
3478   },
3479
3480   {
3481     'key'         => 'selfservice-vlink_color',
3482     'section'     => 'self-service',
3483     'description' => 'HTML visited link color for the self-service interface, for example, #FF00FF',
3484     'type'        => 'text',
3485     'per_agent'   => 1,
3486   },
3487
3488   {
3489     'key'         => 'selfservice-hlink_color',
3490     'section'     => 'self-service',
3491     'description' => 'HTML hover link color for the self-service interface, for example, #808080',
3492     'type'        => 'text',
3493     'per_agent'   => 1,
3494   },
3495
3496   {
3497     'key'         => 'selfservice-alink_color',
3498     'section'     => 'self-service',
3499     'description' => 'HTML active (clicked) link color for the self-service interface, for example, #808080',
3500     'type'        => 'text',
3501     'per_agent'   => 1,
3502   },
3503
3504   {
3505     'key'         => 'selfservice-font',
3506     'section'     => 'self-service',
3507     'description' => 'HTML font CSS for the self-service interface, for example, 0.9em/1.5em Arial, Helvetica, Geneva, sans-serif',
3508     'type'        => 'text',
3509     'per_agent'   => 1,
3510   },
3511
3512   {
3513     'key'         => 'selfservice-title_color',
3514     'section'     => 'self-service',
3515     'description' => 'HTML color for the self-service title, for example, #000000',
3516     'type'        => 'text',
3517     'per_agent'   => 1,
3518   },
3519
3520   {
3521     'key'         => 'selfservice-title_align',
3522     'section'     => 'self-service',
3523     'description' => 'HTML alignment for the self-service title, for example, center',
3524     'type'        => 'text',
3525     'per_agent'   => 1,
3526   },
3527   {
3528     'key'         => 'selfservice-title_size',
3529     'section'     => 'self-service',
3530     'description' => 'HTML font size for the self-service title, for example, 3',
3531     'type'        => 'text',
3532     'per_agent'   => 1,
3533   },
3534
3535   {
3536     'key'         => 'selfservice-title_left_image',
3537     'section'     => 'self-service',
3538     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
3539     'type'        => 'image',
3540     'per_agent'   => 1,
3541   },
3542
3543   {
3544     'key'         => 'selfservice-title_right_image',
3545     'section'     => 'self-service',
3546     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
3547     'type'        => 'image',
3548     'per_agent'   => 1,
3549   },
3550
3551   {
3552     'key'         => 'selfservice-menu_skipblanks',
3553     'section'     => 'self-service',
3554     'description' => 'Skip blank (spacer) entries in the self-service menu',
3555     'type'        => 'checkbox',
3556     'per_agent'   => 1,
3557   },
3558
3559   {
3560     'key'         => 'selfservice-menu_skipheadings',
3561     'section'     => 'self-service',
3562     'description' => 'Skip the unclickable heading entries in the self-service menu',
3563     'type'        => 'checkbox',
3564     'per_agent'   => 1,
3565   },
3566
3567   {
3568     'key'         => 'selfservice-menu_bgcolor',
3569     'section'     => 'self-service',
3570     'description' => 'HTML color for the self-service menu, for example, #C0C0C0',
3571     'type'        => 'text',
3572     'per_agent'   => 1,
3573   },
3574
3575   {
3576     'key'         => 'selfservice-menu_fontsize',
3577     'section'     => 'self-service',
3578     'description' => 'HTML font size for the self-service menu, for example, -1',
3579     'type'        => 'text',
3580     'per_agent'   => 1,
3581   },
3582   {
3583     'key'         => 'selfservice-menu_nounderline',
3584     'section'     => 'self-service',
3585     'description' => 'Styles menu links in the self-service without underlining.',
3586     'type'        => 'checkbox',
3587     'per_agent'   => 1,
3588   },
3589
3590
3591   {
3592     'key'         => 'selfservice-menu_top_image',
3593     'section'     => 'self-service',
3594     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
3595     'type'        => 'image',
3596     'per_agent'   => 1,
3597   },
3598
3599   {
3600     'key'         => 'selfservice-menu_body_image',
3601     'section'     => 'self-service',
3602     'description' => 'Repeating image used for the body of the menu in the self-service interface, in PNG format.',
3603     'type'        => 'image',
3604     'per_agent'   => 1,
3605   },
3606
3607   {
3608     'key'         => 'selfservice-menu_bottom_image',
3609     'section'     => 'self-service',
3610     'description' => 'Image used for the bottom of the menu in the self-service interface, in PNG format.',
3611     'type'        => 'image',
3612     'per_agent'   => 1,
3613   },
3614
3615   {
3616     'key'         => 'selfservice-bulk_format',
3617     'section'     => 'deprecated',
3618     'description' => 'Parameter arrangement for selfservice bulk features',
3619     'type'        => 'select',
3620     'select_enum' => [ '', 'izoom-soap', 'izoom-ftp' ],
3621     'per_agent'   => 1,
3622   },
3623
3624   {
3625     'key'         => 'selfservice-bulk_ftp_dir',
3626     'section'     => 'deprecated',
3627     'description' => 'Enable bulk ftp provisioning in this folder',
3628     'type'        => 'text',
3629     'per_agent'   => 1,
3630   },
3631
3632   {
3633     'key'         => 'signup-no_company',
3634     'section'     => 'self-service',
3635     'description' => "Don't display a field for company name on signup.",
3636     'type'        => 'checkbox',
3637   },
3638
3639   {
3640     'key'         => 'signup-recommend_email',
3641     'section'     => 'self-service',
3642     'description' => 'Encourage the entry of an invoicing email address on signup.',
3643     'type'        => 'checkbox',
3644   },
3645
3646   {
3647     'key'         => 'signup-recommend_daytime',
3648     'section'     => 'self-service',
3649     'description' => 'Encourage the entry of a daytime phone number  invoicing email address on signup.',
3650     'type'        => 'checkbox',
3651   },
3652
3653   {
3654     'key'         => 'svc_phone-radius-default_password',
3655     'section'     => '',
3656     'description' => 'Default password when exporting svc_phone records to RADIUS',
3657     'type'        => 'text',
3658   },
3659
3660   {
3661     'key'         => 'svc_phone-allow_alpha_phonenum',
3662     'section'     => '',
3663     'description' => 'Allow letters in phone numbers.',
3664     'type'        => 'checkbox',
3665   },
3666
3667   {
3668     'key'         => 'svc_phone-domain',
3669     'section'     => '',
3670     'description' => 'Track an optional domain association with each phone service.',
3671     'type'        => 'checkbox',
3672   },
3673
3674   {
3675     'key'         => 'svc_phone-phone_name-max_length',
3676     'section'     => '',
3677     '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.',
3678     'type'        => 'text',
3679   },
3680
3681   {
3682     'key'         => 'default_phone_countrycode',
3683     'section'     => '',
3684     'description' => 'Default countrcode',
3685     'type'        => 'text',
3686   },
3687
3688   {
3689     'key'         => 'cdr-charged_party-field',
3690     'section'     => '',
3691     'description' => 'Set the charged_party field of CDRs to this field.',
3692     'type'        => 'select-sub',
3693     'options_sub' => sub { my $fields = FS::cdr->table_info->{'fields'};
3694                            map { $_ => $fields->{$_}||$_ }
3695                            grep { $_ !~ /^(acctid|charged_party)$/ }
3696                            FS::Schema::dbdef->table('cdr')->columns;
3697                          },
3698     'option_sub'  => sub { my $f = shift;
3699                            FS::cdr->table_info->{'fields'}{$f} || $f;
3700                          },
3701   },
3702
3703   #probably deprecate in favor of cdr-charged_party-field above
3704   {
3705     'key'         => 'cdr-charged_party-accountcode',
3706     'section'     => '',
3707     'description' => 'Set the charged_party field of CDRs to the accountcode.',
3708     'type'        => 'checkbox',
3709   },
3710
3711   {
3712     'key'         => 'cdr-charged_party-accountcode-trim_leading_0s',
3713     'section'     => '',
3714     'description' => 'When setting the charged_party field of CDRs to the accountcode, trim any leading zeros.',
3715     'type'        => 'checkbox',
3716   },
3717
3718 #  {
3719 #    'key'         => 'cdr-charged_party-truncate_prefix',
3720 #    'section'     => '',
3721 #    'description' => 'If the charged_party field has this prefix, truncate it to the length in cdr-charged_party-truncate_length.',
3722 #    'type'        => 'text',
3723 #  },
3724 #
3725 #  {
3726 #    'key'         => 'cdr-charged_party-truncate_length',
3727 #    'section'     => '',
3728 #    'description' => 'If the charged_party field has the prefix in cdr-charged_party-truncate_prefix, truncate it to this length.',
3729 #    'type'        => 'text',
3730 #  },
3731
3732   {
3733     'key'         => 'cdr-charged_party_rewrite',
3734     'section'     => '',
3735     '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*.',
3736     'type'        => 'checkbox',
3737   },
3738
3739   {
3740     'key'         => 'cdr-taqua-da_rewrite',
3741     'section'     => '',
3742     '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.',
3743     'type'        => 'text',
3744   },
3745
3746   {
3747     'key'         => 'cust_pkg-show_autosuspend',
3748     'section'     => 'UI',
3749     'description' => 'Show package auto-suspend dates.  Use with caution for now; can slow down customer view for large insallations.',
3750     'type'        => 'checkbox',
3751   },
3752
3753   {
3754     'key'         => 'cdr-asterisk_forward_rewrite',
3755     'section'     => '',
3756     '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").',
3757     'type'        => 'checkbox',
3758   },
3759
3760   {
3761     'key'         => 'sg-multicustomer_hack',
3762     'section'     => '',
3763     'description' => "Don't use this.",
3764     'type'        => 'checkbox',
3765   },
3766
3767   {
3768     'key'         => 'sg-ping_username',
3769     'section'     => '',
3770     'description' => "Don't use this.",
3771     'type'        => 'text',
3772   },
3773
3774   {
3775     'key'         => 'sg-ping_password',
3776     'section'     => '',
3777     'description' => "Don't use this.",
3778     'type'        => 'text',
3779   },
3780
3781   {
3782     'key'         => 'sg-login_username',
3783     'section'     => '',
3784     'description' => "Don't use this.",
3785     'type'        => 'text',
3786   },
3787
3788   {
3789     'key'         => 'mc-outbound_packages',
3790     'section'     => '',
3791     'description' => "Don't use this.",
3792     'type'        => 'select-part_pkg',
3793     'multiple'    => 1,
3794   },
3795
3796   {
3797     'key'         => 'disable-cust-pkg_class',
3798     'section'     => 'UI',
3799     'description' => 'Disable the two-step dropdown for selecting package class and package, and return to the classic single dropdown.',
3800     'type'        => 'checkbox',
3801   },
3802
3803   {
3804     'key'         => 'queued-max_kids',
3805     'section'     => '',
3806     'description' => 'Maximum number of queued processes.  Defaults to 10.',
3807     'type'        => 'text',
3808   },
3809
3810   {
3811     'key'         => 'queued-sleep_time',
3812     'section'     => '',
3813     '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.',
3814     'type'        => 'text',
3815   },
3816
3817   {
3818     'key'         => 'cancelled_cust-noevents',
3819     'section'     => 'billing',
3820     'description' => "Don't run events for cancelled customers",
3821     'type'        => 'checkbox',
3822   },
3823
3824   {
3825     'key'         => 'agent-invoice_template',
3826     'section'     => 'invoicing',
3827     'description' => 'Enable display/edit of old-style per-agent invoice template selection',
3828     'type'        => 'checkbox',
3829   },
3830
3831   {
3832     'key'         => 'svc_broadband-manage_link',
3833     'section'     => 'UI',
3834     'description' => 'URL for svc_broadband "Manage Device" link.  The following substitutions are available: $ip_addr.',
3835     'type'        => 'text',
3836   },
3837
3838   #more fine-grained, service def-level control could be useful eventually?
3839   {
3840     'key'         => 'svc_broadband-allow_null_ip_addr',
3841     'section'     => '',
3842     'description' => '',
3843     'type'        => 'checkbox',
3844   },
3845
3846   {
3847     'key'         => 'tax-report_groups',
3848     'section'     => '',
3849     'description' => 'List of grouping possibilities for tax names on reports, one per line, "label op value" (op can be = or !=).',
3850     'type'        => 'textarea',
3851   },
3852
3853   {
3854     'key'         => 'tax-cust_exempt-groups',
3855     'section'     => '',
3856     '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).',
3857     'type'        => 'textarea',
3858   },
3859
3860   {
3861     'key'         => 'cust_main-default_view',
3862     'section'     => 'UI',
3863     'description' => 'Default customer view, for users who have not selected a default view in their preferences.',
3864     'type'        => 'select',
3865     'select_hash' => [
3866       #false laziness w/view/cust_main.cgi and pref/pref.html
3867       'basics'          => 'Basics',
3868       'notes'           => 'Notes',
3869       'tickets'         => 'Tickets',
3870       'packages'        => 'Packages',
3871       'payment_history' => 'Payment History',
3872       'change_history'  => 'Change History',
3873       'jumbo'           => 'Jumbo',
3874     ],
3875   },
3876
3877   {
3878     'key'         => 'enable_tax_adjustments',
3879     'section'     => 'billing',
3880     'description' => 'Enable the ability to add manual tax adjustments.',
3881     'type'        => 'checkbox',
3882   },
3883
3884   {
3885     'key'         => 'rt-crontool',
3886     'section'     => '',
3887     'description' => 'Enable the RT CronTool extension.',
3888     'type'        => 'checkbox',
3889   },
3890
3891   {
3892     'key'         => 'pkg-balances',
3893     'section'     => 'billing',
3894     'description' => 'Enable experimental package balances.  Not recommended for general use.',
3895     'type'        => 'checkbox',
3896   },
3897
3898   {
3899     'key'         => 'pkg-addon_classnum',
3900     'section'     => 'billing',
3901     'description' => 'Enable the ability to restrict additional package orders based on package class.',
3902     'type'        => 'checkbox',
3903   },
3904
3905   {
3906     'key'         => 'cust_main-edit_signupdate',
3907     'section'     => 'UI',
3908     'descritpion' => 'Enable manual editing of the signup date.',
3909     'type'        => 'checkbox',
3910   },
3911
3912   {
3913     'key'         => 'svc_acct-disable_access_number',
3914     'section'     => 'UI',
3915     'descritpion' => 'Disable access number selection.',
3916     'type'        => 'checkbox',
3917   },
3918
3919   {
3920     'key'         => 'cust_bill_pay_pkg-manual',
3921     'section'     => 'UI',
3922     'description' => 'Allow manual application of payments to line items.',
3923     'type'        => 'checkbox',
3924   },
3925
3926   {
3927     'key'         => 'cust_credit_bill_pkg-manual',
3928     'section'     => 'UI',
3929     'description' => 'Allow manual application of credits to line items.',
3930     'type'        => 'checkbox',
3931   },
3932
3933   {
3934     'key'         => 'breakage-days',
3935     'section'     => 'billing',
3936     '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.',
3937     'type'        => 'text',
3938     'per_agent'   => 1,
3939   },
3940
3941   {
3942     'key'         => 'breakage-pkg_class',
3943     'section'     => 'billing',
3944     'description' => 'Package class to use for breakage reconciliation.',
3945     'type'        => 'select-pkg_class',
3946   },
3947
3948   {
3949     'key'         => 'disable_cron_billing',
3950     'section'     => 'billing',
3951     '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.',
3952     'type'        => 'checkbox',
3953   },
3954
3955   {
3956     'key'         => 'svc_domain-edit_domain',
3957     'section'     => '',
3958     'description' => 'Enable domain renaming',
3959     'type'        => 'checkbox',
3960   },
3961
3962   {
3963     'key'         => 'enable_legacy_prepaid_income',
3964     'section'     => '',
3965     '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.",
3966     'type'        => 'checkbox',
3967   },
3968
3969   {
3970     'key'         => 'cust_main-exports',
3971     'section'     => '',
3972     'description' => 'Export(s) to call on cust_main insert, modification and deletion.',
3973     'type'        => 'select-sub',
3974     'multiple'    => 1,
3975     'options_sub' => sub {
3976       require FS::Record;
3977       require FS::part_export;
3978       my @part_export =
3979         map { qsearch( 'part_export', {exporttype => $_ } ) }
3980           keys %{FS::part_export::export_info('cust_main')};
3981       map { $_->exportnum => $_->exporttype.' to '.$_->machine } @part_export;
3982     },
3983     'option_sub'  => sub {
3984       require FS::Record;
3985       require FS::part_export;
3986       my $part_export = FS::Record::qsearchs(
3987         'part_export', { 'exportnum' => shift }
3988       );
3989       $part_export
3990         ? $part_export->exporttype.' to '.$part_export->machine
3991         : '';
3992     },
3993   },
3994
3995   {
3996     'key'         => 'cust_tag-location',
3997     'section'     => 'UI',
3998     'description' => 'Location where customer tags are displayed.',
3999     'type'        => 'select',
4000     'select_enum' => [ 'misc_info', 'top' ],
4001   },
4002
4003   {
4004     'key'         => 'maestro-status_test',
4005     'section'     => 'UI',
4006     'description' => 'Display a link to the maestro status test page on the customer view page',
4007     'type'        => 'checkbox',
4008   },
4009
4010   {
4011     'key'         => 'cust_main-custom_link',
4012     'section'     => 'UI',
4013     'description' => 'URL to use as source for the "Custom" tab in the View Customer page.  The custnum will be appended.',
4014     'type'        => 'text',
4015   },
4016
4017   {
4018     'key'         => 'cust_main-custom_title',
4019     'section'     => 'UI',
4020     'description' => 'Title for the "Custom" tab in the View Customer page.',
4021     'type'        => 'text',
4022   },
4023
4024   {
4025     'key'         => 'part_pkg-default_suspend_bill',
4026     'section'     => 'billing',
4027     'description' => 'Default the "Continue recurring billing while suspended" flag to on for new package definitions.',
4028     'type'        => 'checkbox',
4029   },
4030
4031   { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4032   { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4033   { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4034   { key => "bindprimary", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4035   { key => "bindsecondaries", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4036   { key => "bsdshellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4037   { key => "cyrus", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4038   { key => "cp_app", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4039   { key => "erpcdmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4040   { key => "icradiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4041   { key => "icradius_mysqldest", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4042   { key => "icradius_mysqlsource", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4043   { key => "icradius_secrets", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4044   { key => "maildisablecatchall", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4045   { key => "mxmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4046   { key => "nsmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4047   { key => "arecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4048   { key => "cnamerecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4049   { key => "nismachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4050   { key => "qmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4051   { key => "radiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4052   { key => "sendmailconfigpath", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4053   { key => "sendmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4054   { key => "sendmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4055   { key => "shellmachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4056   { key => "shellmachine-useradd", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4057   { key => "shellmachine-userdel", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4058   { key => "shellmachine-usermod", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4059   { key => "shellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4060   { key => "radiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4061   { key => "textradiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4062   { key => "username_policy", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4063   { key => "vpopmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4064   { key => "vpopmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4065   { key => "safe-part_pkg", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4066   { key => "selfservice_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4067   { key => "signup_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4068   { key => "signup_server-email", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4069   { key => "vonage-username", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4070   { key => "vonage-password", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4071   { key => "vonage-fromnumber", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
4072
4073 );
4074
4075 1;
4076