Bugzilla – Attachment 60362 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), 6.69 KB, created by
Aleisha Amohia
on 2017-02-16 20:02:07 UTC
(
hide
)
Description:
Bug 12759: Use a list (shelf) for batch record modification and deletion
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2017-02-16 20:02:07 UTC
Size:
6.69 KB
patch
obsolete
>From 30731e624539cd71507b27aa7b1aad46d689152a 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 list from the dropdown and click Continue >8) Confirm all of the records in that list show on the page. Click >Delete selected records. Confirm this is successful. >9) Go back to your lists. The list should still exist but it will now be >empty. > >Sponsored-by: Catalyst IT >--- > .../prog/en/modules/tools/batch_delete_records.tt | 15 +++++++++++++++ > .../en/modules/tools/batch_record_modification.tt | 22 ++++++++++++++++++++++ > tools/batch_delete_records.pl | 11 +++++++++++ > tools/batch_record_modification.pl | 11 +++++++++++ > 4 files changed, 59 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 7962a9f..5501cc3 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 >@@ -135,6 +135,21 @@ $(document).ready(function() { > </ol> > </fieldset> > <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> >+ <fieldset class="rows"> > <legend>Or enter a list of record numbers</legend> > <ol> > <li> >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 32034a5..6620e34 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 >@@ -9,6 +9,13 @@ > <script type="text/javascript"> > //<![CDATA[ > $(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(); >@@ -142,6 +149,21 @@ $(document).ready(function() { > <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> >diff --git a/tools/batch_delete_records.pl b/tools/batch_delete_records.pl >index 2c2d32e..a979112 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; > > my $input = new CGI; > my $dbh = C4::Context->dbh; >@@ -41,6 +42,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' ) { >@@ -60,6 +64,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 6ea0317..bce71f8 100755 >--- a/tools/batch_record_modification.pl >+++ b/tools/batch_record_modification.pl >@@ -30,6 +30,7 @@ use C4::BackgroundJob; > use C4::Biblio qw( GetMarcBiblio ModBiblio ); > use C4::MarcModificationTemplates qw( GetModificationTemplateActions GetModificationTemplates ModifyRecordWithTemplate ); > use Koha::MetadataRecord::Authority; >+use Koha::Virtualshelves; > > my $input = new CGI; > our $dbh = C4::Context->dbh; >@@ -66,6 +67,9 @@ if ( $completedJobID ) { > exit; > } > >+my @lists = Koha::Virtualshelves->search({}); >+$template->param( lists => \@lists ); >+ > my @templates = GetModificationTemplates( $mmtid ); > unless ( @templates ) { > $op = 'error'; >@@ -108,6 +112,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.1.4
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