[freeside-commits] freeside/FS/FS Conf.pm,1.308,1.309

Jeff Finucane,420,, jeff at wavetail.420.am
Wed Aug 12 07:58:51 PDT 2009


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv21347/FS/FS

Modified Files:
	Conf.pm 
Log Message:
internalize billco-upload and automate the transfer to the provider RT#5902

Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.308
retrieving revision 1.309
diff -u -d -r1.308 -r1.309
--- Conf.pm	9 Aug 2009 09:05:38 -0000	1.308
+++ Conf.pm	12 Aug 2009 14:58:49 -0000	1.309
@@ -76,11 +76,23 @@
   $1;
 }
 
-=item config KEY [ AGENTNUM ]
+=item conf KEY [ AGENTNUM [ NODEFAULT ] ]
+
+Returns the L<FS::conf> 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 @@
   $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 @@
   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 @@
   }
 }
 
-=item config_binary KEY [ AGENTNUM ]
+=item config_binary KEY [ AGENTNUM [ NODEFAULT ] ]
 
 Returns the exact scalar value for key.
 
@@ -136,12 +145,11 @@
   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 @@
 
   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 @@
   },
 
   {
+    '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' => '<a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> 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.',



More information about the freeside-commits mailing list