Merge remote-tracking branch 'origin/new/bug_7613'
[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.tablesorter.min.js"></script>
5     <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
6     <script type="text/javascript" language="javascript">
7     //<![CDATA[
8         $(document).ready(function() {
9
10         $("span.clearall").html("<a id=\"CheckNone\" href=\"/cgi-bin/koha/offline_circ/list.pl\">"+_('Uncheck all')+"<\/a>");
11         $("span.checkall").html("<a id=\"CheckAll\" href=\"/cgi-bin/koha/offline_circ/list.pl\">"+_('Check all')+"<\/a>");
12             $('#CheckNone').click(function() {
13                 $("#operations").unCheckCheckboxes();
14                 return false;
15             });
16             $('#CheckAll').click(function() {
17                 $("#operations").checkCheckboxes();
18                 return false;
19             });
20             $('#process,#delete').click(function() {
21                 var action = $(this).attr("id");
22                 $(":checkbox[name=operationid]:checked").each(function() {
23                     var cb = $(this);
24                     $.ajax({
25                         url: "process.pl",
26                         data: { 'action': action, 'operationid': this.value },
27                         async: false,
28                         dataType: "text",
29                         success: function(data) {
30                             if( data == "Added." ){
31                                 cb.replaceWith(_("Added."));
32                             } else if ( data == "Deleted."){
33                                 cb.replaceWith(_("Deleted."));
34                             } else if ( data == "Success."){
35                                 cb.replaceWith(_("Success."));
36                             } else if ( data == "Item not issued."){
37                                 cb.replaceWith(_("Item not checked out."));
38                             } else if ( data == "Item not found."){
39                                 cb.replaceWith(_("Item not found."));
40                             } else if ( data == "Barcode not found."){
41                                 cb.replaceWith(_("Item not found."));
42                             } else if ( data == "Borrower not found."){
43                                 cb.replaceWith(_("Patron not found."));
44                             } else {
45                                 cb.replaceWith(data);
46                             }
47                         }});
48                 });
49                 if( $('#operations tbody :checkbox').size() == 0 ) {
50                     $('#actions').hide();
51                 }
52             });
53         });
54     //]]>
55     </script>
56 </head>
57 <body id="ocirc_list" class="circ ocirc">
58     [% INCLUDE 'header.inc' %]
59     [% INCLUDE 'circ-search.inc' %]
60
61     <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>
62
63     <div id="doc" class="yui-t7">
64
65             <div id="bd">
66
67         <h2>Offline circulation</h2>
68
69             [% IF ( pending_operations ) %]
70
71                 <form>
72              <p><span class="checkall"></span> |
73              <span class="clearall"></span></p>
74                 <table id="operations">
75                     <thead>
76                             <tr>
77                                 <th>&nbsp;</th>
78                                     <th>Date</th>
79                                     <th>Action</th>
80                                     <th>Barcode</th>
81                         <th>Card number</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 ) %]
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                                 </tr>
107                             [% END %]
108                         </tbody>
109                 </table>
110
111             <p id="actions">For the selected operations:
112             <input type="button" id="process" value="Process" />
113             <input type="button" id="delete" value="Delete" /></p>
114
115             </form>
116
117         [% ELSE %]
118
119             <p>There is no pending offline operations.</p>
120
121         [% END %]
122
123     </div>
124
125     [% INCLUDE 'intranet-bottom.inc' %]