Bugzilla – Attachment 137864 Details for
Bug 25498
Allow to change owner of public or shared list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25498: Show transfer button for shared lists on OPAC
Bug-25498-Show-transfer-button-for-shared-lists-on.patch (text/plain), 4.17 KB, created by
Marcel de Rooy
on 2022-07-19 12:21:40 UTC
(
hide
)
Description:
Bug 25498: Show transfer button for shared lists on OPAC
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-07-19 12:21:40 UTC
Size:
4.17 KB
patch
obsolete
>From 435f2089da85c9fc5ed33611a5cca127792692f3 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 10 Jun 2022 09:42:41 +0000 >Subject: [PATCH] Bug 25498: Show transfer button for shared lists on OPAC >Content-Type: text/plain; charset=utf-8 > >Test plan: >Pick or create a shared list. >Verify that OPAC only shows the Transfer button when you are the >owner of a shared list. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 9 +++++++++ > opac/opac-shelves.pl | 9 ++++++--- > 2 files changed, 15 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >index 07f6b7b130..3bbd59ada0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >@@ -713,6 +713,15 @@ > [% IF s.is_private AND s.can_be_managed( loggedinusernumber ) AND Koha.Preference('OpacAllowSharingPrivateLists') %] > <a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% s.shelfnumber | uri %]" class="sharelist btn btn-link"><i class="fa fa-share" aria-hidden="true"></i> Share</a> > [% END %] >+ [% IF s.is_shared AND s.can_be_managed( loggedinusernumber ) %] >+ <form action="/cgi-bin/koha/opac-shelves.pl" method="get" class="d-inline"> >+ <input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" /> >+ <input type="hidden" name="public" value="0" /> >+ <input type="hidden" name="op" value="transfer" /> >+ <input type="hidden" name="referer" value="list" /> >+ <button type="submit" class="btn btn-link transfershelf"> Transfer</button> >+ </form> >+ [% END %] > [% IF s.is_shared_with( loggedinusernumber ) %] > <form action="opac-shelves.pl" method="post" id="unshare[% s.shelfnumber | html %]" class="d-inline"> > <input type="hidden" name="op" value="remove_share" /> >diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl >index 42a889869d..5bd342f514 100755 >--- a/opac/opac-shelves.pl >+++ b/opac/opac-shelves.pl >@@ -89,6 +89,7 @@ $public = 1 if $query->param('public') && $query->param('public') == 1; > > my ( $shelf, $shelfnumber, @messages ); > >+# PART 1: Perform a few actions > if ( $op eq 'add_form' ) { > # Only pass default > $shelf = { allow_change_from_owner => 1 }; >@@ -255,8 +256,11 @@ if ( $op eq 'add_form' ) { > push @messages, { type => 'error', code => 'does_not_exist' }; > } > $op = 'view'; >+} elsif( $op eq 'transfer' ) { >+ $op = 'list'; # TODO > } > >+# PART 2: After a possible action, view one list or show a number of lists > if ( $op eq 'view' ) { > $shelfnumber ||= $query->param('shelfnumber'); > $shelf = Koha::Virtualshelves->find($shelfnumber); >@@ -424,9 +428,7 @@ if ( $op eq 'view' ) { > } else { > push @messages, { type => 'error', code => 'does_not_exist' }; > } >-} >- >-if ( $op eq 'list' ) { >+} elsif ( $op eq 'list' ) { > my $shelves; > my ( $page, $rows ) = ( $query->param('page') || 1, 20 ); > if ( !$public ) { >@@ -444,6 +446,7 @@ if ( $op eq 'list' ) { > ), > ); > } >+ > my $staffuser; > $staffuser = Koha::Patrons->find( $loggedinuser )->can_patron_change_staff_only_lists if $loggedinuser; > $template->param( >-- >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 25498
:
135889
|
135921
|
136008
|
136009
|
136010
|
136011
|
136033
|
136034
|
136035
|
136036
|
136166
|
136167
|
136168
|
136169
|
136220
|
136221
|
137862
|
137863
| 137864 |
137865
|
137866
|
137867
|
137871
|
137908