add signup server default package
[freeside.git] / FS / FS / Conf.pm
1 package FS::Conf;
2
3 use vars qw($default_dir @config_items $DEBUG );
4 use IO::File;
5 use File::Basename;
6 use FS::ConfItem;
7 use FS::ConfDefaults;
8
9 $DEBUG = 0;
10
11 =head1 NAME
12
13 FS::Conf - Freeside configuration values
14
15 =head1 SYNOPSIS
16
17   use FS::Conf;
18
19   $conf = new FS::Conf "/config/directory";
20
21   $FS::Conf::default_dir = "/config/directory";
22   $conf = new FS::Conf;
23
24   $dir = $conf->dir;
25
26   $value = $conf->config('key');
27   @list  = $conf->config('key');
28   $bool  = $conf->exists('key');
29
30   $conf->touch('key');
31   $conf->set('key' => 'value');
32   $conf->delete('key');
33
34   @config_items = $conf->config_items;
35
36 =head1 DESCRIPTION
37
38 Read and write Freeside configuration values.  Keys currently map to filenames,
39 but this may change in the future.
40
41 =head1 METHODS
42
43 =over 4
44
45 =item new [ DIRECTORY ]
46
47 Create a new configuration object.  A directory arguement is required if
48 $FS::Conf::default_dir has not been set.
49
50 =cut
51
52 sub new {
53   my($proto,$dir) = @_;
54   my($class) = ref($proto) || $proto;
55   my($self) = { 'dir' => $dir || $default_dir } ;
56   bless ($self, $class);
57 }
58
59 =item dir
60
61 Returns the directory.
62
63 =cut
64
65 sub dir {
66   my($self) = @_;
67   my $dir = $self->{dir};
68   -e $dir or die "FATAL: $dir doesn't exist!";
69   -d $dir or die "FATAL: $dir isn't a directory!";
70   -r $dir or die "FATAL: Can't read $dir!";
71   -x $dir or die "FATAL: $dir not searchable (executable)!";
72   $dir =~ /^(.*)$/;
73   $1;
74 }
75
76 =item config KEY
77
78 Returns the configuration value or values (depending on context) for key.
79
80 =cut
81
82 sub config {
83   my($self,$file)=@_;
84   my($dir)=$self->dir;
85   my $fh = new IO::File "<$dir/$file" or return;
86   if ( wantarray ) {
87     map {
88       /^(.*)$/
89         or die "Illegal line (array context) in $dir/$file:\n$_\n";
90       $1;
91     } <$fh>;
92   } else {
93     <$fh> =~ /^(.*)$/
94       or die "Illegal line (scalar context) in $dir/$file:\n$_\n";
95     $1;
96   }
97 }
98
99 =item config_binary KEY
100
101 Returns the exact scalar value for key.
102
103 =cut
104
105 sub config_binary {
106   my($self,$file)=@_;
107   my($dir)=$self->dir;
108   my $fh = new IO::File "<$dir/$file" or return;
109   local $/;
110   my $content = <$fh>;
111   $content;
112 }
113
114 =item exists KEY
115
116 Returns true if the specified key exists, even if the corresponding value
117 is undefined.
118
119 =cut
120
121 sub exists {
122   my($self,$file)=@_;
123   my($dir) = $self->dir;
124   -e "$dir/$file";
125 }
126
127 =item config_orbase KEY SUFFIX
128
129 Returns the configuration value or values (depending on context) for 
130 KEY_SUFFIX, if it exists, otherwise for KEY
131
132 =cut
133
134 sub config_orbase {
135   my( $self, $file, $suffix ) = @_;
136   if ( $self->exists("${file}_$suffix") ) {
137     $self->config("${file}_$suffix");
138   } else {
139     $self->config($file);
140   }
141 }
142
143 =item touch KEY
144
145 Creates the specified configuration key if it does not exist.
146
147 =cut
148
149 sub touch {
150   my($self, $file) = @_;
151   my $dir = $self->dir;
152   unless ( $self->exists($file) ) {
153     warn "[FS::Conf] TOUCH $file\n" if $DEBUG;
154     system('touch', "$dir/$file");
155   }
156 }
157
158 =item set KEY VALUE
159
160 Sets the specified configuration key to the given value.
161
162 =cut
163
164 sub set {
165   my($self, $file, $value) = @_;
166   my $dir = $self->dir;
167   $value =~ /^(.*)$/s;
168   $value = $1;
169   unless ( join("\n", @{[ $self->config($file) ]}) eq $value ) {
170     warn "[FS::Conf] SET $file\n" if $DEBUG;
171 #    warn "$dir" if is_tainted($dir);
172 #    warn "$dir" if is_tainted($file);
173     chmod 0644, "$dir/$file";
174     my $fh = new IO::File ">$dir/$file" or return;
175     chmod 0644, "$dir/$file";
176     print $fh "$value\n";
177   }
178 }
179 #sub is_tainted {
180 #             return ! eval { join('',@_), kill 0; 1; };
181 #         }
182
183 =item delete KEY
184
185 Deletes the specified configuration key.
186
187 =cut
188
189 sub delete {
190   my($self, $file) = @_;
191   my $dir = $self->dir;
192   if ( $self->exists($file) ) {
193     warn "[FS::Conf] DELETE $file\n";
194     unlink "$dir/$file";
195   }
196 }
197
198 =item config_items
199
200 Returns all of the possible configuration items as FS::ConfItem objects.  See
201 L<FS::ConfItem>.
202
203 =cut
204
205 sub config_items {
206   my $self = shift; 
207   #quelle kludge
208   @config_items,
209   ( map { 
210         my $basename = basename($_);
211         $basename =~ /^(.*)$/;
212         $basename = $1;
213         new FS::ConfItem {
214                            'key'         => $basename,
215                            'section'     => 'billing',
216                            'description' => 'Alternate template file for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
217                            'type'        => 'textarea',
218                          }
219       } glob($self->dir. '/invoice_template_*')
220   ),
221   ( map { 
222         my $basename = basename($_);
223         $basename =~ /^(.*)$/;
224         $basename = $1;
225         new FS::ConfItem {
226                            'key'         => $basename,
227                            'section'     => 'billing',
228                            'description' => 'Alternate HTML template for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
229                            'type'        => 'textarea',
230                          }
231       } glob($self->dir. '/invoice_html_*')
232   ),
233   ( map { 
234         my $basename = basename($_);
235         $basename =~ /^(.*)$/;
236         $basename = $1;
237         ($latexname = $basename ) =~ s/latex/html/;
238         new FS::ConfItem {
239                            'key'         => $basename,
240                            'section'     => 'billing',
241                            'description' => "Alternate Notes section for HTML invoices.  Defaults to the same data in $latexname if not specified.",
242                            'type'        => 'textarea',
243                          }
244       } glob($self->dir. '/invoice_htmlnotes_*')
245   ),
246   ( map { 
247         my $basename = basename($_);
248         $basename =~ /^(.*)$/;
249         $basename = $1;
250         new FS::ConfItem {
251                            'key'         => $basename,
252                            'section'     => 'billing',
253                            'description' => 'Alternate LaTeX template for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
254                            'type'        => 'textarea',
255                          }
256       } glob($self->dir. '/invoice_latex_*')
257   ),
258   ( map { 
259         my $basename = basename($_);
260         $basename =~ /^(.*)$/;
261         $basename = $1;
262         new FS::ConfItem {
263                            'key'         => $basename,
264                            'section'     => 'billing',
265                            'description' => 'Alternate Notes section for LaTeX typeset PostScript invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
266                            'type'        => 'textarea',
267                          }
268       } glob($self->dir. '/invoice_latexnotes_*')
269   );
270 }
271
272 =back
273
274 =head1 BUGS
275
276 If this was more than just crud that will never be useful outside Freeside I'd
277 worry that config_items is freeside-specific and icky.
278
279 =head1 SEE ALSO
280
281 "Configuration" in the web interface (config/config.cgi).
282
283 httemplate/docs/config.html
284
285 =cut
286
287 @config_items = map { new FS::ConfItem $_ } (
288
289   {
290     'key'         => 'address',
291     'section'     => 'deprecated',
292     'description' => 'This configuration option is no longer used.  See <a href="#invoice_template">invoice_template</a> instead.',
293     'type'        => 'text',
294   },
295
296   {
297     'key'         => 'alerter_template',
298     'section'     => 'billing',
299     'description' => 'Template file for billing method expiration alerts.  See the <a href="../docs/billing.html#invoice_template">billing documentation</a> for details.',
300     'type'        => 'textarea',
301   },
302
303   {
304     'key'         => 'apacheroot',
305     'section'     => 'deprecated',
306     'description' => '<b>DEPRECATED</b>, add a <i>www_shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead.  The directory containing Apache virtual hosts',
307     'type'        => 'text',
308   },
309
310   {
311     'key'         => 'apacheip',
312     'section'     => 'deprecated',
313     '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',
314     'type'        => 'text',
315   },
316
317   {
318     'key'         => 'apachemachine',
319     'section'     => 'deprecated',
320     'description' => '<b>DEPRECATED</b>, add a <i>www_shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead.  A machine with the apacheroot directory and user home directories.  The existance of this file enables setup of virtual host directories, and, in conjunction with the `home\' configuration file, symlinks into user home directories.',
321     'type'        => 'text',
322   },
323
324   {
325     'key'         => 'apachemachines',
326     'section'     => 'deprecated',
327     'description' => '<b>DEPRECATED</b>, add an <i>apache</i> <a href="../browse/part_export.cgi">export</a> instead.  Used to be Apache machines, one per line.  This enables export of `/etc/apache/vhosts.conf\', which can be included in your Apache configuration via the <a href="http://www.apache.org/docs/mod/core.html#include">Include</a> directive.',
328     'type'        => 'textarea',
329   },
330
331   {
332     'key'         => 'bindprimary',
333     'section'     => 'deprecated',
334     'description' => '<b>DEPRECATED</b>, add a <i>bind</i> <a href="../browse/part_export.cgi">export</a> instead.  Your BIND primary nameserver.  This enables export of /var/named/named.conf and zone files into /var/named',
335     'type'        => 'text',
336   },
337
338   {
339     'key'         => 'bindsecondaries',
340     'section'     => 'deprecated',
341     'description' => '<b>DEPRECATED</b>, add a <i>bind_slave</i> <a href="../browse/part_export.cgi">export</a> instead.  Your BIND secondary nameservers, one per line.  This enables export of /var/named/named.conf',
342     'type'        => 'textarea',
343   },
344
345   {
346     'key'         => 'encryption',
347     'section'     => 'billing',
348     'description' => 'Enable encryption of credit cards.',
349     'type'        => 'checkbox',
350   },
351
352   {
353     'key'         => 'encryptionmodule',
354     'section'     => 'billing',
355     'description' => 'Use which module for encryption?',
356     'type'        => 'text',
357   },
358
359   {
360     'key'         => 'encryptionpublickey',
361     'section'     => 'billing',
362     'description' => 'Your RSA Public Key - Required if Encryption is turned on.',
363     'type'        => 'textarea',
364   },
365
366   {
367     'key'         => 'encryptionprivatekey',
368     'section'     => 'billing',
369     '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.',
370     'type'        => 'textarea',
371   },
372
373   {
374     'key'         => 'business-onlinepayment',
375     'section'     => 'billing',
376     '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.',
377     'type'        => 'textarea',
378   },
379
380   {
381     'key'         => 'business-onlinepayment-ach',
382     'section'     => 'billing',
383     '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.',
384     'type'        => 'textarea',
385   },
386
387   {
388     'key'         => 'business-onlinepayment-description',
389     'section'     => 'billing',
390     '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)',
391     'type'        => 'text',
392   },
393
394   {
395     'key'         => 'business-onlinepayment-email-override',
396     'section'     => 'billing',
397     'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
398     'type'        => 'text',
399   },
400
401   {
402     'key'         => 'bsdshellmachines',
403     'section'     => 'deprecated',
404     'description' => '<b>DEPRECATED</b>, add a <i>bsdshell</i> <a href="../browse/part_export.cgi">export</a> instead.  Your BSD flavored shell (and mail) machines, one per line.  This enables export of `/etc/passwd\' and `/etc/master.passwd\'.',
405     'type'        => 'textarea',
406   },
407
408   {
409     'key'         => 'countrydefault',
410     'section'     => 'UI',
411     'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
412     'type'        => 'text',
413   },
414
415   {
416     'key'         => 'date_format',
417     'section'     => 'UI',
418     'description' => 'Format for displaying dates',
419     'type'        => 'select',
420     'select_hash' => [
421                        '%m/%d/%Y' => 'MM/DD/YYYY',
422                        '%Y/%m/%d' => 'YYYY/MM/DD',
423                      ],
424   },
425
426   {
427     'key'         => 'cyrus',
428     'section'     => 'deprecated',
429     'description' => '<b>DEPRECATED</b>, add a <i>cyrus</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to integrate with <a href="http://asg.web.cmu.edu/cyrus/imapd/">Cyrus IMAP Server</a>, three lines: IMAP server, admin username, and admin password.  Cyrus::IMAP::Admin should be installed locally and the connection to the server secured.',
430     'type'        => 'textarea',
431   },
432
433   {
434     'key'         => 'cp_app',
435     'section'     => 'deprecated',
436     'description' => '<b>DEPRECATED</b>, add a <i>cp</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to integrate with <a href="http://www.cp.net/">Critial Path Account Provisioning Protocol</a>, four lines: "host:port", username, password, and workgroup (for new users).',
437     'type'        => 'textarea',
438   },
439
440   {
441     'key'         => 'deletecustomers',
442     'section'     => 'UI',
443     'description' => 'Enable customer deletions.  Be very careful!  Deleting a customer will remove all traces that this customer ever existed!  It should probably only be used when auditing a legacy database.  Normally, you cancel all of a customers\' packages if they cancel service.',
444     'type'        => 'checkbox',
445   },
446
447   {
448     'key'         => 'deletepayments',
449     'section'     => 'billing',
450     '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.',
451     'type'        => [qw( checkbox text )],
452   },
453
454   {
455     'key'         => 'deletecredits',
456     'section'     => 'deprecated',
457     '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.',
458     'type'        => [qw( checkbox text )],
459   },
460
461   {
462     'key'         => 'unapplypayments',
463     'section'     => 'deprecated',
464     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable "unapplication" of unclosed payments.',
465     'type'        => 'checkbox',
466   },
467
468   {
469     'key'         => 'unapplycredits',
470     'section'     => 'deprecated',
471     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to nable "unapplication" of unclosed credits.',
472     'type'        => 'checkbox',
473   },
474
475   {
476     'key'         => 'dirhash',
477     'section'     => 'shell',
478     '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>',
479     'type'        => 'text',
480   },
481
482   {
483     'key'         => 'disable_customer_referrals',
484     'section'     => 'UI',
485     'description' => 'Disable new customer-to-customer referrals in the web interface',
486     'type'        => 'checkbox',
487   },
488
489   {
490     'key'         => 'editreferrals',
491     'section'     => 'UI',
492     'description' => 'Enable advertising source modification for existing customers',
493     'type'       => 'checkbox',
494   },
495
496   {
497     'key'         => 'emailinvoiceonly',
498     'section'     => 'billing',
499     'description' => 'Disables postal mail invoices',
500     'type'       => 'checkbox',
501   },
502
503   {
504     'key'         => 'disablepostalinvoicedefault',
505     'section'     => 'billing',
506     '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>.',
507     'type'       => 'checkbox',
508   },
509
510   {
511     'key'         => 'emailinvoiceauto',
512     'section'     => 'billing',
513     'description' => 'Automatically adds new accounts to the email invoice list',
514     'type'       => 'checkbox',
515   },
516
517   {
518     'key'         => 'exclude_ip_addr',
519     'section'     => '',
520     'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
521     'type'        => 'textarea',
522   },
523   
524   {
525     'key'         => 'erpcdmachines',
526     'section'     => 'deprecated',
527     'description' => '<b>DEPRECATED</b>, ERPCD is no longer supported.  Used to be ERPCD authentication machines, one per line.  This enables export of `/usr/annex/acp_passwd\' and `/usr/annex/acp_dialup\'',
528     'type'        => 'textarea',
529   },
530
531   {
532     'key'         => 'hidecancelledpackages',
533     'section'     => 'UI',
534     'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
535     'type'        => 'checkbox',
536   },
537
538   {
539     'key'         => 'hidecancelledcustomers',
540     'section'     => 'UI',
541     'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
542     'type'        => 'checkbox',
543   },
544
545   {
546     'key'         => 'home',
547     'section'     => 'required',
548     'description' => 'For new users, prefixed to username to create a directory name.  Should have a leading but not a trailing slash.',
549     'type'        => 'text',
550   },
551
552   {
553     'key'         => 'icradiusmachines',
554     'section'     => 'deprecated',
555     'description' => '<b>DEPRECATED</b>, add an <i>sqlradius</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to enable radcheck and radreply table population - by default in the Freeside database, or in the database specified by the <a href="http://rootwood.haze.st/aspside/config/config-view.cgi#icradius_secrets">icradius_secrets</a> config option (the radcheck and radreply tables needs to be created manually).  You do not need to use MySQL for your Freeside database to export to an ICRADIUS/FreeRADIUS MySQL database with this option.  <blockquote><b>ADDITIONAL DEPRECATED FUNCTIONALITY</b> (instead use <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Replication">MySQL replication</a> or point icradius_secrets to the external database) - your <a href="ftp://ftp.cheapnet.net/pub/icradius">ICRADIUS</a> machines or <a href="http://www.freeradius.org/">FreeRADIUS</a> (with MySQL authentication) machines, one per line.  Machines listed in this file will have the radcheck table exported to them.  Each line should contain four items, separted by whitespace: machine name, MySQL database name, MySQL username, and MySQL password.  For example: <CODE>"radius.isp.tld&nbsp;radius_db&nbsp;radius_user&nbsp;passw0rd"</CODE></blockquote>',
556     'type'        => [qw( checkbox textarea )],
557   },
558
559   {
560     'key'         => 'icradius_mysqldest',
561     'section'     => 'deprecated',
562     'description' => '<b>DEPRECATED</b>, add an <i>sqlradius</i> <a href="../browse/part_export.cgi">export</a> instead.  Used to be the destination directory for the MySQL databases, on the ICRADIUS/FreeRADIUS machines.  Defaults to "/usr/local/var/".',
563     'type'        => 'text',
564   },
565
566   {
567     'key'         => 'icradius_mysqlsource',
568     'section'     => 'deprecated',
569     'description' => '<b>DEPRECATED</b>, add an <i>sqlradius</i> <a href="../browse/part_export.cgi">export</a> instead.  Used to be the source directory for for the MySQL radcheck table files, on the Freeside machine.  Defaults to "/usr/local/var/freeside".',
570     'type'        => 'text',
571   },
572
573   {
574     'key'         => 'icradius_secrets',
575     'section'     => 'deprecated',
576     'description' => '<b>DEPRECATED</b>, add an <i>sqlradius</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to specify a database for ICRADIUS/FreeRADIUS export.  Three lines: DBI data source, username and password.',
577     'type'        => 'textarea',
578   },
579
580   {
581     'key'         => 'invoice_from',
582     'section'     => 'required',
583     'description' => 'Return address on email invoices',
584     'type'        => 'text',
585   },
586
587   {
588     'key'         => 'invoice_template',
589     'section'     => 'required',
590     'description' => 'Required template file for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
591     'type'        => 'textarea',
592   },
593
594   {
595     'key'         => 'invoice_html',
596     'section'     => 'billing',
597     'description' => 'Optional HTML template for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
598
599     'type'        => 'textarea',
600   },
601
602   {
603     'key'         => 'invoice_htmlnotes',
604     'section'     => 'billing',
605     'description' => 'Notes section for HTML invoices.  Defaults to the same data in invoice_latexnotes if not specified.',
606     'type'        => 'textarea',
607   },
608
609   {
610     'key'         => 'invoice_htmlfooter',
611     'section'     => 'billing',
612     'description' => 'Footer for HTML invoices.  Defaults to the same data in invoice_latexfooter if not specified.',
613     'type'        => 'textarea',
614   },
615
616   {
617     'key'         => 'invoice_htmlreturnaddress',
618     'section'     => 'billing',
619     'description' => 'Return address for HTML invoices.  Defaults to the same data in invoice_latexreturnaddress if not specified.',
620     'type'        => 'textarea',
621   },
622
623   {
624     'key'         => 'invoice_latex',
625     'section'     => 'billing',
626     'description' => 'Optional LaTeX template for typeset PostScript invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
627     'type'        => 'textarea',
628   },
629
630   {
631     'key'         => 'invoice_latexnotes',
632     'section'     => 'billing',
633     'description' => 'Notes section for LaTeX typeset PostScript invoices.',
634     'type'        => 'textarea',
635   },
636
637   {
638     'key'         => 'invoice_latexfooter',
639     'section'     => 'billing',
640     'description' => 'Footer for LaTeX typeset PostScript invoices.',
641     'type'        => 'textarea',
642   },
643
644   {
645     'key'         => 'invoice_latexreturnaddress',
646     'section'     => 'billing',
647     'description' => 'Return address for LaTeX typeset PostScript invoices.',
648     'type'        => 'textarea',
649   },
650
651   {
652     'key'         => 'invoice_latexsmallfooter',
653     'section'     => 'billing',
654     'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
655     'type'        => 'textarea',
656   },
657
658   {
659     'key'         => 'invoice_email_pdf',
660     'section'     => 'billing',
661     '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.',
662     'type'        => 'checkbox'
663   },
664
665   {
666     'key'         => 'invoice_email_pdf_note',
667     'section'     => 'billing',
668     'description' => 'If defined, this text will replace the default plain text invoice as the body of emailed PDF invoices.',
669     'type'        => 'textarea'
670   },
671
672
673   { 
674     'key'         => 'invoice_default_terms',
675     'section'     => 'billing',
676     'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
677     'type'        => 'select',
678     'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 30', 'Net 45', 'Net 60' ],
679   },
680
681   {
682     'key'         => 'invoice_send_receipts',
683     'section'     => 'deprecated',
684     'description' => '<b>DEPRECATED</b>, this used to send an invoice copy on payments and credits.  See the payment_receipt_email and XXXX instead.',
685     'type'        => 'checkbox',
686   },
687
688   {
689     'key'         => 'payment_receipt_email',
690     'section'     => 'billing',
691     'description' => 'Template file for payment receipts.  Payment receipts are sent to the customer email invoice destination(s) when a payment is received.  See the <a href="http://search.cpan.org/~mjd/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitution language.  The following variables are available: <ul><li><code>$date</code> <li><code>$name</code> <li><code>$paynum</code> - Freeside payment number <li><code>$paid</code> - Amount of payment <li><code>$payby</code> - Payment type (Card, Check, Electronic check, etc.) <li><code>$payinfo</code> - Masked credit card number or check number <li><code>$balance</code> - New balance</ul>',
692     'type'        => 'textarea',
693   },
694
695   {
696     'key'         => 'lpr',
697     'section'     => 'required',
698     'description' => 'Print command for paper invoices, for example `lpr -h\'',
699     'type'        => 'text',
700   },
701
702   {
703     'key'         => 'maildisablecatchall',
704     'section'     => 'deprecated',
705     'description' => '<b>DEPRECATED</b>, now the default.  Turning this option on used to disable the requirement that each virtual domain have a catch-all mailbox.',
706     'type'        => 'checkbox',
707   },
708
709   {
710     'key'         => 'money_char',
711     'section'     => '',
712     'description' => 'Currency symbol - defaults to `$\'',
713     'type'        => 'text',
714   },
715
716   {
717     'key'         => 'mxmachines',
718     'section'     => 'deprecated',
719     'description' => 'MX entries for new domains, weight and machine, one per line, with trailing `.\'',
720     'type'        => 'textarea',
721   },
722
723   {
724     'key'         => 'nsmachines',
725     'section'     => 'deprecated',
726     'description' => 'NS nameservers for new domains, one per line, with trailing `.\'',
727     'type'        => 'textarea',
728   },
729
730   {
731     'key'         => 'defaultrecords',
732     'section'     => 'BIND',
733     'description' => 'DNS entries to add automatically when creating a domain',
734     'type'        => 'editlist',
735     'editlist_parts' => [ { type=>'text' },
736                           { type=>'immutable', value=>'IN' },
737                           { type=>'select',
738                             select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS TXT)} },
739                           { type=> 'text' }, ],
740   },
741
742   {
743     'key'         => 'arecords',
744     'section'     => 'deprecated',
745     'description' => 'A list of tab seperated CNAME records to add automatically when creating a domain',
746     'type'        => 'textarea',
747   },
748
749   {
750     'key'         => 'cnamerecords',
751     'section'     => 'deprecated',
752     'description' => 'A list of tab seperated CNAME records to add automatically when creating a domain',
753     'type'        => 'textarea',
754   },
755
756   {
757     'key'         => 'nismachines',
758     'section'     => 'deprecated',
759     'description' => '<b>DEPRECATED</b>.  Your NIS master (not slave master) machines, one per line.  This enables export of `/etc/global/passwd\' and `/etc/global/shadow\'.',
760     'type'        => 'textarea',
761   },
762
763   {
764     'key'         => 'passwordmin',
765     'section'     => 'password',
766     'description' => 'Minimum password length (default 6)',
767     'type'        => 'text',
768   },
769
770   {
771     'key'         => 'passwordmax',
772     'section'     => 'password',
773     'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
774     'type'        => 'text',
775   },
776
777   {
778     'key' => 'password-noampersand',
779     'section' => 'password',
780     'description' => 'Disallow ampersands in passwords',
781     'type' => 'checkbox',
782   },
783
784   {
785     'key' => 'password-noexclamation',
786     'section' => 'password',
787     'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
788     'type' => 'checkbox',
789   },
790
791   {
792     'key'         => 'qmailmachines',
793     'section'     => 'deprecated',
794     'description' => '<b>DEPRECATED</b>, add <i>qmail</i> and <i>shellcommands</i> <a href="../browse/part_export.cgi">exports</a> instead.  This option used to export `/var/qmail/control/virtualdomains\', `/var/qmail/control/recipientmap\', and `/var/qmail/control/rcpthosts\'.  Setting this option (even if empty) also turns on user `.qmail-extension\' file maintenance in conjunction with the <b>shellmachine</b> option.',
795     'type'        => [qw( checkbox textarea )],
796   },
797
798   {
799     'key'         => 'radiusmachines',
800     'section'     => 'deprecated',
801     'description' => '<b>DEPRECATED</b>, add an <i>sqlradius</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to export to be: your RADIUS authentication machines, one per line.  This enables export of `/etc/raddb/users\'.',
802     'type'        => 'textarea',
803   },
804
805   {
806     'key'         => 'referraldefault',
807     'section'     => 'UI',
808     'description' => 'Default referral, specified by refnum',
809     'type'        => 'text',
810   },
811
812 #  {
813 #    'key'         => 'registries',
814 #    'section'     => 'required',
815 #    'description' => 'Directory which contains domain registry information.  Each registry is a directory.',
816 #  },
817
818   {
819     'key'         => 'report_template',
820     'section'     => 'deprecated',
821     'description' => 'Deprecated template file for reports.',
822     'type'        => 'textarea',
823   },
824
825
826   {
827     'key'         => 'maxsearchrecordsperpage',
828     'section'     => 'UI',
829     'description' => 'If set, number of search records to return per page.',
830     'type'        => 'text',
831   },
832
833   {
834     'key'         => 'sendmailconfigpath',
835     'section'     => 'deprecated',
836     'description' => '<b>DEPRECATED</b>, add a <i>sendmail</i> <a href="../browse/part_export.cgi">export</a> instead.  Used to be sendmail configuration file path.  Defaults to `/etc\'.  Many newer distributions use `/etc/mail\'.',
837     'type'        => 'text',
838   },
839
840   {
841     'key'         => 'sendmailmachines',
842     'section'     => 'deprecated',
843     'description' => '<b>DEPRECATED</b>, add a <i>sendmail</i> <a href="../browse/part_export.cgi">export</a> instead.  Used to be sendmail machines, one per line.  This enables export of `/etc/virtusertable\' and `/etc/sendmail.cw\'.',
844     'type'        => 'textarea',
845   },
846
847   {
848     'key'         => 'sendmailrestart',
849     'section'     => 'deprecated',
850     'description' => '<b>DEPRECATED</b>, add a <i>sendmail</i> <a href="../browse/part_export.cgi">export</a> instead.  Used to define the command which is run on sendmail machines after files are copied.',
851     'type'        => 'text',
852   },
853
854   {
855     'key'         => 'session-start',
856     'section'     => 'session',
857     '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.',
858     'type'        => 'text',
859   },
860
861   {
862     'key'         => 'session-stop',
863     'section'     => 'session',
864     '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.',
865     'type'        => 'text',
866   },
867
868   {
869     'key'         => 'shellmachine',
870     'section'     => 'deprecated',
871     'description' => '<b>DEPRECATED</b>, add a <i>shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to contain a single machine with user home directories mounted.  This enables home directory creation, renaming and archiving/deletion.  In conjunction with `qmailmachines\', it also enables `.qmail-extension\' file maintenance.',
872     'type'        => 'text',
873   },
874
875   {
876     'key'         => 'shellmachine-useradd',
877     'section'     => 'deprecated',
878     'description' => '<b>DEPRECATED</b>, add a <i>shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to contain command(s) to run on shellmachine when an account is created.  If the <b>shellmachine</b> option is set but this option is not, <code>useradd -d $dir -m -s $shell -u $uid $username</code> is the default.  If this option is set but empty, <code>cp -pr /etc/skel $dir; chown -R $uid.$gid $dir</code> is the default instead.  Otherwise the value is evaluated as a double-quoted perl string, with the following variables available: <code>$username</code>, <code>$uid</code>, <code>$gid</code>, <code>$dir</code>, and <code>$shell</code>.',
879     'type'        => [qw( checkbox text )],
880   },
881
882   {
883     'key'         => 'shellmachine-userdel',
884     'section'     => 'deprecated',
885     'description' => '<b>DEPRECATED</b>, add a <i>shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to contain command(s) to run on shellmachine when an account is deleted.  If the <b>shellmachine</b> option is set but this option is not, <code>userdel $username</code> is the default.  If this option is set but empty, <code>rm -rf $dir</code> is the default instead.  Otherwise the value is evaluated as a double-quoted perl string, with the following variables available: <code>$username</code> and <code>$dir</code>.',
886     'type'        => [qw( checkbox text )],
887   },
888
889   {
890     'key'         => 'shellmachine-usermod',
891     'section'     => 'deprecated',
892     'description' => '<b>DEPRECATED</b>, add a <i>shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to contain command(s) to run on shellmachine when an account is modified.  If the <b>shellmachine</b> option is set but this option is empty, <code>[ -d $old_dir ] &amp;&amp; mv $old_dir $new_dir || ( chmod u+t $old_dir; mkdir $new_dir; cd $old_dir; find . -depth -print | cpio -pdm $new_dir; chmod u-t $new_dir; chown -R $uid.$gid $new_dir; rm -rf $old_dir )</code> is the default.  Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$old_dir</code>, <code>$new_dir</code>, <code>$uid</code> and <code>$gid</code>.',
893     #'type'        => [qw( checkbox text )],
894     'type'        => 'text',
895   },
896
897   {
898     'key'         => 'shellmachines',
899     'section'     => 'deprecated',
900     'description' => '<b>DEPRECATED</b>, add a <i>sysvshell</i> <a href="../browse/part_export.cgi">export</a> instead.  Your Linux and System V flavored shell (and mail) machines, one per line.  This enables export of `/etc/passwd\' and `/etc/shadow\' files.',
901      'type'        => 'textarea',
902  },
903
904   {
905     'key'         => 'shells',
906     'section'     => 'required',
907     '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.',
908     'type'        => 'textarea',
909   },
910
911   {
912     'key'         => 'showpasswords',
913     'section'     => 'UI',
914     'description' => 'Display unencrypted user passwords in the backend (employee) web interface',
915     'type'        => 'checkbox',
916   },
917
918   {
919     'key'         => 'signupurl',
920     'section'     => 'UI',
921     'description' => 'if you are using customer-to-customer referrals, and you enter the URL of your <a href="../docs/signup.html">signup server CGI</a>, the customer view screen will display a customized link to the signup server with the appropriate customer as referral',
922     'type'        => 'text',
923   },
924
925   {
926     'key'         => 'smtpmachine',
927     'section'     => 'required',
928     'description' => 'SMTP relay for Freeside\'s outgoing mail',
929     'type'        => 'text',
930   },
931
932   {
933     'key'         => 'soadefaultttl',
934     'section'     => 'BIND',
935     'description' => 'SOA default TTL for new domains.',
936     'type'        => 'text',
937   },
938
939   {
940     'key'         => 'soaemail',
941     'section'     => 'BIND',
942     'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
943     'type'        => 'text',
944   },
945
946   {
947     'key'         => 'soaexpire',
948     'section'     => 'BIND',
949     'description' => 'SOA expire for new domains',
950     'type'        => 'text',
951   },
952
953   {
954     'key'         => 'soamachine',
955     'section'     => 'BIND',
956     'description' => 'SOA machine for new domains, with trailing `.\'',
957     'type'        => 'text',
958   },
959
960   {
961     'key'         => 'soarefresh',
962     'section'     => 'BIND',
963     'description' => 'SOA refresh for new domains',
964     'type'        => 'text',
965   },
966
967   {
968     'key'         => 'soaretry',
969     'section'     => 'BIND',
970     'description' => 'SOA retry for new domains',
971     'type'        => 'text',
972   },
973
974   {
975     'key'         => 'statedefault',
976     'section'     => 'UI',
977     'description' => 'Default state or province (if not supplied, the default is `CA\')',
978     'type'        => 'text',
979   },
980
981   {
982     'key'         => 'radiusprepend',
983     'section'     => 'deprecated',
984     'description' => '<b>DEPRECATED</b>, real-time text radius now edits an existing file in place - just (turn off freeside-queued and) edit your RADIUS users file directly.  The contents used to be be prepended to the top of the RADIUS users file (text exports only).',
985     'type'        => 'textarea',
986   },
987
988   {
989     'key'         => 'textradiusprepend',
990     'section'     => 'deprecated',
991     'description' => '<b>DEPRECATED</b>, use RADIUS check attributes instead.  The contents used to be prepended to the first line of a user\'s RADIUS entry in text exports.',
992     'type'        => 'text',
993   },
994
995   {
996     'key'         => 'unsuspendauto',
997     'section'     => 'billing',
998     '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',
999     'type'        => 'checkbox',
1000   },
1001
1002   {
1003     'key'         => 'usernamemin',
1004     'section'     => 'username',
1005     'description' => 'Minimum username length (default 2)',
1006     'type'        => 'text',
1007   },
1008
1009   {
1010     'key'         => 'usernamemax',
1011     'section'     => 'username',
1012     'description' => 'Maximum username length',
1013     'type'        => 'text',
1014   },
1015
1016   {
1017     'key'         => 'username-ampersand',
1018     'section'     => 'username',
1019     '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.',
1020     'type'        => 'checkbox',
1021   },
1022
1023   {
1024     'key'         => 'username-letter',
1025     'section'     => 'username',
1026     'description' => 'Usernames must contain at least one letter',
1027     'type'        => 'checkbox',
1028   },
1029
1030   {
1031     'key'         => 'username-letterfirst',
1032     'section'     => 'username',
1033     'description' => 'Usernames must start with a letter',
1034     'type'        => 'checkbox',
1035   },
1036
1037   {
1038     'key'         => 'username-noperiod',
1039     'section'     => 'username',
1040     'description' => 'Disallow periods in usernames',
1041     'type'        => 'checkbox',
1042   },
1043
1044   {
1045     'key'         => 'username-nounderscore',
1046     'section'     => 'username',
1047     'description' => 'Disallow underscores in usernames',
1048     'type'        => 'checkbox',
1049   },
1050
1051   {
1052     'key'         => 'username-nodash',
1053     'section'     => 'username',
1054     'description' => 'Disallow dashes in usernames',
1055     'type'        => 'checkbox',
1056   },
1057
1058   {
1059     'key'         => 'username-uppercase',
1060     'section'     => 'username',
1061     'description' => 'Allow uppercase characters in usernames',
1062     'type'        => 'checkbox',
1063   },
1064
1065   { 
1066     'key'         => 'username-percent',
1067     'section'     => 'username',
1068     'description' => 'Allow the percent character (%) in usernames.',
1069     'type'        => 'checkbox',
1070   },
1071
1072   {
1073     'key'         => 'username_policy',
1074     'section'     => 'deprecated',
1075     'description' => 'This file controls the mechanism for preventing duplicate usernames in passwd/radius files exported from svc_accts.  This should be one of \'prepend domsvc\' \'append domsvc\' \'append domain\' or \'append @domain\'',
1076     'type'        => 'select',
1077     'select_enum' => [ 'prepend domsvc', 'append domsvc', 'append domain', 'append @domain' ],
1078     #'type'        => 'text',
1079   },
1080
1081   {
1082     'key'         => 'vpopmailmachines',
1083     'section'     => 'deprecated',
1084     'description' => '<b>DEPRECATED</b>, add a <i>vpopmail</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to contain your vpopmail pop toasters, one per line.  Each line is of the form "machinename vpopdir vpopuid vpopgid".  For example: <code>poptoaster.domain.tld /home/vpopmail 508 508</code>  Note: vpopuid and vpopgid are values taken from the vpopmail machine\'s /etc/passwd',
1085     'type'        => 'textarea',
1086   },
1087
1088   {
1089     'key'         => 'vpopmailrestart',
1090     'section'     => 'deprecated',
1091     'description' => '<b>DEPRECATED</b>, add a <i>vpopmail</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to define the shell commands to run on vpopmail machines after files are copied.  An example can be found in eg/vpopmailrestart of the source distribution.',
1092     'type'        => 'textarea',
1093   },
1094
1095   {
1096     'key'         => 'safe-part_pkg',
1097     'section'     => 'deprecated',
1098     'description' => '<b>DEPRECATED</b>, obsolete.  Used to validate package definition setup and recur expressions against a preset list.  Useful for webdemos, annoying to powerusers.',
1099     'type'        => 'checkbox',
1100   },
1101
1102   {
1103     'key'         => 'safe-part_bill_event',
1104     'section'     => 'UI',
1105     'description' => 'Validates invoice event expressions against a preset list.  Useful for webdemos, annoying to powerusers.',
1106     'type'        => 'checkbox',
1107   },
1108
1109   {
1110     'key'         => 'show_ss',
1111     'section'     => 'UI',
1112     'description' => 'Turns on display/collection of SS# in the web interface.',
1113     'type'        => 'checkbox',
1114   },
1115
1116   { 
1117     'key'         => 'agent_defaultpkg',
1118     'section'     => 'UI',
1119     'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
1120     'type'        => 'checkbox',
1121   },
1122
1123   {
1124     'key'         => 'legacy_link',
1125     'section'     => 'UI',
1126     'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
1127     'type'        => 'checkbox',
1128   },
1129
1130   {
1131     'key'         => 'legacy_link-steal',
1132     'section'     => 'UI',
1133     'description' => 'Allow "stealing" an already-audited service from one customer (or package) to another using the link function.',
1134     'type'        => 'checkbox',
1135   },
1136
1137   {
1138     'key'         => 'queue_dangerous_controls',
1139     'section'     => 'UI',
1140     '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.',
1141     'type'        => 'checkbox',
1142   },
1143
1144   {
1145     'key'         => 'security_phrase',
1146     'section'     => 'password',
1147     'description' => 'Enable the tracking of a "security phrase" with each account.  Not recommended, as it is vulnerable to social engineering.',
1148     'type'        => 'checkbox',
1149   },
1150
1151   {
1152     'key'         => 'locale',
1153     'section'     => 'UI',
1154     'description' => 'Message locale',
1155     'type'        => 'select',
1156     'select_enum' => [ qw(en_US) ],
1157   },
1158
1159   {
1160     'key'         => 'selfservice_server-quiet',
1161     'section'     => 'deprecated',
1162     'description' => '<b>DEPRECATED</b>, the self-service server no longer sends superfluous decline and cancel emails.  Used to disable decline and cancel emails generated by transactions initiated by the selfservice server.',
1163     'type'        => 'checkbox',
1164   },
1165
1166   {
1167     'key'         => 'signup_server-quiet',
1168     'section'     => 'deprecated',
1169     'description' => '<b>DEPRECATED</b>, the signup server is now part of the self-service server and no longer sends superfluous decline and cancel emails.  Used to disable decline and cancel emails generated by transactions initiated by the signup server.  Does not disable welcome emails.',
1170     'type'        => 'checkbox',
1171   },
1172
1173   {
1174     'key'         => 'signup_server-payby',
1175     'section'     => '',
1176     'description' => 'Acceptable payment types for the signup server',
1177     'type'        => 'selectmultiple',
1178     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
1179   },
1180
1181   {
1182     'key'         => 'signup_server-email',
1183     'section'     => 'deprecated',
1184     'description' => '<b>DEPRECATED</b>, this feature is no longer available.  See the ***fill me in*** report instead.  Used to contain a comma-separated list of email addresses to receive notification of signups via the signup server.',
1185     'type'        => 'text',
1186   },
1187
1188   {
1189     'key'         => 'signup_server-default_agentnum',
1190     'section'     => '',
1191     'description' => 'Default agent for the signup server',
1192     'type'        => 'select-sub',
1193     'options_sub' => sub { require FS::Record;
1194                            require FS::agent;
1195                            map { $_->agentnum => $_->agent }
1196                                FS::Record::qsearch('agent', { disabled=>'' } );
1197                          },
1198     'option_sub'  => sub { require FS::Record;
1199                            require FS::agent;
1200                            my $agent = FS::Record::qsearchs(
1201                              'agent', { 'agentnum'=>shift }
1202                            );
1203                            $agent ? $agent->agent : '';
1204                          },
1205   },
1206
1207   {
1208     'key'         => 'signup_server-default_refnum',
1209     'section'     => '',
1210     'description' => 'Default advertising source for the signup server',
1211     'type'        => 'select-sub',
1212     'options_sub' => sub { require FS::Record;
1213                            require FS::part_referral;
1214                            map { $_->refnum => $_->referral }
1215                                FS::Record::qsearch( 'part_referral', 
1216                                                     { 'disabled' => '' }
1217                                                   );
1218                          },
1219     'option_sub'  => sub { require FS::Record;
1220                            require FS::part_referral;
1221                            my $part_referral = FS::Record::qsearchs(
1222                              'part_referral', { 'refnum'=>shift } );
1223                            $part_referral ? $part_referral->referral : '';
1224                          },
1225   },
1226
1227   {
1228     'key'         => 'signup_server-default_pkgpart',
1229     'section'     => '',
1230     'description' => 'Default pakcage for the signup server',
1231     'type'        => 'select-sub',
1232     'options_sub' => sub { require FS::Record;
1233                            require FS::part_pkg;
1234                            map { $_->pkgpart => $_->pkg.' - '.$_->comment }
1235                                FS::Record::qsearch( 'part_pkg',
1236                                                     { 'disabled' => ''}
1237                                                   );
1238                          },
1239     'option_sub'  => sub { require FS::Record;
1240                            require FS::part_pkg;
1241                            my $part_pkg = FS::Record::qsearchs(
1242                              'part_pkg', { 'pkgpart'=>shift }
1243                            );
1244                            $part_pkg
1245                              ? $part_pkg->pkg.' - '.$part_pkg->comment
1246                              : '';
1247                          },
1248   },
1249
1250   {
1251     'key'         => 'show-msgcat-codes',
1252     'section'     => 'UI',
1253     'description' => 'Show msgcat codes in error messages.  Turn this option on before reporting errors to the mailing list.',
1254     'type'        => 'checkbox',
1255   },
1256
1257   {
1258     'key'         => 'signup_server-realtime',
1259     'section'     => '',
1260     'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
1261     'type'        => 'checkbox',
1262   },
1263   {
1264     'key'         => 'signup_server-classnum2',
1265     'section'     => '',
1266     'description' => 'Package Class for first optional purchase',
1267     'type'        => 'select-sub',
1268     'options_sub' => sub { require FS::Record;
1269                            require FS::pkg_class;
1270                            map { $_->classnum => $_->classname }
1271                                FS::Record::qsearch('pkg_class', {} );
1272                          },
1273     'option_sub'  => sub { require FS::Record;
1274                            require FS::pkg_class;
1275                            my $pkg_class = FS::Record::qsearchs(
1276                              'pkg_class', { 'classnum'=>shift }
1277                            );
1278                            $pkg_class ? $pkg_class->classname : '';
1279                          },
1280   },
1281
1282   {
1283     'key'         => 'signup_server-classnum3',
1284     'section'     => '',
1285     'description' => 'Package Class for second optional purchase',
1286     'type'        => 'select-sub',
1287     'options_sub' => sub { require FS::Record;
1288                            require FS::pkg_class;
1289                            map { $_->classnum => $_->classname }
1290                                FS::Record::qsearch('pkg_class', {} );
1291                          },
1292     'option_sub'  => sub { require FS::Record;
1293                            require FS::pkg_class;
1294                            my $pkg_class = FS::Record::qsearchs(
1295                              'pkg_class', { 'classnum'=>shift }
1296                            );
1297                            $pkg_class ? $pkg_class->classname : '';
1298                          },
1299   },
1300
1301   {
1302     'key'         => 'backend-realtime',
1303     'section'     => '',
1304     'description' => 'Run billing for backend signups immediately.',
1305     'type'        => 'checkbox',
1306   },
1307
1308   {
1309     'key'         => 'declinetemplate',
1310     'section'     => 'billing',
1311     'description' => 'Template file for credit card decline emails.',
1312     'type'        => 'textarea',
1313   },
1314
1315   {
1316     'key'         => 'emaildecline',
1317     'section'     => 'billing',
1318     'description' => 'Enable emailing of credit card decline notices.',
1319     'type'        => 'checkbox',
1320   },
1321
1322   {
1323     'key'         => 'emaildecline-exclude',
1324     'section'     => 'billing',
1325     'description' => 'List of error messages that should not trigger email decline notices, one per line.',
1326     'type'        => 'textarea',
1327   },
1328
1329   {
1330     'key'         => 'cancelmessage',
1331     'section'     => 'billing',
1332     'description' => 'Template file for cancellation emails.',
1333     'type'        => 'textarea',
1334   },
1335
1336   {
1337     'key'         => 'cancelsubject',
1338     'section'     => 'billing',
1339     'description' => 'Subject line for cancellation emails.',
1340     'type'        => 'text',
1341   },
1342
1343   {
1344     'key'         => 'emailcancel',
1345     'section'     => 'billing',
1346     'description' => 'Enable emailing of cancellation notices.',
1347     'type'        => 'checkbox',
1348   },
1349
1350   {
1351     'key'         => 'require_cardname',
1352     'section'     => 'billing',
1353     'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
1354     'type'        => 'checkbox',
1355   },
1356
1357   {
1358     'key'         => 'enable_taxclasses',
1359     'section'     => 'billing',
1360     'description' => 'Enable per-package tax classes',
1361     'type'        => 'checkbox',
1362   },
1363
1364   {
1365     'key'         => 'require_taxclasses',
1366     'section'     => 'billing',
1367     'description' => 'Require a taxclass to be entered for every package',
1368     'type'        => 'checkbox',
1369   },
1370
1371   {
1372     'key'         => 'welcome_email',
1373     'section'     => '',
1374     'description' => 'Template file for welcome email.  Welcome emails are sent to the customer email invoice destination(s) each time a svc_acct record is created.  See the <a href="http://search.cpan.org/~mjd/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitution language.  The following variables are available<ul><li><code>$username</code> <li><code>$password</code> <li><code>$first</code> <li><code>$last</code> <li><code>$pkg</code></ul>',
1375     'type'        => 'textarea',
1376   },
1377
1378   {
1379     'key'         => 'welcome_email-from',
1380     'section'     => '',
1381     'description' => 'From: address header for welcome email',
1382     'type'        => 'text',
1383   },
1384
1385   {
1386     'key'         => 'welcome_email-subject',
1387     'section'     => '',
1388     'description' => 'Subject: header for welcome email',
1389     'type'        => 'text',
1390   },
1391   
1392   {
1393     'key'         => 'welcome_email-mimetype',
1394     'section'     => '',
1395     'description' => 'MIME type for welcome email',
1396     'type'        => 'select',
1397     'select_enum' => [ 'text/plain', 'text/html' ],
1398   },
1399
1400   {
1401     'key'         => 'payby',
1402     'section'     => 'billing',
1403     'description' => 'Available payment types.',
1404     'type'        => 'selectmultiple',
1405     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP) ],
1406   },
1407
1408   {
1409     'key'         => 'payby-default',
1410     'section'     => 'UI',
1411     'description' => 'Default payment type.  HIDE disables display of billing information and sets customers to BILL.',
1412     'type'        => 'select',
1413     'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP HIDE) ],
1414   },
1415
1416   {
1417     'key'         => 'svc_acct-notes',
1418     'section'     => 'UI',
1419     'description' => 'Extra HTML to be displayed on the Account View screen.',
1420     'type'        => 'textarea',
1421   },
1422
1423   {
1424     'key'         => 'radius-password',
1425     'section'     => '',
1426     'description' => 'RADIUS attribute for plain-text passwords.',
1427     'type'        => 'select',
1428     'select_enum' => [ 'Password', 'User-Password' ],
1429   },
1430
1431   {
1432     'key'         => 'radius-ip',
1433     'section'     => '',
1434     'description' => 'RADIUS attribute for IP addresses.',
1435     'type'        => 'select',
1436     'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
1437   },
1438
1439   {
1440     'key'         => 'svc_acct-alldomains',
1441     'section'     => '',
1442     '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.',
1443     'type'        => 'checkbox',
1444   },
1445
1446   {
1447     'key'         => 'dump-scpdest',
1448     'section'     => '',
1449     'description' => 'destination for scp database dumps: user@host:/path',
1450     'type'        => 'text',
1451   },
1452
1453   {
1454     'key'         => 'dump-pgpid',
1455     'section'     => '',
1456     '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.",
1457     'type'        => 'text',
1458   },
1459
1460   {
1461     'key'         => 'users-allow_comp',
1462     'section'     => 'deprecated',
1463     '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.',
1464     'type'        => 'textarea',
1465   },
1466
1467   {
1468     'key'         => 'cvv-save',
1469     'section'     => 'billing',
1470     '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.',
1471     'type'        => 'selectmultiple',
1472     'select_enum' => [ "VISA card",
1473                        "MasterCard",
1474                        "Discover card",
1475                        "American Express card",
1476                        "Diner's Club/Carte Blanche",
1477                        "enRoute",
1478                        "JCB",
1479                        "BankCard",
1480                      ],
1481   },
1482
1483   {
1484     'key'         => 'allow_negative_charges',
1485     'section'     => 'billing',
1486     'description' => 'Allow negative charges.  Normally not used unless importing data from a legacy system that requires this.',
1487     'type'        => 'checkbox',
1488   },
1489   {
1490       'key'         => 'auto_unset_catchall',
1491       'section'     => '',
1492       '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.',
1493       'type'        => 'checkbox',
1494   },
1495
1496   {
1497     'key'         => 'system_usernames',
1498     'section'     => 'username',
1499     '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.',
1500     'type'        => 'textarea',
1501   },
1502
1503   {
1504     'key'         => 'cust_pkg-change_svcpart',
1505     'section'     => '',
1506     'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
1507     'type'        => 'checkbox',
1508   },
1509
1510   {
1511     'key'         => 'disable_autoreverse',
1512     'section'     => 'BIND',
1513     'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
1514     'type'        => 'checkbox',
1515   },
1516
1517   {
1518     'key'         => 'svc_www-enable_subdomains',
1519     'section'     => '',
1520     'description' => 'Enable selection of specific subdomains for virtual host creation.',
1521     'type'        => 'checkbox',
1522   },
1523
1524   {
1525     'key'         => 'svc_www-usersvc_svcpart',
1526     'section'     => '',
1527     'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
1528     'type'        => 'textarea',
1529   },
1530
1531   {
1532     'key'         => 'selfservice_server-primary_only',
1533     'section'     => '',
1534     'description' => 'Only allow primary accounts to access self-service functionality.',
1535     'type'        => 'checkbox',
1536   },
1537
1538   {
1539     'key'         => 'card_refund-days',
1540     'section'     => 'billing',
1541     'description' => 'After a payment, the number of days a refund link will be available for that payment.  Defaults to 120.',
1542     'type'        => 'text',
1543   },
1544
1545   {
1546     'key'         => 'agent-showpasswords',
1547     'section'     => '',
1548     'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
1549     'type'        => 'checkbox',
1550   },
1551
1552   {
1553     'key'         => 'global_unique-username',
1554     'section'     => 'username',
1555     '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.',
1556     'type'        => 'select',
1557     'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
1558   },
1559
1560   {
1561     'key'         => 'svc_external-skip_manual',
1562     'section'     => 'UI',
1563     '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).',
1564     'type'        => 'checkbox',
1565   },
1566
1567   {
1568     'key'         => 'svc_external-display_type',
1569     'section'     => 'UI',
1570     'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
1571     'type'        => 'select',
1572     'select_enum' => [ 'generic', 'artera_turbo', ],
1573   },
1574
1575   {
1576     'key'         => 'ticket_system',
1577     'section'     => '',
1578     'description' => 'Ticketing system integration.  <b>RT_Internal</b> uses the built-in RT ticketing system (see the <a href="../docs/install-rt">integrated ticketing installation instructions</a>).   <b>RT_External</b> accesses an external RT installation in a separate database (local or remote).',
1579     'type'        => 'select',
1580     #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
1581     'select_enum' => [ '', qw(RT_Internal RT_External) ],
1582   },
1583
1584   {
1585     'key'         => 'ticket_system-default_queueid',
1586     'section'     => '',
1587     'description' => 'Default queue used when creating new customer tickets.',
1588     'type'        => 'select-sub',
1589     'options_sub' => sub {
1590                            my $conf = new FS::Conf;
1591                            if ( $conf->config('ticket_system') ) {
1592                              eval "use FS::TicketSystem;";
1593                              die $@ if $@;
1594                              FS::TicketSystem->queues();
1595                            } else {
1596                              ();
1597                            }
1598                          },
1599     'option_sub'  => sub { 
1600                            my $conf = new FS::Conf;
1601                            if ( $conf->config('ticket_system') ) {
1602                              eval "use FS::TicketSystem;";
1603                              die $@ if $@;
1604                              FS::TicketSystem->queue(shift);
1605                            } else {
1606                              '';
1607                            }
1608                          },
1609   },
1610
1611   {
1612     'key'         => 'ticket_system-custom_priority_field',
1613     'section'     => '',
1614     'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
1615     'type'        => 'text',
1616   },
1617
1618   {
1619     'key'         => 'ticket_system-custom_priority_field-values',
1620     'section'     => '',
1621     'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
1622     'type'        => 'textarea',
1623   },
1624
1625   {
1626     'key'         => 'ticket_system-custom_priority_field_queue',
1627     'section'     => '',
1628     'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
1629     'type'        => 'text',
1630   },
1631
1632   {
1633     'key'         => 'ticket_system-rt_external_datasrc',
1634     'section'     => '',
1635     '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>',
1636     'type'        => 'text',
1637
1638   },
1639
1640   {
1641     'key'         => 'ticket_system-rt_external_url',
1642     'section'     => '',
1643     'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
1644     'type'        => 'text',
1645   },
1646
1647   {
1648     'key'         => 'company_name',
1649     'section'     => 'required',
1650     'description' => 'Your company name',
1651     'type'        => 'text',
1652   },
1653
1654   {
1655     'key'         => 'echeck-void',
1656     'section'     => 'deprecated',
1657     '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',
1658     'type'        => 'checkbox',
1659   },
1660
1661   {
1662     'key'         => 'cc-void',
1663     'section'     => 'deprecated',
1664     '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',
1665     'type'        => 'checkbox',
1666   },
1667
1668   {
1669     'key'         => 'unvoid',
1670     'section'     => 'deprecated',
1671     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable unvoiding of voided payments',
1672     'type'        => 'checkbox',
1673   },
1674
1675   {
1676     'key'         => 'address2-search',
1677     'section'     => 'UI',
1678     'description' => 'Enable a "Unit" search box which searches the second address field',
1679     'type'        => 'checkbox',
1680   },
1681
1682   { 'key'         => 'referral_credit',
1683     'section'     => 'billing',
1684     'description' => "Enables one-time referral credits in the amount of one month <i>referred</i> customer's recurring fee (irregardless of frequency).",
1685     'type'        => 'checkbox',
1686   },
1687
1688   { 'key'         => 'selfservice_server-cache_module',
1689     'section'     => '',
1690     '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.',
1691     'type'        => 'select',
1692     'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
1693   },
1694
1695   {
1696     'key'         => 'hylafax',
1697     'section'     => '',
1698     '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).',
1699     'type'        => [qw( checkbox textarea )],
1700   },
1701
1702   {
1703     'key'         => 'svc_acct-usage_suspend',
1704     'section'     => 'billing',
1705     'description' => 'Suspends the package an account belongs to when svc_acct.seconds is decremented to 0 or below (accounts with an empty seconds value are ignored).  Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd.',
1706     'type'        => 'checkbox',
1707   },
1708
1709   {
1710     'key'         => 'svc_acct-usage_unsuspend',
1711     'section'     => 'billing',
1712     'description' => 'Unuspends the package an account belongs to when svc_acct.seconds is incremented from 0 or below to a positive value (accounts with an empty seconds value are ignored).  Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd.',
1713     'type'        => 'checkbox',
1714   },
1715
1716   {
1717     'key'         => 'cust-fields',
1718     'section'     => 'UI',
1719     'description' => 'Which customer fields to display on reports by default',
1720     'type'        => 'select',
1721     'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
1722   },
1723
1724   {
1725     'key'         => 'cust_pkg-display_times',
1726     'section'     => 'UI',
1727     'description' => 'Display full timestamps (not just dates) for customer packages.  Useful if you are doing real-time things like hourly prepaid.',
1728     'type'        => 'checkbox',
1729   },
1730
1731   {
1732     'key'         => 'svc_acct-edit_uid',
1733     'section'     => 'shell',
1734     'description' => 'Allow UID editing.',
1735     'type'        => 'checkbox',
1736   },
1737
1738   {
1739     'key'         => 'svc_acct-edit_gid',
1740     'section'     => 'shell',
1741     'description' => 'Allow GID editing.',
1742     'type'        => 'checkbox',
1743   },
1744
1745   {
1746     'key'         => 'zone-underscore',
1747     'section'     => 'BIND',
1748     'description' => 'Allow underscores in zone names.  As underscores are illegal characters in zone names, this option is not recommended.',
1749     'type'        => 'checkbox',
1750   },
1751
1752   #these should become per-user...
1753   {
1754     'key'         => 'vonage-username',
1755     'section'     => '',
1756     'description' => 'Vonage Click2Call username (see <a href="https://secure.click2callu.com/">https://secure.click2callu.com/</a>)',
1757     'type'        => 'text',
1758   },
1759   {
1760     'key'         => 'vonage-password',
1761     'section'     => '',
1762     'description' => 'Vonage Click2Call username (see <a href="https://secure.click2callu.com/">https://secure.click2callu.com/</a>)',
1763     'type'        => 'text',
1764   },
1765   {
1766     'key'         => 'vonage-fromnumber',
1767     'section'     => '',
1768     'description' => 'Vonage Click2Call number (see <a href="https://secure.click2callu.com/">https://secure.click2callu.com/</a>)',
1769     'type'        => 'text',
1770   },
1771
1772   {
1773     'key'         => 'echeck-nonus',
1774     'section'     => 'billing',
1775     'description' => 'Disable ABA-format account checking for Electronic Check payment info',
1776     'type'        => 'checkbox',
1777   },
1778
1779   {
1780     'key'         => 'voip-cust_cdr_spools',
1781     'section'     => '',
1782     'description' => 'Enable the per-customer option for individual CDR spools.',
1783     'type'        => 'checkbox',
1784   },
1785
1786   {
1787     'key'         => 'svc_forward-arbitrary_dst',
1788     'section'     => '',
1789     '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.",
1790     'type'        => 'checkbox',
1791   },
1792
1793   {
1794     'key'         => 'tax-ship_address',
1795     'section'     => 'billing',
1796     'description' => 'By default, tax calculations are done based on the billing address.  Enable this switch to calculate tax based on the shipping address instead.  Note: Tax reports can take a long time when enabled.',
1797     'type'        => 'checkbox',
1798   },
1799
1800   {
1801     'key'         => 'batch-enable',
1802     'section'     => 'billing',
1803     'description' => 'Enable credit card batching - leave disabled for real-time installations.',
1804     'type'        => 'checkbox',
1805   },
1806
1807   {
1808     'key'         => 'batch-default_format',
1809     'section'     => 'billing',
1810     'description' => 'Default format for batches.',
1811     'type'        => 'select',
1812     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ]
1813   },
1814
1815   {
1816     'key'         => 'batch-fixed_format-CARD',
1817     'section'     => 'billing',
1818     'description' => 'Fixed (unchangeable) format for credit card batches.',
1819     'type'        => 'select',
1820     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ]
1821   },
1822
1823   {
1824     'key'         => 'batch-fixed_format-CHEK',
1825     'section'     => 'billing',
1826     'description' => 'Fixed (unchangeable) format for electronic check batches.',
1827     'type'        => 'select',
1828     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ]
1829   },
1830
1831   {
1832     'key'         => 'batchconfig-BoM',
1833     'section'     => 'billing',
1834     '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',
1835     'type'        => 'textarea',
1836   },
1837
1838   {
1839     'key'         => 'payment_history-years',
1840     'section'     => 'UI',
1841     'description' => 'Number of years of payment history to show by default.  Currently defaults to 2.',
1842     'type'        => 'text',
1843   },
1844
1845   {
1846     'key'         => 'cust_main-use_comments',
1847     'section'     => 'UI',
1848     'description' => 'Display free form comments on the customer edit screen.  Useful as a scratch pad.',
1849     'type'        => 'checkbox',
1850   },
1851
1852   {
1853     'key'         => 'cust_main-disable_notes',
1854     'section'     => 'UI',
1855     'description' => 'Disable new style customer notes - timestamped and user identified customer notes.  Useful in tracking who did what.',
1856     'type'        => 'checkbox',
1857   },
1858
1859   {
1860     'key'         => 'cust_main_note-display_times',
1861     'section'     => 'UI',
1862     'description' => 'Display full timestamps (not just dates) for customer notes.',
1863     'type'        => 'checkbox',
1864   },
1865
1866   {
1867     'key'         => 'cust_main-ticket_statuses',
1868     'section'     => 'UI',
1869     'description' => 'Show tickets with these statuses on the customer view page.',
1870     'type'        => 'selectmultiple',
1871     'select_enum' => [qw( new open stalled resolved rejected deleted )],
1872   },
1873
1874   {
1875     'key'         => 'cust_main-max_tickets',
1876     'section'     => 'UI',
1877     'description' => 'Maximum number of tickets to show on the customer view page.',
1878     'type'        => 'text',
1879   },
1880
1881   {
1882     'key'         => 'cust_main-skeleton_tables',
1883     'section'     => '',
1884     '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.',
1885     'type'        => 'textarea',
1886   },
1887
1888   {
1889     'key'         => 'cust_main-skeleton_custnum',
1890     'section'     => '',
1891     'description' => 'Customer number specifying the source data to copy into skeleton tables for new customers.',
1892     'type'        => 'text',
1893   },
1894
1895   {
1896     'key'         => 'cust_main-enable_birthdate',
1897     'section'     => 'UI',
1898     'descritpion' => 'Enable tracking of a birth date with each customer record',
1899     'type'        => 'checkbox',
1900   },
1901
1902   {
1903     'key'         => 'support-key',
1904     'section'     => '',
1905     'description' => 'A support key enables access to commercial services accessed over the network, such as access to the internal ticket system, priority support and optional backups.',
1906     'type'        => 'text',
1907   },
1908
1909 );
1910
1911 1;
1912