diff --git a/installer/data/mysql/de-DE/mandatory/userpermissions.sql b/installer/data/mysql/de-DE/mandatory/userpermissions.sql index 534fbdf6e1..59e6baba1e 100644 --- a/installer/data/mysql/de-DE/mandatory/userpermissions.sql +++ b/installer/data/mysql/de-DE/mandatory/userpermissions.sql @@ -50,7 +50,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'upload_local_cover_images', 'Eigene Coverbilder hochladen'), (13, 'manage_patron_lists', 'Benutzerlisten anlegen, bearbeiten und löschen'), (13, 'marc_modification_templates', 'Templates für MARC-Modifikationen verwalten'), - (13, 'records_batchdel', 'Perform batch deletion of records (biblios or authorities)'), + (13, 'records_batchdel', 'Perform batch deletion of records (bibliographic or authority)'), (15, 'check_expiration', 'Ablauf eines Abonnements prüfen'), (15, 'claim_serials', 'Fehlende Hefte reklamieren'), (15, 'create_subscription', 'Neue Abonnements anlegen'), diff --git a/installer/data/mysql/en/mandatory/userpermissions.sql b/installer/data/mysql/en/mandatory/userpermissions.sql index 581749948d..f8e3e9d939 100644 --- a/installer/data/mysql/en/mandatory/userpermissions.sql +++ b/installer/data/mysql/en/mandatory/userpermissions.sql @@ -50,7 +50,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'upload_local_cover_images', 'Upload local cover images'), (13, 'manage_patron_lists', 'Add, edit and delete patron lists and their contents'), (13, 'marc_modification_templates', 'Manage marc modification templates'), - (13, 'records_batchdel', 'Perform batch deletion of records (biblios or authorities)'), + (13, 'records_batchdel', 'Perform batch deletion of records (bibliographic or authority)'), (15, 'check_expiration', 'Check the expiration of a serial'), (15, 'claim_serials', 'Claim missing serials'), (15, 'create_subscription', 'Create a new subscription'), diff --git a/installer/data/mysql/es-ES/mandatory/userpermissions.sql b/installer/data/mysql/es-ES/mandatory/userpermissions.sql index efc1d68a72..8b7cc2672b 100644 --- a/installer/data/mysql/es-ES/mandatory/userpermissions.sql +++ b/installer/data/mysql/es-ES/mandatory/userpermissions.sql @@ -50,7 +50,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'upload_local_cover_images', 'Upload local cover images'), (13, 'manage_patron_lists', 'Add, edit and delete patron lists and their contents'), (13, 'marc_modification_templates', 'Manage marc modification templates'), - (13, 'records_batchdel', 'Perform batch deletion of records (biblios or authorities)'), + (13, 'records_batchdel', 'Perform batch deletion of records (bibliographic or authority)'), (15, 'check_expiration', 'Check the expiration of a serial'), (15, 'claim_serials', 'Claim missing serials'), (15, 'create_subscription', 'Create a new subscription'), diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql index 5aa224b44c..b70438a05e 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql @@ -50,7 +50,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'items_batchdel', 'Supprimer les exemplaires par lot'), (13, 'upload_local_cover_images', 'Téléchargement des images de couverture'), (13, 'manage_patron_lists', 'Add, edit and delete patron lists and their contents'), - (13, 'records_batchdel', 'Perform batch deletion of records (biblios or authorities)'), + (13, 'records_batchdel', 'Perform batch deletion of records (bibliographic or authority)'), (15, 'check_expiration', 'Contrôler l''expiration d''un périodique'), (15, 'claim_serials', 'Réclamer les périodiques manquants'), (15, 'create_subscription', 'Créer de nouveaux abonnements'), diff --git a/installer/data/mysql/it-IT/necessari/userpermissions.sql b/installer/data/mysql/it-IT/necessari/userpermissions.sql index cb745e7e1f..3ad8ff7303 100644 --- a/installer/data/mysql/it-IT/necessari/userpermissions.sql +++ b/installer/data/mysql/it-IT/necessari/userpermissions.sql @@ -50,7 +50,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'upload_local_cover_images', 'Carica copertine in locale'), (13, 'manage_patron_lists', 'Aggiungi, modifica e cancella le liste utenti e i loro contenuti'), (13, 'marc_modification_templates', 'Gestisci le modifiche sulle griglie di catalogazione MARC'), - (13, 'records_batchdel', 'Perform batch deletion of records (biblios or authorities)'), + (13, 'records_batchdel', 'Perform batch deletion of records (bibliographic or authority)'), (15, 'check_expiration', 'Controlla la scadenza di una risora in continuazione'), (15, 'claim_serials', 'Richiedi i fascicoli non arrivati'), (15, 'create_subscription', 'Crea un nuovo abbonamento'), diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql index 1b49feeade..bcc117528b 100644 --- a/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql +++ b/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql @@ -70,7 +70,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'upload_local_cover_images', 'Laste opp lokale omslagsbilder'), (13, 'manage_patron_lists', 'Add, edit and delete patron lists and their contents'), (13, 'marc_modification_templates', 'Manage marc modification templates'), - (13, 'records_batchdel', 'Perform batch deletion of records (biblios or authorities)'), + (13, 'records_batchdel', 'Perform batch deletion of records (bibliographic or authority)'), (15, 'check_expiration', 'Sjekke utløpsdato for et periodikum'), (15, 'claim_serials', 'Purre manglende tidsskrifthefter'), (15, 'create_subscription', 'Opprette abonnementer'), diff --git a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql b/installer/data/mysql/pl-PL/mandatory/userpermissions.sql index aed482276a..caf1db8195 100644 --- a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql +++ b/installer/data/mysql/pl-PL/mandatory/userpermissions.sql @@ -51,7 +51,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'rotating_collections', 'Manage rotating collections'), (13, 'upload_local_cover_images', 'Upload local cover images'), (13, 'manage_patron_lists', 'Add, edit and delete patron lists and their contents'), - (13, 'records_batchdel', 'Perform batch deletion of records (biblios or authorities)'), + (13, 'records_batchdel', 'Perform batch deletion of records (bibliographic or authority)'), (15, 'check_expiration', 'Check the expiration of a serial'), (15, 'claim_serials', 'Claim missing serials'), (15, 'create_subscription', 'Create a new subscription'), diff --git a/installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql b/installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql index 8286e9881f..9b9839dd38 100644 --- a/installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql +++ b/installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql @@ -76,7 +76,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'upload_local_cover_images', 'Upload local cover images'), (13, 'manage_patron_lists', 'Add, edit and delete patron lists and their contents'), (13, 'marc_modification_templates', 'Manage marc modification templates'), - (13, 'records_batchdel', 'Perform batch deletion of records (biblios or authorities)'), + (13, 'records_batchdel', 'Perform batch deletion of records (bibliographic or authority)'), (15, 'check_expiration', 'Check the expiration of a serial'), (15, 'claim_serials', 'Claim missing serials'), (15, 'create_subscription', 'Create a new subscription'), diff --git a/installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql b/installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql index 19d6d170bd..40d741fd6f 100644 --- a/installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql +++ b/installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql @@ -76,7 +76,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'upload_local_cover_images', 'Upload local cover images'), (13, 'manage_patron_lists', 'Add, edit and delete patron lists and their contents'), (13, 'marc_modification_templates', 'Manage marc modification templates'), - (13, 'records_batchdel', 'Perform batch deletion of records (biblios or authorities)'), + (13, 'records_batchdel', 'Perform batch deletion of records (bibliographic or authority)'), (15, 'check_expiration', 'Check the expiration of a serial'), (15, 'claim_serials', 'Claim missing serials'), (15, 'create_subscription', 'Create a new subscription'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 33c936e005..5f527dd27d 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9413,9 +9413,9 @@ $DBversion = "3.15.00.XXX"; if ( CheckVersion($DBversion) ) { $dbh->do(q| INSERT INTO permissions (module_bit, code, description) VALUES - (13, 'records_batchdel', 'Perform batch deletion of records (biblios or authorities)') + (13, 'records_batchdel', 'Perform batch deletion of records (bibliographic or authority)') |); - print "Upgrade to $DBversion done (Bug 12403: Add permission tools_records_batchdel)\n"; + print "Upgrade to $DBversion done (Bug 12403: Add permission tools_records_batchdelitem)\n"; SetVersion($DBversion); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt index 60fd2e4206..39a2a07dc4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt @@ -40,7 +40,27 @@ function placeHold () { window.opener.location = newloc; window.close(); } +[% IF CAN_user_tools_records_batchdel %] +function batchDelete(){ + var checkedItems = $("input:checkbox:checked"); + if ($(checkedItems).size() == 0) { + alert(MSG_NO_RECORD_SELECTED); + return false; + } + var newloc; + var bibs = ""; + $(checkedItems).each(function() { + var bib = $(this).val(); + bibs += bib + "/"; + }); + + newloc = "/cgi-bin/koha/tools/batch_delete_records.pl?op=list&type=biblio&bib_list=" + bibs; + + window.opener.location = newloc; + window.close(); +} +[% END %] $(document).ready(function(){ $("#items-popover").popover(); $("#CheckAll").click(function(){ @@ -101,12 +121,6 @@ function placeHold () { [% END %] -
- Actions - -
Print Empty and close Hide window @@ -126,6 +140,10 @@ function placeHold () { | Place hold [% END %] +[% IF CAN_user_tools_records_batchdel %] + | Batch delete +[% END %] +

[% END %]
[% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %] @@ -294,6 +312,10 @@ function placeHold () { | Place hold [% END %] +[% IF CAN_user_tools_records_batchdel %] + | Batch delete +[% END %] + [% END %]

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 6afc7bf5f8..182cc8b705 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 @@ -37,7 +37,7 @@ $(document).ready(function() { $(this).attr('title', MSG_CANNOT_BE_DELETED) $(this).attr('disabled', true); $(this).attr('checked', false); - $(this).parents('tr').find('td').css('background-color', 'red'); + $(this).parents('tr').find('td').css('background-color', '#ffff99'); }); [% END %] @@ -92,22 +92,22 @@ $(document).ready(function() { [% ELSIF message.code == 'authority_not_exists' %] The authority id [% message.authid %] does not exist in the database. [% ELSIF message.code == 'item_issued' %] - At least one item issued for the biblio [% message.biblionumber %]. + At least one item is checked out on bibliographic record [% message.biblionumber %]. [% ELSIF message.code == 'reserve_not_cancelled' %] - The biblio [% message.biblionumber %] has not been deleted. A reserve (reserve_id [% message.reserve_id %]) caused an error on cancel. + Bibliographic record [% message.biblionumber %] was not deleted. A hold could not be canceled (reserve_id [% message.reserve_id %]). [% ELSIF message.code == 'item_not_deleted' %] - The biblio [% message.biblionumber %] has not been deleted. An item (itemnumber [% message.itemnumber %]) caused an error on delete. + The bibliographic record [% message.biblionumber %] was not deleted. An error was encountered when deleting an item (itemnumber [% message.itemnumber %]). [% ELSIF message.code == 'biblio_not_deleted' %] - The biblio [% message.biblionumber %] has not been deleted. An error occurred on deleting it. + Bibliographic record [% message.biblionumber %] was not deleted. An error occurred. [% ELSIF message.code == 'authority_not_deleted' %] - The authority [% message.authid %] has not been deleted. An error occurred on deleting it. + Authority record [% message.authid %] was not deleted. An error occurred. [% ELSIF message.code == 'biblio_deleted' %] - The biblio [% message.biblionumber %] has successfully been deleted. + Bibliographic record [% message.biblionumber %] has been deleted successfully. [% ELSIF message.code == 'authority_deleted' %] - The authority [% message.authid %] has successfully been deleted. + Authority [% message.authid %] has been deleted successfully. [% END %] [% IF message.error %] - (The error was: [% message.error%], see the Koha logfile for more information). + (The error was: [% message.error%], see the Koha log file for more information). [% END %] [% END %] @@ -116,7 +116,7 @@ $(document).ready(function() {
Record type
    -
  1. +
@@ -159,15 +159,15 @@ $(document).ready(function() { Title Items Holds - Issues + Checkouts [% FOR biblio IN records %] - - [% biblio.biblionumber %] - [% biblio.title %] + + + [% INCLUDE 'biblio-default-view.inc' biblionumber=biblio.biblionumber %][% biblio.title %][% IF ( biblio.subtitle ) %][% FOREACH subtitle IN biblio.subtitle %] [% subtitle.subfield |html %][% END %][% END %] [% biblio.itemnumbers.size %] [% biblio.reserves.size %] [% biblio.issues_count %] @@ -175,7 +175,7 @@ $(document).ready(function() { [% END %] -
Reminder: this action will delete all selected biblios, attached subscriptions, existing holds and items!
+
Reminder: this action will delete all selected bibliographic records, attached subscriptions, existing holds, and attached items!
[% ELSE %]
Select all @@ -198,7 +198,7 @@ $(document).ready(function() { [% authority.authid %] [% PROCESS authresult summary=authority.summary %] - [% authority.count_usage %] biblio(s) + [% authority.count_usage %] record(s) [% END %] @@ -213,15 +213,15 @@ $(document).ready(function() { [% ELSE %] - There is no record ids defined. + There are no record ids defined. [% END %] [% ELSIF op == 'report' %] [% IF report.total_records == report.total_success %] - All records have successfully been deleted! + All records have been deleted successfully! [% ELSIF report.total_success == 0 %] - No record has been deleted, some errors occurred. + No record has been deleted. An error occurred. [% ELSE %] - [% report.total_success %] / [% report.total_records %] records have successfully been deleted but some errors occurred. + [% report.total_success %] / [% report.total_records %] records have been deleted successfully but some errors occurred. [% END %]

New batch record deletion

[% ELSE %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt index 82dffca1b9..a87857c990 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt @@ -124,7 +124,7 @@ [% IF CAN_user_tools_records_batchdel %]
Batch record deletion
-
Delete a batch of records (biblios or authorities)
+
Delete a batch of records (bibliographic or authority)
[% END %] [% IF ( CAN_user_tools_export_catalog ) %] diff --git a/tools/batch_delete_records.pl b/tools/batch_delete_records.pl index 8376d6026e..b0523d536c 100755 --- a/tools/batch_delete_records.pl +++ b/tools/batch_delete_records.pl @@ -77,6 +77,8 @@ if ( $op eq 'form' ) { }; next; } + my $record = &GetMarcBiblio( $record_id ); + $biblio->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $record_id ) ); $biblio->{itemnumbers} = C4::Items::GetItemnumbersForBiblio( $record_id ); $biblio->{reserves} = C4::Reserves::GetReservesFromBiblionumber({ biblionumber => $record_id }); $biblio->{issues_count} = C4::Biblio::CountItemsIssued( $record_id );