7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha › Patrons › Merge patron records</title>
9 [% INCLUDE 'doc-head-close.inc' %]
12 <body id="pat_merge" class="pat">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'patron-search.inc' %]
16 [% BLOCK display_names %]
18 [% CASE 'Accountline' %]account lines
19 [% CASE 'ArticleRequest' %]article requests
20 [% CASE 'BorrowerAttribute' %]extended patron attributes
21 [% CASE 'BorrowerDebarment' %]patron restrictions
22 [% CASE 'BorrowerFile' %]patrons files
23 [% CASE 'BorrowerModification' %]patron modification requests
24 [% CASE 'ClubEnrollment' %]club enrollments
25 [% CASE 'Issue' %]checkouts
26 [% CASE 'ItemsLastBorrower' %]marks as last borrower of item
27 [% CASE 'Linktracker' %]tracked link clicks
28 [% CASE 'Message' %]patron messages
29 [% CASE 'MessageQueue' %]patron notices
30 [% CASE 'OldIssue' %]previous checkouts
31 [% CASE 'OldReserve' %]filled holds
32 [% CASE 'Rating' %]ratings
33 [% CASE 'Reserve' %]current holds
34 [% CASE 'Review' %]reviews
35 [% CASE 'Statistic' %]statistics
36 [% CASE 'SearchHistory' %]historical searches
37 [% CASE 'Suggestion' %]purchase suggestions
38 [% CASE 'TagAll' %]tags
39 [% CASE 'Virtualshelfcontent' %]list items
40 [% CASE 'Virtualshelfshare' %]list shares
41 [% CASE 'Virtualshelve' %]lists
42 [% CASE %][% rs | html %]
46 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Merge patron records</div>
48 <div class="main container-fluid">
50 <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
51 <h3>Merge patron records</h3>
53 [% IF action == 'show' %]
54 [% IF patrons.count > 1 %]
55 <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>
56 <form type="post" action="merge-patrons.pl">
57 <table id="patron-merge-table" class="datatable">
63 <th>Date of birth</th>
71 [% FOREACH p IN patrons %]
73 <td><input class='keeper' type='radio' name='keeper' value='[% p.id | html %]' /></td>
74 <td>[% p.cardnumber | html %]</td>
75 <td>[% INCLUDE 'patron-title.inc' patron = p %]</td>
76 <td>[% p.dateofbirth | $KohaDates %]</td>
77 <td>[% Categories.GetName( p.categorycode ) | html %] ([% p.categorycode | html %])</td>
78 <td>[% Branches.GetName( p.branchcode ) | html %]</td>
79 <td>[% p.dateexpiry | $KohaDates %]</td>
84 [% FOREACH p IN patrons %]
85 <input type="hidden" name="id" value="[% p.id | html %]" />
90 <input type="hidden" name="action" value="merge" />
91 <input id="merge-patrons" type="submit" value="Merge patrons" />
93 <div class="dialog alert">Error: Two or more patrons need to be selected for merging</div>
96 [% ELSIF action == 'merge' %]
99 [% IF error == 'INVALID_KEEPER' %]
100 <div class="dialog alert">Merge failed! The patron to keep was invalid.</div>
102 <div class="dialog alert">Merge failed! The following error was reported: [% error | html %].</div>
104 [% ELSIF !results.merged.keys.size %]
105 <div class="dialog alert">No valid patrons to merge were found.</div>
108 Patron records merged into <a href="moremember.pl?borrowernumber=[% keeper.id | uri %]">[% INCLUDE 'patron-title.inc' patron = keeper %]</a>
111 [% FOREACH pair IN results.merged.pairs %]
112 [% SET patron = pair.value.patron %]
114 <h5>[% INCLUDE 'patron-title.inc' %]</h5>
116 [% FOREACH r IN pair.value.updated.pairs %]
117 [% SET name = r.key %]
118 [% SET count = r.value %]
121 <span>[% count | html %] [% PROCESS display_names rs = name %] transferred.</span>
122 [% IF name == 'Reserve' %]
123 <strong>It is advisable to check for and resolve duplicate holds due to merging.</strong>
132 <a class="btn btn-default btn-sm" href="moremember.pl?borrowernumber=[% keeper.id | html %]">View patron record</a>
138 [% MACRO jsinclude BLOCK %]
139 [% INCLUDE 'str/members-menu.inc' %]
140 [% Asset.js("js/members-menu.js") | $raw %]
143 $(document).ready(function() {
144 $('#merge-patrons').prop('disabled', true);
145 $('#patron-merge-table').on('change', 'input', function() {
146 if ( $('.keeper:checked').length > 0 ) {
147 $('#merge-patrons').prop('disabled', false);
149 $('#merge-patrons').prop('disabled', true);
156 [% INCLUDE 'intranet-bottom.inc' %]