Closed GoogleCodeExporter closed 9 years ago
Strange. I remember testing it on our touchscreens and it worked. Try changing
parent.focus() to:
parent.top.$('#barcode).focus();
Let me know the result.
Original comment by ericmelton1@gmail.com
on 22 Apr 2011 at 1:34
Eric,
Thank you for your reply. Unfortunately, replacing the
"parent.focus();" text with "parent.top.$('#barcode).focus();" in
print.js appears to break the application. After making the change,
scanning item/patron barcodes never produces any result.
Is there another option to return focus to the checkout screen? Or is
it necessary for us to create buttons that display after every
checkout for patrons to return focus to the checkout screen? One
button to "Checkout Another Item" and another to "End Checkout
Session" could work.
Thank you for your continued help.
Original comment by amendic...@gmail.com
on 29 Apr 2011 at 12:42
If I remember right, one of the files I sent you a while back was
processes/checkout.php and one of the changes was a line that contained
something like
$('print_item_list_div').print(); or something like that. Try adding this after
that line
setTimeout(function(){ $('#barcode').focus(); }, 200);
Let me know how it works out.
Original comment by ericmelton1@gmail.com
on 29 Apr 2011 at 1:06
Eric,
I think that I put the text in the appropriate place in the
checkout.php file, but an error displays when I try to checkout an
item. The error reads, "Parse error: syntax error, unexpected
T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in
C:\wamp\www\selfcheck\processes\checkout.php on line 165."
The relevant section of the checkout.php reads:
$(document).ready(function(){
$("#loading").hide();
$("#cancel").hide();
$("#user_cko_buttons").show();
$("#checkout_count").html("'.$_SESSION['checkouts'].'");
$("#print_item_list_table .checked_out_item").html(item);
$("#item_list_div").attr({ scrollTop:
$("#item_list_div").attr("scrollHeight") });
$("#print_item_list_div").print();
setTimeout(function(){ $('#barcode').focus(); }, 200);
';
When I put the text "setTimeout(function(){ $('#barcode').focus(); },
200);" after the closing " '; " as follows:
$(document).ready(function(){
$("#loading").hide();
$("#cancel").hide();
$("#user_cko_buttons").show();
$("#checkout_count").html("'.$_SESSION['checkouts'].'");
$("#print_item_list_table .checked_out_item").html(item);
$("#item_list_div").attr({ scrollTop:
$("#item_list_div").attr("scrollHeight") });
$("#print_item_list_div").print();
';
setTimeout(function(){ $('#barcode').focus(); }, 200);
I see another error, "Parse error: syntax error, unexpected '(',
expecting T_VARIABLE or '$' in
C:\wamp\www\selfcheck\processes\checkout.php on line 160."
Am I pasting the string in the wrong place? Thank you for your
continued help; have a good day.
Eric at Town & Country PL
Original comment by amendic...@gmail.com
on 29 Apr 2011 at 11:18
My bad. The single quotes (') are messing it up.
try...
setTimeout(function(){ $("#barcode").focus(); }, 200);
The whole bit you included in your messages should look as follows...
$(document).ready(function(){
$("#loading").hide();
$("#cancel").hide();
$("#user_cko_buttons").show();
$("#checkout_count").html("'.$_SESSION['checkouts'].'");
$("#print_item_list_table .checked_out_item").html(item);
$("#item_list_div").attr({ scrollTop:
$("#item_list_div").attr("scrollHeight") });
$("#print_item_list_div").print();
setTimeout(function(){ $("#barcode").focus(); }, 200);
';
Original comment by ericmelton1@gmail.com
on 30 Apr 2011 at 12:26
Eric,
Adding that line to the ...processes/checkout.php file doesn't break
anything, but it doesn't return focus to the checkout screen either.
The first checkout always works and auto-prints a receipt. However, if
I scan another item nothing happens - until I touch the touch screen
monitor to return focus to the checkout window. After that, I can
checkout an item and a receipt prints. If I touch the monitor screen
again, I can checkout another item.
Are there other commands that I should try?
If not, would the other option I mentioned work? Since touching the
touch screen monitor would return focus to the checkout screen, would
adding a button that does nothing be a passable workaround? It could
be displayed to the left of the "Finish/Logout" button at the bottom
of the screen. Patrons would touch it after each item was checked out
- just to return focus to the checkout window.
Of course, the button approach is not as elegant as using a "focus"
command. It seems like a feasible backup plan though. How would I add
a "Checkout Another Item" button to the left of the "Finish/Logout"
button on the checkout screen. Since the new button would not actually
do anything in your self-checkout software, I'm assuming it would be
pretty easy to manage.
Thank you for your continued help; have a good day.
Eric at Town & Country PL
Original comment by amendic...@gmail.com
on 30 Apr 2011 at 10:45
Try one more thing...
in js/print.js after objFrame.print();
put...
setTimeout(function(){ objFrame.remove(); }, 200);
setTimeout(function(){ $("#barcode").focus(); }, 300);
Original comment by ericmelton1@gmail.com
on 30 Apr 2011 at 11:17
Eric,
Unfortunately, that did not change anything. Just to make sure that
I've made the correct changes, I'll list them below.
The relevant section of ...js/print.js is:
// Print the document.
objFrame.focus();
objFrame.print();
setTimeout(function(){ objFrame.remove(); }, 200);
setTimeout(function(){ $("#barcode").focus(); }, 300);
parent.focus();
// parent.top.$('#barcode).focus();
If I comment out the "parent.focus();" and enable
"parent.top.$('#barcode).focus();" the self-check software stops
responding to barcode scans.
The relevant section of .../processes/checkout.php is:
$(document).ready(function(){
$("#loading").hide();
$("#cancel").hide();
$("#user_cko_buttons").show();
$("#checkout_count").html("'.$_SESSION['checkouts'].'");
$("#print_item_list_table .checked_out_item").html(item);
$("#item_list_div").attr({ scrollTop:
$("#item_list_div").attr("scrollHeight") });
$("#print_item_list_div").print();
setTimeout(function(){ $("#barcode").focus(); }, 200);
';
Have I made the wrong changes somewhere?
Thank you for your continued help.
Eric at Town & Country PL
Original comment by amendic...@gmail.com
on 30 Apr 2011 at 11:40
Remove..
setTimeout(function(){ $("#barcode").focus(); }, 200);
from processes/checkout.php
remove...
parent.focus();
//parent.top.$('#barcode).focus();
from js/print.js
let me know..
Original comment by ericmelton1@gmail.com
on 30 Apr 2011 at 11:44
Eric,
I made the changes you suggested, saved them, reloaded the page and
tried two different test checkouts. Unfortunately, the focus problem
persists.
Do you have any other suggestions?
Thank you for your continued help.
Eric at Town & Country PL
Original comment by amendic...@gmail.com
on 30 Apr 2011 at 11:51
I'm working on a possible solution.
Original comment by ericmelton1@gmail.com
on 2 May 2011 at 2:08
Everything ok now?
Original comment by ericmelton1@gmail.com
on 3 May 2011 at 12:34
Eric,
Everything with the selfcheck is working great - thanks to your
special attention. Our library is grateful for your work. I don't know
why anyone would pay for a commercial unit when yours works just as
well. I just wish your site had a "donations" link, so that we could
help you continue to help other libraries.
Thank you for all of your help. I can't promise that I won't have more
questions, but you've made the staff at Town & Country PL very happy.
Eric at Town & Country PL
Original comment by amendic...@gmail.com
on 3 May 2011 at 12:23
Great! Glad it's working.
Original comment by ericmelton1@gmail.com
on 3 May 2011 at 1:40
Original issue reported on code.google.com by
amendic...@gmail.com
on 22 Apr 2011 at 1:03