Bug 19825: Make links to biblios on pending offline circulation page working again
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / offline_circ / list.tt
1 [% SET footerjs = 1 %]
2     [% INCLUDE "doc-head-open.inc" %]
3     <title>Koha &rsaquo; Circulation &rsaquo; Offline circulation</title>
4     [% INCLUDE "doc-head-close.inc" %]
5 </head>
6
7 <body id="ocirc_list" class="circ ocirc">
8     [% INCLUDE 'header.inc' %]
9     [% INCLUDE 'circ-search.inc' %]
10
11     <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo; Offline circulation</div>
12
13     <div id="doc" class="yui-t7">
14
15             <div id="bd">
16
17         <h2>Offline circulation</h2>
18
19             [% IF ( pending_operations ) %]
20
21                 <form>
22              <p><span class="checkall"></span> |
23              <span class="clearall"></span></p>
24                 <table id="operations">
25                     <thead>
26                             <tr>
27                                 <th>&nbsp;</th>
28                                     <th>Date</th>
29                                     <th>Action</th>
30                                     <th>Barcode</th>
31                                     <th>Card number</th>
32                                     <th>Amount</th>
33                             </tr>
34                         </thead>
35                         <tbody>
36                             [% FOREACH operation IN pending_operations %]
37                                 <tr class="oc-[% operation.action %]">
38                                     <td><input type="checkbox" name="operationid" value="[% operation.operationid %]" /></td>
39                                         <td>[% operation.timestamp %]</td>
40                             <td>
41                                 [% SWITCH ( operation.action ) -%]
42                                     [%   CASE "issue" -%]
43                                         Check out
44                                     [%   CASE "return" -%]
45                                         Check in
46                                     [%   CASE "payment" -%]
47                                         Payment
48                                     [%   CASE # default case -%]
49                                         [% operation.action %]
50                                 [% END -%]
51                             </td>
52                                         <td>
53                                 [% IF ( operation.biblionumber ) %]
54                                                 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% operation.biblionumber %]" title="[% operation.bibliotitle %]">[% operation.barcode %]</a>
55                                             [% ELSE %]
56                                                 <span class="error">[% operation.barcode %]</span>
57                                             [% END %]
58                                         </td>
59                                         <td>
60                                         [% IF ( operation.actionissue || operation.actionpayment) %]
61                                         [% IF ( operation.borrowernumber ) %]
62                                             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% operation.borrowernumber %]" title="[% operation.borrower %]">[% operation.cardnumber %]</a>
63                                         [% ELSE %]
64                                             <span class="error">[% operation.cardnumber %]</span>
65                                         [% END %]
66                                         [% END %]
67                                         </td>
68                                         <td>[% operation.amount %]</td>
69                                 </tr>
70                             [% END %]
71                         </tbody>
72                 </table>
73
74             <p id="actions">For the selected operations:
75             <input type="button" id="process" value="Process" />
76             <input type="button" id="delete" value="Delete" /></p>
77
78             </form>
79
80         [% ELSE %]
81
82             <p>There are no pending offline operations.</p>
83
84         [% END %]
85
86     </div>
87
88 [% MACRO jsinclude BLOCK %]
89     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
90     <script type="text/javascript">
91         $(document).ready(function() {
92
93         $("span.clearall").html("<a id=\"CheckNone\" href=\"/cgi-bin/koha/offline_circ/list.pl\">"+_("Uncheck all")+"<\/a>");
94         $("span.checkall").html("<a id=\"CheckAll\" href=\"/cgi-bin/koha/offline_circ/list.pl\">"+_("Check all")+"<\/a>");
95             $('#CheckNone').click(function() {
96                 $("#operations").unCheckCheckboxes();
97                 return false;
98             });
99             $('#CheckAll').click(function() {
100                 $("#operations").checkCheckboxes();
101                 return false;
102             });
103             $('#process,#delete').click(function() {
104                 var action = $(this).attr("id");
105                 $(":checkbox[name=operationid]:checked").each(function() {
106                     var cb = $(this);
107                     $.ajax({
108                         url: "process.pl",
109                         data: { 'action': action, 'operationid': this.value },
110                         async: false,
111                         dataType: "text",
112                         success: function(data) {
113                             if( data == "Added." ){
114                                 cb.replaceWith(_("Added."));
115                             } else if ( data == "Deleted."){
116                                 cb.replaceWith(_("Deleted."));
117                             } else if ( data == "Success."){
118                                 cb.replaceWith(_("Success."));
119                             } else if ( data == "Item not issued."){
120                                 cb.replaceWith(_("Item not checked out."));
121                             } else if ( data == "Item not found."){
122                                 cb.replaceWith(_("Item not found."));
123                             } else if ( data == "Barcode not found."){
124                                 cb.replaceWith(_("Item not found."));
125                             } else if ( data == "Borrower not found."){
126                                 cb.replaceWith(_("Patron not found."));
127                             } else {
128                                 cb.replaceWith(data);
129                             }
130                         }});
131                 });
132                 if( $('#operations tbody :checkbox').size() == 0 ) {
133                     $('#actions').hide();
134                 }
135             });
136         });
137     </script>
138 [% END %]
139
140 [% INCLUDE 'intranet-bottom.inc' %]