6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha › Patrons › Merge patron records</title>
8 [% INCLUDE 'doc-head-close.inc' %]
11 <body id="pat_merge" class="pat">
12 [% INCLUDE 'header.inc' %]
13 [% INCLUDE 'patron-search.inc' %]
15 [% BLOCK display_names %]
17 [% CASE 'Accountline' %]account lines
18 [% CASE 'ArticleRequest' %]article requests
19 [% CASE 'BorrowerAttribute' %]extended patron attributes
20 [% CASE 'BorrowerDebarment' %]patron restrictions
21 [% CASE 'BorrowerFile' %]patrons files
22 [% CASE 'BorrowerModification' %]patron modification requests
23 [% CASE 'ClubEnrollment' %]club enrollments
24 [% CASE 'Issue' %]checkouts
25 [% CASE 'ItemsLastBorrower' %]marks as last borrower of item
26 [% CASE 'Linktracker' %]tracked link clicks
27 [% CASE 'Message' %]patron messages
28 [% CASE 'MessageQueue' %]patron notices
29 [% CASE 'OldIssue' %]previous checkouts
30 [% CASE 'OldReserve' %]filled holds
31 [% CASE 'Rating' %]ratings
32 [% CASE 'Reserve' %]current holds
33 [% CASE 'Review' %]reviews
34 [% CASE 'Statistic' %]statistics
35 [% CASE 'SearchHistory' %]historical searches
36 [% CASE 'Suggestion' %]purchase suggestions
37 [% CASE 'TagAll' %]tags
38 [% CASE 'Virtualshelfcontent' %]list items
39 [% CASE 'Virtualshelfshare' %]list shares
40 [% CASE 'Virtualshelve' %]lists
45 <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>
47 <div class="main container-fluid">
49 <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
50 <h3>Merge patron records</h3>
52 [% IF action == 'show' %]
53 [% IF patrons.count > 1 %]
54 <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>
55 <form type="post" action="merge-patrons.pl">
56 <table id="patron-merge-table" class="datatable">
62 <th>Date of birth</th>
70 [% FOREACH p IN patrons %]
72 <td><input class='keeper' type='radio' name='keeper' value='[% p.id %]' /></td>
73 <td>[% p.cardnumber | html %]</td>
74 <td>[% INCLUDE 'patron-title.inc' patron = p %]</td>
75 <td>[% p.dateofbirth | $KohaDates %]</td>
76 <td>[% Categories.GetName( p.categorycode ) %] ([% p.categorycode %])</td>
77 <td>[% Branches.GetName( p.branchcode ) %]</td>
78 <td>[% p.dateexpiry | $KohaDates %]</td>
83 [% FOREACH p IN patrons %]
84 <input type="hidden" name="id" value="[% p.id %]" />
89 <input type="hidden" name="action" value="merge" />
90 <input id="merge-patrons" type="submit" value="Merge patrons" />
92 <div class="dialog alert">Error: Two or more patrons need to be selected for merging</div>
95 [% ELSIF action == 'merge' %]
98 <div class="dialog alert">Merge failed! The following error was reported: [% error %].</div>
99 [% ELSIF !results.merged.keys.size %]
100 <div class="dialog alert">No valid patrons to merge were found.</div>
103 Patron records merged into <a href="moremember.pl?borrowernumber=[% keeper.id %]">[% INCLUDE 'patron-title.inc' patron = keeper %]</a>
106 [% FOREACH pair IN results.merged.pairs %]
107 [% SET patron = pair.value.patron %]
109 <h5>[% INCLUDE 'patron-title.inc' %]</h5>
111 [% FOREACH r IN pair.value.updated.pairs %]
112 [% SET name = r.key %]
113 [% SET count = r.value %]
116 <span>[% count %] [% PROCESS display_names rs = name %] transferred.</span>
117 [% IF name == 'Reserve' %]
118 <strong>It is advisable to check for and resolve duplicate holds due to merging.</strong>
126 <a class="btn btn-default btn-sm" href="moremember.pl?borrowernumber=[% keeper.id %]">View patron record</a>
131 [% MACRO jsinclude BLOCK %]
132 [% Asset.js("js/members-menu.js") %]
135 $(document).ready(function() {
136 $('#merge-patrons').prop('disabled', true);
137 $('#patron-merge-table').on('change', 'input', function() {
138 if ( $('.keeper:checked').length > 0 ) {
139 $('#merge-patrons').prop('disabled', false);
141 $('#merge-patrons').prop('disabled', true);
148 [% INCLUDE 'intranet-bottom.inc' %]