Owen Leonard
5d2ff2f80a
This patch updates patron module templates so that title tags can be more easily translated. To test, apply the patch and confirm that the following patron-related pages have the correct title tags: - Patrons home page - Patron search -> - Select two patrons -> Merge selected - Add patron -> - Add a patron with the same name and email address -> - Click "View existing record" in "Duplicate patron record?" dialog. - Patron details - Manage API keys (must have RESTOAuth2ClientCredentials enabled) - Accounting - Transactions - Print fee receipt - Print invoice - Make a payment - Create manual invoice - Create manual credit - Routing lists (must have RoutingSerials enabled) - Circulation history - Notices - Statistics - Files (must have EnableBorrowerFiles enabled) - Purchase suggestions - Discharges (must have useDischarge enabled) - Housebound (must have HouseboundModule enabled) - ILL requests history (must have ILLModule enabled) - Set permissions - Change password - Print summary - Print account balance - Two-factor authentication (must have TwoFactorAuthentication enabled) - Edit patron - Update child to adult patron: - Must have more than one "adult" type category defined - Locate a patron with a "child" type category - Choose More -> Update child to adult patron - Delete patron (confirmation page) - Pending discharge requests - Patrons requesting modifications Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
338 lines
16 KiB
Text
338 lines
16 KiB
Text
[% USE raw %]
|
|
[% USE Asset %]
|
|
[% USE Branches %]
|
|
[% USE Categories %]
|
|
[% USE KohaDates %]
|
|
[% PROCESS 'i18n.inc' %]
|
|
[% SET footerjs = 1 %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>[% FILTER collapse %]
|
|
[% t("Merge patron records") | html %] ›
|
|
[% t("Patrons") | html %] ›
|
|
[% t("Koha") | html %]
|
|
[% END %]</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
[% FILTER collapse %]
|
|
<style>
|
|
ins {
|
|
background-color: #e6ffe6;
|
|
}
|
|
del {
|
|
background-color: #ffe6e6;
|
|
}
|
|
.col0,
|
|
.col1 {
|
|
display: none;
|
|
}
|
|
.col3 ins,
|
|
.col2 del {
|
|
display: none;
|
|
}
|
|
#col-label,
|
|
.col2,
|
|
.col3 {
|
|
border-right: 1px solid #EEE;
|
|
flex-grow: 1;
|
|
margin-right:1em;
|
|
}
|
|
#col-label {
|
|
font-family: monospace;
|
|
}
|
|
#col-label div {
|
|
white-space: none;
|
|
}
|
|
.compare {
|
|
display: flex;
|
|
}
|
|
.modal-lg {
|
|
width: 90%;
|
|
}
|
|
</style>
|
|
[% END %]
|
|
</head>
|
|
<body id="pat_merge" class="pat">
|
|
[% WRAPPER 'header.inc' %]
|
|
[% INCLUDE 'patron-search-header.inc' %]
|
|
[% END %]
|
|
|
|
[% BLOCK display_names %]
|
|
[% SWITCH rs %]
|
|
[% CASE 'Accountline' %]<span>account lines</span>
|
|
[% CASE 'ArticleRequest' %]<span>article requests</span>
|
|
[% CASE 'BorrowerAttribute' %]<span>extended patron attributes</span>
|
|
[% CASE 'BorrowerDebarment' %]<span>patron restrictions</span>
|
|
[% CASE 'BorrowerFile' %]<span>patrons files</span>
|
|
[% CASE 'BorrowerModification' %]<span>patron modification requests</span>
|
|
[% CASE 'ClubEnrollment' %]<span>club enrollments</span>
|
|
[% CASE 'Issue' %]<span>checkouts</span>
|
|
[% CASE 'ItemsLastBorrower' %]<span>marks as last borrower of item</span>
|
|
[% CASE 'Linktracker' %]<span>tracked link clicks</span>
|
|
[% CASE 'Message' %]<span>patron messages</span>
|
|
[% CASE 'MessageQueue' %]<span>patron notices</span>
|
|
[% CASE 'OldIssue' %]<span>previous checkouts</span>
|
|
[% CASE 'OldReserve' %]<span>filled holds</span>
|
|
[% CASE 'Rating' %]<span>ratings</span>
|
|
[% CASE 'Reserve' %]<span>current holds</span>
|
|
[% CASE 'Review' %]<span>reviews</span>
|
|
[% CASE 'Statistic' %]<span>statistics</span>
|
|
[% CASE 'SearchHistory' %]<span>historical searches</span>
|
|
[% CASE 'Suggestion' %]<span>purchase suggestions</span>
|
|
[% CASE 'TagAll' %]<span>tags</span>
|
|
[% CASE 'Virtualshelfcontent' %]<span>list items</span>
|
|
[% CASE 'Virtualshelfshare' %]<span>list shares</span>
|
|
[% CASE 'Virtualshelve' %]<span>lists</span>
|
|
[% CASE %][% rs | html %]
|
|
[% END %]
|
|
[% END %]
|
|
|
|
[% WRAPPER 'sub-header.inc' %]
|
|
[% WRAPPER breadcrumbs %]
|
|
[% WRAPPER breadcrumb_item %]
|
|
<a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
|
|
[% END %]
|
|
[% WRAPPER breadcrumb_item bc_active= 1 %]
|
|
<span>Merge patron records</span>
|
|
[% END %]
|
|
[% END #/ WRAPPER breadcrumbs %]
|
|
[% END #/ WRAPPER sub-header.inc %]
|
|
|
|
<div class="main container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
|
|
<h1>Merge patron records</h1>
|
|
|
|
[% IF action == 'show' %]
|
|
[% IF patrons.count > 1 %]
|
|
[% IF ( patrons.count == 2 ) %]
|
|
<div id="toolbar" class="btn-toolbar">
|
|
<div class="btn-group">
|
|
<button class="btn btn-default" id="compare_patrons">
|
|
<i class="fa fa-arrows-h"></i> Compare patrons
|
|
</button>
|
|
</div>
|
|
</div>
|
|
[% END %]
|
|
|
|
<p>Select patron to keep. Data from the other patrons will be transferred to this patron record and the remaining patron records will be deleted.</p>
|
|
|
|
<form type="post" action="merge-patrons.pl" id="patron-merge-form">
|
|
<table id="patron-merge-table" class="datatable">
|
|
<thead>
|
|
<tr>
|
|
<th> </th>
|
|
<th>Card</th>
|
|
<th>Name</th>
|
|
<th>Date of birth</th>
|
|
<th>Category</th>
|
|
<th>Library</th>
|
|
<th>Expires on</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
[% FOREACH p IN patrons %]
|
|
<tr>
|
|
<td><input class="keeper" type="radio" name="keeper" value="[% p.id | html %]" data-borrowernumber="[% p.id | html %]" id="keeper_[% p.id | html %]" /></td>
|
|
<td>
|
|
<label for="keeper_[% p.id | html %]">
|
|
<strong>[% p.cardnumber | html %]</strong>
|
|
</label>
|
|
</td>
|
|
<td>
|
|
<a target="_blank" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% p.borrowernumber | uri %]">
|
|
[% INCLUDE 'patron-title.inc' patron = p %]
|
|
<i class="fa-solid fa-window-restore"></i>
|
|
</a>
|
|
</td>
|
|
<td>[% p.dateofbirth | $KohaDates %]</td>
|
|
<td>[% Categories.GetName( p.categorycode ) | html %] ([% p.categorycode | html %])</td>
|
|
<td>[% Branches.GetName( p.branchcode ) | html %]</td>
|
|
<td>[% p.dateexpiry | $KohaDates %]</td>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
|
|
<fieldset class="action">
|
|
[% FOREACH p IN patrons %]
|
|
<input type="hidden" name="id" value="[% p.id | html %]" />
|
|
[% END %]
|
|
<input type="hidden" name="action" value="merge" />
|
|
<input type="submit" id="merge-patrons" class="btn btn-primary" value="Merge patrons" />
|
|
</fieldset>
|
|
|
|
[% ELSE %]
|
|
<div class="dialog alert">Error: Two or more patrons need to be selected for merging</div>
|
|
[% END %]
|
|
</form>
|
|
[% ELSIF action == 'merge' %]
|
|
<h4>Results</h4>
|
|
[% IF error %]
|
|
[% IF error == 'INVALID_KEEPER' %]
|
|
<div class="dialog alert">Merge failed! The patron to keep was invalid.</div>
|
|
[% ELSE %]
|
|
<div class="dialog alert">Merge failed! The following error was reported: [% error | html %].</div>
|
|
[% END %]
|
|
[% ELSIF !results.merged.keys.size %]
|
|
<div class="dialog alert">No valid patrons to merge were found.</div>
|
|
[% ELSE %]
|
|
<p>
|
|
Patron records merged into <a href="moremember.pl?borrowernumber=[% keeper.id | uri %]">[% INCLUDE 'patron-title.inc' patron = keeper %]</a>
|
|
</p>
|
|
|
|
[% FOREACH pair IN results.merged.pairs %]
|
|
[% SET patron = pair.value.patron %]
|
|
|
|
<h5>[% INCLUDE 'patron-title.inc' %]</h5>
|
|
|
|
[% FOREACH r IN pair.value.updated.pairs %]
|
|
[% SET name = r.key %]
|
|
[% SET count = r.value %]
|
|
[% IF count %]
|
|
<p>
|
|
<span>[% count | html %] [% PROCESS display_names rs = name %] transferred.</span>
|
|
[% IF name == 'Reserve' %]
|
|
<strong>It is advisable to check for and resolve duplicate holds due to merging.</strong>
|
|
[% END %]
|
|
</p>
|
|
[% END %]
|
|
[% END %]
|
|
[% END %]
|
|
[% END %]
|
|
|
|
[% UNLESS error %]
|
|
<a class="btn btn-default" href="moremember.pl?borrowernumber=[% keeper.id | html %]">View patron record</a>
|
|
[% END %]
|
|
[% END %]
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal -->
|
|
<div class="modal" id="compareModal" tabindex="-1" role="dialog" aria-labelledby="compareModalLabel">
|
|
<div class="modal-dialog modal-lg" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
|
<h4 class="modal-title" id="compareModalLabel">Compare patrons for merging</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="compare">
|
|
<div id="col-label">
|
|
<div><strong>Name:</strong></div>
|
|
<div><strong>Initials:</strong></div>
|
|
<div><strong>Other name:</strong></div>
|
|
<div><strong>Library:</strong></div>
|
|
<div><strong>Card number:</strong></div>
|
|
<div><strong>Category:</strong></div>
|
|
<br />
|
|
<div><strong>Address line 1:</strong></div>
|
|
<div><strong>Address line 2:</strong></div>
|
|
<div><strong>City:</strong></div>
|
|
<div><strong>State:</strong></div>
|
|
<div><strong>ZIP/Postal code:</strong></div>
|
|
<div><strong>Country:</strong></div>
|
|
<br />
|
|
<div><strong>Registration date:</strong></div>
|
|
<div><strong>Renewal date:</strong></div>
|
|
<div><strong>Expiration date:</strong></div>
|
|
<div><strong>Date of birth:</strong></div>
|
|
<div><strong>Restricted:</strong></div>
|
|
<div><strong>Primary email:</strong></div>
|
|
<div><strong>Secondary email:</strong></div>
|
|
<div><strong>Primary phone:</strong></div>
|
|
<div><strong>Secondary phone:</strong></div>
|
|
<div><strong>Other phone:</strong></div>
|
|
<div><strong>Gender:</strong></div>
|
|
<div><strong>Updated on:</strong></div>
|
|
<div><strong>Username:</strong></div>
|
|
</div>
|
|
|
|
[% FOREACH p IN patrons %]
|
|
<div id="col-[% p.borrowernumber | html %]-orig"class="col[% loop.index | html %]">
|
|
<!-- <pre> block is unindented to avoid unwanted whitespace -->
|
|
<pre>
|
|
[% IF ( p.surname ) %][% p.surname | html %], [% p.firstname | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.initials ) %][% p.initials | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.othernames ) %][% p.othernames | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.branchcode ) %][% p.branchcode | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.cardnumber ) %][% p.cardnumber | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.categorycode ) %][% p.categorycode | html %][% ELSE %]-[% END %]
|
|
|
|
[% IF ( p.address ) %][% p.address | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.address2 ) %][% p.address2 | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.city ) %][% p.city | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.state ) %][% p.state | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.zipcode ) %][% p.zipcode | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.country ) %][% p.country | html %][% ELSE %]-[% END %]
|
|
|
|
[% IF ( p.dateenrolled ) %][% p.dateenrolled | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.date_renewed ) %][% p.date_renewed | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.dateexpiry ) %][% p.dateexpiry | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.dateofbirth ) %][% p.dateofbirth | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.debarred ) %][% p.debarred | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.email ) %][% p.email | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.emailpro ) %][% p.emailpro | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.phone ) %][% p.phone | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.phonepro ) %][% p.phonepro | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.mobile ) %][% p.mobile | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.sex ) %][% p.sex | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.updated_on ) %][% p.updated_on | html %][% ELSE %]-[% END %]
|
|
[% IF ( p.userid ) %][% p.userid | html %][% ELSE %]-[% END %]
|
|
</pre>
|
|
</div>
|
|
[% END %]
|
|
[% FOREACH p IN patrons %]
|
|
<div id="col-[% p.borrowernumber | html %]-diff" class="col[% ( loop.index + 2 ) | html %]"><pre></pre></div>
|
|
[% END %]
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" id="submit-merge-form"><i class="fa fa-compress" aria-hidden="true"></i> Merge patrons</button>
|
|
<button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-times" aria-hidden="true"></i> Close</button>
|
|
</div>
|
|
</div> <!-- /.modal-content -->
|
|
</div> <!-- /.modal-dialog -->
|
|
</div> <!-- /#compareModal -->
|
|
|
|
[% MACRO jsinclude BLOCK %]
|
|
[% INCLUDE 'str/members-menu.inc' %]
|
|
[% Asset.js("js/members-menu.js") | $raw %]
|
|
[% Asset.js("lib/jsdiff/jsdiff.min.js") | $raw %]
|
|
<script>
|
|
$(document).ready(function() {
|
|
var controls = $("#merge-patrons, #compare_patrons");
|
|
controls.prop('disabled', true);
|
|
$('#patron-merge-table').on('change', 'input', function() {
|
|
if ( $('.keeper:checked').length > 0 ) {
|
|
controls.prop('disabled', false);
|
|
} else {
|
|
controls.prop('disabled', true);
|
|
}
|
|
});
|
|
|
|
$("#compare_patrons").on("click", function(e){
|
|
e.preventDefault();
|
|
$("#compareModal").modal("show");
|
|
});
|
|
|
|
$("#compareModal").on("shown.bs.modal", function(){
|
|
/* Find which column is the basis for merging */
|
|
var col0 = $(".keeper:checked").data("borrowernumber");
|
|
var col1 = $(".keeper:not(:checked)").data("borrowernumber");
|
|
/* Get the original patron data for comparison */
|
|
var diff1 = $("#col-" + col0 + "-orig pre").text();
|
|
var diff2 = $("#col-" + col1 + "-orig pre").text();
|
|
|
|
var diffs = diffString(diff2, diff1);
|
|
/* Load the diff HTML in the empty columns */
|
|
$(".col2 pre, .col3 pre").html(diffs);
|
|
});
|
|
|
|
$("#submit-merge-form").on("click", function(){
|
|
$("#patron-merge-form").submit();
|
|
});
|
|
});
|
|
|
|
</script>
|
|
[% END %]
|
|
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|