Bugzilla – Attachment 92871 Details for
Bug 21959
Add ability to apply regular expressions to text fields in the batch item modification tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21959: use a link instead of a checkbox
Bug-21959-use-a-link-instead-of-a-checkbox.patch (text/plain), 4.29 KB, created by
Biblibre Sandboxes
on 2019-09-17 10:32:54 UTC
(
hide
)
Description:
Bug 21959: use a link instead of a checkbox
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2019-09-17 10:32:54 UTC
Size:
4.29 KB
patch
obsolete
>From c1547f0c08d9c2b4f7f0f8ededbdfeb28b9b12de Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Tue, 2 Apr 2019 15:20:34 +0200 >Subject: [PATCH] Bug 21959: use a link instead of a checkbox > >Signed-off-by: Mathilde Formery <mathilde.formery@ville-nimes.fr> >--- > .../prog/en/modules/tools/batchMod-edit.tt | 49 +++++++++++----------- > 1 file changed, 25 insertions(+), 24 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >index cae9e85..6c27058 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >@@ -24,37 +24,38 @@ $(document).ready(function(){ > var row = $(this).attr("id"); > row = row.replace("row","hint"); > var editor = $(this).parent().find("[name='field_value']"); >- var regex_input = $(this).parent().find("[name='field_regex']"); >+ var regex_link = $(this).parent().find("[name='field_regex']"); > if ($(this).is(":checked")) { > $(editor).prop('disabled', true); > $("#"+row).html(_("This subfield will be deleted")); >- $(regex_input).prop('disabled', true); >+ $(regex_link).hide(); > } else { > $(editor).prop('disabled', false); > $("#"+row).html(""); >- $(regex_input).prop('disabled', false); >+ $(regex_link).show(); > } > }); > $("#mainformsubmit").on("click",function(){ > return submitBackgroundJob(this.form); > }); >- $('input[name="field_regex"]').change(function() { >- var id = $(this).attr('id'); >- var editor = $(this).parent().find("[name='field_value']"); >- var regex = $(this).parent().find("[name='regex_fields']"); >- var disable_input = $(this).parent().find("[name='disable_input']"); >- if ($(this).is(':checked')) { >- $(editor).hide(); >- $(regex).show(); >- $(this).parent().find('.hint').html(_("Enter a regular expression for this subflied")); >- $(disable_input).prop('disabled', true); >- } else { >- $(editor).show(); >- $(regex).hide(); >- $(this).parent().find('.hint').html(_("")); >- $(disable_input).prop('disabled', false); >- } >- }); >+ $('a[name="field_regex"]').click(function() { >+ var id = $(this).attr('id'); >+ var editor = $(this).parent().find("[name='field_value']"); >+ var regex = $(this).parent().find("[name='regex_fields']"); >+ var disable_input = $(this).parent().find("[name='disable_input']"); >+ if ($(this).html() == 'RegEx') { >+ $(editor).hide(); >+ $(regex).show(); >+ $(this).html('Text'); >+ $(disable_input).prop('disabled', true); >+ } else { >+ $(editor).show(); >+ $(regex).hide(); >+ $(this).html('RegEx'); >+ $(disable_input).prop('disabled', false); >+ } >+ return false; >+ }); > }); > //]]> > </script> >@@ -306,9 +307,9 @@ $(document).ready(function(){ > [%- END -%] > > <span name="regex_fields" style="display: none;"> >- s/<input type="text" id="[% mv.id | html %]" name="regex_search" placeholder="regex pattern" />/ >- <input type="text" id="[% mv.id | html %]" name="regex_replace" placeholder="regex replacement" />/ >- <input type="text" id="[% mv.id | html %]" name="regex_modifiers" placeholder="ig" size="3" /> >+ s/<input type="text" id="[% mv.id | html %]" name="regex_search" placeholder="regex pattern" />/ >+ <input type="text" id="[% mv.id | html %]" name="regex_replace" placeholder="regex replacement" />/ >+ <input type="text" id="[% mv.id | html %]" name="regex_modifiers" placeholder="ig" size="3" /> > </span> > > [% UNLESS ( ite.mandatory ) %] >@@ -318,7 +319,7 @@ $(document).ready(function(){ > [% END %] > > [% IF (mv.type == 'text' || mv.type == 'textarea' ) %] >- <input type="checkbox" name="field_regex" id="[% ite.id | html %]" title="Use regular expression"> >+ <a href="#" name="field_regex" id="[% ite.id | html %]" >RegEx</a> > [% END %] > > <input type="hidden" name="tag" value="[% ite.tag | html %]" /> >-- >2.7.4
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 21959
:
82902
|
83392
|
83470
|
87323
|
87324
|
87325
|
92870
|
92871
|
92872
|
95432
|
95433
|
95434
|
96636
|
96637
|
96638