+[% USE Koha %]
[% SET TagsShowEnabled = ( TagsEnabled && TagsShowOnList ) %]
[% SET TagsInputEnabled = ( opacuserlogin && TagsEnabled && TagsInputOnList ) %]
-
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › [% IF ( viewshelf ) %]Contents of [% shelfname |html %][% ELSE %]Your lists[% END %][% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
<script type="text/javascript">
//<![CDATA[
var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
+var MSG_REMOVE_ONE_FROM_LIST = _("Are you sure you want to remove this item from the list?");
var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to delete this list?");
+var MSG_CONFIRM_REMOVE_SHARE = _("Are you sure you want to remove this share?");
[% IF ( opacuserlogin ) %][% IF ( RequestOnOpac ) %]
function holdSelections() {
});
[% END %]
[% IF ( loggedinusername && allowremovingitems ) %]
+ var removeFromListLinks = $(".removefromlist");
+ removeFromListLinks.show();
+ // "remove from list" appearing on each line of the list output
+ removeFromListLinks.on("click",function(){
+ $(".checkboxed").unCheckCheckboxes();
+ var listitem = $("input[name="+this.id+"]");
+ listitem.prop("checked",true);
+ $("#myform").submit();
+ });
$("#myform").submit(function(){
var checkedBoxes = $(".checkboxed input:checkbox:checked");
- if ($(checkedBoxes).size()) {
- return confirmDelete(MSG_REMOVE_FROM_LIST);
+ var numchecked = $(checkedBoxes).size();
+ if (numchecked) {
+ if( numchecked > 1 ){
+ return confirmDelete(MSG_REMOVE_FROM_LIST);
+ } else {
+ return confirmDelete(MSG_REMOVE_ONE_FROM_LIST);
+ }
} else {
alert(MSG_NO_RECORD_SELECTED);
return false;
[% BLOCK list_permissions %]
<li>
- <label for="permissions">Permissions: </label>
+ <label for="allow_add">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 %]
</li>
[% END %]
+[%# When using the next block, add the parameter for shelfnumber and add a tag to end the form %]
+[% BLOCK remove_share %]
+ <form action="opac-shelves.pl" method="post">
+ <input type="hidden" name="shelves" value="1" />
+ <input type="hidden" name="display" value="privateshelves" />
+ <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
+ <input type="submit" class="removeshare" onclick="return confirmDelete(MSG_CONFIRM_REMOVE_SHARE);" value="Remove share" />
+[% END %]
+
[% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSIF ( loggedinusername ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
<div id="bd">
[% INCLUDE 'masthead.inc' %]
<div class="yui-ge">
<div class="yui-u first">
[% IF ( paramsloo.already ) %]<div class="dialog alert">A list named <b>[% paramsloo.already %]</b> already exists!</div>[% END %]
+ [% IF ( paramsloo.addshelf_failed ) %]<div class="dialog alert">List could not be created. [% IF loggedinuser==0 %](Do not use the database administrator account.)[% END %]</div>[% END %]
[% 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 shelfnumber given.</div>[% END %]
<input type="hidden" value="1" name="shelves"/>
<input type="hidden" value="1" name="DEL-[% shelfnumber %]"/>
[% IF ( showprivateshelves ) %]<input type="hidden" name="display" value="privateshelves"/>[% END %]<input type="submit" class="deleteshelf" value="Delete list" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);"/>
- </form> [% END %]
+ </form>
+ [% IF showprivateshelves && Koha.Preference('OpacAllowSharingPrivateLists') %]
+ <form action="opac-shareshelf.pl" method="post">
+ <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
+ <input type="hidden" name="op" value="invite" />
+ <input type="submit" class="Share" value="Share" />
+ </form>
+ [% END %]
+ [% ELSIF showprivateshelves %]
+ [% INCLUDE remove_share %]
+ <input type="hidden" name="REMSHR-[% shelfnumber %]" value="1" />
+ </form>
+ [% END %]
</div>
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( virtualshelves ) %]<a class="addtoshelf" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber %]'); return false;">Save to another list</a>
[% END %][% END %][% END %]
+
+ [% IF ( allowremovingitems ) %]
+ <a class="removefromlist" id="REM-[% itemsloo.biblionumber %]" href="#">Remove from this list</a>
+ [% END %]
+
[% IF ( opacbookbag ) %]
[% IF ( itemsloo.incart ) %]
<a class="addtocart cart[% itemsloo.biblionumber %]" href="#" onclick="addRecord('[% itemsloo.biblionumber %]'); return false;">In your cart</a> <a class="cartRemove cartR[% itemsloo.biblionumber %]" href="#" onclick="delSingleRecord('[% itemsloo.biblionumber %]'); return false;">(remove)</a>
[% IF ( sortfield == "itemcallnumber" ) %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
</select>
</li>
+ [% IF ( OpacAllowPublicListCreation || category2 ) %]
<li>
- [% IF (OpacAllowPublicListCreation) %]
<label for="category">Category:</label>
<select name="category" id="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>
- [% END %]
+ [% IF ( category2 && !OpacAllowPublicListCreation ) %]
+ The library has disabled the ability for patrons to create new public lists. If you make your list private, you will not be able to make it public again.
+ [% END %]
</li>
[% INCLUDE list_permissions %]
+ [% END %]
</ol>
+ [% UNLESS ( OpacAllowPublicListCreation || category2 ) %]
+ <input type="hidden" name="category" value="1" />
+ [% END %]
</fieldset>
<fieldset class="action"><input type="submit" value="Save" class="submit" /> [% IF ( showprivateshelves ) %]<a class="cancel" href="/cgi-bin/koha/opac-shelves.pl?shelfnumber=[% shelfnumber %]&display=privateshelves">Cancel</a>[% ELSE %]<a class="cancel" href="/cgi-bin/koha/opac-shelves.pl?shelfnumber=[% shelfnumber %]">Cancel</a>[% END %]</fieldset>
</form>
<ul class="link-tabs">
[% IF ( opacuserlogin ) %]
[% IF ( showprivateshelves ) %]
- <li id="privateshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your private lists</a></li>
+ <li id="privateshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your lists</a></li>
[% ELSE %]
- <li id="privateshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your private lists</a></li>
+ <li id="privateshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your lists</a></li>
[% END %]
[% END %]
[% IF ( showpublicshelves ) %]
<th>List name</th>
<th>Contents</th>
<th>Type</th>
- <th> </th>
+ <th>Options</th>
</tr>
[% FOREACH shelveslooppri IN shelveslooppriv %]
[% UNLESS ( loop.odd ) %]
<td><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves&viewshelf=[% shelveslooppri.shelf %]&sortfield=[% shelveslooppri.sortfield %]">[% shelveslooppri.shelfname |html %]</a></td>
<td>[% IF ( shelveslooppri.count ) %][% shelveslooppri.count %] [% IF ( shelveslooppri.single ) %]item[% ELSE %]items[% END %][% ELSE %]Empty[% END %]</td>
<td>
- [% IF ( shelveslooppri.viewcategory1 ) %]Private[% END %]
+ [% IF ( shelveslooppri.viewcategory1 ) %][% IF !shelveslooppri.shares %]Private[% ELSE %]Shared[% END %][% END %]
[% IF ( shelveslooppri.viewcategory2 ) %]Public[% END %]
</td>
<td>
[% ELSE %]
<input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
[% END %]
+ </form>
+ [% IF Koha.Preference('OpacAllowSharingPrivateLists') %]
+ <form action="opac-shareshelf.pl" method="post">
+ <input type="hidden" name="shelfnumber" value="[% shelveslooppri.shelf %]" />
+ <input type="hidden" name="op" value="invite" />
+ <input type="submit" class="Share" value="Share" />
+ </form>
+ [% END %]
+ [% ELSIF shelveslooppri.shares %]
+ [% INCLUDE remove_share %]
+ <input type="hidden" name="REMSHR-[% shelveslooppri.shelf %]" value="1" />
</form>
[% END %]
</td>
<tr>
<th>List name</th>
<th>Contents</th>
- <th>Type</th><th> </th>
+ <th>Type</th>
+ <th>Options</th>
</tr>
[% FOREACH shelvesloo IN shelvesloop %]
[% UNLESS ( loop.odd ) %]
<option value="itemcallnumber">Call number</option>
</select>
</li>
+ [% IF (OpacAllowPublicListCreation) %]
<li>
<label for="category">Category:</label>
<select name="category" id="category">
<option value="1">Private</option>
- [% IF (OpacAllowPublicListCreation) %]
<option value="2">Public</option>
- [% END %]
</select>
</li>
[% INCLUDE list_permissions %]
+ [% END %]
</ol>
+ [% UNLESS (OpacAllowPublicListCreation) %]
+ <input type="hidden" name="category" value="1" />
+ [% END %]
</fieldset>
<fieldset class="action">
<input type="submit" onclick="Check(this.form); return false;" value="Save" class="submit" />