From b3183f16e55f251003583a741b06bdfa635b1f07 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 30 Mar 2015 13:17:26 +0200 Subject: [PATCH] ug 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. Signed-off-by: Nicole Engard Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- cataloguing/addbiblio.pl | 7 ++++--- .../prog/en/includes/cat-toolbar.inc | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 93ef3efb68..9013a4e4be 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 97da6c3482..ee39f310aa 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 %]; @@ -159,15 +159,15 @@ CAN_user_serials_create_subscription ) %] [% END %] -[% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || CAN_user_tools_items_batchmod || CAN_user_tools_items_batchdel ) %] +[% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || CAN_user_tools_items_batchmod || CAN_user_tools_items_batchdel ) or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]