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

(-)a/C4/CourseReserves.pm (-1 / +17 lines)
Lines 1004-1010 sub CountCourseReservesForItem { Link Here
1004
1004
1005
=head2 SearchCourses
1005
=head2 SearchCourses
1006
1006
1007
    my $courses = SearchCourses( term => $search_term, enabled => 'yes' );
1007
    my $courses = SearchCourses( term => $search_term, enabled => 'yes', thesis_table => 'no' );
1008
1008
1009
=cut
1009
=cut
1010
1010
Lines 1014-1019 sub SearchCourses { Link Here
1014
    my $term = $params{'term'};
1014
    my $term = $params{'term'};
1015
1015
1016
    my $enabled = $params{'enabled'} || '%';
1016
    my $enabled = $params{'enabled'} || '%';
1017
    my $thesis_table = $params{'thesis_table'} || 'no';
1017
1018
1018
    my @params;
1019
    my @params;
1019
    my $query = "
1020
    my $query = "
Lines 1042-1047 sub SearchCourses { Link Here
1042
           )
1043
           )
1043
           AND
1044
           AND
1044
           c.enabled LIKE ?
1045
           c.enabled LIKE ?
1046
    ";
1047
1048
    if ( $thesis_table eq 'no' ) {
1049
	$query .= "
1050
	    AND
1051
	    c.department != 'TT'
1052
	";
1053
    } else {
1054
	$query .= "
1055
	    AND
1056
	    c.department = 'TT'
1057
	";
1058
    }
1059
1060
    $query .= "
1045
        GROUP BY c.course_id, c.department, c.course_number, c.section, c.course_name, c.term, c.staff_note, c.public_note, c.students_count, c.enabled, c.timestamp
1061
        GROUP BY c.course_id, c.department, c.course_number, c.section, c.course_name, c.term, c.staff_note, c.public_note, c.students_count, c.enabled, c.timestamp
1046
    ";
1062
    ";
1047
1063
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc (+3 lines)
Lines 320-325 Link Here
320
                        <li class="nav-item">
320
                        <li class="nav-item">
321
                            <a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a>
321
                            <a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a>
322
                        </li>
322
                        </li>
323
			<li class="nav-item">
324
			    <a href="/cgi-bin/koha/opac-thesis-tables.pl">Research tables</a>
325
			</li>
323
                    [% END %]
326
                    [% END %]
324
                    [% IF Koha.Preference( 'OpacBrowser' ) == 1 %]
327
                    [% IF Koha.Preference( 'OpacBrowser' ) == 1 %]
325
                        <li class="nav-item">
328
                        <li class="nav-item">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-thesis-table-details.tt (+127 lines)
Line 0 Link Here
1
[% USE raw %]
2
[% USE Asset %]
3
[% USE Koha %]
4
[% USE KohaDates %]
5
[% USE AuthorisedValues %]
6
[% USE ItemTypes %]
7
[% USE Branches %]
8
[% USE TablesSettings %]
9
[% INCLUDE 'doc-head-open.inc' %]
10
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Reserves for [% course.course_name | html %][%- IF course.section -%] - [% course.section | html %][%- END -%]</title>
11
[% INCLUDE 'doc-head-close.inc' %]
12
[% BLOCK cssinclude %]
13
    [% Asset.css("css/datatables.css") | $raw %]
14
[% END %]
15
16
</head>
17
[% INCLUDE 'bodytag.inc' bodyid='opac-course-details' %]
18
[% INCLUDE 'masthead.inc' %]
19
20
<div class="main">
21
    <nav aria-label="breadcrumb">
22
        <ul class="breadcrumb">
23
            <li class="breadcrumb-item">
24
                <a href="/cgi-bin/koha/opac-main.pl">Home</a>
25
            </li>
26
            <li class="breadcrumb-item">
27
                <a href="/cgi-bin/koha/opac-thesis-tables.pl">Research tables</a>
28
            </li>
29
            <li class="breadcrumb-item" aria-current="page">
30
                Reserves for &nbsp;<em>[% course.course_name | html %][%- IF course.section -%] - [% course.section | html %][%- END -%]</em>
31
            </li>
32
        </ul>
33
    </nav>
34
35
    <div class="container-fluid">
36
        <div class="row">
37
            <div class="col">
38
                <div id="thesis_tables" class="maincontent">
39
40
                    <h2>Reserves for <em>[% course.course_name | html %][%- IF course.section -%] - [% course.section | html %][%- END -%]</em></h2>
41
                    <div class="rows">
42
                        <ol>
43
                            [% IF ( course.instructors ) %]
44
                                <li><span class="label">Researcher:</span>
45
                                    <ul>
46
                                        [% FOREACH i IN course.instructors %]
47
                                            <li><div class="instructor">[% i.firstname | html %] [% i.surname | html %]</div></li>
48
                                        [% END %]
49
                                    </ul>
50
                                </li>
51
                            [% END %]
52
                            [% IF ( course.public_note ) %]<li><span class="label">Notes:</span> [% course.public_note | $raw %]</li>[% END %]
53
                        </ol>
54
                    </div>
55
56
                    [% IF ( course_reserves ) %]
57
                        <table id="thesis-table-items-table" class="table table-bordered table-striped table-condensed">
58
                            <thead>
59
                                <tr>
60
                                    <th class="anti-the">Title</th>
61
                                    <th>Author</th>
62
                                    <th>Item type</th>
63
                                    <th>Location</th>
64
                                    <th>Collection</th>
65
                                    <th>Call number</th>
66
                                    <th>Copy number</th>
67
                                    <th>Status</th>
68
                                    <th class="title-string">Date due</th>
69
                                    <th>Notes</th>
70
                                    <th>Link</th>
71
                                </tr>
72
                            </thead>
73
74
                            <tbody>
75
                                [% FOREACH cr IN course_reserves %]
76
                                    <tr>
77
                                        <td><a href="opac-detail.pl?biblionumber=[% cr.biblio.biblionumber | uri %]">[% INCLUDE 'biblio-title-head.inc' biblio=cr.biblio %]</a></td>
78
                                        <td>[% cr.biblio.author | html %]</td>
79
                                        <td>[% ItemTypes.GetDescription( cr.item.itype ) | html %]</td>
80
                                        <td>[% Branches.GetName( cr.item.holdingbranch ) | html %] <br/> <em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => cr.item.location, opac => 1 ) | html %]</em></td>
81
                                        <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => cr.item.ccode, opac => 1 ) | html %]</td>
82
                                        <td>[% cr.item.itemcallnumber | html %]</td>
83
                                        <td>[% cr.item.copynumber | html %]</td>
84
                                        <td>[% INCLUDE 'item-status.inc' item=cr.item issue=cr.issue %]</td>
85
                                        <td><span title="[% cr.issue.date_due | html %]">[% cr.issue.date_due | $KohaDates  as_due_date => 1 %]</span></td>
86
                                        <td>[% IF ( cr.public_note ) %]
87
                                                [% cr.public_note | $raw %]
88
                                            [% ELSIF ( cr.item.itemnotes ) %]
89
                                                [% cr.item.itemnotes | $raw %]
90
                                            [% END %]
91
                                        </td>
92
                                        <td>[% IF (cr.item.uri) %]
93
                                                <a href="[% cr.item.uri | url %]">Item URI</a>
94
                                            [% ELSIF (cr.biblioitem.url) %]
95
                                                <a href="[% cr.biblioitem.url | url %]">Record URL</a>
96
                                            [% END %]
97
                                        </td>
98
                                    </tr>
99
                                [% END %]
100
                            </tbody>
101
                        </table>
102
                    [% ELSE %]
103
                        <br style="clear:both;" />
104
                        <div class="alert alert-info">
105
                            <p>No reserves have been selected for this research table.</p>
106
                        </div>
107
                    [% END %]
108
                </div> <!-- / #course_reserves -->
109
            </div> <!-- / .col -->
110
        </div> <!-- / .row -->
111
    </div> <!-- / .container-fluid -->
112
</div> <!-- / .main -->
113
[% INCLUDE 'opac-bottom.inc' %]
114
[% BLOCK jsinclude %]
115
    [% INCLUDE 'datatables.inc' %]
116
    [% INCLUDE 'columns_settings.inc' %]
117
    <script>
118
        $(document).ready(function() {
119
            columns_settings = [% TablesSettings.GetColumns( 'opac', 'biblio-detail', 'thesis-table-items-table', 'json' ) | $raw %];
120
            KohaTable("#thesis-table-items-table", {
121
                "dom": '<"top"f>rt<"clear">',
122
                "sorting": [[ 1, "asc" ]],
123
                "autoWidth": false,
124
            }, columns_settings );
125
        });
126
    </script>
127
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-thesis-tables.tt (+86 lines)
Line 0 Link Here
1
[% USE raw %]
2
[% USE Asset %]
3
[% USE Koha %]
4
[% USE AuthorisedValues %]
5
[% USE TablesSettings %]
6
7
[% INCLUDE 'doc-head-open.inc' %]
8
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Research tables</title>
9
[% INCLUDE 'doc-head-close.inc' %]
10
[% BLOCK cssinclude %]
11
    [% Asset.css("css/datatables.css") | $raw %]
12
[% END %]
13
14
</head>
15
[% INCLUDE 'bodytag.inc' bodyid='opac-thesis-tables' %]
16
[% INCLUDE 'masthead.inc' %]
17
18
<div class="main">
19
    <nav aria-label="breadcrumb">
20
        <ul class="breadcrumb">
21
            <li class="breadcrumb-item">
22
                <a href="/cgi-bin/koha/opac-main.pl">Home</a>
23
            </li>
24
            <li class="breadcrumb-item" aria-current="page">
25
                <a href="#">Research tables</a>
26
            </li>
27
        </ul>
28
    </nav>
29
30
    <div class="container-fluid">
31
        <div class="row">
32
            <div class="col order-first order-md-first order-lg-2">
33
                <div id="courses" class="maincontent">
34
                    <h1>Research tables</h1>
35
36
                    <table id="thesis_tables_table" class="table table-bordered table-striped table-condensed">
37
                        <thead>
38
                            <tr>
39
                                <th>Name</th>
40
                                <th>Table #</th>
41
                                <th>Researcher</th>
42
                                <th>Topic</th>
43
                            </tr>
44
                        </thead>
45
46
                        <tbody>
47
                            [% FOREACH c IN courses %]
48
                                <tr>
49
                                    <td><a href="opac-thesis-table-details.pl?table_id=[% c.course_id | uri %]">[% c.course_name | html %][%- IF c.section -%] - [% c.section | html %][%- END -%]</a></td>
50
                                    <td>[% c.course_number | html %]</td>
51
                                    <td>
52
                                      [% FOREACH i IN c.instructors %]
53
                                          <div class="instructor"><span class="inst_surname">[% i.surname | html %]</span>[% IF i.firstname %]<span class="instr_separator">, </span><span class="instr_firstname">[% i.firstname | html %]</span>[% END %]</div>
54
                                      [% END %]
55
                                    </td>
56
                                    <td>[% c.public_note | $raw %]</td>
57
                            [% END %]
58
                        </tbody>
59
                    </table>
60
                </div> <!-- / #courses -->
61
            </div> <!-- / .col -->
62
        </div> <!-- / .row -->
63
    </div> <!-- / .container-fluid -->
64
</div> <!-- / .main -->
65
[% INCLUDE 'opac-bottom.inc' %]
66
[% BLOCK jsinclude %]
67
    [% INCLUDE 'datatables.inc' %]
68
    [% INCLUDE 'columns_settings.inc' %]
69
    <script>
70
        $(document).ready(function() {
71
            columns_settings = [% TablesSettings.GetColumns( 'opac', 'biblio-detail', 'thesis_tables_table', 'json' ) | $raw %]
72
            KohaTable("#thesis_tables_table", {
73
                "dom": '<"top"f>rt<"clear">',
74
                "sorting": [[ 1, "asc" ]],
75
                "autoWidth": false,
76
                "asColumnDefs": [
77
                    { "aTargets": [ 1 ], "sType": "nsb-nse" },
78
                ],
79
                "language": {
80
                    "search": "_INPUT_",
81
                    "searchPlaceholder": "Search courses"
82
                }
83
            }, columns_settings );
84
        });
85
    </script>
86
[% END %]
(-)a/opac/opac-thesis-table-details.pl (+54 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
#
4
# Copyright 2012 Bywater Solutions
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
# (at your option) any later version.
12
#
13
# Koha is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
21
use Modern::Perl;
22
23
use CGI qw ( -utf8 );
24
25
use C4::Auth qw( get_template_and_user );
26
use C4::Output qw( output_html_with_http_headers );
27
use C4::Koha;
28
29
use C4::CourseReserves qw(GetCourse GetCourseReserves);
30
31
my $cgi = CGI->new;
32
33
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
34
    {   template_name   => "opac-thesis-table-details.tt",
35
        query           => $cgi,
36
        type            => "opac",
37
        authnotrequired => 1,
38
        debug           => 1,
39
    }
40
);
41
42
my $table_id = $cgi->param('table_id');
43
44
die("No table_id given") unless ($table_id);
45
46
my $course = GetCourse($table_id);
47
my $course_reserves = GetCourseReserves( course_id => $table_id, include_items => 1, include_count => 1 );
48
49
$template->param(
50
    course          => $course,
51
    course_reserves => $course_reserves,
52
);
53
54
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/opac/opac-thesis-tables.pl (-1 / +44 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
#
4
# Copyright 2012 Bywater Solutions
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
# (at your option) any later version.
12
#
13
# Koha is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
21
use Modern::Perl;
22
23
use CGI qw ( -utf8 );
24
25
use C4::Auth qw( get_template_and_user );
26
use C4::Output qw( output_html_with_http_headers );
27
28
use C4::CourseReserves qw(SearchCourses);
29
30
my $cgi = CGI->new;
31
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
33
    {   template_name   => "opac-thesis-tables.tt",
34
        query           => $cgi,
35
        type            => "opac",
36
        authnotrequired => 1,
37
        debug           => 1,
38
    }
39
);
40
41
my $courses = SearchCourses( enabled => 'yes', thesis_table => 'yes' );
42
43
$template->param( courses => $courses );
44
output_html_with_http_headers $cgi, $cookie, $template->output;

Return to bug 35972