fix usergroup in edit/part_svc.cgi
[freeside.git] / FS / FS / Conf.pm
index 639f06b..156aed3 100644 (file)
@@ -1,11 +1,15 @@
 package FS::Conf;
 
-use vars qw($default_dir @config_items @card_types $DEBUG );
+use vars qw($default_dir $base_dir @config_items @card_types $DEBUG );
 use IO::File;
 use File::Basename;
 use FS::ConfItem;
 use FS::ConfDefaults;
 
+$base_dir = '%%%FREESIDE_CONF%%%';
+$default_dir = '%%%FREESIDE_CONF%%%';
+
+
 $DEBUG = 0;
 
 =head1 NAME
@@ -52,13 +56,15 @@ $FS::Conf::default_dir has not been set.
 sub new {
   my($proto,$dir) = @_;
   my($class) = ref($proto) || $proto;
-  my($self) = { 'dir' => $dir || $default_dir } ;
+  my($self) = { 'dir'      => $dir || $default_dir,
+                'base_dir' => $base_dir,
+              };
   bless ($self, $class);
 }
 
 =item dir
 
-Returns the directory.
+Returns the conf directory.
 
 =cut
 
@@ -73,6 +79,23 @@ sub dir {
   $1;
 }
 
+=item base_dir
+
+Returns the base directory.  By default this is /usr/local/etc/freeside.
+
+=cut
+
+sub base_dir {
+  my($self) = @_;
+  my $base_dir = $self->{base_dir};
+  -e $base_dir or die "FATAL: $base_dir doesn't exist!";
+  -d $base_dir or die "FATAL: $base_dir isn't a directory!";
+  -r $base_dir or die "FATAL: Can't read $base_dir!";
+  -x $base_dir or die "FATAL: $base_dir not searchable (executable)!";
+  $base_dir =~ /^(.*)$/;
+  $1;
+}
+
 =item config KEY
 
 Returns the configuration value or values (depending on context) for key.
@@ -473,6 +496,13 @@ httemplate/docs/config.html
   },
 
   {
+    'key'         => 'deleterefunds',
+    'section'     => 'billing',
+    'description' => 'Enable deletion of unclosed refunds.  Be very careful!  Only delete refunds that were data-entry errors, not adjustments.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'unapplypayments',
     'section'     => 'deprecated',
     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable "unapplication" of unclosed payments.',
@@ -529,6 +559,13 @@ httemplate/docs/config.html
   },
 
   {
+    'key'         => 'emailinvoiceautoalways',
+    'section'     => 'billing',
+    'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses',
+    'type'       => 'checkbox',
+  },
+
+  {
     'key'         => 'exclude_ip_addr',
     'section'     => '',
     'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
@@ -1865,7 +1902,8 @@ httemplate/docs/config.html
     'section'     => 'billing',
     'description' => 'Default format for batches.',
     'type'        => 'select',
-    'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ]
+    'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch',
+                       'csv-chase_canada-E-xactBatch', 'BoM', 'PAP' ]
   },
 
   {
@@ -1873,7 +1911,8 @@ httemplate/docs/config.html
     'section'     => 'billing',
     'description' => 'Fixed (unchangeable) format for credit card batches.',
     'type'        => 'select',
-    'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ]
+    'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
+                       'csv-chase_canada-E-xactBatch', 'BoM', 'PAP' ]
   },
 
   {
@@ -1885,6 +1924,13 @@ httemplate/docs/config.html
   },
 
   {
+    'key'         => 'batch-increment_expiration',
+    'section'     => 'billing',
+    'description' => 'Increment expiration date years in batches until cards are current.  Make sure this is acceptable to your batching provider before enabling.',
+    'type'        => 'checkbox'
+  },
+
+  {
     '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',
@@ -1892,6 +1938,20 @@ httemplate/docs/config.html
   },
 
   {
+    'key'         => 'batchconfig-PAP',
+    'section'     => 'billing',
+    'description' => 'Configuration for PAP batching, seven lines: 1. Origin ID, 2. Datacenter, 3. Typecode, 4. Short name, 5. Long name, 6. Bank, 7. Bank account',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'batchconfig-csv-chase_canada-E-xactBatch',
+    'section'     => 'billing',
+    'description' => 'Gateway ID for Chase Canada E-xact batching',
+    'type'        => 'text',
+  },
+
+  {
     'key'         => 'payment_history-years',
     'section'     => 'UI',
     'description' => 'Number of years of payment history to show by default.  Currently defaults to 2.',
@@ -1970,6 +2030,20 @@ httemplate/docs/config.html
     'select_enum' => \@card_types,
   },
 
+  {
+    'key'         => 'dashboard-toplist',
+    'section'     => 'UI',
+    'description' => 'List of items to display on the top of the front page',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'impending_recur_template',
+    'section'     => 'billing',
+    'description' => 'Template file for alerts about looming first time recurrant billing.  See the <a href="../docs/billing.html#invoice_template">billing documentation</a> for details.  Also see packages with a <a href="../browse/part_pkg.cgi">flat price plan</a>',
+    'type'        => 'textarea',
+  },
+
 );
 
 1;