[% USE raw %] [% USE Asset %] [% USE Branches %] [% USE Categories %] [% USE KohaDates %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › Merge patron records [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] [% BLOCK display_names %] [% SWITCH rs %] [% CASE 'Accountline' %]account lines [% CASE 'ArticleRequest' %]article requests [% CASE 'BorrowerAttribute' %]extended patron attributes [% CASE 'BorrowerDebarment' %]patron restrictions [% CASE 'BorrowerFile' %]patrons files [% CASE 'BorrowerModification' %]patron modification requests [% CASE 'ClubEnrollment' %]club enrollments [% CASE 'Issue' %]checkouts [% CASE 'ItemsLastBorrower' %]marks as last borrower of item [% CASE 'Linktracker' %]tracked link clicks [% CASE 'Message' %]patron messages [% CASE 'MessageQueue' %]patron notices [% CASE 'OldIssue' %]previous checkouts [% CASE 'OldReserve' %]filled holds [% CASE 'Rating' %]ratings [% CASE 'Reserve' %]current holds [% CASE 'Review' %]reviews [% CASE 'Statistic' %]statistics [% CASE 'SearchHistory' %]historical searches [% CASE 'Suggestion' %]purchase suggestions [% CASE 'TagAll' %]tags [% CASE 'Virtualshelfcontent' %]list items [% CASE 'Virtualshelfshare' %]list shares [% CASE 'Virtualshelve' %]lists [% CASE %][% rs | html %] [% END %] [% END %]

Merge patron records

[% IF action == 'show' %] [% IF patrons.count > 1 %]

Select patron to keep. Data from the other patrons will be transferred to this patron record and the remaining patron records will be deleted.

[% FOREACH p IN patrons %] [% END %]
  Card Name Date of birth Category Library Expires on
[% INCLUDE 'patron-title.inc' patron = p %] [% p.dateofbirth | $KohaDates %] [% Categories.GetName( p.categorycode ) | html %] ([% p.categorycode | html %]) [% Branches.GetName( p.branchcode ) | html %] [% p.dateexpiry | $KohaDates %]
[% FOREACH p IN patrons %] [% END %]
[% ELSE %]
Error: Two or more patrons need to be selected for merging
[% END %]
[% ELSIF action == 'merge' %]

Results

[% IF error %] [% IF error == 'INVALID_KEEPER' %]
Merge failed! The patron to keep was invalid.
[% ELSE %]
Merge failed! The following error was reported: [% error | html %].
[% END %] [% ELSIF !results.merged.keys.size %]
No valid patrons to merge were found.
[% ELSE %]

Patron records merged into [% INCLUDE 'patron-title.inc' patron = keeper %]

[% FOREACH pair IN results.merged.pairs %] [% SET patron = pair.value.patron %]
[% INCLUDE 'patron-title.inc' %]
[% FOREACH r IN pair.value.updated.pairs %] [% SET name = r.key %] [% SET count = r.value %] [% IF count %]

[% count | html %] [% PROCESS display_names rs = name %] transferred. [% IF name == 'Reserve' %] It is advisable to check for and resolve duplicate holds due to merging. [% END %]

[% END %] [% END %] [% END %] [% END %] [% UNLESS error %] View patron record [% END %] [% END %]
[% MACRO jsinclude BLOCK %] [% INCLUDE 'str/members-menu.inc' %] [% Asset.js("js/members-menu.js") | $raw %] [% END %] [% INCLUDE 'intranet-bottom.inc' %]