[Koha-patches] [PATCH] bug 3817 added patron permissions for tag tool

Nicole Engard nengard at gmail.com
Mon Nov 30 16:11:38 CET 2009


>From 26e9388b652e7b7d3884408ddd127a789e8b536c Mon Sep 17 00:00:00 2001
From: Nicole Engard <nengard at gmail.com>
Date: Thu, 26 Nov 2009 08:37:03 -0500
Subject: [PATCH] bug 3817 added patron permissions for tag tool
Content-Type: text/plain; charset="utf-8"

---
 .../data/mysql/en/mandatory/userpermissions.sql    |    1 +
 installer/data/mysql/updatedatabase.pl             |    7 +++++++
 .../prog/en/modules/tools/tools-home.tmpl          |    2 +-
 tags/review.pl                                     |    2 +-
 4 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/installer/data/mysql/en/mandatory/userpermissions.sql
b/installer/data/mysql/en/mandatory/userpermissions.sql
index 29b3b05..ddaec21 100644
--- a/installer/data/mysql/en/mandatory/userpermissions.sql
+++ b/installer/data/mysql/en/mandatory/userpermissions.sql
@@ -16,4 +16,5 @@ 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, 'moderate_tags', 'Moderate patron tags')
 ;
diff --git a/installer/data/mysql/updatedatabase.pl
b/installer/data/mysql/updatedatabase.pl
index 7dd236c..513414c 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -2496,6 +2496,13 @@ if (C4::Context->preference("Version") <
TransformToNum($DBversion)) {
     print "Upgrade to $DBversion done (AllowHoldDateInFuture and
OPACAllowHoldDateInFuture sysprefs)\n";
 }

+$DBversion = 'XXX';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("INSERT INTO permissions (module_bit, code, description)
VALUES ( 13, 'moderate_tags', 'Moderate patron tags')");
+    SetVersion ($DBversion);
+    print "Upgrade to $DBversion done (added patron permission for
accessing the tags tool)\n";
+}
+
 =item DropAllForeignKeys($table)

   Drop all foreign keys of the table $table
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 be817d9..a5d1f80 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
@@ -39,7 +39,7 @@
 	<dd>Moderate patron comments</dd>
     <!-- /TMPL_IF -->

-    <!-- TMPL_IF NAME="CAN_user_tools_moderate_comments" --><!--
FIXME: Update here when Tag specific permission is created. -->
+    <!-- TMPL_IF NAME="CAN_user_tools_moderate_tags" -->
     <dt><a href="/cgi-bin/koha/tags/review.pl">Tags</a></dt>
 	<dd>Moderate patron tags</dd>
     <!-- /TMPL_IF -->
diff --git a/tags/review.pl b/tags/review.pl
index 421da4e..1dea768 100755
--- a/tags/review.pl
+++ b/tags/review.pl
@@ -35,7 +35,7 @@ use C4::Debug;
 use C4::Tags 0.03 qw(get_tags get_approval_rows approval_counts
whitelist blacklist is_approved);

 my $script_name = "/cgi-bin/koha/tags/review.pl";
-my $needed_flags = { tools => 'moderate_comments' };	# FIXME: replace
when more specific permission is created.
+my $needed_flags = { tools => 'moderate_tags' };

 sub ajax_auth_cgi ($) {		# returns CGI object
 	my $needed_flags = shift;
-- 
1.5.6.5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-bug-3817-added-patron-permissions-for-tag-tool.patch
Type: application/octet-stream
Size: 3339 bytes
Desc: not available
URL: </pipermail/koha-patches/attachments/20091130/aaa6ac49/attachment-0001.obj>


More information about the Koha-patches mailing list