From 39d70cf05bf8633d96c4e38bb88815a38925f918 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Thu, 27 May 2010 22:03:36 +0200 Subject: [PATCH] MT2938 : Adds a permission for editing items This patch adds a permission on edit_items Signed-off-by: Galen Charlton --- catalogue/updateitem.pl | 1 + cataloguing/additem.pl | 4 ++-- installer/data/mysql/en/mandatory/userpermissions.sql | 1 + .../data/mysql/fr-FR/1-Obligatoire/userpermissions.sql | 1 + installer/data/mysql/updatedatabase.pl | 10 ++++++++++ .../prog/en/modules/catalogue/moredetail.tmpl | 2 +- 6 files changed, 16 insertions(+), 3 deletions(-) diff --git a/catalogue/updateitem.pl b/catalogue/updateitem.pl index 3ec1fe7553..01a16054ce 100755 --- a/catalogue/updateitem.pl +++ b/catalogue/updateitem.pl @@ -57,6 +57,7 @@ for ($damaged,$itemlost,$wthdrawn) { # modify MARC item if input differs from items table. my $item_changes = {}; if (defined $itemnotes) { # i.e., itemnotes parameter passed from form + my ($loggedinuser, $cookie, $sessionID) = checkauth($cgi, 0, {editcatalogue => 'edit_items'}, 'intranet'); if ((not defined $item_data_hashref->{'itemnotes'}) or $itemnotes ne $item_data_hashref->{'itemnotes'}) { $item_changes->{'itemnotes'} = $itemnotes; } diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index bd3876eed3..ea4daf93e1 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -81,11 +81,11 @@ my $frameworkcode = &GetFrameworkCode($biblionumber); # Defining which userflag is needing according to the framework currently used my $userflags; if (defined $input->param('frameworkcode')) { - $userflags = ($input->param('frameworkcode') eq 'FA') ? "fast_cataloging" : "edit_catalogue"; + $userflags = ($input->param('frameworkcode') eq 'FA') ? "fast_cataloging" : "edit_items"; } if (not defined $userflags) { - $userflags = ($frameworkcode eq 'FA') ? "fast_cataloging" : "edit_catalogue"; + $userflags = ($frameworkcode eq 'FA') ? "fast_cataloging" : "edit_items"; } my ($template, $loggedinuser, $cookie) diff --git a/installer/data/mysql/en/mandatory/userpermissions.sql b/installer/data/mysql/en/mandatory/userpermissions.sql index a392c142e5..287d9da0a6 100644 --- a/installer/data/mysql/en/mandatory/userpermissions.sql +++ b/installer/data/mysql/en/mandatory/userpermissions.sql @@ -5,6 +5,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 6, 'modify_holds_priority', 'Modify holds priority'), ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'), ( 9, 'fast_cataloging', 'Fast cataloging'), + ( 9, 'edit_items', 'Edit Items'), (11, 'vendors_manage', 'Manage vendors'), (11, 'contracts_manage', 'Manage contracts'), (11, 'period_manage', 'Manage periods'), diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql index f00fa74634..a300256c66 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql @@ -5,6 +5,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 6, 'modify_holds_priority', 'Modifier la priorité des réservations'), ( 9, 'edit_catalogue', 'Ajouter et modifier les notices du catalogue'), ( 9, 'fast_cataloging', 'Catalogage rapide'), + ( 9, 'edit_items', 'Modification des exemplaires'), (13, 'edit_news', 'Ecrire des nouvelles pour l''OPAC et l''interface professionnelle'), (13, 'label_creator', 'Créer des étiquettes à partir des données du catalogues et des adhérents'), (13, 'edit_calendar', 'Définir les jours de fermeture de la bibliothèque'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index d4e67c0418..1d9065675a 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3615,6 +3615,16 @@ if (C4::Context->preference('Version') < TransformToNum($DBversion)){ SetVersion ($DBversion); } +$DBversion = '3.01.00.136'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do(qq{ +INSERT INTO permissions (module_bit, code, description) VALUES + ( 9, 'edit_items', 'Edit Items');}); + print "Upgrade to $DBversion done Adding a new permission to edit items"; + SetVersion ($DBversion); +} + + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl index 93a46a5513..8577193ca2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl @@ -167,7 +167,7 @@
  • Previous Borrower: "> 
  • Paid for?:  
  • Public Note: - +
    " /> " />" /> -- 2.39.5