Bug 9302: (QA follow-up) Consistency follow-up
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / merge-patrons.tt
blob354ffbf5551cef119fa7fca8da53de1f75073219
1 [% USE Branches %]
2 [% USE Categories %]
3 [% USE KohaDates %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Patrons &rsaquo; Merge patron records</title>
6 [% INCLUDE 'doc-head-close.inc' %]
8 <script type="text/javascript">
9 //<![CDATA[
10 $(document).ready(function() {
11     $('#merge-patrons').prop('disabled', true);
12     $('#patron-merge-table').on('change', 'input', function() {
13         if ( $('.keeper:checked').length > 0 ) {
14             $('#merge-patrons').prop('disabled', false);
15         } else {
16             $('#merge-patrons').prop('disabled', true);
17         }
18     });
19 });
20 //]]>
21 </script>
23 </head>
24 <body id="pat_merge" class="pat">
25 [% INCLUDE 'header.inc' %]
26 [% INCLUDE 'patron-search.inc' %]
28 [% BLOCK display_names %]
29     [% SWITCH rs %]
30         [% CASE 'Accountline'           %]account lines
31         [% CASE 'ArticleRequest'        %]article requests
32         [% CASE 'BorrowerAttribute'     %]extended patron attributes
33         [% CASE 'BorrowerDebarment'     %]patron restrictions
34         [% CASE 'BorrowerFile'          %]patrons files
35         [% CASE 'BorrowerModification'  %]patron modification requests
36         [% CASE 'ClubEnrollment'        %]club enrollments
37         [% CASE 'Issue'                 %]checkouts
38         [% CASE 'ItemsLastBorrower'     %]marks as last borrower of item
39         [% CASE 'Linktracker'           %]tracked link clicks
40         [% CASE 'Message'               %]patron messages
41         [% CASE 'MessageQueue'          %]patron notices
42         [% CASE 'OldIssue'              %]previous checkouts
43         [% CASE 'OldReserve'            %]filled holds
44         [% CASE 'Rating'                %]ratings
45         [% CASE 'Reserve'               %]current holds
46         [% CASE 'Review'                %]reviews
47         [% CASE 'Statistic'             %]statistics
48         [% CASE 'SearchHistory'         %]historical searches
49         [% CASE 'Suggestion'            %]purchase suggestions
50         [% CASE 'TagAll'                %]tags
51         [% CASE 'Virtualshelfcontent'   %]list items
52         [% CASE 'Virtualshelfshare'     %]list shares
53         [% CASE 'Virtualshelve'         %]lists
54         [% CASE %][% rs %]
55     [% END %]
56 [% END %]
58 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> &rsaquo; Merge patron records</div>
60 <div id="doc2" class="yui-t7">
61    <div id="bd">
62         <div id="yui-main">
63             <h3>Merge patron records</h3>
65             [% IF action == 'show' %]
66                 <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>
67                 <form type="post" action="merge-patrons.pl">
68                     <table id="patron-merge-table" class="datatable">
69                         <thead>
70                             <tr>
71                                 <th>&nbsp;</th>
72                                 <th>Card</th>
73                                 <th>Name</th>
74                                 <th>Date of birth</th>
75                                 <th>Category</th>
76                                 <th>Library</th>
77                                 <th>Expires on</th>
78                             </tr>
79                         </thead>
81                         <tbody>
82                             [% FOREACH p IN patrons %]
83                                 <tr>
84                                     <td><input class='keeper' type='radio' name='keeper' value='[% p.id %]' /></td>
85                                     <td>[% p.cardnumber | html %]</td>
86                                     <td>[% p.firstname | html %] [% p.surname | html %]</td>
87                                     <td>[% p.dateofbirth | $KohaDates %]</td>
88                                     <td>[% Categories.GetName( p.categorycode ) %] ([% p.categorycode %])</td>
89                                     <td>[% Branches.GetName( p.branchcode ) %]</td>
90                                     <td>[% p.dateexpiry | $KohaDates %]</td>
91                             [% END %]
92                         </tbody>
93                     </table>
95                     [% FOREACH p IN patrons %]
96                         <input type="hidden" name="id" value="[% p.id %]" />
97                     [% END %]
99                     <p/>
101                     <input type="hidden" name="action" value="merge" />
102                     <input id="merge-patrons" type="submit" value="Merge patrons" />
103                 </form>
104             [% ELSIF action == 'merge' %]
105                 <h4>Results</h4>
107                 [% IF error %]
108                     <div class="dialog alert">Merge failed! The following error was reported: [% error %].</div>
109                 [% ELSE %]
110                     <p>
111                         Patron records merged into <a href="moremember.pl?borrowernumber=[% keeper.id %]">[% keeper.firstname %] [% keeper.surname %] ([% keeper.cardnumber | html %])</a>
112                     </p>
114                     [% FOREACH pair IN results.merged.pairs %]
115                         [% SET patron = pair.value.patron %]
117                         <h5>[% patron.firstname %] [% patron.surname %] ([% patron.cardnumber %])</h5>
119                         [% FOREACH r IN pair.value.updated.pairs %]
120                             [% SET name = r.key %]
121                             [% SET count = r.value %]
122                             [% IF count %]
123                                 <p>
124                                     [% count %] [% PROCESS display_names rs = name %] transferred.
125                                     [% IF name == 'Reserve' %]
126                                         <strong>It is advisable to check for and resolve duplicate holds due to merging.</strong>
127                                     [% END %]
128                                 </p>
129                             [% END %]
130                         [% END %]
131                     [% END %]
132                 [% END %]
133             [% END %]
134         </div>
135     </div>
136 [% INCLUDE 'intranet-bottom.inc' %]