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