@@ -, +, @@ was used --- C4/Auth.pm | 8 ++++---- Koha/BackgroundJob/BatchUpdateBiblio.pm | 6 ++++-- catalogue/ISBDdetail.pl | 4 ++-- catalogue/MARCdetail.pl | 4 ++-- catalogue/detail.pl | 4 ++-- catalogue/labeledMARCdetail.pl | 4 ++-- catalogue/moredetail.pl | 4 ++-- catalogue/search.pl | 4 ++-- opac/opac-addbybiblionumber.pl | 14 +++++++------- opac/opac-detail.pl | 2 +- opac/opac-search.pl | 4 ++-- 11 files changed, 30 insertions(+), 28 deletions(-) --- a/C4/Auth.pm +++ a/C4/Auth.pm @@ -287,12 +287,12 @@ sub get_template_and_user { my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( { borrowernumber => $borrowernumber, - category => 1, + public => 0, } ); my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( { - category => 2, + public => 1, } ); $template->param( @@ -431,7 +431,7 @@ sub get_template_and_user { require Koha::Virtualshelves; my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( { - category => 2, + public => 1, } ); $template->param( @@ -1329,7 +1329,7 @@ sub checkauth { require Koha::Virtualshelves; my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( { - category => 2, + public => 1, } ); $template->param( --- a/Koha/BackgroundJob/BatchUpdateBiblio.pm +++ a/Koha/BackgroundJob/BatchUpdateBiblio.pm @@ -156,10 +156,12 @@ sub additional_report { my $loggedinuser = C4::Context->userenv ? C4::Context->userenv->{'number'} : undef; return { lists => scalar Koha::Virtualshelves->search( - [ { category => 1, owner => $loggedinuser }, { category => 2 } ] + [ + { public => 0, owner => $loggedinuser }, + { public => 1 } + ] ), }; - } 1; --- a/catalogue/ISBDdetail.pl +++ a/catalogue/ISBDdetail.pl @@ -152,14 +152,14 @@ my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( { borrowernumber => $loggedinuser, add_allowed => 1, - category => 1, + public => 0, } ); my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( { borrowernumber => $loggedinuser, add_allowed => 1, - category => 2, + public => 1, } ); --- a/catalogue/MARCdetail.pl +++ a/catalogue/MARCdetail.pl @@ -344,14 +344,14 @@ my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( { borrowernumber => $loggedinuser, add_allowed => 1, - category => 1, + public => 0, } ); my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( { borrowernumber => $loggedinuser, add_allowed => 1, - category => 2, + public => 1, } ); --- a/catalogue/detail.pl +++ a/catalogue/detail.pl @@ -434,14 +434,14 @@ my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( { borrowernumber => $borrowernumber, add_allowed => 1, - category => 1, + public => 0, } ); my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( { borrowernumber => $borrowernumber, add_allowed => 1, - category => 2, + public => 1, } ); --- a/catalogue/labeledMARCdetail.pl +++ a/catalogue/labeledMARCdetail.pl @@ -138,14 +138,14 @@ my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( { borrowernumber => $loggedinuser, add_allowed => 1, - category => 1, + public => 0, } ); my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( { borrowernumber => $loggedinuser, add_allowed => 1, - category => 2, + public => 1, } ); --- a/catalogue/moredetail.pl +++ a/catalogue/moredetail.pl @@ -278,14 +278,14 @@ my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( { borrowernumber => $loggedinuser, add_allowed => 1, - category => 1, + public => 0, } ); my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( { borrowernumber => $loggedinuser, add_allowed => 1, - category => 2, + public => 1, } ); --- a/catalogue/search.pl +++ a/catalogue/search.pl @@ -683,14 +683,14 @@ my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( { borrowernumber => $borrowernumber, add_allowed => 1, - category => 1, + public => 0, } ); my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( { borrowernumber => $borrowernumber, add_allowed => 1, - category => 2, + public => 1, } ); --- a/opac/opac-addbybiblionumber.pl +++ a/opac/opac-addbybiblionumber.pl @@ -33,7 +33,7 @@ my $selectedshelf = $query->param('selectedshelf'); my $newshelf = $query->param('newshelf'); my $shelfnumber = $query->param('shelfnumber'); my $newvirtualshelf = $query->param('newvirtualshelf'); -my $category = $query->param('category'); +my $public = $query->param('public'); my ( $errcode, $authorized ) = ( 0, 1 ); my @biblios; @@ -56,10 +56,10 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( if ($newvirtualshelf) { if ($loggedinuser > 0 - and ( $category == 1 - or $category == 2 and $loggedinuser > 0 && C4::Context->preference('OpacAllowPublicListCreation') ) + and ( !$public + or $public and $loggedinuser > 0 && C4::Context->preference('OpacAllowPublicListCreation') ) ) { - my $shelf = eval { Koha::Virtualshelf->new( { shelfname => $newvirtualshelf, category => $category, owner => $loggedinuser, } )->store; }; + my $shelf = eval { Koha::Virtualshelf->new( { shelfname => $newvirtualshelf, public => $public, owner => $loggedinuser, } )->store; }; if ( $@ or not $shelf ) { $errcode = 1; $authorized = 0; @@ -104,21 +104,21 @@ if ($newvirtualshelf) { } else { if ( $loggedinuser > 0 ) { my $private_shelves = Koha::Virtualshelves->search( - { category => 1, + { 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, --- a/opac/opac-detail.pl +++ a/opac/opac-detail.pl @@ -924,7 +924,7 @@ if (C4::Context->preference("virtualshelves") ) { my $shelves = Koha::Virtualshelves->search( { biblionumber => $biblionumber, - category => 2, + public => 1, }, { join => 'virtualshelfcontents', --- a/opac/opac-search.pl +++ a/opac/opac-search.pl @@ -854,14 +854,14 @@ my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( { borrowernumber => $borrowernumber, add_allowed => 1, - category => 1, + public => 0, } ); my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( { borrowernumber => $borrowernumber, add_allowed => 1, - category => 2, + public => 1, } ); --