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