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