Bugzilla – Attachment 32075 Details for
Bug 7290
New permission for receiving all (independent of library)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7290: QA fixes
Bug-7290-QA-fixes.patch (text/plain), 4.69 KB, created by
Julian Maurice
on 2014-10-09 08:16:52 UTC
(
hide
)
Description:
Bug 7290: QA fixes
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2014-10-09 08:16:52 UTC
Size:
4.69 KB
patch
obsolete
>From 25b7363a925c5de228090af565041c0fad6511b2 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Wed, 30 Jul 2014 16:28:14 +0200 >Subject: [PATCH] Bug 7290: QA fixes > >1) Use the new isSuperlibrarian instead of $userflags->{superlibrarian} >2) Update the database update comment >3) Fix capitalization of "Duplicate Barcode" >4) Add comments in t/Acquisition/CanUserReceiveBasket.t >--- > C4/Acquisition.pm | 2 +- > installer/data/mysql/updatedatabase.pl | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt | 2 +- > t/Acquisition/CanUserReceiveBasket.t | 8 ++++++++ > 4 files changed, 11 insertions(+), 3 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 03a7e84..ae10bc6 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -867,7 +867,7 @@ sub CanUserReceiveOrder { > > my $branch = C4::Context->userenv->{'branch'}; > >- unless ($userflags->{superlibrarian} >+ unless (C4::Context->IsSuperLibrarian() > || (!ref $userflags->{acquisition} && $userflags->{acquisition}) > || (ref $userflags->{acquisition} && $userflags->{acquisition}->{order_receive_all}) ) > { >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index a3b2144..33880f4 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -8787,7 +8787,7 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > INSERT INTO permissions (module_bit, code, description) > VALUES (11, 'order_receive_all', 'Receive all orders') > "); >- print "Upgrade to $DBversion done (Add aqorders.branch and permission order_receive_all)\n"; >+ print "Upgrade to $DBversion done (Bug 7290: Add permission order_receive_all)\n"; > SetVersion($DBversion); > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >index 9f0065f..f303c44 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >@@ -170,7 +170,7 @@ > <li> > [% error.error_param %] > [% IF ( error.error_duplicate_barcode ) %] >- Duplicate Barcode >+ Duplicate barcode > [% ELSIF (error.error_cannot_receive_order) %] > You were not authorised to receive this order > [% END %] >diff --git a/t/Acquisition/CanUserReceiveBasket.t b/t/Acquisition/CanUserReceiveBasket.t >index f0a7453..b0eb385 100644 >--- a/t/Acquisition/CanUserReceiveBasket.t >+++ b/t/Acquisition/CanUserReceiveBasket.t >@@ -37,28 +37,36 @@ my $order3 = { > > $userenv->{branch} = 'B1'; > >+# User can receive any orders thanks to his permissions > ok( CanUserReceiveOrder($borrower, $order1, {superlibrarian => 1}) ); > ok( CanUserReceiveOrder($borrower, $order1, {acquisition => 1}) ); > ok( CanUserReceiveOrder($borrower, $order1, {acquisition => { order_receive_all => 1 }}) ); > >+# User cannot receive any order because of his lack of permission > ok( not CanUserReceiveOrder($borrower, $order1, {}) ); > ok( not CanUserReceiveOrder($borrower, $order1, {acquisition => 0}) ); > ok( not CanUserReceiveOrder($borrower, $order1, {acquisition => { order_receive => 0 }}) ); > >+# User with order_receive permission can receive only orders of his branch (B1) >+# and orders that don't belong to any branch > ok( CanUserReceiveOrder($borrower, $order1, {acquisition => { order_receive => 1 }}) ); > ok( CanUserReceiveOrder($borrower, $order2, {acquisition => { order_receive => 1 }}) ); > ok( not CanUserReceiveOrder($borrower, $order3, {acquisition => { order_receive => 1 }}) ); > > $userenv->{branch} = 'B2'; > >+# User can receive any order thanks to his permissions > ok( CanUserReceiveOrder($borrower, $order1, {superlibrarian => 1}) ); > ok( CanUserReceiveOrder($borrower, $order1, {acquisition => 1}) ); > ok( CanUserReceiveOrder($borrower, $order1, {acquisition => { order_receive_all => 1 }}) ); > >+# User cannot receive any order because of his lack of permission > ok( not CanUserReceiveOrder($borrower, $order1, {}) ); > ok( not CanUserReceiveOrder($borrower, $order1, {acquisition => 0}) ); > ok( not CanUserReceiveOrder($borrower, $order1, {acquisition => { order_receive => 0 }}) ); > >+# User with order_receive permission can receive only orders of his branch (B2) >+# and orders that don't belong to any branch > ok( CanUserReceiveOrder($borrower, $order1, {acquisition => { order_receive => 1 }}) ); > ok( not CanUserReceiveOrder($borrower, $order2, {acquisition => { order_receive => 1 }}) ); > ok( CanUserReceiveOrder($borrower, $order3, {acquisition => { order_receive => 1 }}) ); >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7290
:
9314
|
9399
|
9944
|
11444
|
13214
|
14517
|
25068
|
26669
|
26671
|
26676
|
28386
|
28387
|
28388
|
28405
|
28406
|
28407
|
30337
|
30338
|
30339
|
30340
|
30926
|
30927
|
30928
|
32074
|
32075
|
32076
|
32077
|
35700
|
35701
|
35702
|
35935
|
35936
|
35937