@@ -, +, @@ guess record for domain of koha@dev.bywatersolutions.com designates 174.143.239.187 as permitted sender) smtp.mail=koha@dev.bywatersolutions.com SelfCheckTimeOut: the number of seconds before the self-checkout login times out for a patron AllowSelfCheckReturns: indicate whether or not patrons can return materials via self-checkout SelfCheckHelpMessage: user-configurable HTML to show specific text on the Help page. --- C4/Circulation.pm | 29 +++++++++----- circ/circulation.pl | 6 +- installer/data/mysql/de-DE/mandatory/sysprefs.sql | 3 + installer/data/mysql/en/mandatory/sysprefs.sql | 3 + .../1-Obligatoire/unimarc_standard_systemprefs.sql | 3 + installer/data/mysql/it-IT/necessari/sysprefs.sql | 3 + installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 3 + ...m_preferences_full_optimal_for_install_only.sql | 3 + ...m_preferences_full_optimal_for_install_only.sql | 3 + installer/data/mysql/updatedatabase.pl | 9 ++++ .../en/modules/admin/preferences/circulation.pref | 22 +++++++++++ koha-tmpl/opac-tmpl/prog/en/modules/sco/help.tmpl | 13 +++++- .../opac-tmpl/prog/en/modules/sco/sco-main.tmpl | 25 ++++++++++-- opac/sco/help.pl | 14 +++++++ opac/sco/sco-main.pl | 40 +++++++++++++++++--- 15 files changed, 153 insertions(+), 26 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -14,9 +14,9 @@ package C4::Circulation; # 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., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# 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; @@ -2691,6 +2691,7 @@ C<$startdate> = C4::Dates object representing start date of loan period (assum C<$itemtype> = itemtype code of item in question C<$branch> = location whose calendar to use C<$borrower> = Borrower object + =cut sub CalcDateDue { @@ -2698,14 +2699,21 @@ sub CalcDateDue { my $datedue; my $loanlength = GetLoanLength($borrower->{'categorycode'},$itemtype, $branch); - if(C4::Context->preference('useDaysMode') eq 'Days') { # ignoring calendar - my $timedue = time + ($loanlength) * 86400; - #FIXME - assumes now even though we take a startdate - my @datearr = localtime($timedue); - $datedue = C4::Dates->new( sprintf("%04d-%02d-%02d", 1900 + $datearr[5], $datearr[4] + 1, $datearr[3]), 'iso'); + # if globalDueDate ON the datedue is set to that date + if ( C4::Context->preference('globalDueDate') + && ( C4::Context->preference('globalDueDate') =~ C4::Dates->regexp('syspref') ) ) { + $datedue = C4::Dates->new( C4::Context->preference('globalDueDate') ); } else { - my $calendar = C4::Calendar->new( branchcode => $branch ); - $datedue = $calendar->addDate($startdate, $loanlength); + # otherwise, calculate the datedue as normal + if(C4::Context->preference('useDaysMode') eq 'Days') { # ignoring calendar + my $timedue = time + ($loanlength) * 86400; + #FIXME - assumes now even though we take a startdate + my @datearr = localtime($timedue); + $datedue = C4::Dates->new( sprintf("%04d-%02d-%02d", 1900 + $datearr[5], $datearr[4] + 1, $datearr[3]), 'iso'); + } else { + my $calendar = C4::Calendar->new( branchcode => $branch ); + $datedue = $calendar->addDate($startdate, $loanlength); + } } # if Hard Due Dates are used, retreive them and apply as necessary @@ -2729,7 +2737,6 @@ sub CalcDateDue { $datedue = C4::Dates->new( $borrower->{dateexpiry}, 'iso' ); } - return $datedue; } --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -16,9 +16,9 @@ # 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., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# 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 warnings; FIXME - Bug 2505 --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql +++ a/installer/data/mysql/de-DE/mandatory/sysprefs.sql @@ -137,6 +137,9 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES -- need AddressType to distinguish between US and other, telephone numbers, maori stuff, sex, nationality, etc. -- LDAP ? required fields? INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WebBasedSelfCheck',0,'If ON, enables the web-based self-check system',NULL,'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckTimeout',120,'Define the number of seconds before the Web-based Self Checkout times out a patron','','Integer'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AllowSelfCheckReturns',0,'If enabled, patrons may return items through the Web-based Self Checkout','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckHelpMessage','','Enter HTML to include under the basic Web-based Self Checkout instructions on the Help page','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACnumSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ a/installer/data/mysql/en/mandatory/sysprefs.sql @@ -138,6 +138,9 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES -- need AddressType to distinguish between US and other, telephone numbers, maori stuff, sex, nationality, etc. -- LDAP ? required fields? INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WebBasedSelfCheck',0,'If ON, enables the web-based self-check system',NULL,'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckTimeout',120,'Define the number of seconds before the Web-based Self Checkout times out a patron','','Integer'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AllowSelfCheckReturns',0,'If enabled, patrons may return items through the Web-based Self Checkout','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckHelpMessage','','Enter HTML to include under the basic Web-based Self Checkout instructions on the Help page','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACnumSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -139,6 +139,9 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ThingISBN',0,'Utilisé avec ''FRBRizeEditions''. Si activé, Koha utilisera le service ''ThingISBN'' dans l''onglet supplémentaire de la page de détail de notice.','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WebBasedSelfCheck',0,'Si activé, permet le système de prêt auto-controlé à partir de l''opac (/cgi-bin/koha/sco/sco-main.pl',NULL,'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckTimeout',120,'Define the number of seconds before the Web-based Self Checkout times out a patron','','Integer'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AllowSelfCheckReturns',0,'If enabled, patrons may return items through the Web-based Self Checkout','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckHelpMessage','','Enter HTML to include under the basic Web-based Self Checkout instructions on the Help page','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchResults',20,'Spécifie le nombre maximum de réponses à afficher sur les pages de résultats',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACnumSearchResults',20,'Spécifie le nombre maximum de réponses à afficher sur les pages de résultats',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortField',NULL,'Spécifie le champ utilisé par défaut pour le tri','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql +++ a/installer/data/mysql/it-IT/necessari/sysprefs.sql @@ -210,6 +210,9 @@ insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, --- --- Add from eng --- +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckTimeout',120,'Define the number of seconds before the Web-based Self Checkout times out a patron','','Integer'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AllowSelfCheckReturns',0,'If enabled, patrons may return items through the Web-based Self Checkout','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckHelpMessage','','Enter HTML to include under the basic Web-based Self Checkout instructions on the Help page','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('AcqCreateItem','cataloguing','ordering|receiving|cataloguing','Define when the item is created : when ordering, when receiving, or in cataloguing module','Choice'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowAllMessageDeletion','0','Allow any Library to delete any message','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowHoldDateInFuture','0','If set a date field is displayed on the Hold screen of the Staff Interface, allowing the hold date to be set in the future.','','YesNo'); --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql +++ a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql @@ -136,6 +136,9 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES -- need AddressType to distinguish between US and other, telephone numbers, maori stuff, sex, nationality, etc. -- LDAP ? required fields? INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WebBasedSelfCheck',0,'If ON, enables the web-based self-check system',NULL,'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckTimeout',120,'Define the number of seconds before the Web-based Self Checkout times out a patron','','Integer'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AllowSelfCheckReturns',0,'If enabled, patrons may return items through the Web-based Self Checkout','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckHelpMessage','','Enter HTML to include under the basic Web-based Self Checkout instructions on the Help page','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACnumSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); --- a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql +++ a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -165,6 +165,9 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES -- need AddressType to distinguish between US and other, telephone numbers, maori stuff, sex, nationality, etc. -- LDAP ? required fields? INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WebBasedSelfCheck',0,'If ON, enables the web-based self-check system',NULL,'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckTimeout',120,'Define the number of seconds before the Web-based Self Checkout times out a patron','','Integer'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AllowSelfCheckReturns',0,'If enabled, patrons may return items through the Web-based Self Checkout','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckHelpMessage','','Enter HTML to include under the basic Web-based Self Checkout instructions on the Help page','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACnumSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); --- a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql +++ a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -164,6 +164,9 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES -- need AddressType to distinguish between US and other, telephone numbers, maori stuff, sex, nationality, etc. -- LDAP ? required fields? INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WebBasedSelfCheck',0,'If ON, enables the web-based self-check system',NULL,'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckTimeout',120,'Define the number of seconds before the Web-based Self Checkout times out a patron','','Integer'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AllowSelfCheckReturns',0,'If enabled, patrons may return items through the Web-based Self Checkout','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckHelpMessage','','Enter HTML to include under the basic Web-based Self Checkout instructions on the Help page','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACnumSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -4166,6 +4166,15 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.03.00.XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('SelfCheckTimeout',120,'Define the number of seconds before the Web-based Self Checkout times out a patron','','Integer')"); + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowSelfCheckReturns',0,'If enabled, patrons may return items through the Web-based Self Checkout','','YesNo')"); + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('SelfCheckHelpMessage','','Enter HTML to include under the basic Web-based Self Checkout instructions on the Help page','70|10','Textarea')"); + print "Upgrade to $DBversion done ( Add Self-checkout by Login system preferences )\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -321,6 +321,28 @@ Circulation: no: "Don't enable" - "the web-based self checkout system. (available at: /cgi-bin/koha/sco/sco-main.pl)" - + - Have patrons login into the web-based self checkout system with their + - pref: SelfCheckoutByLogin + choices: + yes: Username and Password + no: Barcode + - + - "Time out the current patron's web-based self checkout system login after" + - pref: SelfCheckTimeout + class: integer + - seconds. + - + - pref: AllowSelfCheckReturns + choices: + yes: Allow + no: "Don't allow" + - patrons to return items through web-based self checkout system. + - + - "Include the following HTML in the Help page of the web-based self checkout system:" + - pref: SelfCheckHelpMessage + type: textarea + class: code + - - pref: AutoSelfCheckAllowed choices: yes: Allow --- a/koha-tmpl/opac-tmpl/prog/en/modules/sco/help.tmpl +++ a/koha-tmpl/opac-tmpl/prog/en/modules/sco/help.tmpl @@ -12,12 +12,19 @@

Self Checkout Help

+ +
+ +
+ +

If this is your first time using the self checkout system, or if the system is not behaving as expected, you may want to refer to this guide to get yourself started.

-

Step One: Enter your user id

-

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

+

Step One: Enter your user id and password

+

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

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

Scan each item and wait for the page to reload before scanning the next item. @@ -25,6 +32,8 @@ The checked-out item should appear in your checkouts list. The Submit button only needs to be clicked if you enter the barcode manually.

Step Three: Click the 'Finish' button

+

If you do not click the 'Finish' button, your session will automatically expire in + seconds.

Return to the Self-Checkout --- a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl +++ a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl @@ -7,7 +7,7 @@