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

(-)a/koha-tmpl/opac-tmpl/bootstrap/css/sco.css (-4 / +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 194-208 i.help { Link Here
194
    padding-right: 19px;
197
    padding-right: 19px;
195
    background: #EEEEEE none;
198
    background: #EEEEEE none;
196
}
199
}
197
198
#sci_logout {
200
#sci_logout {
199
    color: #E8583C;
201
    color: #E8583C;
200
}
202
}
201
202
#sci_checkin_button, #sci_refresh_button, #sci_append_button {
203
#sci_checkin_button, #sci_refresh_button, #sci_append_button {
203
    margin-bottom: 10px;
204
    margin-bottom: 10px;
204
}
205
}
205
206
#sci_refresh_button {
206
#sci_refresh_button {
207
    color: rgb(51, 51, 51);
207
    color: rgb(51, 51, 51);
208
}
208
}
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt (-20 / +94 lines)
Lines 182-207 Link Here
182
                        [% END # / IF patronid %]
182
                        [% END # / IF patronid %]
183
183
184
                        [% IF ( validuser ) %]
184
                        [% IF ( validuser ) %]
185
                            <div id="newcheckout" class="sco_entry">
185
186
                                <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('[% patronid %]');">
186
                            <!-- Nav tabs -->
187
                            <ul class="nav nav-tabs" role="tablist">
188
                                [% IF ( op_sanitized == 'checkout' ) %]
189
                                    <li role="presentation" class="active"><a href="#checkout" aria-controls="checkout" role="tab" data-toggle="tab">Checkout</a></li>
190
                                [% ELSE %]
191
                                    <li role="presentation"><a href="#checkout" aria-controls="checkout" role="tab" data-toggle="tab">Checkout</a></li>
192
                                [% END %]
193
                                [% IF ( op_sanitized == 'renew' ) %]
194
                                    <li role="presentation" class="active"><a href="#renew" aria-controls="renew" role="tab" data-toggle="tab">Renew</a></li>
195
                                [% ELSE %]
196
                                    <li role="presentation"><a href="#renew" aria-controls="renew" role="tab" data-toggle="tab">Renew</a></li>
197
                                [% END %]
198
                                [% IF ( Koha.Preference('AllowSelfCheckReturns') ) %]
199
                                    [% IF ( op_sanitized == 'return' ) %]
200
                                        <li role="presentation" class="active"><a href="#return" aria-controls="return" role="tab" data-toggle="tab">Return</a></li>
201
                                    [% ELSE %]
202
                                        <li role="presentation"><a href="#return" aria-controls="return" role="tab" data-toggle="tab">Return</a></li>
203
                                    [% END %]
204
                                [% END %]
205
                            </ul>
206
207
                            <!-- Tab panes -->
208
                            <div class="tab-content">
209
                            [% IF ( op_sanitized == 'checkout' ) %]
210
                                <div role="tabpanel" class="tab-pane active" id="checkout">
211
                            [% ELSE %]
212
                                <div role="tabpanel" class="tab-pane" id="checkout">
213
                            [% END %]
214
                                <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('checkout', '[% patronid %]');">
187
                                    <fieldset>
215
                                    <fieldset>
188
                                        <legend>Check out[% IF ( Koha.Preference('AllowSelfCheckReturns') ) %], return[% END %] or renew an item: </legend>
216
                                    <div class="input-append">
189
                                        <div class="input-append">
217
                                        <label for="checkout-barcode">Scan a new item or enter its barcode to checkout:</label>
190
                                            <label for="barcode">Scan a new item or enter its barcode:</label>
218
                                        <input id="checkout-barcode" name="barcode" size="20" type="text" class="form-control focus" autocomplete="off" />
191
                                            <input id="barcode" name="barcode" size="20" type="text" class="focus" autocomplete="off" />
219
                                        <span class="input-group-btn">
192
                                            <button type="submit" class="btn">Submit</button>
220
                                            <button type="submit" class="btn btn-default" type="button">Submit</button>
193
                                        </div>
221
                                        </span>
194
                                        <input type="hidden" name="op" value="checkout" />
222
                                    </div>
195
                                        <input type="hidden" name="patronid" value="[% patronid %]" />
223
                                    <input type="hidden" name="op" value="checkout" />
196
                                    </fieldset>
224
                                    <input type="hidden" name="patronid" value="[% patronid %]" />
225
                                </fieldset>
197
                                </form>
226
                                </form>
227
                            </div> <!-- / #checkout -->
198
228
199
                                <div>
229
                            [% IF ( op_sanitized == 'renew' ) %]
200
                                    <form method="post" action="#" id="logout_form">
230
                                <div role="tabpanel" class="tab-pane active" id="renew">
201
                                        <button type="submit" class="btn"><i class="icon finish"></i> Finish</button>
231
                            [% ELSE %]
202
                                    </form>
232
                                <div role="tabpanel" class="tab-pane" id="renew">
203
                                </div>
233
                            [% END %]
204
                            </div> <!-- / #newcheckout -->
234
                                <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('renew', '[% patronid %]');">
235
                                    <fieldset>
236
                                    <div class="input-append">
237
                                        <label for="renew-barcode">Scan a new item or enter its barcode to renew it:</label>
238
                                        <input id="renew-barcode" name="barcode" size="20" type="text" class="form-control focus" autocomplete="off" />
239
                                        <button type="submit" class="btn">Submit</button>
240
                                    </div>
241
                                    <input type="hidden" name="op" value="renew" />
242
                                    <input type="hidden" name="patronid" value="[% patronid %]" />
243
                                </fieldset>
244
                                </form>
245
                            </div> <!-- / #renew -->
246
247
                            [% IF ( Koha.Preference('AllowSelfCheckReturns') ) %]
248
                            [% IF ( op_sanitized == 'return' ) %]
249
                                <div role="tabpanel" class="tab-pane active" id="return">
250
                            [% ELSE %]
251
                                <div role="tabpanel" class="tab-pane" id="return">
252
                            [% END %]
253
                                <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('return', '[% patronid %]');">
254
                                    <fieldset>
255
                                    <div class="input-append">
256
                                        <label for="return-barcode">Scan a new item or enter its barcode to return it:</label>
257
                                        <input id="return-barcode" name="barcode" size="20" type="text" class="form-control focus" autocomplete="off" />
258
                                        <button type="submit" class="btn">Submit</button>
259
                                    </div>
260
                                    <input type="hidden" name="op" value="returnbook" />
261
                                    <input type="hidden" name="patronid" value="[% patronid %]" />
262
                                </fieldset>
263
                                </form>
264
                            </div> <!-- / #return -->
265
                            [% END %]
266
                            </div> <!-- / #tab-content-->
267
268
                            <div class="finish-button">
269
                                <form method="post" action="#" id="logout_form">
270
                                    <button type="submit" class="btn"><i class="icon finish"></i> Finish</button>
271
                                </form>
272
                            </div>
205
                </div> <!-- / .span12/12 -->
273
                </div> <!-- / .span12/12 -->
206
                [% IF ( display_patron_image ) %]
274
                [% IF ( display_patron_image ) %]
207
                    <div class="span2">
275
                    <div class="span2">
Lines 327-333 Link Here
327
        </div> <!-- / .container-fluid -->
395
        </div> <!-- / .container-fluid -->
328
    </div> <!-- / .main -->
396
    </div> <!-- / .main -->
329
    <span id="audio-alert"></span>
397
    <span id="audio-alert"></span>
330
</body>
331
398
332
[% INCLUDE 'opac-bottom.inc' %]
399
[% INCLUDE 'opac-bottom.inc' %]
333
[% BLOCK jsinclude %]
400
[% BLOCK jsinclude %]
Lines 356-363 Link Here
356
423
357
          return false;
424
          return false;
358
        }
425
        }
359
        function checkout_confirm(patronid) {
426
        function checkout_confirm(target, patronid) {
360
            var   barcode = $("#barcode").val();
427
            var   barcode = $("#" + target + "-barcode").val();
361
            // alert("checkout_confirm('" + patronid + "') called for barcode '" + barcode + "'");
428
            // alert("checkout_confirm('" + patronid + "') called for barcode '" + barcode + "'");
362
            if (! barcode) { dofocus(); return false; }    // no barcode
429
            if (! barcode) { dofocus(); return false; }    // no barcode
363
            if (barcode == "__KOHA_NEW_CIRC__") {   // magic barcode
430
            if (barcode == "__KOHA_NEW_CIRC__") {   // magic barcode
Lines 415-420 Link Here
415
482
416
                return true;
483
                return true;
417
            });
484
            });
485
486
            // Make sure the barcode box on the selected tab is given focus
487
            $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
488
                var target = $(e.target).attr("href");
489
                $(target + '-barcode').focus();
490
            });
491
418
    });
492
    });
419
    //]]>
493
    //]]>
420
    </script>
494
    </script>
(-)a/opac/sco/sco-main.pl (-1 / +19 lines)
Lines 128-133 if ($op eq "logout") { Link Here
128
elsif ( $op eq "returnbook" && $allowselfcheckreturns ) {
128
elsif ( $op eq "returnbook" && $allowselfcheckreturns ) {
129
    my ($doreturn) = AddReturn( $barcode, $branch );
129
    my ($doreturn) = AddReturn( $barcode, $branch );
130
}
130
}
131
elsif ( $op eq "renew" ) {
132
    AddRenewal( $borrower->{borrowernumber}, $item->{itemnumber} );
133
}
131
elsif ( $patron and $op eq "checkout" ) {
134
elsif ( $patron and $op eq "checkout" ) {
132
    my $impossible  = {};
135
    my $impossible  = {};
133
    my $needconfirm = {};
136
    my $needconfirm = {};
Lines 306-309 if ($borrower) { Link Here
306
    );
309
    );
307
}
310
}
308
311
312
# Send a sanitized value for op to the template, to determine active tab
313
my $op_sanitized;
314
if ( $op eq 'returnbook' ) {
315
    $op_sanitized = 'return';
316
} elsif ( $op eq 'renew' ) {
317
    $op_sanitized = 'renew';
318
} else {
319
    $op_sanitized = 'checkout';
320
}
321
322
$template->param(
323
    SCOUserJS    => C4::Context->preference('SCOUserJS'),
324
    SCOUserCSS   => C4::Context->preference('SCOUserCSS'),
325
    op_sanitized => $op_sanitized,
326
);
327
309
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
328
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
310
- 

Return to bug 17449