View | Details | Raw Unified | Return to bug 27607
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/merge-patrons.tt (-4 / +152 lines)
Lines 7-13 Link Here
7
[% INCLUDE 'doc-head-open.inc' %]
7
[% INCLUDE 'doc-head-open.inc' %]
8
<title>Koha &rsaquo; Patrons &rsaquo; Merge patron records</title>
8
<title>Koha &rsaquo; Patrons &rsaquo; Merge patron records</title>
9
[% INCLUDE 'doc-head-close.inc' %]
9
[% INCLUDE 'doc-head-close.inc' %]
10
10
<style>
11
    [% FILTER collapse %]
12
    ins {
13
        background-color: #e6ffe6;
14
    }
15
    del {
16
        background-color: #ffe6e6;
17
    }
18
    #col0 ins,
19
    #col1 del {
20
        display: none;
21
    }
22
    #col-label,
23
    #col0,
24
    #col1 {
25
        border-right: 1px solid #EEE;
26
        flex-grow: 1;
27
        margin-right:1em;
28
    }
29
    #col-label {
30
        font-family: monospace;
31
    }
32
    #col-label div {
33
        white-space: none;
34
    }
35
    .compare {
36
        display: flex;
37
    }
38
    .modal-lg {
39
        width: 90%;
40
    }
41
    [% END %]
42
</style>
11
</head>
43
</head>
12
<body id="pat_merge" class="pat">
44
<body id="pat_merge" class="pat">
13
[% INCLUDE 'header.inc' %]
45
[% INCLUDE 'header.inc' %]
Lines 52-58 Link Here
52
84
53
            [% IF action == 'show' %]
85
            [% IF action == 'show' %]
54
                [% IF patrons.count > 1 %]
86
                [% IF patrons.count > 1 %]
87
                    [% IF ( patrons.count == 2 ) %]
88
                        <div id="toolbar" class="btn-toolbar">
89
                            <div class="btn-group">
90
                                <button class="btn btn-default" id="compare_patrons">
91
                                    Compare patrons
92
                                </button>
93
                            </div>
94
                        </div>
95
                    [% END %]
96
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>
97
                    <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>
98
56
                    <form type="post" action="merge-patrons.pl">
99
                    <form type="post" action="merge-patrons.pl">
57
                        <table id="patron-merge-table" class="datatable">
100
                        <table id="patron-merge-table" class="datatable">
58
                            <thead>
101
                            <thead>
Lines 76-82 Link Here
76
                                                <strong>[% p.cardnumber | html %]</strong>
119
                                                <strong>[% p.cardnumber | html %]</strong>
77
                                            </label>
120
                                            </label>
78
                                        </td>
121
                                        </td>
79
                                        <td>[% INCLUDE 'patron-title.inc' patron = p %]</td>
122
                                        <td>
123
                                            <a target="_blank" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% p.borrowernumber | uri %]">
124
                                                [% INCLUDE 'patron-title.inc' patron = p %]
125
                                                <i class="fa fa-window-restore"></i>
126
                                            </a>
127
                                        </td>
80
                                        <td>[% p.dateofbirth | $KohaDates %]</td>
128
                                        <td>[% p.dateofbirth | $KohaDates %]</td>
81
                                        <td>[% Categories.GetName( p.categorycode ) | html %] ([% p.categorycode | html %])</td>
129
                                        <td>[% Categories.GetName( p.categorycode ) | html %] ([% p.categorycode | html %])</td>
82
                                        <td>[% Branches.GetName( p.branchcode ) | html %]</td>
130
                                        <td>[% Branches.GetName( p.branchcode ) | html %]</td>
Lines 139-148 Link Here
139
        </div>
187
        </div>
140
    </div>
188
    </div>
141
189
190
    <!-- Modal -->
191
    <div class="modal" id="compareModal" tabindex="-1" role="dialog" aria-labelledby="compareModalLabel">
192
        <div class="modal-dialog modal-lg" role="document">
193
            <div class="modal-content">
194
                <div class="modal-header">
195
                    <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
196
                    <h4 class="modal-title" id="compareModalLabel">Compare patrons for merging</h4>
197
                </div>
198
                <div class="modal-body">
199
                    <div class="compare">
200
                        <div id="col-label">
201
                            <div><strong>Name:</strong></div>
202
                            <div><strong>Initials:</strong></div>
203
                            <div><strong>Other name:</strong></div>
204
                            <div><strong>Library:</strong></div>
205
                            <div><strong>Card number:</strong></div>
206
                            <div><strong>Category:</strong></div>
207
                            <br />
208
                            <div><strong>Address line 1:</strong></div>
209
                            <div><strong>Address line 2:</strong></div>
210
                            <div><strong>City:</strong></div>
211
                            <div><strong>Country:</strong></div>
212
                            <div><strong>State:</strong></div>
213
                            <div><strong>Zip code:</strong></div>
214
                            <div><strong>Country:</strong></div>
215
                            <br />
216
                            <div><strong>Registration date:</strong></div>
217
                            <div><strong>Renewal date:</strong></div>
218
                            <div><strong>Expiration date:</strong></div>
219
                            <div><strong>Date of birth:</strong></div>
220
                            <div><strong>Restricted:</strong></div>
221
                            <div><strong>Primary email:</strong></div>
222
                            <div><strong>Secondary email:</strong></div>
223
                            <div><strong>Primary phone:</strong></div>
224
                            <div><strong>Secondary phone:</strong></div>
225
                            <div><strong>Other phone:</strong></div>
226
                            <div><strong>Gender:</strong></div>
227
                            <div><strong>Updated on:</strong></div>
228
                            <div><strong>Username:</strong></div>
229
                        </div>
230
231
                        [% FOREACH p IN patrons %]
232
                            <div id="col[% loop.index | html %]">
233
<!-- <pre> block is unindented to avoid unwanted whitespace -->
234
<pre>
235
[% IF ( p.surname ) %][% p.surname | html %], [% p.firstname | html %][% ELSE %]-[% END %]
236
[% IF ( p.initials ) %][% p.initials | html %][% ELSE %]-[% END %]
237
[% IF ( p.othernames ) %][% p.othernames | html %][% ELSE %]-[% END %]
238
[% IF ( p.branchcode ) %][% p.branchcode | html %][% ELSE %]-[% END %]
239
[% IF ( p.cardnumber ) %][% p.cardnumber | html %][% ELSE %]-[% END %]
240
[% IF ( p.categorycode ) %][% p.categorycode | html %][% ELSE %]-[% END %]
241
242
[% IF ( p.address ) %][% p.address | html %][% ELSE %]-[% END %]
243
[% IF ( p.address2 ) %][% p.address2 | html %][% ELSE %]-[% END %]
244
[% IF ( p.city ) %][% p.city | html %][% ELSE %]-[% END %]
245
[% IF ( p.country ) %][% p.country | html %][% ELSE %]-[% END %]
246
[% IF ( p.state ) %][% p.state | html %][% ELSE %]-[% END %]
247
[% IF ( p.zipcode ) %][% p.zipcode | html %][% ELSE %]-[% END %]
248
[% IF ( p.country ) %][% p.country | html %][% ELSE %]-[% END %]
249
250
[% IF ( p.dateenrolled ) %][% p.dateenrolled | html %][% ELSE %]-[% END %]
251
[% IF ( p.date_renewed ) %][% p.date_renewed | html %][% ELSE %]-[% END %]
252
[% IF ( p.dateexpiry ) %][% p.dateexpiry | html %][% ELSE %]-[% END %]
253
[% IF ( p.dateofbirth ) %][% p.dateofbirth | html %][% ELSE %]-[% END %]
254
[% IF ( p.debarred ) %][% p.debarred | html %][% ELSE %]-[% END %]
255
[% IF ( p.email ) %][% p.email | html %][% ELSE %]-[% END %]
256
[% IF ( p.emailpro ) %][% p.emailpro | html %][% ELSE %]-[% END %]
257
[% IF ( p.phone ) %][% p.phone | html %][% ELSE %]-[% END %]
258
[% IF ( p.phonepro ) %][% p.phonepro | html %][% ELSE %]-[% END %]
259
[% IF ( p.mobile ) %][% p.mobile | html %][% ELSE %]-[% END %]
260
[% IF ( p.sex ) %][% p.sex | html %][% ELSE %]-[% END %]
261
[% IF ( p.updated_on ) %][% p.updated_on | html %][% ELSE %]-[% END %]
262
[% IF ( p.userid ) %][% p.userid | html %][% ELSE %]-[% END %]
263
</pre>
264
                            </div>
265
                        [% END %]
266
                    </div>
267
                </div>
268
                <div class="modal-footer">
269
                    <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-remove" aria-hidden="true"></i> Close</button>
270
                </div>
271
            </div> <!-- /.modal-content -->
272
        </div> <!-- /.modal-dialog -->
273
    </div> <!-- /#compareModal -->
274
142
[% MACRO jsinclude BLOCK %]
275
[% MACRO jsinclude BLOCK %]
143
    [% INCLUDE 'str/members-menu.inc' %]
276
    [% INCLUDE 'str/members-menu.inc' %]
144
    [% Asset.js("js/members-menu.js") | $raw %]
277
    [% Asset.js("js/members-menu.js") | $raw %]
145
278
    [% Asset.js("lib/jsdiff/jsdiff.min.js") | $raw %]
146
    <script>
279
    <script>
147
    $(document).ready(function() {
280
    $(document).ready(function() {
148
        $('#merge-patrons').prop('disabled', true);
281
        $('#merge-patrons').prop('disabled', true);
Lines 153-159 Link Here
153
                $('#merge-patrons').prop('disabled', true);
286
                $('#merge-patrons').prop('disabled', true);
154
            }
287
            }
155
        });
288
        });
289
        $("#compare_patrons").on("click", function(e){
290
            e.preventDefault();
291
            $("#compareModal").modal("show");
292
        });
293
        $("#compareModal").on("shown.bs.modal", function(){
294
            if( $(this).hasClass("shown") ){
295
                // modal has already displayed, don't re-run diff
296
            } else {
297
                $(this).addClass("shown");
298
                var diff1 = $("#col0 pre").text();
299
                var diff2 = $("#col1 pre").text();
300
                var diffs = diffString(diff1,diff2);
301
                $("#col0 pre,#col1 pre").html(diffs);
302
            }
303
        });
156
    });
304
    });
305
157
    </script>
306
    </script>
158
[% END %]
307
[% END %]
159
308
160
- 

Return to bug 27607