Koha/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt
Owen Leonard 94b2b6c4f9 Bug 20805: Update child to adult patron process broken on several patron-related pages
This patch fixes a problem with several patron-related pages, where the
"Update child to adult patron" menu item doesn't work. With some pages,
the right category information wasn't being passed from the script to
the template. With some, the right JavaScript variable weren't being
passed from the template to the included JavaScript file.

To test, apply the patch locate some patrons with "child" type patron
categories. With each patron, go to one of the following pages and test
the "update child" process in the toolbar's "More" menu.

 - Circulation ->
   - Batch check out
   - Notices
   - Statistics
   - Files
   - Housebound
   - Delete (test from the deletion confirmation screen).

All test should be performed on a system with multiple adult patron
categories configured AND on a system with only a single adult patron
category.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-07-13 12:23:09 +00:00

132 lines
5.1 KiB
Text

[% USE Asset %]
[% USE Koha %]
[% USE AuthorisedValues %]
[% USE Branches %]
[% USE KohaDates %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Sent notices for [% INCLUDE 'patron-title.inc' no_html = 1 %]</title>
[% INCLUDE 'doc-head-close.inc' %]
[% Asset.css("css/datatables.css") %]
<style type="text/css">
.notice { display: none; }
.notice-title { font-weight: bold; display: block; }
</style>
</head>
<body id="pat_notices" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> &rsaquo; Sent notices for [% INCLUDE 'patron-title.inc' %]</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
[% INCLUDE 'members-toolbar.inc' %]
<h1>Sent notices for [% INCLUDE 'patron-title.inc' %]</h1>
[% IF ( QUEUED_MESSAGES ) %]
<table id="noticestable">
<thead>
<tr>
<th>Notice</th>
<th>Type</th>
<th>Status</th>
<th>Time</th>
</tr>
</thead>
<tbody>
[% FOREACH QUEUED_MESSAGE IN QUEUED_MESSAGES %]
<tr>
<td>
<a class="notice-title" data-noticeid="[% QUEUED_MESSAGE.message_id %]" href="#">[% QUEUED_MESSAGE.subject %]</a>
<div id="notice[% QUEUED_MESSAGE.message_id %]" class="notice">
<iframe srcdoc="[% QUEUED_MESSAGE.content FILTER html_line_break FILTER html %]"></iframe>
</div>
</td>
<td>
[% IF ( QUEUED_MESSAGE.message_transport_type == 'email' ) %]email
[% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'print' ) %]print
[% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'feed' ) %]feed
[% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'sms' ) %]sms
[% ELSE %][% QUEUED_MESSAGE.message_transport_type %][% END %]
</td>
<td>
[% IF ( QUEUED_MESSAGE.status == 'sent' ) %]sent
[% ELSIF ( QUEUED_MESSAGE.status == 'pending' ) %]pending
[% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]failed
[% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]deleted
[% ELSE %][% QUEUED_MESSAGE.status %][% END %]
[% IF ( QUEUED_MESSAGE.status != 'pending' ) %]
<div id="resend_notice[% QUEUED_MESSAGE.message_id %]" class="notice">
<form action="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber %]" method="POST">
<input type="hidden" name="op" value="resend_notice" />
<input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
<input type="hidden" name="message_id" value="[% QUEUED_MESSAGE.message_id %]" />
<fieldset class="action">
<button class="btn btn-default btn-xs" type="submit">Resend</button>
</fieldset>
</form>
</div>
[% END %]
</td>
<td><span title="[% QUEUED_MESSAGE.time_queued %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</span></td>
</tr>
[% END %]
</tbody>
</table>
[% ELSE %]
<div class="dialog message">There is no record of any messages that have been sent to this patron.</div>
[% END %]
</div>
</div>
<div class="yui-b">
[% INCLUDE 'circ-menu.inc' %]
</div>
</div>
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
/* Set some variables needed in members-menu.js */
var borrowernumber = "[% patron.borrowernumber %]";
var advsearch = "[% advsearch %]";
var dateformat = "[% dateformat %]";
var NorwegianPatronDBEnable = "[% NorwegianPatronDBEnable %]";
var CATCODE_MULTI = "[% CATCODE_MULTI %]";
var catcode = "[% catcode %]";
var destination = "[% destination %]";
var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers %]";
$(document).ready(function() {
$("#noticestable").dataTable($.extend(true, {}, dataTablesDefaults, {
"aaSorting": [[ 3, "desc" ]],
"aoColumns": [ null,null,null,{ "sType": "title-string" } ],
"sPaginationType": "four_button"
}));
$("#noticestable").on("click", ".notice-title", function(e){
e.preventDefault();
var rowid = $(this).data("noticeid");
$("#notice"+rowid).toggle();
$("#resend_notice"+rowid).toggle();
var iframe = $("#notice"+rowid).children('iframe');
// Adding some padding to the height and width to remove scrollbars
var height = iframe.get(0).contentWindow.document.body.scrollHeight + 25;
var width = iframe.get(0).contentWindow.document.body.scrollWidth + 25;
iframe.css({
'width': width + 'px',
'height': height + 'px'
});
});
});
</script>
[% Asset.js("js/members-menu.js") %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]