@@ -, +, @@ --- .../opac-tmpl/prog/en/modules/opac-shareshelf.tt | 28 ++++++++++++ .../opac-tmpl/prog/en/modules/opac-shelves.tt | 7 +++ opac/opac-shareshelf.pl | 45 ++++++++++++++++++++ 3 files changed, 80 insertions(+), 0 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/prog/en/modules/opac-shareshelf.tt create mode 100755 opac/opac-shareshelf.pl --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shareshelf.tt +++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shareshelf.tt @@ -0,0 +1,28 @@ +[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Share a list +[% INCLUDE 'doc-head-close.inc' %] + + +
+
+[% INCLUDE 'masthead.inc' %] + +
+
+

Share a list

+

Here follows the stuff for shelfnumber [% shelfnumber %]

+
+
+
+ + +[% IF ( OpacNav ) %] +
+
+ [% INCLUDE 'navigation.inc' %] +
+
+[% END %] + +
+
+[% INCLUDE 'opac-bottom.inc' %] --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt +++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt @@ -1,3 +1,4 @@ +[% USE Koha %] [% SET TagsShowEnabled = ( TagsEnabled && TagsShowOnList ) %] [% SET TagsInputEnabled = ( opacuserlogin && TagsEnabled && TagsInputOnList ) %] @@ -629,7 +630,13 @@ $(document).ready(function() { [% ELSE %] [% END %] + + [% IF Koha.Preference('OpacAllowSharingPrivateLists') %] +
+ +
+ [% END %] [% END %]  --- a/opac/opac-shareshelf.pl +++ a/opac/opac-shareshelf.pl @@ -0,0 +1,45 @@ +#!/usr/bin/perl + +# Copyright 2013 Rijksmuseum +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use strict; +use warnings; + +use CGI; + +use C4::Auth; +use C4::Output; +use C4::VirtualShelves; + +my $query= new CGI; +my $shelfno= $query->param('shelfnumber')||0; + +my ($template, $loggedinuser, $cookie)= get_template_and_user({ + template_name => "opac-shareshelf.tmpl", + query => $query, + type => "opac", + authnotrequired => 0, #should be a user +}); + +#TODO Check: pref value OpacAllowSharingPrivateList +#TODO Check: only owner can share a list + +$template->param( + shelfnumber => $shelfno, +); +output_html_with_http_headers $query, $cookie, $template->output; --