Bug 8215: Followup Fix confirmation links for delete course and item
[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; New course</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7
8 <script type="text/javascript">
9 //<![CDATA[
10     $(document).ready(function(){
11         $("a.delete_item").click(function(){
12             return confirm( _("Are you sure you want to delete this item?"));
13         });
14
15         $("#delete_course").click(function(){
16             return confirm( _("Are you sure you want to delete this course?") );
17         });
18     });
19
20 //]]>
21 </script>
22
23 </head>
24
25 <body>
26
27 [% INCLUDE 'header.inc' %]
28 [% INCLUDE 'cat-search.inc' %]
29
30 <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>
31
32 <div id="doc2" class="yui-t7">
33     <div id="bd">
34         <div id="yui-main">
35             <div id="toolbar">
36                 <ul class="toolbar">
37                     [% 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 %]">Add reserves</a></li>[% END %]
38                     [% 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 %]">Edit course</a></li>[% END %]
39                     [% 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 %]&action=del">Delete course</a></li>[% END %]
40                 </ul>
41             </div><!-- /toolbar -->
42
43             <table>
44               <tbody>
45                 <tr><th>Course name</th><td>[% course.course_name %]</td></tr>
46                 <tr><th>Term</th><td>[% AuthorisedValues.GetByCode( 'TERM', course.term ) %]</td></tr>
47                 <tr><th>Department</th><td>_[% AuthorisedValues.GetByCode( 'DEPARTMENT', course.department ) %]</td></tr>
48                 <tr><th>Course number</th><td>[% course.course_number %]</td></tr>
49                 <tr><th>Section</th><td>[% course.section %]</td></tr>
50                 <tr><th>Instructors</th><td>[% 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 %]</td></tr>
51                 <tr><th>Staff note</th><td>[% course.staff_note %]</td></tr>
52                 <tr><th>Public note</th><td>[% course.public_note %]</td></tr>
53                 <tr><th>Students count</th><td>[% course.students_count %]</td></tr>
54                 <tr><th>Status</th><td>[% IF course.enabled == 'yes' %]Active[% ELSE %]Inactive[% END %]</td></tr>
55               </tbody>
56             </table>
57
58             [% IF course_reserves %]
59             <table>
60                 <thead>
61                     <tr>
62                         <th>Title</th>
63                         <th>Barcode</th>
64                         <th>Call number</th>
65                         [% IF item_level_itypes %]<th>Item type</th>[% END %]
66                         <th>Collection</th>
67                         <th>Location</th>
68                         <th>Library</th>
69                         <th>Staff note</th>
70                         <th>Public note</th>
71                         [% IF CAN_user_coursereserves_add_reserves %]<th>&nbsp;<!-- Edit --></th>[% END %]
72                         [% IF CAN_user_coursereserves_delete_reserves %]<th>&nbsp;<!-- Remove --></th>[% END %]
73                         <th>Other course reserves</th>
74                     </tr>
75                 </thead>
76
77                 <tbody>
78                     [% FOREACH cr IN course_reserves %]
79                         <tr>
80                             <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% cr.item.biblionumber %]">[% cr.item.title %]</a></td>
81                             <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% cr.item.itemnumber %]&biblionumber=[% cr.item.biblionumber %]&bi=[% cr.item.biblioitemnumber %]">[% cr.item.barcode %]</a></td>
82                             <td>[% cr.item.itemcallnumber %]</td>
83                             [% IF item_level_itypes %]
84                             <td>
85                                 [% IF cr.course_item.itype %]
86                                     [% IF cr.course_item.enabled == 'yes' %]
87                                         [% ItemTypes.GetDescription( cr.item.itype ) %]
88                                     [% ELSE %]
89                                         [% ItemTypes.GetDescription( cr.course_item.itype ) %]
90                                     [% END %]
91                                 [% ELSE %]
92                                      <i>Unchanged</i>
93                                      ([% ItemTypes.GetDescription( cr.item.itype ) %])
94                                 [% END %]
95                             </td>
96                             [% END %]
97                             <td>
98                                  [% IF cr.course_item.ccode %]
99                                      [% IF cr.course_item.enabled == 'yes' %]
100                                           [% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) %]
101                                      [% ELSE %]
102                                          [% AuthorisedValues.GetByCode( 'CCODE', cr.course_item.ccode ) %]
103                                      [% END %]
104                                  [% ELSE %]
105                                      <i>Unchanged</i>
106                                      ([% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) %])
107                                  [% END %]
108                             </td>
109                             <td>
110                                 [% IF cr.course_item.location %]
111                                      [% IF cr.course_item.enabled == 'yes' %]
112                                          [% AuthorisedValues.GetByCode( 'LOC', cr.item.location ) %]
113                                     [% ELSE %]
114                                         [% AuthorisedValues.GetByCode( 'LOC', cr.course_item.location ) %]
115                                     [% END %]
116                                 [% ELSE %]
117                                     <i>Unchanged</i>
118                                     ([% AuthorisedValues.GetByCode( 'LOC', cr.item.location ) %])
119                                 [% END %]
120                             </td>
121                             <td>
122                                 [% IF cr.course_item.holdingbranch %]
123                                     [% IF cr.course_item.enabled == 'yes' %]
124                                         [% Branches.GetName( cr.item.holdingbranch ) %]
125                                     [% ELSE %]
126                                         [% Branches.GetName( cr.course_item.holdingbranch ) %]
127                                     [% END %]
128                                 [% ELSE %]
129                                     <i>Unchanged</i>
130                                     ([% Branches.GetName( cr.item.holdingbranch ) %])
131                                 [% END %]
132                             </td>
133                             <td>[% cr.staff_note %]</td>
134                             <td>[% cr.public_note %]</td>
135
136                             [% IF CAN_user_coursereserves_add_reserves %]
137                                 <td><a href="add_items.pl?course_id=[% course.course_id %]&barcode=[% cr.item.barcode %]&action=lookup">Edit</a></td>
138                             [% END %]
139
140                             [% IF CAN_user_coursereserves_delete_reserves %]
141                                 <td>
142                                     [% IF cr.item.onloan %]
143                                         On Loan
144                                     [% ELSIF cr.item.itemlost %]
145                                         Item Lost
146                                     [% ELSE %]
147                                         <a href="course-details.pl?course_id=[% course.course_id %]&action=del_reserve&cr_id=[% cr.cr_id %]" class="delete_item" >Remove</a>
148                                     [% END %]
149
150                                 </td>
151                             [% END %]
152
153                             <td>
154                                 [% FOREACH course IN cr.courses %]
155                                     [% UNLESS cr.course_id == course.course_id %]
156                                         <p>
157                                             <a href="course-details.pl?course_id=[% course.course_id %]">
158                                                 [% course.course_name %]
159                                                 [% IF course.section %] [% course.section %] [% END %]
160                                                 [% IF course.term %] [% AuthorisedValues.GetByCode( 'TERM', course.term ) %] [% END %]
161                                             </a>
162                                         </p>
163                                     [% END %]
164                                 [% END %]
165                             </td>
166                         </tr>
167                     [% END %]
168                 </tbody>
169             </table>
170             [% END %]
171         </div>
172     </div>
173 </div>
174
175
176 [% INCLUDE 'intranet-bottom.inc' %]