X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=virtualshelves%2Faddbybiblionumber.pl;h=ff0ef5045b0546cb0bd3d3cbc50a146d2d72829a;hb=d123287b18e063e50e5cb5a8e90122f67b2b07b2;hp=8d43ab9439d14366e9c98982d0a9fb9b3e543e62;hpb=638786e719fb297ae976061b09a71f3d788416f4;p=koha-ffzg.git diff --git a/virtualshelves/addbybiblionumber.pl b/virtualshelves/addbybiblionumber.pl index 8d43ab9439..ff0ef5045b 100755 --- a/virtualshelves/addbybiblionumber.pl +++ b/virtualshelves/addbybiblionumber.pl @@ -44,9 +44,9 @@ addbybiblionumber.pl if this parameter exists, then it must be equals to the name of the shelf to add. -=item category +=item public - if this script has to add a shelf, it add one with this category. + if this script has to add a shelf, it adds one with this 'public' setting. =item newshelf @@ -59,18 +59,17 @@ addbybiblionumber.pl use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Biblio; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use Koha::Biblios; use Koha::Virtualshelves; -my $query = new CGI; +my $query = CGI->new; my $shelfnumber = $query->param('shelfnumber'); my $newvirtualshelf = $query->param('newvirtualshelf'); my $newshelf = $query->param('newshelf'); -my $category = $query->param('category'); +my $public = $query->param('public'); my $sortfield = $query->param('sortfield'); my $confirmed = $query->param('confirmed') || 0; my ( $errcode, $authorized ) = ( 0, 1 ); @@ -96,7 +95,7 @@ if ($newvirtualshelf) { Koha::Virtualshelf->new( { shelfname => $newvirtualshelf, - category => $category, + public => $public, sortfield => $sortfield, owner => $loggedinuser, } @@ -150,21 +149,21 @@ if ($newvirtualshelf) { } else { my $private_shelves = Koha::Virtualshelves->search( - { category => 1, - owner => $loggedinuser, + { public => 0, + owner => $loggedinuser, allow_change_from_owner => 1, }, { order_by => 'shelfname' } ); my $shelves_shared_with_me = Koha::Virtualshelves->search( - { category => 1, + { public => 0, 'virtualshelfshares.borrowernumber' => $loggedinuser, allow_change_from_others => 1, }, { join => 'virtualshelfshares', } ); my $public_shelves = Koha::Virtualshelves->search( - { category => 2, + { public => 1, -or => [ -and => { allow_change_from_owner => 1,