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 %]" id="keeper_[% p.id | html %]" /></td>
75 <label for="keeper_[% p.id | html %]">
76 <strong>[% p.cardnumber | html %]</strong>
79 <td>[% INCLUDE 'patron-title.inc' patron = p %]</td>
80 <td>[% p.dateofbirth | $KohaDates %]</td>
81 <td>[% Categories.GetName( p.categorycode ) | html %] ([% p.categorycode | html %])</td>
82 <td>[% Branches.GetName( p.branchcode ) | html %]</td>
83 <td>[% p.dateexpiry | $KohaDates %]</td>
88 <fieldset class="action">
89 [% FOREACH p IN patrons %]
90 <input type="hidden" name="id" value="[% p.id | html %]" />
92 <input type="hidden" name="action" value="merge" />
93 <input id="merge-patrons" type="submit" value="Merge patrons" />
97 <div class="dialog alert">Error: Two or more patrons need to be selected for merging</div>
100 [% ELSIF action == 'merge' %]
103 [% IF error == 'INVALID_KEEPER' %]
104 <div class="dialog alert">Merge failed! The patron to keep was invalid.</div>
106 <div class="dialog alert">Merge failed! The following error was reported: [% error | html %].</div>
108 [% ELSIF !results.merged.keys.size %]
109 <div class="dialog alert">No valid patrons to merge were found.</div>
112 Patron records merged into <a href="moremember.pl?borrowernumber=[% keeper.id | uri %]">[% INCLUDE 'patron-title.inc' patron = keeper %]</a>
115 [% FOREACH pair IN results.merged.pairs %]
116 [% SET patron = pair.value.patron %]
118 <h5>[% INCLUDE 'patron-title.inc' %]</h5>
120 [% FOREACH r IN pair.value.updated.pairs %]
121 [% SET name = r.key %]
122 [% SET count = r.value %]
125 <span>[% count | html %] [% PROCESS display_names rs = name %] transferred.</span>
126 [% IF name == 'Reserve' %]
127 <strong>It is advisable to check for and resolve duplicate holds due to merging.</strong>
136 <a class="btn btn-default" href="moremember.pl?borrowernumber=[% keeper.id | html %]">View patron record</a>
142 [% MACRO jsinclude BLOCK %]
143 [% INCLUDE 'str/members-menu.inc' %]
144 [% Asset.js("js/members-menu.js") | $raw %]
147 $(document).ready(function() {
148 $('#merge-patrons').prop('disabled', true);
149 $('#patron-merge-table').on('change', 'input', function() {
150 if ( $('.keeper:checked').length > 0 ) {
151 $('#merge-patrons').prop('disabled', false);
153 $('#merge-patrons').prop('disabled', true);
160 [% INCLUDE 'intranet-bottom.inc' %]