View | Details | Raw Unified | Return to bug 8435
Collapse All | Expand All

(-)a/C4/Serials.pm (+4 lines)
Lines 676-681 sub SearchSubscriptions { Link Here
676
676
677
    for my $subscription ( @$results ) {
677
    for my $subscription ( @$results ) {
678
        $subscription->{cannotedit} = not can_edit_subscription( $subscription );
678
        $subscription->{cannotedit} = not can_edit_subscription( $subscription );
679
        $subscription->{cannotdisplay} =
680
            ( C4::Context->preference("IndependantBranches")
681
                and $subscription->{branchcode} ne C4::Context->userenv->{'branch'} ) ? 1 : 0;
679
    }
682
    }
680
683
681
    return @$results;
684
    return @$results;
Lines 2503-2508 sub can_edit_subscription { Link Here
2503
    return 1 unless $independant_branches;
2506
    return 1 unless $independant_branches;
2504
    if( $flags % 2 == 1
2507
    if( $flags % 2 == 1
2505
        or C4::Auth::haspermission( $userid, {serials => 'superserials'}),
2508
        or C4::Auth::haspermission( $userid, {serials => 'superserials'}),
2509
        or C4::Auth::haspermission( $userid, {serials => 'edit_subscription'}),
2506
        or not defined $subscription->{branchcode}
2510
        or not defined $subscription->{branchcode}
2507
        or $subscription->{branchcode} eq ''
2511
        or $subscription->{branchcode} eq ''
2508
        or $subscription->{branchcode} eq C4::Context->userenv->{'branch'}
2512
        or $subscription->{branchcode} eq C4::Context->userenv->{'branch'}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt (-1 / +3 lines)
Lines 141-147 Link Here
141
                  </tfoot>
141
                  </tfoot>
142
                  <tbody>
142
                  <tbody>
143
                    [% FOREACH subscription IN openedsubscriptions %]
143
                    [% FOREACH subscription IN openedsubscriptions %]
144
                    [% UNLESS subscription.cannotedit %]
144
                    [% UNLESS subscription.cannotdisplay %]
145
                      <tr>
145
                      <tr>
146
                        <td>
146
                        <td>
147
                        [% IF ( subscription.issn ) %][% subscription.issn %]
147
                        [% IF ( subscription.issn ) %][% subscription.issn %]
Lines 218-223 Link Here
218
                  </tfoot>
218
                  </tfoot>
219
                  <tbody>
219
                  <tbody>
220
                    [% FOREACH subscription IN closedsubscriptions %]
220
                    [% FOREACH subscription IN closedsubscriptions %]
221
                    [% UNLESS subscription.cannotdisplay %]
221
                      <tr>
222
                      <tr>
222
                        <td>
223
                        <td>
223
                          [% IF ( subscription.issn ) %]
224
                          [% IF ( subscription.issn ) %]
Lines 249-254 Link Here
249
                        </td>
250
                        </td>
250
                      </tr>
251
                      </tr>
251
                    [% END %]
252
                    [% END %]
253
                    [% END %]
252
                  </tbody>
254
                  </tbody>
253
                </table>
255
                </table>
254
              [% ELSE %]
256
              [% ELSE %]
(-)a/serials/serials-search.pl (-4 / +4 lines)
Lines 96-104 if ($routing) { Link Here
96
my (@openedsubscriptions, @closedsubscriptions);
96
my (@openedsubscriptions, @closedsubscriptions);
97
for my $sub ( @subscriptions ) {
97
for my $sub ( @subscriptions ) {
98
    unless ( $sub->{closed} ) {
98
    unless ( $sub->{closed} ) {
99
        push @openedsubscriptions, $sub;
99
        push @openedsubscriptions, $sub
100
            unless $sub->{cannotdisplay};
100
    } else {
101
    } else {
101
        push @closedsubscriptions, $sub;
102
        push @closedsubscriptions, $sub
103
            unless $sub->{cannotdisplay};
102
    }
104
    }
103
}
105
}
104
106
Lines 127-133 $template->param( Link Here
127
    branches_loop => \@branches_loop,
129
    branches_loop => \@branches_loop,
128
    done_searched => $searched,
130
    done_searched => $searched,
129
    routing       => $routing,
131
    routing       => $routing,
130
    size          => scalar ( map {$_->{cannotedit} ? () : 1} @subscriptions ),
131
    marcflavour   => (uc(C4::Context->preference("marcflavour")))
132
    marcflavour   => (uc(C4::Context->preference("marcflavour")))
132
);
133
);
133
134
134
- 

Return to bug 8435