Koha/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/addbybiblionumber.tt
Fridolin Somers 255af719e6 Bug 22303: Correct bottom in virtualshelves/addbybiblionumber.tt
In virtualshelves/addbybiblionumber.tt the include intranet-bottom.inc which closes the HTML last tag is not the last line of the template.

This patch moved bottom include to last line and uses popup-bottom.inc.

Test plan :
1) Permission OK :
1.1) Login in staff interface with user 'Bob'
1.2) Create a new list 'Readme' : category public and allow changes to contents from anyone
1.3) Perform a search
1.4) Check some results
1.5) Click 'Add to list' and on the list 'Readme'
1.6) A popup window opens
1.7) Check its HTML is OK, ending with </html>
2) Permission KO :
2.1) Open a new window (Firefox private session) and login in staff interface with user 'Bill'
2.2) Perform a search
2.3) Check some results
2.4) On session of 'Bob', edit list 'Readme'
2.5) Change : category private and allow changes to contents from owner only
2.6) On session of 'Bill'
2.7) Click 'Add to list' and on the list 'Readme'
2.8) A popup window opens saying 'Sorry, you do not have permission to add items to this list'
2.9) Check its HTML is OK, ending with </html>

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 20:54:42 +00:00

119 lines
4.9 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Add to list</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="lists_addbybiblionumber" class="lists">
<div class="container-fluid">
[% UNLESS (authorized) %]
<p align="center">
[% IF (errcode==1) %]Could not create a new list. Please check the name.<br/>[% END %]
[% IF (errcode==2) %]Sorry, you do not have permission to add items to this list.<br/>[% END %]
<a href="javascript:self.close();">Close this window.</a>
</p>
[% ELSE %]
[% IF ( multiple ) %]
<h1>Add [% total | html %] 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 | html %] </span>[% END %]
</li>
[% END %]
</ul>
<form name="f1" action="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl" method="post">
[% FOREACH biblio IN biblios %] <input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html %]" />[% END %]
<input type="hidden" name="confirmed" value="1" />
[% IF ( shelfnumber ) %]<input type="hidden" name="shelfnumber" value="[% shelfnumber | html %]" />[% END %]
[% UNLESS ( shelfnumber ) %]
[% UNLESS ( newshelf ) %]
[% IF private_shelves.count OR public_shelves.count OR private_shelves_shared_with_me.count %]
<fieldset class="rows">
<legend>Select an existing list</legend>
<ol>
<li>
<label>Choose 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 | html %]">[% 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 | html %]">[% 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 | html %]">[% public_shelf.shelfname | html %]</option>
[% END %]
</optgroup>
[% END %]
</select>
</li>
</ol>
[% FOREACH biblio IN biblios %]<input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html %]" />[% END %]
[% UNLESS ( biblionumbers ) %]
<input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
[% ELSE %]
<input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]" />
[% END %]
</fieldset>
<p>... or...</p>
[% END %]
[% END %]
<fieldset class="rows"><legend>Add to a new list:</legend>
<ol><li>
<label for="newvirtualshelf">
List name:
</label>
[% FOREACH biblio IN biblios %]<input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html %]" />[% END %]
[% UNLESS ( biblionumbers ) %]
<input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber | html %]" />
[% ELSE %]
<input type="hidden" name="biblionumbers" id="biblionumbers" value="[% biblionumbers | html %]" />
[% END %]
<input type="text" name="newvirtualshelf" id="newvirtualshelf" size="40" />
<input type="hidden" name="confirmed" value="1" />
</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>
[% END %]
<!-- SAVE -->
<fieldset class="action">
<input type="hidden" name="sortfield" value="title" />
<input type="submit" value="Save" class="submit" /> <a class="close cancel" href="#">Cancel</a>
</fieldset>
</form>
<!-- /SAVE -->
[% END %]
[% SET popup_window = 1 %]
[% INCLUDE 'intranet-bottom.inc' %]