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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-2 / +8 lines)
Lines 216-221 Link Here
216
                        [% PROCESS locations_options location => additional_content.location %]
216
                        [% PROCESS locations_options location => additional_content.location %]
217
                    </select>
217
                    </select>
218
                </li>
218
                </li>
219
                [% UNLESS my_branch %]
219
                <li>
220
                <li>
220
                    <label for="branchcode">Library: </label>
221
                    <label for="branchcode">Library: </label>
221
                    <select id="branchcode" name="branchcode">
222
                    <select id="branchcode" name="branchcode">
Lines 227-232 Link Here
227
                        [% PROCESS options_for_libraries libraries => Branches.all( selected => additional_content.branchcode, unfiltered => 1, ) %]
228
                        [% PROCESS options_for_libraries libraries => Branches.all( selected => additional_content.branchcode, unfiltered => 1, ) %]
228
                    </select>
229
                    </select>
229
                </li>
230
                </li>
231
                [% END %]
230
                [% UNLESS languages.size %]
232
                [% UNLESS languages.size %]
231
                    <li>
233
                    <li>
232
                        [% IF category == 'news' %]
234
                        [% IF category == 'news' %]
Lines 366-372 Link Here
366
                        [% FOREACH c IN additional_contents%]
368
                        [% FOREACH c IN additional_contents%]
367
                            [% IF ( c.is_expired ) %]<tr class="expired">[% ELSE %]<tr>[% END %]
369
                            [% IF ( c.is_expired ) %]<tr class="expired">[% ELSE %]<tr>[% END %]
368
                            <td>
370
                            <td>
371
                            [% UNLESS ( my_branch && my_branch != c.branchcode ) %]
369
                                <input type="checkbox" name="ids" value="[% c.idnew | html %]" />
372
                                <input type="checkbox" name="ids" value="[% c.idnew | html %]" />
373
                            [% END %]
370
                            </td>
374
                            </td>
371
                            <td>
375
                            <td>
372
                                [% IF c.category == 'news' || c.category == 'pages' %]
376
                                [% IF c.category == 'news' || c.category == 'pages' %]
Lines 410-416 Link Here
410
                            [% END %]
414
                            [% END %]
411
                            <td>
415
                            <td>
412
                                <div class="btn-group">
416
                                <div class="btn-group">
413
                                    <a class="preview_news btn btn-default btn-xs" data-number="[% loop.count | html %]"><i class="fa-solid fa-eye aria-hidden="true"></i> Preview content</a>
417
                                    <a class="preview_news btn btn-default btn-xs" data-number="[% loop.count | html %]"><i class="fa-solid fa-eye" aria-hidden="true"></i> Preview content</a>
414
                                </div>
418
                                </div>
415
                                <div id="contentModal[% loop.count | html %]" class="modal" tabindex="-1" role="dialog" data-number="[% loop.count | html %]">
419
                                <div id="contentModal[% loop.count | html %]" class="modal" tabindex="-1" role="dialog" data-number="[% loop.count | html %]">
416
                                    <div class="modal-dialog" role="document">
420
                                    <div class="modal-dialog" role="document">
Lines 428-433 Link Here
428
                                </div>
432
                                </div>
429
                            </td>
433
                            </td>
430
                            <td class="actions">
434
                            <td class="actions">
435
                            [% UNLESS ( my_branch && my_branch != c.branchcode ) %]
431
                                <div class="btn-group dropup">
436
                                <div class="btn-group dropup">
432
                                    <a href="/cgi-bin/koha/tools/additional-contents.pl?op=add_form&amp;id=[% c.idnew | uri %]&editmode=[% editmode | uri %]" class="btn btn-default btn-xs"> <i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a><button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
437
                                    <a href="/cgi-bin/koha/tools/additional-contents.pl?op=add_form&amp;id=[% c.idnew | uri %]&editmode=[% editmode | uri %]" class="btn btn-default btn-xs"> <i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a><button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
433
                                        <span class="caret"></span>
438
                                        <span class="caret"></span>
Lines 445-450 Link Here
445
                                <div class="btn-group">
450
                                <div class="btn-group">
446
                                    <a href="#" class="delete_news btn btn-default btn-xs" data-idnew="[% c.idnew | html %]"><i class="fa fa-trash-can"></i> Delete</a>
451
                                    <a href="#" class="delete_news btn btn-default btn-xs" data-idnew="[% c.idnew | html %]"><i class="fa fa-trash-can"></i> Delete</a>
447
                                </div>
452
                                </div>
453
                            [% END %]
448
                            </td>
454
                            </td>
449
                        </tr>
455
                        </tr>
450
                        [% END %]
456
                        [% END %]
Lines 452-458 Link Here
452
                </table>
458
                </table>
453
                <input type="hidden" name="op" value="delete_confirmed" />
459
                <input type="hidden" name="op" value="delete_confirmed" />
454
                <input type="hidden" name="category" value="[% category | html %]" />
460
                <input type="hidden" name="category" value="[% category | html %]" />
455
                <fieldset class="action"><input type="submit" class="btn btn-primary" value="Delete selected" /></fieldset>
461
                <fieldset class="action">ssss<input type="submit" class="btn btn-primary" value="Delete selected" /></fieldset>
456
            </form>
462
            </form>
457
            <form action="/cgi-bin/koha/tools/additional-contents.pl" method="post" id="delete_single">
463
            <form action="/cgi-bin/koha/tools/additional-contents.pl" method="post" id="delete_single">
458
                [% INCLUDE 'csrf-token.inc' %]
464
                [% INCLUDE 'csrf-token.inc' %]
(-)a/tools/additional-contents.pl (-3 / +6 lines)
Lines 61-66 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
61
);
61
);
62
62
63
my @messages;
63
my @messages;
64
my $my_branch = C4::Context->preference("IndependentBranches") && !C4::Context->IsSuperLibrarian()
65
    ?  C4::Context->userenv()->{'branch'}
66
    : undef;
64
if ( $op eq 'add_form' ) {
67
if ( $op eq 'add_form' ) {
65
68
66
    my $additional_content = Koha::AdditionalContents->find($id);
69
    my $additional_content = Koha::AdditionalContents->find($id);
Lines 79-84 if ( $op eq 'add_form' ) { Link Here
79
        $category = $additional_content->category;
82
        $category = $additional_content->category;
80
    }
83
    }
81
    $template->param(
84
    $template->param(
85
        my_branch => $my_branch,
82
        additional_content => $additional_content,
86
        additional_content => $additional_content,
83
        translated_contents => $translated_contents,
87
        translated_contents => $translated_contents,
84
    );
88
    );
Lines 87-93 elsif ( $op eq 'add_validate' ) { Link Here
87
    output_and_exit_if_error($cgi, $cookie, $template, { check => 'csrf_token' });
91
    output_and_exit_if_error($cgi, $cookie, $template, { check => 'csrf_token' });
88
    my $location   = $cgi->param('location');
92
    my $location   = $cgi->param('location');
89
    my $code       = $cgi->param('code');
93
    my $code       = $cgi->param('code');
90
    my $branchcode = $cgi->param('branchcode') || undef;
94
    my $branchcode = $my_branch ? $my_branch : $cgi->param('branchcode') || undef;
91
    my $idnew      = $cgi->param('idnew');
95
    my $idnew      = $cgi->param('idnew');
92
96
93
    my @lang       = $cgi->multi_param('lang');
97
    my @lang       = $cgi->multi_param('lang');
Lines 235-241 if ( $op eq 'list' ) { Link Here
235
        { category => $category, lang => 'default' },
239
        { category => $category, lang => 'default' },
236
        { order_by => { -desc => 'published_on' } }
240
        { order_by => { -desc => 'published_on' } }
237
    );
241
    );
238
    $template->param( additional_contents => $additional_contents );
242
    $template->param( additional_contents => $additional_contents, my_branch => $my_branch );
239
}
243
}
240
244
241
my $translated_languages = C4::Languages::getTranslatedLanguages;
245
my $translated_languages = C4::Languages::getTranslatedLanguages;
242
- 

Return to bug 34631