Bugzilla – Attachment 35438 Details for
Bug 13418
The C4::VirtualShelves::Page needs some cleaning
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13418: Clean C4::VirtualShelves::Page - Part 2
Bug-13418-Clean-C4VirtualShelvesPage---Part-2.patch (text/plain), 5.04 KB, created by
Marcel de Rooy
on 2015-01-21 12:48:40 UTC
(
hide
)
Description:
Bug 13418: Clean C4::VirtualShelves::Page - Part 2
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-01-21 12:48:40 UTC
Size:
5.04 KB
patch
obsolete
>From 54a1fbc32251f64bf855efec9419640a8786da11 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 5 Dec 2014 13:40:00 +0100 >Subject: [PATCH] Bug 13418: Clean C4::VirtualShelves::Page - Part 2 >Content-Type: text/plain; charset=utf-8 > >I don't understand at all the usefulness of $privshelflist and >$privtotshelves in C4::VirtualShelves::Page >They look useless. > >If you deep in the git history, you will find > commit 25eb36f21fe952118327d2c84dfef5d38eee31a7 > Bug #2531 Cannot delete private shelf > >I am not able to reproduce this issue after this patch > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/VirtualShelves/Page.pm | 32 +++++++++++--------------------- > 1 files changed, 11 insertions(+), 21 deletions(-) > >diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm >index 1e3e351..a5b3164 100644 >--- a/C4/VirtualShelves/Page.pm >+++ b/C4/VirtualShelves/Page.pm >@@ -75,14 +75,6 @@ sub shelfpage { > my ( $shelflimit, $shelfoffset, $shelveslimit, $shelvesoffset ); > my $marcflavour = C4::Context->preference("marcflavour"); > >- # get biblionumbers stored in the cart >- my @cart_list; >- my $cart_cookie = ( $type eq 'opac' ? "bib_list" : "intranet_bib_list" ); >- if($query->cookie($cart_cookie)){ >- my $cart_list = $query->cookie($cart_cookie); >- @cart_list = split(/\//, $cart_list); >- } >- > $shelflimit = ( $type eq 'opac' ? C4::Context->preference('OPACnumSearchResults') : C4::Context->preference('numSearchResults') ); > $shelflimit = $shelflimit || ShelvesMax('MGRPAGE'); > $shelfoffset = ( $itemoff - 1 ) * $shelflimit; # Sets the offset to begin retrieving items at >@@ -93,11 +85,6 @@ sub shelfpage { > my $shelflist = GetShelves( $category, $shelveslimit, $shelvesoffset, $loggedinuser ); > my $totshelves = C4::VirtualShelves::GetShelfCount( $loggedinuser, $category ); > >- #Get a list of private shelves for possible deletion. Only do this when we've defaulted to public shelves >- my ( $privshelflist, $privtotshelves ); >- if ( $category == 2 ) { >- ( $privshelflist, $privtotshelves ) = GetShelves( 1, $shelveslimit, $shelvesoffset, $loggedinuser ); >- } > my $op = $query->param('op'); > > # the format of this is unindented for ease of diff comparison to the old script >@@ -260,6 +247,16 @@ sub shelfpage { > direction => $direction, > ); > ( $items, $totitems ) = GetShelfContents( $shelfnumber, $shelflimit, $shelfoffset, $sortfield, $direction ); >+ >+ # get biblionumbers stored in the cart >+ # Note that it's not use at the intranet >+ my @cart_list; >+ my $cart_cookie = ( $type eq 'opac' ? "bib_list" : "intranet_bib_list" ); >+ if($query->cookie($cart_cookie)){ >+ my $cart_list = $query->cookie($cart_cookie); >+ @cart_list = split(/\//, $cart_list); >+ } >+ > for my $this_item (@$items) { > my $biblionumber = $this_item->{'biblionumber'}; > my $record = GetMarcBiblio($biblionumber); >@@ -366,7 +363,7 @@ sub shelfpage { > /(DEL|REMSHR)-(\d+)/ or next; > $delflag = 1; > my $number = $2; >- unless ( defined $shelflist->{$number} || defined $privshelflist->{$number} ) { >+ unless ( defined $shelflist->{$number} ) { > push( @paramsloop, { unrecognized => $number } ); > last; > } >@@ -374,7 +371,6 @@ sub shelfpage { > if(/REMSHR/) { > RemoveShare($loggedinuser, $number); > delete $shelflist->{$number} if exists $shelflist->{$number}; >- delete $privshelflist->{$number} if exists $privshelflist->{$number}; > $stay=0; > next; > } >@@ -390,9 +386,6 @@ sub shelfpage { > if ( defined $shelflist->{$number} ) { > push( @paramsloop, { need_confirm => $shelflist->{$number}->{shelfname}, count => $totshelves, single => ($totshelves eq 1 ? 1:0) } ); > $shelflist->{$number}->{confirm} = $number; >- } else { >- push( @paramsloop, { need_confirm => $privshelflist->{$number}->{shelfname}, count => $totshelves } ); >- $privshelflist->{$number}->{confirm} = $number; > } > $stay = 0; > next; >@@ -402,9 +395,6 @@ sub shelfpage { > if ( defined $shelflist->{$number} ) { > $name = $shelflist->{$number}->{'shelfname'}; > delete $shelflist->{$number}; >- } else { >- $name = $privshelflist->{$number}->{'shelfname'}; >- delete $privshelflist->{$number}; > } > unless ( DelShelf($number) ) { > push( @paramsloop, { delete_fail => $name } ); >-- >1.7.7.6
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 13418
:
34237
|
34238
|
35386
|
35387
|
35388
|
35438
|
35620
|
35621
|
35622
|
35623