[Koha-patches] [3.2 01/13] MT 2269, Follow-up : Granular permissions for items batch modification and deletion
Henri-Damien LAURENT
henridamien.laurent at biblibre.com
Wed Mar 24 09:24:18 CET 2010
From: Matthias Meusburger <matthias.meusburger at biblibre.com>
Change of permissions names
Change of branch title in guided reports
Add a "Select All / Clean All" on items selection
Add a link to item when a given item cannot be deleted
---
.../data/mysql/en/mandatory/userpermissions.sql | 4 ++--
installer/data/mysql/updatedatabase.pl | 11 +++++++++++
koha-tmpl/intranet-tmpl/prog/en/columns.def | 4 ++--
.../intranet-tmpl/prog/en/includes/tools-menu.inc | 4 ++--
.../prog/en/modules/tools/batchMod-del.tmpl | 14 +++++++++++++-
.../prog/en/modules/tools/batchMod-edit.tmpl | 14 +++++++++++++-
.../prog/en/modules/tools/batchMod.tmpl | 1 +
.../prog/en/modules/tools/tools-home.tmpl | 13 +++++++------
kohaversion.pl | 2 +-
tools/batchMod.pl | 4 ++--
10 files changed, 54 insertions(+), 17 deletions(-)
diff --git a/installer/data/mysql/en/mandatory/userpermissions.sql b/installer/data/mysql/en/mandatory/userpermissions.sql
index 669d2ae..287d9da 100644
--- a/installer/data/mysql/en/mandatory/userpermissions.sql
+++ b/installer/data/mysql/en/mandatory/userpermissions.sql
@@ -31,8 +31,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES
(13, 'delete_anonymize_patrons', 'Delete old borrowers and anonymize circulation history (deletes borrower reading history)'),
(13, 'batch_upload_patron_images', 'Upload patron images in batch or one at a time'),
(13, 'schedule_tasks', 'Schedule tasks to run'),
- (13, 'batchmod', 'Perform batch modification of items'),
- (13, 'batchdel', 'Perform batch deletion of items'),
+ (13, 'items_batchmod', 'Perform batch modification of items'),
+ (13, 'items_batchdel', 'Perform batch deletion of items'),
(13, 'manage_csv_profiles', 'Manage CSV export profiles'),
(13, 'moderate_tags', 'Moderate patron tags'),
(13, 'rotating_collections', 'Manage rotating collections'),
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 8aafe67..e5f6c22 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -3603,6 +3603,17 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
}
+
+$DBversion = "3.02.00.001";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("UPDATE `permissions` SET `code` = 'items_batchdel' WHERE `permissions`.`module_bit` =13 AND `permissions`.`code` = 'batchdel' LIMIT 1 ;");
+ $dbh->do("UPDATE `permissions` SET `code` = 'items_batchmod' WHERE `permissions`.`module_bit` =13 AND `permissions`.`code` = 'batchmod' LIMIT 1 ;");
+ print "Upgrade done (Change permissions names for item batch modification / deletion)\n";
+
+ SetVersion ($DBversion);
+}
+
+
=item DropAllForeignKeys($table)
Drop all foreign keys of the table $table
diff --git a/koha-tmpl/intranet-tmpl/prog/en/columns.def b/koha-tmpl/intranet-tmpl/prog/en/columns.def
index 6493288..4aa6637 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/columns.def
+++ b/koha-tmpl/intranet-tmpl/prog/en/columns.def
@@ -56,7 +56,7 @@ items.biblioitemnumber Biblioitem Number (koha internal)
items.barcode Barcode
items.dateaccessioned Accession Date
items.booksellerid Supplier ID
-items.homebranch Permanent Branch Code
+items.homebranch Home Branch
items.price Price
items.replacementprice Replacement Price
items.replacementpricedate Date Replacement Price was set
@@ -75,7 +75,7 @@ items.reserves Reserves Count
items.restricted Item Restricted
items.binding Item needs binding
items.itemnotes Item Notes
-items.holdingbranch Current Branch
+items.holdingbranch Holding Branch
items.paidfor Has Item been lost and then paid for
items.timestamp Timestamp
items.location Location
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc
index c5b81c6..a9e4450 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc
@@ -43,10 +43,10 @@
</ul>
<h5>Catalog</h5>
<ul>
- <!-- TMPL_IF NAME="CAN_user_tools_batchdel" -->
+ <!-- TMPL_IF NAME="CAN_user_tools_items_batchdel" -->
<li><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Batch deletion of items</a></li>
<!--/TMPL_IF-->
- <!-- TMPL_IF NAME="CAN_user_tools_batchmod" -->
+ <!-- TMPL_IF NAME="CAN_user_tools_items_batchmod" -->
<li><a href="/cgi-bin/koha/tools/batchMod.pl">Batch modification of items</a></li>
<!--/TMPL_IF-->
<!-- TMPL_IF NAME="CAN_user_tools_export_catalog" -->
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tmpl
index 1ba9b24..bf9b348 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tmpl
@@ -6,6 +6,17 @@
//<![CDATA[
$(document).ready(function() {
$("#itemst").tablesorter();
+ $("#selectallbutton").click(function() {
+ $("#itemst").find("input:checkbox").each(function() {
+ $(this).attr("checked", true);
+ });
+ });
+ $("#clearallbutton").click(function() {
+ $("#itemst").find("input:checkbox").each(function() {
+ $(this).attr("checked", false);
+ });
+ });
+
});
//]]>
</script>
@@ -56,6 +67,7 @@
<!-- TMPL_IF name="item_loop" -->
<div id="cataloguing_additem_itemlist">
<div style="overflow:auto">
+ <div id="toolbar"><a id="selectallbutton" href="#">Select All</a> | <a id="clearallbutton" href="#">Clear All</a></div>
<table id="itemst">
<thead>
<tr>
@@ -127,7 +139,7 @@
<!-- TMPL_LOOP name="not_deleted_loop" -->
<tr>
<td><!-- TMPL_VAR name="itemnumber" --></td>
- <td><!-- TMPL_VAR name="barcode" --></td>
+ <td><a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->"><!-- TMPL_VAR name="barcode" --></a></td>
<td><!-- TMPL_IF name="book_on_loan" -->Item is checked out<!-- TMPL_ELSIF name="book_reserved" -->Item has a waiting hold<!-- /TMPL_IF --></td>
</tr>
<!-- /TMPL_LOOP -->
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tmpl
index acc9e12..c93eec5 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tmpl
@@ -6,6 +6,17 @@
//<![CDATA[
$(document).ready(function() {
$("#itemst").tablesorter();
+ $("#selectallbutton").click(function() {
+ $("#itemst").find("input:checkbox").each(function() {
+ $(this).attr("checked", true);
+ });
+ });
+ $("#clearallbutton").click(function() {
+ $("#itemst").find("input:checkbox").each(function() {
+ $(this).attr("checked", false);
+ });
+ });
+
});
//]]>
</script>
@@ -17,7 +28,7 @@
<div id="breadcrumbs">
<a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
- <a href="/cgi-bin/koha/tools/batchMod.pl">Modify batches of notices</a>
+ <a href="/cgi-bin/koha/tools/batchMod.pl">Modify batches of items</a>
</div>
<div id="doc3" class="yui-t2">
@@ -53,6 +64,7 @@
<!-- TMPL_IF name="item_loop" -->
<div id="cataloguing_additem_itemlist">
<div style="overflow:auto">
+ <div id="toolbar"><a id="selectallbutton" href="#">Select All</a> | <a id="clearallbutton" href="#">Clear All</a></div>
<table id="itemst">
<thead>
<tr>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tmpl
index be9103a..4c34675 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tmpl
@@ -6,6 +6,7 @@
//<![CDATA[
$(document).ready(function() {
$("#itemst").tablesorter();
+
});
//]]>
</script>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tmpl
index 4490c78..a33f597 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tmpl
@@ -86,20 +86,21 @@
<dt><a href="/cgi-bin/koha/tools/scheduler.pl">Task scheduler</a></dt>
<dd>Schedule tasks to run</dd>
<!-- /TMPL_IF -->
+
</dl>
</div>
<div class="yui-u">
<h3>Catalog</h3>
<dl>
- <!-- TMPL_IF NAME="CAN_user_tools_batchdel" -->
- <dt><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Batch item deletion</a></dt>
- <dd>Perform batch deletion of items</dd>
+ <!-- TMPL_IF NAME="CAN_user_tools_items_batchmod" -->
+ <dt><a href="/cgi-bin/koha/tools/batchMod.pl">Modify a queryset of items</a></dt>
+ <dd>Perform batch modification of items</dd>
<!-- /TMPL_IF -->
- <!-- TMPL_IF NAME="CAN_user_tools_batchmod" -->
- <dt><a href="/cgi-bin/koha/tools/batchMod.pl">Batch item modification</a></dt>
- <dd>Perform batch modification of items</dd>
+ <!-- TMPL_IF NAME="CAN_user_tools_items_batchdel" -->
+ <dt><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Delete a queryset of items</a></dt>
+ <dd>Perform batch deletion of items</dd>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="CAN_user_tools_export_catalog" -->
diff --git a/kohaversion.pl b/kohaversion.pl
index 509c6e2..b231acd 100644
--- a/kohaversion.pl
+++ b/kohaversion.pl
@@ -10,7 +10,7 @@
use strict;
sub kohaversion {
- our $VERSION = '3.01.00.130';
+ our $VERSION = '3.02.00.001';
# version needs to be set this way
# so that it can be picked up by Makefile.PL
# during install
diff --git a/tools/batchMod.pl b/tools/batchMod.pl
index 9ab94d4..5e475fa 100755
--- a/tools/batchMod.pl
+++ b/tools/batchMod.pl
@@ -48,7 +48,7 @@ if (!defined $op) {
$template_flag = { tools => '*' };
} else {
$template_name = ($del) ? "tools/batchMod-del.tmpl" : "tools/batchMod-edit.tmpl";
- $template_flag = ($del) ? { tools => 'batchdel' } : { tools => 'batchmod' };
+ $template_flag = ($del) ? { tools => 'items_batchdel' } : { tools => 'items_batchmod' };
}
@@ -98,7 +98,7 @@ if ($op eq "action") {
$deleted_items++;
} else {
$not_deleted_items++;
- push @not_deleted, { itemnumber => $itemdata->{'itemnumber'}, barcode => $itemdata->{'barcode'}, title => $itemdata->{'title'}, $return => 1 };
+ push @not_deleted, { biblionumber => $itemdata->{'biblionumber'}, itemnumber => $itemdata->{'itemnumber'}, barcode => $itemdata->{'barcode'}, title => $itemdata->{'title'}, $return => 1 };
}
} else {
if ($something_to_modify) {
--
1.6.3.3
More information about the Koha-patches
mailing list