Bugzilla – Attachment 16803 Details for
Bug 8435
new permissions on subscriptions "superserials"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 8435: Fix hide subscriptions if not allow
PASSED-QA-Bug-8435-Fix-hide-subscriptions-if-not-a.patch (text/plain), 3.74 KB, created by
Katrin Fischer
on 2013-03-22 15:11:09 UTC
(
hide
)
Description:
[PASSED QA] Bug 8435: Fix hide subscriptions if not allow
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2013-03-22 15:11:09 UTC
Size:
3.74 KB
patch
obsolete
>From c311e046f11723da2610b57c37f88529af2e0b9f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 22 Mar 2013 11:33:46 +0100 >Subject: [PATCH] [PASSED QA] Bug 8435: Fix hide subscriptions if not allow > >If a user does not have the superserials permission and the syspref >IndependantBranches is ON, he cannot show subscriptions from others >branches. > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >--- > C4/Serials.pm | 4 ++++ > .../prog/en/modules/serials/serials-search.tt | 4 +++- > serials/serials-search.pl | 7 ++++--- > 3 files changed, 11 insertions(+), 4 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index d820c21..108a097 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -676,6 +676,9 @@ sub SearchSubscriptions { > > for my $subscription ( @$results ) { > $subscription->{cannotedit} = not can_edit_subscription( $subscription ); >+ $subscription->{cannotdisplay} = >+ ( C4::Context->preference("IndependantBranches") >+ and $subscription->{branchcode} ne C4::Context->userenv->{'branch'} ) ? 1 : 0; > } > > return @$results; >@@ -2503,6 +2506,7 @@ sub can_edit_subscription { > return 1 unless $independant_branches; > if( $flags % 2 == 1 > or C4::Auth::haspermission( $userid, {serials => 'superserials'}), >+ or C4::Auth::haspermission( $userid, {serials => 'edit_subscription'}), > or not defined $subscription->{branchcode} > or $subscription->{branchcode} eq '' > or $subscription->{branchcode} eq C4::Context->userenv->{'branch'} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >index 60d1231..8609027 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >@@ -141,7 +141,7 @@ > </tfoot> > <tbody> > [% FOREACH subscription IN openedsubscriptions %] >- [% UNLESS subscription.cannotedit %] >+ [% UNLESS subscription.cannotdisplay %] > <tr> > <td> > [% IF ( subscription.issn ) %][% subscription.issn %] >@@ -218,6 +218,7 @@ > </tfoot> > <tbody> > [% FOREACH subscription IN closedsubscriptions %] >+ [% UNLESS subscription.cannotdisplay %] > <tr> > <td> > [% IF ( subscription.issn ) %] >@@ -249,6 +250,7 @@ > </td> > </tr> > [% END %] >+ [% END %] > </tbody> > </table> > [% ELSE %] >diff --git a/serials/serials-search.pl b/serials/serials-search.pl >index 465c1a5..0bcb8f9 100755 >--- a/serials/serials-search.pl >+++ b/serials/serials-search.pl >@@ -96,9 +96,11 @@ if ($routing) { > my (@openedsubscriptions, @closedsubscriptions); > for my $sub ( @subscriptions ) { > unless ( $sub->{closed} ) { >- push @openedsubscriptions, $sub; >+ push @openedsubscriptions, $sub >+ unless $sub->{cannotdisplay}; > } else { >- push @closedsubscriptions, $sub; >+ push @closedsubscriptions, $sub >+ unless $sub->{cannotdisplay}; > } > } > >@@ -127,7 +129,6 @@ $template->param( > branches_loop => \@branches_loop, > done_searched => $searched, > routing => $routing, >- size => scalar ( map {$_->{cannotedit} ? () : 1} @subscriptions ), > marcflavour => (uc(C4::Context->preference("marcflavour"))) > ); > >-- >1.7.9.5
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 8435
:
10821
|
11377
|
11411
|
11892
|
13396
|
15673
|
16404
|
16462
|
16740
|
16750
|
16751
|
16798
|
16799
|
16801
|
16802
|
16803
|
16943
|
16944
|
19260
|
19261
|
19266
|
19268
|
20536
|
21286
|
21287
|
21288
|
21289
|
22624
|
22625
|
22626
|
22627
|
22628