Koha/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt
Owen Leonard 20450829eb Bug 26838: Improve styling of checkin message
This patch makes some changes to the style and use of the "problem"
class in the staff interface:

- Remove the background color
- Remove the extra line height

Some changes to the template:

 - Remove the problem class from the checkin message. The checkin
   message configuration determines whether the dialog is an alert or a
   message-style dialog.
 - Add Font Awesome icons to the "problem" messages in patron details
   and serials collection. This is to help emphasize the message for
   users  who might have difficulty seeing the color difference.

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

 - Go to Administration -> Item types and configure a checkin message
   for an item type: Add a message and select "Message" as the checkin
   message type.
 - Check in an item with that item type and confirm that you see the
   checkin message. It should be displayed in a message-style dialog
   without any additional styling.
 - Change the item type configuration to use "Alert" as the checkin
   message type. Confirm that the correct style is shown in this case as
   well.

 - Locate a patron with a NULL value in borrowers.password. View the
   detail page for that patron.
 - Under the "Library use" heading, the "Password" line should contain a
   link with the text "Undefined," preceded by a red-colored Font
   Awesome  icon.

 - In Serials, locate a subscription which is expired.
 - View the details for the subscription, and then open "serial
   collection" from the sidebar menu.
 - On the serial collection page there should be a cell in the
   subscription summary table showing the message "Subscription expired"
   preceded by a red-colored Font Awesome icon.

Signed-off-by: Salman Ali <salman.ali@inLibro.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-06-21 14:01:50 +02:00

410 lines
17 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE AuthorisedValues %]
[% USE Branches %]
[% USE KohaDates %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Serial collection information for [% bibliotitle | html %] &rsaquo; Serials &rsaquo; Koha</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="ser_serials-collection" class="ser">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'serials-search.inc' %]
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
<ol>
<li>
<a href="/cgi-bin/koha/mainpage.pl">Home</a>
</li>
<li>
<a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
</li>
<li>
<a href="#" aria-current="page">
Serial collection information for <em>[% bibliotitle | html %]</em>
</a>
</li>
</ol>
</nav>
<div class="main container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-push-2">
<main>
[% INCLUDE 'modals/serials_multi_receiving.inc' %]
[% UNLESS ( popup ) %]
[% INCLUDE 'serials-toolbar.inc' %]
<h1>Serial collection information for <em>[% bibliotitle | html %]</em>
[% IF location %] ([% AuthorisedValues.GetByCode( 'LOC', location ) | html %]) [% END %]
[% IF ( callnumber ) %]callnumber: [% callnumber | html %][% END %]</h1>
[% END %]
[% IF ( delete ) %]
<div class="dialog alert">
<h3>You are about to delete [% serialnumber | html %] serial(s). Do you want to continue?</h3>
<form action="/cgi-bin/koha/serials/serials-collection.pl/#">
[% IF countitems > 0 %]
<h5>Number of items available: [% countitems | html %]</h5>
<p>
<label>Delete associated items? <input type="checkbox" name="delitems" value="Yes" />Yes</label>
</p>
[% END %]
<input type="hidden" name="op" value="delete_confirmed" />
<input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
<input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
[% FOREACH serialid IN serialsid %]
<input type="hidden" name="serialid" value="[% serialid | html %]" />
[% END %]
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
</form>
<form action="/cgi-bin/koha/serials/serials-collection.pl">
<input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
<button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
</form>
</div>
[% END %]
[% IF ( error_delitem ) %]
<div class="dialog alert">
<p><strong>Error</strong>: one or more associated items could not be deleted at this time.</p>
</div>
[% END %]
[% IF ( subscriptions ) %]
<table>
[% IF ( subscriptions.size == 1 ) %]
<caption> Subscription summary</caption>
[% ELSE %]
<caption> Subscription summaries</caption>
[% END %]
<tr>
<th>Subscription num.</th>
<th>Frequency</th>
<th>Numbering pattern</th>
<th>Library</th>
<th>Call number</th>
<th>Notes</th>
<th>&nbsp;</th>
</tr>
[% FOREACH subscription IN subscriptions %]
<tr>
<td><a href="subscription-detail.pl?subscriptionid=[% subscription.subscriptionid | uri %]"># [% subscription.subscriptionid | html %]</a> </td>
<td>[% subscription.frequency.description | html %]</td>
<td>[% subscription.numberpattern.label | html %]</td>
<td>[% IF subscription.branchcode %][% Branches.GetName( subscription.branchcode ) | html %][% END %]</td>
<td> [% subscription.callnumber | html %]</td>
<td> [% subscription.notes | html | html_line_break %]
[% UNLESS subscription.closed %]
[% IF ( subscription.subscriptionexpired ) %]
<p class="problem"><i class="fa fa-exclamation-circle problem" aria-hidden="true"></i> Subscription expired</p>
[% END %]
[% ELSE %]
<br /> Subscription closed
[% END %]
</td>
[% IF ( subscription.abouttoexpire ) || ( subscription.subscriptionexpired ) %]<td class="problem actions">[% ELSE %]<td class="actions">[% END %]
[% UNLESS subscription.closed %]
[% IF ( routing && CAN_user_serials_routing ) %]
[% IF ( subscription.hasRouting ) %]
<a class="btn btn-default btn-xs" href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid | html %]"><i class="fa fa-pencil"></i> Edit routing list</a>
[% ELSE %]
<a class="btn btn-default btn-xs" href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid | html %]&amp;op=new"><i class="fa fa-plus"></i> Create routing list</a>
[% END %]
[% END %]
[% IF ( subscription.abouttoexpire || subscription.subscriptionexpired) %]
<a class="btn btn-default btn-xs subscription_renew" data-subscriptionid="[% subscription.subscriptionid | html %]" href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscription.subscriptionid | html %]"><i class="fa fa-refresh"></i> Renew</a>
[% END %]
[% ELSE %]
&nbsp;
[% END %]
</td>
</tr>
[% END %]
[% IF ( subscr ) %]
[% IF ( subscriptioncount > 1 ) %]
<tr ><td colspan="8"> <a href="serials-collection.pl?biblionumber=[% biblionumber | uri %]">See any subscription attached to this biblio</a></td>
</tr>
[% END %]
[% END %]
</table>
[% END %]
[% IF ( years ) %]<form name="edition" action="serials-edit.pl" method="post">
<div id="subscription_years" class="toptabs numbered">
<ul>
[% FOREACH year IN years %]
[% IF ( year.year ) %]
[% IF year.year == 'manage' %]
<li><a href="#subscription-year-manage">Manage</a></li>
[% ELSE %]
<li><a href="#subscription-year-[% year.year | uri %]">[% year.year | html %]</a></li>
[% END %]
[% END %]
[% END %]
</ul>
[% FOREACH year IN years %]
<div id="subscription-year-[% year.year | html %]">
[% IF ( CAN_user_serials_receive_serials ) %]
<p>
<div class="btn-group"><input type="submit" value="Edit serials" class="btn btn-default btn-sm" /></div>
[% UNLESS subscription.closed %]
<div class="btn-group">
<input type="button" value="Generate next" data-subscriptionid="[% subscriptionidlist | html %]" class="btn btn-default btn-sm generatenext" />
</div>
[% IF ( subscriptions.size == 1 and !serialsadditems ) %]&nbsp;
<div class="btn-group"><input type="button" value="Multi receiving" href="#multi_receiving" class="btn btn-default btn-sm" data-toggle="modal"></div>
[% END %]
[% END %]
<input type="button" value="Delete selected issues" class="delete-issues btn btn-default btn-sm" data-subscriptionids="[% subscriptionidlist | html %]" />
</p>
[% END %]
<span class="checkall">
<a class="CheckAll" href="#" data-year="[% year.year | html %]">Select all</a>
</span> |
<span class="clearall">
<a class="CheckNone" href="#" data-year="[% year.year | html %]">Clear all</a>
</span>
<table class="subscription-year-table">
<thead>
<tr>
[% IF ( CAN_user_serials_receive_serials ) %]<th>Edit</th>[% END %]
[% IF ( subscriptions.size > 1 ) %]
<th># Subs</th>
[% END %]
<th>Date published
</th>
<th>Date published (text)
</th>
<th>Date received
</th>
<th>Number
</th>
<th>Status
</th>
<th>Notes
</th>
<th>Library
</th>
[% IF ( routing ) %]<th>Routing</th>[% END %]
</tr>
</thead>
<tbody>
[% FOREACH serial IN year.serials %]
<tr>
[% IF ( CAN_user_serials_receive_serials ) %]
<td>
[% UNLESS CAN_user_serials_receive_serials %]
disabled
[% ELSE %]
[% IF ( serial.subscriptionexpired ) %]
<input type="checkbox" name="serialid" value="[% serial.serialid | html %]" disabled="disabled" />
[% ELSE %]
[% IF ( delete ) %]
[% IF serialsid.grep("${serial.serialid}").size %]
<input type="checkbox" name="serialid" value="[% serial.serialid | html %]" disabled checked />
[% ELSE %]
<input type="checkbox" name="serialid" value="[% serial.serialid | html %]" disabled />
[% END %]
[% ELSE %]
[% IF serial.checked %]
<input type="checkbox" name="serialid" value="[% serial.serialid | html %]" checked />
[% ELSE %]
<input type="checkbox" name="serialid" value="[% serial.serialid | html %]" />
[% END %]
[% END %]
[% END %]
[% END %]
</td>
[% END %]
[% IF ( subscriptions.size > 1 ) %]
<td><a href="serials-collection.pl?subscriptionid=[% serial.subscriptionid | uri %]">[% serial.subscriptionid | html %]</a></td>
[% END %]
<td data-order="[% serial.publisheddate | html %]">
[% IF serial.publisheddate %]
[% serial.publisheddate | $KohaDates %]
[% ELSE %]
Unknown
[% END %]
</td>
<td data-order="[% serial.publisheddatetext | html %]">
[% IF serial.publisheddatetext %]
[% serial.publisheddatetext | html %]
[% END %]
</td>
<td data-order="[% serial.planneddate | html %]">
[% IF serial.planneddate %]
[% serial.planneddate | $KohaDates %]
[% ELSE %]
Unknown
[% END %]
</td>
<td>
[% IF ( matches = serial.serialseq.match('(.*)Spring(.*)') ) %]
[% matches.0 | html %]Spring[% matches.1 | html %]
[% ELSIF ( matches = serial.serialseq.match('(.*)Summer(.*)') ) %]
[% matches.0 | html %]Summer[% matches.1 | html %]
[% ELSIF ( matches = serial.serialseq.match('(.*)Fall(.*)') ) %]
[% matches.0 | html %]Fall[% matches.1 | html %]
[% ELSIF ( matches = serial.serialseq.match('(.*)Winter(.*)') ) %]
[% matches.0 | html %]Winter[% matches.1 | html %]
[% ELSIF ( matches = prediction.number.match('(.*)Spr(.*)') ) %]
[% matches.0 | html %]Spr[% matches.1 | html %]
[% ELSIF ( matches = prediction.number.match('(.*)Sum(.*)') ) %]
[% matches.0 | html %]Sum[% matches.1 | html %]
[% ELSIF ( matches = prediction.number.match('(.*)Fal(.*)') ) %]
[% matches.0 | html %]Fal[% matches.1 | html %]
[% ELSIF ( matches = prediction.number.match('(.*)Win(.*)') ) %]
[% matches.0 | html %]Win[% matches.1 | html %]
[% ELSE %]
[% serial.serialseq | html %]
[% END %]
</td>
<td>
[% IF ( serial.status1 ) %]Expected[% END %]
[% IF ( serial.status2 ) %]Arrived[% END %]
[% IF ( serial.status3 ) %]Late[% END %]
[% IF ( serial.status4 ) %]Missing[% END %]
[% IF ( serial.status41 ) %]Missing (never received)[% END %]
[% IF ( serial.status42 ) %]Missing (sold out)[% END %]
[% IF ( serial.status43 ) %]Missing (damaged)[% END %]
[% IF ( serial.status44 ) %]Missing (lost)[% END %]
[% IF ( serial.status5 ) %]Not issued[% END %]
[% IF ( serial.status6 ) %]Delete[% END %]
[% IF ( serial.status7 ) %]Claimed[% END %]
[% IF ( serial.status8 ) %]Stopped[% END %]
</td>
<td>
[% serial.notes | html %]
</td>
<td>
[% Branches.GetName( serial.branchcode ) | html %]
</td>
[% IF ( routing ) %]
<td class="actions">
<a href="/cgi-bin/koha/serials/routing-preview.pl?ok=1&amp;subscriptionid=[% serial.subscriptionid | uri %]&amp;issue=[% serial.serialseq.replace("'", "\\'") | uri %]%20([% serial.publisheddate | $KohaDates %])" class="btn btn-default btn-xs print_list"><i class="fa fa-print"></i> Print list</a>
</td>
[% END %]
</tr>
[% END %]
</tbody>
</table>
</div>
[% END %]
<input type="hidden" name="subscriptionid" value="[% subscriptionidlist | html %]" />
</div>
</form>
[% END %]
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'serials-menu.inc' %]
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
<script>
var subscriptionid = "[% subscriptionid | html %]";
</script>
[% Asset.js("js/serials-toolbar.js") | $raw %]
<script>
function deleteIssues(subscriptionid) {
var serialschecked = $("form[name='edition'] input[name='serialid']:checked");
if (serialschecked.length > 0) {
var location = 'serials-collection.pl?subscriptionid='+subscriptionid+'&op=delete_confirm';
for (i=0; i < serialschecked.length; i++) {
location += '&serialid=' + serialschecked[i].value;
}
document.location = location;
} else {
alert(_("No serials selected"));
}
}
function generateNext(subscriptionid) {
if(confirm(_("Do you really want to generate next serial?"))){
document.location = 'serials-collection.pl?op=gennext&subscriptionid='+subscriptionid;
}
}
$(document).ready(function() {
$('#subscription_years').tabs();
$(".subscription-year-table").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
{ "aTargets": [ 0,-1 ], "bSortable": false, "bSearchable": false }
],
"aaSorting": [[0, 'desc']],
"sDom": 't',
"bAutoWidth": false,
"bPaginate": false,
"bInfo": false,
"bFilter": false,
} ));
$(".CheckAll").on("click", function(e){
e.preventDefault();
var years = $(this).data("year");
$("#subscription-year-" + years + " input:checkbox").prop("checked", true );
});
$(".CheckNone").on("click", function(e){
e.preventDefault();
var years = $(this).data("year");
$("#subscription-year-" + years + " input:checkbox").prop("checked", false );
});
$(".generatenext").on("click", function(e){
e.preventDefault();
var subscriptionid = $(this).data("subscriptionid");
generateNext( subscriptionid );
});
$(".subscription_renew").on("click", function(e){
e.preventDefault();
var subscriptionid = $(this).data("subscriptionid");
popup( subscriptionid );
});
$(".print_list").on("click", function(e){
e.preventDefault();
var url = $(this).attr("href");
window.open( url,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes');
});
$('#multi_receiving').on('show', function () {
$(this).find(".modal-body").html($(".serials_multi_receiving")[0].outerHTML);
});
$("form[name='edition']").on('submit', function(e){
if ( $(this).find("input[name='serialid']:checked").size() == 0 ) {
e.preventDefault();
alert(_("You must select at least one serial to edit"));
return 0;
}
return 1;
});
$(".delete-issues").on("click", function(e){
e.preventDefault();
deleteIssues("[% subscriptionidlist | html %]");
});
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]