X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FConf.pm;h=8c5b296e03cf1d169bcd989f3a9d4bdaff10e006;hb=024d4735a2894915bb36e9926fa0d0af26c2beee;hp=e1fb8427bc952aab8f7ffd3a98f2671c181a02bf;hpb=7efa0ac8ebfef28bf6cb277c0c2b53159479df21;p=freeside.git diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index e1fb8427b..8c5b296e0 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -97,7 +97,7 @@ sub _config { $hashref->{agentnum} = $agentnum; local $FS::Record::conf = undef; # XXX evil hack prevents recursion my $cv = FS::Record::qsearchs('conf', $hashref); - if (!$cv && defined($agentnum)) { + if (!$cv && defined($agentnum) && $agentnum) { $hashref->{agentnum} = ''; $cv = FS::Record::qsearchs('conf', $hashref); } @@ -108,7 +108,11 @@ sub config { my $self = shift; return $self->_usecompat('config', @_) if use_confcompat; - my($name,$agentnum)=@_; + my($name, $agentnum)=@_; + + carp "FS::Conf->config($name, $agentnum) called" + if $DEBUG > 1; + my $cv = $self->_config($name, $agentnum) or return; if ( wantarray ) { @@ -146,7 +150,11 @@ sub exists { my $self = shift; return $self->_usecompat('exists', @_) if use_confcompat; - my($name,$agentnum)=@_; + my($name, $agentnum)=@_; + + carp "FS::Conf->exists($name, $agentnum) called" + if $DEBUG > 1; + defined($self->_config($name, $agentnum)); } @@ -326,7 +334,7 @@ sub import_config_item { warn "Inserting $key\n" if $DEBUG; local $/; my $value = readline(new IO::File "$dir/$key"); - if ($item->type eq 'binary') { + if ($item->type =~ /^(binary|image)$/ ) { $self->set_binary($key, $value); }else{ $self->set($key, $value); @@ -355,7 +363,8 @@ sub verify_config_item { $error .= "$key fails existential comparison; " if $self->exists($key) xor $compat->exists($key); - unless ($type eq 'binary') { + if ( $type !~ /^(binary|image)$/ ) { + { no warnings; $error .= "$key fails scalar comparison; " @@ -372,22 +381,24 @@ sub verify_config_item { $error .= "$key fails list comparison; " unless $r; } - } - if ($type eq 'binary') { + } else { + $error .= "$key fails binary comparison; " unless scalar($self->config_binary($key)) eq scalar($compat->config_binary($key)); - } - if ($error =~ /existential comparison/ && $item->section eq 'deprecated') { - my $proto; - for ( @config_items ) { $proto = $_; last if $proto->key eq $key; } - unless ($proto->key eq $key) { - warn "removed config item $error\n" if $DEBUG; - $error = ''; - } } +#remove deprecated config on our own terms, not freeside-upgrade's +# if ($error =~ /existential comparison/ && $item->section eq 'deprecated') { +# my $proto; +# for ( @config_items ) { $proto = $_; last if $proto->key eq $key; } +# unless ($proto->key eq $key) { +# warn "removed config item $error\n" if $DEBUG; +# $error = ''; +# } +# } + $error; } @@ -471,7 +482,7 @@ sub config_items { =item init-config DIR -Imports the non-deprecated configuration items from DIR (1.7 compatible) +Imports the configuration items from DIR (1.7 compatible) to conf records in the database. =cut @@ -556,6 +567,7 @@ worry that config_items is freeside-specific and icky. 'section' => 'billing', 'description' => 'Template file for billing method expiration alerts. See the billing documentation for details.', 'type' => 'textarea', + 'per-agent' => 1, }, { @@ -763,6 +775,15 @@ worry that config_items is freeside-specific and icky. 'section' => 'required', 'description' => 'Return address on email invoices', 'type' => 'text', + 'per_agent' => 1, + }, + + { + 'key' => 'invoice_subject', + 'section' => 'billing', + 'description' => 'Subject: header on email invoices. Defaults to "Invoice". The following substitutions are available: $name, $name_short, $invoice_number, and $invoice_date.', + 'type' => 'text', + 'per_agent' => 1, }, { @@ -1459,6 +1480,13 @@ worry that config_items is freeside-specific and icky. }, { + 'key' => 'ignore_incalculable_taxes', + 'section' => 'billing', + 'description' => 'Prefer to invoice without tax over not billing at all', + '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', @@ -1701,6 +1729,14 @@ worry that config_items is freeside-specific and icky. }, { + 'key' => 'global_unique-phonenum', + 'section' => '', + 'description' => 'Global phone number uniqueness control: none (usual setting - check countrycode+phonenumun uniqueness per exports), or countrycode+phonenum (all countrycode+phonenum pairs are globally unique, regardless of exports). disabled turns off duplicate checking completely and is STRONGLY NOT RECOMMENDED unless you REALLY need to turn this off.', + 'type' => 'select', + 'select_enum' => [ 'none', 'countrycode+phonenum', 'disabled' ], + }, + + { 'key' => 'svc_external-skip_manual', 'section' => 'UI', '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).', @@ -1799,6 +1835,7 @@ worry that config_items is freeside-specific and icky. 'section' => 'required', 'description' => 'Your company name', 'type' => 'text', + 'per_agent' => 1, #XXX just FS/FS/ClientAPI/Signup.pm }, { @@ -1806,6 +1843,7 @@ worry that config_items is freeside-specific and icky. 'section' => 'required', 'description' => 'Your company address', 'type' => 'textarea', + 'per_agent' => 1, }, { @@ -1937,6 +1975,13 @@ worry that config_items is freeside-specific and icky. }, { + 'key' => 'cust_pkg-always_show_location', + 'section' => 'UI', + 'description' => "Always display package locations, even when they're all the default service address.", + 'type' => 'checkbox', + }, + + { 'key' => 'svc_acct-edit_uid', 'section' => 'shell', 'description' => 'Allow UID editing.', @@ -1988,7 +2033,14 @@ worry that config_items is freeside-specific and icky. { '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.', + 'description' => 'By default, tax calculations are done based on the billing address. Enable this switch to calculate tax based on the shipping address instead.', + 'type' => 'checkbox', + } +, + { + 'key' => 'tax-pkg_address', + 'section' => 'billing', + 'description' => 'By default, tax calculations are done based on the billing address. Enable this switch to calculate tax based on the package address instead (when present).', 'type' => 'checkbox', }, @@ -2230,15 +2282,18 @@ worry that config_items is freeside-specific and icky. { 'key' => 'logo.png', 'section' => 'billing', #? - 'description' => 'An image to include in some types of invoices', - 'type' => 'binary', + 'description' => 'Company logo for HTML invoices and the backoffice interface, in PNG format. Suggested size somewhere near 92x62.', + 'type' => 'image', + 'per_agent' => 1, #XXX just view/logo.cgi, which is for the global + #old-style editor anyway...? }, { 'key' => 'logo.eps', 'section' => 'billing', #? - 'description' => 'An image to include in some types of invoices', + 'description' => 'Company logo for printed and PDF invoices, in EPS format.', 'type' => 'binary', + 'per_agent' => 1, #XXX as above, kinda }, { @@ -2584,6 +2639,27 @@ worry that config_items is freeside-specific and icky. 'type' => 'text', }, + { + 'key' => 'cdr-charged_party-accountcode', + 'section' => '', + 'description' => 'Set the charged_party field of CDRs to the accountcode.', + 'type' => 'checkbox', + }, + + { + 'key' => 'cdr-taqua-da_rewrite', + 'section' => '', + 'description' => 'For the Taqua CDR format, a comma-separated list of directory assistance 800 numbers. Any CDRs with these numbers as "BilledNumber" will be rewritten to the "CallingPartyNumber" (and CallType "12") on import.', + 'type' => 'text', + }, + + { + 'key' => 'cust_pkg-show_autosuspend', + 'section' => 'UI', + 'description' => 'Show package auto-suspend dates. Use with caution for now; can slow down customer view for large insallations.', + 'type' => 'checkbox', + }, + ); 1;