Bug 15928 - Show unlinked guarantor
authorNick Clemens <nick@bywatersolutions.com>
Fri, 26 Feb 2016 21:08:55 +0000 (21:08 +0000)
committerFrédéric Demians <f.demians@tamil.fr>
Wed, 27 Apr 2016 14:53:26 +0000 (16:53 +0200)
To test:
1 - Add guarantor data to patron account by typing it in but do not 'Set to patron'
2 - Note it is not displayed on patron details
3 - Apply patch
4 - Note the info is displayed
5 - Test that linked guarantors show as expected

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
(cherry picked from commit bebb61739f4460295151a37d44cc1a2d6f956d26)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
members/moremember.pl

index f8354ee..070a9a9 100644 (file)
@@ -243,6 +243,8 @@ function validate1(date) {
     [% ELSE %]
         [% IF ( guarantorborrowernumber ) %]
             <li><span class="label">Guarantor:</span><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorborrowernumber %]">[% guarantorsurname %][%IF ( guarantorfirstname ) %], [% guarantorfirstname %] [% END %]</a></li>
+        [% ELSIF (guarantorsurname || guarantorfirstname) %]
+            <li><span class="label">Guarantor:</span>[% guarantorsurname %][%IF ( guarantorfirstname ) %], [% guarantorfirstname %][% END %]</li>
         [% END %]
     [% END %]
 </ol>
index 2f2a18e..f3f2ec2 100755 (executable)
@@ -197,6 +197,11 @@ else {
                foreach (qw(borrowernumber cardnumber firstname surname)) {        
                          $template->param("guarantor$_" => $guarantor->{$_});
         }
+    } elsif ($data->{contactname} || $data->{contactfirstname}) {
+        $template->param(
+            guarantorfirstname => $data->{contactfirstname},
+            guarantorsurname => $data->{contactname},
+        );
     }
        if ($category_type eq 'C'){
                $template->param('C' => 1);