Bugzilla – Attachment 41592 Details for
Bug 14544
Move the list related code to Koha::Virtualshelves
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14544: Make the intranet side independent of Page.pm
Bug-14544-Make-the-intranet-side-independent-of-Pa.patch (text/plain), 68.66 KB, created by
Jonathan Druart
on 2015-08-18 13:54:44 UTC
(
hide
)
Description:
Bug 14544: Make the intranet side independent of Page.pm
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-08-18 13:54:44 UTC
Size:
68.66 KB
patch
obsolete
>From a7db077f6a5419a6bb9d66dfb98f3ff09254fe4d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 5 Aug 2015 16:37:02 +0100 >Subject: [PATCH] Bug 14544: Make the intranet side independent of Page.pm > >--- > C4/Output.pm | 19 +- > C4/Utils/DataTables/VirtualShelves.pm | 7 +- > C4/VirtualShelves/Page.pm | 19 -- > Koha/Virtualshelf.pm | 56 +++ > .../prog/en/includes/virtualshelves-toolbar.inc | 24 +- > .../prog/en/modules/catalogue/detail.tt | 4 +- > .../en/modules/virtualshelves/downloadshelf.tt | 16 + > .../prog/en/modules/virtualshelves/shelves.tt | 375 ++++++++++----------- > .../virtualshelves/tables/shelves_results.tt | 4 +- > t/db_dependent/Virtualshelves.t | 107 +++++- > virtualshelves/addbybiblionumber.pl | 7 +- > virtualshelves/downloadshelf.pl | 69 ++-- > virtualshelves/shelves.pl | 258 +++++++++++++- > 13 files changed, 694 insertions(+), 271 deletions(-) > >diff --git a/C4/Output.pm b/C4/Output.pm >index 1dbdbee..9f83ae5 100644 >--- a/C4/Output.pm >+++ b/C4/Output.pm >@@ -86,10 +86,12 @@ This function returns HTML, without any language dependency. > =cut > > sub pagination_bar { >- my $base_url = (@_ ? shift : $ENV{SCRIPT_NAME} . $ENV{QUERY_STRING}) or return; >+ my $base_url = (@_ ? shift : $ENV{SCRIPT_NAME} . $ENV{QUERY_STRING}); >+ return unless defined $base_url; > my $nb_pages = (@_) ? shift : 1; > my $current_page = (@_) ? shift : undef; # delay default until later > my $startfrom_name = (@_) ? shift : 'page'; >+ my $additional_parameters = shift || {}; > > # how many pages to show before and after the current page? > my $pages_around = 2; >@@ -106,6 +108,10 @@ sub pagination_bar { > $base_url =~ s/$delim$//; # remove trailing delim > > my $url = $base_url . (($base_url =~ m/$delim/ or $base_url =~ m/\?/) ? '&' : '?' ) . $startfrom_name . '='; >+ my $url_suffix; >+ while ( my ( $k, $v ) = each %$additional_parameters ) { >+ $url_suffix .= '&' . $k . '=' . $v; >+ } > my $pagination_bar = ''; > > # navigation bar useful only if more than one page to display ! >@@ -117,7 +123,9 @@ sub pagination_bar { > "\n" . ' ' > . '<a href="' > . $url >- . '1" rel="start">' >+ . '1' >+ . $url_suffix >+ . '"rel="start">' > . '<<' . '</a>'; > } > else { >@@ -134,6 +142,7 @@ sub pagination_bar { > . '<a href="' > . $url > . $previous >+ . $url_suffix > . '" rel="prev">' . '<' . '</a>'; > } > else { >@@ -172,7 +181,9 @@ sub pagination_bar { > "\n" . ' ' > . '<a href="' > . $url >- . $page_number . '">' >+ . $page_number >+ . $url_suffix >+ . '">' > . $page_number . '</a>'; > } > $last_displayed_page = $page_number; >@@ -187,6 +198,7 @@ sub pagination_bar { > . ' <a href="' > . $url > . $next >+ . $url_suffix > . '" rel="next">' . '>' . '</a>'; > } > else { >@@ -200,6 +212,7 @@ sub pagination_bar { > . ' <a href="' > . $url > . $nb_pages >+ . $url_suffix > . '" rel="last">' > . '>>' . '</a>'; > } >diff --git a/C4/Utils/DataTables/VirtualShelves.pm b/C4/Utils/DataTables/VirtualShelves.pm >index e331447..bfda353 100644 >--- a/C4/Utils/DataTables/VirtualShelves.pm >+++ b/C4/Utils/DataTables/VirtualShelves.pm >@@ -5,7 +5,7 @@ use C4::Branch qw/onlymine/; > use C4::Context; > use C4::Members qw/GetMemberIssuesAndFines/; > use C4::Utils::DataTables; >-use C4::VirtualShelves; >+use Koha::Virtualshelves; > > sub search { > my ( $params ) = @_; >@@ -121,8 +121,9 @@ sub search { > ( $iTotalRecords ) = $dbh->selectrow_array( $query, undef, @args ); > > for my $shelf ( @$shelves ) { >- $shelf->{can_manage_shelf} = C4::VirtualShelves::ShelfPossibleAction( $loggedinuser, $shelf->{shelfnumber}, 'manage' ); >- $shelf->{can_delete_shelf} = C4::VirtualShelves::ShelfPossibleAction( $loggedinuser, $shelf->{shelfnumber}, 'delete_shelf' ); >+ my $s = Koha::Virtualshelves->find( $shelf->{shelfnumber} ); >+ $shelf->{can_manage_shelf} = $s->can_be_managed( $loggedinuser ); >+ $shelf->{can_delete_shelf} = $s->can_be_deleted( $loggedinuser ); > } > return { > iTotalRecords => $iTotalRecords, >diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm >index f22e014..69a85c1 100644 >--- a/C4/VirtualShelves/Page.pm >+++ b/C4/VirtualShelves/Page.pm >@@ -68,7 +68,6 @@ sub shelfpage { > loggedinuser => $loggedinuser, > OpacAllowPublicListCreation => C4::Context->preference('OpacAllowPublicListCreation'), > ); >- my $edit; > my $shelves; > my @paramsloop; > my $totitems; >@@ -209,7 +208,6 @@ sub shelfpage { > my $shelf = Koha::Virtualshelves->find( $shelfnumber ); > my $member = GetMember( 'borrowernumber' => $shelf->owner ); > my $ownername = defined($member) ? $member->{firstname} . " " . $member->{surname} : ''; >- $edit = 1; > $template->param( > edit => 1, > display => $displaymode, >@@ -231,9 +229,6 @@ sub shelfpage { > #View a shelf > if ( $shelfnumber = $query->param('viewshelf') ) { > my $shelf = Koha::Virtualshelves->find( $shelfnumber ); >- $template->param( >- 'DisplayMultiPlaceHold' => C4::Context->preference('DisplayMultiPlaceHold'), >- ); > if (C4::Context->preference('TagsEnabled')) { > $template->param(TagsEnabled => 1); > foreach (qw(TagsShowOnList TagsInputOnList)) { >@@ -494,20 +489,6 @@ sub shelfpage { > csv_profiles => GetCsvProfilesLoop('marc') > ); > >- unless( $shelfnumber or $shelves or $edit ) { >- # Only used for intranet >- $template->param( op => 'list' ); >- } >- >- if ($shelves or # note: this part looks duplicative, but is intentional >- $edit >- ) { >- $template->param( seflag => 1 ); >- #This hack is just another argument for refactoring this script one day >- #At this point you are adding or editing a list; if you add, then you add a private list (by default) with permissions as below; if you edit, do not pass these permissions, they must come from the database >- $template->param( allow_add => 0, allow_delete_own => 1, allow_delete_other => 0) unless $shelfnumber; >- } >- > #Next call updates the shelves for the Lists button. > #May not always be needed (when nothing changed), but doesn't take much. > my ($total, $pubshelves, $barshelves) = C4::VirtualShelves::GetSomeShelfNames($loggedinuser, 'MASTHEAD'); >diff --git a/Koha/Virtualshelf.pm b/Koha/Virtualshelf.pm >index 157e650..9c3894e 100644 >--- a/Koha/Virtualshelf.pm >+++ b/Koha/Virtualshelf.pm >@@ -19,6 +19,9 @@ use Modern::Perl; > > use Carp; > >+use C4::Auth; >+ >+use Koha::Borrowers; > use Koha::Database; > use Koha::DateUtils qw( dt_from_string ); > use Koha::Exceptions; >@@ -201,6 +204,59 @@ sub remove_biblios { > return $number_removed; > } > >+sub can_be_viewed { >+ my ( $self, $borrowernumber ) = @_; >+ return 1 if $self->category == $PUBLIC; >+ return 0 unless $borrowernumber; >+ return 1 if $self->owner == $borrowernumber; >+ return $self->get_shares->search( >+ { >+ borrowernumber => $borrowernumber, >+ } >+ )->count; >+} >+ >+sub can_be_deleted { >+ my ( $self, $borrowernumber ) = @_; >+ >+ return unless $borrowernumber; >+ return 1 if $self->owner == $borrowernumber; >+ >+ my $patron = Koha::Borrowers->find( $borrowernumber ); >+ >+ return 1 if $self->category == $PUBLIC and C4::Auth::haspermission( $patron->userid, { lists => 'delete_public_lists' } ); >+ >+ return 0; >+} >+ >+sub can_be_managed { >+ my ( $self, $borrowernumber ) = @_; >+ return 1 >+ if $borrowernumber and $self->owner == $borrowernumber; >+ return 0; >+} >+ >+sub can_biblios_be_added { >+ my ( $self, $borrowernumber ) = @_; >+ >+ return 1 >+ if $borrowernumber >+ and ( $self->owner == $borrowernumber >+ or $self->allow_add ); >+ return 0; >+} >+ >+sub can_biblios_be_removed { >+ my ( $self, $borrowernumber ) = @_; >+ >+ return 1 >+ if $borrowernumber >+ and ( $self->owner == $borrowernumber >+ or $self->allow_delete_own >+ or $self->allow_delete_other ); >+ return 0; >+} >+ > sub type { > return 'Virtualshelve'; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc >index 1e00cc4..f61a58f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc >@@ -1,7 +1,7 @@ > <script type="text/javascript"> > //<![CDATA[ > >-[% IF ( viewshelf ) %] >+[% IF op == 'view' %] > > function sendList(){ > open(CGIBIN+'virtualshelves/sendshelf.pl?shelfid=[% shelfnumber %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); >@@ -13,7 +13,7 @@ > return false; > }); > $("#deleteshelf").click(function(e){ >- if(confirmDelete(_("Are you sure you want to delete this list?"))){ >+ if(confirm(_("Are you sure you want to delete this list?"))){ > return true; > } else { > e.preventDefault(); >@@ -27,20 +27,16 @@ > </script> > > <div id="toolbar" class="btn-toolbar"> >- <div class="btn-group"><a id="newshelf" class="btn btn-small" href="/cgi-bin/koha/virtualshelves/shelves.pl?shelves=1"><i class="icon-plus"></i> New list</a></div> >+ <div class="btn-group"><a id="newshelf" class="btn btn-small" href="/cgi-bin/koha/virtualshelves/shelves.pl?op=add_form&referer=[% op %]"><i class="icon-plus"></i> New list</a></div> > >- [% IF ( viewshelf ) %] >- [% IF ( manageshelf ) %] >+ [% IF op == 'view' %] >+ [% IF can_manage_shelf %] > <div class="btn-group"> > <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="icon-pencil"></i> Edit <span class="caret"></span></button> >- <ul class="dropdown-menu"> >- <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl?shelfnumber=[% shelfnumber %]&op=modif&display=viewshelf">Edit list</a></li> >- [% IF ( showprivateshelves ) %] >- <li><a id="deleteshelf" href="/cgi-bin/koha/virtualshelves/shelves.pl?display=privateshelves&shelves=1&DEL-[% shelfnumber %]=1">Delete list</a></li> >- [% ELSE %] >- <li><a id="deleteshelf" href="/cgi-bin/koha/virtualshelves/shelves.pl?shelves=1&DEL-[% shelfnumber %]=1">Delete list</a></li> >- [% END %] >- </ul> >+ <ul class="dropdown-menu"> >+ <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=edit_form&shelfnumber=[% shelf.shelfnumber %]&referer=[% op %]">Edit list</a></li> >+ <li><a id="deleteshelf" href="/cgi-bin/koha/virtualshelves/shelves.pl?op=delete&shelfnumber=[% shelf.shelfnumber %]">Delete list</a></li> >+ </ul> > </div> > [% END %] > >@@ -56,6 +52,6 @@ > </ul> > </div> > <div class="btn-group"><a class="btn btn-small" href="#" id="sendlist"><i class="icon-envelope"></i> Send list</a></div> >- <div class="btn-group"><a class="btn btn-small" id="printlist" target="_blank" href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% shelfnumber %]&print=1"><i class="icon-print"></i> Print list</a></div> >+ <div class="btn-group"><a class="btn btn-small" id="printlist" target="_blank" href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber %]&print=1"><i class="icon-print"></i> Print list</a></div> > [% END %] > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 41730f5..0746ff6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -359,7 +359,7 @@ function verify_images() { > [% IF ( GetShelves ) %] > <span class="results_summary"><span class="label">Lists that include this title: </span> > [% FOREACH GetShelve IN GetShelves %] >- <a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% GetShelve.shelfnumber %]">[% GetShelve.shelfname %]</a> >+ <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% GetShelve.shelfnumber %]">[% GetShelve.shelfname %]</a> > [% IF ( loop.last ) %][% ELSE %]|[% END %] > [% END %] > </span> >@@ -524,7 +524,7 @@ function verify_images() { > <li><strong>Lists that include this title: </strong> > <ul> > [% FOREACH GetShelve IN GetShelves %] >- <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% GetShelve.shelfnumber %]">[% GetShelve.shelfname %]</a></li> >+ <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% GetShelve.shelfnumber %]">[% GetShelve.shelfname %]</a></li> > [% END %] > </ul> > </li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/downloadshelf.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/downloadshelf.tt >index 00cb335..96fa994 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/downloadshelf.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/downloadshelf.tt >@@ -3,6 +3,22 @@ > [% INCLUDE 'doc-head-close.inc' %] > </head> > <body id="lists_downloadshelf" class="lists" style="padding:1em;"> >+ >+[% FOR m IN messages %] >+ <div class="dialog [% m.type %]"> >+ [% SWITCH m.code %] >+ [% CASE 'unauthorized' %] >+ You do not have permission to view this list. >+ [% CASE 'does_not_exist' %] >+ This list does not exist. >+ [% CASE %] >+ [% m.code %] >+ [% END %] >+ </div> >+[% END %] >+ >+ >+ > [% IF ( format ) %] > <p>Your download should begin automatically.</p> > [% ELSE %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >index af8c930..704f884 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -1,5 +1,9 @@ >+[% USE Koha %] >+[% USE KohaDates %] >+[% SET PRIVATE = 1 %] >+[% SET PUBLIC = 2 %] > [% INCLUDE 'doc-head-open.inc' %] >-<title>Koha › [% IF ( viewshelf ) %]Lists › Contents of [% shelfname | html %][% ELSE %]Lists[% END %][% IF ( shelves ) %] › Create new list[% END %][% IF ( edit ) %] › Edit list [% shelfname | html %][% END %]</title> >+<title>Koha › [% IF op == 'view' %]Lists › Contents of [% shelf.shelfname | html %][% ELSE %]Lists[% END %][% IF op == 'add_form' %] › Create new list[% END %][% IF op == 'edit_form' %] › Edit list [% shelf.shelfname | html %][% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] > <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> > [% INCLUDE 'datatables.inc' %] >@@ -14,7 +18,7 @@ > </script> > [% END %] > >-[% IF ( viewshelf ) %] >+[% IF op == 'view' %] > <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> > <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script> > [% END %] >@@ -27,7 +31,11 @@ var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to remove this list?"); > > [% IF op == 'list' %] > $(document).ready(function(){ >- var type = 1; >+ [% IF category == PUBLIC %] >+ var type = [% PUBLIC %]; >+ [% ELSE %] >+ var type = [% PRIVATE %]; >+ [% END %] > var dtListResults = $("#listresultst").dataTable($.extend(true, {}, dataTablesDefaults, { > 'bServerSide': true, > 'sAjaxSource': "/cgi-bin/koha/svc/virtualshelves/search", >@@ -81,13 +89,18 @@ $(document).ready(function(){ > dtListResults.fnAddFilters("filter", 750); > > var tabs = $("#tabs").tabs({ >+ [% IF category == PUBLIC %] >+ active: 1, >+ [% ELSE %] >+ active: 0, >+ [% END %] > activate: function(e, ui) { > var active = tabs.tabs("option", "active" ); > if ( active == 0 ) { >- type = 1; // private >+ type = [% PRIVATE %]; > dtListResults.fnDraw(); > } else if ( active == 1 ) { >- type = 2; // public >+ type = [% PUBLIC %]; > dtListResults.fnDraw(); > } > } >@@ -95,7 +108,7 @@ $(document).ready(function(){ > }); > [% END %] > >-[% IF ( viewshelf ) %] >+[% IF op == 'view' %] > $(document).ready(function(){ > [% IF ( itemsloop ) %]$('#searchheader').fixFloat();[% END %] > $("span.clearall").html("<a id=\"CheckNone\" href=\"/cgi-bin/koha/shelves.pl\">"+_("Clear all")+"<\/a>"); >@@ -173,14 +186,6 @@ $(document).ready(function(){ > }); > [% END %] > >- function confirmDelete(message){ >- if (window.confirm(message)) { >- location.href="/cgi-bin/koha/virtualshelves/shelves.pl?[% IF ( showprivateshelves ) %]display=privateshelves&[% END %]shelves=1&DEL-[% shelfnumber %]=1&shelfoff=[% shelfoff %]"; >- } else { >- return false; >- } >- } >- > /** > * This function checks if the adequate number of records are checked for merging > */ >@@ -272,35 +277,28 @@ function placeHold () { > [% INCLUDE 'header.inc' %] > [% INCLUDE 'cat-search.inc' %] > >-[% BLOCK list_permissions %] >- <li> >- <label for="permissions">Permissions: </label> >- <select name="allow_add" id="allow_add"> >- [% IF allow_add %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %] >- [% IF allow_add %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %] >- </select> >- <span>anyone else to add entries.</span> >- </li> >- <li> >- <label> </label> >- <select name="allow_delete_own" id="allow_delete_own"> >- [% IF allow_delete_own %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %] >- [% IF allow_delete_own %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %] >- </select> >- <span>anyone to remove his own contributed entries.</span> >- </li> >- <li> >- <label> </label> >- <select name="allow_delete_other" id="allow_delete_other"> >- [% IF allow_delete_other %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %] >- [% IF allow_delete_other %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %] >- </select> >- <span>anyone to remove other contributed entries.</span> >- </li> >-[% END %] >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a> [% IF ( category1 ) %] › [% IF ( viewshelf || edit ) %] <a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=privateshelves">Your lists</a> [% ELSE %] Your lists [% END %] [% ELSIF ( category2 ) %] › [% IF ( viewshelf ) %] <a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=publicshelves">Public lists</a> [% ELSE %] Public lists [% END %] [% ELSIF ( showprivateshelves ) %] › [% IF ( viewshelf || edit ) %] <a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=privateshelves">Your lists</a> [% ELSE %] Your lists [% END %] [% ELSIF ( showpublicshelves ) %] › [% IF ( viewshelf || edit ) %] <a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=publicshelves">Public lists</a> [% ELSE %] Public lists [% END %] [% END %] >+<div id="breadcrumbs"> >+ <a href="/cgi-bin/koha/mainpage.pl">Home</a> › >+ [% IF op != 'list' %] >+ <a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a> >+ [% ELSE %] >+ Lists >+ [% END %] >+ [% IF shelf AND shelf.category == PRIVATE %] › >+ [% IF op == 'view' OR op == 'edit_form' %] >+ <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PRIVATE %]">Your lists</a> >+ [% ELSE %] >+ Your lists >+ [% END %] >+ [% ELSIF shelf AND shelf.category == PUBLIC %] › >+ [% IF op == 'view' %] >+ <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PUBLIC %]">Public lists</a> >+ [% ELSE %] >+ Public lists >+ [% END %] >+ [% END %] > >-[% IF ( viewshelf ) %]› Contents of <i>[% shelfname | html %]</i>[% END %][% IF ( shelves ) %] › Create new list[% END %][% IF ( edit ) %] › Edit list <i>[% shelfname | html %]</i>[% END %]</div> >+[% IF op == 'view' %]› Contents of <i>[% shelf.shelfname | html %]</i>[% END %][% IF op == 'add_form' %] › Create new list[% END %][% IF op == 'edit_form' %] › Edit list <i>[% shelf.shelfname | html %]</i>[% END %]</div> > > <div id="doc3" class="yui-t2"> > <div id="bd"> >@@ -318,70 +316,53 @@ function placeHold () { > [% CASE 'error_on_insert' %] > An error occurred when inserting this list. Perhaps the name already exists. > [% CASE 'error_on_delete' %] >- An error occurred when deleteing this list. Check the logs. >+ An error occurred when deleting this list. Check the logs. >+ [% CASE 'error_on_add_biblio' %] >+ The item has not been added to the list. Please check it's not in this list yet. > [% CASE 'success_on_update' %] > List updated with success. > [% CASE 'success_on_insert' %] > List inserted with success. > [% CASE 'success_on_delete' %] > List deleted with success. >- [% CASE 'Koha::Exception::DuplicateObject' %] >+ [% CASE 'success_on_add_biblio' %] >+ The item has been added to the list. >+ [% CASE 'success_on_remove_biblios' %] >+ The item has been removed from the list. >+ [% CASE 'does_not_exist' %] >+ This list does not exist. >+ [% CASE 'item_does_not_exist' %] >+ This item does not exist. >+ [% CASE 'unauthorized_on_view' %] >+ You do not have permission to view this list. >+ [% CASE 'unauthorized_on_update' %] >+ You do not have permission to update this list. >+ [% CASE 'unauthorized_on_delete' %] >+ You do not have permission to delete this list. >+ [% CASE 'unauthorized_on_add_biblio' %] >+ You do not have permission to add a biblio to this list. >+ [% CASE 'no_biblio_removed' %] >+ No biblio has been removed. >+ [% CASE 'Koha::Exceptions::Virtualshelves::DuplicateObject' %] > An error occurred when inserting this list. The name already [% shelfname %] exists. >+ [% CASE 'DBIx::Class::Exception' %] >+ [% m.msg %] > [% CASE %] > [% m.code %] > [% END %] > </div> > [% END %] > >-[% IF ( paramsloop ) %] >-[% FOREACH paramsloo IN paramsloop %] >-<div class="yui-ge"> >- <div class="yui-u first"> >- [% IF ( paramsloo.status ) %]<div class="dialog alert">[% paramsloo.string %]</div>[% END %] >- [% IF ( paramsloo.nobarcode ) %]<div class="dialog alert">ERROR: No barcode given.</div>[% END %] >- [% IF ( paramsloo.noshelfnumber ) %]<div class="dialog alert">ERROR: No list number given.</div>[% END %] >- [% IF ( paramsloo.need_confirm ) %] >- <div class="dialog alert">The list <i>[% paramsloo.need_confirm %]</i> is not empty. >- [% IF ( paramsloo.single ) %] >- <br />It has <b>[% paramsloo.count %]</b> entry. >- [% ELSE %] >- <br />It has <b>[% paramsloo.count %]</b> entries. >- [% END %] >- <br />Use the "Confirm" button below to confirm deletion. >- </div> >- [% END %] >- [% IF ( paramsloo.nopermission ) %] >- <div class="dialog alert">ERROR: You do not have adequate permission for that action on list [% paramsloo.nopermission %].</div> >- [% END %] >- [% IF ( paramsloo.failgetitem ) %] >- <div class="dialog alert">ERROR: No item found with barcode [% paramsloo.failgetitem %].</div> >- [% END %] >- [% IF ( paramsloo.duplicatebiblio ) %] >- <div class="dialog alert">A record matching barcode <b>[% paramsloo.duplicatebiblio %]</b> has already been added.</div> >- [% END %] >- [% IF ( paramsloo.nothingdeleted) %] >- <div class="dialog message">Warning: You could not delete any of the selected items from this list.</div> >- [% END %] >- [% IF ( paramsloo.somedeleted) %] >- <div class="dialog message">Warning: You could not delete all selected items from this list.</div> >- [% END %] >- [% IF ( paramsloo.modifyfailure) %] >- <div class="dialog message">ERROR: List could not be modified.</div> >- [% END %] >- </div> >-</div> >-[% END %] >-[% END %] >- >-[% IF ( viewshelf ) %] >+[% IF op == 'view' %] > <div class="yui-g"> >- [% IF ( itemsloop ) %] >+ [% IF itemsloop %] > >- <h3>Contents of <i>[% shelfname | html %]</i></h3> >+ <h3>Contents of <i>[% shelf.shelfname | html %]</i></h3> > <div class="pages">[% pagination_bar %]</div> > <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post" class="checkboxed"> >- <input type="hidden" name="viewshelf" value="[% shelfnumber %]" /> >- <input type="hidden" name="modifyshelfcontents" value="1" /> >+ <input type="hidden" name="op" value="remove_biblios" /> >+ <input type="hidden" name="referer" value="view" /> >+ <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber %]" /> > > [% IF direction == 'asc' %] > [% SET new_direction = 'desc' %] >@@ -391,16 +372,16 @@ function placeHold () { > [% END %] > > <div id="searchheader" class="noprint"> >- [% IF ( itemsloop ) %] >+ [% IF itemsloop %] > <div id="selection_ops"><span class="checkall"></span> | > <span class="clearall"></span> > > <span class="addto">| </span> > >- [% IF ( CAN_user_reserveforothers && DisplayMultiPlaceHold ) %] >+ [% IF CAN_user_reserveforothers && Koha.Preference('DisplayMultiPlaceHold') %] > <div class="btn-group"><button class="btn btn-mini placehold"><i class="icon-hold"></i> Place hold</button></div> > [% END %] >- [% IF ( allowremovingitems ) %] >+ [% IF can_remove_biblios %] > <div class="btn-group"><button type="submit" class="btn btn-mini list-remove"><i class="icon-remove-sign"></i> Remove selected</button></div> > [% END %] > [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<div class="btn-group"><button type="submit" class="btn btn-mini merge-items"><i class="icon-merge"></i> Merge selected</button></div>[% END %] >@@ -414,16 +395,16 @@ function placeHold () { > > [% UNLESS ( item_level_itypes ) %]<th>Item type</th>[% END %] > <th> >- <a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% shelfnumber %]&sort=title&direction=[% IF sort != 'title' %]asc[% ELSE %][% new_direction %][% END %]">Title</a> >- [% IF sort == 'title' %] >+ <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber %]&sortfield=title&direction=[% IF sortfield != 'title' %]asc[% ELSE %][% new_direction %][% END %]">Title</a> >+ [% IF sortfield == 'title' %] > <img src="[% interface %]/[% theme %]/img/[% direction %].gif" alt="[% direction %] sort" /> > [% ELSE %] > <img src="[% interface %]/[% theme %]/img/ascdesc.gif" alt="" /> > [% END %] > </th> > <th> >- <a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% shelfnumber %]&sort=author&direction=[% IF sort != 'author' %]asc[% ELSE %][% new_direction %][% END %]">Author</a> >- [% IF sort == 'author' %] >+ <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber %]&sortfield=author&direction=[% IF sortfield != 'author' %]asc[% ELSE %][% new_direction %][% END %]">Author</a> >+ [% IF sortfield == 'author' %] > <img src="[% interface %]/[% theme %]/img/[% direction %].gif" alt="[% direction %] sort" /> > [% ELSE %] > <img src="[% interface %]/[% theme %]/img/ascdesc.gif" alt="" /> >@@ -431,30 +412,25 @@ function placeHold () { > </th> > <th>Date added</th> > <th> >- <a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% shelfnumber %]&sort=itemcallnumber&direction=[% IF sort != 'itemcallnumber' %]asc[% ELSE %][% new_direction %][% END %]">Call number</a> >- [% IF sort == 'itemcallnumber' %] >+ <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber %]&sortfield=itemcallnumber&direction=[% IF sortfield != 'itemcallnumber' %]asc[% ELSE %][% new_direction %][% END %]">Call number</a> >+ [% IF sortfield == 'itemcallnumber' %] > <img src="[% interface %]/[% theme %]/img/[% direction %].gif" alt="[% direction %] sort" /> > [% ELSE %] > <img src="[% interface %]/[% theme %]/img/ascdesc.gif" alt="" /> > [% END %] > </th> > </tr> >- [% FOREACH itemsloo IN itemsloop %] >- [% UNLESS ( loop.odd ) %] >- <tr class="highlight"> >- [% ELSE %] >- <tr> >- [% END %] >- [% IF ( itemsloop ) %] >- <td> >- [% IF ( itemsloo.confirm ) %] >- <input type="hidden" name="CONFIRM-[% itemsloo.confirm %]" /> >- <input type="checkbox" class="selection" value="[% itemsloo.biblionumber %]" name="REM-[% itemsloo.biblionumber %]" checked /> >- [% ELSE %] >- <input type="checkbox" class="selection" value="[% itemsloo.biblionumber %]" name="REM-[% itemsloo.biblionumber %]" /> >- [% END %] >- </td> >- [% END %] >+ [% FOREACH itemsloo IN itemsloop %] >+ [% UNLESS ( loop.odd ) %] >+ <tr class="highlight"> >+ [% ELSE %] >+ <tr> >+ [% END %] >+ [% IF itemsloop %] >+ <td> >+ <input type="checkbox" class="selection" value="[% itemsloo.biblionumber %]" name="biblionumber" /> >+ </td> >+ [% END %] > [% UNLESS ( item_level_itypes ) %]<td> > [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %]<img src="[% itemsloo.imageurl %]" alt="[% itemsloo.description %]" title="[% itemsloo.description %]" />[% END %][% itemsloo.description %] > </td>[% END %] >@@ -483,10 +459,10 @@ function placeHold () { > | <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% itemsloo.biblionumber %]">Edit items</a> > [% END %] > </p> >- </td> >- <td>[% itemsloo.author %]</td> >- <td>[% itemsloo.dateadded %]</td> >- <td> >+ </td> >+ <td>[% itemsloo.author %]</td> >+ <td>[% itemsloo.dateadded | $KohaDates%]</td> >+ <td> > <ul> > [% FOREACH result IN itemsloo.ITEM_RESULTS %] > <li>[% result.holdingbranch %] [% IF ( result.location_intranet ) %] ([% result.location_intranet %]) [% END %] >@@ -505,88 +481,111 @@ function placeHold () { > > [% END %] > </div> >-[% END %]<!-- /viewshelf --> >+[% END %] > >-[% IF ( debug ) %] >- [% IF ( edit ) %]<div>Edit is on ([% shelfname | html %])</div>[% END %] >- [% IF ( seflag ) %]<div>seflag is on ([% seflag %])</div>[% END %] >+[% IF can_add_biblios %] >+<div class="yui-g"> >+<form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post"> >+ <fieldset class="brief noprint"> >+ <legend>Add an item to <i>[% shelfname | html %]</i></legend> >+ <ol> >+ <li> >+ <label for="barcode">Barcode:</label> >+ <input name="barcode" type="text" id="barcode" size="14" /> >+ <input type="hidden" name="op" value="add_biblio" /> >+ <input type="hidden" name="referer" value="view" /> >+ <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber %]" /> >+ <input type="submit" value="Add" /> >+ </li> >+ </ol> >+ </fieldset> >+</form> >+</div> > [% END %] > >-[% IF ( seflag ) %] >+[% IF op == 'add_form' OR op == 'edit_form' %] > <div class="yui-ge"> > <div class="yui-u first"> > <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated"> > <fieldset class="rows"> > >- [% IF ( shelves ) %] >- <legend>Create a new list</legend> >- <input type="hidden" name="shelves" value="1" /> >+ [% IF op == 'add_form' %] >+ <legend>Create a new list</legend> >+ <input type="hidden" name="op" value="add" /> >+ [% ELSE %] >+ <legend>Edit list <i>[% shelf.shelfname | html %]</i></legend> >+ <input type="hidden" name="op" value="edit" /> >+ [% END %] >+ <input type="hidden" name="referer" value="[% referer %]" /> >+ <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber %]" /> > <ol> >- <li><label class="required" for="addshelf">List name:</label><input id="addshelf" type="text" name="addshelf" size="25" required="required" class="required" /> >+ <li> >+ <label for="shelfname" class="required">Name: </label><input type="text" id="shelfname" name="shelfname" size="25" value="[% shelf.shelfname |html %]" required="required" class="required" /> > <span class="required">Required</span> >- </li> >- <li><span class="label">Owner: </span><input type="hidden" name="owner" id="owner" value="[% loggedinuser %]" />[% loggedinusername %]</li> >- <li><label for="sortfield" >Sort this list by: </label> >- <select name="sortfield" id="sortfield"> >- <option value="title">Title</option> >- <option value="author">Author</option> >- <option value="copyrightdate">Copyrightdate</option> >- <option value="itemcallnumber">Call number</option> >- </select></li> >- <li><label for="category">Category: </label> >- <select name="category" id="category"> >- <option value="1">Private</option> >- <option value="2">Public</option> >- </select></li> >- [% INCLUDE list_permissions %] >- </ol> >- [% END %] >- >- [% IF ( edit ) %] >- <legend>Edit list <i>[% shelfname | html %]</i></legend> >- <input type="hidden" name="display" value="[% display %]" /> >- <input type="hidden" name="op" value="modifsave" /> >- [% IF ( showprivateshelves ) %]<input type="hidden" name="display" value="privateshelves" />[% END %] >- <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" /> >- <ol> >- <li><label for="shelfname" class="required">Name: </label><input type="text" id="shelfname" name="shelfname" size="25" value="[% shelfname |html %]" required="required" class="required" /> >- <span class="required">Required</span> >- </li> >- <li><label for="owner">Owner: </label><input type="hidden" id="owner" name="owner" value="[% IF ( owner ) %][% ownername %][% ELSE %][% loggedinusername %][% END %]" />[% IF ( owner ) %][% ownername %][% ELSE %][% loggedinusername %][% END %]</li> >- <li><label for="sortfield" >Sort this list by: </label> >- <select name="sortfield"> >- [% IF ( sortfield == "title" ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %] >- [% IF ( sortfield == "author" ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %] >- [% IF ( sortfield == "copyrightdate" ) %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %] >- [% IF ( sortfield == "itemcallnumber" ) %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %] >- </select></li> >- <li><label for="category">Category: </label> >- <select id="category" name="category"> >- [% IF ( category1 ) %] >- <option value="1" selected="selected">Private</option> >- [% ELSE %] >- <option value="1">Private</option> >- [% END %] >- [% IF ( category2 ) %] >- <option value="2" selected="selected">Public</option> >- [% ELSE %] >- <option value="2">Public</option> >- [% END %] >- </select></li> >- [% INCLUDE list_permissions %] >- </ol> >- [% END %] >+ </li> >+ <li> >+ <span class="label">Owner: </span> >+ [% IF op == 'add_form' %] >+ <input type="hidden" name="owner" id="owner" value="[% loggedinusernumber %]" />[% loggedinusername %]</li> >+ [% ELSE %] >+ [% IF owner %] >+ <input type="hidden" id="owner" name="owner" value="[% owner.borrowernumber %]" />[% owner.firstname _ ' ' _ owner.surname %] >+ [% ELSE %] >+ <input type="hidden" id="owner" name="owner" value="[% loggedinusernumber %]" />[% loggedinusername %] >+ [% END %] >+ [% END %] >+ </li> >+ <li><label for="sortfield" >Sort this list by: </label> >+ <select name="sortfield"> >+ [% IF shelf.sortfield == "title" %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %] >+ [% IF shelf.sortfield == "author" %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %] >+ [% IF shelf.sortfield == "copyrightdate" %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %] >+ [% IF shelf.sortfield == "itemcallnumber" %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %] >+ </select></li> >+ <li><label for="category">Category: </label> >+ <select id="category" name="category"> >+ [% IF shelf.category == PRIVATE %] >+ <option value="1" selected="selected">Private</option> >+ [% ELSE %] >+ <option value="1">Private</option> >+ [% END %] >+ [% IF shelf.category == PUBLIC %] >+ <option value="2" selected="selected">Public</option> >+ [% ELSE %] >+ <option value="2">Public</option> >+ [% END %] >+ </select></li> > >- </fieldset> >+ [% FOR permission IN ['allow_add', 'allow_delete_own', 'allow_delete_other'] %] >+ <li> >+ [% IF loop.first %] >+ <label for="permissions">Permissions: </label> >+ [% ELSE %] >+ <label> </label> >+ [% END %] >+ <select name="[% permission %]" id="[% permission %]"> >+ [% IF shelf.$permission %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %] >+ [% IF shelf.$permission %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %] >+ </select> >+ [% SWITCH permission %] >+ [% CASE 'allow_add' %] <span>anyone else to add entries.</span> >+ [% CASE 'allow_delete_own' %] <span>anyone to remove his own contributed entries.</span> >+ [% CASE 'allow_delete_other' %] <span>anyone to remove other contributed entries.</span> >+ [% END %] >+ </li> >+ [% END %] >+ </ol> >+ </fieldset> > >- <fieldset class="action"><input type="submit" value="Save" class="submit" /> >- [% IF ( showprivateshelves ) %] >- <a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=privateshelves" class="cancel">Cancel</a> >- [% ELSE %] >- [% IF ( display == "viewshelf" ) %] >- <a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% shelfnumber %]" class="cancel">Cancel</a> >+ <fieldset class="action"> >+ <input type="submit" value="Save" class="submit" /> >+ [% IF referer == 'view' %] >+ <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber %]" class="cancel">Cancel</a> >+ [% ELSE %] >+ [% IF category == PUBLIC %] >+ <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PUBLIC %]" class="cancel">Cancel</a> > [% ELSE %] >- <a href="/cgi-bin/koha/virtualshelves/shelves.pl" class="cancel">Cancel</a> >+ <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=list&category=[% PRIVATE %]" class="cancel">Cancel</a> > [% END %] > [% END %] > </fieldset> >@@ -601,7 +600,7 @@ function placeHold () { > </div> > </div> > </div> >-[% END %]<!-- /seflag --> >+[% END %] > > [% IF op == 'list' %] > <h2>Lists</h2> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt >index 65a7459..28a2ad8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt >@@ -9,7 +9,7 @@ > "dt_type": > "[% data.type %]", > "dt_shelfname": >- "<a href='/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% data.shelfnumber %]'>[% data.shelfname | html%]</a>", >+ "<a href='/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% data.shelfnumber %]'>[% data.shelfname | html%]</a>", > "dt_count": > "[% data.count %] item(s)", > "dt_owner": >@@ -29,7 +29,7 @@ > > [% BLOCK action_form -%] > [%- IF can_manage_shelf -%] >-<form action='shelves.pl' method='get'><input type='hidden' name='shelfnumber' value='[% shelfnumber %]' /><input type='hidden' name='op' value='modif' /><input type='submit' class='editshelf' value='Edit' /></form>[% IF can_manage_shelf OR can_delete_shelf %]<form action='shelves.pl' method='post'><input type='hidden' name='shelfoff' value='[% shelfoff %]' /><input type='hidden' name='shelves' value='1' /><input type='hidden' name='DEL-[% shelfnumber %]' value='1' /><input type='hidden' name='CONFIRM-[% shelfnumber %]' value='1' />[% IF type == 1 %]<input type='hidden' name='display' value='privateshelves' />[% ELSE %]<input type='hidden' name='display' value='publicshelves' />[% END %]<input type='submit' class='deleteshelf' onclick='return confirmDelete(MSG_CONFIRM_DELETE_LIST)' value='Delete' /></form>[% END %] >+<form action='shelves.pl' method='get'><input type='hidden' name='shelfnumber' value='[% shelfnumber %]' /><input type='hidden' name='op' value='edit_form' /><input type='hidden' name='category' value='[% type %]' /><input type='submit' class='editshelf' value='Edit' /></form>[% IF can_manage_shelf OR can_delete_shelf %]<form action='shelves.pl' method='post'><input type='hidden' name='shelfoff' value='[% shelfoff %]' /><input type='hidden' name='op' value='delete' /><input type='hidden', name='shelfnumber', value='[% shelfnumber %] /><input type='hidden' name='category' value='[% type %]' /><input type='submit' class='deleteshelf' onclick='return confirmDelete(MSG_CONFIRM_DELETE_LIST)' value='Delete' /></form>[% END %] > [%- ELSE -%] > None > [%- END -%] >diff --git a/t/db_dependent/Virtualshelves.t b/t/db_dependent/Virtualshelves.t >index fc4b9c7..d7b8f50 100644 >--- a/t/db_dependent/Virtualshelves.t >+++ b/t/db_dependent/Virtualshelves.t >@@ -1,7 +1,7 @@ > #!/usr/bin/perl > > use Modern::Perl; >-use Test::More tests => 3; >+use Test::More tests => 4; > use DateTime::Duration; > > use C4::Context; >@@ -235,3 +235,108 @@ subtest 'Shelf content' => sub { > $number_of_contents = Koha::Virtualshelfcontents->search->count; > is( $number_of_contents, 1, 'The biblio should have been deleted to the shelf by the patron 2, even if it is not his own content (allow_delete_other=1)' ); > }; >+ >+subtest 'Shelf permissions' => sub { >+ >+ plan tests => 40; >+ my $patron1 = $builder->build( { source => 'Borrower', value => { flags => '2096766' } } ); # 2096766 is everything checked but not superlibrarian >+ my $patron2 = $builder->build( { source => 'Borrower', value => { flags => '1048190' } } ); # 1048190 is everything checked but not superlibrarian and delete_public_lists >+ my $biblio1 = $builder->build( { source => 'Biblio', } ); >+ my $biblio2 = $builder->build( { source => 'Biblio', } ); >+ my $biblio3 = $builder->build( { source => 'Biblio', } ); >+ my $biblio4 = $builder->build( { source => 'Biblio', } ); >+ >+ >+ my $public_shelf = Koha::Virtualshelf->new( >+ { shelfname => "my first shelf", >+ owner => $patron1->{borrowernumber}, >+ category => 2, >+ allow_add => 0, >+ allow_delete_own => 0, >+ allow_delete_other => 0, >+ } >+ )->store; >+ >+ is( $public_shelf->can_be_viewed( $patron1->{borrowernumber} ), 1, 'The owner should be able to view his public list' ); >+ is( $public_shelf->can_be_viewed( $patron2->{borrowernumber} ), 1, 'Public list should be viewed by someone else' ); >+ >+ is( $public_shelf->can_be_deleted( $patron1->{borrowernumber} ), 1, 'The owner should be able to delete his list' ); >+ is( $public_shelf->can_be_deleted( $patron2->{borrowernumber} ), 0, 'Public list should not be deleted by someone else' ); >+ >+ is( $public_shelf->can_be_managed( $patron1->{borrowernumber} ), 1, 'The owner should be able to manage his list' ); >+ is( $public_shelf->can_be_managed( $patron2->{borrowernumber} ), 0, 'Public list should not be managed by someone else' ); >+ >+ is( $public_shelf->can_biblios_be_added( $patron1->{borrowernumber} ), 1, 'The owner should be able to add biblios to his list' ); >+ is( $public_shelf->can_biblios_be_added( $patron2->{borrowernumber} ), 0, 'Public list should not be modified (add) by someone else' ); >+ >+ is( $public_shelf->can_biblios_be_removed( $patron1->{borrowernumber} ), 1, 'The owner should be able to remove biblios to his list' ); >+ is( $public_shelf->can_biblios_be_removed( $patron2->{borrowernumber} ), 0, 'Public list should not be modified (remove) by someone else' ); >+ >+ >+ $public_shelf->allow_add(1); >+ $public_shelf->allow_delete_own(1); >+ $public_shelf->allow_delete_other(1); >+ $public_shelf->store; >+ >+ is( $public_shelf->can_be_viewed( $patron1->{borrowernumber} ), 1, 'The owner should be able to view his public list' ); >+ is( $public_shelf->can_be_viewed( $patron2->{borrowernumber} ), 1, 'Public list should be viewed by someone else' ); >+ >+ is( $public_shelf->can_be_deleted( $patron1->{borrowernumber} ), 1, 'The owner should be able to delete his list' ); >+ is( $public_shelf->can_be_deleted( $patron2->{borrowernumber} ), 0, 'Public list should not be deleted by someone else' ); >+ >+ is( $public_shelf->can_be_managed( $patron1->{borrowernumber} ), 1, 'The owner should be able to manage his list' ); >+ is( $public_shelf->can_be_managed( $patron2->{borrowernumber} ), 0, 'Public list should not be managed by someone else' ); >+ >+ is( $public_shelf->can_biblios_be_added( $patron1->{borrowernumber} ), 1, 'The owner should be able to add biblios to his list' ); >+ is( $public_shelf->can_biblios_be_added( $patron2->{borrowernumber} ), 1, 'Public list should not be modified (add) by someone else' ); >+ >+ is( $public_shelf->can_biblios_be_removed( $patron1->{borrowernumber} ), 1, 'The owner should be able to remove biblios to his list' ); >+ is( $public_shelf->can_biblios_be_removed( $patron2->{borrowernumber} ), 1, 'Public list should not be modified (remove) by someone else' ); >+ >+ >+ my $private_shelf = Koha::Virtualshelf->new( >+ { shelfname => "my first shelf", >+ owner => $patron1->{borrowernumber}, >+ category => 1, >+ allow_add => 0, >+ allow_delete_own => 0, >+ allow_delete_other => 0, >+ } >+ )->store; >+ >+ is( $private_shelf->can_be_viewed( $patron1->{borrowernumber} ), 1, 'The owner should be able to view his list' ); >+ is( $private_shelf->can_be_viewed( $patron2->{borrowernumber} ), 0, 'Private list should not be viewed by someone else' ); >+ >+ is( $private_shelf->can_be_deleted( $patron1->{borrowernumber} ), 1, 'The owner should be able to delete his list' ); >+ is( $private_shelf->can_be_deleted( $patron2->{borrowernumber} ), 0, 'Private list should not be deleted by someone else' ); >+ >+ is( $private_shelf->can_be_managed( $patron1->{borrowernumber} ), 1, 'The owner should be able to manage his list' ); >+ is( $private_shelf->can_be_managed( $patron2->{borrowernumber} ), 0, 'Private list should not be managed by someone else' ); >+ >+ is( $private_shelf->can_biblios_be_added( $patron1->{borrowernumber} ), 1, 'The owner should be able to add biblios to his list' ); >+ is( $private_shelf->can_biblios_be_added( $patron2->{borrowernumber} ), 0, 'Private list should not be modified (add) by someone else' ); >+ >+ is( $private_shelf->can_biblios_be_removed( $patron1->{borrowernumber} ), 1, 'The owner should be able to remove biblios to his list' ); >+ is( $private_shelf->can_biblios_be_removed( $patron2->{borrowernumber} ), 0, 'Private list should not be modified (remove) by someone else' ); >+ >+ >+ $private_shelf->allow_add(1); >+ $private_shelf->allow_delete_own(1); >+ $private_shelf->allow_delete_other(1); >+ $private_shelf->store; >+ >+ is( $private_shelf->can_be_viewed( $patron1->{borrowernumber} ), 1, 'The owner should be able to view his list' ); >+ is( $private_shelf->can_be_viewed( $patron2->{borrowernumber} ), 0, 'Private list should not be viewed by someone else' ); >+ >+ is( $private_shelf->can_be_deleted( $patron1->{borrowernumber} ), 1, 'The owner should be able to delete his list' ); >+ is( $private_shelf->can_be_deleted( $patron2->{borrowernumber} ), 0, 'Private list should not be deleted by someone else' ); >+ >+ is( $private_shelf->can_be_managed( $patron1->{borrowernumber} ), 1, 'The owner should be able to manage his list' ); >+ is( $private_shelf->can_be_managed( $patron2->{borrowernumber} ), 0, 'Private list should not be managed by someone else' ); >+ >+ is( $private_shelf->can_biblios_be_added( $patron1->{borrowernumber} ), 1, 'The owner should be able to add biblios to his list' ); >+ is( $private_shelf->can_biblios_be_added( $patron2->{borrowernumber} ), 1, 'Private list could be modified (add) by someone else # individual check done later' ); >+ >+ is( $private_shelf->can_biblios_be_removed( $patron1->{borrowernumber} ), 1, 'The owner should be able to remove biblios to his list' ); >+ is( $private_shelf->can_biblios_be_removed( $patron2->{borrowernumber} ), 1, 'Private list could be modified (remove) by someone else # individual check done later' ); >+}; >diff --git a/virtualshelves/addbybiblionumber.pl b/virtualshelves/addbybiblionumber.pl >index 37d300e..e6a1630 100755 >--- a/virtualshelves/addbybiblionumber.pl >+++ b/virtualshelves/addbybiblionumber.pl >@@ -155,7 +155,8 @@ sub HandleNewVirtualShelf { > } > > sub HandleShelfNumber { >- if($authorized= ShelfPossibleAction($loggedinuser, $shelfnumber, 'add')) { >+ my $shelf = Koha::Virtualshelves->find( $shelfnumber ); >+ if($authorized = $shelf->can_biblios_be_added( $loggedinuser ) ) { > AddBibliosToShelf($shelfnumber, @biblionumber); > #Close this page and return > print $query->header; >@@ -167,9 +168,9 @@ sub HandleShelfNumber { > } > > sub HandleSelectedShelf { >- if($authorized= ShelfPossibleAction( $loggedinuser, $shelfnumber, 'add')){ >+ my $shelf = Koha::Virtualshelves->find( $shelfnumber ); >+ if($authorized = $shelf->can_biblios_be_added( $loggedinuser ) ) { > #confirm adding to specific shelf >- my $shelf = Koha::Virtualshelves->find( $shelfnumber ); > $template->param( > singleshelf => 1, > shelfnumber => $shelf->shelfnumber, >diff --git a/virtualshelves/downloadshelf.pl b/virtualshelves/downloadshelf.pl >index 0f90340..e87f804 100755 >--- a/virtualshelves/downloadshelf.pl >+++ b/virtualshelves/downloadshelf.pl >@@ -31,10 +31,13 @@ use C4::VirtualShelves; > use C4::Record; > use C4::Ris; > use C4::Csv; >+ >+use Koha::Virtualshelves; >+ > use utf8; > my $query = new CGI; > >-my ( $template, $borrowernumber, $cookie ) = get_template_and_user ( >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( > { > template_name => "virtualshelves/downloadshelf.tt", > query => $query, >@@ -47,6 +50,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user ( > my $shelfid = $query->param('shelfid'); > my $format = $query->param('format'); > my $dbh = C4::Context->dbh; >+my @messages; > > if ($shelfid && $format) { > >@@ -54,41 +58,52 @@ if ($shelfid && $format) { > my $marcflavour = C4::Context->preference('marcflavour'); > my $output=''; > >- # CSV >- if ($format =~ /^\d+$/) { >- my @biblios; >- foreach (@$items) { >- push @biblios, $_->{biblionumber}; >- } >- $output = marc2csv(\@biblios, $format); >- } >- else { #Other formats >- foreach my $biblio (@$items) { >- my $biblionumber = $biblio->{biblionumber}; >- my $record = GetMarcBiblio($biblionumber, 1); >- if ($format eq 'iso2709') { >- $output .= $record->as_usmarc(); >- } >- elsif ($format eq 'ris') { >- $output .= marc2ris($record); >+ my $shelf = Koha::Virtualshelves->find($shelfid); >+ if ( $shelf ) { >+ if ( $shelf->can_be_viewed( $loggedinuser ) ) { >+ >+ # CSV >+ if ($format =~ /^\d+$/) { >+ my @biblios; >+ foreach (@$items) { >+ push @biblios, $_->{biblionumber}; >+ } >+ $output = marc2csv(\@biblios, $format); > } >- elsif ($format eq 'bibtex') { >- $output .= marc2bibtex($record, $biblionumber); >+ else { #Other formats >+ foreach my $biblio (@$items) { >+ my $biblionumber = $biblio->{biblionumber}; >+ my $record = GetMarcBiblio($biblionumber, 1); >+ if ($format eq 'iso2709') { >+ $output .= $record->as_usmarc(); >+ } >+ elsif ($format eq 'ris') { >+ $output .= marc2ris($record); >+ } >+ elsif ($format eq 'bibtex') { >+ $output .= marc2bibtex($record, $biblionumber); >+ } >+ } > } >+ print $query->header( >+ -type => 'application/octet-stream', >+ -'Content-Transfer-Encoding' => 'binary', >+ -attachment=>"shelf.$format"); >+ print $output; >+ exit; >+ } else { >+ push @messages, { type => 'error', code => 'unauthorized' }; > } >+ } else { >+ push @messages, { type => 'error', code => 'does_not_exist' }; > } > > # If it was a CSV export we change the format after the export so the file extension is fine > $format = "csv" if ($format =~ m/^\d+$/); >- >- print $query->header( >- -type => 'application/octet-stream', >- -'Content-Transfer-Encoding' => 'binary', >- -attachment=>"shelf.$format"); >- print $output; > } > else { > $template->param(csv_profiles => GetCsvProfilesLoop('marc')); > $template->param(shelfid => $shelfid); >- output_html_with_http_headers $query, $cookie, $template->output; > } >+$template->param( messages => \@messages ); >+output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl >index 43ae72a..8e7ecc0 100755 >--- a/virtualshelves/shelves.pl >+++ b/virtualshelves/shelves.pl >@@ -1,7 +1,6 @@ > #!/usr/bin/perl > >-# >-# Copyright 2000-2002 Katipo Communications >+# Copyright 2015 Koha Team > # > # This file is part of Koha. > # >@@ -18,22 +17,263 @@ > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; >+use Modern::Perl; > use CGI qw ( -utf8 ); >-use C4::VirtualShelves::Page; >+use C4::VirtualShelves; > use C4::Auth; >+use C4::Biblio; >+use C4::Csv; >+use C4::Koha; >+use C4::Items; >+use C4::Members; >+use C4::Output; >+use C4::XSLT; >+use Koha::Virtualshelves; > > my $query = new CGI; > > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >- { >- template_name => "virtualshelves/shelves.tt", >+ { template_name => "virtualshelves/shelves.tt", > query => $query, > type => "intranet", > authnotrequired => 0, > flagsrequired => { catalogue => 1 }, > } > ); >-$template->param( print => $query->param('print') ); >-shelfpage('intranet', $query, $template, $loggedinuser, $cookie); >+ >+my $op = $query->param('op') || 'list'; >+my $referer = $query->param('referer') || $op; >+my $category = $query->param('category') || 1; >+my ( $shelf, $shelfnumber, @messages ); >+ >+if ( $op eq 'add_form' ) { >+ # Nothing to do >+} elsif ( $op eq 'edit_form' ) { >+ $shelfnumber = $query->param('shelfnumber'); >+ $shelf = Koha::Virtualshelves->find($shelfnumber); >+ >+ if ( $shelf ) { >+ $category = $shelf->category; >+ my $patron = GetMember( 'borrowernumber' => $shelf->owner ); >+ $template->param( owner => $patron, ); >+ unless ( $shelf->can_be_managed( $loggedinuser ) ) { >+ push @messages, { type => 'error', code => 'unauthorized_on_update' }; >+ $op = 'list'; >+ } >+ } else { >+ push @messages, { type => 'error', code => 'does_not_exist' }; >+ } >+} elsif ( $op eq 'add' ) { >+ eval { >+ $shelf = Koha::Virtualshelf->new( >+ { shelfname => $query->param('shelfname'), >+ sortfield => $query->param('sortfield'), >+ category => $query->param('category'), >+ allow_add => $query->param('allow_add'), >+ allow_delete_own => $query->param('allow_delete_own'), >+ allow_delete_other => $query->param('allow_delete_other'), >+ owner => $query->param('owner'), >+ } >+ ); >+ $shelf->store; >+ $shelfnumber = $shelf->shelfnumber; >+ }; >+ if ($@) { >+ push @messages, { type => 'error', code => ref($@), msg => $@ }; >+ } elsif ( not $shelf ) { >+ push @messages, { type => 'error', code => 'error_on_insert' }; >+ } else { >+ push @messages, { type => 'message', code => 'success_on_insert' }; >+ $op = 'view'; >+ } >+} elsif ( $op eq 'edit' ) { >+ $shelfnumber = $query->param('shelfnumber'); >+ $shelf = Koha::Virtualshelves->find($shelfnumber); >+ >+ if ( $shelf ) { >+ $op = $referer; >+ if ( $shelf->can_be_managed( $loggedinuser ) ) { >+ $shelf->shelfname( $query->param('shelfname') ); >+ $shelf->sortfield( $query->param('sortfield') ); >+ $shelf->allow_add( $query->param('allow_add') ); >+ $shelf->allow_delete_own( $query->param('allow_delete_own') ); >+ $shelf->allow_delete_other( $query->param('allow_delete_other') ); >+ $shelf->category( $query->param('category') ); >+ eval { $shelf->store }; >+ >+ if ($@) { >+ push @messages, { type => 'error', code => 'error_on_update' }; >+ $op = 'edit_form'; >+ } else { >+ push @messages, { type => 'message', code => 'success_on_update' }; >+ } >+ } else { >+ push @messages, { type => 'error', code => 'unauthorized_on_update' }; >+ } >+ } else { >+ push @messages, { type => 'error', code => 'does_not_exist' }; >+ } >+} elsif ( $op eq 'delete' ) { >+ $shelfnumber = $query->param('shelfnumber'); >+ $shelf = Koha::Virtualshelves->find($shelfnumber); >+ if ($shelf) { >+ if ( $shelf->can_be_deleted( $loggedinuser ) ) { >+ eval { $shelf->delete; }; >+ if ($@) { >+ push @messages, { type => 'error', code => ref($@), msg => $@ }; >+ } else { >+ push @messages, { type => 'message', code => 'success_on_delete' }; >+ } >+ } else { >+ push @messages, { type => 'error', code => 'unauthorized_on_delete' }; >+ } >+ } else { >+ push @messages, { type => 'error', code => 'does_not_exist' }; >+ } >+ $op = 'list'; >+} elsif ( $op eq 'add_biblio' ) { >+ $shelfnumber = $query->param('shelfnumber'); >+ $shelf = Koha::Virtualshelves->find($shelfnumber); >+ if ($shelf) { >+ if( my $barcode = $query->param('barcode') ) { >+ my $item = GetItem( 0, $barcode); >+ if (defined $item && $item->{itemnumber}) { >+ my $biblio = GetBiblioFromItemNumber( $item->{itemnumber} ); >+ if ( $shelf->can_biblios_be_added( $loggedinuser ) ) { >+ my $added = eval { $shelf->add_biblio( $biblio->{biblionumber}, $loggedinuser ); }; >+ if ($@) { >+ push @messages, { type => 'error', code => ref($@), msg => $@ }; >+ } elsif ( $added ) { >+ push @messages, { type => 'message', code => 'success_on_add_biblio' }; >+ } else { >+ push @messages, { type => 'message', code => 'error_on_add_biblio' }; >+ } >+ } else { >+ push @messages, { type => 'error', code => 'unauthorized_on_add_biblio' }; >+ } >+ } else { >+ push @messages, { type => 'error', code => 'item_does_not_exist' }; >+ } >+ } >+ } else { >+ push @messages, { type => 'error', code => 'does_not_exist' }; >+ } >+ $op = $referer; >+} elsif ( $op eq 'remove_biblios' ) { >+ $shelfnumber = $query->param('shelfnumber'); >+ $shelf = Koha::Virtualshelves->find($shelfnumber); >+ my @biblionumbers = $query->param('biblionumber'); >+ if ($shelf) { >+ if ( $shelf->can_biblios_be_removed( $loggedinuser ) ) { >+ my $number_of_biblios_removed = eval { >+ $shelf->remove_biblios( >+ { >+ biblionumbers => \@biblionumbers, >+ borrowernumber => $loggedinuser, >+ } >+ ); >+ }; >+ if ($@) { >+ push @messages, { type => 'error', code => ref($@), msg => $@ }; >+ } elsif ( $number_of_biblios_removed ) { >+ push @messages, { type => 'message', code => 'success_on_remove_biblios' }; >+ } else { >+ push @messages, { type => 'error', code => 'no_biblio_removed' }; >+ } >+ } else { >+ push @messages, { type => 'error', code => 'unauthorized_on_remove_biblios' }; >+ } >+ } else { >+ push @messages, { type => 'error', code => 'does_not_exist' }; >+ } >+ $op = $referer; >+} >+ >+if ( $op eq 'view' ) { >+ $shelfnumber ||= $query->param('shelfnumber'); >+ $shelf = Koha::Virtualshelves->find($shelfnumber); >+ if ( $shelf ) { >+ if ( $shelf->can_be_viewed( $loggedinuser ) ) { >+ my $sortfield = $query->param('sortfield') || $shelf->sortfield; # Passed in sorting overrides default sorting >+ my $direction = $query->param('direction') || 'asc'; >+ my ( $shelflimit, $shelfoffset, $itemoff ); >+ unless ( $query->param('print') ) { >+ $shelflimit = C4::Context->preference('numSearchResults') || 20; >+ $itemoff = ( $query->param('itemoff') ? $query->param('itemoff') : 1 ); >+ $shelfoffset = ( $itemoff - 1 ) * $shelflimit; # Sets the offset to begin retrieving items at >+ } >+ my ( $items, $totitems ) = GetShelfContents( $shelfnumber, $shelflimit, $shelfoffset, $sortfield, $direction ); >+ >+ my $borrower = GetMember( borrowernumber => $loggedinuser ); >+ >+ for my $this_item (@$items) { >+ my $biblionumber = $this_item->{biblionumber}; >+ my $record = GetMarcBiblio($biblionumber); >+ >+ if ( C4::Context->preference("XSLTResultsDisplay") ) { >+ $this_item->{XSLTBloc} = XSLTParse4Display( $biblionumber, $record, "XSLTResultsDisplay" ); >+ } >+ >+ my $marcflavour = C4::Context->preference("marcflavour"); >+ $this_item->{'imageurl'} = getitemtypeinfo( $this_item->{'itemtype'}, 'intranet' )->{'imageurl'}; >+ $this_item->{'coins'} = GetCOinSBiblio($record); >+ $this_item->{'subtitle'} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $this_item->{'biblionumber'} ) ); >+ $this_item->{'normalized_upc'} = GetNormalizedUPC( $record, $marcflavour ); >+ $this_item->{'normalized_ean'} = GetNormalizedEAN( $record, $marcflavour ); >+ $this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber( $record, $marcflavour ); >+ $this_item->{'normalized_isbn'} = GetNormalizedISBN( undef, $record, $marcflavour ); >+ >+ unless ( defined $this_item->{size} ) { >+ >+ #TT has problems with size >+ $this_item->{size} = q||; >+ } >+ >+ # Getting items infos for location display >+ my @items_infos = &GetItemsLocationInfo( $this_item->{'biblionumber'} ); >+ $this_item->{'ITEM_RESULTS'} = \@items_infos; >+ } >+ >+ # Build drop-down list for 'Add To:' menu... >+ my ( $totalref, $pubshelves, $barshelves ) = C4::VirtualShelves::GetSomeShelfNames( $loggedinuser, 'COMBO', 1 ); >+ $template->param( >+ addbarshelves => $totalref->{bartotal}, >+ addbarshelvesloop => $barshelves, >+ addpubshelves => $totalref->{pubtotal}, >+ addpubshelvesloop => $pubshelves, >+ can_manage_shelf => $shelf->can_be_managed($loggedinuser), >+ can_remove_shelf => $shelf->can_be_deleted($loggedinuser), >+ can_remove_biblios => $shelf->can_biblios_be_removed($loggedinuser), >+ can_add_biblios => $shelf->can_biblios_be_added($loggedinuser), >+ sortfield => $sortfield, >+ itemsloop => $items, >+ sortfield => $sortfield, >+ direction => $direction, >+ ); >+ if ($shelflimit) { >+ $template->param( >+ pagination_bar => pagination_bar( >+ q||, ( int( $totitems / $shelflimit ) ) + ( ( $totitems % $shelflimit ) > 0 ? 1 : 0 ), >+ $itemoff, "itemoff", { op => 'view', shelfnumber => $shelf->shelfnumber, sortfield => $sortfield, direction => $direction, } >+ ), >+ ); >+ } >+ } else { >+ push @messages, { type => 'error', code => 'unauthorized_on_view' }; >+ } >+ } else { >+ push @messages, { type => 'error', code => 'does_not_exist' }; >+ } >+} >+ >+$template->param( >+ op => $op, >+ referer => $referer, >+ shelf => $shelf, >+ messages => \@messages, >+ category => $category, >+ print => $query->param('print') || 0, >+ csv_profiles => GetCsvProfilesLoop('marc'), >+); >+ >+output_html_with_http_headers $query, $cookie, $template->output; >-- >2.1.0
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 14544
:
41034
|
41035
|
41036
|
41037
|
41038
|
41039
|
41040
|
41041
|
41042
|
41403
|
41404
|
41405
|
41406
|
41407
|
41408
|
41409
|
41410
|
41411
|
41412
|
41584
|
41585
|
41586
|
41587
|
41588
|
41589
|
41590
|
41591
|
41592
|
41593
|
41594
|
41595
|
41596
|
41597
|
41598
|
41599
|
41600
|
41601
|
41716
|
41717
|
41718
|
41719
|
41720
|
41721
|
41722
|
41723
|
41724
|
41725
|
41726
|
41727
|
41728
|
41729
|
41730
|
41731
|
41732
|
41733
|
41766
|
41909
|
41910
|
41913
|
41914
|
41915
|
41917
|
41918
|
41919
|
41924
|
41927
|
41931
|
41932
|
41953
|
41954
|
41955
|
41956
|
41957
|
41958
|
41959
|
41960
|
41961
|
41962
|
41963
|
41964
|
41965
|
41966
|
41967
|
41968
|
41969
|
41970
|
41973
|
41974
|
41975
|
41976
|
41977
|
41978
|
41979
|
41980
|
41981
|
41982
|
41983
|
41986
|
41988
|
42192
|
42199
|
42200
|
42201
|
42202
|
42203
|
42204
|
42205
|
42206
|
42207
|
42208
|
42209
|
42210
|
42211
|
42212
|
42213
|
42214
|
42215
|
42216
|
42217
|
42218
|
42219
|
42638
|
43223
|
43224
|
43225
|
43226
|
43227
|
43228
|
43229
|
43230
|
43231
|
43232
|
43233
|
43234
|
43235
|
43236
|
43237
|
43238
|
43239
|
43240
|
43241
|
43242
|
43243
|
43296
|
43334
|
43335
|
43403
|
43456
|
43457
|
43458
|
43459
|
43460
|
43461
|
43462
|
43463
|
43464
|
43465
|
43466
|
43467
|
43469
|
43470
|
43471
|
43472
|
43473
|
43474
|
43475
|
43476
|
43477
|
43478
|
43479
|
43480
|
43481
|
43482
|
43485
|
43486
|
43487
|
44467
|
44468
|
44469
|
44470
|
44471
|
44472
|
44473
|
44474
|
44475
|
44476
|
44477
|
44478
|
44479
|
44480
|
44481
|
44482
|
44483
|
44484
|
44485
|
44486
|
44487
|
44758
|
44845
|
44852
|
44863
|
44872