Bugzilla – Attachment 108930 Details for
Bug 25728
Add the ability to create a new authorised value within the cataloguing module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25728: fix rebase issues
Bug-25728-fix-rebase-issues.patch (text/plain), 6.77 KB, created by
Katrin Fischer
on 2020-08-22 13:06:06 UTC
(
hide
)
Description:
Bug 25728: fix rebase issues
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-08-22 13:06:06 UTC
Size:
6.77 KB
patch
obsolete
>From aeb77540ff0b061d754dab9b061ab62389597ada Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sat, 22 Aug 2020 11:15:28 +0200 >Subject: [PATCH] Bug 25728: fix rebase issues > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../prog/en/modules/cataloguing/additem.tt | 8 +-- > koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 78 +++++++++++++--------- > 2 files changed, 49 insertions(+), 37 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >index e05b55f2ef..9e506c72ca 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -161,13 +161,9 @@ > <input type="hidden" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]"> > [% ELSIF ( mv.type == 'select' ) %] > [% IF ( mv.readonly || ite.IS_RETURN_CLAIM ) %] >- <select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor select2" readonly="readonly" disabled="disabled"> >+ <select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor" readonly="readonly" disabled="disabled"> > [% ELSE %] >- [% IF mv.category AND CAN_user_parameters_manage_auth_values %] >- <select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor" data-category="[% mv.category | html %]"> >- [% ELSE %] >- <select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor select2"> >- [% END %] >+ <select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor" data-category="[% mv.category | html %]"> > [% END %] > [% FOREACH aval IN mv.values %] > [% IF aval == mv.default %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >index 1610d36894..67eca4fcec 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >@@ -90,42 +90,58 @@ var Select2Utils = { > initSelect2: function(selects) { > if ($.fn.select2) { > if ( window.CAN_user_parameters_manage_auth_values === undefined || ! CAN_user_parameters_manage_auth_values ) { >- $(selects).select2(); >- } else { >- $(selects).select2({ >- tags: true, >- createTag: function (tag) { >- return { >- id: tag.term, >- text: tag.term, >- newTag: true >- }; >- }, >- templateResult: function(state) { >- if (state.newTag) { >- return state.text + " " + __("(select to create)"); >- } >- return state.text; >- } >- }).on("select2:select", function(e) { >- if(e.params.data.newTag){ >- current_select2 = this; >- var category = $(this).data("category"); >- $("#avCreate #new_av_category").html(category); >- $("#avCreate input[name='category']").val(category); >- $("#avCreate input[name='value']").val(e.params.data.text); >- $("#avCreate input[name='description']").val(e.params.data.text); >- >- $(this).val($(this).find("option:first").val()).trigger('change'); >- $('#avCreate').modal({show:true}); >- } >- }).on("select2:clear", function () { >+ $(selects).select2().on("select2:clear", function () { > $(this).on("select2:opening.cancelOpen", function (evt) { > evt.preventDefault(); >- > $(this).off("select2:opening.cancelOpen"); > }); > }); >+ } else { >+ $(selects).each(function(){ >+ if ( !$(this).data("category") ) { >+ $(this).select2().on("select2:clear", function () { >+ $(this).on("select2:opening.cancelOpen", function (evt) { >+ evt.preventDefault(); >+ $(this).off("select2:opening.cancelOpen"); >+ }); >+ }); >+ } else { >+ $(this).select2({ >+ tags: true, >+ createTag: function (tag) { >+ return { >+ id: tag.term, >+ text: tag.term, >+ newTag: true >+ }; >+ }, >+ templateResult: function(state) { >+ if (state.newTag) { >+ return state.text + " " + __("(select to create)"); >+ } >+ return state.text; >+ } >+ }).on("select2:select", function(e) { >+ if(e.params.data.newTag){ >+ current_select2 = this; >+ var category = $(this).data("category"); >+ $("#avCreate #new_av_category").html(category); >+ $("#avCreate input[name='category']").val(category); >+ $("#avCreate input[name='value']").val(e.params.data.text); >+ $("#avCreate input[name='description']").val(e.params.data.text); >+ >+ $(this).val($(this).find("option:first").val()).trigger('change'); >+ $('#avCreate').modal({show:true}); >+ } >+ }).on("select2:clear", function () { >+ $(this).on("select2:opening.cancelOpen", function (evt) { >+ evt.preventDefault(); >+ >+ $(this).off("select2:opening.cancelOpen"); >+ }); >+ }); >+ } >+ }); > } > } > } >-- >2.11.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 25728
:
105837
|
105838
|
105839
|
105840
|
105841
|
105842
|
105852
|
106696
|
106697
|
106698
|
106699
|
106700
|
106701
|
106702
|
108356
|
108357
|
108358
|
108359
|
108360
|
108361
|
108362
|
108883
|
108884
|
108885
|
108886
|
108887
|
108888
|
108889
|
108890
|
108922
|
108923
|
108924
|
108925
|
108926
|
108927
|
108928
|
108929
| 108930 |
108931