From 1e68a58b238e2461b2b28d8cc9f9db357af383df Mon Sep 17 00:00:00 2001
From: Owen Leonard
Date: Tue, 28 Oct 2014 10:07:22 -0400
Subject: [PATCH] Bug 12403 [Follow-up] Batch record deletion
This follow-up makes several changes to language and markup with one
change in behavior:
- Updated permission description to avoid the use of the term "biblio"
- Updated batch delete template to avoid the use of the term
"biblio" and to improve clarity.
- Replaced instances of terms "issue" and "reserve" with "checkout" and
"hold" respectively.
- On bibliographic record batch delete, wrap biblionumber in .
- On bibliographic record batch delete, show subtitle via Keywords to
MARC mapping.
- On bibliographic record batch delete, respect BiblioDefaultView system
preference.
- In the staff client cart, move batch delete link from "Action" menu
to text link below (alongside "add to list" and "place hold"). The
buttons are actions which affect the whole Cart. The links are actions
which can be applied to selected items. I think this change makes it
more consistent with the kind of operation being performed.
To test:
- Submit a batch of bibliographic records and confirm that the
list of titles shows subtitle data as defined in Keywords to MARC
mapping. Confirm also that the title links respect your
BiblioDefaultView system preference.
- Perform a catalog search, select several titles, and add them to the
Cart. Open the Cart and test the "Batch delete" link with and without
titles selected. Test as a user who lacks batch biblio delete
permission and confirm that the link does not appear.
Signed-off-by: Bernardo Gonzalez Kriegel
Work as described, no koha-qa errors
I love the rewording, we always translated 'biblio' as 'bibliographic record',
it makes a lot of sense.
Tested using direct input of biblionumber or cart, subtitle display shows
correctly, link respect preference, user without permission cant acces the
tool or links.
Signed-off-by: Katrin Fischer
Signed-off-by: Tomas Cohen Arazi
---
.../mysql/de-DE/mandatory/userpermissions.sql | 2 +-
.../mysql/en/mandatory/userpermissions.sql | 2 +-
.../mysql/es-ES/mandatory/userpermissions.sql | 2 +-
.../fr-FR/1-Obligatoire/userpermissions.sql | 2 +-
.../mysql/it-IT/necessari/userpermissions.sql | 2 +-
.../nb-NO/1-Obligatorisk/userpermissions.sql | 2 +-
.../mysql/pl-PL/mandatory/userpermissions.sql | 2 +-
.../mandatory/permissions_and_user_flags.sql | 2 +-
.../mandatory/permissions_and_user_flags.sql | 2 +-
installer/data/mysql/updatedatabase.pl | 4 +-
.../prog/en/modules/basket/basket.tt | 34 +++++++++++++---
.../en/modules/tools/batch_delete_records.tt | 40 +++++++++----------
.../prog/en/modules/tools/tools-home.tt | 2 +-
tools/batch_delete_records.pl | 2 +
14 files changed, 62 insertions(+), 38 deletions(-)
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 %]
-
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 %]