use FS::conf;
use FS::Record qw(qsearch qsearchs);
use FS::UID qw(dbh datasrc use_confcompat);
+use FS::Misc::Invoicing qw( spool_formats );
use FS::Misc::Geo;
$base_dir = '%%%FREESIDE_CONF%%%';
my $self = shift;
return $self->_usecompat('exists', @_) if use_confcompat;
- my($name, $agentnum)=@_;
+ #my($name, $agentnum)=@_;
carp "FS::Conf->exists(". join(', ', @_). ") called"
if $DEBUG > 1;
defined($self->_config(@_));
}
+#maybe this should just be the new exists instead of getting a method of its
+#own, but i wanted to avoid possible fallout
+
+sub config_bool {
+ my $self = shift;
+ return $self->_usecompat('exists', @_) if use_confcompat;
+
+ my($name,$agentnum,$agentonly) = @_;
+
+ carp "FS::Conf->config_bool(". join(', ', @_). ") called"
+ if $DEBUG > 1;
+
+ #defined($self->_config(@_));
+
+ #false laziness w/_config
+ my $hashref = { 'name' => $name };
+ local $FS::Record::conf = undef; # XXX evil hack prevents recursion
+ my $cv;
+ my @a = (
+ ($agentnum || ()),
+ ($agentonly && $agentnum ? () : '')
+ );
+ my @l = (
+ ($self->{locale} || ()),
+ ($self->{localeonly} && $self->{locale} ? () : '')
+ );
+ # try with the agentnum first, then fall back to no agentnum if allowed
+ foreach my $a (@a) {
+ $hashref->{agentnum} = $a;
+ foreach my $l (@l) {
+ $hashref->{locale} = $l;
+ $cv = FS::Record::qsearchs('conf', $hashref);
+ if ( $cv ) {
+ if ( $cv->value eq '0'
+ && ($hashref->{agentnum} || $hashref->{locale} )
+ )
+ {
+ return 0; #an explicit false override, don't continue looking
+ } else {
+ return 1;
+ }
+ }
+ }
+ }
+ return 0;
+
+}
+
=item config_orbase KEY SUFFIX
Returns the configuration value or values (depending on context) for
return $self->_usecompat('touch', @_) if use_confcompat;
my($name, $agentnum) = @_;
- unless ( $self->exists($name, $agentnum) ) {
- $self->set($name, '', $agentnum);
+ #unless ( $self->exists($name, $agentnum) ) {
+ unless ( $self->config_bool($name, $agentnum) ) {
+ if ( $agentnum && $self->exists($name) && $self->config($name,$agentnum) eq '0' ) {
+ $self->delete($name, $agentnum);
+ } else {
+ $self->set($name, '', $agentnum);
+ }
}
}
}
}
+#maybe this should just be the new delete instead of getting a method of its
+#own, but i wanted to avoid possible fallout
+
+sub delete_bool {
+ my $self = shift;
+ return $self->_usecompat('delete', @_) if use_confcompat;
+
+ my($name, $agentnum) = @_;
+
+ warn "[FS::Conf] DELETE $name\n" if $DEBUG;
+
+ my $cv = FS::Record::qsearchs('conf', { name => $name,
+ agentnum => $agentnum,
+ locale => $self->{locale},
+ });
+
+ if ( $cv ) {
+ my $error = $cv->delete;
+ die $error if $error;
+ } elsif ( $agentnum ) {
+ $self->set($name, '0', $agentnum);
+ }
+
+}
+
=item import_config_item CONFITEM DIR
Imports the item specified by the CONFITEM (see L<FS::ConfItem>) into
'description' => 'Send payment receipts.',
'type' => 'checkbox',
'per_agent' => 1,
+ 'agent_bool' => 1,
},
{
'type' => 'checkbox',
},
+ {
+ 'key' => 'unmask_ss',
+ 'section' => 'UI',
+ 'description' => "Don't mask social security numbers in the web interface.",
+ 'type' => 'checkbox',
+ },
+
{
'key' => 'show_stateid',
'section' => 'UI',
'section' => 'invoicing',
'description' => 'Enable FTP of raw invoice data - format.',
'type' => 'select',
- 'select_enum' => [ '', 'default', 'oneline', 'billco', ],
+ 'options' => [ spool_formats() ],
},
{
'section' => 'invoicing',
'description' => 'Enable spooling of raw invoice data - format.',
'type' => 'select',
- 'select_enum' => [ '', 'default', 'oneline', 'billco', ],
+ 'options' => [ spool_formats() ],
},
{
'type' => 'checkbox',
},
+ {
+ 'key' => 'bridgestone-batch_counter',
+ 'section' => '',
+ 'description' => 'Batch counter for spool files. Increments every time a spool file is uploaded.',
+ 'type' => 'text',
+ 'per_agent' => 1,
+ },
+
+ {
+ 'key' => 'bridgestone-prefix',
+ 'section' => '',
+ 'description' => 'Agent identifier for uploading to BABT printing service.',
+ 'type' => 'text',
+ 'per_agent' => 1,
+ },
+
+ {
+ 'key' => 'bridgestone-confirm_template',
+ 'section' => '',
+ 'description' => 'Confirmation email template for uploading to BABT service. Text::Template format, with variables "$zipfile" (name of the zipped file), "$seq" (sequence number), "$prefix" (user ID string), and "$rows" (number of records in the file). Should include Subject: and To: headers, separated from the rest of the message by a blank line.',
+ # this could use a true message template, but it's hard to see how that
+ # would make the world a better place
+ 'type' => 'textarea',
+ 'per_agent' => 1,
+ },
+
{
'key' => 'svc_acct-usage_suspend',
'section' => 'billing',
'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
},
+ {
+ 'key' => 'cust_location-label_prefix',
+ 'section' => 'UI',
+ 'description' => 'Optional "site ID" to show in the location label',
+ 'type' => 'select',
+ 'select_hash' => [ '' => '',
+ 'CoStAg' => 'CoStAgXXXXX (country, state, agent name, locationnum)',
+ ],
+ },
+
{
'key' => 'cust_pkg-display_times',
'section' => 'UI',
{
'key' => 'cust_main-enable_birthdate',
'section' => 'UI',
- 'descritpion' => 'Enable tracking of a birth date with each customer record',
+ 'description' => 'Enable tracking of a birth date with each customer record',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'cust_main-enable_spouse_birthdate',
+ 'section' => 'UI',
+ 'description' => 'Enable tracking of a spouse birth date with each customer record',
'type' => 'checkbox',
},
'section' => 'billing',
'description' => 'Display format for line item date ranges on invoice line items.',
'type' => 'select',
- 'select_hash' => [ '' => 'STARTDATE-ENDDATE',
- 'month_of' => 'Month of MONTHNAME',
+ 'select_hash' => [ '' => 'STARTDATE-ENDDATE',
+ 'month_of' => 'Month of MONTHNAME',
+ 'X_month' => 'DATE_DESC MONTHNAME',
],
+ 'per_agent' => 1,
+ },
+
+ {
+ 'key' => 'cust_bill-line_item-date_description',
+ 'section' => 'billing',
+ 'description' => 'Text to display for "DATE_DESC" when using cust_bill-line_item-date_style DATE_DESC MONTHNAME.',
+ 'type' => 'text',
+ 'per_agent' => 1,
},
{
'section' => 'UI',
'description' => 'Prefix the customer number with this string for display purposes.',
'type' => 'text',
- #and then probably agent-virt this to merge these instances
+ 'per_agent' => 1,
+ },
+
+ {
+ 'key' => 'cust_main-custnum-display_special',
+ 'section' => 'UI',
+ 'description' => 'Use this customer number prefix format',
+ 'type' => 'select',
+ 'select_hash' => [ '' => '',
+ 'CoStAg' => 'CoStAg (country, state, agent name or display_prefix)',
+ 'CoStCl' => 'CoStCl (country, state, class name)' ],
},
{
'type' => 'text',
},
+ {
+ 'key' => 'unsuspend_email_admin',
+ 'section' => '',
+ 'description' => 'Destination admin email address to enable unsuspension notices',
+ 'type' => 'text',
+ },
+
{
'key' => 'email_report-subject',
'section' => '',
'per_agent' => 1,
},
+ {
+ 'key' => 'selfservice-stripe1_bgcolor',
+ 'section' => 'self-service',
+ 'description' => 'HTML color for self-service interface lists (primary stripe), for example, #FFFFFF',
+ 'type' => 'text',
+ 'per_agent' => 1,
+ },
+
+ {
+ 'key' => 'selfservice-stripe2_bgcolor',
+ 'section' => 'self-service',
+ 'description' => 'HTML color for self-service interface lists (alternate stripe), for example, #DDDDDD',
+ 'type' => 'text',
+ 'per_agent' => 1,
+ },
+
{
'key' => 'selfservice-text_color',
'section' => 'self-service',
'type' => 'checkbox',
},
+ {
+ 'key' => 'selfservice-login_banner_image',
+ 'section' => 'self-service',
+ 'description' => 'Banner image shown on the login page, in PNG format.',
+ 'type' => 'image',
+ },
+
+ {
+ 'key' => 'selfservice-login_banner_url',
+ 'section' => 'self-service',
+ 'description' => 'Link for the login banner.',
+ 'type' => 'text',
+ },
+
{
'key' => 'selfservice-bulk_format',
'section' => 'deprecated',
'type' => 'checkbox',
},
- {
- 'key' => 'sg-multicustomer_hack',
- 'section' => '',
- 'description' => "Don't use this.",
- 'type' => 'checkbox',
- },
-
- {
- 'key' => 'sg-ping_username',
- 'section' => '',
- 'description' => "Don't use this.",
- 'type' => 'text',
- },
-
- {
- 'key' => 'sg-ping_password',
- 'section' => '',
- 'description' => "Don't use this.",
- 'type' => 'text',
- },
-
- {
- 'key' => 'sg-login_username',
- 'section' => '',
- 'description' => "Don't use this.",
- 'type' => 'text',
- },
-
{
'key' => 'mc-outbound_packages',
'section' => '',
'type' => 'textarea',
},
+ {
+ 'key' => 'tax-cust_exempt-groups-require_individual_nums',
+ 'section' => '',
+ 'description' => 'When using tax-cust_exempt-groups, require an individual tax exemption number for each exemption from different taxes.',
+ 'type' => 'checkbox',
+ },
+
{
'key' => 'cust_main-default_view',
'section' => 'UI',
{
'key' => 'cust_main-edit_signupdate',
'section' => 'UI',
- 'descritpion' => 'Enable manual editing of the signup date.',
+ 'description' => 'Enable manual editing of the signup date.',
'type' => 'checkbox',
},
{
'key' => 'svc_acct-disable_access_number',
'section' => 'UI',
- 'descritpion' => 'Disable access number selection.',
+ 'description' => 'Disable access number selection.',
'type' => 'checkbox',
},
'type' => 'textarea',
},
+ {
+ 'key' => 'cust_main-custom_content',
+ 'section' => 'UI',
+ 'description' => 'As an alternative to cust_main-custom_link (leave it blank), the contant to display on this customer page, one item per line. Available iems are: small_custview, birthdate, spouse_birthdate, svc_acct, svc_phone and svc_external.',
+ 'type' => 'textarea',
+ },
+
{
'key' => 'cust_main-custom_title',
'section' => 'UI',
},
'option_sub' => sub { FS::Locales->description(shift) },
},
+
+ {
+ 'key' => 'cust_main-require_locale',
+ 'section' => 'UI',
+ 'description' => 'Require an explicit locale to be chosen for new customers.',
+ 'type' => 'checkbox',
+ },
{
'key' => 'translate-auto-insert',
'type' => 'select-agent',
},
+ {
+ 'key' => 'cust_class-tax_exempt',
+ 'section' => 'billing',
+ 'description' => 'Control the tax exemption flag per customer class rather than per indivual customer.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'selfservice-billing_history-line_items',
+ 'section' => 'self-service',
+ 'description' => 'Return line item billing detail for the self-service billing_history API call.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'logout-timeout',
+ 'section' => 'UI',
+ 'description' => 'If set, automatically log users out of the backoffice after this many minutes.',
+ 'type' => 'text',
+ },
{ key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
{ key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },