From: ivan Date: Sun, 15 Jan 2012 05:32:00 +0000 (+0000) Subject: display spam status on account view, RT#15987 X-Git-Tag: freeside_2_3_1~15 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=ba161fc6892f284af6504b6bba578523a248f1ba display spam status on account view, RT#15987 --- diff --git a/FS/FS/part_export/acct_sql_status.pm b/FS/FS/part_export/acct_sql_status.pm index 78a086c3e..e6aeb2071 100644 --- a/FS/FS/part_export/acct_sql_status.pm +++ b/FS/FS/part_export/acct_sql_status.pm @@ -33,16 +33,16 @@ 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; }; + or return "can't connect: ". $DBI::errstr; ### #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 ) - or do { $hashref->{'error'} = "can't execute: ". $vsth->errstr; return; }; + or return "can't execute: ". $vsth->errstr; my $vrow = $vsth->fetchrow_hashref; if ( $vrow ) { @@ -60,9 +60,9 @@ sub export_getstatus { ### 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 ) - or do { $hashref->{'error'} = "can't execute: ". $ssth->errstr; return; }; + or return "can't execute: ". $ssth->errstr; my $srow = $ssth->fetchrow_hashref; if ( $srow ) { @@ -81,6 +81,9 @@ sub export_getstatus { #htmlref not implemented/used for this status export + + ''; #no errors + } 1; diff --git a/FS/FS/svc_Common.pm b/FS/FS/svc_Common.pm index 9137c3f69..499afe0fd 100644 --- a/FS/FS/svc_Common.pm +++ b/FS/FS/svc_Common.pm @@ -996,9 +996,8 @@ sub export_getsettings { my %defaults = (); my $error = $self->export('getsettings', \%settings, \%defaults); if ( $error ) { - #XXX bubble this up better warn "error running export_getsetings: $error"; - return ( {}, {} ); + return ( { 'error' => $error }, {} ); } ( \%settings, \%defaults ); } @@ -1016,9 +1015,8 @@ sub export_getstatus { my %hash = (); my $error = $self->export('getstatus', \$html, \%hash); if ( $error ) { - #XXX bubble this up better warn "error running export_getstatus: $error"; - return ( '', {} ); + return ( '', { 'error' => $error } ); } ( $html, \%hash ); } diff --git a/httemplate/view/elements/svc_export_status.html b/httemplate/view/elements/svc_export_status.html index 7efd3df16..d96bb277d 100644 --- a/httemplate/view/elements/svc_export_status.html +++ b/httemplate/view/elements/svc_export_status.html @@ -7,9 +7,7 @@ % foreach my $key ( sort {$a cmp $b} keys %$hashref ) { <% $key |h %> - - <% $hashref->{$key} |h %> - + <% $hashref->{$key} |h %> % }