Bugzilla – Attachment 124802 Details for
Bug 28959
virtualshelves.category is really a boolean
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28959: (follow-up) Adjust all places in which 'category' was used
Bug-28959-follow-up-Adjust-all-places-in-which-cat.patch (text/plain), 9.74 KB, created by
David Nind
on 2021-09-11 20:38:02 UTC
(
hide
)
Description:
Bug 28959: (follow-up) Adjust all places in which 'category' was used
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-09-11 20:38:02 UTC
Size:
9.74 KB
patch
obsolete
>From e39538d46237c1ee39f263dc37473710eb22fcf4 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 8 Sep 2021 16:44:16 -0300 >Subject: [PATCH] Bug 28959: (follow-up) Adjust all places in which 'category' > was used > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/Auth.pm | 8 ++++---- > admin/background_jobs.pl | 4 ++-- > 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, 28 insertions(+), 28 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index ac635b1a9c..05687b7109 100644 >--- a/C4/Auth.pm >+++ b/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( >@@ -1356,7 +1356,7 @@ sub checkauth { > require Koha::Virtualshelves; > my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( > { >- category => 2, >+ public => 1, > } > ); > $template->param( >diff --git a/admin/background_jobs.pl b/admin/background_jobs.pl >index 9a474857b6..9460a5334b 100755 >--- a/admin/background_jobs.pl >+++ b/admin/background_jobs.pl >@@ -54,8 +54,8 @@ if ( $op eq 'view' ) { > $template->param( > lists => scalar Koha::Virtualshelves->search( > [ >- { category => 1, owner => $loggedinuser }, >- { category => 2 } >+ { public => 0, owner => $loggedinuser }, >+ { public => 1 } > ] > ) > ) if $job->type eq 'batch_biblio_record_modification'; >diff --git a/catalogue/ISBDdetail.pl b/catalogue/ISBDdetail.pl >index 969aca17a0..d991d3e799 100755 >--- a/catalogue/ISBDdetail.pl >+++ b/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, > } > ); > >diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl >index 7ddbbd40dd..4ff6a03c54 100755 >--- a/catalogue/MARCdetail.pl >+++ b/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, > } > ); > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 0cb204ced9..30a0edae52 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -426,14 +426,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, > } > ); > >diff --git a/catalogue/labeledMARCdetail.pl b/catalogue/labeledMARCdetail.pl >index a8f33a674f..785c292154 100755 >--- a/catalogue/labeledMARCdetail.pl >+++ b/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, > } > ); > >diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl >index e033a2105b..cff2460a27 100755 >--- a/catalogue/moredetail.pl >+++ b/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, > } > ); > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 8ed6ff3181..feb106ae07 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -719,14 +719,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, > } > ); > >diff --git a/opac/opac-addbybiblionumber.pl b/opac/opac-addbybiblionumber.pl >index 176a1c4fd2..7dfe42cc14 100755 >--- a/opac/opac-addbybiblionumber.pl >+++ b/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, >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index a9eb913f00..2369a15541 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -925,7 +925,7 @@ if (C4::Context->preference("virtualshelves") ) { > my $shelves = Koha::Virtualshelves->search( > { > biblionumber => $biblionumber, >- category => 2, >+ public => 1, > }, > { > join => 'virtualshelfcontents', >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 0ea238da3d..5e53f94648 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -889,14 +889,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, > } > ); > >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28959
:
124619
|
124620
|
124621
|
124622
|
124623
|
124624
|
124625
|
124663
|
124788
|
124799
|
124800
|
124801
|
124802
|
124803
|
124807
|
124808
|
124809
|
124810
|
124811
|
127046
|
127047
|
127048
|
127049
|
127050
|
127059
|
127060
|
127062
|
127142
|
127206
|
128036