Bugzilla – Attachment 140913 Details for
Bug 31084
Display item type in bundle management table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31084: Expand itemtype
Bug-31084-Expand-itemtype.patch (text/plain), 3.24 KB, created by
Martin Renvoize (ashimema)
on 2022-09-23 13:50:58 UTC
(
hide
)
Description:
Bug 31084: Expand itemtype
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-09-23 13:50:58 UTC
Size:
3.24 KB
patch
obsolete
>From a7836e79403594027648884691043e417ea9e7d9 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 27 Jun 2022 14:32:49 +0100 >Subject: [PATCH] Bug 31084: Expand itemtype > >WIP.. Also need to reverse bug 28854 remove fields patch to bring the >column back >--- > .../prog/en/includes/js-itemtype-format.inc | 57 +++++++++++++++++++ > 1 file changed, 57 insertions(+) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/js-itemtype-format.inc > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js-itemtype-format.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js-itemtype-format.inc >new file mode 100644 >index 0000000000..393632406b >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js-itemtype-format.inc >@@ -0,0 +1,57 @@ >+<script> >+ (function() { >+ /** >+ * Format the biblio response from a Koha RESTful API request. >+ * @param {Object} biblio The biblio json object as returned from the Koha RESTful API >+ * @param {Object} config A configuration object >+ * Valid keys are: `link` >+ * @return {string} The formatted HTML string >+ */ >+ window.$itemtype_to_html = function( itemtype, config ) { >+ >+ if ( itemtype === undefined ) { >+ return ''; // empty string for no itemtype >+ } >+ >+ // Fetch list of itemtypes >+ var itemtypes = $.ajax({ >+ url: '/api/v1/itemtypes', >+ dataType: 'json', >+ type: 'GET' >+ }); >+ >+ var title = '<span class="itemtype-title">'; >+ if ( itemtype.title != null && itemtype.title != '' ) { >+ title += escape_str(itemtype.title); >+ } else { >+ title += __("No title"); >+ } >+ title += '</span>'; >+ >+ if ( itemtype.subtitle != null && itemtype.subtitle != '' ) { >+ title += '<span clas="itemtype-subtitle">' + escape_str(itemtype.subtitle) + '</span>'; >+ } >+ >+ if (config && config.link) { >+ if ( config.link === 'marcdetail' ) { >+ title = '<a href="/cgi-bin/koha/catalogue/MARCdetail.pl?itemtypenumber='+ encodeURIComponent(itemtype.itemtype_id) +'">' + title + '</a>'; >+ } >+ else if ( config.link === 'labeled_marc') { >+ title = '<a href="/cgi-bin/koha/catalogue/labeledMARCdetail.pl?itemtypenumber='+ encodeURIComponent(itemtype.itemtype_id) +'">' + title + '</a>'; >+ } >+ else if ( config.link === 'isbd' ) { >+ title = '<a href="/cgi-bin/koha/catalogue/ISBDdetail.pl?itemtypenumber='+ encodeURIComponent(itemtype.itemtype_id) +'">' + title + '</a>'; >+ } >+ else { >+ title = '<a href="/cgi-bin/koha/catalogue/detail.pl?itemtypenumber='+ encodeURIComponent(itemtype.itemtype_id) +'">' + title + '</a>'; >+ } >+ } >+ >+ if ( itemtype.medium != null && itemtype.medium != '' ) { >+ title += '<span class="itemtype-medium">'+escape_str(itemtype.medium)+'</span>'; >+ } >+ >+ return title; >+ }; >+ })(); >+</script> >-- >2.20.1
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 31084
:
140912
| 140913