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