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