View | Details | Raw Unified | Return to bug 17449
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/css/sco.css (-1 / +4 lines)
Lines 170-175 i.cancel { Link Here
170
i.finish {
170
i.finish {
171
    background : transparent url("../lib/famfamfam/silk/stop.png") no-repeat 0 0;
171
    background : transparent url("../lib/famfamfam/silk/stop.png") no-repeat 0 0;
172
}
172
}
173
.finish-button {
174
    padding-top: 20px;
175
}
173
176
174
i.help {
177
i.help {
175
    background : transparent url("../lib/famfamfam/silk/help.png") no-repeat 0 0;
178
    background : transparent url("../lib/famfamfam/silk/help.png") no-repeat 0 0;
Lines 193-196 i.help { Link Here
193
.table .nosort.sorting {
196
.table .nosort.sorting {
194
    padding-right: 19px;
197
    padding-right: 19px;
195
    background: #EEEEEE none;
198
    background: #EEEEEE none;
196
}
199
}
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt (-20 / +94 lines)
Lines 178-203 Link Here
178
                        [% END # / IF patronid %]
178
                        [% END # / IF patronid %]
179
179
180
                        [% IF ( validuser ) %]
180
                        [% IF ( validuser ) %]
181
                            <div id="newcheckout" class="sco_entry">
181
182
                                <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('[% patronid %]');">
182
                            <!-- Nav tabs -->
183
                            <ul class="nav nav-tabs" role="tablist">
184
                                [% IF ( op_sanitized == 'checkout' ) %]
185
                                    <li role="presentation" class="active"><a href="#checkout" aria-controls="checkout" role="tab" data-toggle="tab">Checkout</a></li>
186
                                [% ELSE %]
187
                                    <li role="presentation"><a href="#checkout" aria-controls="checkout" role="tab" data-toggle="tab">Checkout</a></li>
188
                                [% END %]
189
                                [% IF ( op_sanitized == 'renew' ) %]
190
                                    <li role="presentation" class="active"><a href="#renew" aria-controls="renew" role="tab" data-toggle="tab">Renew</a></li>
191
                                [% ELSE %]
192
                                    <li role="presentation"><a href="#renew" aria-controls="renew" role="tab" data-toggle="tab">Renew</a></li>
193
                                [% END %]
194
                                [% IF ( AllowSelfCheckReturns ) %]
195
                                    [% IF ( op_sanitized == 'return' ) %]
196
                                        <li role="presentation" class="active"><a href="#return" aria-controls="return" role="tab" data-toggle="tab">Return</a></li>
197
                                    [% ELSE %]
198
                                        <li role="presentation"><a href="#return" aria-controls="return" role="tab" data-toggle="tab">Return</a></li>
199
                                    [% END %]
200
                                [% END %]
201
                            </ul>
202
203
                            <!-- Tab panes -->
204
                            <div class="tab-content">
205
                            [% IF ( op_sanitized == 'checkout' ) %]
206
                                <div role="tabpanel" class="tab-pane active" id="checkout">
207
                            [% ELSE %]
208
                                <div role="tabpanel" class="tab-pane" id="checkout">
209
                            [% END %]
210
                                <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('checkout', '[% patronid %]');">
183
                                    <fieldset>
211
                                    <fieldset>
184
                                        <legend>Check out[% IF ( AllowSelfCheckReturns ) %], return[% END %] or renew an item: </legend>
212
                                    <div class="input-append">
185
                                        <div class="input-append">
213
                                        <label for="checkout-barcode">Scan a new item or enter its barcode to checkout:</label>
186
                                            <label for="barcode">Scan a new item or enter its barcode:</label>
214
                                        <input id="checkout-barcode" name="barcode" size="20" type="text" class="form-control focus" autocomplete="off" />
187
                                            <input id="barcode" name="barcode" size="20" type="text" class="focus" autocomplete="off" />
215
                                        <span class="input-group-btn">
188
                                            <button type="submit" class="btn">Submit</button>
216
                                            <button type="submit" class="btn btn-default" type="button">Submit</button>
189
                                        </div>
217
                                        </span>
190
                                        <input type="hidden" name="op" value="checkout" />
218
                                    </div>
191
                                        <input type="hidden" name="patronid" value="[% patronid %]" />
219
                                    <input type="hidden" name="op" value="checkout" />
192
                                    </fieldset>
220
                                    <input type="hidden" name="patronid" value="[% patronid %]" />
221
                                </fieldset>
193
                                </form>
222
                                </form>
223
                            </div> <!-- / #checkout -->
194
224
195
                                <div>
225
                            [% IF ( op_sanitized == 'renew' ) %]
196
                                    <form method="post" action="#" id="logout_form">
226
                                <div role="tabpanel" class="tab-pane active" id="renew">
197
                                        <button type="submit" class="btn"><i class="icon finish"></i> Finish</button>
227
                            [% ELSE %]
198
                                    </form>
228
                                <div role="tabpanel" class="tab-pane" id="renew">
199
                                </div>
229
                            [% END %]
200
                            </div> <!-- / #newcheckout -->
230
                                <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('renew', '[% patronid %]');">
231
                                    <fieldset>
232
                                    <div class="input-append">
233
                                        <label for="renew-barcode">Scan a new item or enter its barcode to renew it:</label>
234
                                        <input id="renew-barcode" name="barcode" size="20" type="text" class="form-control focus" autocomplete="off" />
235
                                        <button type="submit" class="btn">Submit</button>
236
                                    </div>
237
                                    <input type="hidden" name="op" value="renew" />
238
                                    <input type="hidden" name="patronid" value="[% patronid %]" />
239
                                </fieldset>
240
                                </form>
241
                            </div> <!-- / #renew -->
242
243
                            [% IF ( AllowSelfCheckReturns ) %]
244
                            [% IF ( op_sanitized == 'return' ) %]
245
                                <div role="tabpanel" class="tab-pane active" id="return">
246
                            [% ELSE %]
247
                                <div role="tabpanel" class="tab-pane" id="return">
248
                            [% END %]
249
                                <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('return', '[% patronid %]');">
250
                                    <fieldset>
251
                                    <div class="input-append">
252
                                        <label for="return-barcode">Scan a new item or enter its barcode to return it:</label>
253
                                        <input id="return-barcode" name="barcode" size="20" type="text" class="form-control focus" autocomplete="off" />
254
                                        <button type="submit" class="btn">Submit</button>
255
                                    </div>
256
                                    <input type="hidden" name="op" value="returnbook" />
257
                                    <input type="hidden" name="patronid" value="[% patronid %]" />
258
                                </fieldset>
259
                                </form>
260
                            </div> <!-- / #return -->
261
                            [% END %]
262
                            </div> <!-- / #tab-content-->
263
264
                            <div class="finish-button">
265
                                <form method="post" action="#" id="logout_form">
266
                                    <button type="submit" class="btn"><i class="icon finish"></i> Finish</button>
267
                                </form>
268
                            </div>
201
                </div> <!-- / .span12/12 -->
269
                </div> <!-- / .span12/12 -->
202
                [% IF ( display_patron_image ) %]
270
                [% IF ( display_patron_image ) %]
203
                    <div class="span2">
271
                    <div class="span2">
Lines 318-324 Link Here
318
        </div> <!-- / .container-fluid -->
386
        </div> <!-- / .container-fluid -->
319
    </div> <!-- / .main -->
387
    </div> <!-- / .main -->
320
    <span id="audio-alert"></span>
388
    <span id="audio-alert"></span>
321
</body>
322
389
323
[% INCLUDE 'opac-bottom.inc' %]
390
[% INCLUDE 'opac-bottom.inc' %]
324
[% BLOCK jsinclude %]
391
[% BLOCK jsinclude %]
Lines 347-354 Link Here
347
414
348
          return false;
415
          return false;
349
        }
416
        }
350
        function checkout_confirm(patronid) {
417
        function checkout_confirm(target, patronid) {
351
            var   barcode = $("#barcode").val();
418
            var   barcode = $("#" + target + "-barcode").val();
352
            // alert("checkout_confirm('" + patronid + "') called for barcode '" + barcode + "'");
419
            // alert("checkout_confirm('" + patronid + "') called for barcode '" + barcode + "'");
353
            if (! barcode) { dofocus(); return false; }    // no barcode
420
            if (! barcode) { dofocus(); return false; }    // no barcode
354
            if (barcode == "__KOHA_NEW_CIRC__") {   // magic barcode
421
            if (barcode == "__KOHA_NEW_CIRC__") {   // magic barcode
Lines 406-411 Link Here
406
473
407
                return true;
474
                return true;
408
            });
475
            });
476
477
            // Make sure the barcode box on the selected tab is given focus
478
            $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
479
                var target = $(e.target).attr("href");
480
                $(target + '-barcode').focus();
481
            });
482
409
    });
483
    });
410
    //]]>
484
    //]]>
411
    </script>
485
    </script>
(-)a/opac/sco/sco-main.pl (-3 / +16 lines)
Lines 134-139 elsif ( $op eq "returnbook" && $allowselfcheckreturns ) { Link Here
134
    #warn "returnbook: " . $doreturn;
134
    #warn "returnbook: " . $doreturn;
135
    $borrower = GetMemberDetails(undef,$patronid);
135
    $borrower = GetMemberDetails(undef,$patronid);
136
}
136
}
137
elsif ( $op eq "renew" ) {
138
    AddRenewal( $borrower, $item->{itemnumber} );
139
}
137
elsif ( $op eq "checkout" ) {
140
elsif ( $op eq "checkout" ) {
138
    my $impossible  = {};
141
    my $impossible  = {};
139
    my $needconfirm = {};
142
    my $needconfirm = {};
Lines 283-291 if ($borrower->{cardnumber}) { Link Here
283
    );
286
    );
284
}
287
}
285
288
289
# Send a sanitized value for op to the template, to determine active tab
290
my $op_sanitized;
291
if ( $op eq 'returnbook' ) {
292
    $op_sanitized = 'return';
293
} elsif ( $op eq 'renew' ) {
294
    $op_sanitized = 'renew';
295
} else {
296
    $op_sanitized = 'checkout';
297
}
298
286
$template->param(
299
$template->param(
287
    SCOUserJS  => C4::Context->preference('SCOUserJS'),
300
    SCOUserJS    => C4::Context->preference('SCOUserJS'),
288
    SCOUserCSS => C4::Context->preference('SCOUserCSS'),
301
    SCOUserCSS   => C4::Context->preference('SCOUserCSS'),
302
    op_sanitized => $op_sanitized,
289
);
303
);
290
304
291
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
305
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
292
- 

Return to bug 17449