Bugzilla – Attachment 82229 Details for
Bug 12759
Add ability to pass list contents to batch record modification/deletion tools
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12759: (follow-up) Using tabs for diff ways of adding records
Bug-12759-follow-up-Using-tabs-for-diff-ways-of-ad.patch (text/plain), 10.54 KB, created by
Jonathan Druart
on 2018-11-12 17:52:10 UTC
(
hide
)
Description:
Bug 12759: (follow-up) Using tabs for diff ways of adding records
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-11-12 17:52:10 UTC
Size:
10.54 KB
patch
obsolete
>From 8dda3994752d1843fab1bd116b1aa22c1fd7d8c8 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 10 Jul 2018 04:10:40 +0000 >Subject: [PATCH] Bug 12759: (follow-up) Using tabs for diff ways of adding > records > >This patch includes the changes for both batch record modification and >deletion. >Checks that all public lists are included and only private lists created >by the logged in user. >Hides the virtualshelves option if authorities are selected. >Doesn't show shelf option at all if none exist >--- > .../prog/en/modules/tools/batch_delete_records.tt | 91 ++++++++++++++-------- > .../en/modules/tools/batch_record_modification.tt | 91 ++++++++++++++-------- > tools/batch_delete_records.pl | 3 +- > tools/batch_record_modification.pl | 3 +- > 4 files changed, 120 insertions(+), 68 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt >index 1c92dfd07d..63df143b72 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt >@@ -65,36 +65,60 @@ > <li><label for="authority_type">Authorities: </label><input type="radio" name="recordtype" value="authority" id="authority_type" /></li> > </ol> > </fieldset> >- <fieldset class="rows"> >- <legend>Use a file</legend> >- <ol> >- <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li> >- </ol> >- </fieldset> >- <fieldset class="rows" id="shelves"> >- <legend>Or select a list of records</legend> >- <ol> >- <li> >- <label for="shelf_number">Use records from the following list: </label> >- <select name="shelf_number" id="shelf_number"> >- <option value="">Select a list</option> >- [% FOREACH list IN lists %] >- <option value="[% list.shelfnumber %]">[% list.shelfname %]</option> >- [% END %] >- </option> >- </select> >- </li> >- </ol> >- </fieldset> >- <fieldset class="rows"> >- <legend>Or enter a list of record numbers</legend> >- <ol> >- <li> >- <label for="recordnumber_list">List of biblionumbers or authority ids (one per line): </label> >- <textarea rows="10" cols="30" id="recordnumber_list" name="recordnumber_list"></textarea> >- </li> >- </ol> >- </fieldset> >+ >+ <br><br> >+ >+ <div id="batch_del_form" class="toptabs"> >+ <ul> >+ <li><a href="#uploadfile">Upload a file</a></li> >+ [% IF lists.count %]<li id="show_list_option"><a href="#shelves">Select a list of records</a></li>[% END %] >+ <li><a href="#enterlist">Enter a list of record numbers</a></li> >+ </ul> >+ >+ <div id="uploadfile"> >+ <fieldset class="rows"> >+ <legend>Use a file</legend> >+ <ol> >+ <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li> >+ </ol> >+ </fieldset> >+ >+ </div> >+ >+ <div id="shelves"> >+ <fieldset class="rows"> >+ <legend>Or select a list of records</legend> >+ <ol> >+ <li> >+ <label for="shelf_number">Use records from the following list: </label> >+ <select name="shelf_number" id="shelf_number"> >+ <option value="">Select a list</option> >+ [% FOREACH list IN lists %] >+ <option value="[% list.shelfnumber %]">[% list.shelfname %]</option> >+ [% END %] >+ </option> >+ </select> >+ </li> >+ </ol> >+ </fieldset> >+ >+ </div> >+ >+ <div id="enterlist"> >+ <fieldset class="rows"> >+ <legend>Or enter a list of record numbers</legend> >+ <ol> >+ <li> >+ <label for="recordnumber_list">List of biblionumbers or authority ids (one per line): </label> >+ <textarea rows="10" cols="30" id="recordnumber_list" name="recordnumber_list"></textarea> >+ </li> >+ </ol> >+ </fieldset> >+ >+ </div> >+ >+ </div> >+ > <fieldset class="action"> > <input type="hidden" name="op" value="list" /> > <input type="submit" value="Continue" class="button" /> >@@ -205,11 +229,14 @@ > <script> > var MSG_CANNOT_BE_DELETED = _("This record cannot be deleted, at least one item is currently checked out."); > $(document).ready(function() { >+ >+ $("#batch_del_form").tabs(); >+ > $("input[type='radio']").click(function(){ > if ($(this).attr('id') == 'authority_type') { >- $("#shelves").hide(); >+ $("#show_list_option").hide(); > } else if ($(this).attr('id') == 'biblio_type') { >- $("#shelves").show(); >+ $("#show_list_option").show(); > } > }); > $("#selectall").click(function(e){ >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 3bdea3ad9e..a8f9b7cc53 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 >@@ -69,36 +69,60 @@ > <li><label for="authority_type">Authorities: </label><input type="radio" name="recordtype" value="authority" id="authority_type" /></li> > </ol> > </fieldset> >- <fieldset class="rows"> >- <legend>Use a file</legend> >- <ol> >- <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li> >- </ol> >- </fieldset> >- <fieldset class="rows" id="shelves"> >- <legend>Or select a list of records</legend> >- <ol> >- <li> >- <label for="shelf_number">Use records from the following list: </label> >- <select name="shelf_number" id="shelf_number"> >- <option value="">Select a list</option> >- [% FOREACH list IN lists %] >- <option value="[% list.shelfnumber %]">[% list.shelfname %]</option> >- [% END %] >- </option> >- </select> >- </li> >- </ol> >- </fieldset> >- <fieldset class="rows"> >- <legend>Or enter a list of record numbers</legend> >- <ol> >- <li> >- <label for="recordnumber_list">List of biblionumbers or authority ids (one per line): </label> >- <textarea rows="10" cols="30" id="recordnumber_list" name="recordnumber_list"></textarea> >- </li> >- </ol> >- </fieldset> >+ >+ <br><br> >+ >+ <div id="batch_mod_form" class="toptabs"> >+ <ul> >+ <li><a href="#uploadfile">Upload a file</a></li> >+ [% IF lists.count %]<li id="show_list_option"><a href="#shelves">Select a list of records</a></li>[% END %] >+ <li><a href="#enterlist">Enter a list of record numbers</a></li> >+ </ul> >+ >+ <div id="uploadfile"> >+ <fieldset class="rows"> >+ <legend>Use a file</legend> >+ <ol> >+ <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li> >+ </ol> >+ </fieldset> >+ >+ </div> >+ >+ <div id="shelves"> >+ <fieldset class="rows"> >+ <legend>Or select a list of records</legend> >+ <ol> >+ <li> >+ <label for="shelf_number">Use records from the following list: </label> >+ <select name="shelf_number" id="shelf_number"> >+ <option value="">Select a list</option> >+ [% FOREACH list IN lists %] >+ <option value="[% list.shelfnumber %]">[% list.shelfname %]</option> >+ [% END %] >+ </option> >+ </select> >+ </li> >+ </ol> >+ </fieldset> >+ >+ </div> >+ >+ <div id="enterlist"> >+ <fieldset class="rows"> >+ <legend>Or enter a list of record numbers</legend> >+ <ol> >+ <li> >+ <label for="recordnumber_list">List of biblionumbers or authority ids (one per line): </label> >+ <textarea rows="10" cols="30" id="recordnumber_list" name="recordnumber_list"></textarea> >+ </li> >+ </ol> >+ </fieldset> >+ >+ </div> >+ >+ </div> >+ > <fieldset class="rows"> > <legend>Use MARC Modification Template:</legend> > <ol> >@@ -262,11 +286,14 @@ > [% Asset.js("js/background-job-progressbar.js") | $raw %] > <script> > $(document).ready(function() { >+ >+ $("#batch_mod_form").tabs(); >+ > $("input[type='radio']").click(function(){ > if ($(this).attr('id') == 'authority_type') { >- $("#shelves").hide(); >+ $("#show_list_option").hide(); > } else if ($(this).attr('id') == 'biblio_type') { >- $("#shelves").show(); >+ $("#show_list_option").show(); > } > }); > $("#selectall").click(function(e){ >diff --git a/tools/batch_delete_records.pl b/tools/batch_delete_records.pl >index c8d0566f76..34c6b5a8ac 100755 >--- a/tools/batch_delete_records.pl >+++ b/tools/batch_delete_records.pl >@@ -45,8 +45,7 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user({ > flagsrequired => { tools => 'records_batchdel' }, > }); > >-my @lists = Koha::Virtualshelves->search({}); >-$template->param( lists => \@lists ); >+$template->param( lists => scalar Koha::Virtualshelves->search([{ category => 1, owner => $loggedinuser }, { category => 2 }]) ); > > my @records; > my @messages; >diff --git a/tools/batch_record_modification.pl b/tools/batch_record_modification.pl >index b6f65f3ad4..1a82c476c3 100755 >--- a/tools/batch_record_modification.pl >+++ b/tools/batch_record_modification.pl >@@ -69,8 +69,7 @@ if ( $completedJobID ) { > exit; > } > >-my @lists = Koha::Virtualshelves->search({}); >-$template->param( lists => \@lists ); >+$template->param( lists => scalar Koha::Virtualshelves->search([{ category => 1, owner => $loggedinuser }, { category => 2 }]) ); > > my @templates = GetModificationTemplates( $mmtid ); > unless ( @templates ) { >-- >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 12759
:
60297
|
60362
|
60367
|
60489
|
61337
|
75548
|
75572
|
76802
|
76803
|
82228
|
82229
|
82230
|
83421
|
83422
|
83423
|
83424
|
84672
|
84875
|
84876
|
84877
|
84878