Bug 20036: Switch single-column templates to Bootstrap grid: Offline circulation
[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 class="main container-fluid">
14     <div class="row">
15         <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
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 </div>
88
89 [% MACRO jsinclude BLOCK %]
90     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min_[% KOHA_VERSION %].js"></script>
91     <script type="text/javascript">
92         $(document).ready(function() {
93
94         $("span.clearall").html("<a id=\"CheckNone\" href=\"/cgi-bin/koha/offline_circ/list.pl\">"+_("Uncheck all")+"<\/a>");
95         $("span.checkall").html("<a id=\"CheckAll\" href=\"/cgi-bin/koha/offline_circ/list.pl\">"+_("Check all")+"<\/a>");
96             $('#CheckNone').click(function() {
97                 $("#operations").unCheckCheckboxes();
98                 return false;
99             });
100             $('#CheckAll').click(function() {
101                 $("#operations").checkCheckboxes();
102                 return false;
103             });
104             $('#process,#delete').click(function() {
105                 var action = $(this).attr("id");
106                 $(":checkbox[name=operationid]:checked").each(function() {
107                     var cb = $(this);
108                     $.ajax({
109                         url: "process.pl",
110                         data: { 'action': action, 'operationid': this.value },
111                         async: false,
112                         dataType: "text",
113                         success: function(data) {
114                             if( data == "Added." ){
115                                 cb.replaceWith(_("Added."));
116                             } else if ( data == "Deleted."){
117                                 cb.replaceWith(_("Deleted."));
118                             } else if ( data == "Success."){
119                                 cb.replaceWith(_("Success."));
120                             } else if ( data == "Item not issued."){
121                                 cb.replaceWith(_("Item not checked out."));
122                             } else if ( data == "Item not found."){
123                                 cb.replaceWith(_("Item not found."));
124                             } else if ( data == "Barcode not found."){
125                                 cb.replaceWith(_("Item not found."));
126                             } else if ( data == "Borrower not found."){
127                                 cb.replaceWith(_("Patron not found."));
128                             } else {
129                                 cb.replaceWith(data);
130                             }
131                         }});
132                 });
133                 if( $('#operations tbody :checkbox').size() == 0 ) {
134                     $('#actions').hide();
135                 }
136             });
137         });
138     </script>
139 [% END %]
140
141 [% INCLUDE 'intranet-bottom.inc' %]