Bugzilla – Attachment 148653 Details for
Bug 32164
Add link to MARC modification templates from batch record modification page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32164: Add link to MARC modification templates from batch record modification page
Bug-32164-Add-link-to-MARC-modification-templates-.patch (text/plain), 6.82 KB, created by
Kyle M Hall (khall)
on 2023-03-24 10:56:33 UTC
(
hide
)
Description:
Bug 32164: Add link to MARC modification templates from batch record modification page
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-03-24 10:56:33 UTC
Size:
6.82 KB
patch
obsolete
>From f163710c9eb08bacb7375d0a7f8cf5abb57ef56a Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 13 Feb 2023 19:34:45 +0000 >Subject: [PATCH] Bug 32164: Add link to MARC modification templates from batch > record modification page > >This patch adds a more visible link from the batch record modification >page in the event that there are no MARC modification templates defined. >The template checks that the user has permission. > >The patch also modifies the same message on the MARC modification >templates page so that the interfaces are more unified, and tweaks the >operation of the "New action" button. > >To test you should have no MARC modification templates defined. > >- Apply the patch and go to Tools -> Batch record modification. >- If you're logged in as a user with permission you should see a message > dialog containing a button, "Create a new MARC modification template." >- Clicking it should take you to the MARC modification templates page, > where you'll see a similar message and a button, "Create a new > template." Clicking this button should trigger a modal form, just like > clicking the "New template" button in the toolbar should. >- Submit the form to create a new template. You should see message on > the following page that says "New action." Clicking the button should > display the entry form, and then clicking "Cancel" should hide the > form and redisplay the message. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../en/modules/tools/batch_record_modification.tt | 7 +++++-- > .../en/modules/tools/marc_modification_templates.tt | 12 +++++++++--- > .../prog/js/marc_modification_templates.js | 8 +++++++- > 3 files changed, 21 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt >index fc2dcff60d0..f7935a09448 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt >@@ -269,8 +269,11 @@ > [% ELSIF view == 'errors' %] > [% FOR error IN errors %] > [% IF error == 'no_template_defined' %] >- <div class="dialog alert"> >- No MARC modification template is defined. You have <a href="/cgi-bin/koha/tools/marc_modification_templates.pl">to create</a> at least one template for using this tool. >+ <div class="dialog message"> >+ <p>No MARC modification template is defined. You have to create at least one template in order to use this tool.</p> >+ [% IF ( CAN_user_tools_marc_modification_templates ) %] >+ <a class="btn btn-default" href="/cgi-bin/koha/tools/marc_modification_templates.pl"><i class="fa fa-plus"></i> Create a new MARC modification template</a> >+ [% END %] > </div> > [% END %] > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt >index 53e80a5d889..01c1bfc44fb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt >@@ -70,7 +70,7 @@ > <div id="toolbar" class="btn-toolbar"> > <a href="#" data-toggle="modal" data-template_id="" data-target="#createTemplate" id="new_template" class="btn btn-default duplicate_template"><i class="fa fa-plus"></i> New template</a> > [% IF ( template_id != '' ) %] >- <a href="#" id="new_action" class="btn btn-default"><i class="fa fa-plus"></i> New action</a> >+ <a href="#" class="btn btn-default new_action"><i class="fa fa-plus"></i> New action</a> > <a class="btn btn-default delete_template" href="/cgi-bin/koha/tools/marc_modification_templates.pl?template_id=[% template_id | html %]&op=delete_template"><i class="fa fa-fw fa-trash"></i> Delete template</a> > [% END %] > </div> >@@ -208,7 +208,10 @@ > </table> > </div> <!-- /.page-section --> > [% ELSE %] >- <div class="dialog message template_actions"><p>There are no defined actions for this template.</p></div> >+ <div class="dialog message" id="no_defined_actions"> >+ <p>There are no defined actions for this template.</p> >+ <p><a href="#" class="btn btn-default approve new_action"><i class="fa fa-plus" aria-hidden="true"></i> New action</a></p> >+ </div> > [% END # /IF ActionsLoop %] > > <form method="post" action="/cgi-bin/koha/tools/marc_modification_templates.pl" id="add_action" > >@@ -307,7 +310,10 @@ > > [% ELSE %] > <h1>MARC modification templates</h1> >- <div class="dialog message"><p>There are no defined templates. Please create a template first.</p></div> >+ <div class="dialog message"> >+ <p>There are no defined templates. Please create a template first.</p> >+ <a href="#" data-toggle="modal" data-target="#createTemplate" class="btn btn-default"><i class="fa fa-plus" aria-hidden="true"></i> Create a new template</a> >+ </div> > [% END # /IF TemplatesLoop %] > > <!-- Modal to create new template --> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js b/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js >index e513fbe8968..847f88c009f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js >@@ -68,9 +68,10 @@ $(document).ready(function() { > updateAllEvery(); > }); > >- $("#new_action").on("click",function(e){ >+ $(".new_action").on("click",function(e){ > e.preventDefault(); > cancelEditAction(); >+ $("#no_defined_actions").hide(); > $("#add_action").show(); > $("#action").focus(); > }); >@@ -350,6 +351,11 @@ function cancelEditAction() { > > document.getElementById('modaction_legend').innerHTML = window.modaction_legend_innerhtml; > document.getElementById('action_submit').value = window.action_submit_value; >+ >+ if( $("#template_actions").length < 1 ){ >+ $("#no_defined_actions").show(); >+ } >+ > $("#add_action").hide(); > } > >-- >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 32164
:
146600
|
146640
|
146979
| 148653