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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-3 / +3 lines)
Lines 237-243 Link Here
237
                    </select>
237
                    </select>
238
                    [% INCLUDE 'html-customization-help.inc' %]
238
                    [% INCLUDE 'html-customization-help.inc' %]
239
                </li>
239
                </li>
240
                [% UNLESS my_branch %]
240
                [% UNLESS my_branch_as_staff %]
241
                <li>
241
                <li>
242
                    <label for="branchcode">Library: </label>
242
                    <label for="branchcode">Library: </label>
243
                    <select id="branchcode" name="branchcode">
243
                    <select id="branchcode" name="branchcode">
Lines 404-410 Link Here
404
                            [% SET default_localization = c.default_localization %]
404
                            [% SET default_localization = c.default_localization %]
405
                            [% IF ( c.is_expired ) %]<tr class="expired">[% ELSE %]<tr>[% END %]
405
                            [% IF ( c.is_expired ) %]<tr class="expired">[% ELSE %]<tr>[% END %]
406
                            <td>
406
                            <td>
407
                            [% UNLESS ( my_branch && my_branch != c.branchcode ) %]
407
                            [% UNLESS ( my_branch_as_staff && my_branch_as_staff != c.branchcode ) %]
408
                                <input type="checkbox" name="ids" value="[% c.id | html %]" />
408
                                <input type="checkbox" name="ids" value="[% c.id | html %]" />
409
                            [% END %]
409
                            [% END %]
410
                            </td>
410
                            </td>
Lines 465-471 Link Here
465
                                </div>
465
                                </div>
466
                            </td>
466
                            </td>
467
                            <td class="actions">
467
                            <td class="actions">
468
                            [% UNLESS ( my_branch && my_branch != c.branchcode ) %]
468
                            [% UNLESS ( my_branch_as_staff && my_branch_as_staff != c.branchcode ) %]
469
                                <div class="btn-group dropup">
469
                                <div class="btn-group dropup">
470
                                    <a href="/cgi-bin/koha/tools/additional-contents.pl?op=add_form&amp;id=[% c.id | uri %]&editmode=[% editmode | uri %]" class="btn btn-default btn-xs"> <i class="fa-solid fa-pencil"></i> Edit</a><button class="btn btn-default btn-xs dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
470
                                    <a href="/cgi-bin/koha/tools/additional-contents.pl?op=add_form&amp;id=[% c.id | uri %]&editmode=[% editmode | uri %]" class="btn btn-default btn-xs"> <i class="fa-solid fa-pencil"></i> Edit</a><button class="btn btn-default btn-xs dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
471
471
(-)a/tools/additional-contents.pl (-5 / +4 lines)
Lines 63-69 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
63
);
63
);
64
64
65
my @messages;
65
my @messages;
66
my $my_branch =
66
my $my_branch_as_staff =
67
    C4::Context->preference("IndependentBranches")
67
    C4::Context->preference("IndependentBranches")
68
    && !C4::Context->IsSuperLibrarian()
68
    && !C4::Context->IsSuperLibrarian()
69
    ? C4::Context->userenv()->{'branch'}
69
    ? C4::Context->userenv()->{'branch'}
Lines 77-83 if ( $op eq 'add_form' ) { Link Here
77
        $category            = $additional_content->category;
77
        $category            = $additional_content->category;
78
    }
78
    }
79
    $template->param(
79
    $template->param(
80
        my_branch           => $my_branch,
80
        my_branch_as_staff           => $my_branch_as_staff,
81
        additional_content  => $additional_content,
81
        additional_content  => $additional_content,
82
        translated_contents => $translated_contents,
82
        translated_contents => $translated_contents,
83
    );
83
    );
Lines 86-92 elsif ( $op eq 'cud-add_validate' ) { Link Here
86
    output_and_exit_if_error( $cgi, $cookie, $template, { check => 'csrf_token' } );
86
    output_and_exit_if_error( $cgi, $cookie, $template, { check => 'csrf_token' } );
87
    my $location   = $cgi->param('location');
87
    my $location   = $cgi->param('location');
88
    my $code       = $cgi->param('code');
88
    my $code       = $cgi->param('code');
89
    my $branchcode = $my_branch ? $my_branch : $cgi->param('branchcode') || undef;
89
    my $branchcode = $my_branch_as_staff ? $my_branch_as_staff : $cgi->param('branchcode') || undef;
90
90
91
    my @lang       = $cgi->multi_param('lang');
91
    my @lang       = $cgi->multi_param('lang');
92
92
Lines 229-235 if ( $op eq 'list' ) { Link Here
229
        { category => $category, 'additional_contents_localizations.lang' => 'default' },
229
        { category => $category, 'additional_contents_localizations.lang' => 'default' },
230
        { order_by => { -desc => 'published_on' }, join => 'additional_contents_localizations' }
230
        { order_by => { -desc => 'published_on' }, join => 'additional_contents_localizations' }
231
    );
231
    );
232
    $template->param( additional_contents => $additional_contents, my_branch => $my_branch );
232
    $template->param( additional_contents => $additional_contents, my_branch_as_staff => $my_branch_as_staff );
233
}
233
}
234
234
235
my $translated_languages = C4::Languages::getTranslatedLanguages;
235
my $translated_languages = C4::Languages::getTranslatedLanguages;
236
- 

Return to bug 34631