@ -1,8 +1,6 @@
[% USE raw %]
[% USE Asset %]
[% USE Koha %]
[% SET PRIVATE = 1 %]
[% SET PUBLIC = 2 %]
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsShowOnList') ) %]
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsInputOnList') ) %]
@ -10,7 +8,7 @@
<form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="deleteshelf[% shelf.shelfnumber | html %]" class="d-inline">
<input type="hidden" name="op" value="delete" />
<input type="hidden" name="referer" value="list" />
<input type='hidden' name='category ' value='[% category | html %]' />
<input type='hidden' name='publi c' value='[% publi c | html %]' />
<input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
<button type="submit" class="btn btn-link remove deleteshelf" data-shelfnumber="[% shelf.shelfnumber | html %]" data-shelfname="[% shelf.shelfname | html %]" data-shared="[% shelf.is_shared | html %]" data-count="[% contents.count | html %]">
<i class="fa fa-remove" aria-hidden="true"></i>
@ -80,7 +78,7 @@
[% IF shelf and shelf.is_private %]
[% IF op == 'view' OR op == 'edit_form' %]
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-shelves.pl?op=list&category=[% PRIVATE | uri %] ">Your lists</a>
<a href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0 ">Your lists</a>
</li>
[% ELSE %]
<li class="breadcrumb-item active">
@ -90,7 +88,7 @@
[% ELSIF shelf AND shelf.is_public %]
[% IF op == 'view' %]
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-shelves.pl?op=list&category=[% PUBLIC | uri %] ">Public lists</a>
<a href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1 ">Public lists</a>
</li>
[% ELSE %]
<li class="breadcrumb-item active">
@ -231,21 +229,21 @@
<form method="get" action="/cgi-bin/koha/opac-shelves.pl" class="d-inline">
<input type="hidden" name="op" value="edit_form" />
<input type="hidden" name="referer" value="view" />
<input type='hidden' name='category ' value='[% shelf.category | html %]' />
<input type='hidden' name='publi c' value='[% shelf.publi c | html %]' />
<input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
<button type="submit" class="btn btn-link editshelf"><i class="fa fa-fw fa-pencil-square-o" aria-hidden="true"></i> Edit list</button>
</form>
[% PROCESS delete_shelf context = "details" %]
[% IF category == PRIVATE && Koha.Preference('OpacAllowSharingPrivateLists') %]
[% IF !publi c && Koha.Preference('OpacAllowSharingPrivateLists') %]
<a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% shelf.shelfnumber | uri %]" class="btn btn-link sharelist"><i class="fa fa-fw fa-share" aria-hidden="true"></i> Share list</a>
[% END %]
[% ELSIF category == PRIVATE # not manageshelf and private means shared %]
[% ELSIF !publi c # not manageshelf and private means shared %]
<form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="unshare[% shelf.shelfnumber | html %]" class="d-inline">
<input type="hidden" name="op" value="remove_share" />
<input type="hidden" name="referer" value="list" />
<input type='hidden' name='category ' value='[% category | html %]' />
<input type='hidden' name='publi c' value='[% publi c | html %]' />
<input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
<button type="submit" class="btn btn-link remove remove_share" data-shelfname="[% shelf.shelfname | html %]" data-shelfnumber="[% shelf.shelfnumber | html %]">
<i class="fa fa-remove" aria-hidden="true"></i> Remove share
@ -522,7 +520,7 @@
<form method="get" action="/cgi-bin/koha/opac-shelves.pl" class="d-inline">
<input type="hidden" name="op" value="edit_form" />
<input type="hidden" name="referer" value="view" />
<input type="hidden" name="category " value="[% shelf.category | html %]" />
<input type="hidden" name="publi c" value="[% shelf.publi c | html %]" />
<input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
<button type="submit" class="btn btn-link editshelf"><i class="fa fa-fw fa-pencil-square-o" aria-hidden="true"></i> Edit list</button>
</form>
@ -600,19 +598,19 @@
[% END %]
</select>
</li>
[% IF Koha.Preference('OpacAllowPublicListCreation') OR category == PUBLIC %]
[% IF Koha.Preference('OpacAllowPublicListCreation') OR public == 1 %]
<li>
<label for="category ">Category:</label>
<select name="category " id="category " onchange="AdjustRemark()">
<label for="publi c">Category:</label>
<select name="publi c" id="publi c" onchange="AdjustRemark()">
[% IF shelf.is_private %]
<option value="1 " selected="selected">Private</option>
<option value="0 " selected="selected">Private</option>
[% ELSE %]
<option value="1 ">Private</option>
<option value="0 ">Private</option>
[% END %]
[% IF shelf.is_public %]
<option value="2 " selected="selected">Public</option>
<option value="1 " selected="selected">Public</option>
[% ELSE %]
<option value="2 ">Public</option>
<option value="1 ">Public</option>
[% END %]
</select>
[% IF shelf.is_public AND NOT Koha.Preference('OpacAllowPublicListCreation') %]
@ -622,8 +620,8 @@
[% END %]
[% INCLUDE list_permissions %]
</ol>
[% UNLESS Koha.Preference('OpacAllowPublicListCreation') OR category == PUBLIC %]
<input type="hidden" name="category" value="[% PRIVATE | html %] " />
[% UNLESS Koha.Preference('OpacAllowPublicListCreation') OR public == 1 %]
<input type="hidden" name="public" value="0 " />
[% END %]
</fieldset> <!-- /.rows -->
@ -632,7 +630,7 @@
[% IF referer == 'view' %]
<a href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]" class="cancel">Cancel</a>
[% ELSE %]
<a href="/cgi-bin/koha/opac-shelves.pl?op=list&category=[% PRIVATE | uri %] " class="cancel">Cancel</a>
<a href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0 " class="cancel">Cancel</a>
[% END %]
</fieldset>
</form>
@ -642,26 +640,26 @@
<div class="toptabs ui-tabs ui-widget ui-widget-content ui-corner-all">
<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
[% IF category == PRIVATE %]
<li id="privateshelves_tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&category=[% PRIVATE | html %] ">Your lists</a></li>
[% IF !publi c %]
<li id="privateshelves_tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0 ">Your lists</a></li>
[% ELSE %]
<li id="privateshelves_tab" class="ui-state-default ui-corner-top"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&category=[% PRIVATE | html %] ">Your lists</a></li>
<li id="privateshelves_tab" class="ui-state-default ui-corner-top"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0 ">Your lists</a></li>
[% END %]
[% END %]
[% IF category == PUBLIC %]
<li id="publicshelves_tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&category=[% PUBLIC | html %] ">Public lists</a></li>
[% IF publi c %]
<li id="publicshelves_tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1 ">Public lists</a></li>
[% ELSE %]
<li id="publicshelves_tab" class="ui-state-default ui-corner-top"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&category=[% PUBLIC | html %] ">Public lists</a></li>
<li id="publicshelves_tab" class="ui-state-default ui-corner-top"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1 ">Public lists</a></li>
[% END %]
</ul>
[% IF category == PRIVATE %]
[% IF !publi c %]
<div id="privateshelves" class="ui-tabs-panel ui-widget-content ui-corner-bottom" style="display:block;">
[% ELSE %]
<div id="publicshelves" class="ui-tabs-panel ui-widget-content ui-corner-bottom" style="display:block;">
[% END %]
[% IF category == PRIVATE || Koha.Preference('OpacAllowPublicListCreation') %]
[% IF !publi c || Koha.Preference('OpacAllowPublicListCreation') %]
[% IF loggedinusername %]
<div id="toolbar" class="toolbar"><a class="btn btn-link newshelf" href="/cgi-bin/koha/opac-shelves.pl?op=add_form"><i class="fa fa-plus" aria-hidden="true"></i> New list</a></div>
[% ELSE %]
@ -673,9 +671,9 @@
[% IF shelves.count %]
<table class="table">
[% IF category == PRIVATE %]
[% IF !publi c %]
<caption class="sr-only">Your lists</caption>
[% ELSIF category == PUBLIC %]
[% ELSIF publi c %]
<caption class="sr-only">Public lists</caption>
[% END %]
<thead>
@ -703,7 +701,7 @@
[% IF s.can_be_managed( loggedinusernumber ) %]
<form action="/cgi-bin/koha/opac-shelves.pl" method="get" class="d-inline">
<input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" />
<input type="hidden" name="category " value="[% s.category | html %]" />
<input type="hidden" name="publi c" value="[% s.publi c | html %]" />
<input type="hidden" name="op" value="edit_form" />
<input type="hidden" name="referer" value="list" />
<button type="submit" class="btn btn-link editshelf"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> Edit</button>
@ -719,7 +717,7 @@
<form action="opac-shelves.pl" method="post" id="unshare[% s.shelfnumber | html %]" class="d-inline">
<input type="hidden" name="op" value="remove_share" />
<input type="hidden" name="referer" value="list" />
<input type='hidden' name='category ' value='[% category | html %]' />
<input type='hidden' name='publi c' value='[% publi c | html %]' />
<input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" />
<button type="submit" class="btn btn-link remove remove_share"
data-shelfname="[% s.shelfname | html %]" data-shelfnumber="[% s.shelfnumber | html %]"><i class="fa fa-remove" aria-hidden="true"></i> Remove share</button>
@ -732,7 +730,7 @@
</table> <!-- /.table -->
<div class="pages">[% pagination_bar | $raw %]</div>
[% ELSE %]
[% IF category == PUBLIC %]
[% IF publi c %]
<p>No public lists.</p>
[% ELSIF loggedinusernumber %]
<p>No private lists.</p>
@ -1031,17 +1029,17 @@ function sortMenu( sorting_form ){
}
function AdjustRemark() {
var category ;
if( $("#category ").length > 0 ) {
category = $("#category ").val();
var publi c;
if( $("#publi c").length > 0 ) {
publi c = $("#publi c").val();
} else {
category = "[% category | html %]";
publi c = "[% publi c | html %]";
}
var perms = $("#allow_changes_from").val();
if( perms < 2 ) {
$("#anyone_remark").hide();
} else if( category==1 ) {
} else if( public==0 ) {
// If we move to Private (without shares), show Anyone remark
// Note: the number of shares is not tested real-time
[% IF !shelf.is_shared %]