Bugzilla – Attachment 125801 Details for
Bug 28445
Use the task queue for the batch delete and update items tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28445: Isolate add item form to an include file
Bug-28445-Isolate-add-item-form-to-an-include-file.patch (text/plain), 16.78 KB, created by
Jonathan Druart
on 2021-10-06 13:33:59 UTC
(
hide
)
Description:
Bug 28445: Isolate add item form to an include file
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-10-06 13:33:59 UTC
Size:
16.78 KB
patch
obsolete
>From 0f1e90831b80d3cf8b13eacbf072d23fef7e0bb5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 26 Jul 2021 18:25:19 +0200 >Subject: [PATCH] Bug 28445: Isolate add item form to an include file > >To ease reusability >--- > .../prog/en/includes/html_helpers.inc | 121 ++++++++++++++++++ > .../prog/en/modules/cataloguing/additem.tt | 90 +------------ > 2 files changed, 122 insertions(+), 89 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >index 86eab2547f4..6aac6ae28ec 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >@@ -58,3 +58,124 @@ > </option> > [% END %] > [% END %] >+ >+[% BLOCK subfields_for_item %] >+ <ol> >+ [% FOREACH subfield IN subfields %] >+ [% IF subfield.kohafield == 'items.more_subfields_xml' %] >+ [% SET kohafield = 'items.more_subfields_xml_' _ subfield.subfield %] >+ [% ELSE %] >+ [% SET kohafield = subfield.kohafield %] >+ [% END %] >+ >+ <li> >+ <div class="subfield_line" style="[% subfield.visibility | html %]" id="subfield[% subfield.tag | html %][% subfield.subfield | html %][% subfield.random | html %]"> >+ [% IF ( subfield.mandatory ) %] >+ <label class="required">[% subfield.subfield | html %] - [% subfield.marc_lib | $raw %]</label> >+ [% ELSE %] >+ <label>[% subfield.subfield | html %] - [% subfield.marc_lib | $raw %]</label> >+ [% END %] >+ >+ [% SET mv = subfield.marc_value %] >+ [% IF ( mv.type == 'hidden' ) %] >+ <input type="hidden" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]"> >+ [% ELSIF ( mv.type == 'select' ) %] >+ [% IF ( mv.readonly || subfield.IS_RETURN_CLAIM ) %] >+ <select name="[% kohafield | html %]" id="[%- mv.id | html -%]" class="input_marceditor" readonly="readonly" disabled="disabled" data-width="50%"> >+ [% ELSE %] >+ <select name="[% kohafield | html %]" id="[%- mv.id | html -%]" class="input_marceditor select2" data-category="[% mv.category | html %]" data-width="50%"> >+ [% END %] >+ >+ [% FOREACH aval IN mv.values %] >+ [% IF aval == mv.default %] >+ <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option> >+ [% ELSE %] >+ [% IF subfield.IS_LOST_AV && Koha.Preference("ClaimReturnedLostValue") && aval == Koha.Preference("ClaimReturnedLostValue") %] >+ <option disabled="disabled" value="[%- aval | html -%]" title="Return claims must be processed from the patron details page">[%- mv.labels.$aval | html -%]</option> >+ [% ELSE %] >+ <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option> >+ [% END %] >+ [% END %] >+ [% END %] >+ </select> >+ [% ELSIF ( mv.type == 'text_auth' ) %] >+ [% IF mv.readonly %] >+ <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" /> >+ [% ELSE %] >+ <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" /> >+ [% SET dopop = "Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=\"${mv.authtypecode}\"&index=${mv.id}','${mv.id}')" %] >+ <a href="#" class="buttonDot" onclick="[%- dopop | html -%]; return false;" title="Tag editor">...</a> >+ [% END %] >+ [% ELSIF ( mv.type == 'text_plugin' ) %] >+ [% IF mv.readonly %] >+ <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" /> >+ [% ELSE %] >+ <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" /> >+ [% IF ( mv.nopopup ) %] >+ <a href="#" id="buttonDot_[%- mv.id | html -%]" class="[%- mv.class | html -%]" title="No popup">...</a> >+ [% ELSE %] >+ <a href="#" id="buttonDot_[%- mv.id | html -%]" class="[%- mv.class | html -%]" title="Tag editor">...</a> >+ [% END %] >+ [%- mv.javascript | $raw -%] >+ [% END %] >+ [% ELSIF ( mv.type == 'text' ) %] >+ [% IF mv.readonly %] >+ <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" /> >+ [% ELSE %] >+ <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" /> >+ [% END %] >+ [% ELSIF ( mv.type == 'textarea' ) %] >+ [% IF mv.readonly %] >+ <textarea id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" rows="5" cols="64" readonly="readonly" >[% mv.value | html %]</textarea> >+ [% ELSE %] >+ <textarea id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" rows="5" cols="64" >[% mv.value | html %]</textarea> >+ [% END %] >+ [% END %] >+ >+ [% IF subfield.kohafield == 'items.more_subfields_xml' %] >+ <input type="hidden" name="items.more_subfields_xml" value="[% subfield.subfield | html %]" /> >+ [% END %] >+ <input type="hidden" name="tag" value="[% subfield.tag | html %]" /> >+ <input type="hidden" name="subfield" value="[% subfield.subfield | html %]" /> >+ <input type="hidden" name="mandatory" value="[% subfield.mandatory | html %]" /> >+ <input type="hidden" name="important" value="[% subfield.important | html %]" /> >+ >+ [% IF add_regex %] >+ <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" /> >+ </span> >+ [% END %] >+ >+ [% IF add_delete_checkbox %] >+ [% UNLESS ( subfield.mandatory ) %] >+ <input type="checkbox" id="row[% subfield.tag | html %][% subfield.subfield | html %][% subfield.random | html %]" title="Check to delete subfield [% subfield.subfield | html %]" name="disable_input" value="[% subfield.subfield | html %]" /> >+ [% ELSE %] >+ <span class="required">Required</span> >+ [% END %] >+ [% ELSE %] >+ [% IF ( subfield.mandatory ) %] <span class="required">Required</span> >+ [% ELSIF ( subfield.important ) %] <span class="important">Important</span> >+ [% END %] >+ [% END %] >+ >+ [% IF add_regex %] >+ [% IF (mv.type == 'text' || mv.type == 'text2' || mv.type == 'textarea' ) %] >+ <a href="#" name="field_regex" id="[% subfield.id | html %]" >RegEx</a> >+ [% END %] >+ [% END %] >+ >+ [% IF ( subfield.repeatable ) %] >+ <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode.parentNode); return false;"> >+ <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /> >+ </a> >+ [% END %] >+ >+ <span class="hint" id="hint[% subfield.tag | html %][% subfield.subfield | html %][% subfield.random | html %]"></span> >+ >+ </div> >+ </li> >+ [% END %] >+ </ol> >+[% END %] >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 b7e4b62bbbe..3168ed4769e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -157,95 +157,7 @@ > <h2 id="edititem">Edit item #[% itemnumber | html %][% IF ( barcode ) %] / Barcode [% barcode | html %][% END %]</h2> > [% END %] > <fieldset class="rows"> >- <ol> >- [% FOREACH subfield IN subfields %] >- >- [% IF subfield.kohafield == 'items.more_subfields_xml' %] >- [% SET kohafield = 'items.more_subfields_xml_' _ subfield.subfield %] >- [% ELSE %] >- [% SET kohafield = subfield.kohafield %] >- [% END %] >- >- <li><div class="subfield_line" style="[% subfield.visibility | html %]" id="subfield[% subfield.tag | html %][% subfield.subfield | html %][% subfield.random | html %]"> >- [% IF ( subfield.mandatory ) %] >- <label class="required">[% subfield.subfield | html %] - [% subfield.marc_lib | $raw %]</label> >- [% ELSE %] >- <label>[% subfield.subfield | html %] - [% subfield.marc_lib | $raw %]</label> >- [% END %] >- >- [% SET mv = subfield.marc_value %] >- [% IF ( mv.type == 'hidden' ) %] >- <input type="hidden" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]"> >- [% ELSIF ( mv.type == 'select' ) %] >- [% IF ( mv.readonly || subfield.IS_RETURN_CLAIM ) %] >- <select name="[% kohafield | html %]" id="[%- mv.id | html -%]" class="input_marceditor" readonly="readonly" disabled="disabled" data-width="50%"> >- [% ELSE %] >- <select name="[% kohafield | html %]" id="[%- mv.id | html -%]" class="input_marceditor" data-category="[% mv.category | html %]" data-width="50%"> >- [% END %] >- [% FOREACH aval IN mv.values %] >- [% IF aval == mv.default %] >- <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option> >- [% ELSE %] >- [% IF subfield.IS_LOST_AV && Koha.Preference("ClaimReturnedLostValue") && aval == Koha.Preference("ClaimReturnedLostValue") %] >- <option disabled="disabled" value="[%- aval | html -%]" title="Return claims must be processed from the patron details page">[%- mv.labels.$aval | html -%]</option> >- [% ELSE %] >- <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option> >- [% END %] >- [% END %] >- [% END %] >- </select> >- [% ELSIF ( mv.type == 'text_auth' ) %] >- [% IF mv.readonly %] >- <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" /> >- [% ELSE %] >- <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" /> >- [% SET dopop = "Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=\"${mv.authtypecode}\"&index=${mv.id}','${mv.id}')" %] >- <a href="#" class="buttonDot" onclick="[%- dopop | html -%]; return false;" title="Tag editor">...</a> >- [% END %] >- [% ELSIF ( mv.type == 'text_plugin' ) %] >- [% IF mv.readonly %] >- <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" /> >- [% ELSE %] >- <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" /> >- [% IF ( mv.nopopup ) %] >- <a href="#" id="buttonDot_[%- mv.id | html -%]" class="[%- mv.class | html -%]" title="No popup">...</a> >- [% ELSE %] >- <a href="#" id="buttonDot_[%- mv.id | html -%]" class="[%- mv.class | html -%]" title="Tag editor">...</a> >- [% END %] >- [%- mv.javascript | $raw -%] >- [% END %] >- [% ELSIF ( mv.type == 'text' ) %] >- [% IF mv.readonly %] >- <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" /> >- [% ELSE %] >- <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" /> >- [% END %] >- [% ELSIF ( mv.type == 'textarea' ) %] >- [% IF mv.readonly %] >- <textarea id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" rows="5" cols="64" readonly="readonly" >[% mv.value | html %]</textarea> >- [% ELSE %] >- <textarea id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" rows="5" cols="64" >[% mv.value | html %]</textarea> >- [% END %] >- [% END %] >- >- [% IF subfield.kohafield == 'items.more_subfields_xml' %] >- <input type="hidden" name="items.more_subfields_xml" value="[% subfield.subfield | html %]" /> >- [% END %] >- <input type="hidden" name="tag" value="[% subfield.tag | html %]" /> >- <input type="hidden" name="subfield" value="[% subfield.subfield | html %]" /> >- <input type="hidden" name="mandatory" value="[% subfield.mandatory | html %]" /> >- <input type="hidden" name="important" value="[% subfield.important | html %]" /> >- [% IF ( subfield.repeatable ) %] >- <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode.parentNode); return false;"> >- <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /> >- </a> >- [% END %] >- [% IF ( subfield.mandatory ) %] <span class="required">Required</span> >- [% ELSIF ( subfield.important ) %] <span class="important">Important</span> >- [% END %] >- </div></li> >- [% END %] >- </ol> >+ [% PROCESS subfields_for_item subfields => subfields %] > </fieldset> > <input type="hidden" name="indicator" value=" " /> > <input type="hidden" name="indicator" value=" " /> >-- >2.25.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 28445
:
121372
|
123221
|
123222
|
123223
|
123224
|
123225
|
123226
|
123227
|
123228
|
123229
|
123239
|
123240
|
125801
|
125802
|
125803
|
125804
|
125805
|
125808
|
125810
|
125811
|
125812
|
125817
|
125865
|
126046
|
126047
|
126136
|
126137
|
126138
|
126139
|
126140
|
126141
|
126142
|
126217
|
126218
|
126219
|
126223
|
126328
|
126329
|
126330
|
126331
|
126332
|
126333
|
126334
|
126335
|
126336
|
126337
|
126338
|
126339
|
126352
|
126353
|
126354
|
126355
|
126356
|
126357
|
126358
|
126359
|
126360
|
126361
|
126362
|
126363
|
126364
|
126365
|
126366
|
126367
|
126374
|
126375
|
126376
|
126377
|
126378
|
126379
|
126380
|
126381
|
126382
|
126383
|
126384
|
126385
|
126386
|
126387
|
126388
|
126389
|
127033
|
127037
|
127038
|
127039
|
128007
|
128008
|
128009