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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (+6 lines)
Lines 234-239 Link Here
234
                    </select>
234
                    </select>
235
                    [% INCLUDE 'html-customization-help.inc' %]
235
                    [% INCLUDE 'html-customization-help.inc' %]
236
                </li>
236
                </li>
237
                [% UNLESS my_branch %]
237
                <li>
238
                <li>
238
                    <label for="branchcode">Library: </label>
239
                    <label for="branchcode">Library: </label>
239
                    <select id="branchcode" name="branchcode">
240
                    <select id="branchcode" name="branchcode">
Lines 245-250 Link Here
245
                        [% PROCESS options_for_libraries libraries => Branches.all( selected => additional_content.branchcode, unfiltered => 1, ) %]
246
                        [% PROCESS options_for_libraries libraries => Branches.all( selected => additional_content.branchcode, unfiltered => 1, ) %]
246
                    </select>
247
                    </select>
247
                </li>
248
                </li>
249
                [% END %]
248
                [% UNLESS languages.size %]
250
                [% UNLESS languages.size %]
249
                    <li>
251
                    <li>
250
                        [% IF category == 'news' %]
252
                        [% IF category == 'news' %]
Lines 400-406 Link Here
400
                            [% SET default_localization = c.default_localization %]
402
                            [% SET default_localization = c.default_localization %]
401
                            <tr [% IF c.is_expired %]class="expired"[% END %]>
403
                            <tr [% IF c.is_expired %]class="expired"[% END %]>
402
                                <td>
404
                                <td>
405
                                [% UNLESS ( my_branch && my_branch != c.branchcode ) %]
403
                                    <input type="checkbox" name="ids" value="[% c.id | html %]" />
406
                                    <input type="checkbox" name="ids" value="[% c.id | html %]" />
407
                                [% END %]
404
                                </td>
408
                                </td>
405
                                <td>
409
                                <td>
406
                                    [% IF c.category == 'news' || c.category == 'pages' %]
410
                                    [% IF c.category == 'news' || c.category == 'pages' %]
Lines 464-469 Link Here
464
                                    </div>
468
                                    </div>
465
                                </td>
469
                                </td>
466
                                <td class="actions">
470
                                <td class="actions">
471
                                [% UNLESS ( my_branch && my_branch != c.branchcode ) %]
467
                                    <div class="btn-group dropup">
472
                                    <div class="btn-group dropup">
468
                                        <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
473
                                        <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
469
                                        ><button class="btn btn-default btn-xs dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> </button>
474
                                        ><button class="btn btn-default btn-xs dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> </button>
Lines 482-487 Link Here
482
                                    <div class="btn-group">
487
                                    <div class="btn-group">
483
                                        <a href="#" class="delete_news btn btn-default btn-xs" data-id="[% c.id | html %]"><i class="fa fa-trash-can"></i> Delete</a>
488
                                        <a href="#" class="delete_news btn btn-default btn-xs" data-id="[% c.id | html %]"><i class="fa fa-trash-can"></i> Delete</a>
484
                                    </div>
489
                                    </div>
490
                                [% END %]
485
                                </td>
491
                                </td>
486
                            </tr>
492
                            </tr>
487
                        [% END %]
493
                        [% END %]
(-)a/tools/additional-contents.pl (-3 / +8 lines)
Lines 63-68 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
63
);
63
);
64
64
65
my @messages;
65
my @messages;
66
my $my_branch =
67
    C4::Context->preference("IndependentBranches")
68
    && !C4::Context->IsSuperLibrarian()
69
    ? C4::Context->userenv()->{'branch'}
70
    : undef;
66
if ( $op eq 'add_form' ) {
71
if ( $op eq 'add_form' ) {
67
72
68
    my $additional_content = Koha::AdditionalContents->find($id);
73
    my $additional_content = Koha::AdditionalContents->find($id);
Lines 72-77 if ( $op eq 'add_form' ) { Link Here
72
        $category            = $additional_content->category;
77
        $category            = $additional_content->category;
73
    }
78
    }
74
    $template->param(
79
    $template->param(
80
        my_branch           => $my_branch,
75
        additional_content  => $additional_content,
81
        additional_content  => $additional_content,
76
        translated_contents => $translated_contents,
82
        translated_contents => $translated_contents,
77
    );
83
    );
Lines 79-85 if ( $op eq 'add_form' ) { Link Here
79
    output_and_exit_if_error( $cgi, $cookie, $template, { check => 'csrf_token' } );
85
    output_and_exit_if_error( $cgi, $cookie, $template, { check => 'csrf_token' } );
80
    my $location   = $cgi->param('location');
86
    my $location   = $cgi->param('location');
81
    my $code       = $cgi->param('code');
87
    my $code       = $cgi->param('code');
82
    my $branchcode = $cgi->param('branchcode') || undef;
88
    my $branchcode = $my_branch ? $my_branch : $cgi->param('branchcode') || undef;
83
89
84
    my @lang = $cgi->multi_param('lang');
90
    my @lang = $cgi->multi_param('lang');
85
91
Lines 227-233 if ( $op eq 'list' ) { Link Here
227
        { category => $category,                   'additional_contents_localizations.lang' => 'default' },
233
        { category => $category,                   'additional_contents_localizations.lang' => 'default' },
228
        { order_by => { -desc => 'published_on' }, join => 'additional_contents_localizations' }
234
        { order_by => { -desc => 'published_on' }, join => 'additional_contents_localizations' }
229
    );
235
    );
230
    $template->param( additional_contents => $additional_contents );
236
    $template->param( additional_contents => $additional_contents, my_branch => $my_branch );
231
}
237
}
232
238
233
my $translated_languages = C4::Languages::getTranslatedLanguages();
239
my $translated_languages = C4::Languages::getTranslatedLanguages();
234
- 

Return to bug 34631