Bugzilla – Attachment 136168 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.13 KB, created by
Martin Renvoize (ashimema)
on 2022-06-16 13:52:54 UTC
(
hide
)
Description:
Bug 25498: Show transfer button for shared lists on OPAC
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-06-16 13:52:54 UTC
Size:
4.13 KB
patch
obsolete
>From 51e13cb3c23693451958d3769ded8dc28badc838 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 > >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 195b817e7a..0fd48bca39 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