Koha/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt
Andrew Isherwood 4b97a67ae4 Bug 21460: (follow-up) Fix bugs found in QA
Fix silly bugs mentioned in comment #29

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-25 10:46:56 +00:00

543 lines
32 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[% USE raw %]
[% USE Asset %]
[% USE Branches %]
[% USE Koha %]
[% USE KohaDates %]
[% SET footerjs = 1 %]
[% USE AuthorisedValues %]
[% USE ColumnsSettings %]
[% USE Price %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; ILL requests</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="illrequests" class="ill">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs">
<a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
<a href="/cgi-bin/koha/ill/ill-requests.pl">ILL requests</a>
[% IF query_type == 'create' %]
&rsaquo; New request
[% ELSIF query_type == 'status' %]
&rsaquo; Status
[% END %]
</div>
<div id="doc3" class="yui-t2">
<div id="bd">
[% IF query_type == 'illlist' %]
<div id="illfilter_yui_column" class="yui-b">
<form method="get" id="illfilter_form">
<fieldset class="brief">
<h3>Filters</h3>
<ol>
<li>
<label for="illfilter_status">Status:</label>
<select name="illfilter_status" id="illfilter_status">
<option value=""></option>
</select>
</li>
<li>
<label for="illfilter_dateplaced_start">Date placed between:</label>
<input type="text" name="illfilter_dateplaced_start" id="illfilter_dateplaced_start" class="datepicker" />
</li>
<li>
<label for="illfilter_dateplaced_end">and:</label>
<input type="text" name="illfilter_dateplaced_end" id="illfilter_dateplaced_end" class="datepicker" />
</li>
<li>
<label for="illfilter_datemodified_start">Updated between:</label>
<input type="text" name="illfilter_datemodified_start" id="illfilter_datemodified_start" class="datepicker" />
</li>
<li>
<label for="illfilter_datemodified_end">and:</label>
<input type="text" name="illfilter_datemodified_end" id="illfilter_datemodified_end" class="datepicker" />
</li>
<li>
<label for="illfilter_branchname">Library:</label>
<select name="illfilter_branchname" id="illfilter_branchname">
<option value=""></option>
</select>
</li>
<li>
<label for="illfilter_patron">Patron:</label>
<input type="text" name="illfilter_patron" id="illfilter_patron" />
</li>
</ol>
<fieldset class="action">
<input type="submit" value="Search" />
<input type="button" value="Clear" id="clear_search" />
</fieldset>
</fieldset>
</form>
</div>
[% END %]
<div id="yui-main">
<div id="interlibraryloans" class="yui-b">
[% IF !backends_available || !has_branch %]
<div class="dialog message">ILL module configuration problem. Take a look at the <a href="/cgi-bin/koha/about.pl#sysinfo">about page</a></div>
[% ELSE %]
[% INCLUDE 'ill-toolbar.inc' %]
[% IF whole.error %]
<h1>Error performing operation</h1>
<!-- Dispatch on Status -->
<p>We encountered an error:</p>
<p>
<pre>[% whole.message | html %] ([% whole.status | html %])</pre>
</p>
[% END %]
[% IF query_type == 'create' %]
<h1>New ILL request</h1>
[% PROCESS $whole.template %]
[% ELSIF query_type == 'confirm' %]
<h1>Confirm ILL request</h1>
[% PROCESS $whole.template %]
[% ELSIF query_type == 'cancel' and !whole.error %]
<h1>Cancel a confirmed request</h1>
[% PROCESS $whole.template %]
[% ELSIF query_type == 'generic_confirm' %]
<h1>Place request with partner libraries</h1>
[% IF error %]
[% IF error == 'no_target_email' %]
<div class="alert">
No target email addresses found. Either select at least
one partner or check your ILL partner library records.
</div>
[% ELSIF error == 'no_library_email' %]
<div class="alert">
Your library has no usable email address. Please set it.
</div>
[% ELSIF error == 'unkown_error' %]
<div class="alert">
Unknown error processing your request. Contact your administrator.
</div>
[% END %]
[% END %]
<!-- Start of GENERIC_EMAIL case -->
[% IF whole.value.partners %]
[% ill_url = "/cgi-bin/koha/ill/ill-requests.pl?method=illview&illrequest_id=" _ request.illrequest_id %]
<form method="POST" action="/cgi-bin/koha/ill/ill-requests.pl">
<fieldset class="rows">
<legend>Interlibrary loan request details</legend>
<ol>
<li>
<label for="partner_filter">Filter partner libraries:</label>
<input type="text" id="partner_filter" />
</li>
<li>
<label for="partners" class="required">Select partner libraries:</label>
<select size="5" multiple="true" id="partners" name="partners" required="required">
[% FOREACH partner IN whole.value.partners %]
<option value=[% partner.email | html %]>
[% partner.branchcode _ " - " _ partner.surname %]
</option>
[% END %]
</select>
</li>
<li>
<label for="subject" class="required">Subject line:</label>
<input type="text" name="subject" id="subject" type="text" value="[% whole.value.draft.subject | html %]" required="required" />
</li>
<li>
<label for="body" class="required">Email text:</label>
<textarea name="body" id="body" rows="20" cols="80" required="required">[% whole.value.draft.body | html %]</textarea>
</li>
</ol>
<input type="hidden" value="generic_confirm" name="method">
<input type="hidden" value="draft" name="stage">
<input type="hidden" value="[% request.illrequest_id | html %]" name="illrequest_id">
</fieldset>
<fieldset class="action">
<input type="submit" class="btn btn-default" value="Send email"/>
<span><a href="[% ill_url | url %]" title="Return to request details">Cancel</a></span>
</fieldset>
</form>
[% ELSE %]
<fieldset class="rows">
<legend>Interlibrary loan request details</legend>
<p>No partners have been defined yet. Please create appropriate patron records (by default ILLLIBS category).</p>
<p>Be sure to provide email addresses for these patrons.</p>
<p><span><a href="[% ill_url | url %]" title="Return to request details">Cancel</a></span></p>
</fieldset>
[% END %]
<!-- generic_confirm ends here -->
[% ELSIF query_type == 'edit_action' %]
<form method="POST" action="/cgi-bin/koha/ill/ill-requests.pl">
<fieldset class="rows">
<legend>Request details</legend>
<ol>
[% type = request.get_type %]
<li class="borrowernumber">
<label for="borrowernumber">Patron ID:</label>
[% request.borrowernumber | html %]
</li>
<li class="biblio_id">
<label for="biblio_id" class="biblio_id">Bibliographic record ID:</label>
<input name="biblio_id" id="biblio_id" type="text" value="[% request.biblio_id | html %]">
</li>
<li class="branchcode">
<label for="library" class="branchcode">Library:</label>
<select name="branchcode" id="library">
[% PROCESS options_for_libraries libraries => Branches.all( selected => request.branchcode ) %]
</select>
</li>
<li class="status">
<label class="status">Status:</label>
[% stat = request.status %]
[% current_alias = request.status_alias %]
<select id="status_alias" name="status_alias">
[% IF !current_alias %]
<option value="" selected>
[% ELSE %]
<option value="">
[% END %]
[% request.capabilities.$stat.name | html %]
</option>
[% FOREACH alias IN AuthorisedValues.Get('ILLSTATUS') %]
[% IF alias.authorised_value == current_alias %]
<option value="[% alias.authorised_value | html %]" selected>
[% ELSE %]
<option value="[% alias.authorised_value | html %]">
[% END %]
[% alias.lib | html %]
</option>
[% END %]
</select>
</li>
<li class="updated">
<label class="updated">Last updated:</label>
[% request.updated | $KohaDates with_hours => 1 %]
</li>
<li class="medium">
<label class="medium">Request type:</label>
[% IF type %][% type | html %][% ELSE %]<span>N/A</span>[% END %]
</li>
<li class="cost">
<label class="cost">Cost:</label>
[% IF request.cost %][% request.cost | $Price %][% ELSE %]<span>N/A</span>[% END %]
</li>
<li class="price_paid">
<label class="price_paid">Price paid:</label>
<input name="price_paid" id="price_paid" type="text" value="[% request.price_paid | html %]">
</li>
<li class="req_id">
<label class="req_id">Request number:</label>
[% request.id_prefix _ request.illrequest_id | html %]
</li>
<li class="notesstaff">
<label for="notesstaff" class="notesstaff">Staff notes:</label>
<textarea name="notesstaff" id="notesstaff" rows="5">[% request.notesstaff | html %]</textarea>
</li>
<li class="notesopac">
<label for="notesopac" class="notesopac">Opac notes:</label>
<textarea name="notesopac" id="notesopac" rows="5">[% request.notesopac | html %]</textarea>
</li>
</ol>
</fieldset>
<fieldset class="action">
<input type="hidden" value="edit_action" name="method">
<input type="hidden" value="form" name="stage">
<input type="hidden" value="[% request.illrequest_id | html %]" name="illrequest_id">
<input type="hidden" value="[% request.borrowernumber | html %]" name="borrowernumber">
<input type="submit" value="Submit">
<a class="cancel" href="/cgi-bin/koha/ill/ill-requests.pl?method=illview&amp;illrequest_id=[% request.id | html %]">Cancel</a>
</fieldset>
</form>
[% ELSIF query_type == 'delete_confirm' %]
<div class="dialog alert">
<h3>Are you sure you wish to delete this request?</h3>
<form action="/cgi-bin/koha/ill/ill-requests.pl" method="post">
<input type="hidden" name="method" value="delete" />
<input type="hidden" name="confirmed" value="1" />
<input type="hidden" name="illrequest_id" value="[% request.id | html %]" />
<button type="submit" class="btn btn-default approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
</form>
<a class="btn btn-default deny" href="/cgi-bin/koha/ill/ill-requests.pl?method=illview&amp;illrequest_id=[% request.id | html %]"><i class="fa fa-fw fa-remove"></i>No, do not delete</a>
</div>
[% ELSIF query_type == 'illview' %]
[% req_status = request.status %]
[% IF error %]
[% IF error == 'migrate_target' %]
<div class="alert">
The backend you tried to migrate to does not yet support migrations, please try again with an alternative target.
</div>
[% END %]
[% END %]
<h1>Manage ILL request</h1>
<div id="request-toolbar" class="btn-toolbar">
<a title="Edit request" id="ill-toolbar-btn-edit-action" class="btn btn-default" href="/cgi-bin/koha/ill/ill-requests.pl?method=edit_action&amp;illrequest_id=[% request.illrequest_id | html %]">
<span class="fa fa-pencil"></span>
Edit request
</a>
[% FOREACH action IN request.available_actions %]
[% IF action.method == 'migrate' %]
[% IF backends.size > 2 %]
<div class="dropdown btn-group">
<button class="btn btn-default dropdown-toggle" type="button" id="ill-migrate-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa [% action.ui_method_icon | html %]"></i> [% action.ui_method_name | html %] <span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="ill-migrate-dropdown">
[% FOREACH backend IN backends %]
[% IF backend != request.backend %]
<li><a href="/cgi-bin/koha/ill/ill-requests.pl?method=[% action.method | uri %]&amp;illrequest_id=[% request.illrequest_id | uri %]&amp;backend=[% backend | uri %]">[% backend | html %]</a></li>
[% END %]
[% END %]
</ul>
</div>
[% ELSIF backends.size == 2 %]
[% FOREACH backend IN backends %]
[% IF backend != request.backend %]
<a title="[% action.ui_method_name | html %]" id="ill-toolbar-btn-[% action.id | lower | html %]" class="btn btn-default" href="/cgi-bin/koha/ill/ill-requests.pl?method=[% action.method | uri %]&amp;illrequest_id=[% request.illrequest_id | uri %]&amp;backend=[% backend | uri %]">
<span class="fa [% action.ui_method_icon | html %]"></span>
[% action.ui_method_name | html %]
</a>
[% END %]
[% END %]
[% END %]
[% ELSIF action.method != 0 %]
<a title="[% action.ui_method_name | html %]" id="ill-toolbar-btn-[% action.id | lower | html %]" class="btn btn-default" href="/cgi-bin/koha/ill/ill-requests.pl?method=[% action.method | uri %]&amp;illrequest_id=[% request.illrequest_id | uri %]">
<span class="fa [% action.ui_method_icon | html %]"></span>
[% action.ui_method_name | html %]
</a>
[% END %]
[% END %]
<a title="Display supplier metadata" id="ill-request-display-metadata" class="btn btn-default pull-right" href="#">
<span class="fa fa-eye"></span>
Display supplier metadata
</a>
<a title="ILL request log" id="ill-request-display-log" class="btn btn-default pull-right" href="#">
<span class="fa fa-calendar"></span>
ILL request log
</a>
</div>
<div class="ill-view-panel panel panel-default">
<div class="panel-heading">
<h3>Request details</h3>
</div>
<div class="panel-body">
<h4>Details from library</h4>
<div class="rows">
<ol>
<li class="orderid">
<span class="label orderid">Order ID:</span>
[% IF request.orderid %][% request.orderid | html %][% ELSE %]<span>N/A</span>[% END %]
</li>
<li class="borrowernumber">
<span class="label borrowernumber">Patron:</span>
[% borrowerlink = "/cgi-bin/koha/members/moremember.pl" _ "?borrowernumber=" _ request.patron.borrowernumber %]
<a href="[% borrowerlink | url %]" title="View borrower details">
[% request.patron.firstname _ " " _ request.patron.surname _ " [" _ request.patron.cardnumber _ "]" | html %]
</a>
</li>
<li class="biblio_id">
<span class="label biblio_id">Bibliographic record ID:</span>
[% IF request.biblio_id %]
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% request.biblio_id | uri %]">[% request.biblio_id | html %]</a>
[% ELSE %]
<span>N/A</span>
[% END %]
</li>
<li class="branchcode">
<span class="label branchcode">Library:</span>
[% Branches.GetName(request.branchcode) | html %]
</li>
<li class="status">
<span class="label status">Status:</span>
[% IF request.statusalias %]
[% request.statusalias.lib | html %]
[% ELSE %]
[% request.capabilities.$req_status.name | html%]
[% IF request.requested_partners.length > 0 %]
([% request.requested_partners | html %])
[% END %]
[% END %]
</li>
<li class="updated">
<span class="label updated">Last updated:</span>
[% request.updated | $KohaDates with_hours => 1 %]
</li>
<li class="medium">
<span class="label medium">Request type:</span>
[% type = request.get_type %]
[% IF type %][% type | html %][% ELSE %]<span>N/A</span>[% END %]
</li>
<li class="cost">
<span class="label cost">Cost:</span>
[% IF request.cost %][% request.cost | $Price %][% ELSE %]<span>N/A</span>[% END %]
</li>
<li class="price_paid">
<span class="label price_paid">Price paid:</span>
[% IF request.price_paid %][% request.price_paid | $Price %][% ELSE %]<span>N/A</span>[% END %]
</li>
<li class="req_id">
<span class="label req_id">Request number:</span>
[% request.id_prefix _ request.illrequest_id | html %]
</li>
<li class="notesstaff">
<span class="label notes_staff">Staff notes:</span>
<p>[% request.notesstaff | html %]</p>
</li>
<li class="notesopac">
<span class="label notes_opac">Notes:</span>
<p>[% request.notesopac | html %]</p>
</li>
</ol>
</div>
<div class="rows">
<h4>Details from supplier ([% request.backend | html %])</h4>
<ol>
[% FOREACH meta IN request.metadata %]
<li class="requestmeta-[% meta.key.replace('\s','_') | html %]">
<span class="label">[% meta.key | html %]:</span>
[% meta.value | html %]
</li>
[% END %]
</ol>
</div>
</div>
</div>
<div id="dataPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="dataPreviewLabel"> Supplier metadata</h3>
</div>
<div class="modal-body">
<div id="requestattributes">
[% FOREACH attr IN request.illrequestattributes %]
<div class="requestattr-[% attr.type | html %]">
<span class="label">[% attr.type | html %]:</span>
[% attr.value | html %]
</div>
[% END %]
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
</div>
</div>
<div id="requestLog" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="requestLogLabel"> Request log</h3>
</div>
<div class="modal-body">
[% IF request.logs.size > 0 %]
[% FOREACH log IN request.logs %]
[% tpl = log.template %]
[% INCLUDE $tpl log=log %]
[% END %]
[% ELSE %]
There are no recorded logs for this request
[% END %]
</div>
<div class="modal-footer">
<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
</div>
</div>
<div class="ill-view-panel panel panel-default">
<div class="panel-heading">
<h3>[% request.illcomments.count | html %] comments</h3>
</div>
<div class="panel-body">
[% IF request.illcomments.count && request.illcomments.count > 0 %]
[% FOREACH comment IN request.illcomments %]
<div class="rows comment_[% comment.patron.categorycode | html %]">
<h5>Comment by:
<a href="[% borrowerlink | url %]" title="View borrower details">
[% comment.patron.firstname _ " " _ comment.patron.surname _ " [" _ comment.patron.cardnumber _ "]" | html %]</a>
[% comment.timestamp | $KohaDates with_hours => 1 %]</h5>
<p>[% comment.comment | html %]</p>
</div>
[% END %]
[% END %]
<div class="rows">
<h3><a id="toggle_addcomment" href="#">Add comment</a></h3>
<div id="addcomment" class="content_hidden">
<form class="validated" method="post" action="/cgi-bin/koha/ill/ill-requests.pl">
<input type="hidden" value="save_comment" name="method">
<input type="hidden" value="[% csrf_token | html %]" name="csrf_token">
<input type="hidden" value="[% request.illrequest_id | html %]" name="illrequest_id">
<fieldset class="rows">
<ol>
<li>
<label class="required" for="comment">Comment: </label>
<textarea class="required" required="required" cols="80" rows="10" id="comment" name="comment"></textarea>
<span class="required">Required</span>
</li>
</ol>
</fieldset>
<fieldset class="action">
<input type="submit" value="Submit">
</fieldset>
</form>
</div>
</div>
</div>
</div>
[% ELSIF query_type == 'illlist' %]
<!-- illlist -->
<h1>View ILL requests</h1>
<div id="results">
<h3>Details for all requests</h3>
[% INCLUDE 'ill-list-table.inc' %]
</div>
[% ELSE %]
<!-- Custom Backend Action -->
[% PROCESS $whole.template %]
[% END %]
[% END %]
</div>
</div>
</div>
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'columns_settings.inc' %]
[% INCLUDE 'calendar.inc' %]
[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
<script>
var prefilters = '[% prefilters | $raw %]';
// Set column settings
var columns_settings = [% ColumnsSettings.GetColumns( 'illrequests', 'ill-requests', 'ill-requests', 'json' ) %];
</script>
[% INCLUDE 'ill-list-table-strings.inc' %]
[% Asset.js("js/ill-list-table.js") | $raw %]
[% END %]
[% TRY %]
[% PROCESS backend_jsinclude %]
[% CATCH %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]