X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FConf.pm;h=b7edd0dee80204a1823e41ddbe485821381758fb;hb=65bfed89f6eff03f32ba6199e3a2e2debcd1a009;hp=f797f275c237f0b2025d5545c7295cc0b12d9b10;hpb=e2985f4afb40416c37e1c815b21b1c914095db45;p=freeside.git diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index f797f275c..b7edd0dee 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -1,6 +1,7 @@ package FS::Conf; use vars qw($base_dir @config_items @base_items @card_types $DEBUG); +use Carp; use IO::File; use File::Basename; use MIME::Base64; @@ -84,7 +85,7 @@ global default if one is present. sub _usecompat { my ($self, $method) = (shift, shift); - warn "NO CONFIGURATION RECORDS FOUND -- USING COMPATIBILITY MODE" + carp "NO CONFIGURATION RECORDS FOUND -- USING COMPATIBILITY MODE" if use_confcompat; my $compat = new FS::Conf_compat17 ("$base_dir/conf." . datasrc); $compat->$method(@_); @@ -171,6 +172,30 @@ sub config_orbase { } } +=item invoice_templatenames + +Returns all possible invoice template names. + +=cut + +sub invoice_templatenames { + my( $self ) = @_; + + my %templatenames = (); + foreach my $item ( $self->config_items ) { + foreach my $base ( @base_items ) { + my( $main, $ext) = split(/\./, $base); + $ext = ".$ext" if $ext; + if ( $item->key =~ /^${main}_(.+)$ext$/ ) { + $templatenames{$1}++; + } + } + } + + sort keys %templatenames; + +} + =item touch KEY [ AGENT ]; Creates the specified configuration key if it does not exist. @@ -396,7 +421,7 @@ sub _orbase_items { map { new FS::ConfItem { 'key' => $_, 'section' => $proto->section, - 'description' => 'Alternate ' . $proto->description . ' See the billing documentation for details.', + 'description' => 'Alternate ' . $proto->description . ' See the billing documentation for details.', 'type' => $proto->type, }; } &$listmaker($base); @@ -465,8 +490,6 @@ worry that config_items is freeside-specific and icky. "Configuration" in the web interface (config/config.cgi). -httemplate/docs/config.html - =cut #Business::CreditCard @@ -498,6 +521,21 @@ httemplate/docs/config.html logo.eps ); +@base_items = qw ( + invoice_template + invoice_latex + invoice_latexreturnaddress + invoice_latexfooter + invoice_latexsmallfooter + invoice_latexnotes + invoice_html + invoice_htmlreturnaddress + invoice_htmlfooter + invoice_htmlnotes + logo.png + logo.eps + ); + @config_items = map { new FS::ConfItem $_ } ( { @@ -510,7 +548,7 @@ httemplate/docs/config.html { 'key' => 'alerter_template', 'section' => 'billing', - 'description' => 'Template file for billing method expiration alerts. See the billing documentation for details.', + 'description' => 'Template file for billing method expiration alerts. See the billing documentation for details.', 'type' => 'textarea', }, @@ -578,6 +616,13 @@ httemplate/docs/config.html }, { + 'key' => 'business-onlinepayment-email_customer', + 'section' => 'billing', + 'description' => 'Controls the "email_customer" flag used by some Business::OnlinePayment processors to enable customer receipts.', + 'type' => 'checkbox', + }, + + { 'key' => 'countrydefault', 'section' => 'UI', 'description' => 'Default two-letter country code (if not supplied, the default is `US\')', @@ -695,7 +740,7 @@ httemplate/docs/config.html { 'key' => 'home', - 'section' => 'required', + 'section' => 'shell', 'description' => 'For new users, prefixed to username to create a directory name. Should have a leading but not a trailing slash.', 'type' => 'text', }, @@ -709,15 +754,15 @@ httemplate/docs/config.html { 'key' => 'invoice_template', - 'section' => 'required', - 'description' => 'Required template file for invoices. See the billing documentation for details.', + 'section' => 'billing', + 'description' => 'Text template file for invoices. Used if no invoice_html template is defined, and also seen by users using non-HTML capable mail clients. See the billing documentation for details.', 'type' => 'textarea', }, { 'key' => 'invoice_html', 'section' => 'billing', - 'description' => 'Optional HTML template for invoices. See the billing documentation for details.', + 'description' => 'Optional HTML template for invoices. See the billing documentation for details.', 'type' => 'textarea', }, @@ -746,7 +791,7 @@ httemplate/docs/config.html { 'key' => 'invoice_latex', 'section' => 'billing', - 'description' => 'Optional LaTeX template for typeset PostScript invoices. See the billing documentation for details.', + 'description' => 'Optional LaTeX template for typeset PostScript invoices. See the billing documentation for details.', 'type' => 'textarea', }, @@ -798,7 +843,14 @@ httemplate/docs/config.html 'section' => 'billing', 'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.', 'type' => 'select', - 'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 30', 'Net 45', 'Net 60' ], + 'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 20', 'Net 30', 'Net 45', 'Net 60' ], + }, + + { + 'key' => 'invoice_sections', + 'section' => 'billing', + 'description' => 'Split invoice into sections and label according to package type when enabled.', + 'type' => 'checkbox', }, { @@ -912,7 +964,7 @@ httemplate/docs/config.html { 'key' => 'shells', - 'section' => 'required', + 'section' => 'shell', '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.', 'type' => 'textarea', }, @@ -927,7 +979,7 @@ httemplate/docs/config.html { 'key' => 'signupurl', 'section' => 'UI', - 'description' => 'if you are using customer-to-customer referrals, and you enter the URL of your signup server CGI, the customer view screen will display a customized link to the signup server with the appropriate customer as referral', + 'description' => 'if you are using customer-to-customer referrals, and you enter the URL of your signup server CGI, the customer view screen will display a customized link to the signup server with the appropriate customer as referral', 'type' => 'text', }, @@ -1060,7 +1112,7 @@ httemplate/docs/config.html { 'key' => 'username-uppercase', 'section' => 'username', - 'description' => 'Allow uppercase characters in usernames', + 'description' => 'Allow uppercase characters in usernames. Not recommended for use with FreeRADIUS with MySQL backend, which is case-insensitive by default.', 'type' => 'checkbox', }, @@ -1579,7 +1631,7 @@ httemplate/docs/config.html { 'key' => 'ticket_system', 'section' => '', - '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).', + '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_External) ], @@ -1613,6 +1665,13 @@ httemplate/docs/config.html }, { + 'key' => 'ticket_system-priority_reverse', + 'section' => '', + 'description' => 'Enable this to consider lower numbered priorities more important. A bad habit we picked up somewhere. You probably want to avoid it and use the default.', + 'type' => 'checkbox', + }, + + { 'key' => 'ticket_system-custom_priority_field', 'section' => '', 'description' => 'Custom field from the ticketing system to use as a custom priority classification.', @@ -1656,9 +1715,23 @@ httemplate/docs/config.html }, { + 'key' => 'company_address', + 'section' => 'required', + 'description' => 'Your company address', + 'type' => 'textarea', + }, + + { 'key' => 'address2-search', 'section' => 'UI', - 'description' => 'Enable a "Unit" search box which searches the second address field', + 'description' => 'Enable a "Unit" search box which searches the second address field. Useful for multi-tenant applications. See also: cust_main-require_address2', + 'type' => 'checkbox', + }, + + { + 'key' => 'cust_main-require_address2', + 'section' => 'UI', + 'description' => 'Second address field is required (on service address only, if billing and service addresses differ). Also enables "Unit" labeling of address2 on customer view and edit pages. Useful for multi-tenant applications. See also: address2-search', 'type' => 'checkbox', }, @@ -1912,6 +1985,25 @@ httemplate/docs/config.html }, { + 'key' => 'disable-fuzzy', + 'section' => 'UI', + 'description' => 'Disable fuzzy searching. Speeds up searching for large sites, but only shows exact matches.', + 'type' => 'checkbox', + }, + + { 'key' => 'pkg_referral', + 'section' => '', + 'description' => 'Enable package-specific advertising sources.', + 'type' => 'checkbox', + }, + + { 'key' => 'pkg_referral-multiple', + 'section' => '', + 'description' => 'In addition, allow multiple advertising sources to be associated with a single package.', + 'type' => 'checkbox', + }, + + { 'key' => 'dashboard-toplist', 'section' => 'UI', 'description' => 'List of items to display on the top of the front page', @@ -1948,6 +2040,14 @@ httemplate/docs/config.html }, { + 'key' => 'selfservice-session_timeout', + 'section' => '', + 'description' => 'Self-service session timeout. Defaults to 1 hour.', + 'type' => 'select', + 'select_enum' => [ '1 hour', '2 hours', '4 hours', '8 hours', '1 day', '1 week', ], + }, + + { 'key' => 'disable_setup_suspended_pkgs', 'section' => 'billing', 'description' => 'Disables charging of setup fees for suspended packages.', @@ -1989,6 +2089,119 @@ httemplate/docs/config.html 'type' => 'checkbox', }, + { + 'key' => 'support_packages', + 'section' => '', + 'description' => 'A list of packages eligible for RT ticket time transfer, one pkgpart per line.', #this should really be a select multiple, or specified in the packages themselves... + 'type' => 'textarea', + }, + + { + 'key' => 'cust_main-require_phone', + 'section' => '', + 'description' => 'Require daytime or night for all customer records.', + 'type' => 'checkbox', + }, + + { + 'key' => 'cust_main-require_invoicing_list_email', + 'section' => '', + 'description' => 'Email address field is required: require at least one invoicing email address for all customer records.', + 'type' => 'checkbox', + }, + + { + 'key' => 'svc_acct-display_paid_time_remaining', + 'section' => '', + 'description' => 'Show paid time remaining in addition to time remaining.', + 'type' => 'checkbox', + }, + + { + 'key' => 'cancel_credit_type', + 'section' => 'billing', + 'description' => 'The group to use for new, automatically generated credit reasons resulting from cancellation.', + 'type' => 'select-sub', + 'options_sub' => sub { require FS::Record; + require FS::reason_type; + map { $_->typenum => $_->type } + FS::Record::qsearch('reason_type', { class=>'R' } ); + }, + 'option_sub' => sub { require FS::Record; + require FS::reason_type; + my $reason_type = FS::Record::qsearchs( + 'reason_type', { 'typenum' => shift } + ); + $reason_type ? $reason_type->type : ''; + }, + }, + + { + 'key' => 'referral_credit_type', + 'section' => 'billing', + 'description' => 'The group to use for new, automatically generated credit reasons resulting from referrals.', + 'type' => 'select-sub', + 'options_sub' => sub { require FS::Record; + require FS::reason_type; + map { $_->typenum => $_->type } + FS::Record::qsearch('reason_type', { class=>'R' } ); + }, + 'option_sub' => sub { require FS::Record; + require FS::reason_type; + my $reason_type = FS::Record::qsearchs( + 'reason_type', { 'typenum' => shift } + ); + $reason_type ? $reason_type->type : ''; + }, + }, + + { + 'key' => 'signup_credit_type', + 'section' => 'billing', + 'description' => 'The group to use for new, automatically generated credit reasons resulting from signup and self-service declines.', + 'type' => 'select-sub', + 'options_sub' => sub { require FS::Record; + require FS::reason_type; + map { $_->typenum => $_->type } + FS::Record::qsearch('reason_type', { class=>'R' } ); + }, + 'option_sub' => sub { require FS::Record; + require FS::reason_type; + my $reason_type = FS::Record::qsearchs( + 'reason_type', { 'typenum' => shift } + ); + $reason_type ? $reason_type->type : ''; + }, + }, + + { + 'key' => 'cust_main-agent_custid-format', + 'section' => '', + 'description' => 'Enables searching of various formatted values in cust_main.agent_custid', + 'type' => 'select', + 'select_hash' => [ + '' => 'Numeric only', + 'ww?d+' => 'Numeric with one or two letter prefix', + ], + }, + + { + 'key' => 'card_masking_method', + 'section' => 'UI', + 'description' => 'Digits to display when masking credit cards. Note that the first six digits are necessary to canonically identify the credit card type (Visa/MC, Amex, Discover, Maestro, etc.) in all cases. The first four digits can identify the most common credit card types in most cases (Visa/MC, Amex, and Discover). The first two digits can distinguish between Visa/MC and Amex.', + 'type' => 'select', + 'select_hash' => [ + '' => '123456xxxxxx1234', + 'first6last2' => '123456xxxxxxxx12', + 'first4last4' => '1234xxxxxxxx1234', + 'first4last2' => '1234xxxxxxxxxx12', + 'first2last4' => '12xxxxxxxxxx1234', + 'first2last2' => '12xxxxxxxxxxxx12', + 'first0last4' => 'xxxxxxxxxxxx1234', + 'first0last2' => 'xxxxxxxxxxxxxx12', + ], + }, + ); 1;