Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-addbybiblionumber.tt
Caitlin Goodger c089df3f3b Bug 17886: Don't show option to add to existing list if there are no lists
This patch modifies the page for adding a title to a list so that the
"Add to existing list" option doesn't appear if there are no lists
defined.

TEST PLAN
---------
1) Make sure no lists exist at all.
2) Make there is at least one findable biblio record entered
3) Find that biblio record in the OPAC
4) Click 'Save to your lists'
   -- Notice that the whole save to list section is there.
5) Apply this patch
6) Click 'Cancel'
7) Click 'Save to your lists'
   -- Notice you can only add now, which makes sense.
8) Run koha qa test tools.

Perform the same tests in the staff client.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and the patch works.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-06-29 20:28:38 +00:00

116 lines
8 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Add to your list</title>
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %][% END %]
</head>
[% INCLUDE 'bodytag.inc' bodyid='addtolist' bodyclass='popup' %]
<div class="main">
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="useraddbybiblionumber">
[% IF ( authorized ) %]
[% UNLESS ( newshelf ) %]
[% IF ( multiple ) %]
<h1>Add [% total %] items to [% IF ( singleshelf ) %]<em>[% shelfname | html %]</em>: [% ELSE %]a list:[% END %]</h1>
[% ELSE %]
<h1>Add to [% IF ( singleshelf ) %]<em>[% shelfname | html %]</em>[% ELSE %]a list:[% END %]</h1>
[% END %]
<ul>
[% FOREACH biblio IN biblios %]
<li> <span class="title">[% biblio.title |html %]</span>
[% IF ( biblio.author ) %]<span class="author"> [% biblio.author %] </span>[% END %]
</li>
[% END %]
</ul>
[% IF private_shelves.count or public_shelves.count or private_shelves_shared_with_me.count %]
<form name="f1" action="/cgi-bin/koha/opac-addbybiblionumber.pl" method="post">
<fieldset>
<legend>Select a list</legend>
<label for="shelfnumber">Add to list:</label> <select name="shelfnumber" id="shelfnumber">
[% IF private_shelves.count %]<optgroup label="Private lists">
[% FOREACH private_shelf IN private_shelves %]
<option value="[% private_shelf.shelfnumber %]">[% private_shelf.shelfname | html%]</option>
[% END %]
</optgroup>[% END %]
[% IF private_shelves_shared_with_me.count %]<optgroup label="Private lists shared with me">
[% FOREACH private_shelf IN private_shelves_shared_with_me %]
<option value="[% private_shelf.shelfnumber %]">[% private_shelf.shelfname | html%]</option>
[% END %]
</optgroup>[% END %]
[% IF public_shelves.count %]<optgroup label="Public lists">
[% FOREACH public_shelf IN public_shelves %]
<option value="[% public_shelf.shelfnumber %]">[% public_shelf.shelfname |html%]</option>
[% END %]
</optgroup>[% END %]
</select>
[% FOREACH biblio IN biblios %]
<input type="hidden" name="biblionumber" value="[% biblio.biblionumber %]" />
[% END %]
<input type="hidden" name="modifyshelfcontents" value="1" />
</fieldset>
<fieldset class="action">
<input type="submit" value="Save" class="btn" />
<a class="close cancel" href="#">Cancel</a>
</fieldset>
</form>
<p>...or...</p>
[% ELSE %]
[% IF ( singleshelf ) %]
<form name="f1" action="/cgi-bin/koha/opac-addbybiblionumber.pl" method="post">
[% FOREACH biblio IN biblios %]
<input type="hidden" name="biblionumber" value="[% biblio.biblionumber %]">
[% END %]
<input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
<input type="hidden" name="modifyshelfcontents" value="1" /></fieldset>
<fieldset class="action">
<input type="submit" value="Save" class="btn" />
<a class="close cancel" href="#">Cancel</a>
</fieldset>
</form>
[% END %]
[% END # IF / existingshelves %]
[% END # / UNLESS newshelf %]
[% UNLESS ( singleshelf ) %]
<form name="f2" method="post" action="/cgi-bin/koha/opac-addbybiblionumber.pl">
<fieldset>
<legend>Add to a new list:</legend>
<label for="newvirtualshelf">List name:</label>
<input type="text" name="newvirtualshelf" id="newvirtualshelf" size="40" />
<label for="category">Category:</label>
<select name="category" id="category">
<option value="1">Private</option>
[% IF (OpacAllowPublicListCreation) %]
<option value="2">Public</option>
[% END %]
</select>
</fieldset>
[% FOREACH biblio IN biblios %]
<input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html%]" />
[% END %]
<fieldset class="action">
<input type="hidden" name="sortfield" value="title" />
<input type="submit" value="Save" class="btn" />
<a class="close cancel" href="#">Cancel</a>
</fieldset>
</form>
[% END # / UNLESS singleshelf %]
[% ELSE %]
<p>
[% IF (errcode==1) %]
Could not create new list. Please check if the name is unique.
[% ELSE %]
Sorry, you cannot add items to this list.
[% END %]
</p>
[% END # IF authorized %]
<p><a href="#" class="close">Close this window.</a></p>
</div> <!-- / #useraddbybiblionumber -->
</div> <!-- / .span12 -->
</div> <!-- / .row-fluid -->
</div> <!-- / .container-fluid -->
</div> <!-- / .main -->
[% INCLUDE 'opac-bottom.inc' is_popup=1 %]
[% BLOCK jsinclude %][% END %]