Bug 11866: (follow-up) ensure that empty toolbar is not displayed
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / course_reserves / course-details.tt
1 [% USE AuthorisedValues %]
2 [% USE ItemTypes %]
3 [% USE Branches %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Course reserves &rsaquo; Course details for [% course.course_name %]</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7
8 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
9 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
10 [% INCLUDE 'datatables-strings.inc' %]
11 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
12 <script type="text/javascript">
13 //<![CDATA[
14     $(document).ready(function(){
15         $("#course_reserves_table").dataTable($.extend(true, {}, dataTablesDefaults, {
16             "sPaginationType": "four_button",
17             "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
18             "iDisplayLength": 20,
19             "aoColumnDefs": [
20                 { 'bSortable': false, 'aTargets': [ 'NoSort' ] }
21             ]
22         }));
23
24         $("a.delete_item").click(function(){
25             return confirm( _("Are you sure you want to remove this item from the course?"));
26         });
27
28         $("#delete_course").click(function(){
29             return confirm( _("Are you sure you want to delete this course?") );
30         });
31     });
32
33 //]]>
34 </script>
35
36 </head>
37
38 <body>
39
40 [% INCLUDE 'header.inc' %]
41 [% INCLUDE 'cat-search.inc' %]
42
43 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/course_reserves/course-reserves.pl">Course reserves</a> &rsaquo; Course details for <i>[% course.course_name %]</i></div>
44
45 <div id="doc2" class="yui-t7">
46     <div id="bd">
47         <div id="yui-main">
48             [% IF CAN_user_coursereserves_add_reserves OR CAN_user_coursereserves_manage_courses OR CAN_user_coursereserves_manage_courses %]
49             <div id="toolbar">
50                 <ul class="toolbar">
51                     [% IF CAN_user_coursereserves_add_reserves %]<li><a class="btn" id="add_items" href="/cgi-bin/koha/course_reserves/add_items.pl?course_id=[% course.course_id %]"><i class="icon-plus"></i> Add reserves</a></li>[% END %]
52                     [% IF ( CAN_user_coursereserves_manage_courses ) %]<li><a class="btn" id="edit_course" href="/cgi-bin/koha/course_reserves/course.pl?course_id=[% course.course_id %]"><i class="icon-pencil"></i> Edit course</a></li>[% END %]
53                     [% IF ( CAN_user_coursereserves_manage_courses ) %]<li><a class="btn" id="delete_course" href="/cgi-bin/koha/course_reserves/mod_course.pl?course_id=[% course.course_id %]&amp;action=del"><i class="icon-remove"></i> Delete course</a></li>[% END %]
54                 </ul>
55             </div><!-- /toolbar -->
56             [% END %]
57
58             <div class="rows">
59               <ol>
60                 <li><span class="label">Course name</span> [% course.course_name %]</li>
61                 <li><span class="label">Term</span> [% AuthorisedValues.GetByCode( 'TERM', course.term ) %]</li>
62                 <li><span class="label">Department</span> [% AuthorisedValues.GetByCode( 'DEPARTMENT', course.department ) %]</li>
63                 <li><span class="label">Course number</span> [% course.course_number %]</li>
64                 <li><span class="label">Section</span> [% course.section %]</li>
65                 <li><span class="label">Instructors</span> [% FOREACH i IN course.instructors %]<div class="instructor"><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% i.borrowernumber %]">[% i.firstname %] [% i.surname %]</a></div>[% END %]</li>
66                 <li><span class="label">Staff note</span> [% course.staff_note %]</li>
67                 <li><span class="label">Public note</span> [% course.public_note %]</li>
68                 <li><span class="label">Student count</span> [% course.students_count %]</li>
69                 <li><span class="label">Status</span> [% IF course.enabled == 'yes' %]Active[% ELSE %]Inactive[% END %]</li>
70               </ol>
71             </div>
72
73             [% IF course_reserves %]
74             <table id="course_reserves_table">
75                 <caption>Reserves</caption>
76                 <thead>
77                     <tr>
78                         <th>Title</th>
79                         <th>Barcode</th>
80                         <th>Call number</th>
81                         [% IF item_level_itypes %]<th>Item type</th>[% END %]
82                         <th>Collection</th>
83                         <th>Location</th>
84                         <th>Library</th>
85                         <th>Staff note</th>
86                         <th>Public note</th>
87                         [% IF CAN_user_coursereserves_add_reserves %]<th class="NoSort">&nbsp;<!-- Edit --></th>[% END %]
88                         [% IF CAN_user_coursereserves_delete_reserves %]<th class="NoSort">&nbsp;<!-- Remove --></th>[% END %]
89                         <th class="NoSort">Other course reserves</th>
90                     </tr>
91                 </thead>
92
93                 <tbody>
94                     [% FOREACH cr IN course_reserves %]
95                         <tr>
96                             <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% cr.item.biblionumber %]">[% cr.item.title %]</a></td>
97                             <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% cr.item.itemnumber %]&amp;biblionumber=[% cr.item.biblionumber %]&amp;bi=[% cr.item.biblioitemnumber %]">[% cr.item.barcode %]</a></td>
98                             <td>[% cr.item.itemcallnumber %]</td>
99                             [% IF item_level_itypes %]
100                             <td>
101                                 [% IF cr.course_item.itype %]
102                                     [% IF cr.course_item.enabled == 'yes' %]
103                                         [% ItemTypes.GetDescription( cr.item.itype ) %]
104                                     [% ELSE %]
105                                         [% ItemTypes.GetDescription( cr.course_item.itype ) %]
106                                     [% END %]
107                                 [% ELSE %]
108                                      <i>Unchanged</i>
109                                      [% IF cr.item.itype %]
110                                          ([% ItemTypes.GetDescription( cr.item.itype ) %])
111                                      [% END %]
112                                 [% END %]
113                             </td>
114                             [% END %]
115                             <td>
116                                  [% IF cr.course_item.ccode %]
117                                      [% IF cr.course_item.enabled == 'yes' %]
118                                           [% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) %]
119                                      [% ELSE %]
120                                          [% AuthorisedValues.GetByCode( 'CCODE', cr.course_item.ccode ) %]
121                                      [% END %]
122                                  [% ELSE %]
123                                      <i>Unchanged</i>
124                                      [% IF cr.item.ccode %]
125                                          ([% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) %])
126                                      [% END %]
127                                  [% END %]
128                             </td>
129                             <td>
130                                 [% IF cr.course_item.location %]
131                                      [% IF cr.course_item.enabled == 'yes' %]
132                                          [% AuthorisedValues.GetByCode( 'LOC', cr.item.location ) %]
133                                     [% ELSE %]
134                                         [% AuthorisedValues.GetByCode( 'LOC', cr.course_item.location ) %]
135                                     [% END %]
136                                 [% ELSE %]
137                                     <i>Unchanged</i>
138                                     [% IF cr.item.location %]
139                                         ([% AuthorisedValues.GetByCode( 'LOC', cr.item.location ) %])
140                                     [% END %]
141                                 [% END %]
142                             </td>
143                             <td>
144                                 [% IF cr.course_item.holdingbranch %]
145                                     [% IF cr.course_item.enabled == 'yes' %]
146                                         [% Branches.GetName( cr.item.holdingbranch ) %]
147                                     [% ELSE %]
148                                         [% Branches.GetName( cr.course_item.holdingbranch ) %]
149                                     [% END %]
150                                 [% ELSE %]
151                                     <i>Unchanged</i>
152                                     [% IF cr.item.holdingbranch %]
153                                         ([% Branches.GetName( cr.item.holdingbranch ) %])
154                                     [% END %]
155                                 [% END %]
156                             </td>
157                             <td>[% cr.staff_note %]</td>
158                             <td>[% cr.public_note %]</td>
159
160                             [% IF CAN_user_coursereserves_add_reserves %]
161                                 <td><a href="add_items.pl?course_id=[% course.course_id %]&amp;barcode=[% cr.item.barcode %]&amp;action=lookup">Edit</a></td>
162                             [% END %]
163
164                             [% IF CAN_user_coursereserves_delete_reserves %]
165                                 <td>
166                                     [% IF cr.item.onloan %]
167                                         On Loan
168                                     [% ELSIF cr.item.itemlost %]
169                                         Item Lost
170                                     [% ELSE %]
171                                         <a href="course-details.pl?course_id=[% course.course_id %]&amp;action=del_reserve&amp;cr_id=[% cr.cr_id %]" class="delete_item" >Remove</a>
172                                     [% END %]
173
174                                 </td>
175                             [% END %]
176
177                             <td>
178                                 [% FOREACH course IN cr.courses %]
179                                     [% UNLESS cr.course_id == course.course_id %]
180                                         <p>
181                                             <a href="course-details.pl?course_id=[% course.course_id %]">
182                                                 [% course.course_name %]
183                                                 [% IF course.section %] [% course.section %] [% END %]
184                                                 [% IF course.term %] [% AuthorisedValues.GetByCode( 'TERM', course.term ) %] [% END %]
185                                             </a>
186                                         </p>
187                                     [% END %]
188                                 [% END %]
189                             </td>
190                         </tr>
191                     [% END %]
192                 </tbody>
193             </table>
194             [% END %]
195         </div>
196     </div>
197
198 [% INCLUDE 'intranet-bottom.inc' %]