2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Share a list</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% BLOCK cssinclude %][% END %]
8 [% INCLUDE 'bodytag.inc' bodyid='opac-shareshelf' bodyclass='scrollto' %]
9 [% INCLUDE 'masthead.inc' %]
11 <ul class="breadcrumb">
12 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
13 [% IF ( loggedinusername ) %]
14 <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">›</span></li>
16 <li><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a> <span class="divider">›</span></li>
18 </ul> <!-- / .breadcrumb -->
20 <div class="container-fluid">
21 <div class="row-fluid">
25 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
31 <div id="shareshelf" class="maincontent">
33 [%# This section contains the essential code for error messages and three operations: invite, confirm_invite and accept. %]
34 <h2>Share a list with another patron</h2>
37 [% IF errcode==1 && op %]<div class="alert">The operation [% op | html %] is not supported.</div>[% END %]
38 [% IF errcode==1 && !op %]<div class="alert">No operation parameter has been passed.</div>[% END %]
39 [% IF errcode==2 %]<div class="alert">Invalid shelf number.</div>[% END %]
40 [% IF errcode==3 %]<div class="alert">The feature of sharing lists is not in use in this library.</div>[% END %]
41 [% IF errcode==4 %]<div class="alert">You can only share a list if you are the owner.</div>[% END %]
42 [% IF errcode==5 %]<div class="alert">You cannot share a public list.</div>[% END %]
43 [% IF errcode==6 %]<div class="alert">Sorry, but you did not enter a valid email address.</div>[% END %]
44 [% IF errcode==7 %]<div class="alert">Sorry, but we could not accept this key. The invitation may have expired. Contact the patron who sent you the invitation.</div>[% END %]
45 [% IF errcode==8 %]<div class="alert">As owner of a list you cannot accept an invitation for sharing it.</div>[% END %]
46 <p><a href="/cgi-bin/koha/opac-shelves.pl?op=list&category=1">Return to your lists</a></p>
48 [% ELSIF op=='invite' %]
50 <form id="share_list">
51 <fieldset class="rows">
53 <input type="hidden" name="op" value="conf_invite"/>
54 <input type="hidden" name="shelfnumber" value="[% shelfnumber %]"/>
55 <li><label for="name">List name:</label> [% shelfname | html %]</li>
57 <label for="invite_address">Email address:</label>
58 <input id="invite_address" name="invite_address" size="40" />
62 <fieldset class="action">
63 <input type="submit" value="Send" class="btn" />
64 <a href="/cgi-bin/koha/opac-shelves.pl?op=list&category=1" class="cancel">Cancel</a>
69 [% ELSIF op=='conf_invite' %]
70 <div id="conf_invite">
71 [% IF approvedaddress %]
72 <p>An invitation to share list <i>[% shelfname | html %]</i> will be sent shortly to [% approvedaddress %].</p>
75 <p>Something went wrong while processing the following addresses. Please check them. These are: [% failaddress %]</p>
77 [% IF approvedaddress %]
78 <p>You will receive an email notification if someone accepts your share within two weeks.</p>
80 <p><a href="/cgi-bin/koha/opac-shelves.pl?op=list&category=1">Return to your lists</a></p>
83 [% ELSIF op=='accept' %]
84 [%# Nothing to do: we already display an error or we redirect. %]
87 </div> <!-- / .span10 -->
88 </div> <!-- / .maincontent -->
89 [%# End of essential part %]
91 </div> <!-- / .row-fluid -->
92 </div> <!-- / .container-fluid -->
93 </div> <!-- / .main -->
94 [% INCLUDE 'opac-bottom.inc' %]
98 $(document).ready(function(){
99 $("#share_list").on('submit', function(e) {
100 var address = $("#invite_address").val();
101 if ( address.length == 0) {