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 109-114 Link Here
109
    [% IF ( CAN_user_tools_edit_additional_contents ) %]
109
    [% IF ( CAN_user_tools_edit_additional_contents ) %]
110
    <li><a href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a></li>
110
    <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=html_customizations">HTML customizations</a></li>
111
    <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=pages">Pages</a></li>
112
    [% END %]
113
    [% END %]
113
    [% IF ( CAN_user_tools_schedule_tasks ) %]
114
    [% IF ( CAN_user_tools_schedule_tasks ) %]
114
	<li><a href="/cgi-bin/koha/tools/scheduler.pl">Task scheduler</a></li>
115
	<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 (-11 / +42 lines)
Lines 39-44 Link Here
39
            <li>
39
            <li>
40
                [% IF category == 'news' %]
40
                [% IF category == 'news' %]
41
                    <a href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a>
41
                    <a href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a>
42
                [% ELSIF category == 'pages' %]
43
                    <a href="/cgi-bin/koha/tools/additional-contents.pl?category=pages">Pages</a>
42
                [% ELSE %]
44
                [% ELSE %]
43
                    <a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a>
45
                    <a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a>
44
                [% END %]
46
                [% END %]
Lines 50-56 Link Here
50
                    [% ELSE %]
52
                    [% ELSE %]
51
                        <span>Add additional content<span>
53
                        <span>Add additional content<span>
52
                    [% END %]
54
                    [% END %]
53
                    ([% IF category == 'news' %]<span>News</span>[% ELSE %]<span>HTML customizations</span>[% END %])
55
                    ([% IF category == 'news' %]<span>News</span>[% ELSIF category == 'pages' %]<span>Pages</span>[% ELSE %]<span>HTML customizations</span>[% END %])
54
                </a>
56
                </a>
55
            </li>
57
            </li>
56
        [% ELSE %]
58
        [% ELSE %]
Lines 58-63 Link Here
58
                <a href="#" aria-current="page">
60
                <a href="#" aria-current="page">
59
                    [% IF category == 'news' %]
61
                    [% IF category == 'news' %]
60
                        News
62
                        News
63
                    [% ELSIF category == 'pages' %]
64
                        Pages
61
                    [% ELSE %]
65
                    [% ELSE %]
62
                        HTML customizations
66
                        HTML customizations
63
                    [% END %]
67
                    [% END %]
Lines 160-166 Link Here
160
    [% IF additional_content %]
164
    [% IF additional_content %]
161
        <h1>Modify an additional content</h1>
165
        <h1>Modify an additional content</h1>
162
    [% ELSE %]
166
    [% ELSE %]
163
        <h1>New additional content ([% IF category == 'news' %]News[% ELSE %]HTML customizations[% END %])</h1>
167
        <h1>New additional content ([% IF category == 'news' %]News[% ELSIF category == 'pages' %]Pages[% ELSE %]HTML customizations[% END %])</h1>
164
    [% END %]
168
    [% END %]
165
169
166
    <div id="toolbar" class="btn-toolbar">
170
    <div id="toolbar" class="btn-toolbar">
Lines 169-174 Link Here
169
        </div>
173
        </div>
170
        [% IF category == 'news' %]
174
        [% IF category == 'news' %]
171
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl"><i class="fa fa-remove"></i> Cancel</a>
175
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl"><i class="fa fa-remove"></i> Cancel</a>
176
        [% ELSIF category == 'pages' %]
177
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl?category=pages"><i class="fa fa-remove"></i> Cancel</a>
172
        [% ELSE %]
178
        [% ELSE %]
173
            <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
            <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>
174
        [% END %]
180
        [% END %]
Lines 289-299 Link Here
289
        </div>
295
        </div>
290
    </div>
296
    </div>
291
297
292
    <h2>Additional contents ([% IF category == 'news' %]News[% ELSE %]HTML customizations[% END %])</h2>
298
    <h2>Additional contents ([% IF category == 'news' %]News[% ELSIF category == 'pages' %]Pages[% ELSE %]HTML customizations[% END %])</h2>
293
    [% IF category == 'news' %]
299
    [% IF category == 'news' %]
294
        See <a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a>
300
        See <a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a> or <a href="/cgi-bin/koha/tools/additional-contents.pl?category=pages">Pages</a>
301
    [% ELSIF category == 'pages' %]
302
        See <a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a> or <a href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a>
295
    [% ELSE %]
303
    [% ELSE %]
296
        See <a href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a>
304
        See <a href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a> or <a href="/cgi-bin/koha/tools/additional-contents.pl?category=pages">Pages</a>
297
    [% END %]
305
    [% END %]
298
306
299
    [% IF additional_contents.count %]
307
    [% IF additional_contents.count %]
Lines 320-326 Link Here
320
                            <input type="checkbox" name="ids" value="[% c.idnew | html %]" />
328
                            <input type="checkbox" name="ids" value="[% c.idnew | html %]" />
321
                        </td>
329
                        </td>
322
                        <td>
330
                        <td>
323
                            [% IF c.category == 'news' %]
331
                            [% IF c.category == 'news' || c.category == 'pages' %]
324
                                [% IF c.location == 'staff_and_opac' %]All
332
                                [% IF c.location == 'staff_and_opac' %]All
325
                                [% ELSIF c.location == 'staff_only' %]Librarian interface
333
                                [% ELSIF c.location == 'staff_only' %]Librarian interface
326
                                [% ELSIF c.location == 'opac_only' %]OPAC
334
                                [% ELSIF c.location == 'opac_only' %]OPAC
Lines 379-384 Link Here
379
                            <div class="btn-group">
387
                            <div class="btn-group">
380
                                <a href="#" class="delete_news btn btn-default btn-xs" data-idnew="[% c.idnew | html %]"><i class="fa fa-trash"></i> Delete</a>
388
                                <a href="#" class="delete_news btn btn-default btn-xs" data-idnew="[% c.idnew | html %]"><i class="fa fa-trash"></i> Delete</a>
381
                            </div>
389
                            </div>
390
                            [% IF c.category == 'pages' %]
391
                                <div class="btn-group dropup">
392
                                    [% IF c.location == 'opac_only' %]
393
                                    <a target="_blank" href="[% Koha.Preference('OPACBaseURL') | url %]/cgi-bin/koha/page.pl?page_id=[% c.idnew | uri %]" class="btn btn-default btn-xs"> <i class="fa fa-eye"></i> View</a><button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
394
                                        <span class="caret"></span>
395
                                    </button>
396
                                    [% ELSE %]
397
                                    <a href="/cgi-bin/koha/tools/page.pl?page_id=[% c.idnew | uri %]" class="btn btn-default btn-xs"><i class="fa fa-eye"></i> View</a><button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
398
                                        <span class="caret"></span>
399
                                    </button>
400
                                    [% END %]
401
                                    [% IF c.location == 'staff_and_opac' %]
402
                                    <ul class="dropdown-menu pull-right">
403
                                        <li>
404
                                            <a target="_blank" href="[% Koha.Preference('OPACBaseURL') | url %]/cgi-bin/koha/page.pl?page_id=[% c.idnew | uri %]"><i class="fa fa-eye"></i> View on OPAC</a>
405
                                            <a href="/cgi-bin/koha/tools/page.pl?page_id=[% c.idnew | uri %]"><i class="fa fa-eye"></i> View on staff client</a>
406
                                        </li>
407
                                    </ul>
408
                                    [% END %]
409
                                </div>
410
                            [% END %]
382
                        </td>
411
                        </td>
383
                    </tr>
412
                    </tr>
384
                    [% END %]
413
                    [% END %]
Lines 399-405 Link Here
399
[% END %]
428
[% END %]
400
429
401
[% BLOCK locations_options %]
430
[% BLOCK locations_options %]
402
    [% IF category == 'news' %]
431
    [% IF category == 'news' || category == 'pages' %]
403
        [% IF location == "staff_and_opac" %]
432
        [% IF location == "staff_and_opac" %]
404
            <option value="staff_and_opac" selected="selected">Librarian and OPAC interfaces</option>
433
            <option value="staff_and_opac" selected="selected">Librarian and OPAC interfaces</option>
405
        [% ELSE %]
434
        [% ELSE %]
Lines 418-427 Link Here
418
            <option value="opac_only">OPAC</option>
447
            <option value="opac_only">OPAC</option>
419
        [% END %]
448
        [% END %]
420
449
421
        [% IF location == "slip" %]
450
        [% UNLESS category == 'pages' %]
422
            <option value="slip" selected="selected">Slip</option>
451
            [% IF location == "slip" %]
423
        [% ELSE %]
452
                <option value="slip" selected="selected">Slip</option>
424
            <option value="slip">Slip</option>
453
            [% ELSE %]
454
                <option value="slip">Slip</option>
455
            [% END %]
425
        [% END %]
456
        [% END %]
426
    [% ELSE %]
457
    [% ELSE %]
427
        [% FOREACH l IN [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText' ] %]
458
        [% FOREACH l IN [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText' ] %]
(-)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 120-125 Link Here
120
126
121
    <dt><a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a></dt>
127
    <dt><a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a></dt>
122
    <dd>Write HTML customizations</dd>
128
    <dd>Write HTML customizations</dd>
129
130
    <dt><a href="/cgi-bin/koha/tools/additional-contents.pl?category=pages">Pages</a></dt>
131
    <dd>Write custom pages</dd>
132
    [% INCLUDE 'pages-nav.inc' %]
123
    [% END %]
133
    [% END %]
124
134
125
    [% IF ( CAN_user_tools_schedule_tasks ) %]
135
    [% 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 (+12 lines)
Lines 8-13 Link Here
8
[% SET OpacHeader = AdditionalContents.get( location => "opacheader", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
8
[% SET OpacHeader = AdditionalContents.get( location => "opacheader", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
9
[% SET OpacCustomSearch = AdditionalContents.get( location => "OpacCustomSearch", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
9
[% SET OpacCustomSearch = AdditionalContents.get( location => "OpacCustomSearch", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
10
[% SET OpacLoginInstructions = AdditionalContents.get( location => "OpacLoginInstructions", lang => lang, library => branchcode ) %]
10
[% SET OpacLoginInstructions = AdditionalContents.get( location => "OpacLoginInstructions", lang => lang, library => branchcode ) %]
11
[% SET pages = AdditionalContents.get( category => "pages", location => [ "opac_only", "staff_and_opac" ], lang => lang, library => branchcode ) %]
11
12
12
<button id="scrolltocontent">Skip to main content</button>
13
<button id="scrolltocontent">Skip to main content</button>
13
<div id="wrapper">
14
<div id="wrapper">
Lines 352-357 Link Here
352
                            [% END %]
353
                            [% END %]
353
                        </a>
354
                        </a>
354
                    </li>
355
                    </li>
356
                    [% IF pages %]
357
                        <div id="pages-masthead">
358
                        [% FOREACH page IN pages %]
359
                            <li class="nav-item">
360
                                <a class="custom_page" href="/cgi-bin/koha/opac-page.pl?page_id=[% page.idnew | uri %]">
361
                                    [% page.title | html %]
362
                                </a>
363
                            </li>
364
                        [% END %]
365
                        </div>
366
                    [% END %]
355
                    [% Koha.Preference('OpacMoreSearches') | $raw %]
367
                    [% Koha.Preference('OpacMoreSearches') | $raw %]
356
                </ul> <!-- /.nav#moresearches -->
368
                </ul> <!-- /.nav#moresearches -->
357
            </div> <!-- /.row -->
369
            </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 page IN pages %]
42
                                <li>
43
                                    <a href="/cgi-bin/koha/opac-page.pl?page_id=[% page.idnew | uri %]">[% page.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 (+67 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 $branchcode = $query->param('branchcode');
28
29
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
30
    {
31
        template_name   => "opac-page.tt",
32
        query           => $query,
33
        type            => "opac",
34
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
35
    }
36
);
37
38
my $homebranch;
39
if (C4::Context->userenv) {
40
    $homebranch = C4::Context->userenv->{'branch'};
41
}
42
my $pages = Koha::AdditionalContents->search_for_display(
43
    {
44
        category   => 'pages',
45
        location   => [ 'opac_only', 'staff_and_opac' ],
46
        lang       => $template->lang,
47
        library_id => $homebranch
48
    }
49
);
50
51
my $page_id = $query->param('page_id');
52
53
my $page;
54
if ( $page_id ) {
55
    foreach ( @{$pages->unblessed} ) {
56
        if ( $_->{idnew} eq $page_id ) {
57
            $page = $_;
58
        }
59
    }
60
}
61
62
$template->param(
63
    pages => $pages,
64
    page => $page,
65
);
66
67
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