X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FConf.pm;h=aa6a133217140220de3aa2f25247d09c6a264312;hb=25cf511573ebff303700ce71611450ad72debcbc;hp=1da55837c949db65cc05548290116bb7b4ba186b;hpb=283ea2b5137ae3ec36882b492e6de024b0ce6027;p=freeside.git diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 1da55837c..aa6a13321 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -76,11 +76,23 @@ sub base_dir { $1; } -=item config KEY [ AGENTNUM ] +=item conf KEY [ AGENTNUM [ NODEFAULT ] ] + +Returns the L record for the key and agent. + +=cut + +sub conf { + my $self = shift; + $self->_config(@_); +} + +=item config KEY [ AGENTNUM [ NODEFAULT ] ] Returns the configuration value or values (depending on context) for key. The optional agent number selects an agent specific value instead of the -global default if one is present. +global default if one is present. If NODEFAULT is true only the agent +specific value(s) is returned. =cut @@ -92,14 +104,13 @@ sub _usecompat { $compat->$method(@_); } -# needs a non _ name, called externally by config-view now (and elsewhere?) sub _config { - my($self,$name,$agentnum)=@_; + my($self,$name,$agentnum,$agentonly)=@_; my $hashref = { 'name' => $name }; $hashref->{agentnum} = $agentnum; local $FS::Record::conf = undef; # XXX evil hack prevents recursion my $cv = FS::Record::qsearchs('conf', $hashref); - if (!$cv && defined($agentnum) && $agentnum) { + if (!$agentonly && !$cv && defined($agentnum) && $agentnum) { $hashref->{agentnum} = ''; $cv = FS::Record::qsearchs('conf', $hashref); } @@ -110,12 +121,10 @@ sub config { my $self = shift; return $self->_usecompat('config', @_) if use_confcompat; - my($name, $agentnum)=@_; - - carp "FS::Conf->config($name, $agentnum) called" + carp "FS::Conf->config(". join(', ', @_). ") called" if $DEBUG > 1; - my $cv = $self->_config($name, $agentnum) or return; + my $cv = $self->_config(@_) or return; if ( wantarray ) { my $v = $cv->value; @@ -126,7 +135,7 @@ sub config { } } -=item config_binary KEY [ AGENTNUM ] +=item config_binary KEY [ AGENTNUM [ NODEFAULT ] ] Returns the exact scalar value for key. @@ -136,12 +145,11 @@ sub config_binary { my $self = shift; return $self->_usecompat('config_binary', @_) if use_confcompat; - my($name,$agentnum)=@_; - my $cv = $self->_config($name, $agentnum) or return; + my $cv = $self->_config(@_) or return; decode_base64($cv->value); } -=item exists KEY [ AGENTNUM ] +=item exists KEY [ AGENTNUM [ NODEFAULT ] ] Returns true if the specified key exists, even if the corresponding value is undefined. @@ -154,10 +162,10 @@ sub exists { my($name, $agentnum)=@_; - carp "FS::Conf->exists($name, $agentnum) called" + carp "FS::Conf->exists(". join(', ', @_). ") called" if $DEBUG > 1; - defined($self->_config($name, $agentnum)); + defined($self->_config(@_)); } =item config_orbase KEY SUFFIX @@ -620,6 +628,40 @@ worry that config_items is freeside-specific and icky. }, { + 'key' => 'billco-url', + 'section' => 'billing', + 'description' => 'The url to use for performing uploads to the invoice mailing service.', + 'type' => 'text', + 'per_agent' => 1, + }, + + { + 'key' => 'billco-username', + 'section' => 'billing', + 'description' => 'The login name to use for uploads to the invoice mailing service.', + 'type' => 'text', + 'per_agent' => 1, + 'agentonly' => 1, + }, + + { + 'key' => 'billco-password', + 'section' => 'billing', + 'description' => 'The password to use for uploads to the invoice mailing service.', + 'type' => 'text', + 'per_agent' => 1, + 'agentonly' => 1, + }, + + { + 'key' => 'billco-clicode', + 'section' => 'billing', + 'description' => 'The clicode to use for uploads to the invoice mailing service.', + 'type' => 'text', + 'per_agent' => 1, + }, + + { '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.', @@ -973,11 +1015,22 @@ worry that config_items is freeside-specific and icky. { 'key' => 'payment_receipt_email', 'section' => 'billing', - '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: ', + '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' => [qw( checkbox textarea )], }, { + 'key' => 'payment_receipt-trigger', + 'section' => 'billing', + 'description' => 'When payment receipts are triggered. Defaults to when payment is made.', + 'type' => 'select', + 'select_hash' => [ + 'cust_pay' => 'When payment is made.', + 'cust_bill_pay_pkg' => 'When payment is applied.', + ], + }, + + { 'key' => 'lpr', 'section' => 'required', 'description' => 'Print command for paper invoices, for example `lpr -h\'', @@ -2445,6 +2498,14 @@ worry that config_items is freeside-specific and icky. }, { + 'key' => 'dashboard-install_welcome', + 'section' => 'UI', + 'description' => 'New install welcome screen.', + 'type' => 'select', + 'select_enum' => [ '', 'ITSP_fsinc_hosted', ], + }, + + { 'key' => 'dashboard-toplist', 'section' => 'UI', 'description' => 'List of items to display on the top of the front page', @@ -2693,7 +2754,7 @@ worry that config_items is freeside-specific and icky. 'section' => 'UI', 'description' => 'The year to use in census tract lookups', 'type' => 'select', - 'select_enum' => [ qw( 2008 2007 2006 ) ], + 'select_enum' => [ qw( 2009 2008 2007 2006 ) ], }, { @@ -2727,7 +2788,14 @@ worry that config_items is freeside-specific and icky. { 'key' => 'cust_main-default_agent_custid', 'section' => 'UI', - 'description' => 'Display the agent_custid field instead of the custnum field.', + 'description' => 'Display the agent_custid field when available instead of the custnum field.', + 'type' => 'checkbox', + }, + + { + 'key' => 'cust_bill-default_agent_invid', + 'section' => 'UI', + 'description' => 'Display the agent_invid field when available instead of the invnum field.', 'type' => 'checkbox', }, @@ -3037,6 +3105,13 @@ worry that config_items is freeside-specific and icky. 'type' => 'checkbox', }, + { + 'key' => 'svc_acct-disable_access_number', + 'section' => 'UI', + 'descritpion' => 'Disable access number selection.', + 'type' => 'checkbox', + }, + { key => "apacheroot", section => "deprecated", description => "DEPRECATED", type => "text" }, { key => "apachemachine", section => "deprecated", description => "DEPRECATED", type => "text" }, { key => "apachemachines", section => "deprecated", description => "DEPRECATED", type => "text" },