From ece3a31fcadb4a7678019df2365596620a30c27b Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Wed, 3 Jun 2009 09:31:46 -0500 Subject: [PATCH] Cleanup SCO - OPAC self checkout ~ vestigial broken scripts and templates removed ~ meaningless dependencies removed ~ Focus handling issues resolved for cross-browsers ~ Timeout only invoked for non-first screen. This keeps the refresh from flooding the logs continuously for no purpose. ~ two halves of "validuser" conditional linked in TMPL ~ elsif's used for $op conditionals The focus should now appear on the "Return to Account Summary" button during errors. The user can scan anything (w/ carriage return) and get back to the first screen. Also, special functionality is added for the magic barcode "__KOHA_NEW_CIRC__". This effectively ends the patron session and logs them out so the next patron can begin. The purpose is for patrons to avoid having to use a keyboard at all, if libraries print and have this special barcode available for patrons at the SCO station. Enhancement was requested by Plano Independent School District. Signed-off-by: Galen Charlton --- .../prog/en/modules/sco/circulation.tmpl | 172 ------ .../opac-tmpl/prog/en/modules/sco/help.tmpl | 16 +- .../prog/en/modules/sco/sco-circ.tmpl | 109 ---- .../prog/en/modules/sco/sco-main.tmpl | 92 ++- opac/sco/abort.pl | 38 -- opac/sco/help.pl | 36 +- opac/sco/printer.pl | 556 ------------------ opac/sco/sco-circ.pl | 211 ------- opac/sco/sco-main.pl | 143 ++--- 9 files changed, 146 insertions(+), 1227 deletions(-) delete mode 100644 koha-tmpl/opac-tmpl/prog/en/modules/sco/circulation.tmpl delete mode 100644 koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-circ.tmpl delete mode 100755 opac/sco/abort.pl delete mode 100755 opac/sco/printer.pl delete mode 100755 opac/sco/sco-circ.pl diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/sco/circulation.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/sco/circulation.tmpl deleted file mode 100644 index ffdf677436..0000000000 --- a/koha-tmpl/opac-tmpl/prog/en/modules/sco/circulation.tmpl +++ /dev/null @@ -1,172 +0,0 @@ - - - -Koha Self Checkout - -/css/sco.css" /> - - - - -

Self Checkout System

- -
-
- -

Sorry, checkout cannot proceed

-There is a problem with your account. Please ask for help at the circulation desk. -
-
-
- - - - - -
-

Issuing Question

-

Attempting to issue - by to .

-

-
- " /> - " /> - " /> - " /> - " /> - " /> - " /> - " /> - "> - - " value="" /> - - - -
- -
- " /> - " /> - " /> - " /> - " /> - " /> - " /> - " /> - " /> - - " value="" /> - - - -
-
- - - -
-

Error Issuing Book

- -
- - - -
-

No borrower matched

-
- - - - -
-
-
-
-

Checking out to ()

- " />" />" />" /> - -
- - - - -
- - - - - - - - - - - - --> - - - - - -
Today's Issues
TitleAuthorCall No.Due Date
/images/.gif" align="left" title="" alt="" />
- - - - - - - - - - - - --> - - - - -
Previous Issues
TitleAuthorCall No.Due Date
/images/.gif" align="left" title="" alt="" />  
-
- - - diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/sco/help.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/sco/help.tmpl index ba4f6651a4..01abb421de 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/sco/help.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/sco/help.tmpl @@ -3,14 +3,12 @@ " /> /includes/favicon.ico" type="image/x-icon" /> - /css/sco.css" />
-
-
- +
+

Self Checkout Help

@@ -18,7 +16,7 @@ is not behaving as expected, you may want to refer to this guide to get yourself started.

-

Step One: Enter your user id

+

Step One: Enter your user id

Enter your User ID, and click the submit button (or press the enter key).

Step Two: Scan the barcode for each item, one at a time

@@ -26,11 +24,11 @@ yourself started.

The checked-out item should appear in your issues list. The Submit button only needs to be clicked if you enter the barcode manually.

-

Step Three: Click the 'Click here if done' link when done.

+

Step Three: Click the 'Click here if done' link when done

- +
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-circ.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-circ.tmpl deleted file mode 100644 index 6c2a2b61f3..0000000000 --- a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-circ.tmpl +++ /dev/null @@ -1,109 +0,0 @@ - - - -Koha Self Checkout - -/css/sco.css" /> - - - - - -

Self Checkout System

- -
-
- -

Sorry, checkout cannot proceed

-There is a problem with your account. Please ask for help at the circulation desk. -
-
-
- - - -
-

Warning:

-

Attempting to issue
- to .

-

-
- " /> - " /> - - -
-
- - - -
-

Error Issuing Book

- -
- - - -
-

No borrower matched

-
- - - -
-
-
-
-
-

Checking out to ()

- - - -" /> -
- - - -
- -
- - - - - - - - - - - -
Issues ( total)
TitleCall No.DueRenewFines
/images/.gif" alt="" title="" /> ">.01.THUMBZZZ.jpg" alt="Book Cover Image" class="thumbnail" /> "> - - -&bornum=">Renew - -Not renewable -YesNo
-
-
- -
- - - diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl index 2efaedb1fe..39a64a9154 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl @@ -3,24 +3,51 @@ " /> /includes/favicon.ico" type="image/x-icon" /> - /css/sco.css" /> - +
-

Self Checkout System

- -
-
+

Self Checkout System

+
+

Item cannot be checked out.

Sorry, This item cannot be checked out at this station.

@@ -33,7 +60,7 @@ " /> - +
@@ -44,7 +71,7 @@ " /> " /> - + @@ -67,8 +94,9 @@ Sorry, This Self-Checkout Station has lost authentication. Please contact the a
-

Self Checkout

+

Self Checkout

+
HELP with the self checkout system
@@ -79,31 +107,21 @@ Sorry, This Self-Checkout Station has lost authentication. Please contact the a
-

Sorry

The userid was not found in the database. Please try again.

+

Sorry

The userid was not found in the database. Please try again.


+

Sorry

Your session has timed out due to inactivity. Please sign in.


- -
-
-
- - - " value=""> - -
-
-
-
.')){ this.op.value='logout'; this.patronid.value=''; } return true;}; " > +
Check out or return an item: - + " /> @@ -120,9 +138,10 @@ Sorry, This Self-Checkout Station has lost authentication. Please contact the a + ">.01.THUMBZZZ.jpg" alt="Book Cover Image" class="thumbnail" /> "> () -   + @@ -130,11 +149,11 @@ Sorry, This Self-Checkout Station has lost authentication. Please contact the a " /> " /> - + - + name="confirm" class="renew" onclick="this.form.confirmed.value='1';this.form.submit();" /> - + YesNo @@ -145,11 +164,20 @@ Sorry, This Self-Checkout Station has lost authentication. Please contact the a

You currently have nothing checked out.

+ +
+
+
+ + + " value=""> + +
+
-
diff --git a/opac/sco/abort.pl b/opac/sco/abort.pl deleted file mode 100755 index 12a2487ba7..0000000000 --- a/opac/sco/abort.pl +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/perl -# Please use 8-character tabs for this file (indents are every 4 characters) - -# Copyright 2000-2002 Katipo Communications -# -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA - -use strict; -use CGI; -use C4::Output; -use C4::Auth; -use HTML::Template::Pro; - - -my $query = new CGI; -my ($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => 'sco/abort.tmpl', - query => $query, - type => "opac", - authnotrequired => 0, - flagsrequired => {circulate => "circulate_remaining_permissions"}, - - }); - -output_html_with_http_headers $query, $cookie, $template->output; diff --git a/opac/sco/help.pl b/opac/sco/help.pl index bde37d9e16..b2cbd003d4 100755 --- a/opac/sco/help.pl +++ b/opac/sco/help.pl @@ -1,28 +1,26 @@ #!/usr/bin/perl -# This code has been modified by Trendsetters (originally from circulation.pl) +# +# This code (originally from circulation.pl) has been modified by: +# Trendsetters, +# dan, and +# Christina Lee. + use strict; +use warnings; use CGI; -use C4::Auth; -use C4::Output; -use HTML::Template::Pro; +use C4::Auth qw(get_template_and_user); +use C4::Output qw(output_html_with_http_headers); -# begin code modifed by dan my $query = new CGI; -my ($template, $borrowernumber, $cookie) -#Begin code modified by Christina Lee -# function comes from C4::Auth - = get_template_and_user({template_name => "sco/help.tmpl", -#End code modified by Christina Lee - query => $query, - type => "opac", - authnotrequired => 1, - flagsrequired => {circulate => "circulate_remaining_permissions"}, - debug => 1, - }); -# end code modified by dan - +my ($template, $borrowernumber, $cookie) = get_template_and_user({ + template_name => "sco/help.tmpl", + query => $query, + type => "opac", + debug => 1, + authnotrequired => 1, + flagsrequired => {circulate => "circulate_remaining_permissions"}, +}); -# function comes from C4::Interface::CGI::Output output_html_with_http_headers $query, $cookie, $template->output; diff --git a/opac/sco/printer.pl b/opac/sco/printer.pl deleted file mode 100755 index c75220ccc7..0000000000 --- a/opac/sco/printer.pl +++ /dev/null @@ -1,556 +0,0 @@ -#!/usr/bin/perl -#this code has been modified (slightly) by Trendsetters (originally from circulation.pl) -# Please use 8-character tabs for this file (indents are every 4 characters) - -#written 8/5/2002 by Finlay -#script to execute issuing of books - - -# Copyright 2000-2002 Katipo Communications -# -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA - -use strict; -use CGI; -use C4::Circulation; -use C4::Search; -use C4::Output; -use C4::Print; -use DBI; -use C4::Authsco; -use C4::Output; -use C4::Koha; -use HTML::Template::Pro; -use C4::Dates; - -my $query=new CGI; -#my ($loggedinuser, $sessioncookie, $sessionID) = checkauth -# ($query, 0, { circulate => 1 }); - -my ($template, $loggedinuser, $cookie) = get_template_and_user - ({ -#Begin code modified by Christina Lee - template_name => 'sco/receipt.tmpl', - query => $query, - type => "opac", - authnotrequired => 0, - flagsrequired => { circulate => "circulate_remaining_permissions" }, -# End Code Modified by Christina Lee - }); - -#Begin code by Christina Lee--Sets variable $borr equal to loggedinuser's data -my ($borr, $flags) = getpatroninformation(undef, $loggedinuser); -# End code by Christina Lee - -my %env; -my $linecolor1='#339999'; -my $linecolor2='white'; - -my $branches = getbranches(); -my $printers = getprinters(\%env); - -my $branch = "APL"; #getbranch($query, $branches); -my $printer = getprinter($query, $printers); - - -#set up cookie..... -my $branchcookie; -my $printercookie; -if ($query->param('setcookies')) { - $branchcookie = $query->cookie(-name=>'branch', -value=>"$branch", -expires=>'+1y'); - $printercookie = $query->cookie(-name=>'printer', -value=>"$printer", -expires=>'+1y'); -} - -$env{'branchcode'}=$branch; -$env{'printer'}=$printer; -$env{'queue'}=$printer; - -my @datearr = localtime(time()); -# FIXME - Could just use POSIX::strftime("%Y%m%d", localtime); -my $todaysdate = (1900+$datearr[5]).sprintf ("%0.2d", ($datearr[4]+1)).sprintf ("%0.2d", ($datearr[3])); -#warn $todaysdate; - -################# Start code modified by Christina Lee########################### -# get borrower information .... -#my ($borr, $flags) = getpatroninformation(undef, $loggedinusername); -#my @bordat; -#$bordat[0] = $borr; - -#$template->param(BORROWER_INFO => \@bordat); - -######################End code modified by christina Lee############################ - -my $message; -my $borrowerslist; -# if there is a list of find borrowers.... -my $findborrower = $query->param('findborrower'); -if ($findborrower) { - my ($count,$borrowers)=BornameSearch(\%env,$findborrower,'web'); - my @borrowers=@$borrowers; - if ($#borrowers == -1) { - $query->param('findborrower', ''); - $message = "'$findborrower'"; - } elsif ($#borrowers == 0) { - $query->param('borrnumber', $borrowers[0]->{'borrowernumber'}); - $query->param('barcode',''); - } else { - $borrowerslist = \@borrowers; - } -} - - -my $borrowernumber = $query->param('borrnumber'); -my $bornum = $query->param('borrnumber'); -# check and see if we should print -my $print=$query->param('print'); -my $barcode = $query->param('barcode'); -if ($barcode eq '' && $print eq 'maybe'){ - $print = 'yes'; -} -if ($print eq 'yes' && $borrowernumber ne ''){ - printslip(\%env,$borrowernumber); - $query->param('borrnumber',''); - $borrowernumber=''; -} - -# get the borrower information..... -my $borrower; -my $flags; -if ($borrowernumber) { - ($borrower, $flags) = getpatroninformation(\%env,$borrowernumber,0); -} - -# get the responses to any questions..... -my %responses; -foreach (sort $query->param) { - if ($_ =~ /response-(\d*)/) { - $responses{$1} = $query->param($_); - } -} -if (my $qnumber = $query->param('questionnumber')) { - $responses{$qnumber} = $query->param('answer'); -} - - -my ($iteminformation, $duedate, $rejected, $question, $questionnumber, $defaultanswer); -#Begin code edited by Christina Lee -#my $barc = 123456789; -my $barc = cuecatbarcodedecode($barcode); - -(my $year, my $month, my $day) = set_duedate($barc); -#End code edited by Christina Lee - -# if the barcode is set -if ($barcode) { - $barcode = cuecatbarcodedecode($barcode); - -#note: edit code here --Christina Lee - my ($datedue, $invalidduedate) = fixdate($year, $month, $day); - unless ($invalidduedate) { - $env{'datedue'}=$datedue; - my @time=localtime(); - my $date= (1900+$time[5])."-".($time[4]+1)."-".$time[3]; - ($iteminformation, $duedate, $rejected, $question, $questionnumber, $defaultanswer, $message) - = issuebook(\%env, $borr, $barcode, \%responses, $date); - } -} - -# reload the borrower info for the sake of reseting the flags..... -if ($borrowernumber) { - ($borrower, $flags) = getpatroninformation(\%env,$borrowernumber,0); -} - -################################################################################## -# HTML code.... - -my %responseform; -my @responsearray; -foreach (keys %responses) { -# $responsesform.="\n"; - $responseform{'name'}=$_; - $responseform{'value'}=$responses{$_}; - push @responsearray,\%responseform; -} -my $questionform; -my $stickyduedate; -if ($question) { - $stickyduedate=$query->param('stickyduedate'); -} - - -# Barcode entry box, with hidden inputs attached.... - -# FIXME - How can we move this HTML into the template? Can we create -# arrays of the months, dates, etc and use in the template to -# output the data that's getting built here? -my $counter = 1; -my $dayoptions = ''; -my $monthoptions = ''; -my $yearoptions = ''; -for (my $i=1; $i<32; $i++) { - my $selected=''; - if (($query->param('stickyduedate')) && ($day==$i)) { - $selected='selected'; - } - $dayoptions.="