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