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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc (+1 lines)
Lines 110-115 Link Here
110
    [% IF ( CAN_user_tools_edit_additional_contents ) %]
110
    [% IF ( CAN_user_tools_edit_additional_contents ) %]
111
    <li><a href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a></li>
111
    <li><a href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a></li>
112
    <li><a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a></li>
112
    <li><a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a></li>
113
    <li><a href="/cgi-bin/koha/tools/additional-contents.pl?category=pages">Pages</a></li>
113
    [% END %]
114
    [% END %]
114
    [% IF ( CAN_user_tools_schedule_tasks ) %]
115
    [% IF ( CAN_user_tools_schedule_tasks ) %]
115
	<li><a href="/cgi-bin/koha/tools/scheduler.pl">Task scheduler</a></li>
116
	<li><a href="/cgi-bin/koha/tools/scheduler.pl">Task scheduler</a></li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-19 / +51 lines)
Lines 24-29 Link Here
24
        .syspref-link::before {
24
        .syspref-link::before {
25
            content: " | ";
25
            content: " | ";
26
        }
26
        }
27
        .customisation-link::before {
28
            content: " | ";
29
        }
30
        .customisation-link:first-child::before {
31
            content: none;
32
        }
27
    </style>
33
    </style>
28
</head>
34
</head>
29
35
Lines 44-49 Link Here
44
            <li>
50
            <li>
45
                [% IF category == 'news' %]
51
                [% IF category == 'news' %]
46
                    <a href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a>
52
                    <a href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a>
53
                [% ELSIF category == 'pages' %]
54
                    <a href="/cgi-bin/koha/tools/additional-contents.pl?category=pages">Pages</a>
47
                [% ELSE %]
55
                [% ELSE %]
48
                    <a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a>
56
                    <a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a>
49
                [% END %]
57
                [% END %]
Lines 55-61 Link Here
55
                    [% ELSE %]
63
                    [% ELSE %]
56
                        <span>Add additional content</span>
64
                        <span>Add additional content</span>
57
                    [% END %]
65
                    [% END %]
58
                    ([% IF category == 'news' %]<span>News</span>[% ELSE %]<span>HTML customizations</span>[% END %])
66
                    ([% IF category == 'news' %]<span>News</span>[% ELSIF category == 'pages' %]<span>Pages</span>[% ELSE %]<span>HTML customizations</span>[% END %])
59
                </a>
67
                </a>
60
            </li>
68
            </li>
61
        [% ELSE %]
69
        [% ELSE %]
Lines 63-68 Link Here
63
                <a href="#" aria-current="page">
71
                <a href="#" aria-current="page">
64
                    [% IF category == 'news' %]
72
                    [% IF category == 'news' %]
65
                        News
73
                        News
74
                    [% ELSIF category == 'pages' %]
75
                        Pages
66
                    [% ELSE %]
76
                    [% ELSE %]
67
                        HTML customizations
77
                        HTML customizations
68
                    [% END %]
78
                    [% END %]
Lines 165-171 Link Here
165
    [% IF additional_content %]
175
    [% IF additional_content %]
166
        <h1>Modify an additional content</h1>
176
        <h1>Modify an additional content</h1>
167
    [% ELSE %]
177
    [% ELSE %]
168
        <h1>New additional content ([% IF category == 'news' %]News[% ELSE %]HTML customizations[% END %])</h1>
178
        <h1>New additional content ([% IF category == 'news' %]News[% ELSIF category == 'pages' %]Pages[% ELSE %]HTML customizations[% END %])</h1>
169
    [% END %]
179
    [% END %]
170
180
171
    <div id="toolbar" class="btn-toolbar">
181
    <div id="toolbar" class="btn-toolbar">
Lines 180-185 Link Here
180
        </div>
190
        </div>
181
        [% IF category == 'news' %]
191
        [% IF category == 'news' %]
182
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl"><i class="fa fa-remove"></i> Cancel</a>
192
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl"><i class="fa fa-remove"></i> Cancel</a>
193
        [% ELSIF category == 'pages' %]
194
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl?category=pages"><i class="fa fa-remove"></i> Cancel</a>
183
        [% ELSE %]
195
        [% ELSE %]
184
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations"><i class="fa fa-remove"></i> Cancel</a>
196
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations"><i class="fa fa-remove"></i> Cancel</a>
185
        [% END %]
197
        [% END %]
Lines 308-323 Link Here
308
        </div>
320
        </div>
309
    </div>
321
    </div>
310
322
311
    <h2>Additional contents ([% IF category == 'news' %]News[% ELSE %]HTML customizations[% END %])</h2>
323
    <h2>Additional contents ([% IF category == 'news' %]News[% ELSIF category == 'pages' %]Pages[% ELSE %]HTML customizations[% END %])</h2>
312
    [% IF category == 'news' %]
324
    <span id="additional_contents_links">
313
        See <a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a>
325
        See
314
    [% ELSE %]
326
        <a class="customisation-link" href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a>
315
        See <a href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a>
327
        <a class="customisation-link" href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a>
316
    [% END %]
328
        <a class="customisation-link" href="/cgi-bin/koha/tools/additional-contents.pl?category=pages">Pages</a>
317
    [% IF ( CAN_user_parameters_manage_sysprefs ) %]
329
        [% IF ( CAN_user_parameters_manage_sysprefs ) %]
318
        <a class="syspref-link" href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACUserJS'>OPACUserJS</a>
330
            <a class="syspref-link" href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACUserJS'>OPACUserJS</a>
319
        <a class="syspref-link" href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACUserCSS'>OPACUserCSS</a>
331
            <a class="syspref-link" href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACUserCSS'>OPACUserCSS</a>
320
    [% END %]
332
        [% END %]
333
    </span>
321
334
322
    [% IF additional_contents.count %]
335
    [% IF additional_contents.count %]
323
        <form id="del_form" method="post" action="/cgi-bin/koha/tools/additional-contents.pl">
336
        <form id="del_form" method="post" action="/cgi-bin/koha/tools/additional-contents.pl">
Lines 332-338 Link Here
332
                        <th>Expiration date</th>
345
                        <th>Expiration date</th>
333
                        <th class="anti-the">Title</th>
346
                        <th class="anti-the">Title</th>
334
                        <th>Author</th>
347
                        <th>Author</th>
335
                        <th class="anti-the">News</th>
348
                        [% IF category == 'pages' %]
349
                            <th>Page URL</th>
350
                            <th class="anti-the">Page</th>
351
                        [% ELSE %]
352
                            <th class="anti-the">News</th>
353
                        [% END %]
336
                        <th class="NoSort noExport">Actions</th>
354
                        <th class="NoSort noExport">Actions</th>
337
                    </tr>
355
                    </tr>
338
                </thead>
356
                </thead>
Lines 343-349 Link Here
343
                            <input type="checkbox" name="ids" value="[% c.idnew | html %]" />
361
                            <input type="checkbox" name="ids" value="[% c.idnew | html %]" />
344
                        </td>
362
                        </td>
345
                        <td>
363
                        <td>
346
                            [% IF c.category == 'news' %]
364
                            [% IF c.category == 'news' || c.category == 'pages' %]
347
                                [% IF c.location == 'staff_and_opac' %]<span>All</span>
365
                                [% IF c.location == 'staff_and_opac' %]<span>All</span>
348
                                [% ELSIF c.location == 'staff_only' %]<span>Librarian interface</span>
366
                                [% ELSIF c.location == 'staff_only' %]<span>Librarian interface</span>
349
                                [% ELSIF c.location == 'opac_only' %]<span>OPAC</span>
367
                                [% ELSIF c.location == 'opac_only' %]<span>OPAC</span>
Lines 365-370 Link Here
365
                        <td data-order="[% c.expirationdate | html %]">[% c.expirationdate | $KohaDates %] [% IF ( c.is_expired ) %](<span class="expired">expired</span>)[% END %]</td>
383
                        <td data-order="[% c.expirationdate | html %]">[% c.expirationdate | $KohaDates %] [% IF ( c.is_expired ) %](<span class="expired">expired</span>)[% END %]</td>
366
                        <td>[% c.title | html %]</td>
384
                        <td>[% c.title | html %]</td>
367
                        <td>[% IF ( c.author) %][% INCLUDE 'patron-title.inc' patron=c.author %][% END %]</td>
385
                        <td>[% IF ( c.author) %][% INCLUDE 'patron-title.inc' patron=c.author %][% END %]</td>
386
                        [% IF category == 'pages' %]
387
                            <td class="actions">
388
                                [% IF c.location == 'opac_only' %]
389
                                <strong>OPAC</strong>: <a target="_blank" href="[% Koha.Preference('OPACBaseURL') | url %]/cgi-bin/koha/opac-page.pl?page_id=[% c.idnew | uri %]" title="View on OPAC">[% Koha.Preference('OPACBaseURL') | url %]/cgi-bin/koha/opac-page.pl?page_id=[% c.idnew | uri %]</a>
390
                                [% ELSIF c.location == 'staff_only' %]
391
                                <strong>Librarian interface</strong>: <a href="/cgi-bin/koha/tools/page.pl?page_id=[% c.idnew | uri %]" title="View on librarian interface">[% Koha.Preference('staffClientBaseURL') | url %]/cgi-bin/koha/tools/page.pl?page_id=[% c.idnew | uri %]</a>
392
                                [% ELSIF c.location == 'staff_and_opac' %]
393
                                <strong>OPAC</strong>: <a target="_blank" href="[% Koha.Preference('OPACBaseURL') | url %]/cgi-bin/koha/opac-page.pl?page_id=[% c.idnew | uri %]" title="View on OPAC">[% Koha.Preference('OPACBaseURL') | url %]/cgi-bin/koha/opac-page.pl?page_id=[% c.idnew | uri %]</a><br>
394
                                <strong>Librarian interface</strong>: <a href="/cgi-bin/koha/tools/page.pl?page_id=[% c.idnew | uri %]" title="View on librarian interface">[% Koha.Preference('staffClientBaseURL') | url %]/cgi-bin/koha/tools/page.pl?page_id=[% c.idnew | uri %]</a>
395
                                [% END %]
396
                            </td>
397
                        [% END %]
368
                        <td>
398
                        <td>
369
                            <div class="btn-group">
399
                            <div class="btn-group">
370
                                <a class="preview_news btn btn-default btn-xs" data-number="[% loop.count | html %]"><i class="fa fa-eye" aria-hidden="true"></i> Preview content</a>
400
                                <a class="preview_news btn btn-default btn-xs" data-number="[% loop.count | html %]"><i class="fa fa-eye" aria-hidden="true"></i> Preview content</a>
Lines 422-428 Link Here
422
[% END %]
452
[% END %]
423
453
424
[% BLOCK locations_options %]
454
[% BLOCK locations_options %]
425
    [% IF category == 'news' %]
455
    [% IF category == 'news' || category == 'pages' %]
426
        [% IF location == "staff_and_opac" %]
456
        [% IF location == "staff_and_opac" %]
427
            <option value="staff_and_opac" selected="selected">Librarian and OPAC interfaces</option>
457
            <option value="staff_and_opac" selected="selected">Librarian and OPAC interfaces</option>
428
        [% ELSE %]
458
        [% ELSE %]
Lines 441-450 Link Here
441
            <option value="opac_only">OPAC</option>
471
            <option value="opac_only">OPAC</option>
442
        [% END %]
472
        [% END %]
443
473
444
        [% IF location == "slip" %]
474
        [% UNLESS category == 'pages' %]
445
            <option value="slip" selected="selected">Slip</option>
475
            [% IF location == "slip" %]
446
        [% ELSE %]
476
                <option value="slip" selected="selected">Slip</option>
447
            <option value="slip">Slip</option>
477
            [% ELSE %]
478
                <option value="slip">Slip</option>
479
            [% END %]
448
        [% END %]
480
        [% END %]
449
    [% ELSE %]
481
    [% ELSE %]
450
        [% FOREACH l IN [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote' ] %]
482
        [% FOREACH l IN [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote' ] %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/page.tt (+62 lines)
Line 0 Link Here
1
[% USE raw %]
2
[% USE Asset %]
3
[% SET footerjs = 1 %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>[% IF page %][% page.title | html %][% ELSE %]Page error[% END %] &rsaquo; Tools &rsaquo; Koha</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
</head>
8
9
<body id="tools_page_[% page.idnew | html %]" class="tools">
10
    [% INCLUDE 'header.inc' %]
11
    [% INCLUDE 'cat-search.inc' %]
12
13
    <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
14
        <ol>
15
            <li>
16
                <a href="/cgi-bin/koha/mainpage.pl">Home</a>
17
            </li>
18
            <li>
19
                <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
20
            </li>
21
            <li>
22
                <a href="#" aria-current="page">[% IF page %][% page.title | html %][% ELSE %]Page error[% END %]</a>
23
            </li>
24
        </ol>
25
    </nav>
26
27
    <div class="main container-fluid">
28
        <div class="row">
29
            <div class="col-sm-10 col-sm-push-2">
30
                <main>
31
32
                    [% IF page %]
33
34
                    <h1>[% page.title | html %]</h1>
35
36
                    <div class="page">
37
                        [% page.content | $raw %]
38
                    </div>
39
40
                    [% ELSE %]
41
42
                    <div class="dialog alert">
43
                        This page does not exist.
44
                    </div>
45
46
                    [% END %]
47
48
                </main>
49
            </div> <!-- /.col-sm-10.col-sm-push-2 -->
50
51
            <div class="col-sm-2 col-sm-pull-10">
52
                <aside>
53
                    [% INCLUDE 'tools-menu.inc' %]
54
                </aside>
55
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
56
        </div> <!-- /.row -->
57
58
[% MACRO jsinclude BLOCK %]
59
    [% Asset.js("js/tools-menu.js") | $raw %]
60
[% END %]
61
62
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt (+3 lines)
Lines 121-126 Link Here
121
121
122
    <dt><a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a></dt>
122
    <dt><a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a></dt>
123
    <dd>Write HTML customizations</dd>
123
    <dd>Write HTML customizations</dd>
124
125
    <dt><a href="/cgi-bin/koha/tools/additional-contents.pl?category=pages">Pages</a></dt>
126
    <dd>Write custom pages</dd>
124
    [% END %]
127
    [% END %]
125
128
126
    [% IF ( CAN_user_tools_schedule_tasks ) %]
129
    [% IF ( CAN_user_tools_schedule_tasks ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/tools-menu.js (+2 lines)
Lines 18-22 Link Here
18
          $('#navmenulist a[href$="/cgi-bin/koha/tools/stockrotation.pl"]').addClass("current");
18
          $('#navmenulist a[href$="/cgi-bin/koha/tools/stockrotation.pl"]').addClass("current");
19
      } else if (path.indexOf("plugins") >= 0 ) {
19
      } else if (path.indexOf("plugins") >= 0 ) {
20
          $('#navmenulist a[href$="/cgi-bin/koha/plugins/plugins-home.pl?method=tool"]').addClass("current");
20
          $('#navmenulist a[href$="/cgi-bin/koha/plugins/plugins-home.pl?method=tool"]').addClass("current");
21
      } else if (path.indexOf("page.pl") >= 0 ) {
22
          $('#navmenulist a[href$="/cgi-bin/koha/tools/additional-contents.pl?category=pages"]').addClass("current");
21
      }
23
      }
22
  });
24
  });
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt (+2 lines)
Lines 100-105 Link Here
100
                <div id="news" class="newscontainer">
100
                <div id="news" class="newscontainer">
101
                    [% SET show_author = Koha.Preference('NewsAuthorDisplay') == 'opac' || Koha.Preference('NewsAuthorDisplay') == 'both' %]
101
                    [% SET show_author = Koha.Preference('NewsAuthorDisplay') == 'opac' || Koha.Preference('NewsAuthorDisplay') == 'both' %]
102
                    [% FOREACH koha_new IN koha_news %]
102
                    [% FOREACH koha_new IN koha_news %]
103
                    [% IF koha_new.category == 'news' %]
103
                        <div class="newsitem">
104
                        <div class="newsitem">
104
                            <h4 class="newsheader">
105
                            <h4 class="newsheader">
105
                                [% IF ( news_item ) %]
106
                                [% IF ( news_item ) %]
Lines 120-125 Link Here
120
                            </div>
121
                            </div>
121
                        </div>
122
                        </div>
122
                    [% END %]
123
                    [% END %]
124
                    [% END %]
123
125
124
                    [% UNLESS news_item %]
126
                    [% UNLESS news_item %]
125
                        <div id="rssnews-container">
127
                        <div id="rssnews-container">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-page.tt (+73 lines)
Line 0 Link Here
1
[% USE raw %]
2
[% USE Koha %]
3
[% USE AdditionalContents %]
4
[% PROCESS 'i18n.inc' %]
5
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
6
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
7
[% INCLUDE 'doc-head-open.inc' %]
8
<title>[% IF page %][% page.title | html %][% ELSE %]Page error[% END %] &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
9
[% INCLUDE 'doc-head-close.inc' %]
10
[% BLOCK cssinclude %][% END %]
11
</head>
12
[% INCLUDE 'bodytag.inc' bodyid='opac-page-' _ page.idnew %]
13
[% INCLUDE 'masthead.inc' %]
14
15
<div class="main">
16
    <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
17
        <ol class="breadcrumb">
18
            <li class="breadcrumb-item">
19
                <a href="/cgi-bin/koha/opac-main.pl">Home</a>
20
            </li>
21
            [% IF page %]
22
                <li class="breadcrumb-item active">
23
                    <a href="#" aria-current="page">[% page.title | html %]</a>
24
                </li>
25
            [% ELSE %]
26
                <li class="breadcrumb-item active">
27
                    <a href="#" aria-current="page">Page error</a>
28
                </li>
29
            [% END %]
30
        </ol>
31
    </nav> <!-- /#breadcrumbs -->
32
33
    <div class="container-fluid">
34
        <div class="row">
35
            [% IF ( OpacNav || OpacNavBottom ) %]
36
                <div class="col-12 col-lg-2 order-3 order-lg-1">
37
                    <div id="navigation">
38
                        [% IF ( OpacNav || OpacNavBottom ) %]
39
                            <hr>
40
                            [% INCLUDE 'navigation.inc' %]
41
                        [% END %]
42
                    </div>
43
                </div>
44
                <div class="col-12 col-lg-10 order-md-1 maincontent">
45
            [% ELSE %]
46
                <div class="col order-md-1 maincontent">
47
            [% END %]
48
                <div id="page_[% page.idnew | html %]" class="maincontent">
49
50
            [% IF page %]
51
52
            <h1>[% page.title | html %]</h1>
53
54
            <div class="page_content">
55
                [% page.content | $raw %]
56
            </div>
57
58
            [% ELSE %]
59
60
            <div class="alert alert-error">
61
                This page does not exist.
62
            </div>
63
64
            [% END %]
65
66
        </div> <!-- / .col 6/8 -->
67
68
        </div> <!-- /.container-fluid -->
69
    </div> <!-- /.row -->
70
</div> <!-- /.main -->
71
72
[% INCLUDE 'opac-bottom.inc' %]
73
[% BLOCK jsinclude %][% END %]
(-)a/opac/opac-page.pl (+48 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use CGI qw ( -utf8 );
21
use C4::Auth qw( get_template_and_user );
22
use C4::Output qw( output_html_with_http_headers );
23
use Koha::AdditionalContents;
24
25
my $query = CGI->new();
26
27
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
28
    {
29
        template_name   => "opac-page.tt",
30
        query           => $query,
31
        type            => "opac",
32
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
33
    }
34
);
35
36
my $page_id = $query->param('page_id');
37
my $page;
38
39
if (defined $page_id){
40
    $page = Koha::AdditionalContents->search({ idnew => $page_id, location => ['opac_only', 'staff_and_opac'] });
41
    if ( $page->count > 0){
42
        $template->param( page => $page->next );
43
    } else {
44
        $template->param( page_error => 1 );
45
    }
46
}
47
48
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/tools/page.pl (-1 / +47 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use CGI qw ( -utf8 );
21
use C4::Auth qw( get_template_and_user );
22
use C4::Output qw( output_html_with_http_headers );
23
use Koha::AdditionalContents;
24
25
my $query = CGI->new;
26
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
27
    {
28
        template_name   => "tools/page.tt",
29
        query           => $query,
30
        type            => "intranet",
31
        flagsrequired   => { tools => '*' },
32
    }
33
);
34
35
my $page_id = $query->param('page_id');
36
my $page;
37
38
if (defined $page_id){
39
    $page = Koha::AdditionalContents->search({ idnew => $page_id, location => ['staff_only', 'staff_and_opac'] });
40
    if ( $page->count > 0){
41
        $template->param( page => $page->next );
42
    } else {
43
        $template->param( page_error => 1 );
44
    }
45
}
46
47
output_html_with_http_headers $query, $cookie, $template->output;

Return to bug 15326