From baba2cb575fbe1643c69e86431215760fb44f01d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 30 Mar 2015 13:17:26 +0200 Subject: [PATCH] Bug 7561: Fast cataloging - Allow add/edit items and delete record With the fast cataloging permission, a librarian was not able to add/edit items and to delete a record with the FA framework. This patch fixes that. Test plan: 0/ Set the permission fast_cataloging (and only this one under editcatalogue) to a librarian 1/ Log in with this account 2/ Go to Circulation > Fast cataloging 3/ Confirm you can create a record 4/ Save and confirm you can create items 5/ Confirm you are able to edit items, remove all of them and delete the record. 6/ Make sure it only works for records with the FA framework code. --- cataloguing/addbiblio.pl | 7 ++++--- koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc | 16 +++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 93ef3ef..9013a4e 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -727,14 +727,15 @@ my $fa_stickyduedate = $input->param('stickyduedate'); my $fa_duedatespec = $input->param('duedatespec'); my $userflags = 'edit_catalogue'; -if ($frameworkcode eq 'FA'){ - $userflags = 'fast_cataloging'; -} my $changed_framework = $input->param('changed_framework'); $frameworkcode = &GetFrameworkCode($biblionumber) if ( $biblionumber and not($frameworkcode) and $op ne 'addbiblio' ); +if ($frameworkcode eq 'FA'){ + $userflags = 'fast_cataloging'; +} + $frameworkcode = '' if ( $frameworkcode eq 'Default' ); my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc index 97da6c3..32992c2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -27,7 +27,7 @@ function addToShelf() { window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumber=[% biblionumber %]','Add_to_virtualshelf','width=500,height=400,toolbar=false,scrollbars=yes'); } function printBiblio() {window.print(); } -[% IF ( CAN_user_editcatalogue_edit_catalogue ) %] +[% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %] function confirm_deletion() { var count = [% count %]; var holdcount = [% holdcount %]; @@ -68,7 +68,7 @@ } [% END %] -[% IF ( CAN_user_editcatalogue_edit_items ) %] +[% IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %] function confirm_items_deletion() { var count = [% count %]; var holdcount = [% holdcount %]; @@ -163,11 +163,11 @@ CAN_user_serials_create_subscription ) %]