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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/merge-patrons.tt (-35 / +40 lines)
Lines 50-98 Link Here
50
            <h3>Merge patron records</h3>
50
            <h3>Merge patron records</h3>
51
51
52
            [% IF action == 'show' %]
52
            [% IF action == 'show' %]
53
                <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>
53
                [% IF patrons.count > 1 %]
54
                <form type="post" action="merge-patrons.pl">
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
                    <table id="patron-merge-table" class="datatable">
55
                    <form type="post" action="merge-patrons.pl">
56
                        <thead>
56
                        <table id="patron-merge-table" class="datatable">
57
                            <tr>
57
                            <thead>
58
                                <th>&nbsp;</th>
59
                                <th>Card</th>
60
                                <th>Name</th>
61
                                <th>Date of birth</th>
62
                                <th>Category</th>
63
                                <th>Library</th>
64
                                <th>Expires on</th>
65
                            </tr>
66
                        </thead>
67
68
                        <tbody>
69
                            [% FOREACH p IN patrons %]
70
                                <tr>
58
                                <tr>
71
                                    <td><input class='keeper' type='radio' name='keeper' value='[% p.id %]' /></td>
59
                                    <th>&nbsp;</th>
72
                                    <td>[% p.cardnumber | html %]</td>
60
                                    <th>Card</th>
73
                                    <td>[% INCLUDE 'patron-title.inc' patron = p %]</td>
61
                                    <th>Name</th>
74
                                    <td>[% p.dateofbirth | $KohaDates %]</td>
62
                                    <th>Date of birth</th>
75
                                    <td>[% Categories.GetName( p.categorycode ) %] ([% p.categorycode %])</td>
63
                                    <th>Category</th>
76
                                    <td>[% Branches.GetName( p.branchcode ) %]</td>
64
                                    <th>Library</th>
77
                                    <td>[% p.dateexpiry | $KohaDates %]</td>
65
                                    <th>Expires on</th>
78
                            [% END %]
66
                                </tr>
79
                        </tbody>
67
                            </thead>
80
                    </table>
68
81
69
                            <tbody>
82
                    [% FOREACH p IN patrons %]
70
                                [% FOREACH p IN patrons %]
83
                        <input type="hidden" name="id" value="[% p.id %]" />
71
                                    <tr>
84
                    [% END %]
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>
79
                                [% END %]
80
                            </tbody>
81
                        </table>
82
83
                        [% FOREACH p IN patrons %]
84
                            <input type="hidden" name="id" value="[% p.id %]" />
85
                        [% END %]
85
86
86
                    <p/>
87
                        <p/>
87
88
88
                    <input type="hidden" name="action" value="merge" />
89
                        <input type="hidden" name="action" value="merge" />
89
                    <input id="merge-patrons" type="submit" value="Merge patrons" />
90
                        <input id="merge-patrons" type="submit" value="Merge patrons" />
91
                    [% ELSE %]
92
                        <div class="dialog alert">Error: Two or more patrons need to be selected for merging</div>
93
                    [% END %]
90
                </form>
94
                </form>
91
            [% ELSIF action == 'merge' %]
95
            [% ELSIF action == 'merge' %]
92
                <h4>Results</h4>
96
                <h4>Results</h4>
93
94
                [% IF error %]
97
                [% IF error %]
95
                    <div class="dialog alert">Merge failed! The following error was reported: [% error %].</div>
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>
96
                [% ELSE %]
101
                [% ELSE %]
97
                    <p>
102
                    <p>
98
                        Patron records merged into <a href="moremember.pl?borrowernumber=[% keeper.id %]">[% INCLUDE 'patron-title.inc' patron = keeper %]</a>
103
                        Patron records merged into <a href="moremember.pl?borrowernumber=[% keeper.id %]">[% INCLUDE 'patron-title.inc' patron = keeper %]</a>
(-)a/t/db_dependent/Koha/Patrons.t (-2 / +1 lines)
Lines 1337-1343 subtest 'Log cardnumber change' => sub { Link Here
1337
$schema->storage->txn_rollback;
1337
$schema->storage->txn_rollback;
1338
1338
1339
subtest 'Test Koha::Patrons::merge' => sub {
1339
subtest 'Test Koha::Patrons::merge' => sub {
1340
    plan tests => 98;
1340
    plan tests => 110;
1341
1341
1342
    my $schema = Koha::Database->new()->schema();
1342
    my $schema = Koha::Database->new()->schema();
1343
1343
1344
- 

Return to bug 9302