Bugzilla – Attachment 127894 Details for
Bug 29275
Use the API to render checkout history for a biblio
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29275: Add $patron_to_html to render patron information in JS
Bug-29275-Add-patrontohtml-to-render-patron-inform.patch (text/plain), 2.44 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-11-19 18:39:54 UTC
(
hide
)
Description:
Bug 29275: Add $patron_to_html to render patron information in JS
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-11-19 18:39:54 UTC
Size:
2.44 KB
patch
obsolete
>From 91a663cd08d2d4a44f01c193791b7415957b0717 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 20 Oct 2021 18:16:37 -0300 >Subject: [PATCH] Bug 29275: Add $patron_to_html to render patron information > in JS > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > .../prog/en/includes/js-patron-format.inc | 46 +++++++++++++++++++ > 1 file changed, 46 insertions(+) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc >new file mode 100644 >index 0000000000..c81d37338f >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc >@@ -0,0 +1,46 @@ >+<!-- js-patron-title.inc --> >+<script> >+ (function() { >+ window.$patron_to_html = function( patron, config ) { >+ >+ if ( patron === undefined ) { >+ return ''; // empty string for no patron >+ } >+ >+ var title = null; >+ if ( patron.title != null ) { >+ title = '<span class="patron-title">' + escape_str(patron.title) + '</span>'; >+ } >+ >+ var name; >+ var firstname = escape_str(patron.firstname); >+ var surname = escape_str(patron.surname); >+ >+ if ( patron.other_name != null ) { >+ firstname += ' (' + escape_str(patron.other_name) + ')'; >+ } >+ if ( config && config.invert_name ) { >+ name = surname + ', ' + firstname; >+ } >+ else { >+ name = firstname + ' ' + surname; >+ } >+ >+ if ( config && config.display_cardnumber ) { >+ name = name + ' (' + escape_str(patron.cardnumber) + ')'; >+ } >+ >+ if (config && config.url) { >+ if ( config.url === 'circulation_reserves' ) { >+ name = '<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber='+ encodeURIComponent(patron.patron_id) +'#reserves">' + name + '</a>'; >+ } >+ else { >+ name = '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber='+ encodeURIComponent(patron.patron_id) +'">' + name + '</a>'; >+ } >+ } >+ >+ return name; >+ }; >+ })(); >+</script> >+<!-- / js-patron-title.inc --> >-- >2.34.0
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 29275
:
126626
|
126627
|
126628
|
126634
|
126635
|
126636
|
127701
|
127702
|
127703
|
127704
|
127894
|
127895
|
127896
|
127897
|
128001
|
128002
|
128003
|
131333
|
131334
|
131335