Bugzilla – Attachment 75548 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: Use a list (shelf) for batch record modification and deletion
Bug-12759-Use-a-list-shelf-for-batch-record-modifi.patch (text/plain), 7.64 KB, created by
Mark Tompsett
on 2018-05-24 18:26:15 UTC
(
hide
)
Description:
Bug 12759: Use a list (shelf) for batch record modification and deletion
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2018-05-24 18:26:15 UTC
Size:
7.64 KB
patch
obsolete
>From a24aa2fad304dd1d75b68f2f9d0799734cccbbcd Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 15 Feb 2017 22:52:45 +0000 >Subject: [PATCH] Bug 12759: Use a list (shelf) for batch record modification > and deletion > >To test: >1) Create a list, add a record to it by its barcode that you don't mind >deleting >2) Go to Tools -> Batch record modification >3) Select the record type 'Authorities'. Confirm the dropdown to select >a list disappears. Confirm selecting 'Biblios' makes the dropdown show >again. >4) Select the list from the dropdown, select a modification template, >Continue >5) Confirm all of the records in that list show on the page. Click >Modify selected records. Confirm this is successful. >6) Go to Batch record deletion >7) Select the record type 'Authorities'. Confirm the dropdown to select >a list disappears. Confirm selecting 'Biblios' makes the dropdown >show again. >8) Select the list from the dropdown and click Continue >9) Confirm all of the records in that list show on the page. Click >Delete selected records. Confirm this is successful. >10) Go back to your lists. The list should still exist but it will now be >empty. > >Sponsored-by: Catalyst IT > >NOTE: Rebased to work -- Mark Tompsett >--- > .../prog/en/modules/tools/batch_delete_records.tt | 22 ++++++++++++++++++++++ > .../en/modules/tools/batch_record_modification.tt | 22 ++++++++++++++++++++++ > tools/batch_delete_records.pl | 11 +++++++++++ > tools/batch_record_modification.pl | 11 +++++++++++ > 4 files changed, 66 insertions(+) > >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 cd789a9ef5..50db42654e 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 >@@ -69,6 +69,21 @@ > <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> >@@ -184,6 +199,13 @@ > <script type="text/javascript"> > var MSG_CANNOT_BE_DELETED = _("This record cannot be deleted, at least one item is currently checked out."); > $(document).ready(function() { >+ $("input[type='radio']").click(function(){ >+ if ($(this).attr('id') == 'authority_type') { >+ $("#shelves").hide(); >+ } else if ($(this).attr('id') == 'biblio_type') { >+ $("#shelves").show(); >+ } >+ }); > $("#selectall").click(function(e){ > e.preventDefault(); > $(".records").checkCheckboxes(":input[type='checkbox']:not(:disabled)"); >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 a1d5d7535c..bd7bba08ce 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 >@@ -73,6 +73,21 @@ > <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> >@@ -242,6 +257,13 @@ > [% Asset.js("js/background-job-progressbar.js") %] > <script type="text/javascript"> > $(document).ready(function() { >+ $("input[type='radio']").click(function(){ >+ if ($(this).attr('id') == 'authority_type') { >+ $("#shelves").hide(); >+ } else if ($(this).attr('id') == 'biblio_type') { >+ $("#shelves").show(); >+ } >+ }); > $("#selectall").click(function(e){ > e.preventDefault(); > $(".records").checkCheckboxes(); >diff --git a/tools/batch_delete_records.pl b/tools/batch_delete_records.pl >index 8804e6292a..f4825a665c 100755 >--- a/tools/batch_delete_records.pl >+++ b/tools/batch_delete_records.pl >@@ -27,6 +27,7 @@ use C4::Auth; > use C4::Output; > use C4::AuthoritiesMarc; > use C4::Biblio; >+use Koha::Virtualshelves; > > use Koha::Authorities; > use Koha::Biblios; >@@ -43,6 +44,9 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user({ > flagsrequired => { tools => 'records_batchdel' }, > }); > >+my @lists = Koha::Virtualshelves->search({}); >+$template->param( lists => \@lists ); >+ > my @records; > my @messages; > if ( $op eq 'form' ) { >@@ -62,6 +66,13 @@ if ( $op eq 'form' ) { > $content =~ s/[\r\n]*$//; > push @record_ids, $content if $content; > } >+ } elsif ( my $shelf_number = $input->param('shelf_number') ) { >+ my $shelf = Koha::Virtualshelves->find($shelf_number); >+ my $contents = $shelf->get_contents; >+ while ( my $content = $contents->next ) { >+ my $biblionumber = $content->biblionumber; >+ push @record_ids, $biblionumber; >+ } > } else { > # The user enters manually the list of id > push @record_ids, split( /\s\n/, $input->param('recordnumber_list') ); >diff --git a/tools/batch_record_modification.pl b/tools/batch_record_modification.pl >index bfdb7583f5..2b19bce11d 100755 >--- a/tools/batch_record_modification.pl >+++ b/tools/batch_record_modification.pl >@@ -32,6 +32,7 @@ use C4::MarcModificationTemplates qw( GetModificationTemplateActions GetModifica > > use Koha::Biblios; > use Koha::MetadataRecord::Authority; >+use Koha::Virtualshelves; > > my $input = new CGI; > our $dbh = C4::Context->dbh; >@@ -68,6 +69,9 @@ if ( $completedJobID ) { > exit; > } > >+my @lists = Koha::Virtualshelves->search({}); >+$template->param( lists => \@lists ); >+ > my @templates = GetModificationTemplates( $mmtid ); > unless ( @templates ) { > $op = 'error'; >@@ -110,6 +114,13 @@ if ( $op eq 'form' ) { > $content =~ s/[\r\n]*$//; > push @record_ids, $content if $content; > } >+ } elsif ( my $shelf_number = $input->param('shelf_number') ) { >+ my $shelf = Koha::Virtualshelves->find($shelf_number); >+ my $contents = $shelf->get_contents; >+ while ( my $content = $contents->next ) { >+ my $biblionumber = $content->biblionumber; >+ push @record_ids, $biblionumber; >+ } > } else { > # The user enters manually the list of id > push @record_ids, split( /\s\n/, $input->param('recordnumber_list') ); >-- >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