add ticket creation to self-service API, RT#7007
[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::payby;
12 use FS::conf;
13 use FS::Record qw(qsearch qsearchs);
14 use FS::UID qw(dbh datasrc use_confcompat);
15
16 $base_dir = '%%%FREESIDE_CONF%%%';
17
18 $DEBUG = 0;
19
20 =head1 NAME
21
22 FS::Conf - Freeside configuration values
23
24 =head1 SYNOPSIS
25
26   use FS::Conf;
27
28   $conf = new FS::Conf;
29
30   $value = $conf->config('key');
31   @list  = $conf->config('key');
32   $bool  = $conf->exists('key');
33
34   $conf->touch('key');
35   $conf->set('key' => 'value');
36   $conf->delete('key');
37
38   @config_items = $conf->config_items;
39
40 =head1 DESCRIPTION
41
42 Read and write Freeside configuration values.  Keys currently map to filenames,
43 but this may change in the future.
44
45 =head1 METHODS
46
47 =over 4
48
49 =item new
50
51 Create a new configuration object.
52
53 =cut
54
55 sub new {
56   my($proto) = @_;
57   my($class) = ref($proto) || $proto;
58   my($self) = { 'base_dir' => $base_dir };
59   bless ($self, $class);
60 }
61
62 =item base_dir
63
64 Returns the base directory.  By default this is /usr/local/etc/freeside.
65
66 =cut
67
68 sub base_dir {
69   my($self) = @_;
70   my $base_dir = $self->{base_dir};
71   -e $base_dir or die "FATAL: $base_dir doesn't exist!";
72   -d $base_dir or die "FATAL: $base_dir isn't a directory!";
73   -r $base_dir or die "FATAL: Can't read $base_dir!";
74   -x $base_dir or die "FATAL: $base_dir not searchable (executable)!";
75   $base_dir =~ /^(.*)$/;
76   $1;
77 }
78
79 =item conf KEY [ AGENTNUM [ NODEFAULT ] ]
80
81 Returns the L<FS::conf> record for the key and agent.
82
83 =cut
84
85 sub conf {
86   my $self = shift;
87   $self->_config(@_);
88 }
89
90 =item config KEY [ AGENTNUM [ NODEFAULT ] ]
91
92 Returns the configuration value or values (depending on context) for key.
93 The optional agent number selects an agent specific value instead of the
94 global default if one is present.  If NODEFAULT is true only the agent
95 specific value(s) is returned.
96
97 =cut
98
99 sub _usecompat {
100   my ($self, $method) = (shift, shift);
101   carp "NO CONFIGURATION RECORDS FOUND -- USING COMPATIBILITY MODE"
102     if use_confcompat;
103   my $compat = new FS::Conf_compat17 ("$base_dir/conf." . datasrc);
104   $compat->$method(@_);
105 }
106
107 sub _config {
108   my($self,$name,$agentnum,$agentonly)=@_;
109   my $hashref = { 'name' => $name };
110   $hashref->{agentnum} = $agentnum;
111   local $FS::Record::conf = undef;  # XXX evil hack prevents recursion
112   my $cv = FS::Record::qsearchs('conf', $hashref);
113   if (!$agentonly && !$cv && defined($agentnum) && $agentnum) {
114     $hashref->{agentnum} = '';
115     $cv = FS::Record::qsearchs('conf', $hashref);
116   }
117   return $cv;
118 }
119
120 sub config {
121   my $self = shift;
122   return $self->_usecompat('config', @_) if use_confcompat;
123
124   carp "FS::Conf->config(". join(', ', @_). ") called"
125     if $DEBUG > 1;
126
127   my $cv = $self->_config(@_) or return;
128
129   if ( wantarray ) {
130     my $v = $cv->value;
131     chomp $v;
132     (split "\n", $v, -1);
133   } else {
134     (split("\n", $cv->value))[0];
135   }
136 }
137
138 =item config_binary KEY [ AGENTNUM [ NODEFAULT ] ]
139
140 Returns the exact scalar value for key.
141
142 =cut
143
144 sub config_binary {
145   my $self = shift;
146   return $self->_usecompat('config_binary', @_) if use_confcompat;
147
148   my $cv = $self->_config(@_) or return;
149   length($cv->value) ? decode_base64($cv->value) : '';
150 }
151
152 =item exists KEY [ AGENTNUM [ NODEFAULT ] ]
153
154 Returns true if the specified key exists, even if the corresponding value
155 is undefined.
156
157 =cut
158
159 sub exists {
160   my $self = shift;
161   return $self->_usecompat('exists', @_) if use_confcompat;
162
163   my($name, $agentnum)=@_;
164
165   carp "FS::Conf->exists(". join(', ', @_). ") called"
166     if $DEBUG > 1;
167
168   defined($self->_config(@_));
169 }
170
171 =item config_orbase KEY SUFFIX
172
173 Returns the configuration value or values (depending on context) for 
174 KEY_SUFFIX, if it exists, otherwise for KEY
175
176 =cut
177
178 # outmoded as soon as we shift to agentnum based config values
179 # well, mostly.  still useful for e.g. late notices, etc. in that we want
180 # these to fall back to standard values
181 sub config_orbase {
182   my $self = shift;
183   return $self->_usecompat('config_orbase', @_) if use_confcompat;
184
185   my( $name, $suffix ) = @_;
186   if ( $self->exists("${name}_$suffix") ) {
187     $self->config("${name}_$suffix");
188   } else {
189     $self->config($name);
190   }
191 }
192
193 =item key_orbase KEY SUFFIX
194
195 If the config value KEY_SUFFIX exists, returns KEY_SUFFIX, otherwise returns
196 KEY.  Useful for determining which exact configuration option is returned by
197 config_orbase.
198
199 =cut
200
201 sub key_orbase {
202   my $self = shift;
203   #no compat for this...return $self->_usecompat('config_orbase', @_) if use_confcompat;
204
205   my( $name, $suffix ) = @_;
206   if ( $self->exists("${name}_$suffix") ) {
207     "${name}_$suffix";
208   } else {
209     $name;
210   }
211 }
212
213 =item invoice_templatenames
214
215 Returns all possible invoice template names.
216
217 =cut
218
219 sub invoice_templatenames {
220   my( $self ) = @_;
221
222   my %templatenames = ();
223   foreach my $item ( $self->config_items ) {
224     foreach my $base ( @base_items ) {
225       my( $main, $ext) = split(/\./, $base);
226       $ext = ".$ext" if $ext;
227       if ( $item->key =~ /^${main}_(.+)$ext$/ ) {
228       $templatenames{$1}++;
229       }
230     }
231   }
232   
233   map { $_ } #handle scalar context
234   sort keys %templatenames;
235
236 }
237
238 =item touch KEY [ AGENT ];
239
240 Creates the specified configuration key if it does not exist.
241
242 =cut
243
244 sub touch {
245   my $self = shift;
246   return $self->_usecompat('touch', @_) if use_confcompat;
247
248   my($name, $agentnum) = @_;
249   unless ( $self->exists($name, $agentnum) ) {
250     $self->set($name, '', $agentnum);
251   }
252 }
253
254 =item set KEY VALUE [ AGENTNUM ];
255
256 Sets the specified configuration key to the given value.
257
258 =cut
259
260 sub set {
261   my $self = shift;
262   return $self->_usecompat('set', @_) if use_confcompat;
263
264   my($name, $value, $agentnum) = @_;
265   $value =~ /^(.*)$/s;
266   $value = $1;
267
268   warn "[FS::Conf] SET $name\n" if $DEBUG;
269
270   my $old = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum});
271   my $new = new FS::conf { $old ? $old->hash 
272                                 : ('name' => $name, 'agentnum' => $agentnum)
273                          };
274   $new->value($value);
275
276   my $error;
277   if ($old) {
278     $error = $new->replace($old);
279   } else {
280     $error = $new->insert;
281   }
282
283   die "error setting configuration value: $error \n"
284     if $error;
285
286 }
287
288 =item set_binary KEY VALUE [ AGENTNUM ]
289
290 Sets the specified configuration key to an exact scalar value which
291 can be retrieved with config_binary.
292
293 =cut
294
295 sub set_binary {
296   my $self  = shift;
297   return if use_confcompat;
298
299   my($name, $value, $agentnum)=@_;
300   $self->set($name, encode_base64($value), $agentnum);
301 }
302
303 =item delete KEY [ AGENTNUM ];
304
305 Deletes the specified configuration key.
306
307 =cut
308
309 sub delete {
310   my $self = shift;
311   return $self->_usecompat('delete', @_) if use_confcompat;
312
313   my($name, $agentnum) = @_;
314   if ( my $cv = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum}) ) {
315     warn "[FS::Conf] DELETE $name\n";
316
317     my $oldAutoCommit = $FS::UID::AutoCommit;
318     local $FS::UID::AutoCommit = 0;
319     my $dbh = dbh;
320
321     my $error = $cv->delete;
322
323     if ( $error ) {
324       $dbh->rollback if $oldAutoCommit;
325       die "error setting configuration value: $error \n"
326     }
327
328     $dbh->commit or die $dbh->errstr if $oldAutoCommit;
329
330   }
331 }
332
333 =item import_config_item CONFITEM DIR 
334
335   Imports the item specified by the CONFITEM (see L<FS::ConfItem>) into
336 the database as a conf record (see L<FS::conf>).  Imports from the file
337 in the directory DIR.
338
339 =cut
340
341 sub import_config_item { 
342   my ($self,$item,$dir) = @_;
343   my $key = $item->key;
344   if ( -e "$dir/$key" && ! use_confcompat ) {
345     warn "Inserting $key\n" if $DEBUG;
346     local $/;
347     my $value = readline(new IO::File "$dir/$key");
348     if ($item->type =~ /^(binary|image)$/ ) {
349       $self->set_binary($key, $value);
350     }else{
351       $self->set($key, $value);
352     }
353   }else {
354     warn "Not inserting $key\n" if $DEBUG;
355   }
356 }
357
358 =item verify_config_item CONFITEM DIR 
359
360   Compares the item specified by the CONFITEM (see L<FS::ConfItem>) in
361 the database to the legacy file value in DIR.
362
363 =cut
364
365 sub verify_config_item { 
366   return '' if use_confcompat;
367   my ($self,$item,$dir) = @_;
368   my $key = $item->key;
369   my $type = $item->type;
370
371   my $compat = new FS::Conf_compat17 $dir;
372   my $error = '';
373   
374   $error .= "$key fails existential comparison; "
375     if $self->exists($key) xor $compat->exists($key);
376
377   if ( $type !~ /^(binary|image)$/ ) {
378
379     {
380       no warnings;
381       $error .= "$key fails scalar comparison; "
382         unless scalar($self->config($key)) eq scalar($compat->config($key));
383     }
384
385     my (@new) = $self->config($key);
386     my (@old) = $compat->config($key);
387     unless ( scalar(@new) == scalar(@old)) { 
388       $error .= "$key fails list comparison; ";
389     }else{
390       my $r=1;
391       foreach (@old) { $r=0 if ($_ cmp shift(@new)); }
392       $error .= "$key fails list comparison; "
393         unless $r;
394     }
395
396   } else {
397
398     $error .= "$key fails binary comparison; "
399       unless scalar($self->config_binary($key)) eq scalar($compat->config_binary($key));
400
401   }
402
403 #remove deprecated config on our own terms, not freeside-upgrade's
404 #  if ($error =~ /existential comparison/ && $item->section eq 'deprecated') {
405 #    my $proto;
406 #    for ( @config_items ) { $proto = $_; last if $proto->key eq $key;  }
407 #    unless ($proto->key eq $key) { 
408 #      warn "removed config item $error\n" if $DEBUG;
409 #      $error = '';
410 #    }
411 #  }
412
413   $error;
414 }
415
416 #item _orbase_items OPTIONS
417 #
418 #Returns all of the possible extensible config items as FS::ConfItem objects.
419 #See #L<FS::ConfItem>.  OPTIONS consists of name value pairs.  Possible
420 #options include
421 #
422 # dir - the directory to search for configuration option files instead
423 #       of using the conf records in the database
424 #
425 #cut
426
427 #quelle kludge
428 sub _orbase_items {
429   my ($self, %opt) = @_; 
430
431   my $listmaker = sub { my $v = shift;
432                         $v =~ s/_/!_/g;
433                         if ( $v =~ /\.(png|eps)$/ ) {
434                           $v =~ s/\./!_%./;
435                         }else{
436                           $v .= '!_%';
437                         }
438                         map { $_->name }
439                           FS::Record::qsearch( 'conf',
440                                                {},
441                                                '',
442                                                "WHERE name LIKE '$v' ESCAPE '!'"
443                                              );
444                       };
445
446   if (exists($opt{dir}) && $opt{dir}) {
447     $listmaker = sub { my $v = shift;
448                        if ( $v =~ /\.(png|eps)$/ ) {
449                          $v =~ s/\./_*./;
450                        }else{
451                          $v .= '_*';
452                        }
453                        map { basename $_ } glob($opt{dir}. "/$v" );
454                      };
455   }
456
457   ( map { 
458           my $proto;
459           my $base = $_;
460           for ( @config_items ) { $proto = $_; last if $proto->key eq $base;  }
461           die "don't know about $base items" unless $proto->key eq $base;
462
463           map { new FS::ConfItem { 
464                   'key'         => $_,
465                   'base_key'    => $proto->key,
466                   'section'     => $proto->section,
467                   'description' => 'Alternate ' . $proto->description . '  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Invoice_templates">billing documentation</a> for details.',
468                   'type'        => $proto->type,
469                 };
470               } &$listmaker($base);
471         } @base_items,
472   );
473 }
474
475 =item config_items
476
477 Returns all of the possible global/default configuration items as
478 FS::ConfItem objects.  See L<FS::ConfItem>.
479
480 =cut
481
482 sub config_items {
483   my $self = shift; 
484   return $self->_usecompat('config_items', @_) if use_confcompat;
485
486   ( @config_items, $self->_orbase_items(@_) );
487 }
488
489 =back
490
491 =head1 SUBROUTINES
492
493 =over 4
494
495 =item init-config DIR
496
497 Imports the configuration items from DIR (1.7 compatible)
498 to conf records in the database.
499
500 =cut
501
502 sub init_config {
503   my $dir = shift;
504
505   {
506     local $FS::UID::use_confcompat = 0;
507     my $conf = new FS::Conf;
508     foreach my $item ( $conf->config_items(dir => $dir) ) {
509       $conf->import_config_item($item, $dir);
510       my $error = $conf->verify_config_item($item, $dir);
511       return $error if $error;
512     }
513   
514     my $compat = new FS::Conf_compat17 $dir;
515     foreach my $item ( $compat->config_items ) {
516       my $error = $conf->verify_config_item($item, $dir);
517       return $error if $error;
518     }
519   }
520
521   $FS::UID::use_confcompat = 0;
522   '';  #success
523 }
524
525 =back
526
527 =head1 BUGS
528
529 If this was more than just crud that will never be useful outside Freeside I'd
530 worry that config_items is freeside-specific and icky.
531
532 =head1 SEE ALSO
533
534 "Configuration" in the web interface (config/config.cgi).
535
536 =cut
537
538 #Business::CreditCard
539 @card_types = (
540   "VISA card",
541   "MasterCard",
542   "Discover card",
543   "American Express card",
544   "Diner's Club/Carte Blanche",
545   "enRoute",
546   "JCB",
547   "BankCard",
548   "Switch",
549   "Solo",
550 );
551
552 @base_items = qw (
553                    invoice_template
554                    invoice_latex
555                    invoice_latexreturnaddress
556                    invoice_latexfooter
557                    invoice_latexsmallfooter
558                    invoice_latexnotes
559                    invoice_latexcoupon
560                    invoice_html
561                    invoice_htmlreturnaddress
562                    invoice_htmlfooter
563                    invoice_htmlnotes
564                    logo.png
565                    logo.eps
566                  );
567
568 #Billing (81 items)
569 #Invoicing (50 items)
570 #UI (69 items)
571 #Self-service (29 items)
572 #...
573 #Unclassified (77 items)
574
575
576 @config_items = map { new FS::ConfItem $_ } (
577
578   {
579     'key'         => 'address',
580     'section'     => 'deprecated',
581     'description' => 'This configuration option is no longer used.  See <a href="#invoice_template">invoice_template</a> instead.',
582     'type'        => 'text',
583   },
584
585   {
586     'key'         => 'alert_expiration',
587     'section'     => 'billing',
588     'description' => 'Enable alerts about billing method expiration (i.e. expiring credit cards).',
589     'type'        => 'checkbox',
590     'per_agent'   => 1,
591   },
592
593   {
594     'key'         => 'alerter_template',
595     'section'     => 'billing',
596     'description' => 'Template file for billing method expiration alerts (i.e. expiring credit cards).  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Credit_cards_and_Electronic_checks">billing documentation</a> for details.',
597     'type'        => 'textarea',
598     'per_agent'   => 1,
599   },
600
601   {
602     'key'         => 'apacheip',
603     #not actually deprecated yet
604     #'section'     => 'deprecated',
605     #'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',
606     'section'     => '',
607     'description' => 'IP address to assign to new virtual hosts',
608     'type'        => 'text',
609   },
610
611   {
612     'key'         => 'encryption',
613     'section'     => 'billing',
614     'description' => 'Enable encryption of credit cards.',
615     'type'        => 'checkbox',
616   },
617
618   {
619     'key'         => 'encryptionmodule',
620     'section'     => 'billing',
621     'description' => 'Use which module for encryption?',
622     'type'        => 'text',
623   },
624
625   {
626     'key'         => 'encryptionpublickey',
627     'section'     => 'billing',
628     'description' => 'Your RSA Public Key - Required if Encryption is turned on.',
629     'type'        => 'textarea',
630   },
631
632   {
633     'key'         => 'encryptionprivatekey',
634     'section'     => 'billing',
635     '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.',
636     'type'        => 'textarea',
637   },
638
639   {
640     'key'         => 'billco-url',
641     'section'     => 'billing',
642     'description' => 'The url to use for performing uploads to the invoice mailing service.',
643     'type'        => 'text',
644     'per_agent'   => 1,
645   },
646
647   {
648     'key'         => 'billco-username',
649     'section'     => 'billing',
650     'description' => 'The login name to use for uploads to the invoice mailing service.',
651     'type'        => 'text',
652     'per_agent'   => 1,
653     'agentonly'   => 1,
654   },
655
656   {
657     'key'         => 'billco-password',
658     'section'     => 'billing',
659     'description' => 'The password to use for uploads to the invoice mailing service.',
660     'type'        => 'text',
661     'per_agent'   => 1,
662     'agentonly'   => 1,
663   },
664
665   {
666     'key'         => 'billco-clicode',
667     'section'     => 'billing',
668     'description' => 'The clicode to use for uploads to the invoice mailing service.',
669     'type'        => 'text',
670     'per_agent'   => 1,
671   },
672
673   {
674     'key'         => 'business-onlinepayment',
675     'section'     => 'billing',
676     '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.',
677     'type'        => 'textarea',
678   },
679
680   {
681     'key'         => 'business-onlinepayment-ach',
682     'section'     => 'billing',
683     '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.',
684     'type'        => 'textarea',
685   },
686
687   {
688     'key'         => 'business-onlinepayment-namespace',
689     'section'     => 'billing',
690     'description' => 'Specifies which perl module namespace (which group of collection routines) is used by default.',
691     'type'        => 'select',
692     'select_hash' => [
693                        'Business::OnlinePayment' => 'Direct API (Business::OnlinePayment)',
694                        'Business::OnlineThirdPartyPayment' => 'Web API (Business::ThirdPartyPayment)',
695                      ],
696   },
697
698   {
699     'key'         => 'business-onlinepayment-description',
700     'section'     => 'billing',
701     '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)',
702     'type'        => 'text',
703   },
704
705   {
706     'key'         => 'business-onlinepayment-email-override',
707     'section'     => 'billing',
708     'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
709     'type'        => 'text',
710   },
711
712   {
713     'key'         => 'business-onlinepayment-email_customer',
714     'section'     => 'billing',
715     'description' => 'Controls the "email_customer" flag used by some Business::OnlinePayment processors to enable customer receipts.',
716     'type'        => 'checkbox',
717   },
718
719   {
720     'key'         => 'countrydefault',
721     'section'     => 'UI',
722     'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
723     'type'        => 'text',
724   },
725
726   {
727     'key'         => 'date_format',
728     'section'     => 'UI',
729     'description' => 'Format for displaying dates',
730     'type'        => 'select',
731     'select_hash' => [
732                        '%m/%d/%Y' => 'MM/DD/YYYY',
733                        '%Y/%m/%d' => 'YYYY/MM/DD',
734                      ],
735   },
736
737   {
738     'key'         => 'deletecustomers',
739     'section'     => 'UI',
740     '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.',
741     'type'        => 'checkbox',
742   },
743
744   {
745     'key'         => 'deleteinvoices',
746     'section'     => 'UI',
747     '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?
748     'type'        => 'checkbox',
749   },
750
751   {
752     'key'         => 'deletepayments',
753     'section'     => 'billing',
754     '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.',
755     'type'        => [qw( checkbox text )],
756   },
757
758   {
759     'key'         => 'deletecredits',
760     #not actually deprecated yet
761     #'section'     => 'deprecated',
762     #'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.',
763     'section'     => '',
764     'description' => 'One or more comma-separated email addresses to be notified when a credit is deleted.',
765     'type'        => [qw( checkbox text )],
766   },
767
768   {
769     'key'         => 'deleterefunds',
770     'section'     => 'billing',
771     'description' => 'Enable deletion of unclosed refunds.  Be very careful!  Only delete refunds that were data-entry errors, not adjustments.',
772     'type'        => 'checkbox',
773   },
774
775   {
776     'key'         => 'unapplypayments',
777     'section'     => 'deprecated',
778     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable "unapplication" of unclosed payments.',
779     'type'        => 'checkbox',
780   },
781
782   {
783     'key'         => 'unapplycredits',
784     'section'     => 'deprecated',
785     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to nable "unapplication" of unclosed credits.',
786     'type'        => 'checkbox',
787   },
788
789   {
790     'key'         => 'dirhash',
791     'section'     => 'shell',
792     '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>',
793     'type'        => 'text',
794   },
795
796   {
797     'key'         => 'disable_cust_attachment',
798     'section'     => '',
799     'description' => 'Disable customer file attachments',
800     'type'        => 'checkbox',
801   },
802
803   {
804     'key'         => 'max_attachment_size',
805     'section'     => '',
806     'description' => 'Maximum size for customer file attachments (leave blank for unlimited)',
807     'type'        => 'text',
808   },
809
810   {
811     'key'         => 'disable_customer_referrals',
812     'section'     => 'UI',
813     'description' => 'Disable new customer-to-customer referrals in the web interface',
814     'type'        => 'checkbox',
815   },
816
817   {
818     'key'         => 'editreferrals',
819     'section'     => 'UI',
820     'description' => 'Enable advertising source modification for existing customers',
821     'type'        => 'checkbox',
822   },
823
824   {
825     'key'         => 'emailinvoiceonly',
826     'section'     => 'invoicing',
827     'description' => 'Disables postal mail invoices',
828     'type'        => 'checkbox',
829   },
830
831   {
832     'key'         => 'disablepostalinvoicedefault',
833     'section'     => 'invoicing',
834     '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>.',
835     'type'        => 'checkbox',
836   },
837
838   {
839     'key'         => 'emailinvoiceauto',
840     'section'     => 'invoicing',
841     'description' => 'Automatically adds new accounts to the email invoice list',
842     'type'        => 'checkbox',
843   },
844
845   {
846     'key'         => 'emailinvoiceautoalways',
847     'section'     => 'invoicing',
848     'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses',
849     'type'        => 'checkbox',
850   },
851
852   {
853     'key'         => 'emailinvoice-apostrophe',
854     'section'     => 'invoicing',
855     'description' => 'Allows the apostrophe (single quote) character in the email addresses in the email invoice list.',
856     'type'        => 'checkbox',
857   },
858
859   {
860     'key'         => 'exclude_ip_addr',
861     'section'     => '',
862     'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
863     'type'        => 'textarea',
864   },
865   
866   {
867     'key'         => 'auto_router',
868     'section'     => '',
869     'description' => 'Automatically choose the correct router/block based on supplied ip address when possible while provisioning broadband services',
870     'type'        => 'checkbox',
871   },
872   
873   {
874     'key'         => 'hidecancelledpackages',
875     'section'     => 'UI',
876     'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
877     'type'        => 'checkbox',
878   },
879
880   {
881     'key'         => 'hidecancelledcustomers',
882     'section'     => 'UI',
883     'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
884     'type'        => 'checkbox',
885   },
886
887   {
888     'key'         => 'home',
889     'section'     => 'shell',
890     'description' => 'For new users, prefixed to username to create a directory name.  Should have a leading but not a trailing slash.',
891     'type'        => 'text',
892   },
893
894   {
895     'key'         => 'invoice_from',
896     'section'     => 'required',
897     'description' => 'Return address on email invoices',
898     'type'        => 'text',
899     'per_agent'   => 1,
900   },
901
902   {
903     'key'         => 'invoice_subject',
904     'section'     => 'invoicing',
905     'description' => 'Subject: header on email invoices.  Defaults to "Invoice".  The following substitutions are available: $name, $name_short, $invoice_number, and $invoice_date.',
906     'type'        => 'text',
907     'per_agent'   => 1,
908   },
909
910   {
911     'key'         => 'invoice_usesummary',
912     'section'     => 'invoicing',
913     'description' => 'Indicates that html and latex invoices should be in summary style and make use of invoice_latexsummary.',
914     'type'        => 'checkbox',
915   },
916
917   {
918     'key'         => 'invoice_template',
919     'section'     => 'invoicing',
920     '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:1.7:Documentation:Administration#Plaintext_invoice_templates">billing documentation</a> for details.',
921     'type'        => 'textarea',
922   },
923
924   {
925     'key'         => 'invoice_html',
926     'section'     => 'invoicing',
927     'description' => 'Optional HTML template for invoices.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#HTML_invoice_templates">billing documentation</a> for details.',
928
929     'type'        => 'textarea',
930   },
931
932   {
933     'key'         => 'invoice_htmlnotes',
934     'section'     => 'invoicing',
935     'description' => 'Notes section for HTML invoices.  Defaults to the same data in invoice_latexnotes if not specified.',
936     'type'        => 'textarea',
937     'per_agent'   => 1,
938   },
939
940   {
941     'key'         => 'invoice_htmlfooter',
942     'section'     => 'invoicing',
943     'description' => 'Footer for HTML invoices.  Defaults to the same data in invoice_latexfooter if not specified.',
944     'type'        => 'textarea',
945     'per_agent'   => 1,
946   },
947
948   {
949     'key'         => 'invoice_htmlsummary',
950     'section'     => 'invoicing',
951     'description' => 'Summary initial page for HTML invoices.',
952     'type'        => 'textarea',
953     'per_agent'   => 1,
954   },
955
956   {
957     'key'         => 'invoice_htmlreturnaddress',
958     'section'     => 'invoicing',
959     'description' => 'Return address for HTML invoices.  Defaults to the same data in invoice_latexreturnaddress if not specified.',
960     'type'        => 'textarea',
961   },
962
963   {
964     'key'         => 'invoice_latex',
965     'section'     => 'invoicing',
966     'description' => 'Optional LaTeX template for typeset PostScript invoices.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Typeset_.28LaTeX.29_invoice_templates">billing documentation</a> for details.',
967     'type'        => 'textarea',
968   },
969
970   {
971     'key'         => 'invoice_latexnotes',
972     'section'     => 'invoicing',
973     'description' => 'Notes section for LaTeX typeset PostScript invoices.',
974     'type'        => 'textarea',
975     'per_agent'   => 1,
976   },
977
978   {
979     'key'         => 'invoice_latexfooter',
980     'section'     => 'invoicing',
981     'description' => 'Footer for LaTeX typeset PostScript invoices.',
982     'type'        => 'textarea',
983     'per_agent'   => 1,
984   },
985
986   {
987     'key'         => 'invoice_latexsummary',
988     'section'     => 'invoicing',
989     'description' => 'Summary initial page for LaTeX typeset PostScript invoices.',
990     'type'        => 'textarea',
991     'per_agent'   => 1,
992   },
993
994   {
995     'key'         => 'invoice_latexcoupon',
996     'section'     => 'invoicing',
997     'description' => 'Remittance coupon for LaTeX typeset PostScript invoices.',
998     'type'        => 'textarea',
999     'per_agent'   => 1,
1000   },
1001
1002   {
1003     'key'         => 'invoice_latexreturnaddress',
1004     'section'     => 'invoicing',
1005     'description' => 'Return address for LaTeX typeset PostScript invoices.',
1006     'type'        => 'textarea',
1007   },
1008
1009   {
1010     'key'         => 'invoice_latexsmallfooter',
1011     'section'     => 'invoicing',
1012     'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
1013     'type'        => 'textarea',
1014     'per_agent'   => 1,
1015   },
1016
1017   {
1018     'key'         => 'invoice_email_pdf',
1019     'section'     => 'invoicing',
1020     '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.',
1021     'type'        => 'checkbox'
1022   },
1023
1024   {
1025     'key'         => 'invoice_email_pdf_note',
1026     'section'     => 'invoicing',
1027     'description' => 'If defined, this text will replace the default plain text invoice as the body of emailed PDF invoices.',
1028     'type'        => 'textarea'
1029   },
1030
1031
1032   { 
1033     'key'         => 'invoice_default_terms',
1034     'section'     => 'invoicing',
1035     'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
1036     'type'        => 'select',
1037     'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 20', 'Net 30', 'Net 45', 'Net 60' ],
1038   },
1039
1040   { 
1041     'key'         => 'invoice_show_prior_due_date',
1042     'section'     => 'invoicing',
1043     'description' => 'Show previous invoice due dates when showing prior balances.  Default is to show invoice date.',
1044     'type'        => 'checkbox',
1045   },
1046
1047   { 
1048     'key'         => 'invoice_include_aging',
1049     'section'     => 'invoicing',
1050     'description' => 'Show an aging line after the prior balance section.  Only valud when invoice_sections is enabled.',
1051     'type'        => 'checkbox',
1052   },
1053
1054   { 
1055     'key'         => 'invoice_sections',
1056     'section'     => 'invoicing',
1057     'description' => 'Split invoice into sections and label according to package category when enabled.',
1058     'type'        => 'checkbox',
1059   },
1060
1061   { 
1062     'key'         => 'usage_class_as_a_section',
1063     'section'     => 'invoicing',
1064     'description' => 'Split usage into sections and label according to usage class name when enabled.  Only valid when invoice_sections is enabled.',
1065     'type'        => 'checkbox',
1066   },
1067
1068   { 
1069     'key'         => 'svc_phone_sections',
1070     'section'     => 'invoicing',
1071     'description' => 'Create a section for each svc_phone when enabled.  Only valid when invoice_sections is enabled.',
1072     'type'        => 'checkbox',
1073   },
1074
1075   {
1076     'key'         => 'finance_pkgclass',
1077     'section'     => 'billing',
1078     'description' => 'The default package class for late fee charges, used if the fee event does not specify a package class itself.',
1079     'type'        => 'select-pkg_class',
1080   },
1081
1082   { 
1083     'key'         => 'separate_usage',
1084     'section'     => 'invoicing',
1085     'description' => 'Split the rated call usage into a separate line from the recurring charges.',
1086     'type'        => 'checkbox',
1087   },
1088
1089   {
1090     'key'         => 'invoice_send_receipts',
1091     'section'     => 'deprecated',
1092     'description' => '<b>DEPRECATED</b>, this used to send an invoice copy on payments and credits.  See the payment_receipt_email and XXXX instead.',
1093     'type'        => 'checkbox',
1094   },
1095
1096   {
1097     'key'         => 'payment_receipt_email',
1098     'section'     => 'billing',
1099     'description' => 'Template file for payment receipts.  Payment receipts are sent to the customer email invoice destination(s) when a payment is received.  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>$date</code> <li><code>$name</code> <li><code>$paynum</code> - Freeside payment number <li><code>$paid</code> - Amount of payment <li><code>$payby</code> - Payment type (Card, Check, Electronic check, etc.) <li><code>$payinfo</code> - Masked credit card number or check number <li><code>$balance</code> - New balance<li><code>$pkg</code> - Package (requires payment_receipt-trigger set to "when payment is applied".)</ul>',
1100     'type'        => [qw( checkbox textarea )],
1101   },
1102
1103   {
1104     'key'         => 'payment_receipt-trigger',
1105     'section'     => 'billing',
1106     'description' => 'When payment receipts are triggered.  Defaults to when payment is made.',
1107     'type'        => 'select',
1108     'select_hash' => [
1109                        'cust_pay'          => 'When payment is made.',
1110                        'cust_bill_pay_pkg' => 'When payment is applied.',
1111                      ],
1112   },
1113
1114   {
1115     'key'         => 'trigger_export_insert_on_payment',
1116     'section'     => 'billing',
1117     'description' => 'Enable exports on payment application.',
1118     'type'        => 'checkbox',
1119   },
1120
1121   {
1122     'key'         => 'lpr',
1123     'section'     => 'required',
1124     'description' => 'Print command for paper invoices, for example `lpr -h\'',
1125     'type'        => 'text',
1126   },
1127
1128   {
1129     'key'         => 'lpr-postscript_prefix',
1130     'section'     => 'billing',
1131     'description' => 'Raw printer commands prepended to the beginning of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
1132     'type'        => 'text',
1133   },
1134
1135   {
1136     'key'         => 'lpr-postscript_suffix',
1137     'section'     => 'billing',
1138     'description' => 'Raw printer commands added to the end of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
1139     'type'        => 'text',
1140   },
1141
1142   {
1143     'key'         => 'money_char',
1144     'section'     => '',
1145     'description' => 'Currency symbol - defaults to `$\'',
1146     'type'        => 'text',
1147   },
1148
1149   {
1150     'key'         => 'defaultrecords',
1151     'section'     => 'BIND',
1152     'description' => 'DNS entries to add automatically when creating a domain',
1153     'type'        => 'editlist',
1154     'editlist_parts' => [ { type=>'text' },
1155                           { type=>'immutable', value=>'IN' },
1156                           { type=>'select',
1157                             select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS TXT)} },
1158                           { type=> 'text' }, ],
1159   },
1160
1161   {
1162     'key'         => 'passwordmin',
1163     'section'     => 'password',
1164     'description' => 'Minimum password length (default 6)',
1165     'type'        => 'text',
1166   },
1167
1168   {
1169     'key'         => 'passwordmax',
1170     'section'     => 'password',
1171     'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
1172     'type'        => 'text',
1173   },
1174
1175   {
1176     'key'         => 'password-noampersand',
1177     'section'     => 'password',
1178     'description' => 'Disallow ampersands in passwords',
1179     'type'        => 'checkbox',
1180   },
1181
1182   {
1183     'key'         => 'password-noexclamation',
1184     'section'     => 'password',
1185     'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
1186     'type'        => 'checkbox',
1187   },
1188
1189   {
1190     'key'         => 'default-password-encoding',
1191     'section'     => 'password',
1192     'description' => 'Default storage format for passwords',
1193     'type'        => 'select',
1194     'select_hash' => [
1195       'plain'       => 'Plain text',
1196       'crypt-des'   => 'Unix password (DES encrypted)',
1197       'crypt-md5'   => 'Unix password (MD5 digest)',
1198       'ldap-plain'  => 'LDAP (plain text)',
1199       'ldap-crypt'  => 'LDAP (DES encrypted)',
1200       'ldap-md5'    => 'LDAP (MD5 digest)',
1201       'ldap-sha1'   => 'LDAP (SHA1 digest)',
1202       'legacy'      => 'Legacy mode',
1203     ],
1204   },
1205
1206   {
1207     'key'         => 'referraldefault',
1208     'section'     => 'UI',
1209     'description' => 'Default referral, specified by refnum',
1210     'type'        => 'text',
1211   },
1212
1213 #  {
1214 #    'key'         => 'registries',
1215 #    'section'     => 'required',
1216 #    'description' => 'Directory which contains domain registry information.  Each registry is a directory.',
1217 #  },
1218
1219   {
1220     'key'         => 'report_template',
1221     'section'     => 'deprecated',
1222     'description' => 'Deprecated template file for reports.',
1223     'type'        => 'textarea',
1224   },
1225
1226   {
1227     'key'         => 'maxsearchrecordsperpage',
1228     'section'     => 'UI',
1229     'description' => 'If set, number of search records to return per page.',
1230     'type'        => 'text',
1231   },
1232
1233   {
1234     'key'         => 'session-start',
1235     'section'     => 'session',
1236     '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.',
1237     'type'        => 'text',
1238   },
1239
1240   {
1241     'key'         => 'session-stop',
1242     'section'     => 'session',
1243     '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.',
1244     'type'        => 'text',
1245   },
1246
1247   {
1248     'key'         => 'shells',
1249     'section'     => 'shell',
1250     '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.',
1251     'type'        => 'textarea',
1252   },
1253
1254   {
1255     'key'         => 'showpasswords',
1256     'section'     => 'UI',
1257     'description' => 'Display unencrypted user passwords in the backend (employee) web interface',
1258     'type'        => 'checkbox',
1259   },
1260
1261   {
1262     'key'         => 'signupurl',
1263     'section'     => 'UI',
1264     '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:1.7: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',
1265     'type'        => 'text',
1266   },
1267
1268   {
1269     'key'         => 'smtpmachine',
1270     'section'     => 'required',
1271     'description' => 'SMTP relay for Freeside\'s outgoing mail',
1272     'type'        => 'text',
1273   },
1274
1275   {
1276     'key'         => 'soadefaultttl',
1277     'section'     => 'BIND',
1278     'description' => 'SOA default TTL for new domains.',
1279     'type'        => 'text',
1280   },
1281
1282   {
1283     'key'         => 'soaemail',
1284     'section'     => 'BIND',
1285     'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
1286     'type'        => 'text',
1287   },
1288
1289   {
1290     'key'         => 'soaexpire',
1291     'section'     => 'BIND',
1292     'description' => 'SOA expire for new domains',
1293     'type'        => 'text',
1294   },
1295
1296   {
1297     'key'         => 'soamachine',
1298     'section'     => 'BIND',
1299     'description' => 'SOA machine for new domains, with trailing `.\'',
1300     'type'        => 'text',
1301   },
1302
1303   {
1304     'key'         => 'soarefresh',
1305     'section'     => 'BIND',
1306     'description' => 'SOA refresh for new domains',
1307     'type'        => 'text',
1308   },
1309
1310   {
1311     'key'         => 'soaretry',
1312     'section'     => 'BIND',
1313     'description' => 'SOA retry for new domains',
1314     'type'        => 'text',
1315   },
1316
1317   {
1318     'key'         => 'statedefault',
1319     'section'     => 'UI',
1320     'description' => 'Default state or province (if not supplied, the default is `CA\')',
1321     'type'        => 'text',
1322   },
1323
1324   {
1325     'key'         => 'unsuspendauto',
1326     'section'     => 'billing',
1327     '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',
1328     'type'        => 'checkbox',
1329   },
1330
1331   {
1332     'key'         => 'unsuspend-always_adjust_next_bill_date',
1333     'section'     => 'billing',
1334     '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.',
1335     'type'        => 'checkbox',
1336   },
1337
1338   {
1339     'key'         => 'usernamemin',
1340     'section'     => 'username',
1341     'description' => 'Minimum username length (default 2)',
1342     'type'        => 'text',
1343   },
1344
1345   {
1346     'key'         => 'usernamemax',
1347     'section'     => 'username',
1348     'description' => 'Maximum username length',
1349     'type'        => 'text',
1350   },
1351
1352   {
1353     'key'         => 'username-ampersand',
1354     'section'     => 'username',
1355     '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.',
1356     'type'        => 'checkbox',
1357   },
1358
1359   {
1360     'key'         => 'username-letter',
1361     'section'     => 'username',
1362     'description' => 'Usernames must contain at least one letter',
1363     'type'        => 'checkbox',
1364     'per_agent'   => 1,
1365   },
1366
1367   {
1368     'key'         => 'username-letterfirst',
1369     'section'     => 'username',
1370     'description' => 'Usernames must start with a letter',
1371     'type'        => 'checkbox',
1372   },
1373
1374   {
1375     'key'         => 'username-noperiod',
1376     'section'     => 'username',
1377     'description' => 'Disallow periods in usernames',
1378     'type'        => 'checkbox',
1379   },
1380
1381   {
1382     'key'         => 'username-nounderscore',
1383     'section'     => 'username',
1384     'description' => 'Disallow underscores in usernames',
1385     'type'        => 'checkbox',
1386   },
1387
1388   {
1389     'key'         => 'username-nodash',
1390     'section'     => 'username',
1391     'description' => 'Disallow dashes in usernames',
1392     'type'        => 'checkbox',
1393   },
1394
1395   {
1396     'key'         => 'username-uppercase',
1397     'section'     => 'username',
1398     'description' => 'Allow uppercase characters in usernames.  Not recommended for use with FreeRADIUS with MySQL backend, which is case-insensitive by default.',
1399     'type'        => 'checkbox',
1400   },
1401
1402   { 
1403     'key'         => 'username-percent',
1404     'section'     => 'username',
1405     'description' => 'Allow the percent character (%) in usernames.',
1406     'type'        => 'checkbox',
1407   },
1408
1409   { 
1410     'key'         => 'username-colon',
1411     'section'     => 'username',
1412     'description' => 'Allow the colon character (:) in usernames.',
1413     'type'        => 'checkbox',
1414   },
1415
1416   {
1417     'key'         => 'safe-part_bill_event',
1418     'section'     => 'UI',
1419     'description' => 'Validates invoice event expressions against a preset list.  Useful for webdemos, annoying to powerusers.',
1420     'type'        => 'checkbox',
1421   },
1422
1423   {
1424     'key'         => 'show_ss',
1425     'section'     => 'UI',
1426     'description' => 'Turns on display/collection of social security numbers in the web interface.  Sometimes required by electronic check (ACH) processors.',
1427     'type'        => 'checkbox',
1428   },
1429
1430   {
1431     'key'         => 'show_stateid',
1432     'section'     => 'UI',
1433     'description' => "Turns on display/collection of driver's license/state issued id numbers in the web interface.  Sometimes required by electronic check (ACH) processors.",
1434     'type'        => 'checkbox',
1435   },
1436
1437   {
1438     'key'         => 'show_bankstate',
1439     'section'     => 'UI',
1440     'description' => "Turns on display/collection of state for bank accounts in the web interface.  Sometimes required by electronic check (ACH) processors.",
1441     'type'        => 'checkbox',
1442   },
1443
1444   { 
1445     'key'         => 'agent_defaultpkg',
1446     'section'     => 'UI',
1447     'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
1448     'type'        => 'checkbox',
1449   },
1450
1451   {
1452     'key'         => 'legacy_link',
1453     'section'     => 'UI',
1454     'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
1455     'type'        => 'checkbox',
1456   },
1457
1458   {
1459     'key'         => 'legacy_link-steal',
1460     'section'     => 'UI',
1461     'description' => 'Allow "stealing" an already-audited service from one customer (or package) to another using the link function.',
1462     'type'        => 'checkbox',
1463   },
1464
1465   {
1466     'key'         => 'queue_dangerous_controls',
1467     'section'     => 'UI',
1468     '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.',
1469     'type'        => 'checkbox',
1470   },
1471
1472   {
1473     'key'         => 'security_phrase',
1474     'section'     => 'password',
1475     'description' => 'Enable the tracking of a "security phrase" with each account.  Not recommended, as it is vulnerable to social engineering.',
1476     'type'        => 'checkbox',
1477   },
1478
1479   {
1480     'key'         => 'locale',
1481     'section'     => 'UI',
1482     'description' => 'Message locale',
1483     'type'        => 'select',
1484     'select_enum' => [ qw(en_US) ],
1485   },
1486
1487   {
1488     'key'         => 'signup_server-payby',
1489     'section'     => 'self-service',
1490     'description' => 'Acceptable payment types for the signup server',
1491     'type'        => 'selectmultiple',
1492     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
1493   },
1494
1495   {
1496     'key'         => 'signup_server-default_agentnum',
1497     'section'     => 'self-service',
1498     'description' => 'Default agent for the signup server',
1499     'type'        => 'select-sub',
1500     'options_sub' => sub { require FS::Record;
1501                            require FS::agent;
1502                            map { $_->agentnum => $_->agent }
1503                                FS::Record::qsearch('agent', { disabled=>'' } );
1504                          },
1505     'option_sub'  => sub { require FS::Record;
1506                            require FS::agent;
1507                            my $agent = FS::Record::qsearchs(
1508                              'agent', { 'agentnum'=>shift }
1509                            );
1510                            $agent ? $agent->agent : '';
1511                          },
1512   },
1513
1514   {
1515     'key'         => 'signup_server-default_refnum',
1516     'section'     => 'self-service',
1517     'description' => 'Default advertising source for the signup server',
1518     'type'        => 'select-sub',
1519     'options_sub' => sub { require FS::Record;
1520                            require FS::part_referral;
1521                            map { $_->refnum => $_->referral }
1522                                FS::Record::qsearch( 'part_referral', 
1523                                                     { 'disabled' => '' }
1524                                                   );
1525                          },
1526     'option_sub'  => sub { require FS::Record;
1527                            require FS::part_referral;
1528                            my $part_referral = FS::Record::qsearchs(
1529                              'part_referral', { 'refnum'=>shift } );
1530                            $part_referral ? $part_referral->referral : '';
1531                          },
1532   },
1533
1534   {
1535     'key'         => 'signup_server-default_pkgpart',
1536     'section'     => 'self-service',
1537     'description' => 'Default package for the signup server',
1538     'type'        => 'select-part_pkg',
1539   },
1540
1541   {
1542     'key'         => 'signup_server-default_svcpart',
1543     'section'     => 'self-service',
1544     'description' => 'Default service definition for the signup server - only necessary for services that trigger special provisioning widgets (such as DID provisioning).',
1545     'type'        => 'select-part_svc',
1546   },
1547
1548   {
1549     'key'         => 'signup_server-mac_addr_svcparts',
1550     'section'     => 'self-service',
1551     'description' => 'Service definitions which can receive mac addresses (current mapped to username for svc_acct).',
1552     'type'        => 'select-part_svc',
1553     'multiple'    => 1,
1554   },
1555
1556   {
1557     'key'         => 'signup_server-nomadix',
1558     'section'     => 'self-service',
1559     'description' => 'Signup page Nomadix integration',
1560     'type'        => 'checkbox',
1561   },
1562
1563   {
1564     'key'         => 'signup_server-service',
1565     'section'     => 'self-service',
1566     'description' => 'Service for the signup server - "Account (svc_acct)" is the default setting, or "Phone number (svc_phone)" for ITSP signup',
1567     'type'        => 'select',
1568     'select_hash' => [
1569                        'svc_acct'  => 'Account (svc_acct)',
1570                        'svc_phone' => 'Phone number (svc_phone)',
1571                      ],
1572   },
1573
1574   {
1575     'key'         => 'selfservice_server-base_url',
1576     'section'     => 'self-service',
1577     '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.',
1578     'type'        => 'text',
1579   },
1580
1581   {
1582     'key'         => 'show-msgcat-codes',
1583     'section'     => 'UI',
1584     'description' => 'Show msgcat codes in error messages.  Turn this option on before reporting errors to the mailing list.',
1585     'type'        => 'checkbox',
1586   },
1587
1588   {
1589     'key'         => 'signup_server-realtime',
1590     'section'     => 'self-service',
1591     'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
1592     'type'        => 'checkbox',
1593   },
1594   {
1595     'key'         => 'signup_server-classnum2',
1596     'section'     => 'self-service',
1597     'description' => 'Package Class for first optional purchase',
1598     'type'        => 'select-pkg_class',
1599   },
1600
1601   {
1602     'key'         => 'signup_server-classnum3',
1603     'section'     => 'self-service',
1604     'description' => 'Package Class for second optional purchase',
1605     'type'        => 'select-pkg_class',
1606   },
1607
1608   {
1609     'key'         => 'backend-realtime',
1610     'section'     => 'billing',
1611     'description' => 'Run billing for backend signups immediately.',
1612     'type'        => 'checkbox',
1613   },
1614
1615   {
1616     'key'         => 'declinetemplate',
1617     'section'     => 'billing',
1618     'description' => 'Template file for credit card and electronic check decline emails.',
1619     'type'        => 'textarea',
1620   },
1621
1622   {
1623     'key'         => 'emaildecline',
1624     'section'     => 'billing',
1625     'description' => 'Enable emailing of credit card and electronic check decline notices.',
1626     'type'        => 'checkbox',
1627   },
1628
1629   {
1630     'key'         => 'emaildecline-exclude',
1631     'section'     => 'billing',
1632     'description' => 'List of error messages that should not trigger email decline notices, one per line.',
1633     'type'        => 'textarea',
1634   },
1635
1636   {
1637     'key'         => 'cancelmessage',
1638     'section'     => 'billing',
1639     'description' => 'Template file for cancellation emails.',
1640     'type'        => 'textarea',
1641   },
1642
1643   {
1644     'key'         => 'cancelsubject',
1645     'section'     => 'billing',
1646     'description' => 'Subject line for cancellation emails.',
1647     'type'        => 'text',
1648   },
1649
1650   {
1651     'key'         => 'emailcancel',
1652     'section'     => 'billing',
1653     'description' => 'Enable emailing of cancellation notices.  Make sure to fill in the cancelmessage and cancelsubject configuration values as well.',
1654     'type'        => 'checkbox',
1655   },
1656
1657   {
1658     'key'         => 'bill_usage_on_cancel',
1659     'section'     => 'billing',
1660     '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.',
1661     'type'        => 'checkbox',
1662   },
1663
1664   {
1665     'key'         => 'require_cardname',
1666     'section'     => 'billing',
1667     'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
1668     'type'        => 'checkbox',
1669   },
1670
1671   {
1672     'key'         => 'enable_taxclasses',
1673     'section'     => 'billing',
1674     'description' => 'Enable per-package tax classes',
1675     'type'        => 'checkbox',
1676   },
1677
1678   {
1679     'key'         => 'require_taxclasses',
1680     'section'     => 'billing',
1681     'description' => 'Require a taxclass to be entered for every package',
1682     'type'        => 'checkbox',
1683   },
1684
1685   {
1686     'key'         => 'enable_taxproducts',
1687     'section'     => 'billing',
1688     'description' => 'Enable per-package mapping to vendor tax data from CCH or elsewhere.',
1689     'type'        => 'checkbox',
1690   },
1691
1692   {
1693     'key'         => 'taxdatadirectdownload',
1694     'section'     => 'billing',  #well
1695     'description' => 'Enable downloading tax data directly from the vendor site. at least three lines: URL, username, and password.j',
1696     'type'        => 'textarea',
1697   },
1698
1699   {
1700     'key'         => 'ignore_incalculable_taxes',
1701     'section'     => 'billing',
1702     'description' => 'Prefer to invoice without tax over not billing at all',
1703     'type'        => 'checkbox',
1704   },
1705
1706   {
1707     'key'         => 'welcome_email',
1708     'section'     => '',
1709     '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.  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></ul>',
1710     'type'        => 'textarea',
1711     'per_agent'   => 1,
1712   },
1713
1714   {
1715     'key'         => 'welcome_email-from',
1716     'section'     => '',
1717     'description' => 'From: address header for welcome email',
1718     'type'        => 'text',
1719     'per_agent'   => 1,
1720   },
1721
1722   {
1723     'key'         => 'welcome_email-subject',
1724     'section'     => '',
1725     'description' => 'Subject: header for welcome email',
1726     'type'        => 'text',
1727     'per_agent'   => 1,
1728   },
1729   
1730   {
1731     'key'         => 'welcome_email-mimetype',
1732     'section'     => '',
1733     'description' => 'MIME type for welcome email',
1734     'type'        => 'select',
1735     'select_enum' => [ 'text/plain', 'text/html' ],
1736     'per_agent'   => 1,
1737   },
1738
1739   {
1740     'key'         => 'welcome_letter',
1741     'section'     => '',
1742     '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>',
1743     'type'        => 'textarea',
1744   },
1745
1746   {
1747     'key'         => 'warning_email',
1748     'section'     => '',
1749     '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>',
1750     'type'        => 'textarea',
1751   },
1752
1753   {
1754     'key'         => 'warning_email-from',
1755     'section'     => '',
1756     'description' => 'From: address header for warning email',
1757     'type'        => 'text',
1758   },
1759
1760   {
1761     'key'         => 'warning_email-cc',
1762     'section'     => '',
1763     'description' => 'Additional recipient(s) (comma separated) for warning email when remaining usage reaches zero.',
1764     'type'        => 'text',
1765   },
1766
1767   {
1768     'key'         => 'warning_email-subject',
1769     'section'     => '',
1770     'description' => 'Subject: header for warning email',
1771     'type'        => 'text',
1772   },
1773   
1774   {
1775     'key'         => 'warning_email-mimetype',
1776     'section'     => '',
1777     'description' => 'MIME type for warning email',
1778     'type'        => 'select',
1779     'select_enum' => [ 'text/plain', 'text/html' ],
1780   },
1781
1782   {
1783     'key'         => 'payby',
1784     'section'     => 'billing',
1785     'description' => 'Available payment types.',
1786     'type'        => 'selectmultiple',
1787     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP) ],
1788   },
1789
1790   {
1791     'key'         => 'payby-default',
1792     'section'     => 'UI',
1793     'description' => 'Default payment type.  HIDE disables display of billing information and sets customers to BILL.',
1794     'type'        => 'select',
1795     'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP HIDE) ],
1796   },
1797
1798   {
1799     'key'         => 'paymentforcedtobatch',
1800     'section'     => 'deprecated',
1801     '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.',
1802     'type'        => 'checkbox',
1803   },
1804
1805   {
1806     'key'         => 'svc_acct-notes',
1807     'section'     => 'UI',
1808     'description' => 'Extra HTML to be displayed on the Account View screen.',
1809     'type'        => 'textarea',
1810   },
1811
1812   {
1813     'key'         => 'radius-password',
1814     'section'     => '',
1815     'description' => 'RADIUS attribute for plain-text passwords.',
1816     'type'        => 'select',
1817     'select_enum' => [ 'Password', 'User-Password', 'Cleartext-Password' ],
1818   },
1819
1820   {
1821     'key'         => 'radius-ip',
1822     'section'     => '',
1823     'description' => 'RADIUS attribute for IP addresses.',
1824     'type'        => 'select',
1825     'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
1826   },
1827
1828   #http://dev.coova.org/svn/coova-chilli/doc/dictionary.chillispot
1829   {
1830     'key'         => 'radius-chillispot-max',
1831     'section'     => '',
1832     'description' => 'Enable ChilliSpot (and CoovaChilli) Max attributes, specifically ChilliSpot-Max-{Input,Output,Total}-{Octets,Gigawords}.',
1833     'type'        => 'checkbox',
1834   },
1835
1836   {
1837     'key'         => 'svc_acct-alldomains',
1838     'section'     => '',
1839     '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.',
1840     'type'        => 'checkbox',
1841   },
1842
1843   {
1844     'key'         => 'dump-scpdest',
1845     'section'     => '',
1846     'description' => 'destination for scp database dumps: user@host:/path',
1847     'type'        => 'text',
1848   },
1849
1850   {
1851     'key'         => 'dump-pgpid',
1852     'section'     => '',
1853     '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.",
1854     'type'        => 'text',
1855   },
1856
1857   {
1858     'key'         => 'users-allow_comp',
1859     'section'     => 'deprecated',
1860     '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.',
1861     'type'        => 'textarea',
1862   },
1863
1864   {
1865     'key'         => 'credit_card-recurring_billing_flag',
1866     'section'     => 'billing',
1867     '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. ',
1868     'type'        => 'select',
1869     'select_hash' => [
1870                        'actual_oncard' => 'Default/classic behavior: set the flag if a customer has actual previous charges on the card.',
1871                        'transaction_is_recur' => 'Set the flag if the transaction itself is recurring, irregardless of previous charges on the card.',
1872                      ],
1873   },
1874
1875   {
1876     'key'         => 'credit_card-recurring_billing_acct_code',
1877     'section'     => 'billing',
1878     'description' => 'When the "recurring billing" flag is set, also set the "acct_code" to "rebill".  Useful for reporting purposes with supported gateways (PlugNPay, others?)',
1879     'type'        => 'checkbox',
1880   },
1881
1882   {
1883     'key'         => 'cvv-save',
1884     'section'     => 'billing',
1885     '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.',
1886     'type'        => 'selectmultiple',
1887     'select_enum' => \@card_types,
1888   },
1889
1890   {
1891     'key'         => 'manual_process-pkgpart',
1892     'section'     => 'billing',
1893     '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.',
1894     'type'        => 'select-part_pkg',
1895   },
1896
1897   {
1898     'key'         => 'manual_process-display',
1899     'section'     => 'billing',
1900     'description' => 'When using manual_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
1901     'type'        => 'select',
1902     'select_hash' => [
1903                        'add'      => 'Add fee to amount entered',
1904                        'subtract' => 'Subtract fee from amount entered',
1905                      ],
1906   },
1907
1908   {
1909     'key'         => 'manual_process-skip_first',
1910     'section'     => 'billing',
1911     'description' => "When using manual_process-pkgpart, omit the fee if it is the customer's first payment.",
1912     'type'        => 'checkbox',
1913   },
1914
1915   {
1916     'key'         => 'allow_negative_charges',
1917     'section'     => 'billing',
1918     'description' => 'Allow negative charges.  Normally not used unless importing data from a legacy system that requires this.',
1919     'type'        => 'checkbox',
1920   },
1921   {
1922       'key'         => 'auto_unset_catchall',
1923       'section'     => '',
1924       '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.',
1925       'type'        => 'checkbox',
1926   },
1927
1928   {
1929     'key'         => 'system_usernames',
1930     'section'     => 'username',
1931     '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.',
1932     'type'        => 'textarea',
1933   },
1934
1935   {
1936     'key'         => 'cust_pkg-change_svcpart',
1937     'section'     => '',
1938     'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
1939     'type'        => 'checkbox',
1940   },
1941
1942   {
1943     'key'         => 'cust_pkg-change_pkgpart-bill_now',
1944     'section'     => '',
1945     'description' => "When changing packages, bill the new package immediately.  Useful for prepaid situations with RADIUS where an Expiration attribute base don the package must be present at all times.",
1946     'type'        => 'checkbox',
1947   },
1948
1949   {
1950     'key'         => 'disable_autoreverse',
1951     'section'     => 'BIND',
1952     'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
1953     'type'        => 'checkbox',
1954   },
1955
1956   {
1957     'key'         => 'svc_www-enable_subdomains',
1958     'section'     => '',
1959     'description' => 'Enable selection of specific subdomains for virtual host creation.',
1960     'type'        => 'checkbox',
1961   },
1962
1963   {
1964     'key'         => 'svc_www-usersvc_svcpart',
1965     'section'     => '',
1966     'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
1967     'type'        => 'select-part_svc',
1968     'multiple'    => 1,
1969   },
1970
1971   {
1972     'key'         => 'selfservice_server-primary_only',
1973     'section'     => 'self-service',
1974     'description' => 'Only allow primary accounts to access self-service functionality.',
1975     'type'        => 'checkbox',
1976   },
1977
1978   {
1979     'key'         => 'selfservice_server-phone_login',
1980     'section'     => 'self-service',
1981     'description' => 'Allow login to self-service with phone number and PIN.',
1982     'type'        => 'checkbox',
1983   },
1984
1985   {
1986     'key'         => 'selfservice_server-single_domain',
1987     'section'     => 'self-service',
1988     'description' => 'If specified, only use this one domain for self-service access.',
1989     'type'        => 'text',
1990   },
1991
1992   {
1993     'key'         => 'card_refund-days',
1994     'section'     => 'billing',
1995     'description' => 'After a payment, the number of days a refund link will be available for that payment.  Defaults to 120.',
1996     'type'        => 'text',
1997   },
1998
1999   {
2000     'key'         => 'agent-showpasswords',
2001     'section'     => '',
2002     'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
2003     'type'        => 'checkbox',
2004   },
2005
2006   {
2007     'key'         => 'global_unique-username',
2008     'section'     => 'username',
2009     '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.',
2010     'type'        => 'select',
2011     'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
2012   },
2013
2014   {
2015     'key'         => 'global_unique-phonenum',
2016     'section'     => '',
2017     '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.',
2018     'type'        => 'select',
2019     'select_enum' => [ 'none', 'countrycode+phonenum', 'disabled' ],
2020   },
2021
2022   {
2023     'key'         => 'svc_external-skip_manual',
2024     'section'     => 'UI',
2025     '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).',
2026     'type'        => 'checkbox',
2027   },
2028
2029   {
2030     'key'         => 'svc_external-display_type',
2031     'section'     => 'UI',
2032     'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
2033     'type'        => 'select',
2034     'select_enum' => [ 'generic', 'artera_turbo', ],
2035   },
2036
2037   {
2038     'key'         => 'ticket_system',
2039     'section'     => '',
2040     '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:1.7:Documentation:RT_Installation">integrated ticketing installation instructions</a>).   <b>RT_External</b> accesses an external RT installation in a separate database (local or remote).',
2041     'type'        => 'select',
2042     #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
2043     'select_enum' => [ '', qw(RT_Internal RT_External) ],
2044   },
2045
2046   {
2047     'key'         => 'ticket_system-default_queueid',
2048     'section'     => '',
2049     'description' => 'Default queue used when creating new customer tickets.',
2050     'type'        => 'select-sub',
2051     'options_sub' => sub {
2052                            my $conf = new FS::Conf;
2053                            if ( $conf->config('ticket_system') ) {
2054                              eval "use FS::TicketSystem;";
2055                              die $@ if $@;
2056                              FS::TicketSystem->queues();
2057                            } else {
2058                              ();
2059                            }
2060                          },
2061     'option_sub'  => sub { 
2062                            my $conf = new FS::Conf;
2063                            if ( $conf->config('ticket_system') ) {
2064                              eval "use FS::TicketSystem;";
2065                              die $@ if $@;
2066                              FS::TicketSystem->queue(shift);
2067                            } else {
2068                              '';
2069                            }
2070                          },
2071   },
2072
2073   {
2074     'key'         => 'ticket_system-selfservice_queueid',
2075     'section'     => '',
2076     'description' => 'Queue used when creating new customer tickets from self-service.  Defautls to ticket_system-default_queueid if not specified.',
2077     #false laziness w/above
2078     'type'        => 'select-sub',
2079     'options_sub' => sub {
2080                            my $conf = new FS::Conf;
2081                            if ( $conf->config('ticket_system') ) {
2082                              eval "use FS::TicketSystem;";
2083                              die $@ if $@;
2084                              FS::TicketSystem->queues();
2085                            } else {
2086                              ();
2087                            }
2088                          },
2089     'option_sub'  => sub { 
2090                            my $conf = new FS::Conf;
2091                            if ( $conf->config('ticket_system') ) {
2092                              eval "use FS::TicketSystem;";
2093                              die $@ if $@;
2094                              FS::TicketSystem->queue(shift);
2095                            } else {
2096                              '';
2097                            }
2098                          },
2099   },
2100
2101   {
2102     'key'         => 'ticket_system-priority_reverse',
2103     'section'     => '',
2104     '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.',
2105     'type'        => 'checkbox',
2106   },
2107
2108   {
2109     'key'         => 'ticket_system-custom_priority_field',
2110     'section'     => '',
2111     'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
2112     'type'        => 'text',
2113   },
2114
2115   {
2116     'key'         => 'ticket_system-custom_priority_field-values',
2117     'section'     => '',
2118     'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
2119     'type'        => 'textarea',
2120   },
2121
2122   {
2123     'key'         => 'ticket_system-custom_priority_field_queue',
2124     'section'     => '',
2125     'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
2126     'type'        => 'text',
2127   },
2128
2129   {
2130     'key'         => 'ticket_system-rt_external_datasrc',
2131     'section'     => '',
2132     '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>',
2133     'type'        => 'text',
2134
2135   },
2136
2137   {
2138     'key'         => 'ticket_system-rt_external_url',
2139     'section'     => '',
2140     'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
2141     'type'        => 'text',
2142   },
2143
2144   {
2145     'key'         => 'company_name',
2146     'section'     => 'required',
2147     'description' => 'Your company name',
2148     'type'        => 'text',
2149     'per_agent'   => 1, #XXX just FS/FS/ClientAPI/Signup.pm
2150   },
2151
2152   {
2153     'key'         => 'company_address',
2154     'section'     => 'required',
2155     'description' => 'Your company address',
2156     'type'        => 'textarea',
2157     'per_agent'   => 1,
2158   },
2159
2160   {
2161     'key'         => 'echeck-void',
2162     'section'     => 'deprecated',
2163     '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',
2164     'type'        => 'checkbox',
2165   },
2166
2167   {
2168     'key'         => 'cc-void',
2169     'section'     => 'deprecated',
2170     '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',
2171     'type'        => 'checkbox',
2172   },
2173
2174   {
2175     'key'         => 'unvoid',
2176     'section'     => 'deprecated',
2177     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable unvoiding of voided payments',
2178     'type'        => 'checkbox',
2179   },
2180
2181   {
2182     'key'         => 'address1-search',
2183     'section'     => 'UI',
2184     'description' => 'Enable the ability to search the address1 field from customer search.',
2185     'type'        => 'checkbox',
2186   },
2187
2188   {
2189     'key'         => 'address2-search',
2190     'section'     => 'UI',
2191     'description' => 'Enable a "Unit" search box which searches the second address field.  Useful for multi-tenant applications.  See also: cust_main-require_address2',
2192     'type'        => 'checkbox',
2193   },
2194
2195   {
2196     'key'         => 'cust_main-require_address2',
2197     'section'     => 'UI',
2198     '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',
2199     'type'        => 'checkbox',
2200   },
2201
2202   {
2203     'key'         => 'agent-ship_address',
2204     'section'     => '',
2205     '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.",
2206     'type'        => 'checkbox',
2207   },
2208
2209   { 'key'         => 'referral_credit',
2210     'section'     => 'deprecated',
2211     '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.",
2212     'type'        => 'checkbox',
2213   },
2214
2215   { 'key'         => 'selfservice_server-cache_module',
2216     'section'     => 'self-service',
2217     '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.',
2218     'type'        => 'select',
2219     'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
2220   },
2221
2222   {
2223     'key'         => 'hylafax',
2224     'section'     => 'billing',
2225     '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).',
2226     'type'        => [qw( checkbox textarea )],
2227   },
2228
2229   {
2230     'key'         => 'cust_bill-ftpformat',
2231     'section'     => 'invoicing',
2232     'description' => 'Enable FTP of raw invoice data - format.',
2233     'type'        => 'select',
2234     'select_enum' => [ '', 'default', 'billco', ],
2235   },
2236
2237   {
2238     'key'         => 'cust_bill-ftpserver',
2239     'section'     => 'invoicing',
2240     'description' => 'Enable FTP of raw invoice data - server.',
2241     'type'        => 'text',
2242   },
2243
2244   {
2245     'key'         => 'cust_bill-ftpusername',
2246     'section'     => 'invoicing',
2247     'description' => 'Enable FTP of raw invoice data - server.',
2248     'type'        => 'text',
2249   },
2250
2251   {
2252     'key'         => 'cust_bill-ftppassword',
2253     'section'     => 'invoicing',
2254     'description' => 'Enable FTP of raw invoice data - server.',
2255     'type'        => 'text',
2256   },
2257
2258   {
2259     'key'         => 'cust_bill-ftpdir',
2260     'section'     => 'invoicing',
2261     'description' => 'Enable FTP of raw invoice data - server.',
2262     'type'        => 'text',
2263   },
2264
2265   {
2266     'key'         => 'cust_bill-spoolformat',
2267     'section'     => 'invoicing',
2268     'description' => 'Enable spooling of raw invoice data - format.',
2269     'type'        => 'select',
2270     'select_enum' => [ '', 'default', 'billco', ],
2271   },
2272
2273   {
2274     'key'         => 'cust_bill-spoolagent',
2275     'section'     => 'invoicing',
2276     'description' => 'Enable per-agent spooling of raw invoice data.',
2277     'type'        => 'checkbox',
2278   },
2279
2280   {
2281     'key'         => 'svc_acct-usage_suspend',
2282     'section'     => 'billing',
2283     '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.',
2284     'type'        => 'checkbox',
2285   },
2286
2287   {
2288     'key'         => 'svc_acct-usage_unsuspend',
2289     'section'     => 'billing',
2290     '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.',
2291     'type'        => 'checkbox',
2292   },
2293
2294   {
2295     'key'         => 'svc_acct-usage_threshold',
2296     'section'     => 'billing',
2297     '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.',
2298     'type'        => 'text',
2299   },
2300
2301   {
2302     'key'         => 'overlimit_groups',
2303     'section'     => '',
2304     'description' => 'RADIUS group (or comma-separated groups) to assign to svc_acct which has exceeded its bandwidth or time limit.',
2305     'type'        => 'text',
2306     'per_agent'   => 1,
2307   },
2308
2309   {
2310     'key'         => 'cust-fields',
2311     'section'     => 'UI',
2312     'description' => 'Which customer fields to display on reports by default',
2313     'type'        => 'select',
2314     'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
2315   },
2316
2317   {
2318     'key'         => 'cust_pkg-display_times',
2319     'section'     => 'UI',
2320     'description' => 'Display full timestamps (not just dates) for customer packages.  Useful if you are doing real-time things like hourly prepaid.',
2321     'type'        => 'checkbox',
2322   },
2323
2324   {
2325     'key'         => 'cust_pkg-always_show_location',
2326     'section'     => 'UI',
2327     'description' => "Always display package locations, even when they're all the default service address.",
2328     'type'        => 'checkbox',
2329   },
2330
2331   {
2332     'key'         => 'svc_acct-edit_uid',
2333     'section'     => 'shell',
2334     'description' => 'Allow UID editing.',
2335     'type'        => 'checkbox',
2336   },
2337
2338   {
2339     'key'         => 'svc_acct-edit_gid',
2340     'section'     => 'shell',
2341     'description' => 'Allow GID editing.',
2342     'type'        => 'checkbox',
2343   },
2344
2345   {
2346     'key'         => 'zone-underscore',
2347     'section'     => 'BIND',
2348     'description' => 'Allow underscores in zone names.  As underscores are illegal characters in zone names, this option is not recommended.',
2349     'type'        => 'checkbox',
2350   },
2351
2352   {
2353     'key'         => 'echeck-nonus',
2354     'section'     => 'billing',
2355     'description' => 'Disable ABA-format account checking for Electronic Check payment info',
2356     'type'        => 'checkbox',
2357   },
2358
2359   {
2360     'key'         => 'voip-cust_cdr_spools',
2361     'section'     => '',
2362     'description' => 'Enable the per-customer option for individual CDR spools.',
2363     'type'        => 'checkbox',
2364   },
2365
2366   {
2367     'key'         => 'voip-cust_cdr_squelch',
2368     'section'     => '',
2369     'description' => 'Enable the per-customer option for not printing CDR on invoices.',
2370     'type'        => 'checkbox',
2371   },
2372
2373   {
2374     'key'         => 'voip-cdr_email',
2375     'section'     => '',
2376     'description' => 'Include the call details on emailed invoices even if the customer is configured for not printing them on the invoices.',
2377     'type'        => 'checkbox',
2378   },
2379
2380   {
2381     'key'         => 'voip-cust_email_csv_cdr',
2382     'section'     => '',
2383     'description' => 'Enable the per-customer option for including CDR information as a CSV attachment on emailed invoices.',
2384     'type'        => 'checkbox',
2385   },
2386
2387   {
2388     'key'         => 'svc_forward-arbitrary_dst',
2389     'section'     => '',
2390     '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.",
2391     'type'        => 'checkbox',
2392   },
2393
2394   {
2395     'key'         => 'tax-ship_address',
2396     'section'     => 'billing',
2397     'description' => 'By default, tax calculations are done based on the billing address.  Enable this switch to calculate tax based on the shipping address instead.',
2398     'type'        => 'checkbox',
2399   }
2400 ,
2401   {
2402     'key'         => 'tax-pkg_address',
2403     'section'     => 'billing',
2404     '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).  Note that this option is currently incompatible with vendor data taxation enabled by enable_taxproducts.',
2405     'type'        => 'checkbox',
2406   },
2407
2408   {
2409     'key'         => 'invoice-ship_address',
2410     'section'     => 'invoicing',
2411     'description' => 'Include the shipping address on invoices.',
2412     'type'        => 'checkbox',
2413   },
2414
2415   {
2416     'key'         => 'invoice-unitprice',
2417     'section'     => 'invoicing',
2418     'description' => 'Enable unit pricing on invoices.',
2419     'type'        => 'checkbox',
2420   },
2421
2422   {
2423     'key'         => 'invoice-smallernotes',
2424     'section'     => 'invoicing',
2425     'description' => 'Display the notes section in a smaller font on invoices.',
2426     'type'        => 'checkbox',
2427   },
2428
2429   {
2430     'key'         => 'invoice-smallerfooter',
2431     'section'     => 'invoicing',
2432     'description' => 'Display footers in a smaller font on invoices.',
2433     'type'        => 'checkbox',
2434   },
2435
2436   {
2437     'key'         => 'postal_invoice-fee_pkgpart',
2438     'section'     => 'billing',
2439     'description' => 'This allows selection of a package to insert on invoices for customers with postal invoices selected.',
2440     'type'        => 'select-part_pkg',
2441   },
2442
2443   {
2444     'key'         => 'postal_invoice-recurring_only',
2445     'section'     => 'billing',
2446     'description' => 'The postal invoice fee is omitted on invoices without reucrring charges when this is set.',
2447     'type'        => 'checkbox',
2448   },
2449
2450   {
2451     'key'         => 'batch-enable',
2452     'section'     => 'deprecated', #make sure batch-enable_payby is set for
2453                                    #everyone before removing
2454     'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
2455     'type'        => 'checkbox',
2456   },
2457
2458   {
2459     'key'         => 'batch-enable_payby',
2460     'section'     => 'billing',
2461     'description' => 'Enable batch processing for the specified payment types.',
2462     'type'        => 'selectmultiple',
2463     'select_enum' => [qw( CARD CHEK )],
2464   },
2465
2466   {
2467     'key'         => 'realtime-disable_payby',
2468     'section'     => 'billing',
2469     'description' => 'Disable realtime processing for the specified payment types.',
2470     'type'        => 'selectmultiple',
2471     'select_enum' => [qw( CARD CHEK )],
2472   },
2473
2474   {
2475     'key'         => 'batch-default_format',
2476     'section'     => 'billing',
2477     'description' => 'Default format for batches.',
2478     'type'        => 'select',
2479     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch',
2480                        'csv-chase_canada-E-xactBatch', 'BoM', 'PAP',
2481                        'paymentech', 'ach-spiritone', 'RBC'
2482                     ]
2483   },
2484
2485   #lists could be auto-generated from pay_batch info
2486   {
2487     'key'         => 'batch-fixed_format-CARD',
2488     'section'     => 'billing',
2489     'description' => 'Fixed (unchangeable) format for credit card batches.',
2490     'type'        => 'select',
2491     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
2492                        'csv-chase_canada-E-xactBatch', 'paymentech' ]
2493   },
2494
2495   {
2496     'key'         => 'batch-fixed_format-CHEK',
2497     'section'     => 'billing',
2498     'description' => 'Fixed (unchangeable) format for electronic check batches.',
2499     'type'        => 'select',
2500     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP',
2501                        'paymentech', 'ach-spiritone', 'RBC'
2502                      ]
2503   },
2504
2505   {
2506     'key'         => 'batch-increment_expiration',
2507     'section'     => 'billing',
2508     'description' => 'Increment expiration date years in batches until cards are current.  Make sure this is acceptable to your batching provider before enabling.',
2509     'type'        => 'checkbox'
2510   },
2511
2512   {
2513     'key'         => 'batchconfig-BoM',
2514     'section'     => 'billing',
2515     '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',
2516     'type'        => 'textarea',
2517   },
2518
2519   {
2520     'key'         => 'batchconfig-PAP',
2521     'section'     => 'billing',
2522     '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',
2523     'type'        => 'textarea',
2524   },
2525
2526   {
2527     'key'         => 'batchconfig-csv-chase_canada-E-xactBatch',
2528     'section'     => 'billing',
2529     'description' => 'Gateway ID for Chase Canada E-xact batching',
2530     'type'        => 'text',
2531   },
2532
2533   {
2534     'key'         => 'batchconfig-paymentech',
2535     'section'     => 'billing',
2536     'description' => 'Configuration for Chase Paymentech batching, five lines: 1. BIN, 2. Terminal ID, 3. Merchant ID, 4. Username, 5. Password (for batch uploads)',
2537     'type'        => 'textarea',
2538   },
2539
2540   {
2541     'key'         => 'batchconfig-RBC',
2542     'section'     => 'billing',
2543     'description' => 'Configuration for Royal Bank of Canada PDS batching, four lines: 1. Client number, 2. Short name, 3. Long name, 4. Transaction code.',
2544     'type'        => 'textarea',
2545   },
2546
2547   {
2548     'key'         => 'payment_history-years',
2549     'section'     => 'UI',
2550     'description' => 'Number of years of payment history to show by default.  Currently defaults to 2.',
2551     'type'        => 'text',
2552   },
2553
2554   {
2555     'key'         => 'change_history-years',
2556     'section'     => 'UI',
2557     'description' => 'Number of years of change history to show by default.  Currently defaults to 0.5.',
2558     'type'        => 'text',
2559   },
2560
2561   {
2562     'key'         => 'cust_main-packages-years',
2563     'section'     => 'UI',
2564     'description' => 'Number of years to show old (cancelled and one-time charge) packages by default.  Currently defaults to 2.',
2565     'type'        => 'text',
2566   },
2567
2568   {
2569     'key'         => 'cust_main-use_comments',
2570     'section'     => 'UI',
2571     'description' => 'Display free form comments on the customer edit screen.  Useful as a scratch pad.',
2572     'type'        => 'checkbox',
2573   },
2574
2575   {
2576     'key'         => 'cust_main-disable_notes',
2577     'section'     => 'UI',
2578     'description' => 'Disable new style customer notes - timestamped and user identified customer notes.  Useful in tracking who did what.',
2579     'type'        => 'checkbox',
2580   },
2581
2582   {
2583     'key'         => 'cust_main_note-display_times',
2584     'section'     => 'UI',
2585     'description' => 'Display full timestamps (not just dates) for customer notes.',
2586     'type'        => 'checkbox',
2587   },
2588
2589   {
2590     'key'         => 'cust_main-ticket_statuses',
2591     'section'     => 'UI',
2592     'description' => 'Show tickets with these statuses on the customer view page.',
2593     'type'        => 'selectmultiple',
2594     'select_enum' => [qw( new open stalled resolved rejected deleted )],
2595   },
2596
2597   {
2598     'key'         => 'cust_main-max_tickets',
2599     'section'     => 'UI',
2600     'description' => 'Maximum number of tickets to show on the customer view page.',
2601     'type'        => 'text',
2602   },
2603
2604   {
2605     'key'         => 'cust_main-skeleton_tables',
2606     'section'     => '',
2607     '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.',
2608     'type'        => 'textarea',
2609   },
2610
2611   {
2612     'key'         => 'cust_main-skeleton_custnum',
2613     'section'     => '',
2614     'description' => 'Customer number specifying the source data to copy into skeleton tables for new customers.',
2615     'type'        => 'text',
2616   },
2617
2618   {
2619     'key'         => 'cust_main-enable_birthdate',
2620     'section'     => 'UI',
2621     'descritpion' => 'Enable tracking of a birth date with each customer record',
2622     'type'        => 'checkbox',
2623   },
2624
2625   {
2626     'key'         => 'support-key',
2627     'section'     => '',
2628     '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.',
2629     'type'        => 'text',
2630   },
2631
2632   {
2633     'key'         => 'card-types',
2634     'section'     => 'billing',
2635     'description' => 'Select one or more card types to enable only those card types.  If no card types are selected, all card types are available.',
2636     'type'        => 'selectmultiple',
2637     'select_enum' => \@card_types,
2638   },
2639
2640   {
2641     'key'         => 'disable-fuzzy',
2642     'section'     => 'UI',
2643     'description' => 'Disable fuzzy searching.  Speeds up searching for large sites, but only shows exact matches.',
2644     'type'        => 'checkbox',
2645   },
2646
2647   { 'key'         => 'pkg_referral',
2648     'section'     => '',
2649     'description' => 'Enable package-specific advertising sources.',
2650     'type'        => 'checkbox',
2651   },
2652
2653   { 'key'         => 'pkg_referral-multiple',
2654     'section'     => '',
2655     'description' => 'In addition, allow multiple advertising sources to be associated with a single package.',
2656     'type'        => 'checkbox',
2657   },
2658
2659   {
2660     'key'         => 'dashboard-install_welcome',
2661     'section'     => 'UI',
2662     'description' => 'New install welcome screen.',
2663     'type'        => 'select',
2664     'select_enum' => [ '', 'ITSP_fsinc_hosted', ],
2665   },
2666
2667   {
2668     'key'         => 'dashboard-toplist',
2669     'section'     => 'UI',
2670     'description' => 'List of items to display on the top of the front page',
2671     'type'        => 'textarea',
2672   },
2673
2674   {
2675     'key'         => 'impending_recur_template',
2676     'section'     => 'billing',
2677     '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>',
2678 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
2679     'type'        => 'textarea',
2680   },
2681
2682   {
2683     'key'         => 'logo.png',
2684     'section'     => 'UI',  #'invoicing' ?
2685     'description' => 'Company logo for HTML invoices and the backoffice interface, in PNG format.  Suggested size somewhere near 92x62.',
2686     'type'        => 'image',
2687     'per_agent'   => 1, #XXX just view/logo.cgi, which is for the global
2688                         #old-style editor anyway...?
2689   },
2690
2691   {
2692     'key'         => 'logo.eps',
2693     'section'     => 'invoicing',
2694     'description' => 'Company logo for printed and PDF invoices, in EPS format.',
2695     'type'        => 'image',
2696     'per_agent'   => 1, #XXX as above, kinda
2697   },
2698
2699   {
2700     'key'         => 'selfservice-ignore_quantity',
2701     'section'     => 'self-service',
2702     'description' => 'Ignores service quantity restrictions in self-service context.  Strongly not recommended - just set your quantities correctly in the first place.',
2703     'type'        => 'checkbox',
2704   },
2705
2706   {
2707     'key'         => 'selfservice-session_timeout',
2708     'section'     => 'self-service',
2709     'description' => 'Self-service session timeout.  Defaults to 1 hour.',
2710     'type'        => 'select',
2711     'select_enum' => [ '1 hour', '2 hours', '4 hours', '8 hours', '1 day', '1 week', ],
2712   },
2713
2714   {
2715     'key'         => 'disable_setup_suspended_pkgs',
2716     'section'     => 'billing',
2717     'description' => 'Disables charging of setup fees for suspended packages.',
2718     'type'        => 'checkbox',
2719   },
2720
2721   {
2722     'key'         => 'password-generated-allcaps',
2723     'section'     => 'password',
2724     'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
2725     'type'        => 'checkbox',
2726   },
2727
2728   {
2729     'key'         => 'datavolume-forcemegabytes',
2730     'section'     => 'UI',
2731     'description' => 'All data volumes are expressed in megabytes',
2732     'type'        => 'checkbox',
2733   },
2734
2735   {
2736     'key'         => 'datavolume-significantdigits',
2737     'section'     => 'UI',
2738     'description' => 'number of significant digits to use to represent data volumes',
2739     'type'        => 'text',
2740   },
2741
2742   {
2743     'key'         => 'disable_void_after',
2744     'section'     => 'billing',
2745     'description' => 'Number of seconds after which freeside won\'t attempt to VOID a payment first when performing a refund.',
2746     'type'        => 'text',
2747   },
2748
2749   {
2750     'key'         => 'disable_line_item_date_ranges',
2751     'section'     => 'billing',
2752     'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.',
2753     'type'        => 'checkbox',
2754   },
2755
2756   {
2757     'key'         => 'support_packages',
2758     'section'     => '',
2759     '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...
2760     'type'        => 'select-part_pkg',
2761     'multiple'    => 1,
2762   },
2763
2764   {
2765     'key'         => 'cust_main-require_phone',
2766     'section'     => '',
2767     'description' => 'Require daytime or night phone for all customer records.',
2768     'type'        => 'checkbox',
2769   },
2770
2771   {
2772     'key'         => 'cust_main-require_invoicing_list_email',
2773     'section'     => '',
2774     'description' => 'Email address field is required: require at least one invoicing email address for all customer records.',
2775     'type'        => 'checkbox',
2776   },
2777
2778   {
2779     'key'         => 'svc_acct-display_paid_time_remaining',
2780     'section'     => '',
2781     'description' => 'Show paid time remaining in addition to time remaining.',
2782     'type'        => 'checkbox',
2783   },
2784
2785   {
2786     'key'         => 'cancel_credit_type',
2787     'section'     => 'billing',
2788     'description' => 'The group to use for new, automatically generated credit reasons resulting from cancellation.',
2789     'type'        => 'select-sub',
2790     'options_sub' => sub { require FS::Record;
2791                            require FS::reason_type;
2792                            map { $_->typenum => $_->type }
2793                                FS::Record::qsearch('reason_type', { class=>'R' } );
2794                          },
2795     'option_sub'  => sub { require FS::Record;
2796                            require FS::reason_type;
2797                            my $reason_type = FS::Record::qsearchs(
2798                              'reason_type', { 'typenum' => shift }
2799                            );
2800                            $reason_type ? $reason_type->type : '';
2801                          },
2802   },
2803
2804   {
2805     'key'         => 'referral_credit_type',
2806     'section'     => 'deprecated',
2807     '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.',
2808     'type'        => 'select-sub',
2809     'options_sub' => sub { require FS::Record;
2810                            require FS::reason_type;
2811                            map { $_->typenum => $_->type }
2812                                FS::Record::qsearch('reason_type', { class=>'R' } );
2813                          },
2814     'option_sub'  => sub { require FS::Record;
2815                            require FS::reason_type;
2816                            my $reason_type = FS::Record::qsearchs(
2817                              'reason_type', { 'typenum' => shift }
2818                            );
2819                            $reason_type ? $reason_type->type : '';
2820                          },
2821   },
2822
2823   {
2824     'key'         => 'signup_credit_type',
2825     'section'     => 'billing', #self-service?
2826     'description' => 'The group to use for new, automatically generated credit reasons resulting from signup and self-service declines.',
2827     'type'        => 'select-sub',
2828     'options_sub' => sub { require FS::Record;
2829                            require FS::reason_type;
2830                            map { $_->typenum => $_->type }
2831                                FS::Record::qsearch('reason_type', { class=>'R' } );
2832                          },
2833     'option_sub'  => sub { require FS::Record;
2834                            require FS::reason_type;
2835                            my $reason_type = FS::Record::qsearchs(
2836                              'reason_type', { 'typenum' => shift }
2837                            );
2838                            $reason_type ? $reason_type->type : '';
2839                          },
2840   },
2841
2842   {
2843     'key'         => 'cust_main-agent_custid-format',
2844     'section'     => '',
2845     'description' => 'Enables searching of various formatted values in cust_main.agent_custid',
2846     'type'        => 'select',
2847     'select_hash' => [
2848                        ''      => 'Numeric only',
2849                        'ww?d+' => 'Numeric with one or two letter prefix',
2850                      ],
2851   },
2852
2853   {
2854     'key'         => 'card_masking_method',
2855     'section'     => 'UI',
2856     '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.',
2857     'type'        => 'select',
2858     'select_hash' => [
2859                        ''            => '123456xxxxxx1234',
2860                        'first6last2' => '123456xxxxxxxx12',
2861                        'first4last4' => '1234xxxxxxxx1234',
2862                        'first4last2' => '1234xxxxxxxxxx12',
2863                        'first2last4' => '12xxxxxxxxxx1234',
2864                        'first2last2' => '12xxxxxxxxxxxx12',
2865                        'first0last4' => 'xxxxxxxxxxxx1234',
2866                        'first0last2' => 'xxxxxxxxxxxxxx12',
2867                      ],
2868   },
2869
2870   {
2871     'key'         => 'disable_previous_balance',
2872     'section'     => 'invoicing',
2873     'description' => 'Disable inclusion of previous balancem payment, and credit lines on invoices',
2874     'type'        => 'checkbox',
2875   },
2876
2877   {
2878     'key'         => 'previous_balance-summary_only',
2879     'section'     => 'invoicing',
2880     'description' => 'Only show a single line summarizing the total previous balance rather than one line per invoice.',
2881     'type'        => 'checkbox',
2882   },
2883
2884   {
2885     'key'         => 'usps_webtools-userid',
2886     'section'     => 'UI',
2887     '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.',
2888     'type'        => 'text',
2889   },
2890
2891   {
2892     'key'         => 'usps_webtools-password',
2893     'section'     => 'UI',
2894     '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.',
2895     'type'        => 'text',
2896   },
2897
2898   {
2899     'key'         => 'cust_main-auto_standardize_address',
2900     'section'     => 'UI',
2901     'description' => 'When using USPS web tools, automatically standardize the address without asking.',
2902     'type'        => 'checkbox',
2903   },
2904
2905   {
2906     'key'         => 'cust_main-require_censustract',
2907     'section'     => 'UI',
2908     'description' => 'Customer is required to have a census tract.  Useful for FCC form 477 reports. See also: cust_main-auto_standardize_address',
2909     'type'        => 'checkbox',
2910   },
2911
2912   {
2913     'key'         => 'census_year',
2914     'section'     => 'UI',
2915     'description' => 'The year to use in census tract lookups',
2916     'type'        => 'select',
2917     'select_enum' => [ qw( 2009 2008 2007 2006 ) ],
2918   },
2919
2920   {
2921     'key'         => 'company_latitude',
2922     'section'     => 'UI',
2923     'description' => 'Your company latitude (-90 through 90)',
2924     'type'        => 'text',
2925   },
2926
2927   {
2928     'key'         => 'company_longitude',
2929     'section'     => 'UI',
2930     'description' => 'Your company longitude (-180 thru 180)',
2931     'type'        => 'text',
2932   },
2933
2934   {
2935     'key'         => 'disable_acl_changes',
2936     'section'     => '',
2937     'description' => 'Disable all ACL changes, for demos.',
2938     'type'        => 'checkbox',
2939   },
2940
2941   {
2942     'key'         => 'cust_main-edit_agent_custid',
2943     'section'     => 'UI',
2944     'description' => 'Enable editing of the agent_custid field.',
2945     'type'        => 'checkbox',
2946   },
2947
2948   {
2949     'key'         => 'cust_main-default_agent_custid',
2950     'section'     => 'UI',
2951     'description' => 'Display the agent_custid field when available instead of the custnum field.',
2952     'type'        => 'checkbox',
2953   },
2954
2955   {
2956     'key'         => 'cust_bill-default_agent_invid',
2957     'section'     => 'UI',
2958     'description' => 'Display the agent_invid field when available instead of the invnum field.',
2959     'type'        => 'checkbox',
2960   },
2961
2962   {
2963     'key'         => 'cust_main-auto_agent_custid',
2964     'section'     => 'UI',
2965     'description' => 'Automatically assign an agent_custid - select format',
2966     'type'        => 'select',
2967     'select_hash' => [ '' => 'No',
2968                        '1YMMXXXXXXXX' => '1YMMXXXXXXXX',
2969                      ],
2970   },
2971
2972   {
2973     'key'         => 'cust_main-default_areacode',
2974     'section'     => 'UI',
2975     'description' => 'Default area code for customers.',
2976     'type'        => 'text',
2977   },
2978
2979   {
2980     'key'         => 'mcp_svcpart',
2981     'section'     => '',
2982     'description' => 'Master Control Program svcpart.  Leave this blank.',
2983     'type'        => 'text', #select-part_svc
2984   },
2985
2986   {
2987     'key'         => 'cust_bill-max_same_services',
2988     'section'     => 'invoicing',
2989     '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.',
2990     'type'        => 'text',
2991   },
2992
2993   {
2994     'key'         => 'cust_bill-consolidate_services',
2995     'section'     => 'invoicing',
2996     'description' => 'Consolidate service display into fewer lines on invoices rather than one per service.',
2997     'type'        => 'checkbox',
2998   },
2999
3000   {
3001     'key'         => 'suspend_email_admin',
3002     'section'     => '',
3003     'description' => 'Destination admin email address to enable suspension notices',
3004     'type'        => 'text',
3005   },
3006
3007   {
3008     'key'         => 'email_report-subject',
3009     'section'     => '',
3010     'description' => 'Subject for reports emailed by freeside-fetch.  Defaults to "Freeside report".',
3011     'type'        => 'text',
3012   },
3013
3014   {
3015     'key'         => 'selfservice-head',
3016     'section'     => 'self-service',
3017     'description' => 'HTML for the HEAD section of the self-service interface, typically used for LINK stylesheet tags',
3018     'type'        => 'textarea', #htmlarea?
3019     'per_agent'   => 1,
3020   },
3021
3022
3023   {
3024     'key'         => 'selfservice-body_header',
3025     'section'     => 'self-service',
3026     'description' => 'HTML header for the self-service interface',
3027     'type'        => 'textarea', #htmlarea?
3028     'per_agent'   => 1,
3029   },
3030
3031   {
3032     'key'         => 'selfservice-body_footer',
3033     'section'     => 'self-service',
3034     'description' => 'HTML footer for the self-service interface',
3035     'type'        => 'textarea', #htmlarea?
3036     'per_agent'   => 1,
3037   },
3038
3039
3040   {
3041     'key'         => 'selfservice-body_bgcolor',
3042     'section'     => 'self-service',
3043     'description' => 'HTML background color for the self-service interface, for example, #FFFFFF',
3044     'type'        => 'text',
3045     'per_agent'   => 1,
3046   },
3047
3048   {
3049     'key'         => 'selfservice-box_bgcolor',
3050     'section'     => 'self-service',
3051     'description' => 'HTML color for self-service interface input boxes, for example, #C0C0C0',
3052     'type'        => 'text',
3053     'per_agent'   => 1,
3054   },
3055
3056   {
3057     'key'         => 'selfservice-text_color',
3058     'section'     => 'self-service',
3059     'description' => 'HTML text color for the self-service interface, for example, #000000',
3060     'type'        => 'text',
3061     'per_agent'   => 1,
3062   },
3063
3064   {
3065     'key'         => 'selfservice-link_color',
3066     'section'     => 'self-service',
3067     'description' => 'HTML link color for the self-service interface, for example, #0000FF',
3068     'type'        => 'text',
3069     'per_agent'   => 1,
3070   },
3071
3072   {
3073     'key'         => 'selfservice-vlink_color',
3074     'section'     => 'self-service',
3075     'description' => 'HTML visited link color for the self-service interface, for example, #FF00FF',
3076     'type'        => 'text',
3077     'per_agent'   => 1,
3078   },
3079
3080   {
3081     'key'         => 'selfservice-hlink_color',
3082     'section'     => 'self-service',
3083     'description' => 'HTML hover link color for the self-service interface, for example, #808080',
3084     'type'        => 'text',
3085     'per_agent'   => 1,
3086   },
3087
3088   {
3089     'key'         => 'selfservice-alink_color',
3090     'section'     => 'self-service',
3091     'description' => 'HTML active (clicked) link color for the self-service interface, for example, #808080',
3092     'type'        => 'text',
3093     'per_agent'   => 1,
3094   },
3095
3096   {
3097     'key'         => 'selfservice-font',
3098     'section'     => 'self-service',
3099     'description' => 'HTML font CSS for the self-service interface, for example, 0.9em/1.5em Arial, Helvetica, Geneva, sans-serif',
3100     'type'        => 'text',
3101     'per_agent'   => 1,
3102   },
3103
3104   {
3105     'key'         => 'selfservice-title_color',
3106     'section'     => 'self-service',
3107     'description' => 'HTML color for the self-service title, for example, #000000',
3108     'type'        => 'text',
3109     'per_agent'   => 1,
3110   },
3111
3112   {
3113     'key'         => 'selfservice-title_align',
3114     'section'     => 'self-service',
3115     'description' => 'HTML alignment for the self-service title, for example, center',
3116     'type'        => 'text',
3117     'per_agent'   => 1,
3118   },
3119   {
3120     'key'         => 'selfservice-title_size',
3121     'section'     => 'self-service',
3122     'description' => 'HTML font size for the self-service title, for example, 3',
3123     'type'        => 'text',
3124     'per_agent'   => 1,
3125   },
3126
3127   {
3128     'key'         => 'selfservice-title_left_image',
3129     'section'     => 'self-service',
3130     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
3131     'type'        => 'image',
3132     'per_agent'   => 1,
3133   },
3134
3135   {
3136     'key'         => 'selfservice-title_right_image',
3137     'section'     => 'self-service',
3138     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
3139     'type'        => 'image',
3140     'per_agent'   => 1,
3141   },
3142
3143   {
3144     'key'         => 'selfservice-menu_skipblanks',
3145     'section'     => 'self-service',
3146     'description' => 'Skip blank (spacer) entries in the self-service menu',
3147     'type'        => 'checkbox',
3148     'per_agent'   => 1,
3149   },
3150
3151   {
3152     'key'         => 'selfservice-menu_skipheadings',
3153     'section'     => 'self-service',
3154     'description' => 'Skip the unclickable heading entries in the self-service menu',
3155     'type'        => 'checkbox',
3156     'per_agent'   => 1,
3157   },
3158
3159   {
3160     'key'         => 'selfservice-menu_bgcolor',
3161     'section'     => 'self-service',
3162     'description' => 'HTML color for the self-service menu, for example, #C0C0C0',
3163     'type'        => 'text',
3164     'per_agent'   => 1,
3165   },
3166
3167   {
3168     'key'         => 'selfservice-menu_fontsize',
3169     'section'     => 'self-service',
3170     'description' => 'HTML font size for the self-service menu, for example, -1',
3171     'type'        => 'text',
3172     'per_agent'   => 1,
3173   },
3174   {
3175     'key'         => 'selfservice-menu_nounderline',
3176     'section'     => 'self-service',
3177     'description' => 'Styles menu links in the self-service without underlining.',
3178     'type'        => 'checkbox',
3179     'per_agent'   => 1,
3180   },
3181
3182
3183   {
3184     'key'         => 'selfservice-menu_top_image',
3185     'section'     => 'self-service',
3186     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
3187     'type'        => 'image',
3188     'per_agent'   => 1,
3189   },
3190
3191   {
3192     'key'         => 'selfservice-menu_body_image',
3193     'section'     => 'self-service',
3194     'description' => 'Repeating image used for the body of the menu in the self-service interface, in PNG format.',
3195     'type'        => 'image',
3196     'per_agent'   => 1,
3197   },
3198
3199   {
3200     'key'         => 'selfservice-menu_bottom_image',
3201     'section'     => 'self-service',
3202     'description' => 'Image used for the bottom of the menu in the self-service interface, in PNG format.',
3203     'type'        => 'image',
3204     'per_agent'   => 1,
3205   },
3206
3207   {
3208     'key'         => 'selfservice-bulk_format',
3209     'section'     => 'deprecated',
3210     'description' => 'Parameter arrangement for selfservice bulk features',
3211     'type'        => 'select',
3212     'select_enum' => [ '', 'izoom-soap', 'izoom-ftp' ],
3213     'per_agent'   => 1,
3214   },
3215
3216   {
3217     'key'         => 'selfservice-bulk_ftp_dir',
3218     'section'     => 'deprecated',
3219     'description' => 'Enable bulk ftp provisioning in this folder',
3220     'type'        => 'text',
3221     'per_agent'   => 1,
3222   },
3223
3224   {
3225     'key'         => 'signup-no_company',
3226     'section'     => 'self-service',
3227     'description' => "Don't display a field for company name on signup.",
3228     'type'        => 'checkbox',
3229   },
3230
3231   {
3232     'key'         => 'signup-recommend_email',
3233     'section'     => 'self-service',
3234     'description' => 'Encourage the entry of an invoicing email address on signup.',
3235     'type'        => 'checkbox',
3236   },
3237
3238   {
3239     'key'         => 'signup-recommend_daytime',
3240     'section'     => 'self-service',
3241     'description' => 'Encourage the entry of a daytime phone number  invoicing email address on signup.',
3242     'type'        => 'checkbox',
3243   },
3244
3245   {
3246     'key'         => 'svc_phone-radius-default_password',
3247     'section'     => '',
3248     'description' => 'Default password when exporting svc_phone records to RADIUS',
3249     'type'        => 'text',
3250   },
3251
3252   {
3253     'key'         => 'svc_phone-allow_alpha_phonenum',
3254     'section'     => '',
3255     'description' => 'Allow letters in phone numbers.',
3256     'type'        => 'checkbox',
3257   },
3258
3259   {
3260     'key'         => 'default_phone_countrycode',
3261     'section'     => '',
3262     'description' => 'Default countrcode',
3263     'type'        => 'text',
3264   },
3265
3266   {
3267     'key'         => 'cdr-charged_party-accountcode',
3268     'section'     => '',
3269     'description' => 'Set the charged_party field of CDRs to the accountcode.',
3270     'type'        => 'checkbox',
3271   },
3272
3273   {
3274     'key'         => 'cdr-charged_party-accountcode-trim_leading_0s',
3275     'section'     => '',
3276     'description' => 'When setting the charged_party field of CDRs to the accountcode, trim any leading zeros.',
3277     'type'        => 'checkbox',
3278   },
3279
3280 #  {
3281 #    'key'         => 'cdr-charged_party-truncate_prefix',
3282 #    'section'     => '',
3283 #    'description' => 'If the charged_party field has this prefix, truncate it to the length in cdr-charged_party-truncate_length.',
3284 #    'type'        => 'text',
3285 #  },
3286 #
3287 #  {
3288 #    'key'         => 'cdr-charged_party-truncate_length',
3289 #    'section'     => '',
3290 #    'description' => 'If the charged_party field has the prefix in cdr-charged_party-truncate_prefix, truncate it to this length.',
3291 #    'type'        => 'text',
3292 #  },
3293
3294   {
3295     'key'         => 'cdr-charged_party_rewrite',
3296     'section'     => '',
3297     '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*.',
3298     'type'        => 'checkbox',
3299   },
3300
3301   {
3302     'key'         => 'cdr-taqua-da_rewrite',
3303     'section'     => '',
3304     '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.',
3305     'type'        => 'text',
3306   },
3307
3308   {
3309     'key'         => 'cust_pkg-show_autosuspend',
3310     'section'     => 'UI',
3311     'description' => 'Show package auto-suspend dates.  Use with caution for now; can slow down customer view for large insallations.',
3312     'type'        => 'checkbox',
3313   },
3314
3315   {
3316     'key'         => 'cdr-asterisk_forward_rewrite',
3317     'section'     => '',
3318     '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").',
3319     'type'        => 'checkbox',
3320   },
3321
3322   {
3323     'key'         => 'sg-multicustomer_hack',
3324     'section'     => '',
3325     'description' => "Don't use this.",
3326     'type'        => 'checkbox',
3327   },
3328
3329   {
3330     'key'         => 'sg-ping_username',
3331     'section'     => '',
3332     'description' => "Don't use this.",
3333     'type'        => 'text',
3334   },
3335
3336   {
3337     'key'         => 'sg-ping_password',
3338     'section'     => '',
3339     'description' => "Don't use this.",
3340     'type'        => 'text',
3341   },
3342
3343   {
3344     'key'         => 'sg-login_username',
3345     'section'     => '',
3346     'description' => "Don't use this.",
3347     'type'        => 'text',
3348   },
3349
3350   {
3351     'key'         => 'disable-cust-pkg_class',
3352     'section'     => 'UI',
3353     'description' => 'Disable the two-step dropdown for selecting package class and package, and return to the classic single dropdown.',
3354     'type'        => 'checkbox',
3355   },
3356
3357   {
3358     'key'         => 'queued-max_kids',
3359     'section'     => '',
3360     'description' => 'Maximum number of queued processes.  Defaults to 10.',
3361     'type'        => 'text',
3362   },
3363
3364   {
3365     'key'         => 'queued-sleep_time',
3366     'section'     => '',
3367     '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.',
3368     'type'        => 'text',
3369   },
3370
3371   {
3372     'key'         => 'cancelled_cust-noevents',
3373     'section'     => 'billing',
3374     'description' => "Don't run events for cancelled customers",
3375     'type'        => 'checkbox',
3376   },
3377
3378   {
3379     'key'         => 'agent-invoice_template',
3380     'section'     => 'invoicing',
3381     'description' => 'Enable display/edit of old-style per-agent invoice template selection',
3382     'type'        => 'checkbox',
3383   },
3384
3385   {
3386     'key'         => 'svc_broadband-manage_link',
3387     'section'     => 'UI',
3388     'description' => 'URL for svc_broadband "Manage Device" link.  The following substitutions are available: $ip_addr.',
3389     'type'        => 'text',
3390   },
3391
3392   #more fine-grained, service def-level control could be useful eventually?
3393   {
3394     'key'         => 'svc_broadband-allow_null_ip_addr',
3395     'section'     => '',
3396     'description' => '',
3397     'type'        => 'checkbox',
3398   },
3399
3400   {
3401     'key'         => 'tax-report_groups',
3402     'section'     => '',
3403     'description' => 'List of grouping possibilities for tax names on reports, one per line, "label op value" (op can be = or !=).',
3404     'type'        => 'textarea',
3405   },
3406
3407   {
3408     'key'         => 'tax-cust_exempt-groups',
3409     'section'     => '',
3410     '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).',
3411     'type'        => 'textarea',
3412   },
3413
3414   {
3415     'key'         => 'cust_main-default_view',
3416     'section'     => 'UI',
3417     'description' => 'Default customer view, for users who have not selected a default view in their preferences.',
3418     'type'        => 'select',
3419     'select_hash' => [
3420       #false laziness w/view/cust_main.cgi and pref/pref.html
3421       'basics'          => 'Basics',
3422       'notes'           => 'Notes',
3423       'tickets'         => 'Tickets',
3424       'packages'        => 'Packages',
3425       'payment_history' => 'Payment History',
3426       'change_history'  => 'Change History',
3427       'jumbo'           => 'Jumbo',
3428     ],
3429   },
3430
3431   {
3432     'key'         => 'enable_tax_adjustments',
3433     'section'     => 'billing',
3434     'description' => 'Enable the ability to add manual tax adjustments.',
3435     'type'        => 'checkbox',
3436   },
3437
3438   {
3439     'key'         => 'rt-crontool',
3440     'section'     => '',
3441     'description' => 'Enable the RT CronTool extension.',
3442     'type'        => 'checkbox',
3443   },
3444
3445   {
3446     'key'         => 'pkg-balances',
3447     'section'     => 'billing',
3448     'description' => 'Enable experimental package balances.  Not recommended for general use.',
3449     'type'        => 'checkbox',
3450   },
3451
3452   {
3453     'key'         => 'pkg-addon_classnum',
3454     'section'     => 'billing',
3455     'description' => 'Enable the ability to restrict additional package orders based on package class.',
3456     'type'        => 'checkbox',
3457   },
3458
3459   {
3460     'key'         => 'cust_main-edit_signupdate',
3461     'section'     => 'UI',
3462     'descritpion' => 'Enable manual editing of the signup date.',
3463     'type'        => 'checkbox',
3464   },
3465
3466   {
3467     'key'         => 'svc_acct-disable_access_number',
3468     'section'     => 'UI',
3469     'descritpion' => 'Disable access number selection.',
3470     'type'        => 'checkbox',
3471   },
3472
3473   {
3474     'key'         => 'cust_bill_pay_pkg-manual',
3475     'section'     => 'UI',
3476     'description' => 'Allow manual application of payments to line items.',
3477     'type'        => 'checkbox',
3478   },
3479
3480   {
3481     'key'         => 'cust_credit_bill_pkg-manual',
3482     'section'     => 'UI',
3483     'description' => 'Allow manual application of credits to line items.',
3484     'type'        => 'checkbox',
3485   },
3486
3487   {
3488     'key'         => 'breakage-days',
3489     'section'     => 'billing',
3490     '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.',
3491     'type'        => 'text',
3492     'per_agent'   => 1,
3493   },
3494
3495   {
3496     'key'         => 'breakage-pkg_class',
3497     'section'     => 'billing',
3498     'description' => 'Package class to use for breakage reconciliation.',
3499     'type'        => 'select-pkg_class',
3500   },
3501
3502   {
3503     'key'         => 'disable_cron_billing',
3504     'section'     => 'billing',
3505     '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.',
3506     'type'        => 'checkbox',
3507   },
3508
3509   { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3510   { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3511   { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3512   { key => "bindprimary", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3513   { key => "bindsecondaries", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3514   { key => "bsdshellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3515   { key => "cyrus", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3516   { key => "cp_app", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3517   { key => "erpcdmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3518   { key => "icradiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3519   { key => "icradius_mysqldest", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3520   { key => "icradius_mysqlsource", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3521   { key => "icradius_secrets", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3522   { key => "maildisablecatchall", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3523   { key => "mxmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3524   { key => "nsmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3525   { key => "arecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3526   { key => "cnamerecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3527   { key => "nismachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3528   { key => "qmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3529   { key => "radiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3530   { key => "sendmailconfigpath", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3531   { key => "sendmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3532   { key => "sendmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3533   { key => "shellmachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3534   { key => "shellmachine-useradd", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3535   { key => "shellmachine-userdel", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3536   { key => "shellmachine-usermod", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3537   { key => "shellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3538   { key => "radiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3539   { key => "textradiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3540   { key => "username_policy", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3541   { key => "vpopmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3542   { key => "vpopmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3543   { key => "safe-part_pkg", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3544   { key => "selfservice_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3545   { key => "signup_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3546   { key => "signup_server-email", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3547   { key => "vonage-username", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3548   { key => "vonage-password", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3549   { key => "vonage-fromnumber", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3550
3551 );
3552
3553 1;
3554