Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-review.tt
Marcel de Rooy 177542bf52 Bug 15839: [QA Follow-up] Error checking in opac-review.pl
[1] Adds a check on biblionumber. (Prevents a DBIx error.)
[2] If you have a reviewid, search on that and check results.
    Add an unauthorized error in template.
[3] If you add a new review, check that there is no review yet.
    If so, edit the existing one.
    This supports the added FIXME on a unique constraint.

Note: This script could receive further attention.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested all crud ops with opac-review.pl (incl URL manipulation).

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-09 10:31:06 +00:00

77 lines
4.1 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Comments on [% title |html %]</title>
<style type="text/css">
#custom-doc { width:37.08em;*width:36.16em;min-width:485px; margin:1em auto; text-align:left; }
</style>
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %][% END %]
</head>
[% INCLUDE 'bodytag.inc' bodyid='comment' bodyclass='popup' %]
<div class="main">
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="userreview">
[% IF ( cgi_debug ) %]
<div class="debug">CGI debug is on.</div>
[% END %]
[% IF ( ERRORS ) %]
<div class="alert">
[% FOREACH ERROR IN ERRORS %]
[% IF ( ERROR.nobiblio ) %]
<p>Error: we cannot find this bibliographic record.</p>
[% END %]
[% IF ( ERROR.unauthorized ) %]
<p>Sorry, only the creator of this comment is allowed to change it.</p>
[% END %]
[% IF ( ERROR.scrubbed ) %]
<p>Note: your comment contained illegal markup code. It has been saved with the markup removed, as below. You can edit the comment further, or cancel to retain the comment as is.</p>
[% END %]
[% IF ( ERROR.scrubbed_all ) %]
<p>Error! Your comment was entirely illegal markup code. It has NOT been added.</p>
[% END %]
[% IF ( ERROR.empty ) %]
<p>Error! You cannot add an empty comment. Please add content or cancel.</p>
[% END %]
[% END # / FOREACH ERROR %]
[% IF ( WINDOW_CLOSE ) %]
Note: this window will close automatically in 5 seconds.
[% END %]
</div>
[% END # / ERRORs %]
<h1>Comments on <i>[% title |html %] [% subtitle %]</i></h1>
[% IF ( author ) %]<h3>[% author |html %]</h3>[% END %]
<form id="reviewf" action="/cgi-bin/koha/opac-review.pl[% IF ( cgi_debug ) %]?debug=1[% END %]" method="post">
<input type="hidden" name="biblionumber" value="[% biblionumber | html%]" />
[% IF ( reviewid ) %]<input type="hidden" name="reviewid" value="[% reviewid | html%]" />[% END %]
<fieldset>
<textarea id="review" name="review" cols="60" rows="8">[% review %]</textarea>
</fieldset>
<p>Note: Your comment must be approved by a librarian. </p>
<fieldset class="action">
<input type="submit" class="btn" value="Submit and close this window" />
<a class="cancel close" href="#">Cancel</a>
</fieldset>
</form>
</div> <!-- / #usersendshelfform -->
</div> <!-- / .span12 -->
</div> <!-- / .row-fluid -->
</div> <!-- / .container-fluid -->
</div> <!-- / .main -->
[% INCLUDE 'opac-bottom.inc' is_popup=1 %]
[% BLOCK jsinclude %]
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
[% IF WINDOW_CLOSE %]
opener.location.reload();
window.close();
[% END %]
});
//]]>
</script>
[% END %]