MT 2269, Follow-up : Granular permissions for items batch modification and deletion

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

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
Matthias Meusburger 2010-03-24 09:24:18 +01:00 committed by Galen Charlton
parent 4b027bc4c9
commit 7f3df2735d
10 changed files with 53 additions and 17 deletions

View file

@ -30,8 +30,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'),

View file

@ -3555,6 +3555,16 @@ if (C4::Context->preference('Version') < TransformToNum($DBversion)){
SetVersion ($DBversion);
}
$DBversion = "3.02.00.129";
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

View file

@ -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

View file

@ -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" -->

View file

@ -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 -->

View file

@ -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> &rsaquo;
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
<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>

View file

@ -6,6 +6,7 @@
//<![CDATA[
$(document).ready(function() {
$("#itemst").tablesorter();
});
//]]>
</script>

View file

@ -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" -->

View file

@ -10,7 +10,7 @@
use strict;
sub kohaversion {
our $VERSION = '3.01.00.128';
our $VERSION = '3.01.00.129';
# version needs to be set this way
# so that it can be picked up by Makefile.PL
# during install

View file

@ -49,7 +49,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' };
}
@ -99,7 +99,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) {