X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FConf.pm;h=c592bac6b9496b2bec0890ce6343c2eb99ab07d6;hb=c8cccb4a92adceb943c635fe62dad0d034462ce0;hp=61e74d0eae98c2515ac4c482c923bb4461410bdc;hpb=821c540a2d41f633b1a4e1cd8bda82b8b2ff60de;p=freeside.git diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 61e74d0ea..c592bac6b 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -4,6 +4,7 @@ use vars qw($default_dir @config_items $DEBUG ); use IO::File; use File::Basename; use FS::ConfItem; +use FS::ConfDefaults; $DEBUG = 0; @@ -95,6 +96,21 @@ sub config { } } +=item config_binary KEY + +Returns the exact scalar value for key. + +=cut + +sub config_binary { + my($self,$file)=@_; + my($dir)=$self->dir; + my $fh = new IO::File "<$dir/$file" or return; + local $/; + my $content = <$fh>; + $content; +} + =item exists KEY Returns true if the specified key exists, even if the corresponding value @@ -209,6 +225,31 @@ sub config_items { new FS::ConfItem { 'key' => $basename, 'section' => 'billing', + 'description' => 'Alternate HTML template for invoices. See the billing documentation for details.', + 'type' => 'textarea', + } + } glob($self->dir. '/invoice_html_*') + ), + ( map { + my $basename = basename($_); + $basename =~ /^(.*)$/; + $basename = $1; + ($latexname = $basename ) =~ s/latex/html/; + new FS::ConfItem { + 'key' => $basename, + 'section' => 'billing', + 'description' => "Alternate Notes section for HTML invoices. Defaults to the same data in $latexname if not specified.", + 'type' => 'textarea', + } + } glob($self->dir. '/invoice_htmlnotes_*') + ), + ( map { + my $basename = basename($_); + $basename =~ /^(.*)$/; + $basename = $1; + new FS::ConfItem { + 'key' => $basename, + 'section' => 'billing', 'description' => 'Alternate LaTeX template for invoices. See the billing documentation for details.', 'type' => 'textarea', } @@ -302,6 +343,34 @@ httemplate/docs/config.html }, { + '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', 'description' => 'Business::OnlinePayment 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.', @@ -323,6 +392,13 @@ httemplate/docs/config.html }, { + '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', 'description' => 'DEPRECATED, add a bsdshell export instead. Your BSD flavored shell (and mail) machines, one per line. This enables export of `/etc/passwd\' and `/etc/master.passwd\'.', @@ -337,6 +413,17 @@ httemplate/docs/config.html }, { + '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', 'description' => 'DEPRECATED, add a cyrus export instead. This option used to integrate with Cyrus IMAP Server, three lines: IMAP server, admin username, and admin password. Cyrus::IMAP::Admin should be installed locally and the connection to the server secured.', @@ -359,29 +446,29 @@ 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' => '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', }, @@ -437,7 +524,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', }, @@ -505,9 +592,38 @@ httemplate/docs/config.html }, { + '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', }, @@ -526,6 +642,13 @@ httemplate/docs/config.html }, { + 'key' => 'invoice_latexreturnaddress', + 'section' => 'billing', + 'description' => 'Return address for LaTeX typeset PostScript invoices.', + 'type' => 'textarea', + }, + + { 'key' => 'invoice_latexsmallfooter', 'section' => 'billing', 'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.', @@ -557,7 +680,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', }, @@ -565,7 +688,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: ', 'type' => 'textarea', }, @@ -612,7 +735,7 @@ httemplate/docs/config.html 'editlist_parts' => [ { type=>'text' }, { type=>'immutable', value=>'IN' }, { type=>'select', - select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS)} }, + select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS TXT)} }, { type=> 'text' }, ], }, @@ -939,6 +1062,13 @@ httemplate/docs/config.html 'type' => 'checkbox', }, + { + 'key' => 'username-percent', + 'section' => 'username', + 'description' => 'Allow the percent character (%) in usernames.', + 'type' => 'checkbox', + }, + { 'key' => 'username_policy', 'section' => 'deprecated', @@ -1082,6 +1212,33 @@ httemplate/docs/config.html 'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.', 'type' => 'checkbox', }, + { + key => 'signup_server-classnum2', + section => '', + description => 'Package Class for first optional purchase', + type => 'select-sub', + options_sub => sub { my @o = map { $_->{classnum} => $_->{classname} } map { $_->hashref } FS::Record::qsearch('pkg_class',{}); + } , + option_sub => sub { return map { $_->hashref->{classname}} FS::Record::qsearchs('pkg_class', { classnum => shift } ); }, + + }, + + { + key => 'signup_server-classnum3', + section => '', + description => 'Package Class for second optional purchase', + type => 'select-sub', + options_sub => sub { my @o = map { $_->{classnum} => $_->{classname} } map { $_->hashref } FS::Record::qsearch('pkg_class',{}); + } , + option_sub => sub { return map { $_->hashref->{classname}} FS::Record::qsearchs('pkg_class', { classnum => shift } ); }, + }, + + { + 'key' => 'backend-realtime', + 'section' => '', + 'description' => 'Run billing for backend signups immediately.', + 'type' => 'checkbox', + }, { 'key' => 'declinetemplate', @@ -1140,9 +1297,16 @@ httemplate/docs/config.html }, { + 'key' => 'require_taxclasses', + 'section' => 'billing', + 'description' => 'Require a taxclass to be entered for every package', + 'type' => 'checkbox', + }, + + { 'key' => 'welcome_email', 'section' => '', - '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 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', 'type' => 'textarea', }, @@ -1169,11 +1333,19 @@ httemplate/docs/config.html }, { + 'key' => 'payby', + 'section' => 'billing', + 'description' => 'Available payment types.', + 'type' => 'selectmultiple', + 'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP) ], + }, + + { 'key' => 'payby-default', 'section' => 'UI', 'description' => 'Default payment type. HIDE disables display of billing information and sets customers to BILL.', 'type' => 'select', - 'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL COMP HIDE) ], + 'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP HIDE) ], }, { @@ -1222,8 +1394,8 @@ httemplate/docs/config.html { 'key' => 'users-allow_comp', - 'section' => '', - 'description' => 'Usernames (Freeside users, created with freeside-adduser) which can create complimentary customers, one per line. If no usernames are entered, all users can create complimentary accounts.', + 'section' => 'deprecated', + 'description' => 'DEPRECATED, enable the Complimentary customer access right instead. Was: Usernames (Freeside users, created with freeside-adduser) which can create complimentary customers, one per line. If no usernames are entered, all users can create complimentary accounts.', 'type' => 'textarea', }, @@ -1315,9 +1487,9 @@ httemplate/docs/config.html { 'key' => 'global_unique-username', 'section' => 'username', - '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)', + '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.', 'type' => 'select', - 'select_enum' => [ 'none', 'username', 'username@domain' ], + 'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ], }, { @@ -1338,16 +1510,37 @@ httemplate/docs/config.html { 'key' => 'ticket_system', 'section' => '', - 'description' => 'Ticketing system integraiton. RT_Internal uses the built-in RT ticketing system (use make create-rt to create the necessary tables). RT_Libs uses the built-in RT libraries to access an RT installation in a separate database (local or remote). RT_External uses raw SQL access (and eventually RT\'s XML interface and RTx::Atom?) to access an RT installation in a separate database (local or remote).', + 'description' => 'Ticketing system integration. RT_Internal uses the built-in RT ticketing system (see the integrated ticketing installation instructions). RT_External accesses an external RT installation in a separate database (local or remote).', 'type' => 'select', - 'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ], + #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ], + 'select_enum' => [ '', qw(RT_Internal RT_External) ], }, { 'key' => 'ticket_system-default_queueid', 'section' => '', - 'description' => 'Default queue number used when creating new customer tickets.', - 'type' => 'text', + 'description' => 'Default queue used when creating new customer tickets.', + 'type' => 'select-sub', + 'options_sub' => sub { + my $conf = new FS::Conf; + if ( $conf->config('ticket_system') ) { + eval "use FS::TicketSystem;"; + die $@ if $@; + FS::TicketSystem->queues(); + } else { + (); + } + }, + 'option_sub' => sub { + my $conf = new FS::Conf; + if ( $conf->config('ticket_system') ) { + eval "use FS::TicketSystem;"; + die $@ if $@; + FS::TicketSystem->queue(shift); + } else { + ''; + } + }, }, { @@ -1372,6 +1565,21 @@ httemplate/docs/config.html }, { + 'key' => 'ticket_system-rt_external_datasrc', + 'section' => '', + 'description' => 'With external RT integration, the DBI data source for the external RT installation, for example, 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', @@ -1380,8 +1588,22 @@ httemplate/docs/config.html { 'key' => 'echeck-void', - 'section' => 'billing', - 'description' => 'Enable local-only voiding of echeck payments in addition to refunds against the payment gateway', + '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', }, @@ -1405,6 +1627,213 @@ httemplate/docs/config.html '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 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.', + 'type' => 'checkbox', + }, + + { + 'key' => 'svc_acct-usage_unsuspend', + 'section' => 'billing', + '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.', + 'type' => 'checkbox', + }, + + { + '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', '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' ] + }, + + { + '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' => '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' => '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 customr 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', + }, + ); 1;