projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT# 83450 - fixed rateplan export
[freeside.git]
/
FS
/
FS
/
part_export
/
acct_sql_status.pm
diff --git
a/FS/FS/part_export/acct_sql_status.pm
b/FS/FS/part_export/acct_sql_status.pm
index
5ad462e
..
0e73431
100644
(file)
--- a/
FS/FS/part_export/acct_sql_status.pm
+++ b/
FS/FS/part_export/acct_sql_status.pm
@@
-4,14
+4,18
@@
use base qw( FS::part_export::sql_Common );
use strict;
use warnings;
use vars qw( %info );
use strict;
use warnings;
use vars qw( %info );
+use Tie::IxHash;
+use FS::DBI;
-
my $options = __PACKAGE__->sql_options
;
-delete $options
->
{$_} for qw( table schema static primary_key );
+
tie my %options, 'Tie::IxHash', %{__PACKAGE__->sql_options}
;
+delete $options{$_} for qw( table schema static primary_key );
%info = (
'svc' => 'svc_acct',
%info = (
'svc' => 'svc_acct',
- 'options' => $options,
+ 'desc' => 'Mailbox status information from SQL',
+ 'options' => \%options,
'nodomain' => '',
'nodomain' => '',
+ 'no_machine' => 1,
'notes' => <<END
Read mailbox status information (vacation and spam settings) from an SQL
database, tables "vacation" and "users" respectively.
'notes' => <<END
Read mailbox status information (vacation and spam settings) from an SQL
database, tables "vacation" and "users" respectively.
@@
-30,17
+34,17
@@
sub _export_unsuspend {}
sub export_getstatus {
my($self, $svc_acct, $htmlref, $hashref) = @_;
sub export_getstatus {
my($self, $svc_acct, $htmlref, $hashref) = @_;
- my $dbh = DBI->connect( map $self->option($_), qw(datasrc username password) )
- or
do { $hashref->{'error'} = "can't connect: ". $DBI::errstr; return; }
;
+ my $dbh =
FS::
DBI->connect( map $self->option($_), qw(datasrc username password) )
+ or
return "can't connect: ". $FS::DBI::errstr
;
###
#vacation settings
###
my $vsth = $dbh->prepare('SELECT * FROM vacation WHERE email = ?')
###
#vacation settings
###
my $vsth = $dbh->prepare('SELECT * FROM vacation WHERE email = ?')
- or
do { $hashref->{'error'} = "can't prepare: ". $dbh->errstr; return; }
;
+ or
return "can't prepare: ". $dbh->errstr
;
$vsth->execute( $svc_acct->email )
$vsth->execute( $svc_acct->email )
- or
do { $hashref->{'error'} = "can't execute: ". $vsth->errstr; return; }
;
+ or
return "can't execute: ". $vsth->errstr
;
my $vrow = $vsth->fetchrow_hashref;
if ( $vrow ) {
my $vrow = $vsth->fetchrow_hashref;
if ( $vrow ) {
@@
-58,9
+62,9
@@
sub export_getstatus {
###
my $ssth = $dbh->prepare('SELECT * FROM users WHERE address = ?')
###
my $ssth = $dbh->prepare('SELECT * FROM users WHERE address = ?')
- or
do { $hashref->{'error'} = "can't prepare: ". $dbh->errstr; return; }
;
+ or
return "can't prepare: ". $dbh->errstr
;
$ssth->execute( $svc_acct->email )
$ssth->execute( $svc_acct->email )
- or
do { $hashref->{'error'} = "can't execute: ". $ssth->errstr; return; }
;
+ or
return "can't execute: ". $ssth->errstr
;
my $srow = $ssth->fetchrow_hashref;
if ( $srow ) {
my $srow = $ssth->fetchrow_hashref;
if ( $srow ) {
@@
-79,6
+83,9
@@
sub export_getstatus {
#htmlref not implemented/used for this status export
#htmlref not implemented/used for this status export
+
+ ''; #no errors
+
}
1;
}
1;