X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FConf.pm;h=f2b1bea56ae90694e033590905635772bed8cfb3;hb=16a91fd700e3c3e5ec051d2c3692275f9389aab4;hp=d676d4e8c2c5c808b5b86ed38dfc8865420c9060;hpb=6fe8172b11d0369d0b1274d6825ec0c57afe8001;p=freeside.git diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index d676d4e8c..f2b1bea56 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -1,9 +1,15 @@ package FS::Conf; -use vars qw($default_dir @config_items $DEBUG ); -use IO::File; -use File::Basename; +use vars qw($base_dir @config_items @card_types $DEBUG ); +use MIME::Base64; use FS::ConfItem; +use FS::ConfDefaults; +use FS::conf; +use FS::Record qw(qsearch qsearchs); +use FS::UID qw(dbh); + +$base_dir = '%%%FREESIDE_CONF%%%'; + $DEBUG = 0; @@ -15,13 +21,8 @@ FS::Conf - Freeside configuration values use FS::Conf; - $conf = new FS::Conf "/config/directory"; - - $FS::Conf::default_dir = "/config/directory"; $conf = new FS::Conf; - $dir = $conf->dir; - $value = $conf->config('key'); @list = $conf->config('key'); $bool = $conf->exists('key'); @@ -41,34 +42,33 @@ but this may change in the future. =over 4 -=item new [ DIRECTORY ] +=item new -Create a new configuration object. A directory arguement is required if -$FS::Conf::default_dir has not been set. +Create a new configuration object. =cut sub new { - my($proto,$dir) = @_; + my($proto) = @_; my($class) = ref($proto) || $proto; - my($self) = { 'dir' => $dir || $default_dir } ; + my($self) = { 'base_dir' => $base_dir }; bless ($self, $class); } -=item dir +=item base_dir -Returns the directory. +Returns the base directory. By default this is /usr/local/etc/freeside. =cut -sub dir { +sub base_dir { my($self) = @_; - my $dir = $self->{dir}; - -e $dir or die "FATAL: $dir doesn't exist!"; - -d $dir or die "FATAL: $dir isn't a directory!"; - -r $dir or die "FATAL: Can't read $dir!"; - -x $dir or die "FATAL: $dir not searchable (executable)!"; - $dir =~ /^(.*)$/; + my $base_dir = $self->{base_dir}; + -e $base_dir or die "FATAL: $base_dir doesn't exist!"; + -d $base_dir or die "FATAL: $base_dir isn't a directory!"; + -r $base_dir or die "FATAL: Can't read $base_dir!"; + -x $base_dir or die "FATAL: $base_dir not searchable (executable)!"; + $base_dir =~ /^(.*)$/; $1; } @@ -78,23 +78,44 @@ Returns the configuration value or values (depending on context) for key. =cut +sub _config { + my($self,$name,$agent)=@_; + my $hashref = { 'name' => $name }; + if (defined($agent) && $agent) { + $hashref->{agent} = $agent; + } + local $FS::Record::conf = undef; # XXX evil hack prevents recursion + my $cv = FS::Record::qsearchs('conf', $hashref); + if (!$cv && exists($hashref->{agent})) { + delete($hashref->{agent}); + $cv = FS::Record::qsearchs('conf', $hashref); + } + return $cv; +} + sub config { - my($self,$file)=@_; - my($dir)=$self->dir; - my $fh = new IO::File "<$dir/$file" or return; + my($self,$name,$agent)=@_; + my $cv = $self->_config($name, $agent) or return; + if ( wantarray ) { - map { - /^(.*)$/ - or die "Illegal line (array context) in $dir/$file:\n$_\n"; - $1; - } <$fh>; + split "\n", $cv->value; } else { - <$fh> =~ /^(.*)$/ - or die "Illegal line (scalar context) in $dir/$file:\n$_\n"; - $1; + (split("\n", $cv->value))[0]; } } +=item config_binary KEY + +Returns the exact scalar value for key. + +=cut + +sub config_binary { + my($self,$name,$agent)=@_; + my $cv = $self->_config($name, $agent) or return; + decode_base64($cv->value); +} + =item exists KEY Returns true if the specified key exists, even if the corresponding value @@ -103,9 +124,8 @@ is undefined. =cut sub exists { - my($self,$file)=@_; - my($dir) = $self->dir; - -e "$dir/$file"; + my($self,$name,$agent)=@_; + defined($self->_config($name, $agent)); } =item config_orbase KEY SUFFIX @@ -116,11 +136,11 @@ KEY_SUFFIX, if it exists, otherwise for KEY =cut sub config_orbase { - my( $self, $file, $suffix ) = @_; - if ( $self->exists("${file}_$suffix") ) { - $self->config("${file}_$suffix"); + my( $self, $name, $suffix ) = @_; + if ( $self->exists("${name}_$suffix") ) { + $self->config("${name}_$suffix"); } else { - $self->config($file); + $self->config($name); } } @@ -131,12 +151,8 @@ Creates the specified configuration key if it does not exist. =cut sub touch { - my($self, $file) = @_; - my $dir = $self->dir; - unless ( $self->exists($file) ) { - warn "[FS::Conf] TOUCH $file\n" if $DEBUG; - system('touch', "$dir/$file"); - } + my($self, $name, $agent) = @_; + $self->set($name, '', $agent); } =item set KEY VALUE @@ -146,23 +162,41 @@ Sets the specified configuration key to the given value. =cut sub set { - my($self, $file, $value) = @_; - my $dir = $self->dir; + my($self, $name, $value, $agent) = @_; $value =~ /^(.*)$/s; $value = $1; - unless ( join("\n", @{[ $self->config($file) ]}) eq $value ) { - warn "[FS::Conf] SET $file\n" if $DEBUG; -# warn "$dir" if is_tainted($dir); -# warn "$dir" if is_tainted($file); - chmod 0644, "$dir/$file"; - my $fh = new IO::File ">$dir/$file" or return; - chmod 0644, "$dir/$file"; - print $fh "$value\n"; + + warn "[FS::Conf] SET $file\n" if $DEBUG; + + my $old = FS::Record::qsearchs('conf', {name => $name, agent => $agent}); + my $new = new FS::conf { $old ? $old->hash + : ('name' => $name, 'agent' => $agent) + }; + $new->value($value); + + my $error; + if ($old) { + $error = $new->replace($old); + } else { + $error = $new->insert; } + + die "error setting configuration value: $error \n" + if $error; + +} + +=item set_binary KEY VALUE + +Sets the specified configuration key to an exact scalar value which +can be retrieved with config_binary. + +=cut + +sub set_binary { + my($self,$name, $value, $agent)=@_; + $self->set($name, encode_base64($value), $agent); } -#sub is_tainted { -# return ! eval { join('',@_), kill 0; 1; }; -# } =item delete KEY @@ -171,11 +205,23 @@ Deletes the specified configuration key. =cut sub delete { - my($self, $file) = @_; - my $dir = $self->dir; - if ( $self->exists($file) ) { + my($self, $name, $agent) = @_; + if ( my $cv = FS::Record::qsearchs('conf', {name => $name, agent => $agent}) ) { warn "[FS::Conf] DELETE $file\n"; - unlink "$dir/$file"; + + my $oldAutoCommit = $FS::UID::AutoCommit; + local $FS::UID::AutoCommit = 0; + my $dbh = dbh; + + my $error = $cv->delete; + + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + die "error setting configuration value: $error \n" + } + + $dbh->commit or die $dbh->errstr if $oldAutoCommit; + } } @@ -191,40 +237,68 @@ sub config_items { #quelle kludge @config_items, ( map { - my $basename = basename($_); - $basename =~ /^(.*)$/; - $basename = $1; new FS::ConfItem { - 'key' => $basename, + 'key' => $_->name, 'section' => 'billing', 'description' => 'Alternate template file for invoices. See the billing documentation for details.', 'type' => 'textarea', } - } glob($self->dir. '/invoice_template_*') + } FS::Record::qsearch('conf', {}, '', "WHERE name LIKE 'invoice!_template!_%' ESCAPE '!'") + ), + ( map { + new FS::ConfItem { + 'key' => '$_->name', + 'section' => 'billing', #? + 'description' => 'An image to include in some types of invoices', + 'type' => 'binary', + } + } FS::Record::qsearch('conf', {}, '', "WHERE name LIKE 'logo!_%.png' ESCAPE '!'") ), ( map { - my $basename = basename($_); - $basename =~ /^(.*)$/; - $basename = $1; new FS::ConfItem { - 'key' => $basename, + 'key' => $_->name, + 'section' => 'billing', + 'description' => 'Alternate HTML template for invoices. See the billing documentation for details.', + 'type' => 'textarea', + } + } FS::Record::qsearch('conf', {}, '', "WHERE name LIKE 'invoice!_html!_%' ESCAPE '!'") + ), + ( map { + ($latexname = $_->name ) =~ s/latex/html/; + new FS::ConfItem { + 'key' => $_->name, + 'section' => 'billing', + 'description' => "Alternate Notes section for HTML invoices. Defaults to the same data in $latexname if not specified.", + 'type' => 'textarea', + } + } FS::Record::qsearch('conf', {}, '', "WHERE name LIKE 'invoice!_htmlnotes!_%' ESCAPE '!'") + ), + ( map { + new FS::ConfItem { + 'key' => $_->name, 'section' => 'billing', 'description' => 'Alternate LaTeX template for invoices. See the billing documentation for details.', 'type' => 'textarea', } - } glob($self->dir. '/invoice_latex_*') + } FS::Record::qsearch('conf', {}, '', "WHERE name LIKE 'invoice!_latex!_%' ESCAPE '!'") + ), + ( map { + new FS::ConfItem { + 'key' => '$_->name', + 'section' => 'billing', #? + 'description' => 'An image to include in some types of invoices', + 'type' => 'binary', + } + } FS::Record::qsearch('conf', {}, '', "WHERE name LIKE 'logo!_%.eps' ESCAPE '!'") ), ( map { - my $basename = basename($_); - $basename =~ /^(.*)$/; - $basename = $1; new FS::ConfItem { - 'key' => $basename, + 'key' => $_->name, 'section' => 'billing', 'description' => 'Alternate Notes section for LaTeX typeset PostScript invoices. See the billing documentation for details.', 'type' => 'textarea', } - } glob($self->dir. '/invoice_latexnotes_*') + } FS::Record::qsearch('conf', {}, '', "WHERE name LIKE 'invoice!_latexnotes!_%' ESCAPE '!'") ); } @@ -243,6 +317,20 @@ httemplate/docs/config.html =cut +#Business::CreditCard +@card_types = ( + "VISA card", + "MasterCard", + "Discover card", + "American Express card", + "Diner's Club/Carte Blanche", + "enRoute", + "JCB", + "BankCard", + "Switch", + "Solo", +); + @config_items = map { new FS::ConfItem $_ } ( { @@ -301,6 +389,34 @@ httemplate/docs/config.html 'type' => 'textarea', }, + { + 'key' => 'encryption', + 'section' => 'billing', + 'description' => 'Enable encryption of credit cards.', + 'type' => 'checkbox', + }, + + { + 'key' => 'encryptionmodule', + 'section' => 'billing', + 'description' => 'Use which module for encryption?', + 'type' => 'text', + }, + + { + 'key' => 'encryptionpublickey', + 'section' => 'billing', + 'description' => 'Your RSA Public Key - Required if Encryption is turned on.', + 'type' => 'textarea', + }, + + { + 'key' => 'encryptionprivatekey', + 'section' => 'billing', + '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.', + 'type' => 'textarea', + }, + { 'key' => 'business-onlinepayment', 'section' => 'billing', @@ -322,6 +438,13 @@ httemplate/docs/config.html 'type' => 'text', }, + { + 'key' => 'business-onlinepayment-email-override', + 'section' => 'billing', + 'description' => 'Email address used instead of customer email address when submitting a BOP transaction.', + 'type' => 'text', + }, + { 'key' => 'bsdshellmachines', 'section' => 'deprecated', @@ -336,6 +459,17 @@ httemplate/docs/config.html 'type' => 'text', }, + { + 'key' => 'date_format', + 'section' => 'UI', + 'description' => 'Format for displaying dates', + 'type' => 'select', + 'select_hash' => [ + '%m/%d/%Y' => 'MM/DD/YYYY', + '%Y/%m/%d' => 'YYYY/MM/DD', + ], + }, + { 'key' => 'cyrus', 'section' => 'deprecated', @@ -359,29 +493,36 @@ httemplate/docs/config.html { 'key' => 'deletepayments', - 'section' => 'UI', - 'description' => 'Enable deletion of unclosed payments. 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.', + 'section' => 'billing', + '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.', 'type' => [qw( checkbox text )], }, { 'key' => 'deletecredits', - 'section' => 'UI', - 'description' => '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.', + 'section' => 'deprecated', + 'description' => 'DEPRECATED, 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.', 'type' => [qw( checkbox text )], }, + { + 'key' => 'deleterefunds', + 'section' => 'billing', + 'description' => 'Enable deletion of unclosed refunds. Be very careful! Only delete refunds that were data-entry errors, not adjustments.', + 'type' => 'checkbox', + }, + { 'key' => 'unapplypayments', - 'section' => 'UI', - 'description' => 'Enable "unapplication" of unclosed payments.', + 'section' => 'deprecated', + 'description' => 'DEPRECATED, now controlled by ACLs. Used to enable "unapplication" of unclosed payments.', 'type' => 'checkbox', }, { 'key' => 'unapplycredits', - 'section' => 'UI', - 'description' => 'Enable "unapplication" of unclosed credits.', + 'section' => 'deprecated', + 'description' => 'DEPRECATED, now controlled by ACLs. Used to nable "unapplication" of unclosed credits.', 'type' => 'checkbox', }, @@ -427,6 +568,13 @@ httemplate/docs/config.html 'type' => 'checkbox', }, + { + 'key' => 'emailinvoiceautoalways', + 'section' => 'billing', + 'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses', + 'type' => 'checkbox', + }, + { 'key' => 'exclude_ip_addr', 'section' => '', @@ -437,7 +585,7 @@ httemplate/docs/config.html { 'key' => 'erpcdmachines', 'section' => 'deprecated', - 'description' => 'DEPRECATED, ERPCD is no longer supported. Used to be ERPCD authenticaion machines, one per line. This enables export of `/usr/annex/acp_passwd\' and `/usr/annex/acp_dialup\'', + 'description' => 'DEPRECATED, 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\'', 'type' => 'textarea', }, @@ -504,10 +652,39 @@ httemplate/docs/config.html 'type' => 'textarea', }, + { + 'key' => 'invoice_html', + 'section' => 'billing', + 'description' => 'Optional HTML template for invoices. See the billing documentation for details.', + + 'type' => 'textarea', + }, + + { + 'key' => 'invoice_htmlnotes', + 'section' => 'billing', + 'description' => 'Notes section for HTML invoices. Defaults to the same data in invoice_latexnotes if not specified.', + 'type' => 'textarea', + }, + + { + 'key' => 'invoice_htmlfooter', + 'section' => 'billing', + 'description' => 'Footer for HTML invoices. Defaults to the same data in invoice_latexfooter if not specified.', + 'type' => 'textarea', + }, + + { + 'key' => 'invoice_htmlreturnaddress', + 'section' => 'billing', + 'description' => 'Return address for HTML invoices. Defaults to the same data in invoice_latexreturnaddress if not specified.', + 'type' => 'textarea', + }, + { 'key' => 'invoice_latex', 'section' => 'billing', - 'description' => 'Optional LaTeX template for typeset PostScript invoices.', + 'description' => 'Optional LaTeX template for typeset PostScript invoices. See the billing documentation for details.', 'type' => 'textarea', }, @@ -525,6 +702,13 @@ httemplate/docs/config.html 'type' => 'textarea', }, + { + 'key' => 'invoice_latexreturnaddress', + 'section' => 'billing', + 'description' => 'Return address for LaTeX typeset PostScript invoices.', + 'type' => 'textarea', + }, + { 'key' => 'invoice_latexsmallfooter', 'section' => 'billing', @@ -532,6 +716,21 @@ httemplate/docs/config.html 'type' => 'textarea', }, + { + 'key' => 'invoice_email_pdf', + 'section' => 'billing', + '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.', + 'type' => 'checkbox' + }, + + { + 'key' => 'invoice_email_pdf_note', + 'section' => 'billing', + 'description' => 'If defined, this text will replace the default plain text invoice as the body of emailed PDF invoices.', + 'type' => 'textarea' + }, + + { 'key' => 'invoice_default_terms', 'section' => 'billing', @@ -542,7 +741,7 @@ httemplate/docs/config.html { 'key' => 'invoice_send_receipts', - 'section' => 'deprecated',q + 'section' => 'deprecated', 'description' => 'DEPRECATED, this used to send an invoice copy on payments and credits. See the payment_receipt_email and XXXX instead.', 'type' => 'checkbox', }, @@ -550,7 +749,7 @@ httemplate/docs/config.html { 'key' => 'payment_receipt_email', 'section' => 'billing', - 'description' => 'Template file for payment receipts.', + 'description' => 'Template file for payment receipts. Payment receipts are sent to the customer email invoice destination(s) when a payment is received. See the Text::Template documentation for details on the template substitution language. The following variables are available:
$date
$name
$paynum
- Freeside payment number $paid
- Amount of payment $payby
- Payment type (Card, Check, Electronic check, etc.) $payinfo
- Masked credit card number or check number $balance
- New balance$username
, $password
, $first
, $last
and $pkg
.',
+ '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 Text::Template documentation for details on the template substitution language. The following variables are available$username
$password
$first
$last
$pkg
$username
$password
$first
$last
$pkg
$column
$amount
$threshold
DBI:Pg:user=rt_user;password=rt_word;host=rt.example.com;dbname=rt
',
+ 'type' => 'text',
+
+ },
+
+ {
+ 'key' => 'ticket_system-rt_external_url',
+ 'section' => '',
+ 'description' => 'With external RT integration, the URL for the external RT installation, for example, https://rt.example.com/rt
',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'company_name',
+ 'section' => 'required',
+ 'description' => 'Your company name',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'echeck-void',
+ 'section' => 'deprecated',
+ 'description' => 'DEPRECATED, now controlled by ACLs. Used to enable local-only voiding of echeck payments in addition to refunds against the payment gateway',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'cc-void',
+ 'section' => 'deprecated',
+ 'description' => 'DEPRECATED, now controlled by ACLs. Used to enable local-only voiding of credit card payments in addition to refunds against the payment gateway',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'unvoid',
+ 'section' => 'deprecated',
+ 'description' => 'DEPRECATED, now controlled by ACLs. Used to enable unvoiding of voided payments',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'address2-search',
+ 'section' => 'UI',
+ 'description' => 'Enable a "Unit" search box which searches the second address field',
+ 'type' => 'checkbox',
+ },
+
+ { 'key' => 'referral_credit',
+ 'section' => 'billing',
+ 'description' => "Enables one-time referral credits in the amount of one month referred customer's recurring fee (irregardless of frequency).",
+ 'type' => 'checkbox',
+ },
+
+ { 'key' => 'selfservice_server-cache_module',
+ 'section' => '',
+ '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.',
+ 'type' => 'select',
+ 'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
+ },
+
+ {
+ 'key' => 'hylafax',
+ 'section' => '',
+ '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).',
+ 'type' => [qw( checkbox textarea )],
+ },
+
+ {
+ 'key' => 'svc_acct-usage_suspend',
+ 'section' => 'billing',
+ '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.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'svc_acct-usage_unsuspend',
+ 'section' => 'billing',
+ '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.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'svc_acct-usage_threshold',
+ 'section' => 'billing',
+ 'description' => 'The threshold (expressed as percentage) of acct.seconds or acct.up|down|totalbytes at which a warning message is sent to a service holder. Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd. Defaults to 80.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'cust-fields',
+ 'section' => 'UI',
+ 'description' => 'Which customer fields to display on reports by default',
+ 'type' => 'select',
+ 'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
+ },
+
+ {
+ 'key' => 'cust_pkg-display_times',
+ 'section' => 'UI',
+ 'description' => 'Display full timestamps (not just dates) for customer packages. Useful if you are doing real-time things like hourly prepaid.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'svc_acct-edit_uid',
+ 'section' => 'shell',
+ 'description' => 'Allow UID editing.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'svc_acct-edit_gid',
+ 'section' => 'shell',
+ 'description' => 'Allow GID editing.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'zone-underscore',
+ 'section' => 'BIND',
+ 'description' => 'Allow underscores in zone names. As underscores are illegal characters in zone names, this option is not recommended.',
+ 'type' => 'checkbox',
+ },
+
+ #these should become per-user...
+ {
+ 'key' => 'vonage-username',
+ 'section' => '',
+ 'description' => 'Vonage Click2Call username (see https://secure.click2callu.com/)',
+ 'type' => 'text',
+ },
+ {
+ 'key' => 'vonage-password',
+ 'section' => '',
+ 'description' => 'Vonage Click2Call username (see https://secure.click2callu.com/)',
+ 'type' => 'text',
+ },
+ {
+ 'key' => 'vonage-fromnumber',
+ 'section' => '',
+ 'description' => 'Vonage Click2Call number (see https://secure.click2callu.com/)',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'echeck-nonus',
+ 'section' => 'billing',
+ 'description' => 'Disable ABA-format account checking for Electronic Check payment info',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'voip-cust_cdr_spools',
+ 'section' => '',
+ 'description' => 'Enable the per-customer option for individual CDR spools.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'svc_forward-arbitrary_dst',
+ 'section' => '',
+ '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.",
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'tax-ship_address',
+ 'section' => 'billing',
+ '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.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'batch-enable',
+ 'section' => 'billing',
+ 'description' => 'Enable credit card batching - leave disabled for real-time installations.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'batch-default_format',
+ 'section' => 'billing',
+ 'description' => 'Default format for batches.',
+ 'type' => 'select',
+ 'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch',
+ 'csv-chase_canada-E-xactBatch', 'BoM', 'PAP' ]
+ },
+
+ {
+ 'key' => 'batch-fixed_format-CARD',
+ 'section' => 'billing',
+ 'description' => 'Fixed (unchangeable) format for credit card batches.',
+ 'type' => 'select',
+ 'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
+ 'csv-chase_canada-E-xactBatch', 'BoM', 'PAP' ]
+ },
+
+ {
+ 'key' => 'batch-fixed_format-CHEK',
+ 'section' => 'billing',
+ 'description' => 'Fixed (unchangeable) format for electronic check batches.',
+ 'type' => 'select',
+ 'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ]
+ },
+
+ {
+ 'key' => 'batch-increment_expiration',
+ 'section' => 'billing',
+ 'description' => 'Increment expiration date years in batches until cards are current. Make sure this is acceptable to your batching provider before enabling.',
+ 'type' => 'checkbox'
+ },
+
+ {
+ 'key' => 'batchconfig-BoM',
+ 'section' => 'billing',
+ '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',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'batchconfig-PAP',
+ 'section' => 'billing',
+ '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',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'batchconfig-csv-chase_canada-E-xactBatch',
+ 'section' => 'billing',
+ 'description' => 'Gateway ID for Chase Canada E-xact batching',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'payment_history-years',
+ 'section' => 'UI',
+ 'description' => 'Number of years of payment history to show by default. Currently defaults to 2.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'cust_main-use_comments',
+ 'section' => 'UI',
+ 'description' => 'Display free form comments on the customer edit screen. Useful as a scratch pad.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'cust_main-disable_notes',
+ 'section' => 'UI',
+ 'description' => 'Disable new style customer notes - timestamped and user identified customer notes. Useful in tracking who did what.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'cust_main_note-display_times',
+ 'section' => 'UI',
+ 'description' => 'Display full timestamps (not just dates) for customer notes.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'cust_main-ticket_statuses',
+ 'section' => 'UI',
+ 'description' => 'Show tickets with these statuses on the customer view page.',
+ 'type' => 'selectmultiple',
+ 'select_enum' => [qw( new open stalled resolved rejected deleted )],
+ },
+
+ {
+ 'key' => 'cust_main-max_tickets',
+ 'section' => 'UI',
+ 'description' => 'Maximum number of tickets to show on the customer view page.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'cust_main-skeleton_tables',
+ 'section' => '',
+ '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.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'cust_main-skeleton_custnum',
+ 'section' => '',
+ 'description' => 'Customer number specifying the source data to copy into skeleton tables for new customers.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'cust_main-enable_birthdate',
+ 'section' => 'UI',
+ 'descritpion' => 'Enable tracking of a birth date with each customer record',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'support-key',
+ 'section' => '',
+ '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.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'card-types',
+ 'section' => 'billing',
+ 'description' => 'Select one or more card types to enable only those card types. If no card types are selected, all card types are available.',
+ 'type' => 'selectmultiple',
+ 'select_enum' => \@card_types,
+ },
+
+ {
+ 'key' => 'dashboard-toplist',
+ 'section' => 'UI',
+ 'description' => 'List of items to display on the top of the front page',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'impending_recur_template',
+ 'section' => 'billing',
+ 'description' => 'Template file for alerts about looming first time recurrant billing. See the Text::Template documentation for details on the template substitition language. Also see packages with a flat price plan The following variables are available$packages
allowing $packages->[0]
thru $packages->[n]
$package
the first package, same as $packages->[0]
$recurdates
allowing $recurdates->[0]
thru $recurdates->[n]
$recurdate
the first recurdate, same as $recurdate->[0]
$first
$last
$payby
$expdate
most likely only confuse
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'logo.png',
+ 'section' => 'billing', #?
+ 'description' => 'An image to include in some types of invoices',
+ 'type' => 'binary',
+ },
+
+ {
+ 'key' => 'logo.eps',
+ 'section' => 'billing', #?
+ 'description' => 'An image to include in some types of invoices',
+ 'type' => 'binary',
+ },
+
+ {
+ 'key' => 'selfservice-ignore_quantity',
+ 'section' => '',
+ 'description' => 'Ignores service quantity restrictions in self-service context. Strongly not recommended - just set your quantities correctly in the first place.',
+ 'type' => 'checkbox',
+ },
+
);
1;