'/cgi-bin/koha/opac-shelves.pl?display=privateshelves&viewshelf=';
use CGI qw ( -utf8 );
-use Email::Address;
use C4::Auth qw( get_template_and_user );
use C4::Context;
use C4::Letters;
use C4::Output qw( output_html_with_http_headers );
+use Koha::Email;
use Koha::Patrons;
use Koha::Virtualshelves;
use Koha::Virtualshelfshares;
$shelf = Koha::Virtualshelves->find( $shelfnumber ) unless $param->{errcode};
$param->{shelfname} = $shelf ? $shelf->shelfname : q||;
$param->{owner} = $shelf ? $shelf->owner : -1;
- $param->{category} = $shelf ? $shelf->category : -1;
+ $param->{public} = $shelf ? $shelf->public : 0;
load_template($param);
return $param;
# You must not be the owner and the list must be private
if( !$shelf ) {
$param->{errcode} = 2;
- } elsif( $shelf->category == 2 ) {
+ } elsif( $shelf->public ) {
$param->{errcode} = 5;
} elsif( $shelf->owner == $param->{loggedinuser} ) {
$param->{errcode} = 8;
foreach my $a (@temp) {
$a =~ s/^\s+//;
$a =~ s/\s+$//;
- if ( $a =~ m/$Email::Address::mailbox/ ) {
+ if ( Koha::Email->is_valid($a) ) {
push @appr_addr, $a;
}
else {
#sharing user should be the owner
#list should be private
$param->{errcode} = 4 if $param->{owner} != $param->{loggedinuser};
- $param->{errcode} = 5 if !$param->{errcode} && $param->{category} != 1;
+ $param->{errcode} = 5 if !$param->{errcode} && $param->{public};
return !defined $param->{errcode};
}