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 237-242 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
                <li>
241
                <li>
241
                    <label for="branchcode">Library: </label>
242
                    <label for="branchcode">Library: </label>
242
                    <select id="branchcode" name="branchcode">
243
                    <select id="branchcode" name="branchcode">
Lines 248-253 Link Here
248
                        [% PROCESS options_for_libraries libraries => Branches.all( selected => additional_content.branchcode, unfiltered => 1, ) %]
249
                        [% PROCESS options_for_libraries libraries => Branches.all( selected => additional_content.branchcode, unfiltered => 1, ) %]
249
                    </select>
250
                    </select>
250
                </li>
251
                </li>
252
                [% END %]
251
                [% UNLESS languages.size %]
253
                [% UNLESS languages.size %]
252
                    <li>
254
                    <li>
253
                        [% IF category == 'news' %]
255
                        [% IF category == 'news' %]
Lines 403-409 Link Here
403
                            [% SET default_localization = c.default_localization %]
405
                            [% SET default_localization = c.default_localization %]
404
                            [% IF ( c.is_expired ) %]<tr class="expired">[% ELSE %]<tr>[% END %]
406
                            [% IF ( c.is_expired ) %]<tr class="expired">[% ELSE %]<tr>[% END %]
405
                            <td>
407
                            <td>
408
                            [% UNLESS ( my_branch && my_branch != c.branchcode ) %]
406
                                <input type="checkbox" name="ids" value="[% c.id | html %]" />
409
                                <input type="checkbox" name="ids" value="[% c.id | html %]" />
410
                            [% END %]
407
                            </td>
411
                            </td>
408
                            <td>
412
                            <td>
409
                                [% IF c.category == 'news' || c.category == 'pages' %]
413
                                [% IF c.category == 'news' || c.category == 'pages' %]
Lines 462-467 Link Here
462
                                </div>
466
                                </div>
463
                            </td>
467
                            </td>
464
                            <td class="actions">
468
                            <td class="actions">
469
                            [% UNLESS ( my_branch && my_branch != c.branchcode ) %]
465
                                <div class="btn-group dropup">
470
                                <div class="btn-group dropup">
466
                                    <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
                                    <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">
467
472
Lines 479-484 Link Here
479
                                <div class="btn-group">
484
                                <div class="btn-group">
480
                                    <a href="#" class="delete_news btn btn-default btn-xs" data-id="[% c.id | html %]"><i class="fa fa-trash-can"></i> Delete</a>
485
                                    <a href="#" class="delete_news btn btn-default btn-xs" data-id="[% c.id | html %]"><i class="fa fa-trash-can"></i> Delete</a>
481
                                </div>
486
                                </div>
487
                            [% END %]
482
                            </td>
488
                            </td>
483
                        </tr>
489
                        </tr>
484
                        [% END %]
490
                        [% END %]
(-)a/tools/additional-contents.pl (-4 / +9 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-78 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(
75
        additional_content => $additional_content,
80
        my_branch           => $my_branch,
81
        additional_content  => $additional_content,
76
        translated_contents => $translated_contents,
82
        translated_contents => $translated_contents,
77
    );
83
    );
78
}
84
}
Lines 80-86 elsif ( $op eq 'cud-add_validate' ) { Link Here
80
    output_and_exit_if_error( $cgi, $cookie, $template, { check => 'csrf_token' } );
86
    output_and_exit_if_error( $cgi, $cookie, $template, { check => 'csrf_token' } );
81
    my $location   = $cgi->param('location');
87
    my $location   = $cgi->param('location');
82
    my $code       = $cgi->param('code');
88
    my $code       = $cgi->param('code');
83
    my $branchcode = $cgi->param('branchcode') || undef;
89
    my $branchcode = $my_branch ? $my_branch : $cgi->param('branchcode') || undef;
84
90
85
    my @lang       = $cgi->multi_param('lang');
91
    my @lang       = $cgi->multi_param('lang');
86
92
Lines 223-229 if ( $op eq 'list' ) { Link Here
223
        { category => $category, 'additional_contents_localizations.lang' => 'default' },
229
        { category => $category, 'additional_contents_localizations.lang' => 'default' },
224
        { order_by => { -desc => 'published_on' }, join => 'additional_contents_localizations' }
230
        { order_by => { -desc => 'published_on' }, join => 'additional_contents_localizations' }
225
    );
231
    );
226
    $template->param( additional_contents => $additional_contents );
232
    $template->param( additional_contents => $additional_contents, my_branch => $my_branch );
227
}
233
}
228
234
229
my $translated_languages = C4::Languages::getTranslatedLanguages;
235
my $translated_languages = C4::Languages::getTranslatedLanguages;
230
- 

Return to bug 34631