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