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