Bugzilla – Attachment 180068 Details for
Bug 38340
Translatability - Standard form include files are not translatable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38340: (follow-up) Refactor and tidy template files
Bug-38340-follow-up-Refactor-and-tidy-template-fil.patch (text/plain), 28.23 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-03-31 14:46:54 UTC
(
hide
)
Description:
Bug 38340: (follow-up) Refactor and tidy template files
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-03-31 14:46:54 UTC
Size:
28.23 KB
patch
obsolete
>From 8d88430a5fa586cc5d3d60659208d80df7067872 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 20 Feb 2025 09:28:28 -0300 >Subject: [PATCH] Bug 38340: (follow-up) Refactor and tidy template files > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> >--- > .../includes/ill/backends/Standard/create.inc | 404 +++++++++--------- > .../ill/backends/Standard/edititem.inc | 1 + > .../ill/backends/Standard/inc/shared.js | 60 +-- > .../ill/backends/Standard/migrate.inc | 1 + > .../includes/ill/backends/Standard/create.inc | 1 + > .../ill/backends/Standard/inc/shared.js | 60 +-- > 6 files changed, 265 insertions(+), 262 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/create.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/create.inc >index 29e137b3bf0..e06db297665 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/create.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/create.inc >@@ -1,215 +1,207 @@ > [% SET koha_version = Koha.Version %] > [% PROCESS "ill/backends/Standard/inc/form_input_helpers.inc" %] > [% IF whole.error %] >-[% IF whole.status == 'missing_identifier' %] >-<p><em>Please note:</em> Mandatory field Identifier is missing.</p> >-[% ELSIF whole.status == 'missing_branch' %] >-<p><em>Please note:</em> Library is a mandatory field.</p> >-[% ELSIF whole.status == 'invalid_borrower' %] >-<p><em>Please note:</em> The patron details you entered are invalid.</p> >-[% ELSIF whole.status == 'invalid_branch' %] >-<p><em>Please note:</em> The library you chose is invalid.</p> >-[% ELSE %] >-<p>Unhandled error</p> >-[% END %] >+ [% IF whole.status == 'missing_identifier' %] >+ <p><em>Please note:</em> Mandatory field Identifier is missing.</p> >+ [% ELSIF whole.status == 'missing_branch' %] >+ <p><em>Please note:</em> Library is a mandatory field.</p> >+ [% ELSIF whole.status == 'invalid_borrower' %] >+ <p><em>Please note:</em> The patron details you entered are invalid.</p> >+ [% ELSIF whole.status == 'invalid_branch' %] >+ <p><em>Please note:</em> The library you chose is invalid.</p> >+ [% ELSE %] >+ <p>Unhandled error</p> >+ [% END %] > [% END %] > > [% IF whole.stage == "form" %] >-<h2>Create a manual ILL request</h2> >-<form id="create_form" method="POST" action=""> >- [% INCLUDE 'csrf-token.inc' %] >- <fieldset class="rows"> >- <legend>General details</legend> >- <ol id="general-standard-fields"> >- <li> >- <label class="required" for="type">Type:</label> >- <select name="type" id="type"> >- <option value=""/> >- [% IF whole.value.other.type.lower == "book" %] >- <option value="book" selected="selected">Book</option> >- [% ELSE %] >- <option value="book">Book</option> >- [% END %] >- [% IF whole.value.other.type.lower == "chapter" %] >- <option value="chapter" selected="selected">Chapter</option> >- [% ELSE %] >- <option value="chapter">Chapter</option> >- [% END %] >- [% IF whole.value.other.type.lower == "journal" %] >- <option value="journal" selected="selected">Journal</option> >- [% ELSE %] >- <option value="journal">Journal</option> >- [% END %] >- [% IF whole.value.other.type.lower == "article" %] >- <option value="article" selected="selected">Journal article</option> >- [% ELSE %] >- <option value="article">Journal article</option> >- [% END %] >- [% IF whole.value.other.type.lower == "thesis" %] >- <option value="thesis" selected="selected">Thesis</option> >- [% ELSE %] >- <option value="thesis">Thesis</option> >- [% END %] >- [% IF whole.value.other.type.lower == "conference" %] >- <option value="conference" selected="selected">Conference</option> >- [% ELSE %] >- <option value="conference">Conference</option> >- [% END %] >- [% IF whole.value.other.type.lower == "dvd" %] >- <option value="dvd" selected="selected">DVD</option> >- [% ELSE %] >- <option value="dvd">DVD</option> >- [% END %] >- [% IF whole.value.other.type.lower == "other" %] >- <option value="other" selected="selected">Other</option> >- [% ELSE %] >- <option value="other">Other</option> >- [% END %] >- [% IF whole.value.other.type.lower == "resource" %] >- <option value="resource" selected="selected">Generic resource</option> >- [% ELSE %] >- <option value="resource">Generic resource</option> >- [% END %] >- </select> >- </li> >- </ol> >- </fieldset> >- [% type = whole.value.other.type %] >- [% IF type %] >- [% INCLUDE "ill/backends/Standard/inc/forms/${type}.inc" %] >- [% END %] >- [% INCLUDE "ill/backends/Standard/inc/custom_fields.inc" %] >- <fieldset class="rows"> >- <legend>Patron options</legend> >- <ol> >- <li> >- <label class="required" for="cardnumber"> >- Card number, username or surname: >- </label> >- <input type="text" name="cardnumber" id="cardnumber" autocomplete="off" type="text" value="[% whole.value.other.cardnumber | html %]" /> >- <span class="required">Required</span> >- </li> >- <li> >- <label class="required" for="branchcode">Destination library:</label> >- <select id="branchcode" name="branchcode"> >- <option value="" /> >- [% FOREACH branch IN branches %] >- [% IF branch.branchcode == whole.value.other.branchcode %] >- <option value="[% branch.branchcode | html %]" selected="selected"> >- [% ELSE %] >- <option value="[% branch.branchcode | html %]"> >- [% END %] >- [% branch.branchname | html %] >- </option> >- [% END %] >- </select> >- <span class="required">Required</span> >- </li> >- </ol> >- </fieldset> >- <fieldset class="action"> >- <input id="ill-submit" class="btn btn-primary" type="submit" value="Create" disabled /> >- <a class="cancel" href="/cgi-bin/koha/ill/ill-requests.pl">Cancel</a> >- </fieldset> >- <input type="hidden" name="method" value="create" /> >- <input type="hidden" name="stage" value="form" /> >- <input type="hidden" name="backend" value="Standard" /> >-</form> >-[% BLOCK backend_jsinclude %] >-<script> >- // <![CDATA[] >- [% INCLUDE "ill/backends/Standard/inc/shared.js" %] >- // Require a username and branch selection >- document.addEventListener('DOMContentLoaded', function(){ >- let cardnumber_input = '#create_form #cardnumber'; >- let branchcode_input = '#create_form #branchcode'; >- updateCreateButtonStatus(); >- $(cardnumber_input + ',' + branchcode_input).change(function() { >- updateCreateButtonStatus(); >- }); >- function updateCreateButtonStatus(){ >- var comp = [cardnumber_input,branchcode_input].filter(function(id) { >- return $(id).val().length > 0; >- }); >- $('#ill-submit').attr('disabled', comp.length < 2); >- } >- /* Maintain patron autocomplete compatibility across versions */ >- [% IF koha_version.major <= 22 && koha_version.minor < 11 %] >- $('#create_form #cardnumber').autocomplete({ >- source: "/cgi-bin/koha/circ/ysearch.pl", >- minLength: 3, >- select: function( event, ui ) { >- var field = ui.item.cardnumber; >- $('#create_form #cardnumber').val(field) >- return false; >- } >- }) >- .data( "ui-autocomplete" )._renderItem = function( ul, item ) { >- return $( "<li></li>" ) >- .data( "ui-autocomplete-item", item ) >- .append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" ) >- .appendTo( ul ); >- }; >- [% ELSE %] >- patron_autocomplete( >- $('#create_form #cardnumber'), >- { >- 'on-select-callback': function( event, ui ) { >- $("#create_form #cardnumber").val( ui.item.cardnumber ); >- return false; >- } >- } >- ); >- [% END %] >- }); >- // ]]> >-</script> >-[% END %] >- >-[% ELSIF whole.stage == "borrowers" %] >-<!-- We need to clarify the borrower that has been requested. --> >-<h2>Borrower selection</h2> >-<form method="POST" action=""> >- [% FOREACH prop IN whole.value.other.keys %] >- [% IF prop != 'custom_key' && prop != 'custom_value' && prop != 'cardnumber' %] >- <input type="hidden" name="[% prop | html %]" value="[% whole.value.other.$prop | html %]"> >+ <h2>Create a manual ILL request</h2> >+ <form id="create_form" method="POST" action=""> >+ [% INCLUDE 'csrf-token.inc' %] >+ <fieldset class="rows"> >+ <legend>General details</legend> >+ <ol id="general-standard-fields"> >+ <li> >+ <label class="required" for="type">Type:</label> >+ <select name="type" id="type"> >+ <option value="" /> >+ [% IF whole.value.other.type.lower == "book" %] >+ <option value="book" selected="selected">Book</option> >+ [% ELSE %] >+ <option value="book">Book</option> >+ [% END %] >+ [% IF whole.value.other.type.lower == "chapter" %] >+ <option value="chapter" selected="selected">Chapter</option> >+ [% ELSE %] >+ <option value="chapter">Chapter</option> >+ [% END %] >+ [% IF whole.value.other.type.lower == "journal" %] >+ <option value="journal" selected="selected">Journal</option> >+ [% ELSE %] >+ <option value="journal">Journal</option> >+ [% END %] >+ [% IF whole.value.other.type.lower == "article" %] >+ <option value="article" selected="selected">Journal article</option> >+ [% ELSE %] >+ <option value="article">Journal article</option> >+ [% END %] >+ [% IF whole.value.other.type.lower == "thesis" %] >+ <option value="thesis" selected="selected">Thesis</option> >+ [% ELSE %] >+ <option value="thesis">Thesis</option> >+ [% END %] >+ [% IF whole.value.other.type.lower == "conference" %] >+ <option value="conference" selected="selected">Conference</option> >+ [% ELSE %] >+ <option value="conference">Conference</option> >+ [% END %] >+ [% IF whole.value.other.type.lower == "dvd" %] >+ <option value="dvd" selected="selected">DVD</option> >+ [% ELSE %] >+ <option value="dvd">DVD</option> >+ [% END %] >+ [% IF whole.value.other.type.lower == "other" %] >+ <option value="other" selected="selected">Other</option> >+ [% ELSE %] >+ <option value="other">Other</option> >+ [% END %] >+ [% IF whole.value.other.type.lower == "resource" %] >+ <option value="resource" selected="selected">Generic resource</option> >+ [% ELSE %] >+ <option value="resource">Generic resource</option> >+ [% END %] >+ </select> >+ </li> >+ </ol> >+ </fieldset> >+ [% type = whole.value.other.type %] >+ [% IF type %] >+ [% INCLUDE "ill/backends/Standard/inc/forms/${type}.inc" %] >+ [% END %] >+ [% INCLUDE "ill/backends/Standard/inc/custom_fields.inc" %] >+ <fieldset class="rows"> >+ <legend>Patron options</legend> >+ <ol> >+ <li> >+ <label class="required" for="cardnumber"> Card number, username or surname: </label> >+ <input type="text" name="cardnumber" id="cardnumber" autocomplete="off" type="text" value="[% whole.value.other.cardnumber | html %]" /> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <label class="required" for="branchcode">Destination library:</label> >+ <select id="branchcode" name="branchcode"> >+ <option value="" /> >+ [% FOREACH branch IN branches %] >+ [% IF branch.branchcode == whole.value.other.branchcode %] >+ <option value="[% branch.branchcode | html %]" selected="selected">[% branch.branchname | html %]</option> >+ [% ELSE %] >+ <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ <span class="required">Required</span> >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset class="action"> >+ <input id="ill-submit" class="btn btn-primary" type="submit" value="Create" disabled /> >+ <a class="cancel" href="/cgi-bin/koha/ill/ill-requests.pl">Cancel</a> >+ </fieldset> >+ <input type="hidden" name="method" value="create" /> >+ <input type="hidden" name="stage" value="form" /> >+ <input type="hidden" name="backend" value="Standard" /> >+ </form> >+ [% BLOCK backend_jsinclude %] >+ <script> >+ // <![CDATA[] >+ var core = [ [% whole.core | $raw %] ]; >+ [% INCLUDE "ill/backends/Standard/inc/shared.js" %] >+ // Require a username and branch selection >+ document.addEventListener('DOMContentLoaded', function(){ >+ let cardnumber_input = '#create_form #cardnumber'; >+ let branchcode_input = '#create_form #branchcode'; >+ updateCreateButtonStatus(); >+ $(cardnumber_input + ',' + branchcode_input).change(function() { >+ updateCreateButtonStatus(); >+ }); >+ function updateCreateButtonStatus(){ >+ var comp = [cardnumber_input,branchcode_input].filter(function(id) { >+ return $(id).val().length > 0; >+ }); >+ $('#ill-submit').attr('disabled', comp.length < 2); >+ } >+ /* Maintain patron autocomplete compatibility across versions */ >+ [% IF koha_version.major <= 22 && koha_version.minor < 11 %] >+ $('#create_form #cardnumber').autocomplete({ >+ source: "/cgi-bin/koha/circ/ysearch.pl", >+ minLength: 3, >+ select: function( event, ui ) { >+ var field = ui.item.cardnumber; >+ $('#create_form #cardnumber').val(field) >+ return false; >+ } >+ }) >+ .data( "ui-autocomplete" )._renderItem = function( ul, item ) { >+ return $( "<li></li>" ) >+ .data( "ui-autocomplete-item", item ) >+ .append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" ) >+ .appendTo( ul ); >+ }; >+ [% ELSE %] >+ patron_autocomplete( >+ $('#create_form #cardnumber'), >+ { >+ 'on-select-callback': function( event, ui ) { >+ $("#create_form #cardnumber").val( ui.item.cardnumber ); >+ return false; >+ } >+ } >+ ); >+ [% END %] >+ }); >+ // ]]> >+ </script> > [% END %] >- [% END %] >- [% keys = whole.value.other.custom_key.split('\0') %] >- [% values = whole.value.other.custom_value.split('\0') %] >- [% i = 0 %] >- [% FOREACH key IN keys %] >- <input type="hidden" name="custom_key" value="[% key | html %]"> >- <input type="hidden" name="custom_value" value="[% values.$i | html %]"> >- [% i = i + 1 %] >- [% END %] >- <fieldset class="rows"> >- <legend>Available borrowers for surname [% surname | html %]</legend> >- [% FOREACH opt IN whole.value %] >- [% IF opt.key == "brw" %] >- <ol> >- <li> >- <label class="required" for="brw">Borrower</label> >- <select name="cardnumber" id="cardnumber"> >- <option value=""></option> >- [% FOREACH brw IN opt.value %] >- <option value="[% brw.cardnumber | html %]"> >- [% brw.firstname | html %] [% brw.surname | html %] ([% brw.cardnumber | html %]) >- </option> >- [% END %] >- </select> >- </li> >- </ol> >- [% END %] >- [% END %] >- </fieldset> >- <fieldset class="action"> >- <input type="submit" value="Select"/> >- <a class="cancel" href=[% parent | url %]>Cancel</a> >- </fieldset> >-</form> >- >+[% ELSIF whole.stage == "borrowers" %] >+ <!-- We need to clarify the borrower that has been requested. --> >+ <h2>Borrower selection</h2> >+ <form method="POST" action=""> >+ [% FOREACH prop IN whole.value.other.keys %] >+ [% IF prop != 'custom_key' && prop != 'custom_value' && prop != 'cardnumber' %] >+ <input type="hidden" name="[% prop | html %]" value="[% whole.value.other.$prop | html %]" /> >+ [% END %] >+ [% END %] >+ [% keys = whole.value.other.custom_key.split('\0') %] >+ [% values = whole.value.other.custom_value.split('\0') %] >+ [% i = 0 %] >+ [% FOREACH key IN keys %] >+ <input type="hidden" name="custom_key" value="[% key | html %]" /> >+ <input type="hidden" name="custom_value" value="[% values.$i | html %]" /> >+ [% i = i + 1 %] >+ [% END %] >+ <fieldset class="rows"> >+ <legend>Available borrowers for surname [% surname | html %]</legend> >+ [% FOREACH opt IN whole.value %] >+ [% IF opt.key == "brw" %] >+ <ol> >+ <li> >+ <label class="required" for="brw">Borrower</label> >+ <select name="cardnumber" id="cardnumber"> >+ <option value=""></option> >+ [% FOREACH brw IN opt.value %] >+ <option value="[% brw.cardnumber | html %]"> [% brw.firstname | html %] [% brw.surname | html %] ([% brw.cardnumber | html %]) </option> >+ [% END %] >+ </select> >+ </li> >+ </ol> >+ [% END %] >+ [% END %] >+ </fieldset> >+ <fieldset class="action"> >+ <input type="submit" value="Select" /> >+ <a class="cancel" href="[% parent | url %]">Cancel</a> >+ </fieldset> >+ </form> > [% ELSE %] >-<p>Unknown stage. This should not have happened. >- >+ <p>Unknown stage. This should not have happened. </p> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/edititem.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/edititem.inc >index fe67493c359..f3b9d5fdff2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/edititem.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/edititem.inc >@@ -84,6 +84,7 @@ > [% BLOCK backend_jsinclude %] > <script> > // <![CDATA[] >+ var core = [ [% whole.core %] ]; > [% INCLUDE "ill/backends/Standard/inc/shared.js" %] > // ]]> > </script> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/shared.js b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/shared.js >index c65fcdab401..61f188abe96 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/shared.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/shared.js >@@ -1,44 +1,48 @@ >-var core = [ [% whole.core %] ]; >-var opac = [% opac || 0 %]; >-document.addEventListener('DOMContentLoaded', function() { >- $('#add-new-fields').click(function(e) { >+document.addEventListener("DOMContentLoaded", function () { >+ $("#add-new-fields").click(function (e) { > e.preventDefault(); >- var row = '<li class="form-horizontal">' + >+ var row = >+ '<li class="form-horizontal">' + > '<input type="text" class="custom-name ' + >- ( opac ? 'form-control input-fluid custom-field-input' : '') + >- '" name="custom_key" placeholder="'+__('key')+'">' + >- ' ' + >+ "" + >+ '" name="custom_key" placeholder="' + >+ __("key") + >+ '">' + >+ " " + > '<input type="text" id="custom-value" name="custom_value" class="' + >- ( opac ? 'form-control input-fluid custom-field-input' : '') +'" placeholder="'+__('value')+'"> ' + >+ "" + >+ '" placeholder="' + >+ __("value") + >+ '"> ' + > '<button type="button" class="btn btn-danger btn-sm ' + > 'delete-new-field">' + > '<span class="fa fa-trash-can"></span> ' + >- __('Delete') + >- '</button></li>'; >- $('#standard-fields').append(row); >+ __("Delete") + >+ "</button></li>"; >+ $("#standard-fields").append(row); > }); >- $('#standard-fields').on('click', '.delete-new-field', >- function(event) { >- event.preventDefault(); >- $(event.target).parent().remove(); >- } >- ); >- $('#type').change(function() { >- $('#create_form').prepend( >+ $("#standard-fields").on("click", ".delete-new-field", function (event) { >+ event.preventDefault(); >+ $(event.target).parent().remove(); >+ }); >+ $("#type").change(function () { >+ $("#create_form").prepend( > '<input type="hidden" name="change_type" value="1" />' > ); >- $('#create_form').submit(); >+ $("#create_form").submit(); > }); >- $('#standard-fields').on('keyup', '.custom-name', function() { >+ $("#standard-fields").on("keyup", ".custom-name", function () { > var val = $(this).val(); > if (core.indexOf(val.toLowerCase()) > -1) { >- $('#custom-warning').text(__("The name '%s' is not permitted").format(val)).show(); >- $('#ill-submit').attr('disabled', true); >- $('#add-new-fields').attr('disabled', true); >+ $("#custom-warning") >+ .text(__("The name '%s' is not permitted").format(val)) >+ .show(); >+ $("#ill-submit").attr("disabled", true); >+ $("#add-new-fields").attr("disabled", true); > } else { >- $('#custom-warning').hide(); >- $('#ill-submit').attr('disabled', false); >- $('#add-new-fields').attr('disabled', false); >+ $("#custom-warning").hide(); >+ $("#ill-submit").attr("disabled", false); >+ $("#add-new-fields").attr("disabled", false); > } > }); > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/migrate.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/migrate.inc >index af20a7fdb66..9661c640e82 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/migrate.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/migrate.inc >@@ -107,6 +107,7 @@ > [% BLOCK backend_jsinclude %] > <script> > // <![CDATA[] >+ var core = [ [% whole.core %] ]; > [% INCLUDE "ill/backends/Standard/inc/shared.js" %] > // ]]> > </script> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/create.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/create.inc >index d79b91ef527..3b697151c04 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/create.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/create.inc >@@ -108,6 +108,7 @@ > [% BLOCK backend_jsinclude %] > <script> > // <![CDATA[] >+ var core = [ [% whole.core | $raw %] ]; > [% INCLUDE "ill/backends/Standard/inc/shared.js" %] > // ]]> > </script> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/shared.js b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/shared.js >index c65fcdab401..493a4146c64 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/shared.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/shared.js >@@ -1,44 +1,48 @@ >-var core = [ [% whole.core %] ]; >-var opac = [% opac || 0 %]; >-document.addEventListener('DOMContentLoaded', function() { >- $('#add-new-fields').click(function(e) { >+document.addEventListener("DOMContentLoaded", function () { >+ $("#add-new-fields").click(function (e) { > e.preventDefault(); >- var row = '<li class="form-horizontal">' + >+ var row = >+ '<li class="form-horizontal">' + > '<input type="text" class="custom-name ' + >- ( opac ? 'form-control input-fluid custom-field-input' : '') + >- '" name="custom_key" placeholder="'+__('key')+'">' + >- ' ' + >+ "form-control input-fluid custom-field-input" + >+ '" name="custom_key" placeholder="' + >+ __("key") + >+ '">' + >+ " " + > '<input type="text" id="custom-value" name="custom_value" class="' + >- ( opac ? 'form-control input-fluid custom-field-input' : '') +'" placeholder="'+__('value')+'"> ' + >+ "form-control input-fluid custom-field-input" + >+ '" placeholder="' + >+ __("value") + >+ '"> ' + > '<button type="button" class="btn btn-danger btn-sm ' + > 'delete-new-field">' + > '<span class="fa fa-trash-can"></span> ' + >- __('Delete') + >- '</button></li>'; >- $('#standard-fields').append(row); >+ __("Delete") + >+ "</button></li>"; >+ $("#standard-fields").append(row); > }); >- $('#standard-fields').on('click', '.delete-new-field', >- function(event) { >- event.preventDefault(); >- $(event.target).parent().remove(); >- } >- ); >- $('#type').change(function() { >- $('#create_form').prepend( >+ $("#standard-fields").on("click", ".delete-new-field", function (event) { >+ event.preventDefault(); >+ $(event.target).parent().remove(); >+ }); >+ $("#type").change(function () { >+ $("#create_form").prepend( > '<input type="hidden" name="change_type" value="1" />' > ); >- $('#create_form').submit(); >+ $("#create_form").submit(); > }); >- $('#standard-fields').on('keyup', '.custom-name', function() { >+ $("#standard-fields").on("keyup", ".custom-name", function () { > var val = $(this).val(); > if (core.indexOf(val.toLowerCase()) > -1) { >- $('#custom-warning').text(__("The name '%s' is not permitted").format(val)).show(); >- $('#ill-submit').attr('disabled', true); >- $('#add-new-fields').attr('disabled', true); >+ $("#custom-warning") >+ .text(__("The name '%s' is not permitted").format(val)) >+ .show(); >+ $("#ill-submit").attr("disabled", true); >+ $("#add-new-fields").attr("disabled", true); > } else { >- $('#custom-warning').hide(); >- $('#ill-submit').attr('disabled', false); >- $('#add-new-fields').attr('disabled', false); >+ $("#custom-warning").hide(); >+ $("#ill-submit").attr("disabled", false); >+ $("#add-new-fields").attr("disabled", false); > } > }); > }); >-- >2.49.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 38340
:
177749
|
177750
|
178057
|
178058
|
178079
|
178080
|
178414
|
178415
|
178416
|
178418
|
178420
|
178421
|
178422
|
180066
|
180067
|
180068
|
181215
|
181216
|
181217
|
181294
|
181391
|
181392
|
181435
|
181541
|
181542
|
181543
|
181544
|
181549