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

(-)a/Koha/AdditionalContents.pm (-1 / +2 lines)
Lines 38-44 Koha::AdditionalContents - Koha Additional content object set class Link Here
38
=head3 search_for_display
38
=head3 search_for_display
39
39
40
my $contents = Koha::AdditionalContents->search_for_display({
40
my $contents = Koha::AdditionalContents->search_for_display({
41
    category => 'news', # news or html_customizations
41
    category => 'news', # news, html_customizations, or pages
42
    location => 'slip',
42
    location => 'slip',
43
    lang => 'es-ES',
43
    lang => 'es-ES',
44
    library_id => $branchcode
44
    library_id => $branchcode
Lines 75-80 sub search_for_display { Link Here
75
    $search_params->{published_on} = { '<=' => \'CAST(NOW() AS DATE)' };
75
    $search_params->{published_on} = { '<=' => \'CAST(NOW() AS DATE)' };
76
    $search_params->{-or} = [ expirationdate => { '>=' => \'CAST(NOW() AS DATE)' },
76
    $search_params->{-or} = [ expirationdate => { '>=' => \'CAST(NOW() AS DATE)' },
77
                              expirationdate => undef ];
77
                              expirationdate => undef ];
78
    $search_params->{category} = $params->{category};
78
79
79
    if ( $params->{lang} ) {
80
    if ( $params->{lang} ) {
80
        # FIXME I am failing to translate the following query
81
        # FIXME I am failing to translate the following query
(-)a/Koha/Template/Plugin/AdditionalContents.pm (+4 lines)
Lines 46-51 sub get { Link Here
46
        }
46
        }
47
    );
47
    );
48
48
49
    if ( $category and $category eq 'pages' ) {
50
        return $content->unblessed;
51
    }
52
49
    if ( $content->count ) {
53
    if ( $content->count ) {
50
        return {
54
        return {
51
            content    => $content,
55
            content    => $content,
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/pages-nav.inc (+10 lines)
Line 0 Link Here
1
[% IF ( pages.count ) %]
2
    [% IF show_heading %]<h3><span class="pages_title">Pages</span></h3>[% END %]
3
    <ul id="pages-nav">
4
    [% FOREACH page IN pages %]
5
        <li>
6
            <a href="/cgi-bin/koha/tools/page.pl?page_id=[% page.idnew | uri %]">[% page.title | html %]</a>
7
        </li>
8
    [% END %]
9
    </ul>
10
[% END %]
(-)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 (-18 / +56 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 174-179 Link Here
174
        </div>
184
        </div>
175
        [% IF category == 'news' %]
185
        [% IF category == 'news' %]
176
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl"><i class="fa fa-remove"></i> Cancel</a>
186
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl"><i class="fa fa-remove"></i> Cancel</a>
187
        [% ELSIF category == 'pages' %]
188
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl?category=pages"><i class="fa fa-remove"></i> Cancel</a>
177
        [% ELSE %]
189
        [% ELSE %]
178
            <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>
190
            <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>
179
        [% END %]
191
        [% END %]
Lines 300-315 Link Here
300
        </div>
312
        </div>
301
    </div>
313
    </div>
302
314
303
    <h2>Additional contents ([% IF category == 'news' %]News[% ELSE %]HTML customizations[% END %])</h2>
315
    <h2>Additional contents ([% IF category == 'news' %]News[% ELSIF category == 'pages' %]Pages[% ELSE %]HTML customizations[% END %])</h2>
304
    [% IF category == 'news' %]
316
    <span id="additional_contents_links">
305
        See <a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a>
317
        See
306
    [% ELSE %]
318
        <a class="customisation-link" href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a>
307
        See <a href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a>
319
        <a class="customisation-link" href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a>
308
    [% END %]
320
        <a class="customisation-link" href="/cgi-bin/koha/tools/additional-contents.pl?category=pages">Pages</a>
309
    [% IF ( CAN_user_parameters_manage_sysprefs ) %]
321
        [% IF ( CAN_user_parameters_manage_sysprefs ) %]
310
        <a class="syspref-link" href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACUserJS'>OPACUserJS</a>
322
            <a class="syspref-link" href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACUserJS'>OPACUserJS</a>
311
        <a class="syspref-link" href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACUserCSS'>OPACUserCSS</a>
323
            <a class="syspref-link" href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACUserCSS'>OPACUserCSS</a>
312
    [% END %]
324
        [% END %]
325
    </span>
313
326
314
    [% IF additional_contents.count %]
327
    [% IF additional_contents.count %]
315
        <form id="del_form" method="post" action="/cgi-bin/koha/tools/additional-contents.pl">
328
        <form id="del_form" method="post" action="/cgi-bin/koha/tools/additional-contents.pl">
Lines 335-341 Link Here
335
                            <input type="checkbox" name="ids" value="[% c.idnew | html %]" />
348
                            <input type="checkbox" name="ids" value="[% c.idnew | html %]" />
336
                        </td>
349
                        </td>
337
                        <td>
350
                        <td>
338
                            [% IF c.category == 'news' %]
351
                            [% IF c.category == 'news' || c.category == 'pages' %]
339
                                [% IF c.location == 'staff_and_opac' %]<span>All</span>
352
                                [% IF c.location == 'staff_and_opac' %]<span>All</span>
340
                                [% ELSIF c.location == 'staff_only' %]<span>Librarian interface</span>
353
                                [% ELSIF c.location == 'staff_only' %]<span>Librarian interface</span>
341
                                [% ELSIF c.location == 'opac_only' %]<span>OPAC</span>
354
                                [% ELSIF c.location == 'opac_only' %]<span>OPAC</span>
Lines 394-399 Link Here
394
                            <div class="btn-group">
407
                            <div class="btn-group">
395
                                <a href="#" class="delete_news btn btn-default btn-xs" data-idnew="[% c.idnew | html %]"><i class="fa fa-trash"></i> Delete</a>
408
                                <a href="#" class="delete_news btn btn-default btn-xs" data-idnew="[% c.idnew | html %]"><i class="fa fa-trash"></i> Delete</a>
396
                            </div>
409
                            </div>
410
                            [% IF c.category == 'pages' %]
411
                                <div class="btn-group dropup">
412
                                    [% IF c.location == 'opac_only' %]
413
                                    <a target="_blank" href="[% Koha.Preference('OPACBaseURL') | url %]/cgi-bin/koha/opac-page.pl?page_id=[% c.idnew | uri %]" class="btn btn-default btn-xs" title="View on OPAC"> <i class="fa fa-eye"></i> View</a><button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
414
                                        <span class="caret"></span>
415
                                    </button>
416
                                    [% ELSE %]
417
                                    <a href="/cgi-bin/koha/tools/page.pl?page_id=[% c.idnew | uri %]" class="btn btn-default btn-xs" title="View on staff client"><i class="fa fa-eye"></i> View</a><button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
418
                                        <span class="caret"></span>
419
                                    </button>
420
                                    [% END %]
421
                                    <ul class="dropdown-menu pull-right">
422
                                        <li>
423
                                            [% UNLESS c.location == 'staff_only' %]
424
                                                <a target="_blank" href="[% Koha.Preference('OPACBaseURL') | url %]/cgi-bin/koha/opac-page.pl?page_id=[% c.idnew | uri %]" title="View on OPAC"><i class="fa fa-eye"></i> View on OPAC</a>
425
                                            [% END %]
426
                                            [% UNLESS c.location == 'opac_only' %]
427
                                                <a href="/cgi-bin/koha/tools/page.pl?page_id=[% c.idnew | uri %]" title="View on staff client"><i class="fa fa-eye"></i> View on staff client</a>
428
                                            [% END %]
429
                                        </li>
430
                                    </ul>
431
                                </div>
432
                            [% END %]
397
                        </td>
433
                        </td>
398
                    </tr>
434
                    </tr>
399
                    [% END %]
435
                    [% END %]
Lines 414-420 Link Here
414
[% END %]
450
[% END %]
415
451
416
[% BLOCK locations_options %]
452
[% BLOCK locations_options %]
417
    [% IF category == 'news' %]
453
    [% IF category == 'news' || category == 'pages' %]
418
        [% IF location == "staff_and_opac" %]
454
        [% IF location == "staff_and_opac" %]
419
            <option value="staff_and_opac" selected="selected">Librarian and OPAC interfaces</option>
455
            <option value="staff_and_opac" selected="selected">Librarian and OPAC interfaces</option>
420
        [% ELSE %]
456
        [% ELSE %]
Lines 433-442 Link Here
433
            <option value="opac_only">OPAC</option>
469
            <option value="opac_only">OPAC</option>
434
        [% END %]
470
        [% END %]
435
471
436
        [% IF location == "slip" %]
472
        [% UNLESS category == 'pages' %]
437
            <option value="slip" selected="selected">Slip</option>
473
            [% IF location == "slip" %]
438
        [% ELSE %]
474
                <option value="slip" selected="selected">Slip</option>
439
            <option value="slip">Slip</option>
475
            [% ELSE %]
476
                <option value="slip">Slip</option>
477
            [% END %]
440
        [% END %]
478
        [% END %]
441
    [% ELSE %]
479
    [% ELSE %]
442
        [% FOREACH l IN [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote' ] %]
480
        [% 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 (+64 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 'pages-nav.inc' show_heading=1 %]
54
                    <hr>
55
                    [% INCLUDE 'tools-menu.inc' %]
56
                </aside>
57
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
58
        </div> <!-- /.row -->
59
60
[% MACRO jsinclude BLOCK %]
61
    [% Asset.js("js/tools-menu.js") | $raw %]
62
[% END %]
63
64
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt (+10 lines)
Lines 5-10 Link Here
5
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Tools &rsaquo; Koha</title>
6
<title>Tools &rsaquo; Koha</title>
7
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'doc-head-close.inc' %]
8
<style>
9
#pages-nav {
10
    font-size: 90%;
11
    padding: .2em .2em .2em 2.5em;
12
}
13
</style>
8
</head>
14
</head>
9
<body id="tools_tools-home" class="tools">
15
<body id="tools_tools-home" class="tools">
10
[% INCLUDE 'header.inc' %]
16
[% INCLUDE 'header.inc' %]
Lines 121-126 Link Here
121
127
122
    <dt><a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a></dt>
128
    <dt><a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a></dt>
123
    <dd>Write HTML customizations</dd>
129
    <dd>Write HTML customizations</dd>
130
131
    <dt><a href="/cgi-bin/koha/tools/additional-contents.pl?category=pages">Pages</a></dt>
132
    <dd>Write custom pages</dd>
133
    [% INCLUDE 'pages-nav.inc' %]
124
    [% END %]
134
    [% END %]
125
135
126
    [% IF ( CAN_user_tools_schedule_tasks ) %]
136
    [% 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/includes/masthead.inc (+14 lines)
Lines 9-14 Link Here
9
[% SET OpacCustomSearch = AdditionalContents.get( location => "OpacCustomSearch", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
9
[% SET OpacCustomSearch = AdditionalContents.get( location => "OpacCustomSearch", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
10
[% SET OpacLoginInstructions = AdditionalContents.get( location => "OpacLoginInstructions", lang => lang, library => branchcode || default_branch ) %]
10
[% SET OpacLoginInstructions = AdditionalContents.get( location => "OpacLoginInstructions", lang => lang, library => branchcode || default_branch ) %]
11
[% SET OpacMoreSearches = AdditionalContents.get( location => "OpacMoreSearches", lang => lang, library => branchcode || default_branch ) %]
11
[% SET OpacMoreSearches = AdditionalContents.get( location => "OpacMoreSearches", lang => lang, library => branchcode || default_branch ) %]
12
[% SET pages = AdditionalContents.get( category => "pages", location => [ "opac_only", "staff_and_opac" ], lang => lang, library => branchcode || default_branch ) %]
12
13
13
<button id="scrolltocontent">Skip to main content</button>
14
<button id="scrolltocontent">Skip to main content</button>
14
<div id="wrapper">
15
<div id="wrapper">
Lines 345-350 Link Here
345
                            [% END %]
346
                            [% END %]
346
                        </a>
347
                        </a>
347
                    </li>
348
                    </li>
349
350
                    [% IF pages %]
351
                        <div id="pages-masthead">
352
                        [% FOREACH page IN pages %]
353
                            <li class="nav-item">
354
                                <a class="custom_page" href="/cgi-bin/koha/opac-page.pl?page_id=[% page.idnew | uri %]">
355
                                    [% page.title | html %]
356
                                </a>
357
                            </li>
358
                        [% END %]
359
                        </div>
360
                    [% END %]
361
348
                    [% PROCESS koha_news_block news => OpacMoreSearches %]
362
                    [% PROCESS koha_news_block news => OpacMoreSearches %]
349
                </ul> <!-- /.nav#moresearches -->
363
                </ul> <!-- /.nav#moresearches -->
350
            </div> <!-- /.row -->
364
            </div> <!-- /.row -->
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-page.tt (+83 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 || pages.count ) %]
36
                <div class="col-12 col-lg-2 order-3 order-lg-1">
37
                    <div id="navigation">
38
                        [% IF ( pages.count ) %]
39
                            <h2><span class="pages_title">Pages</span></h2>
40
                            <ul id="pages-nav">
41
                            [% FOREACH p IN pages %]
42
                                <li>
43
                                    <a href="/cgi-bin/koha/opac-page.pl?page_id=[% p.idnew | uri %]">[% p.title | html %]</a>
44
                                </li>
45
                            [% END %]
46
                            </ul>
47
                        [% END %]
48
                        [% IF ( OpacNav || OpacNavBottom ) %]
49
                            <hr>
50
                            [% INCLUDE 'navigation.inc' %]
51
                        [% END %]
52
                    </div>
53
                </div>
54
                <div class="col-12 col-lg-10 order-md-1 maincontent">
55
            [% ELSE %]
56
                <div class="col order-md-1 maincontent">
57
            [% END %]
58
                <div id="page_[% page.idnew | html %]" class="maincontent">
59
60
        [% IF page %]
61
62
        <h1>[% page.title | html %]</h1>
63
64
        <div class="page_content">
65
            [% page.content | $raw %]
66
        </div>
67
68
        [% ELSE %]
69
70
        <div class="alert alert-error">
71
            This page does not exist.
72
        </div>
73
74
        [% END %]
75
76
        </div> <!-- / .col 6/8 -->
77
78
        </div> <!-- /.container-fluid -->
79
    </div> <!-- /.row -->
80
</div> <!-- /.main -->
81
82
[% INCLUDE 'opac-bottom.inc' %]
83
[% BLOCK jsinclude %][% END %]
(-)a/opac/opac-page.pl (+65 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 $homebranch = $ENV{OPAC_BRANCH_DEFAULT};
37
if (C4::Context->userenv) {
38
    $homebranch = C4::Context->userenv->{'branch'};
39
}
40
41
my $pages = Koha::AdditionalContents->search_for_display(
42
    {
43
        category   => 'pages',
44
        location   => [ 'opac_only', 'staff_and_opac' ],
45
        lang       => $template->lang,
46
        library_id => $homebranch
47
    }
48
);
49
50
my $page_id = $query->param('page_id');
51
my $page;
52
if ( $page_id ) {
53
    foreach ( @{$pages->unblessed} ) {
54
        if ( $_->{idnew} eq $page_id ) {
55
            $page = $_;
56
        }
57
    }
58
}
59
60
$template->param(
61
    pages => $pages,
62
    page  => $page,
63
);
64
65
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/tools/page.pl (+64 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
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 $homebranch;
36
if (C4::Context->userenv) {
37
    $homebranch = C4::Context->userenv->{'branch'};
38
}
39
my $pages = Koha::AdditionalContents->search_for_display(
40
    {
41
        category   => 'pages',
42
        location   => [ 'staff_only', 'staff_and_opac' ],
43
        lang       => $template->lang,
44
        library_id => $homebranch
45
    }
46
);
47
48
my $page_id = $query->param('page_id');
49
50
my $page;
51
if ( $page_id ) {
52
    foreach ( @{$pages->unblessed} ) {
53
        if ( $_->{idnew} eq $page_id ) {
54
            $page = $_;
55
        }
56
    }
57
}
58
59
$template->param(
60
    pages => $pages,
61
    page => $page,
62
);
63
64
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/tools/tools-home.pl (-2 / +15 lines)
Lines 36-44 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
36
my $pendingcomments = Koha::Reviews->search_limited({ approved => 0 })->count;
36
my $pendingcomments = Koha::Reviews->search_limited({ approved => 0 })->count;
37
my $pendingtags = get_count_by_tag_status(0);
37
my $pendingtags = get_count_by_tag_status(0);
38
38
39
my $homebranch;
40
if (C4::Context->userenv) {
41
    $homebranch = C4::Context->userenv->{'branch'};
42
}
43
my $pages = Koha::AdditionalContents->search_for_display(
44
    {
45
        category   => 'pages',
46
        location   => [ 'staff_only', 'staff_and_opac' ],
47
        lang       => $template->lang,
48
        library_id => $homebranch
49
    }
50
);
51
39
$template->param(
52
$template->param(
40
    pendingcomments => $pendingcomments,
53
    pendingcomments => $pendingcomments,
41
    pendingtags     => $pendingtags
54
    pendingtags     => $pendingtags,
55
    pages           => $pages,
42
);
56
);
43
57
44
if ( C4::Context->config('enable_plugins') ) {
58
if ( C4::Context->config('enable_plugins') ) {
45
- 

Return to bug 15326