Bugzilla – Attachment 143843 Details for
Bug 32188
Only show template controls above item form if templates have been defined
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32188: Only show template controls above item form if templates have been defined
Bug-32188-Only-show-template-controls-above-item-f.patch (text/plain), 7.55 KB, created by
Kyle M Hall (khall)
on 2022-11-14 16:09:46 UTC
(
hide
)
Description:
Bug 32188: Only show template controls above item form if templates have been defined
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2022-11-14 16:09:46 UTC
Size:
7.55 KB
patch
obsolete
>From d702c6ff27b9dd6252f83b43c44d7963e8efc948 Mon Sep 17 00:00:00 2001 >From: Kyle Hall <kyle@bywatersolutions.com> >Date: Mon, 14 Nov 2022 11:07:51 -0500 >Subject: [PATCH] Bug 32188: Only show template controls above item form if > templates have been defined > >The new item templates above the item edit form should only show, when at least one template has been defined. > >Test Plan: >1) Browse to the item editor >2) Delete all templates >3) Note the template toolbar is displayed >4) Apply this patch >5) Reload the page, note the toolbar is not displayed >6) Create a new template, note the toolbar is now displayed >7) Delete that template, note the toolbar is no longer displayed >--- > .../prog/en/modules/cataloguing/additem.tt | 91 ++++++++++--------- > 1 file changed, 46 insertions(+), 45 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 05168fc3a4..e179b82e34 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -163,60 +163,61 @@ > <h2 id="edititem">Edit item #[% itemnumber | html %][% IF ( barcode ) %] / Barcode [% barcode | html %][% END %]</h2> > [% END %] > >- <div id="item-template-toolbar" class="btn-toolbar"> >- <div class="btn-group"> >- <select name="template_id" id="template_id" class="select2" style="width: 20em"> >- <option value="0" selected="selected">Do not use template</option> >- <optgroup label="My templates"> >- [% FOREACH t IN item_templates.owned %] >- [% IF t.id == template_id %] >- <option data-editor="1" value="[% t.id | html %]" selected="selected">[% t.name | html %][% IF t.is_shared %] (shared)[% END %]</option> >- [% ELSE %] >- <option data-editor="1" value="[% t.id | html %]">[% t.name | html %][% IF t.is_shared %] (shared)[% END %]</option> >- [% END %] >- [% END %] >- </optgroup> >- <optgroup label="Shared templates"> >- [% FOREACH t IN item_templates.shared %] >- [% IF t.id == template_id %] >- [% IF CAN_user_editcatalogue_manage_item_editor_templates %] >- <option data-editor="1" value="[% t.id | html %]" selected="selected">[% t.name | html %]</option> >+ [% IF item_templates.owned.count || item_templates.shared.count %] >+ <div id="item-template-toolbar" class="btn-toolbar"> >+ <div class="btn-group"> >+ <select name="template_id" id="template_id" class="select2" style="width: 20em"> >+ <option value="0" selected="selected">Do not use template</option> >+ <optgroup label="My templates"> >+ [% FOREACH t IN item_templates.owned %] >+ [% IF t.id == template_id %] >+ <option data-editor="1" value="[% t.id | html %]" selected="selected">[% t.name | html %][% IF t.is_shared %] (shared)[% END %]</option> > [% ELSE %] >- <option data-editor="0" value="[% t.id | html %]" selected="selected">[% t.name | html %]</option> >+ <option data-editor="1" value="[% t.id | html %]">[% t.name | html %][% IF t.is_shared %] (shared)[% END %]</option> > [% END %] >- [% ELSE %] >- [% IF CAN_user_editcatalogue_manage_item_editor_templates %] >- <option data-editor="1" value="[% t.id | html %]">[% t.name | html %]</option> >+ [% END %] >+ </optgroup> >+ <optgroup label="Shared templates"> >+ [% FOREACH t IN item_templates.shared %] >+ [% IF t.id == template_id %] >+ [% IF CAN_user_editcatalogue_manage_item_editor_templates %] >+ <option data-editor="1" value="[% t.id | html %]" selected="selected">[% t.name | html %]</option> >+ [% ELSE %] >+ <option data-editor="0" value="[% t.id | html %]" selected="selected">[% t.name | html %]</option> >+ [% END %] > [% ELSE %] >- <option data-editor="0" value="[% t.id | html %]">[% t.name | html %]</option> >+ [% IF CAN_user_editcatalogue_manage_item_editor_templates %] >+ <option data-editor="1" value="[% t.id | html %]">[% t.name | html %]</option> >+ [% ELSE %] >+ <option data-editor="0" value="[% t.id | html %]">[% t.name | html %]</option> >+ [% END %] > [% END %] > [% END %] >+ </optgroup> >+ </select> >+ </div> >+ <div class="btn-group"> >+ <button type="submit" id="load_template_submit" name="load_template_submit" value="1"><i class="fa fa-wpforms"></i> Apply template</button> >+ </div> >+ <div class="btn-group"> >+ <label for="use_template_for_session"> >+ [% IF use_template_for_session %] >+ <input type="checkbox" id="use_template_for_session" name="use_template_for_session" checked="checked"> >+ [% ELSE %] >+ <input type="checkbox" id="use_template_for_session" name="use_template_for_session"> > [% END %] >- </optgroup> >- </select> >- </div> >- <div class="btn-group"> >- <button type="submit" id="load_template_submit" name="load_template_submit" value="1"><i class="fa fa-wpforms"></i> Apply template</button> >- </div> >- <div class="btn-group"> >- <label for="use_template_for_session"> >- [% IF use_template_for_session %] >- <input type="checkbox" id="use_template_for_session" name="use_template_for_session" checked="checked"> >- [% ELSE %] >- <input type="checkbox" id="use_template_for_session" name="use_template_for_session"> >- [% END %] >- For session</label> >- </div> >+ For session</label> >+ </div> > >- <div class="btn-group"> >- <button type="submit" id="unload_template_submit" name="unload_template_submit" value="1"><i class="fa fa-eraser"></i> Clear template</button> >- </div> >+ <div class="btn-group"> >+ <button type="submit" id="unload_template_submit" name="unload_template_submit" value="1"><i class="fa fa-eraser"></i> Clear template</button> >+ </div> > >- <div class="btn-group"> >- <button type="submit" id="delete_template_submit" name="delete_template_submit" value="1" disabled><i class="fa fa-trash"></i> Delete template</button> >+ <div class="btn-group"> >+ <button type="submit" id="delete_template_submit" name="delete_template_submit" value="1" disabled><i class="fa fa-trash"></i> Delete template</button> >+ </div> > </div> >- >- </div> >+ [% END %] > > <fieldset class="rows"> > [% PROCESS subfields_for_item subfields => subfields %] >-- >2.30.2
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 32188
:
143843
|
143846