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