From a2fc557d0a2696a633448ee69d64051fd67044a7 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 25 Sep 2014 17:21:13 +0200 Subject: [PATCH] Bug 6279: Cannot delete lists from second page of lists in the OPAC The code in Page.pm still needs more attention, but this may serve as a quick fix for the problem; it will at least improve the situation. If you delete a list from its individual page (viewshelf), you already see the items (if any). So we will assume that after you said Yes to the message box, you want to delete it. There will not be a confirmation button anymore. Note that after you deleted the list, the intended message is not shown and the pagination bar is gone. I leave those for the future refactoring. Test plan: Delete a list from its own viewshelf page in OPAC and staff. Note that OPAC will delete it rightaway now. Note that staff still has the confirmation button. Signed-off-by: Jonathan Druart --- C4/VirtualShelves/Page.pm | 7 +------ koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 1 + 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index 56518c2..fa0ded0 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -362,13 +362,9 @@ sub shelfpage { #Deleting a shelf (asking for confirmation if it has entries) foreach ( $query->param() ) { - /(DEL|REMSHR)-(\d+)/ or next; + /(DEL|REMSHR)-(\d+)$/ or next; $delflag = 1; my $number = $2; - unless ( defined $shelflist->{$number} || defined $privshelflist->{$number} ) { - push( @paramsloop, { unrecognized => $number } ); - last; - } #remove a share if(/REMSHR/) { RemoveShare($loggedinuser, $number); @@ -377,7 +373,6 @@ sub shelfpage { $stay=0; next; } - # unless ( ShelfPossibleAction( $loggedinuser, $number, 'manage' ) ) { push( @paramsloop, { nopermission => $shelfnumber } ); last; 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 f39b2c5..67322ed 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -176,6 +176,7 @@
+ [% IF ( showprivateshelves ) %] [% END %] -- 2.1.0