[Koha-patches] [PATCH] Bug #2531 Cannot delete private shelf

Allen Reinmeyer allen.reinmeyer at liblime.com
Mon Nov 17 16:56:07 CET 2008


On Sat, Nov 8, 2008 at 8:24 AM, Henri-Damien <
henridamien.laurent at biblibre.com> wrote:

> Allen Reinmeyer wrote ..
> >  C4/VirtualShelves/Page.pm                          |   26 +++++++++---
> >  .../opac-tmpl/prog/en/modules/opac-shelves.tmpl    |   44
> +++++++++++---------
> >  2 files changed, 44 insertions(+), 26 deletions(-)
> >
> > diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm
> > index bcfd3af..efe8902 100644
> > --- a/C4/VirtualShelves/Page.pm
> > +++ b/C4/VirtualShelves/Page.pm
> > @@ -72,6 +72,8 @@ sub shelfpage ($$$$$) {
> >       # getting the Shelves list
> >       my $category = (($displaymode eq 'privateshelves') ? 1 : 2);
> >       my ($shelflist, $totshelves) = GetShelves( $category,
> $shelveslimit, $shelvesoffset,
> > $loggedinuser );
> > +     #Get a list of private shelves for possible deletion.
> > +     my ($privshelflist, $privtotshelves) = GetShelves( 1,
> $shelveslimit, $shelvesoffset,
> > $loggedinuser );
> From what I read here, if displaymode eq pricateshelves, then
> you are doing the same thing twice.
> Am I correct ?
> So what is the point ?
>

You are right.  I should make the second call conditional on the category.
No need to store the same thing in 2 different variables.

>
> >       my $op = $query->param('op');
> >  #    my $imgdir = getitemtypeimagesrc();
> >  #    my $itemtypes = GetItemTypes();
> > @@ -173,6 +175,7 @@ SWITCH: {
> >                               #$this_item->{'description'} =
> $itemtypes->{ $this_item->{itemtype} }->{'description'};
> >                               $this_item->{'dateadded'} =
> format_date($this_item->{'dateadded'});
> >                       }
> > +                     push @paramsloop, {display => 'privateshelves'} if
> $category == 1;
> should be  :
>                        push @paramsloop, {display => $displaymode} ;
> should it not ?
>

It certainly could be, but the default behavior is display => publicshelves,
so there's no need to pass that explicitly.  The above way seemed to be more
explicit in defining what was needed.

-- 
Allen Reinmeyer
LibLime
p. 770-888-9743
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-patches/attachments/20081117/a2daeb1e/attachment-0002.htm>


More information about the Koha-patches mailing list