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 239-244 Link Here
239
                    </select>
239
                    </select>
240
                    [% INCLUDE 'html-customization-help.inc' %]
240
                    [% INCLUDE 'html-customization-help.inc' %]
241
                </li>
241
                </li>
242
                [% UNLESS my_branch %]
242
                <li>
243
                <li>
243
                    <label for="branchcode">Library: </label>
244
                    <label for="branchcode">Library: </label>
244
                    <select id="branchcode" name="branchcode">
245
                    <select id="branchcode" name="branchcode">
Lines 250-255 Link Here
250
                        [% PROCESS options_for_libraries libraries => Branches.all( selected => additional_content.branchcode, unfiltered => 1, ) %]
251
                        [% PROCESS options_for_libraries libraries => Branches.all( selected => additional_content.branchcode, unfiltered => 1, ) %]
251
                    </select>
252
                    </select>
252
                </li>
253
                </li>
254
                [% END %]
253
                [% UNLESS languages.size %]
255
                [% UNLESS languages.size %]
254
                    <li>
256
                    <li>
255
                        [% IF category == 'news' %]
257
                        [% IF category == 'news' %]
Lines 404-410 Link Here
404
                            [% SET default_localization = c.default_localization %]
406
                            [% SET default_localization = c.default_localization %]
405
                            [% IF ( c.is_expired ) %]<tr class="expired">[% ELSE %]<tr>[% END %]
407
                            [% IF ( c.is_expired ) %]<tr class="expired">[% ELSE %]<tr>[% END %]
406
                            <td>
408
                            <td>
409
                            [% UNLESS ( my_branch && my_branch != c.branchcode ) %]
407
                                <input type="checkbox" name="ids" value="[% c.id | html %]" />
410
                                <input type="checkbox" name="ids" value="[% c.id | html %]" />
411
                            [% END %]
408
                            </td>
412
                            </td>
409
                            <td>
413
                            <td>
410
                                [% IF c.category == 'news' || c.category == 'pages' %]
414
                                [% IF c.category == 'news' || c.category == 'pages' %]
Lines 460-465 Link Here
460
                                </div>
464
                                </div>
461
                            </td>
465
                            </td>
462
                            <td class="actions">
466
                            <td class="actions">
467
                            [% UNLESS ( my_branch && my_branch != c.branchcode ) %]
463
                                <div class="btn-group dropup">
468
                                <div class="btn-group dropup">
464
                                    <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-toggle="dropdown">
469
                                    <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-toggle="dropdown">
465
                                        <span class="caret"></span>
470
                                        <span class="caret"></span>
Lines 477-482 Link Here
477
                                <div class="btn-group">
482
                                <div class="btn-group">
478
                                    <a href="#" class="delete_news btn btn-default btn-xs" data-id="[% c.id | html %]"><i class="fa fa-trash-can"></i> Delete</a>
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>
479
                                </div>
484
                                </div>
485
                            [% END %]
480
                            </td>
486
                            </td>
481
                        </tr>
487
                        </tr>
482
                        [% END %]
488
                        [% 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