Bugzilla – Attachment 151328 Details for
Bug 33722
Cannot see existing public lists from virtualshelves/addbybiblionumber.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33722: Make public lists viewable for users on virtualshelves/addbybiblionumber.pl
Bug-33722-Make-public-lists-viewable-for-users-on-.patch (text/plain), 5.91 KB, created by
David Nind
on 2023-05-16 21:39:44 UTC
(
hide
)
Description:
Bug 33722: Make public lists viewable for users on virtualshelves/addbybiblionumber.pl
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-05-16 21:39:44 UTC
Size:
5.91 KB
patch
obsolete
>From 07fcd00ae353eea37cda5e068c9d780b5267d658 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 11 May 2023 23:17:51 +0000 >Subject: [PATCH] Bug 33722: Make public lists viewable for users on > virtualshelves/addbybiblionumber.pl > >To test: >1. Have two users with staff access and lists permissions. ( User A and User B) >2. Create some public lists with User A. Make some that are for staff only and some for everyone. >3. Make sure you create at least 10 different public lists. >4. Log in to the staff interface as user B and search the catalog. >5. Select a few titles and in the toolbar click 'Add to list'. >6. Here you should properly see your lists and any public lists which you can edit. >7. If you have more than 10 lists you won't see them all in this dropdown. >8. At the bottom of the dropdown you should see 'More lists', click it. >9. Notice here you cannot select any of the existing public lists which User B should be able to edit. >10. APPLY PATCH >11. Repeate steps 5 - 8. Now you should be able to edit public lists. >12. Create some private lists with User A and make sure User B cannot see them. >13. PLay with some new lists for User A and change 'Allow changes to contents from' and make sure User B can see the ones they should. > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../virtualshelves/addbybiblionumber.tt | 21 +++------ > virtualshelves/addbybiblionumber.pl | 44 +++++++------------ > 2 files changed, 23 insertions(+), 42 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/addbybiblionumber.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/addbybiblionumber.tt >index 51b9dde8e6..48cca158a1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/addbybiblionumber.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/addbybiblionumber.tt >@@ -36,31 +36,24 @@ > [% UNLESS ( shelfnumber ) %] > > [% UNLESS ( newshelf ) %] >- [% IF private_shelves.count OR public_shelves.count OR private_shelves_shared_with_me.count %] >+ [% IF add_to_some_public_shelves.count OR add_to_some_private_shelves %] > <fieldset class="rows"> > <legend>Select an existing list</legend> > <ol> > <li> > <label>Choose list</label> > <select name="shelfnumber" id="shelfnumber"> >- [% IF private_shelves.count %] >+ [% IF add_to_some_private_shelves.count %] > <optgroup label="Private lists"> >- [% FOREACH private_shelf IN private_shelves %] >- <option value="[% private_shelf.shelfnumber | html %]">[% private_shelf.shelfname | html %]</option> >+ [% FOREACH s IN add_to_some_private_shelves %] >+ <option value="[% s.shelfnumber | html %]">[% s.shelfname | html %]</option> > [% END %] > </optgroup> > [% END %] >- [% IF private_shelves_shared_with_me.count %] >- <optgroup label="Private lists shared with me"> >- [% FOREACH private_shelf IN private_shelves_shared_with_me %] >- <option value="[% private_shelf.shelfnumber | html %]">[% private_shelf.shelfname | html %]</option> >- [% END %] >- </optgroup> >- [% END %] >- [% IF public_shelves.count %] >+ [% IF add_to_some_public_shelves.count %] > <optgroup label="Public lists"> >- [% FOREACH public_shelf IN public_shelves %] >- <option value="[% public_shelf.shelfnumber | html %]">[% public_shelf.shelfname | html %]</option> >+ [% FOREACH s IN add_to_some_public_shelves %] >+ <option value="[% s.shelfnumber | html %]">[% s.shelfname | html %]</option> > [% END %] > </optgroup> > [% END %] >diff --git a/virtualshelves/addbybiblionumber.pl b/virtualshelves/addbybiblionumber.pl >index ff0ef5045b..837bf3bbca 100755 >--- a/virtualshelves/addbybiblionumber.pl >+++ b/virtualshelves/addbybiblionumber.pl >@@ -148,38 +148,26 @@ if ($newvirtualshelf) { > } > > } else { >- my $private_shelves = Koha::Virtualshelves->search( >- { public => 0, >- owner => $loggedinuser, >- allow_change_from_owner => 1, >- }, >- { order_by => 'shelfname' } >- ); >- my $shelves_shared_with_me = Koha::Virtualshelves->search( >- { public => 0, >- 'virtualshelfshares.borrowernumber' => $loggedinuser, >- allow_change_from_others => 1, >- }, >- { join => 'virtualshelfshares', } >+ my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( >+ { >+ borrowernumber => $loggedinuser, >+ add_allowed => 1, >+ public => 0, >+ } > ); >- my $public_shelves = Koha::Virtualshelves->search( >- { public => 1, >- -or => [ >- -and => { >- allow_change_from_owner => 1, >- owner => $loggedinuser, >- }, >- allow_change_from_others => 1, >- ], >- }, >- { order_by => 'shelfname' } >+ my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( >+ { >+ borrowernumber => $loggedinuser, >+ add_allowed => 1, >+ public => 1, >+ } > ); >+ >+ > $template->param( >- private_shelves => $private_shelves, >- private_shelves_shared_with_me => $shelves_shared_with_me, >- public_shelves => $public_shelves, >+ add_to_some_private_shelves => $some_private_shelves, >+ add_to_some_public_shelves => $some_public_shelves, > ); >- > } > > my @biblios; >-- >2.30.2
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 33722
:
151107
| 151328