fix documenation links to point into wiki where they belong
[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 IO::File;
5 use File::Basename;
6 use MIME::Base64;
7 use FS::ConfItem;
8 use FS::ConfDefaults;
9 use FS::Conf_compat17;
10 use FS::conf;
11 use FS::Record qw(qsearch qsearchs);
12 use FS::UID qw(dbh datasrc use_confcompat);
13
14 $base_dir = '%%%FREESIDE_CONF%%%';
15
16 $DEBUG = 0;
17
18 =head1 NAME
19
20 FS::Conf - Freeside configuration values
21
22 =head1 SYNOPSIS
23
24   use FS::Conf;
25
26   $conf = new FS::Conf;
27
28   $value = $conf->config('key');
29   @list  = $conf->config('key');
30   $bool  = $conf->exists('key');
31
32   $conf->touch('key');
33   $conf->set('key' => 'value');
34   $conf->delete('key');
35
36   @config_items = $conf->config_items;
37
38 =head1 DESCRIPTION
39
40 Read and write Freeside configuration values.  Keys currently map to filenames,
41 but this may change in the future.
42
43 =head1 METHODS
44
45 =over 4
46
47 =item new
48
49 Create a new configuration object.
50
51 =cut
52
53 sub new {
54   my($proto) = @_;
55   my($class) = ref($proto) || $proto;
56   my($self) = { 'base_dir' => $base_dir };
57   bless ($self, $class);
58 }
59
60 =item base_dir
61
62 Returns the base directory.  By default this is /usr/local/etc/freeside.
63
64 =cut
65
66 sub base_dir {
67   my($self) = @_;
68   my $base_dir = $self->{base_dir};
69   -e $base_dir or die "FATAL: $base_dir doesn't exist!";
70   -d $base_dir or die "FATAL: $base_dir isn't a directory!";
71   -r $base_dir or die "FATAL: Can't read $base_dir!";
72   -x $base_dir or die "FATAL: $base_dir not searchable (executable)!";
73   $base_dir =~ /^(.*)$/;
74   $1;
75 }
76
77 =item config KEY [ AGENTNUM ]
78
79 Returns the configuration value or values (depending on context) for key.
80 The optional agent number selects an agent specific value instead of the
81 global default if one is present.
82
83 =cut
84
85 sub _usecompat {
86   my ($self, $method) = (shift, shift);
87   warn "NO CONFIGURATION RECORDS FOUND -- USING COMPATIBILITY MODE"
88     if use_confcompat;
89   my $compat = new FS::Conf_compat17 ("$base_dir/conf." . datasrc);
90   $compat->$method(@_);
91 }
92
93 sub _config {
94   my($self,$name,$agentnum)=@_;
95   my $hashref = { 'name' => $name };
96   $hashref->{agentnum} = $agentnum;
97   local $FS::Record::conf = undef;  # XXX evil hack prevents recursion
98   my $cv = FS::Record::qsearchs('conf', $hashref);
99   if (!$cv && defined($agentnum)) {
100     $hashref->{agentnum} = '';
101     $cv = FS::Record::qsearchs('conf', $hashref);
102   }
103   return $cv;
104 }
105
106 sub config {
107   my $self = shift;
108   return $self->_usecompat('config', @_) if use_confcompat;
109
110   my($name,$agentnum)=@_;
111   my $cv = $self->_config($name, $agentnum) or return;
112
113   if ( wantarray ) {
114     my $v = $cv->value;
115     chomp $v;
116     (split "\n", $v, -1);
117   } else {
118     (split("\n", $cv->value))[0];
119   }
120 }
121
122 =item config_binary KEY [ AGENTNUM ]
123
124 Returns the exact scalar value for key.
125
126 =cut
127
128 sub config_binary {
129   my $self = shift;
130   return $self->_usecompat('config_binary', @_) if use_confcompat;
131
132   my($name,$agentnum)=@_;
133   my $cv = $self->_config($name, $agentnum) or return;
134   decode_base64($cv->value);
135 }
136
137 =item exists KEY [ AGENTNUM ]
138
139 Returns true if the specified key exists, even if the corresponding value
140 is undefined.
141
142 =cut
143
144 sub exists {
145   my $self = shift;
146   return $self->_usecompat('exists', @_) if use_confcompat;
147
148   my($name,$agentnum)=@_;
149   defined($self->_config($name, $agentnum));
150 }
151
152 #=item config_orbase KEY SUFFIX
153 #
154 #Returns the configuration value or values (depending on context) for 
155 #KEY_SUFFIX, if it exists, otherwise for KEY
156 #
157 #=cut
158
159 # outmoded as soon as we shift to agentnum based config values
160 # well, mostly.  still useful for e.g. late notices, etc. in that we want
161 # these to fall back to standard values
162 sub config_orbase {
163   my $self = shift;
164   return $self->_usecompat('config_orbase', @_) if use_confcompat;
165
166   my( $name, $suffix ) = @_;
167   if ( $self->exists("${name}_$suffix") ) {
168     $self->config("${name}_$suffix");
169   } else {
170     $self->config($name);
171   }
172 }
173
174 =item invoice_templatenames
175
176 Returns all possible invoice template names.
177
178 =cut
179
180 sub invoice_templatenames {
181   my( $self ) = @_;
182
183   my %templatenames = ();
184   foreach my $item ( $self->config_items ) {
185     foreach my $base ( @base_items ) {
186       my( $main, $ext) = split(/\./, $base);
187       $ext = ".$ext" if $ext;
188       if ( $item->key =~ /^${main}_(.+)$ext$/ ) {
189       $templatenames{$1}++;
190       }
191     }
192   }
193   
194   sort keys %templatenames;
195
196 }
197
198 =item touch KEY [ AGENT ];
199
200 Creates the specified configuration key if it does not exist.
201
202 =cut
203
204 sub touch {
205   my $self = shift;
206   return $self->_usecompat('touch', @_) if use_confcompat;
207
208   my($name, $agentnum) = @_;
209   unless ( $self->exists($name, $agentnum) ) {
210     $self->set($name, '', $agentnum);
211   }
212 }
213
214 =item set KEY VALUE [ AGENTNUM ];
215
216 Sets the specified configuration key to the given value.
217
218 =cut
219
220 sub set {
221   my $self = shift;
222   return $self->_usecompat('set', @_) if use_confcompat;
223
224   my($name, $value, $agentnum) = @_;
225   $value =~ /^(.*)$/s;
226   $value = $1;
227
228   warn "[FS::Conf] SET $name\n" if $DEBUG;
229
230   my $old = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum});
231   my $new = new FS::conf { $old ? $old->hash 
232                                 : ('name' => $name, 'agentnum' => $agentnum)
233                          };
234   $new->value($value);
235
236   my $error;
237   if ($old) {
238     $error = $new->replace($old);
239   } else {
240     $error = $new->insert;
241   }
242
243   die "error setting configuration value: $error \n"
244     if $error;
245
246 }
247
248 =item set_binary KEY VALUE [ AGENTNUM ]
249
250 Sets the specified configuration key to an exact scalar value which
251 can be retrieved with config_binary.
252
253 =cut
254
255 sub set_binary {
256   my $self  = shift;
257   return if use_confcompat;
258
259   my($name, $value, $agentnum)=@_;
260   $self->set($name, encode_base64($value), $agentnum);
261 }
262
263 =item delete KEY [ AGENTNUM ];
264
265 Deletes the specified configuration key.
266
267 =cut
268
269 sub delete {
270   my $self = shift;
271   return $self->_usecompat('delete', @_) if use_confcompat;
272
273   my($name, $agentnum) = @_;
274   if ( my $cv = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum}) ) {
275     warn "[FS::Conf] DELETE $name\n";
276
277     my $oldAutoCommit = $FS::UID::AutoCommit;
278     local $FS::UID::AutoCommit = 0;
279     my $dbh = dbh;
280
281     my $error = $cv->delete;
282
283     if ( $error ) {
284       $dbh->rollback if $oldAutoCommit;
285       die "error setting configuration value: $error \n"
286     }
287
288     $dbh->commit or die $dbh->errstr if $oldAutoCommit;
289
290   }
291 }
292
293 =item import_config_item CONFITEM DIR 
294
295   Imports the item specified by the CONFITEM (see L<FS::ConfItem>) into
296 the database as a conf record (see L<FS::conf>).  Imports from the file
297 in the directory DIR.
298
299 =cut
300
301 sub import_config_item { 
302   my ($self,$item,$dir) = @_;
303   my $key = $item->key;
304   if ( -e "$dir/$key" && ! use_confcompat ) {
305     warn "Inserting $key\n" if $DEBUG;
306     local $/;
307     my $value = readline(new IO::File "$dir/$key");
308     if ($item->type eq 'binary') {
309       $self->set_binary($key, $value);
310     }else{
311       $self->set($key, $value);
312     }
313   }else {
314     warn "Not inserting $key\n" if $DEBUG;
315   }
316 }
317
318 =item verify_config_item CONFITEM DIR 
319
320   Compares the item specified by the CONFITEM (see L<FS::ConfItem>) in
321 the database to the legacy file value in DIR.
322
323 =cut
324
325 sub verify_config_item { 
326   return '' if use_confcompat;
327   my ($self,$item,$dir) = @_;
328   my $key = $item->key;
329   my $type = $item->type;
330
331   my $compat = new FS::Conf_compat17 $dir;
332   my $error = '';
333   
334   $error .= "$key fails existential comparison; "
335     if $self->exists($key) xor $compat->exists($key);
336
337   unless ($type eq 'binary') {
338     {
339       no warnings;
340       $error .= "$key fails scalar comparison; "
341         unless scalar($self->config($key)) eq scalar($compat->config($key));
342     }
343
344     my (@new) = $self->config($key);
345     my (@old) = $compat->config($key);
346     unless ( scalar(@new) == scalar(@old)) { 
347       $error .= "$key fails list comparison; ";
348     }else{
349       my $r=1;
350       foreach (@old) { $r=0 if ($_ cmp shift(@new)); }
351       $error .= "$key fails list comparison; "
352         unless $r;
353     }
354   }
355
356   if ($type eq 'binary') {
357     $error .= "$key fails binary comparison; "
358       unless scalar($self->config_binary($key)) eq scalar($compat->config_binary($key));
359   }
360
361   if ($error =~ /existential comparison/ && $item->section eq 'deprecated') {
362     my $proto;
363     for ( @config_items ) { $proto = $_; last if $proto->key eq $key;  }
364     unless ($proto->key eq $key) { 
365       warn "removed config item $error\n" if $DEBUG;
366       $error = '';
367     }
368   }
369
370   $error;
371 }
372
373 #item _orbase_items OPTIONS
374 #
375 #Returns all of the possible extensible config items as FS::ConfItem objects.
376 #See #L<FS::ConfItem>.  OPTIONS consists of name value pairs.  Possible
377 #options include
378 #
379 # dir - the directory to search for configuration option files instead
380 #       of using the conf records in the database
381 #
382 #cut
383
384 #quelle kludge
385 sub _orbase_items {
386   my ($self, %opt) = @_; 
387
388   my $listmaker = sub { my $v = shift;
389                         $v =~ s/_/!_/g;
390                         if ( $v =~ /\.(png|eps)$/ ) {
391                           $v =~ s/\./!_%./;
392                         }else{
393                           $v .= '!_%';
394                         }
395                         map { $_->name }
396                           FS::Record::qsearch( 'conf',
397                                                {},
398                                                '',
399                                                "WHERE name LIKE '$v' ESCAPE '!'"
400                                              );
401                       };
402
403   if (exists($opt{dir}) && $opt{dir}) {
404     $listmaker = sub { my $v = shift;
405                        if ( $v =~ /\.(png|eps)$/ ) {
406                          $v =~ s/\./_*./;
407                        }else{
408                          $v .= '_*';
409                        }
410                        map { basename $_ } glob($opt{dir}. "/$v" );
411                      };
412   }
413
414   ( map { 
415           my $proto;
416           my $base = $_;
417           for ( @config_items ) { $proto = $_; last if $proto->key eq $base;  }
418           die "don't know about $base items" unless $proto->key eq $base;
419
420           map { new FS::ConfItem { 
421                                    'key' => $_,
422                                    'section' => $proto->section,
423                                    'description' => 'Alternate ' . $proto->description . '  See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Invoice_templates">billing documentation</a> for details.',
424                                    'type' => $proto->type,
425                                  };
426               } &$listmaker($base);
427         } @base_items,
428   );
429 }
430
431 =item config_items
432
433 Returns all of the possible global/default configuration items as
434 FS::ConfItem objects.  See L<FS::ConfItem>.
435
436 =cut
437
438 sub config_items {
439   my $self = shift; 
440   return $self->_usecompat('config_items', @_) if use_confcompat;
441
442   ( @config_items, $self->_orbase_items(@_) );
443 }
444
445 =back
446
447 =head1 SUBROUTINES
448
449 =over 4
450
451 =item init-config DIR
452
453 Imports the non-deprecated configuration items from DIR (1.7 compatible)
454 to conf records in the database.
455
456 =cut
457
458 sub init_config {
459   my $dir = shift;
460
461   {
462     local $FS::UID::use_confcompat = 0;
463     my $conf = new FS::Conf;
464     foreach my $item ( $conf->config_items(dir => $dir) ) {
465       $conf->import_config_item($item, $dir);
466       my $error = $conf->verify_config_item($item, $dir);
467       return $error if $error;
468     }
469   
470     my $compat = new FS::Conf_compat17 $dir;
471     foreach my $item ( $compat->config_items ) {
472       my $error = $conf->verify_config_item($item, $dir);
473       return $error if $error;
474     }
475   }
476
477   $FS::UID::use_confcompat = 0;
478   '';  #success
479 }
480
481 =back
482
483 =head1 BUGS
484
485 If this was more than just crud that will never be useful outside Freeside I'd
486 worry that config_items is freeside-specific and icky.
487
488 =head1 SEE ALSO
489
490 "Configuration" in the web interface (config/config.cgi).
491
492 =cut
493
494 #Business::CreditCard
495 @card_types = (
496   "VISA card",
497   "MasterCard",
498   "Discover card",
499   "American Express card",
500   "Diner's Club/Carte Blanche",
501   "enRoute",
502   "JCB",
503   "BankCard",
504   "Switch",
505   "Solo",
506 );
507
508 @base_items = qw (
509                    invoice_template
510                    invoice_latex
511                    invoice_latexreturnaddress
512                    invoice_latexfooter
513                    invoice_latexsmallfooter
514                    invoice_latexnotes
515                    invoice_html
516                    invoice_htmlreturnaddress
517                    invoice_htmlfooter
518                    invoice_htmlnotes
519                    logo.png
520                    logo.eps
521                  );
522
523 @base_items = qw (
524                    invoice_template
525                    invoice_latex
526                    invoice_latexreturnaddress
527                    invoice_latexfooter
528                    invoice_latexsmallfooter
529                    invoice_latexnotes
530                    invoice_html
531                    invoice_htmlreturnaddress
532                    invoice_htmlfooter
533                    invoice_htmlnotes
534                    logo.png
535                    logo.eps
536                  );
537
538 @config_items = map { new FS::ConfItem $_ } (
539
540   {
541     'key'         => 'address',
542     'section'     => 'deprecated',
543     'description' => 'This configuration option is no longer used.  See <a href="#invoice_template">invoice_template</a> instead.',
544     'type'        => 'text',
545   },
546
547   {
548     'key'         => 'alerter_template',
549     'section'     => 'billing',
550     'description' => 'Template file for billing method expiration alerts.  See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Credit_cards_and_Electronic_checks">billing documentation</a> for details.',
551     'type'        => 'textarea',
552   },
553
554   {
555     'key'         => 'apacheip',
556     'section'     => 'deprecated',
557     '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',
558     'type'        => 'text',
559   },
560
561   {
562     'key'         => 'encryption',
563     'section'     => 'billing',
564     'description' => 'Enable encryption of credit cards.',
565     'type'        => 'checkbox',
566   },
567
568   {
569     'key'         => 'encryptionmodule',
570     'section'     => 'billing',
571     'description' => 'Use which module for encryption?',
572     'type'        => 'text',
573   },
574
575   {
576     'key'         => 'encryptionpublickey',
577     'section'     => 'billing',
578     'description' => 'Your RSA Public Key - Required if Encryption is turned on.',
579     'type'        => 'textarea',
580   },
581
582   {
583     'key'         => 'encryptionprivatekey',
584     'section'     => 'billing',
585     '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.',
586     'type'        => 'textarea',
587   },
588
589   {
590     'key'         => 'business-onlinepayment',
591     'section'     => 'billing',
592     '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.',
593     'type'        => 'textarea',
594   },
595
596   {
597     'key'         => 'business-onlinepayment-ach',
598     'section'     => 'billing',
599     '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.',
600     'type'        => 'textarea',
601   },
602
603   {
604     'key'         => 'business-onlinepayment-description',
605     'section'     => 'billing',
606     '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)',
607     'type'        => 'text',
608   },
609
610   {
611     'key'         => 'business-onlinepayment-email-override',
612     'section'     => 'billing',
613     'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
614     'type'        => 'text',
615   },
616
617   {
618     'key'         => 'countrydefault',
619     'section'     => 'UI',
620     'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
621     'type'        => 'text',
622   },
623
624   {
625     'key'         => 'date_format',
626     'section'     => 'UI',
627     'description' => 'Format for displaying dates',
628     'type'        => 'select',
629     'select_hash' => [
630                        '%m/%d/%Y' => 'MM/DD/YYYY',
631                        '%Y/%m/%d' => 'YYYY/MM/DD',
632                      ],
633   },
634
635   {
636     'key'         => 'deletecustomers',
637     'section'     => 'UI',
638     'description' => 'Enable customer deletions.  Be very careful!  Deleting a customer will remove all traces that this 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.',
639     'type'        => 'checkbox',
640   },
641
642   {
643     'key'         => 'deletepayments',
644     'section'     => 'billing',
645     '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.',
646     'type'        => [qw( checkbox text )],
647   },
648
649   {
650     'key'         => 'deletecredits',
651     'section'     => 'deprecated',
652     '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.',
653     'type'        => [qw( checkbox text )],
654   },
655
656   {
657     'key'         => 'deleterefunds',
658     'section'     => 'billing',
659     'description' => 'Enable deletion of unclosed refunds.  Be very careful!  Only delete refunds that were data-entry errors, not adjustments.',
660     'type'        => 'checkbox',
661   },
662
663   {
664     'key'         => 'dirhash',
665     'section'     => 'shell',
666     '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>',
667     'type'        => 'text',
668   },
669
670   {
671     'key'         => 'disable_customer_referrals',
672     'section'     => 'UI',
673     'description' => 'Disable new customer-to-customer referrals in the web interface',
674     'type'        => 'checkbox',
675   },
676
677   {
678     'key'         => 'editreferrals',
679     'section'     => 'UI',
680     'description' => 'Enable advertising source modification for existing customers',
681     'type'       => 'checkbox',
682   },
683
684   {
685     'key'         => 'emailinvoiceonly',
686     'section'     => 'billing',
687     'description' => 'Disables postal mail invoices',
688     'type'       => 'checkbox',
689   },
690
691   {
692     'key'         => 'disablepostalinvoicedefault',
693     'section'     => 'billing',
694     '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>.',
695     'type'       => 'checkbox',
696   },
697
698   {
699     'key'         => 'emailinvoiceauto',
700     'section'     => 'billing',
701     'description' => 'Automatically adds new accounts to the email invoice list',
702     'type'       => 'checkbox',
703   },
704
705   {
706     'key'         => 'emailinvoiceautoalways',
707     'section'     => 'billing',
708     'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses',
709     'type'       => 'checkbox',
710   },
711
712   {
713     'key'         => 'exclude_ip_addr',
714     'section'     => '',
715     'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
716     'type'        => 'textarea',
717   },
718   
719   {
720     'key'         => 'hidecancelledpackages',
721     'section'     => 'UI',
722     'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
723     'type'        => 'checkbox',
724   },
725
726   {
727     'key'         => 'hidecancelledcustomers',
728     'section'     => 'UI',
729     'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
730     'type'        => 'checkbox',
731   },
732
733   {
734     'key'         => 'home',
735     'section'     => 'required',
736     'description' => 'For new users, prefixed to username to create a directory name.  Should have a leading but not a trailing slash.',
737     'type'        => 'text',
738   },
739
740   {
741     'key'         => 'invoice_from',
742     'section'     => 'required',
743     'description' => 'Return address on email invoices',
744     'type'        => 'text',
745   },
746
747   {
748     'key'         => 'invoice_template',
749     'section'     => 'required',
750     'description' => 'Required template file for invoices.  See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Plaintext_invoice_templates">billing documentation</a> for details.',
751     'type'        => 'textarea',
752   },
753
754   {
755     'key'         => 'invoice_html',
756     'section'     => 'billing',
757     'description' => 'Optional HTML template for invoices.  See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#HTML_invoice_templates">billing documentation</a> for details.',
758
759     'type'        => 'textarea',
760   },
761
762   {
763     'key'         => 'invoice_htmlnotes',
764     'section'     => 'billing',
765     'description' => 'Notes section for HTML invoices.  Defaults to the same data in invoice_latexnotes if not specified.',
766     'type'        => 'textarea',
767   },
768
769   {
770     'key'         => 'invoice_htmlfooter',
771     'section'     => 'billing',
772     'description' => 'Footer for HTML invoices.  Defaults to the same data in invoice_latexfooter if not specified.',
773     'type'        => 'textarea',
774   },
775
776   {
777     'key'         => 'invoice_htmlreturnaddress',
778     'section'     => 'billing',
779     'description' => 'Return address for HTML invoices.  Defaults to the same data in invoice_latexreturnaddress if not specified.',
780     'type'        => 'textarea',
781   },
782
783   {
784     'key'         => 'invoice_latex',
785     'section'     => 'billing',
786     'description' => 'Optional LaTeX template for typeset PostScript invoices.  See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Typeset_.28LaTeX.29_invoice_templates">billing documentation</a> for details.',
787     'type'        => 'textarea',
788   },
789
790   {
791     'key'         => 'invoice_latexnotes',
792     'section'     => 'billing',
793     'description' => 'Notes section for LaTeX typeset PostScript invoices.',
794     'type'        => 'textarea',
795   },
796
797   {
798     'key'         => 'invoice_latexfooter',
799     'section'     => 'billing',
800     'description' => 'Footer for LaTeX typeset PostScript invoices.',
801     'type'        => 'textarea',
802   },
803
804   {
805     'key'         => 'invoice_latexreturnaddress',
806     'section'     => 'billing',
807     'description' => 'Return address for LaTeX typeset PostScript invoices.',
808     'type'        => 'textarea',
809   },
810
811   {
812     'key'         => 'invoice_latexsmallfooter',
813     'section'     => 'billing',
814     'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
815     'type'        => 'textarea',
816   },
817
818   {
819     'key'         => 'invoice_email_pdf',
820     'section'     => 'billing',
821     '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.',
822     'type'        => 'checkbox'
823   },
824
825   {
826     'key'         => 'invoice_email_pdf_note',
827     'section'     => 'billing',
828     'description' => 'If defined, this text will replace the default plain text invoice as the body of emailed PDF invoices.',
829     'type'        => 'textarea'
830   },
831
832
833   { 
834     'key'         => 'invoice_default_terms',
835     'section'     => 'billing',
836     'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
837     'type'        => 'select',
838     'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 30', 'Net 45', 'Net 60' ],
839   },
840
841   {
842     'key'         => 'payment_receipt_email',
843     'section'     => 'billing',
844     '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/~mjd/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</ul>',
845     'type'        => [qw( checkbox textarea )],
846   },
847
848   {
849     'key'         => 'lpr',
850     'section'     => 'required',
851     'description' => 'Print command for paper invoices, for example `lpr -h\'',
852     'type'        => 'text',
853   },
854
855   {
856     'key'         => 'lpr-postscript_prefix',
857     'section'     => 'billing',
858     'description' => 'Raw printer commands prepended to the beginning of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
859     'type'        => 'text',
860   },
861
862   {
863     'key'         => 'lpr-postscript_suffix',
864     'section'     => 'billing',
865     'description' => 'Raw printer commands added to the end of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
866     'type'        => 'text',
867   },
868
869   {
870     'key'         => 'money_char',
871     'section'     => '',
872     'description' => 'Currency symbol - defaults to `$\'',
873     'type'        => 'text',
874   },
875
876   {
877     'key'         => 'defaultrecords',
878     'section'     => 'BIND',
879     'description' => 'DNS entries to add automatically when creating a domain',
880     'type'        => 'editlist',
881     'editlist_parts' => [ { type=>'text' },
882                           { type=>'immutable', value=>'IN' },
883                           { type=>'select',
884                             select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS TXT)} },
885                           { type=> 'text' }, ],
886   },
887
888   {
889     'key'         => 'passwordmin',
890     'section'     => 'password',
891     'description' => 'Minimum password length (default 6)',
892     'type'        => 'text',
893   },
894
895   {
896     'key'         => 'passwordmax',
897     'section'     => 'password',
898     'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
899     'type'        => 'text',
900   },
901
902   {
903     'key' => 'password-noampersand',
904     'section' => 'password',
905     'description' => 'Disallow ampersands in passwords',
906     'type' => 'checkbox',
907   },
908
909   {
910     'key' => 'password-noexclamation',
911     'section' => 'password',
912     'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
913     'type' => 'checkbox',
914   },
915
916   {
917     'key'         => 'referraldefault',
918     'section'     => 'UI',
919     'description' => 'Default referral, specified by refnum',
920     'type'        => 'text',
921   },
922
923 #  {
924 #    'key'         => 'registries',
925 #    'section'     => 'required',
926 #    'description' => 'Directory which contains domain registry information.  Each registry is a directory.',
927 #  },
928
929   {
930     'key'         => 'maxsearchrecordsperpage',
931     'section'     => 'UI',
932     'description' => 'If set, number of search records to return per page.',
933     'type'        => 'text',
934   },
935
936   {
937     'key'         => 'session-start',
938     'section'     => 'session',
939     '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.',
940     'type'        => 'text',
941   },
942
943   {
944     'key'         => 'session-stop',
945     'section'     => 'session',
946     '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.',
947     'type'        => 'text',
948   },
949
950   {
951     'key'         => 'shells',
952     'section'     => 'required',
953     '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.',
954     'type'        => 'textarea',
955   },
956
957   {
958     'key'         => 'showpasswords',
959     'section'     => 'UI',
960     'description' => 'Display unencrypted user passwords in the backend (employee) web interface',
961     'type'        => 'checkbox',
962   },
963
964   {
965     'key'         => 'signupurl',
966     'section'     => 'UI',
967     'description' => 'if you are using customer-to-customer referrals, and you enter the URL of your <a href="http://www.sisd.com/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',
968     'type'        => 'text',
969   },
970
971   {
972     'key'         => 'smtpmachine',
973     'section'     => 'required',
974     'description' => 'SMTP relay for Freeside\'s outgoing mail',
975     'type'        => 'text',
976   },
977
978   {
979     'key'         => 'soadefaultttl',
980     'section'     => 'BIND',
981     'description' => 'SOA default TTL for new domains.',
982     'type'        => 'text',
983   },
984
985   {
986     'key'         => 'soaemail',
987     'section'     => 'BIND',
988     'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
989     'type'        => 'text',
990   },
991
992   {
993     'key'         => 'soaexpire',
994     'section'     => 'BIND',
995     'description' => 'SOA expire for new domains',
996     'type'        => 'text',
997   },
998
999   {
1000     'key'         => 'soamachine',
1001     'section'     => 'BIND',
1002     'description' => 'SOA machine for new domains, with trailing `.\'',
1003     'type'        => 'text',
1004   },
1005
1006   {
1007     'key'         => 'soarefresh',
1008     'section'     => 'BIND',
1009     'description' => 'SOA refresh for new domains',
1010     'type'        => 'text',
1011   },
1012
1013   {
1014     'key'         => 'soaretry',
1015     'section'     => 'BIND',
1016     'description' => 'SOA retry for new domains',
1017     'type'        => 'text',
1018   },
1019
1020   {
1021     'key'         => 'statedefault',
1022     'section'     => 'UI',
1023     'description' => 'Default state or province (if not supplied, the default is `CA\')',
1024     'type'        => 'text',
1025   },
1026
1027   {
1028     'key'         => 'unsuspendauto',
1029     'section'     => 'billing',
1030     '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',
1031     'type'        => 'checkbox',
1032   },
1033
1034   {
1035     'key'         => 'unsuspend-always_adjust_next_bill_date',
1036     'section'     => 'billing',
1037     '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.',
1038     'type'        => 'checkbox',
1039   },
1040
1041   {
1042     'key'         => 'usernamemin',
1043     'section'     => 'username',
1044     'description' => 'Minimum username length (default 2)',
1045     'type'        => 'text',
1046   },
1047
1048   {
1049     'key'         => 'usernamemax',
1050     'section'     => 'username',
1051     'description' => 'Maximum username length',
1052     'type'        => 'text',
1053   },
1054
1055   {
1056     'key'         => 'username-ampersand',
1057     'section'     => 'username',
1058     '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.',
1059     'type'        => 'checkbox',
1060   },
1061
1062   {
1063     'key'         => 'username-letter',
1064     'section'     => 'username',
1065     'description' => 'Usernames must contain at least one letter',
1066     'type'        => 'checkbox',
1067   },
1068
1069   {
1070     'key'         => 'username-letterfirst',
1071     'section'     => 'username',
1072     'description' => 'Usernames must start with a letter',
1073     'type'        => 'checkbox',
1074   },
1075
1076   {
1077     'key'         => 'username-noperiod',
1078     'section'     => 'username',
1079     'description' => 'Disallow periods in usernames',
1080     'type'        => 'checkbox',
1081   },
1082
1083   {
1084     'key'         => 'username-nounderscore',
1085     'section'     => 'username',
1086     'description' => 'Disallow underscores in usernames',
1087     'type'        => 'checkbox',
1088   },
1089
1090   {
1091     'key'         => 'username-nodash',
1092     'section'     => 'username',
1093     'description' => 'Disallow dashes in usernames',
1094     'type'        => 'checkbox',
1095   },
1096
1097   {
1098     'key'         => 'username-uppercase',
1099     'section'     => 'username',
1100     'description' => 'Allow uppercase characters in usernames.  Not recommended for use with FreeRADIUS with MySQL backend, which is case-insensitive by default.',
1101     'type'        => 'checkbox',
1102   },
1103
1104   { 
1105     'key'         => 'username-percent',
1106     'section'     => 'username',
1107     'description' => 'Allow the percent character (%) in usernames.',
1108     'type'        => 'checkbox',
1109   },
1110
1111   {
1112     'key'         => 'safe-part_bill_event',
1113     'section'     => 'UI',
1114     'description' => 'Validates invoice event expressions against a preset list.  Useful for webdemos, annoying to powerusers.',
1115     'type'        => 'checkbox',
1116   },
1117
1118   {
1119     'key'         => 'show_ss',
1120     'section'     => 'UI',
1121     'description' => 'Turns on display/collection of social security numbers in the web interface.  Sometimes required by electronic check (ACH) processors.',
1122     'type'        => 'checkbox',
1123   },
1124
1125   {
1126     'key'         => 'show_stateid',
1127     'section'     => 'UI',
1128     'description' => "Turns on display/collection of driver's license/state issued id numbers in the web interface.  Sometimes required by electronic check (ACH) processors.",
1129     'type'        => 'checkbox',
1130   },
1131
1132   {
1133     'key'         => 'show_bankstate',
1134     'section'     => 'UI',
1135     'description' => "Turns on display/collection of state for bank accounts in the web interface.  Sometimes required by electronic check (ACH) processors.",
1136     'type'        => 'checkbox',
1137   },
1138
1139   { 
1140     'key'         => 'agent_defaultpkg',
1141     'section'     => 'UI',
1142     'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
1143     'type'        => 'checkbox',
1144   },
1145
1146   {
1147     'key'         => 'legacy_link',
1148     'section'     => 'UI',
1149     'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
1150     'type'        => 'checkbox',
1151   },
1152
1153   {
1154     'key'         => 'legacy_link-steal',
1155     'section'     => 'UI',
1156     'description' => 'Allow "stealing" an already-audited service from one customer (or package) to another using the link function.',
1157     'type'        => 'checkbox',
1158   },
1159
1160   {
1161     'key'         => 'queue_dangerous_controls',
1162     'section'     => 'UI',
1163     '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.',
1164     'type'        => 'checkbox',
1165   },
1166
1167   {
1168     'key'         => 'security_phrase',
1169     'section'     => 'password',
1170     'description' => 'Enable the tracking of a "security phrase" with each account.  Not recommended, as it is vulnerable to social engineering.',
1171     'type'        => 'checkbox',
1172   },
1173
1174   {
1175     'key'         => 'locale',
1176     'section'     => 'UI',
1177     'description' => 'Message locale',
1178     'type'        => 'select',
1179     'select_enum' => [ qw(en_US) ],
1180   },
1181
1182   {
1183     'key'         => 'signup_server-payby',
1184     'section'     => '',
1185     'description' => 'Acceptable payment types for the signup server',
1186     'type'        => 'selectmultiple',
1187     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
1188   },
1189
1190   {
1191     'key'         => 'signup_server-default_agentnum',
1192     'section'     => '',
1193     'description' => 'Default agent for the signup server',
1194     'type'        => 'select-sub',
1195     'options_sub' => sub { require FS::Record;
1196                            require FS::agent;
1197                            map { $_->agentnum => $_->agent }
1198                                FS::Record::qsearch('agent', { disabled=>'' } );
1199                          },
1200     'option_sub'  => sub { require FS::Record;
1201                            require FS::agent;
1202                            my $agent = FS::Record::qsearchs(
1203                              'agent', { 'agentnum'=>shift }
1204                            );
1205                            $agent ? $agent->agent : '';
1206                          },
1207   },
1208
1209   {
1210     'key'         => 'signup_server-default_refnum',
1211     'section'     => '',
1212     'description' => 'Default advertising source for the signup server',
1213     'type'        => 'select-sub',
1214     'options_sub' => sub { require FS::Record;
1215                            require FS::part_referral;
1216                            map { $_->refnum => $_->referral }
1217                                FS::Record::qsearch( 'part_referral', 
1218                                                     { 'disabled' => '' }
1219                                                   );
1220                          },
1221     'option_sub'  => sub { require FS::Record;
1222                            require FS::part_referral;
1223                            my $part_referral = FS::Record::qsearchs(
1224                              'part_referral', { 'refnum'=>shift } );
1225                            $part_referral ? $part_referral->referral : '';
1226                          },
1227   },
1228
1229   {
1230     'key'         => 'signup_server-default_pkgpart',
1231     'section'     => '',
1232     'description' => 'Default pakcage for the signup server',
1233     'type'        => 'select-sub',
1234     'options_sub' => sub { require FS::Record;
1235                            require FS::part_pkg;
1236                            map { $_->pkgpart => $_->pkg.' - '.$_->comment }
1237                                FS::Record::qsearch( 'part_pkg',
1238                                                     { 'disabled' => ''}
1239                                                   );
1240                          },
1241     'option_sub'  => sub { require FS::Record;
1242                            require FS::part_pkg;
1243                            my $part_pkg = FS::Record::qsearchs(
1244                              'part_pkg', { 'pkgpart'=>shift }
1245                            );
1246                            $part_pkg
1247                              ? $part_pkg->pkg.' - '.$part_pkg->comment
1248                              : '';
1249                          },
1250   },
1251
1252   {
1253     'key'         => 'show-msgcat-codes',
1254     'section'     => 'UI',
1255     'description' => 'Show msgcat codes in error messages.  Turn this option on before reporting errors to the mailing list.',
1256     'type'        => 'checkbox',
1257   },
1258
1259   {
1260     'key'         => 'signup_server-realtime',
1261     'section'     => '',
1262     'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
1263     'type'        => 'checkbox',
1264   },
1265   {
1266     'key'         => 'signup_server-classnum2',
1267     'section'     => '',
1268     'description' => 'Package Class for first optional purchase',
1269     'type'        => 'select-sub',
1270     'options_sub' => sub { require FS::Record;
1271                            require FS::pkg_class;
1272                            map { $_->classnum => $_->classname }
1273                                FS::Record::qsearch('pkg_class', {} );
1274                          },
1275     'option_sub'  => sub { require FS::Record;
1276                            require FS::pkg_class;
1277                            my $pkg_class = FS::Record::qsearchs(
1278                              'pkg_class', { 'classnum'=>shift }
1279                            );
1280                            $pkg_class ? $pkg_class->classname : '';
1281                          },
1282   },
1283
1284   {
1285     'key'         => 'signup_server-classnum3',
1286     'section'     => '',
1287     'description' => 'Package Class for second optional purchase',
1288     'type'        => 'select-sub',
1289     'options_sub' => sub { require FS::Record;
1290                            require FS::pkg_class;
1291                            map { $_->classnum => $_->classname }
1292                                FS::Record::qsearch('pkg_class', {} );
1293                          },
1294     'option_sub'  => sub { require FS::Record;
1295                            require FS::pkg_class;
1296                            my $pkg_class = FS::Record::qsearchs(
1297                              'pkg_class', { 'classnum'=>shift }
1298                            );
1299                            $pkg_class ? $pkg_class->classname : '';
1300                          },
1301   },
1302
1303   {
1304     'key'         => 'backend-realtime',
1305     'section'     => '',
1306     'description' => 'Run billing for backend signups immediately.',
1307     'type'        => 'checkbox',
1308   },
1309
1310   {
1311     'key'         => 'declinetemplate',
1312     'section'     => 'billing',
1313     'description' => 'Template file for credit card decline emails.',
1314     'type'        => 'textarea',
1315   },
1316
1317   {
1318     'key'         => 'emaildecline',
1319     'section'     => 'billing',
1320     'description' => 'Enable emailing of credit card decline notices.',
1321     'type'        => 'checkbox',
1322   },
1323
1324   {
1325     'key'         => 'emaildecline-exclude',
1326     'section'     => 'billing',
1327     'description' => 'List of error messages that should not trigger email decline notices, one per line.',
1328     'type'        => 'textarea',
1329   },
1330
1331   {
1332     'key'         => 'cancelmessage',
1333     'section'     => 'billing',
1334     'description' => 'Template file for cancellation emails.',
1335     'type'        => 'textarea',
1336   },
1337
1338   {
1339     'key'         => 'cancelsubject',
1340     'section'     => 'billing',
1341     'description' => 'Subject line for cancellation emails.',
1342     'type'        => 'text',
1343   },
1344
1345   {
1346     'key'         => 'emailcancel',
1347     'section'     => 'billing',
1348     'description' => 'Enable emailing of cancellation notices.  Make sure to fill in the cancelmessage and cancelsubject configuration values as well.',
1349     'type'        => 'checkbox',
1350   },
1351
1352   {
1353     'key'         => 'require_cardname',
1354     'section'     => 'billing',
1355     'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
1356     'type'        => 'checkbox',
1357   },
1358
1359   {
1360     'key'         => 'enable_taxclasses',
1361     'section'     => 'billing',
1362     'description' => 'Enable per-package tax classes',
1363     'type'        => 'checkbox',
1364   },
1365
1366   {
1367     'key'         => 'require_taxclasses',
1368     'section'     => 'billing',
1369     'description' => 'Require a taxclass to be entered for every package',
1370     'type'        => 'checkbox',
1371   },
1372
1373   {
1374     'key'         => 'welcome_email',
1375     'section'     => '',
1376     '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/~mjd/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>',
1377     'type'        => 'textarea',
1378     'per_agent'   => 1,
1379   },
1380
1381   {
1382     'key'         => 'welcome_email-from',
1383     'section'     => '',
1384     'description' => 'From: address header for welcome email',
1385     'type'        => 'text',
1386     'per_agent'   => 1,
1387   },
1388
1389   {
1390     'key'         => 'welcome_email-subject',
1391     'section'     => '',
1392     'description' => 'Subject: header for welcome email',
1393     'type'        => 'text',
1394     'per_agent'   => 1,
1395   },
1396   
1397   {
1398     'key'         => 'welcome_email-mimetype',
1399     'section'     => '',
1400     'description' => 'MIME type for welcome email',
1401     'type'        => 'select',
1402     'select_enum' => [ 'text/plain', 'text/html' ],
1403     'per_agent'   => 1,
1404   },
1405
1406   {
1407     'key'         => 'welcome_letter',
1408     'section'     => '',
1409     '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/~mjd/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>',
1410     'type'        => 'textarea',
1411   },
1412
1413   {
1414     'key'         => 'warning_email',
1415     'section'     => '',
1416     '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/~mjd/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>',
1417     'type'        => 'textarea',
1418   },
1419
1420   {
1421     'key'         => 'warning_email-from',
1422     'section'     => '',
1423     'description' => 'From: address header for warning email',
1424     'type'        => 'text',
1425   },
1426
1427   {
1428     'key'         => 'warning_email-cc',
1429     'section'     => '',
1430     'description' => 'Additional recipient(s) (comma separated) for warning email when remaining usage reaches zero.',
1431     'type'        => 'text',
1432   },
1433
1434   {
1435     'key'         => 'warning_email-subject',
1436     'section'     => '',
1437     'description' => 'Subject: header for warning email',
1438     'type'        => 'text',
1439   },
1440   
1441   {
1442     'key'         => 'warning_email-mimetype',
1443     'section'     => '',
1444     'description' => 'MIME type for warning email',
1445     'type'        => 'select',
1446     'select_enum' => [ 'text/plain', 'text/html' ],
1447   },
1448
1449   {
1450     'key'         => 'payby',
1451     'section'     => 'billing',
1452     'description' => 'Available payment types.',
1453     'type'        => 'selectmultiple',
1454     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP) ],
1455   },
1456
1457   {
1458     'key'         => 'payby-default',
1459     'section'     => 'UI',
1460     'description' => 'Default payment type.  HIDE disables display of billing information and sets customers to BILL.',
1461     'type'        => 'select',
1462     'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP HIDE) ],
1463   },
1464
1465   {
1466     'key'         => 'paymentforcedtobatch',
1467     'section'     => 'UI',
1468     'description' => 'Causes per customer payment entry to be forced to a batch processor rather than performed realtime.',
1469     'type'        => 'checkbox',
1470   },
1471
1472   {
1473     'key'         => 'svc_acct-notes',
1474     'section'     => 'UI',
1475     'description' => 'Extra HTML to be displayed on the Account View screen.',
1476     'type'        => 'textarea',
1477   },
1478
1479   {
1480     'key'         => 'radius-password',
1481     'section'     => '',
1482     'description' => 'RADIUS attribute for plain-text passwords.',
1483     'type'        => 'select',
1484     'select_enum' => [ 'Password', 'User-Password' ],
1485   },
1486
1487   {
1488     'key'         => 'radius-ip',
1489     'section'     => '',
1490     'description' => 'RADIUS attribute for IP addresses.',
1491     'type'        => 'select',
1492     'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
1493   },
1494
1495   {
1496     'key'         => 'svc_acct-alldomains',
1497     'section'     => '',
1498     '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.',
1499     'type'        => 'checkbox',
1500   },
1501
1502   {
1503     'key'         => 'dump-scpdest',
1504     'section'     => '',
1505     'description' => 'destination for scp database dumps: user@host:/path',
1506     'type'        => 'text',
1507   },
1508
1509   {
1510     'key'         => 'dump-pgpid',
1511     'section'     => '',
1512     '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.",
1513     'type'        => 'text',
1514   },
1515
1516   {
1517     'key'         => 'cvv-save',
1518     'section'     => 'billing',
1519     '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.',
1520     'type'        => 'selectmultiple',
1521     'select_enum' => \@card_types,
1522   },
1523
1524   {
1525     'key'         => 'allow_negative_charges',
1526     'section'     => 'billing',
1527     'description' => 'Allow negative charges.  Normally not used unless importing data from a legacy system that requires this.',
1528     'type'        => 'checkbox',
1529   },
1530   {
1531       'key'         => 'auto_unset_catchall',
1532       'section'     => '',
1533       '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.',
1534       'type'        => 'checkbox',
1535   },
1536
1537   {
1538     'key'         => 'system_usernames',
1539     'section'     => 'username',
1540     '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.',
1541     'type'        => 'textarea',
1542   },
1543
1544   {
1545     'key'         => 'cust_pkg-change_svcpart',
1546     'section'     => '',
1547     'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
1548     'type'        => 'checkbox',
1549   },
1550
1551   {
1552     'key'         => 'disable_autoreverse',
1553     'section'     => 'BIND',
1554     'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
1555     'type'        => 'checkbox',
1556   },
1557
1558   {
1559     'key'         => 'svc_www-enable_subdomains',
1560     'section'     => '',
1561     'description' => 'Enable selection of specific subdomains for virtual host creation.',
1562     'type'        => 'checkbox',
1563   },
1564
1565   {
1566     'key'         => 'svc_www-usersvc_svcpart',
1567     'section'     => '',
1568     'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
1569     'type'        => 'textarea',
1570   },
1571
1572   {
1573     'key'         => 'selfservice_server-primary_only',
1574     'section'     => '',
1575     'description' => 'Only allow primary accounts to access self-service functionality.',
1576     'type'        => 'checkbox',
1577   },
1578
1579   {
1580     'key'         => 'card_refund-days',
1581     'section'     => 'billing',
1582     'description' => 'After a payment, the number of days a refund link will be available for that payment.  Defaults to 120.',
1583     'type'        => 'text',
1584   },
1585
1586   {
1587     'key'         => 'agent-showpasswords',
1588     'section'     => '',
1589     'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
1590     'type'        => 'checkbox',
1591   },
1592
1593   {
1594     'key'         => 'global_unique-username',
1595     'section'     => 'username',
1596     '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.',
1597     'type'        => 'select',
1598     'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
1599   },
1600
1601   {
1602     'key'         => 'svc_external-skip_manual',
1603     'section'     => 'UI',
1604     '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).',
1605     'type'        => 'checkbox',
1606   },
1607
1608   {
1609     'key'         => 'svc_external-display_type',
1610     'section'     => 'UI',
1611     'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
1612     'type'        => 'select',
1613     'select_enum' => [ 'generic', 'artera_turbo', ],
1614   },
1615
1616   {
1617     'key'         => 'ticket_system',
1618     'section'     => '',
1619     'description' => 'Ticketing system integration.  <b>RT_Internal</b> uses the built-in RT ticketing system (see the <a href="http://www.sisd.com/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).',
1620     'type'        => 'select',
1621     #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
1622     'select_enum' => [ '', qw(RT_Internal RT_External) ],
1623   },
1624
1625   {
1626     'key'         => 'ticket_system-default_queueid',
1627     'section'     => '',
1628     'description' => 'Default queue used when creating new customer tickets.',
1629     'type'        => 'select-sub',
1630     'options_sub' => sub {
1631                            my $conf = new FS::Conf;
1632                            if ( $conf->config('ticket_system') ) {
1633                              eval "use FS::TicketSystem;";
1634                              die $@ if $@;
1635                              FS::TicketSystem->queues();
1636                            } else {
1637                              ();
1638                            }
1639                          },
1640     'option_sub'  => sub { 
1641                            my $conf = new FS::Conf;
1642                            if ( $conf->config('ticket_system') ) {
1643                              eval "use FS::TicketSystem;";
1644                              die $@ if $@;
1645                              FS::TicketSystem->queue(shift);
1646                            } else {
1647                              '';
1648                            }
1649                          },
1650   },
1651
1652   {
1653     'key'         => 'ticket_system-priority_reverse',
1654     'section'     => '',
1655     '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.',
1656     'type'        => 'checkbox',
1657   },
1658
1659   {
1660     'key'         => 'ticket_system-custom_priority_field',
1661     'section'     => '',
1662     'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
1663     'type'        => 'text',
1664   },
1665
1666   {
1667     'key'         => 'ticket_system-custom_priority_field-values',
1668     'section'     => '',
1669     'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
1670     'type'        => 'textarea',
1671   },
1672
1673   {
1674     'key'         => 'ticket_system-custom_priority_field_queue',
1675     'section'     => '',
1676     'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
1677     'type'        => 'text',
1678   },
1679
1680   {
1681     'key'         => 'ticket_system-rt_external_datasrc',
1682     'section'     => '',
1683     '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>',
1684     'type'        => 'text',
1685
1686   },
1687
1688   {
1689     'key'         => 'ticket_system-rt_external_url',
1690     'section'     => '',
1691     'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
1692     'type'        => 'text',
1693   },
1694
1695   {
1696     'key'         => 'company_name',
1697     'section'     => 'required',
1698     'description' => 'Your company name',
1699     'type'        => 'text',
1700   },
1701
1702   {
1703     'key'         => 'address2-search',
1704     'section'     => 'UI',
1705     'description' => 'Enable a "Unit" search box which searches the second address field',
1706     'type'        => 'checkbox',
1707   },
1708
1709   { 'key'         => 'referral_credit',
1710     'section'     => 'billing',
1711     'description' => "Enables one-time referral credits in the amount of one month <i>referred</i> customer's recurring fee (irregardless of frequency).",
1712     'type'        => 'checkbox',
1713   },
1714
1715   { 'key'         => 'selfservice_server-cache_module',
1716     'section'     => '',
1717     '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.',
1718     'type'        => 'select',
1719     'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
1720   },
1721
1722   {
1723     'key'         => 'hylafax',
1724     'section'     => '',
1725     '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).',
1726     'type'        => [qw( checkbox textarea )],
1727   },
1728
1729   {
1730     'key'         => 'svc_acct-usage_suspend',
1731     'section'     => 'billing',
1732     '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.',
1733     'type'        => 'checkbox',
1734   },
1735
1736   {
1737     'key'         => 'svc_acct-usage_unsuspend',
1738     'section'     => 'billing',
1739     '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.',
1740     'type'        => 'checkbox',
1741   },
1742
1743   {
1744     'key'         => 'svc_acct-usage_threshold',
1745     'section'     => 'billing',
1746     '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.  Defaults to 80.',
1747     'type'        => 'text',
1748   },
1749
1750   {
1751     'key'         => 'cust-fields',
1752     'section'     => 'UI',
1753     'description' => 'Which customer fields to display on reports by default',
1754     'type'        => 'select',
1755     'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
1756   },
1757
1758   {
1759     'key'         => 'cust_pkg-display_times',
1760     'section'     => 'UI',
1761     'description' => 'Display full timestamps (not just dates) for customer packages.  Useful if you are doing real-time things like hourly prepaid.',
1762     'type'        => 'checkbox',
1763   },
1764
1765   {
1766     'key'         => 'svc_acct-edit_uid',
1767     'section'     => 'shell',
1768     'description' => 'Allow UID editing.',
1769     'type'        => 'checkbox',
1770   },
1771
1772   {
1773     'key'         => 'svc_acct-edit_gid',
1774     'section'     => 'shell',
1775     'description' => 'Allow GID editing.',
1776     'type'        => 'checkbox',
1777   },
1778
1779   {
1780     'key'         => 'zone-underscore',
1781     'section'     => 'BIND',
1782     'description' => 'Allow underscores in zone names.  As underscores are illegal characters in zone names, this option is not recommended.',
1783     'type'        => 'checkbox',
1784   },
1785
1786   {
1787     'key'         => 'echeck-nonus',
1788     'section'     => 'billing',
1789     'description' => 'Disable ABA-format account checking for Electronic Check payment info',
1790     'type'        => 'checkbox',
1791   },
1792
1793   {
1794     'key'         => 'voip-cust_cdr_spools',
1795     'section'     => '',
1796     'description' => 'Enable the per-customer option for individual CDR spools.',
1797     'type'        => 'checkbox',
1798   },
1799
1800   {
1801     'key'         => 'svc_forward-arbitrary_dst',
1802     'section'     => '',
1803     '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.",
1804     'type'        => 'checkbox',
1805   },
1806
1807   {
1808     'key'         => 'tax-ship_address',
1809     'section'     => 'billing',
1810     'description' => 'By default, tax calculations are done based on the billing address.  Enable this switch to calculate tax based on the shipping address instead.  Note: Tax reports can take a long time when enabled.',
1811     'type'        => 'checkbox',
1812   },
1813
1814   {
1815     'key'         => 'batch-enable',
1816     'section'     => 'billing',
1817     'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
1818     'type'        => 'checkbox',
1819   },
1820
1821   {
1822     'key'         => 'batch-default_format',
1823     'section'     => 'billing',
1824     'description' => 'Default format for batches.',
1825     'type'        => 'select',
1826     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch',
1827                        'csv-chase_canada-E-xactBatch', 'BoM', 'PAP',
1828                        'ach-spiritone',
1829                     ]
1830   },
1831
1832   {
1833     'key'         => 'batch-fixed_format-CARD',
1834     'section'     => 'billing',
1835     'description' => 'Fixed (unchangeable) format for credit card batches.',
1836     'type'        => 'select',
1837     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
1838                        'csv-chase_canada-E-xactBatch', 'BoM', 'PAP' ]
1839   },
1840
1841   {
1842     'key'         => 'batch-fixed_format-CHEK',
1843     'section'     => 'billing',
1844     'description' => 'Fixed (unchangeable) format for electronic check batches.',
1845     'type'        => 'select',
1846     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP',
1847                        'ach-spiritone',
1848                      ]
1849   },
1850
1851   {
1852     'key'         => 'batch-increment_expiration',
1853     'section'     => 'billing',
1854     'description' => 'Increment expiration date years in batches until cards are current.  Make sure this is acceptable to your batching provider before enabling.',
1855     'type'        => 'checkbox'
1856   },
1857
1858   {
1859     'key'         => 'batchconfig-BoM',
1860     'section'     => 'billing',
1861     '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',
1862     'type'        => 'textarea',
1863   },
1864
1865   {
1866     'key'         => 'batchconfig-PAP',
1867     'section'     => 'billing',
1868     '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',
1869     'type'        => 'textarea',
1870   },
1871
1872   {
1873     'key'         => 'batchconfig-csv-chase_canada-E-xactBatch',
1874     'section'     => 'billing',
1875     'description' => 'Gateway ID for Chase Canada E-xact batching',
1876     'type'        => 'text',
1877   },
1878
1879   {
1880     'key'         => 'payment_history-years',
1881     'section'     => 'UI',
1882     'description' => 'Number of years of payment history to show by default.  Currently defaults to 2.',
1883     'type'        => 'text',
1884   },
1885
1886   {
1887     'key'         => 'cust_main-use_comments',
1888     'section'     => 'UI',
1889     'description' => 'Display free form comments on the customer edit screen.  Useful as a scratch pad.',
1890     'type'        => 'checkbox',
1891   },
1892
1893   {
1894     'key'         => 'cust_main-disable_notes',
1895     'section'     => 'UI',
1896     'description' => 'Disable new style customer notes - timestamped and user identified customer notes.  Useful in tracking who did what.',
1897     'type'        => 'checkbox',
1898   },
1899
1900   {
1901     'key'         => 'cust_main_note-display_times',
1902     'section'     => 'UI',
1903     'description' => 'Display full timestamps (not just dates) for customer notes.',
1904     'type'        => 'checkbox',
1905   },
1906
1907   {
1908     'key'         => 'cust_main-ticket_statuses',
1909     'section'     => 'UI',
1910     'description' => 'Show tickets with these statuses on the customer view page.',
1911     'type'        => 'selectmultiple',
1912     'select_enum' => [qw( new open stalled resolved rejected deleted )],
1913   },
1914
1915   {
1916     'key'         => 'cust_main-max_tickets',
1917     'section'     => 'UI',
1918     'description' => 'Maximum number of tickets to show on the customer view page.',
1919     'type'        => 'text',
1920   },
1921
1922   {
1923     'key'         => 'cust_main-skeleton_tables',
1924     'section'     => '',
1925     '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.',
1926     'type'        => 'textarea',
1927   },
1928
1929   {
1930     'key'         => 'cust_main-skeleton_custnum',
1931     'section'     => '',
1932     'description' => 'Customer number specifying the source data to copy into skeleton tables for new customers.',
1933     'type'        => 'text',
1934   },
1935
1936   {
1937     'key'         => 'cust_main-enable_birthdate',
1938     'section'     => 'UI',
1939     'descritpion' => 'Enable tracking of a birth date with each customer record',
1940     'type'        => 'checkbox',
1941   },
1942
1943   {
1944     'key'         => 'support-key',
1945     'section'     => '',
1946     '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.',
1947     'type'        => 'text',
1948   },
1949
1950   {
1951     'key'         => 'card-types',
1952     'section'     => 'billing',
1953     'description' => 'Select one or more card types to enable only those card types.  If no card types are selected, all card types are available.',
1954     'type'        => 'selectmultiple',
1955     'select_enum' => \@card_types,
1956   },
1957
1958   {
1959     'key'         => 'disable-fuzzy',
1960     'section'     => 'UI',
1961     'description' => 'Disable fuzzy searching.  Speeds up searching for large sites, but only shows exact matches.',
1962     'type'        => 'checkbox',
1963   },
1964
1965   { 'key'         => 'pkg_referral',
1966     'section'     => '',
1967     'description' => 'Enable package-specific advertising sources.',
1968     'type'        => 'checkbox',
1969   },
1970
1971   { 'key'         => 'pkg_referral-multiple',
1972     'section'     => '',
1973     'description' => 'In addition, allow multiple advertising sources to be associated with a single package.',
1974     'type'        => 'checkbox',
1975   },
1976
1977   {
1978     'key'         => 'dashboard-toplist',
1979     'section'     => 'UI',
1980     'description' => 'List of items to display on the top of the front page',
1981     'type'        => 'textarea',
1982   },
1983
1984   {
1985     'key'         => 'impending_recur_template',
1986     'section'     => 'billing',
1987     'description' => 'Template file for alerts about looming first time recurrant billing.  See the <a href="http://search.cpan.org/~mjd/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>',
1988 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
1989     'type'        => 'textarea',
1990   },
1991
1992   {
1993     'key'         => 'logo.png',
1994     'section'     => 'billing',  #? 
1995     'description' => 'An image to include in some types of invoices',
1996     'type'        => 'binary',
1997   },
1998
1999   {
2000     'key'         => 'logo.eps',
2001     'section'     => 'billing',  #? 
2002     'description' => 'An image to include in some types of invoices',
2003     'type'        => 'binary',
2004   },
2005
2006   {
2007     'key'         => 'selfservice-ignore_quantity',
2008     'section'     => '',
2009     'description' => 'Ignores service quantity restrictions in self-service context.  Strongly not recommended - just set your quantities correctly in the first place.',
2010     'type'        => 'checkbox',
2011   },
2012
2013   {
2014     'key'         => 'disable_setup_suspended_pkgs',
2015     'section'     => 'billing',
2016     'description' => 'Disables charging of setup fees for suspended packages.',
2017     'type'       => 'checkbox',
2018   },
2019
2020   {
2021     'key' => 'password-generated-allcaps',
2022     'section' => 'password',
2023     'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
2024     'type' => 'checkbox',
2025   },
2026
2027   {
2028     'key'         => 'datavolume-forcemegabytes',
2029     'section'     => 'UI',
2030     'description' => 'All data volumes are expressed in megabytes',
2031     'type'        => 'checkbox',
2032   },
2033
2034   {
2035     'key'         => 'datavolume-significantdigits',
2036     'section'     => 'UI',
2037     'description' => 'number of significant digits to use to represent data volumes',
2038     'type'        => 'text',
2039   },
2040
2041   {
2042     'key'         => 'disable_void_after',
2043     'section'     => 'billing',
2044     'description' => 'Number of seconds after which freeside won\'t attempt to VOID a payment first when performing a refund.',
2045     'type'        => 'text',
2046   },
2047
2048   {
2049     'key'         => 'disable_line_item_date_ranges',
2050     'section'     => 'billing',
2051     'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.',
2052     'type'        => 'checkbox',
2053   },
2054
2055   {
2056     'key'         => 'support_packages',
2057     'section'     => '',
2058     '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...
2059     'type'        => 'textarea',
2060   },
2061
2062   {
2063     'key'         => 'cust_main-require_phone',
2064     'section'     => '',
2065     'description' => 'Require daytime or night for all customer records.',
2066     'type'        => 'checkbox',
2067   },
2068
2069   {
2070     'key'         => 'cust_main-require_invoicing_list_email',
2071     'section'     => '',
2072     'description' => 'Require at least one invoicing email address for all customer records.',
2073     'type'        => 'checkbox',
2074   },
2075
2076   {
2077     'key'         => 'svc_acct-display_paid_time_remaining',
2078     'section'     => '',
2079     'description' => 'Show paid time remaining in addition to time remaining.',
2080     'type'        => 'checkbox',
2081   },
2082
2083 );
2084
2085 1;