Bug 29408: Add JSDoc documentation for kohaTable function
[koha-ffzg.git] / opac / opac-addbybiblionumber.pl
index 176a1c4..7dfe42c 100755 (executable)
@@ -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,