Koha/koha-tmpl/opac-tmpl/prog/en/modules/opac-addbybiblionumber.tt
Marcel de Rooy c4d21bcbfe Bug 7310: Code changes for Improving list permissions
This lays the foundation for further changes for report 7310.
Implements following points from the wiki page List permissions:
1) Preference that controls if users may create public lists in opac.
2) New add/delete own/delete other permissions per list.

Code has been changed (in some cases refactored). New permissions are not yet visible; with this patch current functionality is kept as much as possible while resolving several issues, improving permissions and extending the code for further developments (using the new permissions and sharing lists).

Feb 23, 2012 (revision): Changed defaults for new lists. Could also remove routine GetRecentShelves by using GetSomeShelfNames in catalogue/search.pl just as opac-search.pl already did. (More consistent.)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Feb 29, 2012: Automerge version.
March 5, 2012: Rebase for pushed 4912 patch.
March 21, 2012: Rebased. Resolving some conflicts in relation to pushed report 7719.
2012-03-21 16:46:40 +01:00

89 lines
3.9 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog &rsaquo; Add to Your List
[% INCLUDE 'doc-head-close.inc' %]
<style type="text/css">
#custom-doc { width:34.62em;*width:33.78em;min-width:450px; margin:auto; margin-top: .4em;text-align:left; }
</style>
</head>
<body id="addtolist">
<div id="custom-doc" class="yui-t7">
<div id="useraddbybiblionumber" class="container">
[% IF ( authorized ) %]
[% UNLESS ( newshelf ) %]
[% IF ( multiple ) %]
<h1>Add [% total %] items to [% IF ( singleshelf ) %]<em>[% shelfname %]</em>: [% ELSE %]a list:[% END %]</h1>
[% ELSE %]
<h1>Add to [% IF ( singleshelf ) %]<em>[% shelfname %]</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 ( existingshelves ) %]
<form name="f1" action="/cgi-bin/koha/opac-addbybiblionumber.pl" method="post">
<fieldset class="rows"><legend>Select a List</legend>
<ol><li> <label for="shelfnumber">Add to list:</label> <select name="shelfnumber" id="shelfnumber">
[% IF ( privatevirtualshelves ) %]<optgroup label="Private Lists">
[% FOREACH privatevirtualshelve IN privatevirtualshelves %]
<option value="[% privatevirtualshelve.shelfnumber %]">[% privatevirtualshelve.shelfname %]</option>
[% END %]
</optgroup>[% END %]
[% IF ( publicvirtualshelves ) %]<optgroup label="Public Lists">
[% FOREACH publicvirtualshelve IN publicvirtualshelves %]
<option value="[% publicvirtualshelve.shelfnumber %]">[% publicvirtualshelve.shelfname %]</option>
[% END %]
</optgroup>[% END %]
</select></li></ol>
[% 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="submit" /> <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="submit" /> <a class="close cancel" href="#">Cancel</a></fieldset>
</form>
[% END %]
[% END %]
[% END %]
[% UNLESS ( singleshelf ) %]<form name="f2" method="post" action="/cgi-bin/koha/opac-addbybiblionumber.pl">
<fieldset class="rows"> <legend>Add to a New List:</legend>
<ol><li>
<label for="newvirtualshelf">
List Name:
</label>
<input type="text" name="newvirtualshelf" id="newvirtualshelf" size="40" />
</li>
<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></ol></fieldset>
[% FOREACH biblio IN biblios %] <input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html%]" />[% END %]
<fieldset class="action"><input type="submit" value="Save" class="submit" /> <a class="close cancel" href="#">Cancel</a></fieldset>
</form>
[% END %]
[% ELSE %]
<p align="center">
[% 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 %]
<p align="center">
<a href="#" class="close">Close this window.</a>
</p>
</div></div>
</body>
</html>