Bugzilla – Attachment 127049 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), 10.02 KB, created by
Jonathan Druart
on 2021-10-28 12:23:42 UTC
(
hide
)
Description:
Bug 28959: (follow-up) Adjust all places in which 'category' was used
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-10-28 12:23:42 UTC
Size:
10.02 KB
patch
obsolete
>From bc411ebc00459b5a732e8b6275ed07692ee7f16d 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 >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> >--- > 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(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index a9bd7fe365f..d6cd32d3eb2 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( >@@ -1329,7 +1329,7 @@ sub checkauth { > require Koha::Virtualshelves; > my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( > { >- category => 2, >+ public => 1, > } > ); > $template->param( >diff --git a/Koha/BackgroundJob/BatchUpdateBiblio.pm b/Koha/BackgroundJob/BatchUpdateBiblio.pm >index 013fecbb1ac..8ab10008374 100644 >--- a/Koha/BackgroundJob/BatchUpdateBiblio.pm >+++ b/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; >diff --git a/catalogue/ISBDdetail.pl b/catalogue/ISBDdetail.pl >index 969aca17a02..d991d3e799a 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 7ddbbd40dde..4ff6a03c548 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 0c2bc884d24..f5d9582da99 100755 >--- a/catalogue/detail.pl >+++ b/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, > } > ); > >diff --git a/catalogue/labeledMARCdetail.pl b/catalogue/labeledMARCdetail.pl >index a8f33a674f1..785c2921542 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 e033a2105b2..cff2460a278 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 c0063a1b402..5da9c063f3b 100755 >--- a/catalogue/search.pl >+++ b/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, > } > ); > >diff --git a/opac/opac-addbybiblionumber.pl b/opac/opac-addbybiblionumber.pl >index 176a1c4fd2d..7dfe42cc143 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 73ea3b46a08..69b791e1d50 100755 >--- a/opac/opac-detail.pl >+++ b/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', >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 22e97da817c..8f93d689841 100755 >--- a/opac/opac-search.pl >+++ b/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, > } > ); > >-- >2.25.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