Bug 20921: Add borrowernumber and branchcode as html attributes
authorNick Clemens <nick@bywatersolutions.com>
Tue, 12 Jun 2018 15:57:56 +0000 (15:57 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 29 Jun 2018 20:43:42 +0000 (20:43 +0000)
To test:
1 - Apply patch
2 - Visit the opac
3 - Sign in
4 - You should not see any difference
5 - Inspect the element  'Welcome, {username}'
6 - Note the attributes for borrowernumber and branchcode
7 - Add to OPACUserJS:
$(document).ready(function(){
    console.log( $(".loggedinusername").attr('data-branchcode'));
    console.log( $(".loggedinusername").attr('data-borrowernumber'));
});
8 - Check the console and note you can see the info expected

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc

index 0984563..3ace3a4 100644 (file)
                                         [% END %]
                                     [% END %]
                                     [% IF ( loggedinusername ) %]
-                                        <li><p class="members navbar-text">Welcome, <a class="login-link" href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</span></a></p></li>
+                                        <li><p class="members navbar-text">Welcome, <a class="login-link" href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername" data-borrowernumber="[% USER_INFO.borrowernumber %]" data-branchcode="[% USER_INFO.branchcode %]" >[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</span></a></p></li>
                                         <li class="divider-vertical"></li>
                                     [% END %]
                                 [% END %]