Koha/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt
Owen Leonard 0b9d4902de Bug 7226 - can't add tags on list
Incorrect check for TagsInputOnList was preventing the
right JavaScript from being triggered, and markup was
nested inside the wrong logic for the confirmation
message to be displayed consistently.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-16 18:14:20 +01:00

614 lines
35 KiB
Text

[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog &rsaquo; [% IF ( viewshelf ) %]Contents of [% shelfname |html %][% ELSE %]My 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_NO_TAG_SPECIFIED = _("No tag was specified.");
var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to delete this list?");
[% IF ( opacuserlogin ) %][% IF ( RequestOnOpac ) %]
function holdSelections() {
var checkedBoxes = $(":checkbox:checked");
if ($(checkedBoxes).size() == 0) {
alert(MSG_NO_RECORD_SELECTED);
} else {
var bibs = "";
$(checkedBoxes).each(function(){
var name = $(this).attr("name");
bib = name.substr(4);
bibs += bib + "/";
});
document.location = "/cgi-bin/koha/opac-reserve.pl?biblionumbers="+bibs;
}
}
[% END %][% END %]
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]function tagSelected() {
var checkedBoxes = $("input:checkbox:checked");
if ($(checkedBoxes).size()) {
$("#tagsel_tag").hide();
$(".tag_hides").hide();
$("#tagsel_form").show();
} else {
alert(MSG_NO_RECORD_SELECTED);
}
}
function tagCanceled() {
$("#tagsel_form").hide();
$("#tagsel_tag").show();
$(".tag_hides").show();
}
function tagAdded() {
var checkedBoxes = $("input:checkbox:checked");
if (!$(checkedBoxes).size()) {
alert(MSG_NO_RECORD_SELECTED);
return false;
}
var tag = $("#tagsel_new").val();
if (!tag || (tag == "")) {
alert(MSG_NO_TAG_SPECIFIED);
return false;
}
var bibs = [];
for (var i = 0; i < $(checkedBoxes).size(); i++) {
var box = $(checkedBoxes).get(i);
bibs[i] = $(box).val();
}
KOHA.Tags.add_multitags_button(bibs, tag);
return false;
}[% END %][% END %][% END %]
$(function() {
[% IF ( opacbookbag ) %]$(".addtocart").show();[% END %]
$("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_('Clear All')+"<\/a>|");
$("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_('Select All')+"<\/a>");
$("a.print").show();
[% IF ( opacuserlogin ) %][% IF ( RequestOnOpac ) %]$("#placehold").html("<a href=\"#\" class=\"hold tag_hides\">"+_('Place Hold')+"<\/a>");
$("#toolbar a.hold").click(function(){
holdSelections();
return false;
});[% END %][% END %]
$("#CheckAll").click(function(){
$(".checkboxed").checkCheckboxes();
return false;
});
$("#CheckNone").click(function(){
$(".checkboxed").unCheckCheckboxes();
return false;
});
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
$("#addtags").click(function(){
tagSelected();
return false;
});
$("#addtags").html("<a id=\"tagsel_tag\" href=\"#\">"+_("Tag")+"<\/a> |");
$(".tagbutton").click(KOHA.Tags.add_tag_button);
[% IF ( loggedinusername ) %]
$("#tagsel_tag").click(function(){
tagSelected();
return false;
});
$("#tagsel_cancel").click(function(){
tagCanceled();
return false;
});
$("#tagsel_button").click(function(){
tagAdded();
return false;
});
[% ELSE %]
$("#tagsel_tag").click(function(){
window.location = "/cgi-bin/koha/opac-user.pl";
return false;
});
[% END %]
[% END %][% END %][% END %]
[% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
});
function Check(f) {
var _alertString="";
var alertString2;
if(f.addshelf.value.length ==0){
_alertString += _("- You must enter a List Name") + "\n";
}
if (_alertString.length==0) {
f.submit();
} else {
alertString2 = _("Form not submitted because of the following problem(s)");
alertString2 += "\n------------------------------------------------------------------------------------\n\n";
alertString2 += _alertString;
alert(alertString2);
}
}
//]]>
</script>
</head>
[% IF ( loggedinusername ) %]<body id="opac-userlists">[% ELSE %]<body id="opac-lists">[% 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 id="yui-main">
<div class="yui-b">
<div id="usershelves" class="container">
[% IF ( paramsloop ) %]
[% FOREACH paramsloo IN paramsloop %]
<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.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 %]
[% IF ( paramsloo.need_confirm ) %]
<div class="dialog alert">
The list <i>[% paramsloo.need_confirm %]</i> is not empty.
<br />It has <b>[% paramsloo.count %]</b> [% IF ( paramsloo.single ) %]entry[% ELSE %]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.delete_ok ) %]
<div class="dialog message">List [% paramsloo.delete_ok %] Deleted.</div>
[% END %]
[% IF ( paramsloo.delete_fail ) %]
<div class="dialog message">ERROR: Database error. Delete (list number [% paramsloo.delete_fail %]) failed.</div>
[% END %]
[% IF ( paramsloo.unrecognized ) %]
<div class="dialog message">ERROR: List number [% paramsloo.unrecognized %] unrecognized.</div>
[% END %]
</div>
</div>
[% END %]<!-- /paramsloop -->
[% END %] <!-- /paramsloop -->
<div class="yui-g">
[% IF ( viewshelf ) %]<!-- Viewing a particular shelf -->
<h3><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a> <img src="[% themelang %]/../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> <em>[% shelfname |html %]</em></h3>
[% IF ( itemsloop ) %]
<div id="toolbar" class="list-actions"> <span class="checkall"></span>
<span class="clearall"></span>
[% IF ( RequestOnOpac ) %]
<span id="placehold"></span>[% UNLESS ( TagsEnabled ) %] |[% END %]
[% END %]
[% IF ( loggedinusername ) %]
[% IF ( TagsEnabled ) %]
<span id="addtags"></span>
<span id="tagsel_form" style="display:none">
<label for="tagsel_new" style="display:inline">New&nbsp;Tag:</label>
<input name="tagsel_new" id="tagsel_new" maxlength="100" style="display:inline"/>
<input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="tagsel_button"
type="submit" value="Add" style="display:inline" />
<a href="#" id="tagsel_cancel" onclick="tagCanceled(); return false;" style="display:inline">Cancel</a>
</span>
[% END %][% END %]
<a href="/cgi-bin/koha/opac-downloadshelf.pl?shelfid=[% shelfnumber %]" class="download tag_hides" onclick="open(CGIBIN+'opac-downloadshelf.pl?shelfid=[% shelfnumber %]','win_form','dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false;">Download List</a>
<span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber %]" class="send tag_hides" onclick="open(CGIBIN+'opac-sendshelf.pl?shelfid=[% shelfnumber %]','win_form','dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false; ">Send List</a></span>
<a class="print tag_hides" href="opac-shelves.pl" onclick="print(); return false;">Print List</a>
[% IF ( manageshelf ) %] | <form method="get" action="opac-shelves.pl" class="tag_hides"><input type="hidden" name="op" value="modif" />[% IF ( showprivateshelves ) %]<input type="hidden" name="display" value="privateshelves" />[% END %] <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" /> <input type="submit" class="editshelf tag_hides" value="Edit List" /></form>
<form method="post" action="opac-shelves.pl" class="tag_hides">
<input type="hidden" value="1" name="shelves"/>
[% IF ( showprivateshelves ) %]
<input type="hidden" name="display" value="privateshelves" />
[% END %]
<input type="hidden" value="1" name="DEL-[% shelfnumber %]"/>
<input type="submit" class="deleteshelf" value="Delete List" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);"/>
</form> [% END %]
</div>
<form action="/cgi-bin/koha/opac-shelves.pl" method="post" name="myform" class="checkboxed">
[% IF ( manageshelf ) %]
<input type="hidden" name="viewshelf" value="[% shelfnumber %]" />
<input type="hidden" name="modifyshelfcontents" value="1" />
[% END %]
<div class="searchresults">
<table id="listcontents">
<tbody>
[% FOREACH itemsloo IN itemsloop %]
[% UNLESS ( loop.odd ) %]
<tr class="highlight">
[% ELSE %]
<tr>
[% END %]
<td><input type="checkbox" name="REM-[% itemsloo.biblionumber %]"
value="[% itemsloo.biblionumber %]" /></td>
[% UNLESS ( item_level_itypes ) %]
<td>
[% UNLESS ( noItemTypeImages ) %]
<img src="[% itemsloo.imageurl %]" alt="[% itemsloo.description %]" title="[% itemsloo.description %]" />
[% END %]
[% itemsloo.description %]
</td>
[% END %]
<td>
[% IF ( itemsloo.XSLTBloc ) %]
[% itemsloo.XSLTBloc %]
[% ELSE %]
[% IF ( itemsloo.BiblioDefaultViewmarc ) %]<a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
[% ELSE %]
[% IF ( itemsloo.BiblioDefaultViewisbd ) %]<a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
[% ELSE %]<a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
[% END %]
[% END %]
[% IF ( itemsloo.title ) %][% itemsloo.title |html %][% ELSE %]No title[% END %] [% FOREACH subtitl IN itemsloo.subtitle %][% subtitl.subfield %][% END %]</a>
[% IF ( itemsloo.author ) %]by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% itemsloo.author |url %]" title="Search for works by this author" class="author">[% itemsloo.author %]</a>
[% ELSE %]&nbsp;
[% END %]
<span class="results_summary"><span class="label">Publication:</span>
[% IF ( itemsloo.place ) %][% itemsloo.place %] [% END %][% IF ( itemsloo.publishercode ) %][% itemsloo.publishercode %][% END %][% IF ( itemsloo.publicationyear ) %] [% itemsloo.publicationyear %]
[% ELSE %][% IF ( itemsloo.copyrightdate ) %] [% itemsloo.copyrightdate %][% END %][% END %]
[% IF ( itemsloo.pages ) %]. [% itemsloo.pages %][% END %]
[% IF ( itemsloo.notes ) %], [% itemsloo.notes %][% END %]
[% IF ( itemsloo.size ) %] [% itemsloo.size %][% END %]
</span>
<span class="results_summary"><span class="label">Holdings:</span>[% IF ( itemsloo.ITEM_RESULTS ) %][% FOREACH ITEM_RESULT IN itemsloo.ITEM_RESULTS %]
[% ITEM_RESULT.homebranch %][% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
[% IF ( ITEM_RESULT.itemcallnumber ) %]
([% ITEM_RESULT.itemcallnumber %])[% IF ( loop.last ) %].[% ELSE %],[% END %]
[% END %]
[% END %][% ELSE %]This record has no items.[% END %]</span>
[% END %]
[% IF ( TagsEnabled ) %]
[% IF ( TagsShowOnList ) %]
[% IF ( itemsloo.TagLoop.size ) %]
<div class="results_summary">
<span class="label">Tags:</span>
<ul style="display: inline; list-style: none;">[% FOREACH TagLoo IN itemsloo.TagLoop %]<li style="display: inline; list-style: none;"><a href="/cgi-bin/koha/opac-search.pl?tag=[% TagLoo.term |url %]&amp;q=[% TagLoo.term |url %]">[% TagLoo.term %]</a> <span class="weight">([% TagLoo.weight_total %])</span></li>
[% END %]
</ul>
</div>
[% END %]
[% END %]
[% IF ( TagsInputOnList ) %]
[% IF ( loggedinusername ) %]
<form name="tagform[% itemsloo.biblionumber %]" method="post" action="/cgi-bin/koha/opac-tags.pl">
<label for="newtag[% itemsloo.biblionumber %]">New tag:</label>
<input name="newtag[% itemsloo.biblionumber %]" id="newtag[% itemsloo.biblionumber %]" maxlength="100" />
<input name="tagbutton" class="tagbutton" title="[% itemsloo.biblionumber %]" type="submit" value="Add" />
</form>
<span id="newtag[% itemsloo.biblionumber %]_status" class="tagstatus" style="display:none;">
Tag status here.
</span>
[% ELSIF ( loop.first ) %]<span class="tagstatus" id="login4tags">Log in to add tags.</span>
[% END %]
[% END %]
[% IF ( loggedinusername ) %]
<span id="newtag[% itemsloo.biblionumber %]_status" class="tagstatus" style="display:none;">Tag status here.</span>
[% END %]
[% END %]
<span class="results_summary actions"><span class="label">Actions:</span>
[% IF ( RequestOnOpac ) %]
[% UNLESS ( itemsloo.norequests ) %]
[% IF ( opacuserlogin ) %]
[% IF ( AllowOnShelfHolds ) %]
<a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber %]">Place Hold</a><!-- add back when available 0 holds in queue-->
[% ELSE %]
[% IF ( itemsloo.itemsissued ) %]
<a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber %]">Place Hold</a><!-- add back when available 0 holds in queue-->
[% END %]
[% END %]
[% END %]
[% END %]
[% END %]
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( virtualshelves ) %]<a class="addtolist" 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 ( opacbookbag ) %]<a class="addtocart" href="#" onclick="addRecord('[% itemsloo.biblionumber %]'); return false;">Add to Cart</a>[% ELSE %]nocart[% END %]
</span>
<!-- COinS / Openurl -->
<!-- COinS / Openurl --><span class="Z3988" title="[% itemsloo.coins %]"></span>
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]<br/>
<div id="newtag[% itemsloo.biblionumber %]_status" class="tagstatus results_summary" style="display:none">Tag status here.</div>[% END %][% END %][% END %]
</td>
<td>
<a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber %]">
[% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( itemsloo.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% itemsloo.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
[% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %]
<img src="https://secure.syndetics.com/index.aspx?isbn=[% itemsloo.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% itemsloo.normalized_upc %]&amp;oclc=[% itemsloo.normalized_oclc %]" alt="" class="thumbnail" />
[% ELSE %]
<img src="http://www.syndetics.com/index.aspx?isbn=[% itemsloo.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% itemsloo.normalized_upc %]&amp;oclc=[% itemsloo.normalized_oclc %]" alt="" class="thumbnail" />[% END %][% END %][% END %]
[% IF ( GoogleJackets ) %][% IF ( itemsloo.normalized_isbn ) %]<div style="block" title="[% itemsloo.biblionumber |url %]" class="[% itemsloo.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
</a>
[% IF ( BakerTaylorEnabled ) %][% IF ( itemsloo.normalized_isbn ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% itemsloo.normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% itemsloo.normalized_isbn %]" /></a>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
</td>
</tr>
[% END %]<!-- /itemsloop -->
</tbody>
</table>
</div>
[% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
[% ELSE %]
<div class="dialog message">This List is empty. You can add to your lists from the results of any <a href="opac-main.pl">search</a>!</div>
[% END %]<!-- /itemsloop -->
[% END %]<!-- /viewshelf -->
[% IF ( manageshelf ) %]
<!-- Editing shelf -->
[% IF ( itemsloop ) %]
<input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
<input type="hidden" name="modifyshelfcontents" value="1" />
<input type="hidden" name="viewshelf" value="[% shelfnumber %]" /><input type="submit" value="Remove Selected Items" class="icon delete" onclick="return confirmDelete(MSG_REMOVE_FROM_LIST)" />
[% ELSE %]
<form method="post" action="opac-shelves.pl">
<input type="hidden" name="DEL-[% shelfnumber %]" value="1" />
<input type="hidden" name="shelves" value="1" />
<input type="hidden" name="shelfoff" value="[% shelfoff %]" />
<input type="submit" class="icon delete" value="Delete this List" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST)" />
[% END %]
[% END %]
</form>
[% IF ( edit ) %]
<h3><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a> <img src="[% themelang %]/../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelfnumber %]"><em>[% shelfname |html %]</em></a> <img src="[% themelang %]/../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> Editing</h3>
<form method="post" action="/cgi-bin/koha/opac-shelves.pl">
<input type="hidden" name="op" value="modifsave" />
[% IF ( showprivateshelves ) %]<input type="hidden" name="display" value="privateshelves" />[% END %]
<input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
<fieldset class="rows">
<ol>
<li><label for="shelfname">List Name: </label><input type="text" id="shelfname" name="shelfname" size="60" value="[% shelfname |html %]" /></li>
<li>
<label for="sortfield" >Sort this list by: </label>
<select name="sortfield" id="sortfield">
[% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
[% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
[% IF ( sort_year ) %]<option value="year" selected="selected">Year</option>[% ELSE %]<option value="year">Year</option>[% END %]
</select>
</li>
<li>
<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>
</li>
</ol>
</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 %]&amp;display=privateshelves">Cancel</a>[% ELSE %]<a class="cancel" href="/cgi-bin/koha/opac-shelves.pl?shelfnumber=[% shelfnumber %]">Cancel</a>[% END %]</fieldset>
</form>
[% END %]<!-- /edit -->
[% UNLESS ( edit ) %]
[% UNLESS ( viewshelf ) %]
[% UNLESS ( shelves ) %]
<h2>Lists</h2>
<ul class="link-tabs">
[% IF ( showprivateshelves ) %]
<li id="privateshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your private 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>
[% END %]
[% IF ( showpublicshelves ) %]
<li id="publicshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a></li>
[% ELSE %]
<li id="publicshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a></li>
[% END %]
</ul>
[% IF ( showprivateshelves ) %]
<div id="privateshelves" class="tab-container" style="display:block;">
[% ELSE %]
<div id="privateshelves" class="tab-container" style="display:none;">
[% END %]
[% IF ( loggedinusername ) %]
<div id="toolbar"><a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New List</a></div>
[% IF ( showprivateshelves ) %]
[% IF ( shelveslooppriv ) %]
<table>
<tr>
<th>List Name</th>
<th>Contents</th>
<th>Type</th>
<th>&nbsp;</th>
</tr>
[% FOREACH shelveslooppri IN shelveslooppriv %]
[% UNLESS ( loop.odd ) %]
<tr class="highlight">
[% ELSE %]
<tr>
[% END %]
<td><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves&amp;viewshelf=[% shelveslooppri.shelf %]&amp;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.viewcategory2 ) %]Public[% END %]
[% IF ( shelveslooppri.viewcategory3 ) %]Open[% END %]
</td>
<td>
[% IF ( shelveslooppri.mine ) %]
<form action="/cgi-bin/koha/opac-shelves.pl" method="get">
<input type="hidden" name="shelfnumber" value="[% shelveslooppri.shelf %]" />
<input type="hidden" name="display" value="privateshelves" />
<input type="hidden" name="op" value="modif" />
<input type="submit" class="editshelf" value="Edit" />
</form>
<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="DEL-[% shelveslooppri.shelf %]" value="1" />
<input type="hidden" name="shelfoff" value="[% shelfoff %]" />
[% IF ( shelveslooppri.confirm ) %]
<input type="hidden" name="CONFIRM-[% shelveslooppri.confirm %]" value="1" />
<input type="submit" class="confirm" value="Confirm" />
[% ELSE %]
<input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
[% END %]
</form>
[% END %]&nbsp;
</td>
</tr>
[% END %]
</table>
<div class="pages">[% pagination_bar %]</div>
[% ELSE %]
<p>No private lists.</p>
[% END %]<!-- /shelveslooppriv -->
[% END %]<!-- /showprivateshelves -->
[% ELSE %]<!-- /loggedinusername -->
<div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new Lists.</div>
[% END %]<!-- /loggedinusername -->
</div><!-- /privateshelves -->
[% IF ( showpublicshelves ) %]
<div id="publicshelves" class="tab-container" style="display:block;">
[% ELSE %]
<div id="publicshelves" class="tab-container" style="display:none;">
[% END %]
[% IF ( loggedinusername ) %]
<div id="toolbar"> <a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New List</a></div>
[% ELSE %]
<div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new Lists.</div>
[% END %]
[% IF ( shelvesloop ) %]
<table>
<tr>
<th>List Name</th>
<th>Contents</th>
<th>Type</th><th>&nbsp;</th>
</tr>
[% FOREACH shelvesloo IN shelvesloop %]
[% UNLESS ( loop.odd ) %]
<tr class="highlight">
[% ELSE %]
<tr>
[% END %]
<td><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelvesloo.shelf %]&amp;sortfield=[% shelvesloo.sortfield %]">[% shelvesloo.shelfname |html %]</a></td>
<td>[% shelvesloo.count %] [% IF ( shelvesloo.single ) %]item[% ELSE %]item(s)[% END %]</td>
<td>
[% IF ( shelvesloo.viewcategory1 ) %]Private[% END %]
[% IF ( shelvesloo.viewcategory2 ) %]Public[% END %]
[% IF ( shelvesloo.viewcategory3 ) %]Open[% END %]
</td>
<td>
[% IF ( shelvesloo.mine ) %]
<form action="/cgi-bin/koha/opac-shelves.pl" method="get">
<input type="hidden" name="shelfnumber" value="[% shelvesloo.shelf %]" />
<input type="hidden" name="op" value="modif" />
<input type="submit" class="editshelf" value="Edit" />
</form>
<form action="opac-shelves.pl" method="post">
<input type="hidden" name="shelves" value="1" />
<input type="hidden" name="DEL-[% shelvesloo.shelf %]" value="1" />
[% IF ( shelvesloo.confirm ) %]
<input type="hidden" name="CONFIRM-[% shelvesloo.confirm %]" value="1" />
<input type="submit" class="confirm" value="Confirm" />
[% ELSE %]
<input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
[% END %]
</form>
[% END %]&nbsp;
</td>
</tr>
[% END %]<!-- /shelvesloop -->
</table>
[% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
[% ELSE %]<!-- /shelvesloop -->
[% IF ( showpublicshelves ) %]<p>No public lists.</p>[% END %]
[% END %]<!-- /shelvesloop -->
</div><!-- /publicshelves -->
[% END %]<!-- /shelves -->
[% END %]<!-- /viewshelf -->
[% END %]<!-- /edit -->
[% IF ( shelves ) %]
<div id="addshelf">
<form method="post" action="/cgi-bin/koha/opac-shelves.pl">
<fieldset class="rows">
<legend>Create a New List</legend>
<input type="hidden" name="shelves" value="1" />
<ol>
<li>
<label class="required" for="addshelf">List Name:</label>
[% IF ( already ) %]
<input id="addshelf" type="text" name="addshelf" value="[% already %]" size="60" />
[% ELSE %]
<input id="addshelf" type="text" name="addshelf" size="60" />
[% END %]
<input type="hidden" name="owner" id="owner" value="[% loggedinuser %]" />
</li>
<li>
<label for="sortfield" >Sort this list by: </label>
<select name="sortfield" id="sortfield">
[% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
[% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
[% IF ( sort_year ) %]<option value="year" selected="selected">Year</option>[% ELSE %]<option value="year">Year</option>[% END %]
</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>
</ol>
</fieldset>
<fieldset class="action">
<input type="submit" onclick="Check(this.form); return false;" value="Save" class="submit" />
<a class="cancel" href="/cgi-bin/koha/opac-shelves.pl">Cancel</a>
</fieldset>
</form>
</div>
[% END %]<!-- /shelves -->
</div>
</div>
</div>
</div>
[% IF ( OpacNav||loggedinusername ) %]
<div class="yui-b">
<div id="leftmenus" class="container">
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div>
</div>
[% END %]
</div><!-- /bd -->
<!-- </div> -->
<!-- DEBUG -->
<div id="debug"></div>
[% INCLUDE 'opac-bottom.inc' %]