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