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