Bugzilla – Attachment 74585 Details for
Bug 9302
Add ability to merge patron records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9302: Add error messages, correct number of unit tests in subtest 'Test Koha::Patrons::merge'
Bug-9302-Add-error-messages-correct-number-of-unit.patch (text/plain), 6.13 KB, created by
Kyle M Hall (khall)
on 2018-04-19 19:02:58 UTC
(
hide
)
Description:
Bug 9302: Add error messages, correct number of unit tests in subtest 'Test Koha::Patrons::merge'
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-04-19 19:02:58 UTC
Size:
6.13 KB
patch
obsolete
>From 5bdd9ab050ddb2b4e5d4b23fb60dd2813f8c0160 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatetsolutions.com> >Date: Thu, 19 Apr 2018 15:02:31 -0400 >Subject: [PATCH] Bug 9302: Add error messages, correct number of unit tests in > subtest 'Test Koha::Patrons::merge' > >--- > .../prog/en/modules/members/merge-patrons.tt | 75 ++++++++++++---------- > t/db_dependent/Koha/Patrons.t | 2 +- > 2 files changed, 41 insertions(+), 36 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/merge-patrons.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/merge-patrons.tt >index f016436479..a8cd953978 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/merge-patrons.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/merge-patrons.tt >@@ -50,49 +50,54 @@ > <h3>Merge patron records</h3> > > [% IF action == 'show' %] >- <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> >- <form type="post" action="merge-patrons.pl"> >- <table id="patron-merge-table" class="datatable"> >- <thead> >- <tr> >- <th> </th> >- <th>Card</th> >- <th>Name</th> >- <th>Date of birth</th> >- <th>Category</th> >- <th>Library</th> >- <th>Expires on</th> >- </tr> >- </thead> >- >- <tbody> >- [% FOREACH p IN patrons %] >+ [% IF patrons.count > 1 %] >+ <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> >+ <form type="post" action="merge-patrons.pl"> >+ <table id="patron-merge-table" class="datatable"> >+ <thead> > <tr> >- <td><input class='keeper' type='radio' name='keeper' value='[% p.id %]' /></td> >- <td>[% p.cardnumber | html %]</td> >- <td>[% INCLUDE 'patron-title.inc' patron = p %]</td> >- <td>[% p.dateofbirth | $KohaDates %]</td> >- <td>[% Categories.GetName( p.categorycode ) %] ([% p.categorycode %])</td> >- <td>[% Branches.GetName( p.branchcode ) %]</td> >- <td>[% p.dateexpiry | $KohaDates %]</td> >- [% END %] >- </tbody> >- </table> >- >- [% FOREACH p IN patrons %] >- <input type="hidden" name="id" value="[% p.id %]" /> >- [% END %] >+ <th> </th> >+ <th>Card</th> >+ <th>Name</th> >+ <th>Date of birth</th> >+ <th>Category</th> >+ <th>Library</th> >+ <th>Expires on</th> >+ </tr> >+ </thead> >+ >+ <tbody> >+ [% FOREACH p IN patrons %] >+ <tr> >+ <td><input class='keeper' type='radio' name='keeper' value='[% p.id %]' /></td> >+ <td>[% p.cardnumber | html %]</td> >+ <td>[% INCLUDE 'patron-title.inc' patron = p %]</td> >+ <td>[% p.dateofbirth | $KohaDates %]</td> >+ <td>[% Categories.GetName( p.categorycode ) %] ([% p.categorycode %])</td> >+ <td>[% Branches.GetName( p.branchcode ) %]</td> >+ <td>[% p.dateexpiry | $KohaDates %]</td> >+ [% END %] >+ </tbody> >+ </table> >+ >+ [% FOREACH p IN patrons %] >+ <input type="hidden" name="id" value="[% p.id %]" /> >+ [% END %] > >- <p/> >+ <p/> > >- <input type="hidden" name="action" value="merge" /> >- <input id="merge-patrons" type="submit" value="Merge patrons" /> >+ <input type="hidden" name="action" value="merge" /> >+ <input id="merge-patrons" type="submit" value="Merge patrons" /> >+ [% ELSE %] >+ <div class="dialog alert">Error: Two or more patrons need to be selected for merging</div> >+ [% END %] > </form> > [% ELSIF action == 'merge' %] > <h4>Results</h4> >- > [% IF error %] > <div class="dialog alert">Merge failed! The following error was reported: [% error %].</div> >+ [% ELSIF !results.merged.keys.size %] >+ <div class="dialog alert">No valid patrons to merge were found.</div> > [% ELSE %] > <p> > Patron records merged into <a href="moremember.pl?borrowernumber=[% keeper.id %]">[% INCLUDE 'patron-title.inc' patron = keeper %]</a> >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index 8eb80e6f7e..04352c9de3 100644 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -1337,7 +1337,7 @@ subtest 'Log cardnumber change' => sub { > $schema->storage->txn_rollback; > > subtest 'Test Koha::Patrons::merge' => sub { >- plan tests => 98; >+ plan tests => 110; > > my $schema = Koha::Database->new()->schema(); > >-- >2.15.1 (Apple Git-101)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9302
:
66615
|
66617
|
68606
|
70474
|
70477
|
70478
|
70479
|
70482
|
70483
|
72082
|
72083
|
73645
|
73646
|
73647
|
73648
|
73649
|
73660
|
73661
|
73662
|
73663
|
73664
|
73668
|
73679
|
74439
|
74440
|
74441
|
74442
|
74443
|
74444
|
74445
|
74446
|
74447
|
74448
|
74449
|
74450
|
74451
| 74585 |
74653