Bug 22322 - Self-checkin module should provide for automatic logins (like self-checkout)
Summary: Self-checkin module should provide for automatic logins (like self-checkout)
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Emmi Takkinen
QA Contact: Testopia
URL:
Keywords:
: 30590 (view as bug list)
Depends on: 15492
Blocks:
  Show dependency treegraph
 
Reported: 2019-02-13 09:41 UTC by Oliver Behnke
Modified: 2024-04-29 09:44 UTC (History)
11 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Medium patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 22322: Self check-in without log in (20.45 KB, patch)
2021-07-30 11:25 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 22322: Self check-in without log in (18.92 KB, patch)
2022-08-16 09:48 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 22322: Self check-in without log in (18.99 KB, patch)
2022-09-02 15:46 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 22322: Fix QA issues (4.15 KB, patch)
2022-11-11 08:54 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 22322: Fix QA issues (4.14 KB, patch)
2023-05-05 15:25 UTC, Hinemoea Viault
Details | Diff | Splinter Review
Bug 22322: Fix QA issues (4.19 KB, patch)
2023-05-05 15:46 UTC, Hinemoea Viault
Details | Diff | Splinter Review
Bug 22322: Self check-in without log in (19.10 KB, patch)
2024-02-02 10:24 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 22322: Fix QA issues (4.14 KB, patch)
2024-02-02 10:24 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 22322: Self check-in without log in (19.18 KB, patch)
2024-04-29 08:56 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 22322: Fix QA issues (4.71 KB, patch)
2024-04-29 08:57 UTC, Emmi Takkinen
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Behnke 2019-02-13 09:41:06 UTC
The self-checkin (SCI) module currently requires to set up a dedicated kiosk terminal for its purpose. The reason being that you can't provide user/password system preferences for an automatic login, like you can for the self-checkout (SCO) counterpart.

Our use case is the following: we are already using the SCO module with automatic login of the dedicated SCO patron, and our actual patrons identify  themselves via their cardnumber. While they can obviously check in their books via the SCO module, we'd like to streamline the process such that they don't have to login with their cardnumber in order to simply return a book. The SCI module would be ideal for this but, effectively, it can't be used on the same terminal as switching between the modules currently requires a manual login of the dedicated SCI patron.
Comment 1 Oliver Behnke 2019-02-13 09:42:23 UTC
Related: going forward I think it would be useful to have a dedicated "Component" for the self checkin module as well (see the self checkout component).

Thanks
Comment 2 Emmi Takkinen 2021-07-30 11:25:02 UTC
Created attachment 123299 [details] [review]
Bug 22322: Self check-in without log in

One should be able to return loans via SCO without
login required. This patch adds check in box where
patrons can check in their loans with barcode.

To test:
1. Set "SelfCheckoutByLogin" as "cardnumber".
2. Find patron with loan or add one.
3. Go to /cgi-bin/koha/sco/sco-main.pl
4. Return loan by passing items barcode
=> confirm loans is returned succesfully

Sponsored-by: Koha-Suomi Oy
Comment 3 Lucas Gass 2022-04-06 20:12:57 UTC
Hi Emmi,

Sadly this no longer applies. Any chance we could get a rebase?
Comment 4 Emmi Takkinen 2022-08-16 09:48:22 UTC
Created attachment 139170 [details] [review]
Bug 22322: Self check-in without log in

One should be able to return loans via SCO without
login required. This patch adds check in box where
patrons can check in their loans with barcode.

To test:
1. Set "SelfCheckoutByLogin" as "cardnumber".
2. Find patron with loan or add one.
3. Go to /cgi-bin/koha/sco/sco-main.pl
4. Return loan by passing items barcode
=> confirm loans is returned succesfully

Sponsored-by: Koha-Suomi Oy
Comment 5 ByWater Sandboxes 2022-09-02 15:46:08 UTC
Created attachment 140162 [details] [review]
Bug 22322: Self check-in without log in

One should be able to return loans via SCO without
login required. This patch adds check in box where
patrons can check in their loans with barcode.

To test:
1. Set "SelfCheckoutByLogin" as "cardnumber".
2. Find patron with loan or add one.
3. Go to /cgi-bin/koha/sco/sco-main.pl
4. Return loan by passing items barcode
=> confirm loans is returned succesfully

Sponsored-by: Koha-Suomi Oy

Signed-off-by: Lucy Vaux-Harvey <lucy.vaux-harvey@ptfs-europe.com>
Comment 6 Katrin Fischer 2022-10-03 17:20:18 UTC
Hi Emmi, there are several problems highlighted by the QA tools, can you please fix?

For fixing the filters there is a handy script: misc/devel/add_missing_filters.pl. 

 FAIL	koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead-sco-self.inc
   FAIL	  filters
		missing_filter at line 7 (                <a class="brand" href="/cgi-bin/koha/sco/sco-main.pl"><img src="[% interface %]/[% theme %]/images/koha-logo-navbar.png" alt=""></a>)
		missing_filter at line 7 (                <a class="brand" href="/cgi-bin/koha/sco/sco-main.pl"><img src="[% interface %]/[% theme %]/images/koha-logo-navbar.png" alt=""></a>)
		missing_filter at line 31 (                   [% opacheader %])

 OK	koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/help.tt
 FAIL	koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt
   FAIL	  filters
		missing_filter at line 486 (                    <b>[% checkinmessage %]</b>)
		missing_filter at line 589 (                    if ( (Date.now() - confirmStart) < [% SelfCheckTimeout %] ) {)
		missing_filter at line 590 (                        window.open("/cgi-bin/koha/sco/printslip.pl?borrowernumber=[% borrowernumber %]&amp;print=qslip");)

 FAIL	opac/sco/sco-main.pl
   FAIL	  critic
		# Variables::ProhibitConditionalDeclarations: Got 1 violation(s).  
   FAIL	  forbidden patterns
		forbidden pattern: Script permissions is authnotrequired => 0, it could be correct for an OPAC script if it is was you really want error (bug 24663) (line 79)
		forbidden pattern: Use of DateTime->now should certainly be replaced with dt_from_string (bug 24840) (line 135)
Comment 7 Emmi Takkinen 2022-11-11 08:54:51 UTC
Created attachment 143764 [details] [review]
Bug 22322: Fix QA issues

This patch fixes following QA issues:
- Add missing filters
- Use dt_from_string instead of DateTime->now in sco-main.pl

Following issue is left unchanged, since it is purposeful:
forbidden pattern: Script permissions is authnotrequired => 0,
it could be correct for an OPAC script if it is was you really want error

Sponsored-by: Koha-Suomi Oy
Comment 8 Katrin Fischer 2023-05-03 22:24:05 UTC
*** Bug 30590 has been marked as a duplicate of this bug. ***
Comment 9 Hinemoea Viault 2023-05-05 15:25:32 UTC
Created attachment 150770 [details] [review]
Bug 22322: Fix QA issues

This patch fixes following QA issues:
- Add missing filters
- Use dt_from_string instead of DateTime->now in sco-main.pl

Following issue is left unchanged, since it is purposeful:
forbidden pattern: Script permissions is authnotrequired => 0,
it could be correct for an OPAC script if it is was you really want error

Sponsored-by: Koha-Suomi Oy
Comment 10 Hinemoea Viault 2023-05-05 15:46:11 UTC
Created attachment 150776 [details] [review]
Bug 22322: Fix QA issues

This patch fixes following QA issues:
- Add missing filters
- Use dt_from_string instead of DateTime->now in sco-main.pl

Following issue is left unchanged, since it is purposeful:
forbidden pattern: Script permissions is authnotrequired => 0,
it could be correct for an OPAC script if it is was you really want error

Sponsored-by: Koha-Suomi Oy
Signed-off-by: hinemoea <hinemoea@inlibro.com>
Comment 11 David Nind 2023-05-09 01:48:18 UTC
Hi Hinemoea.

Another one for you to change the status to Signed Off, so that you get the credit on the dashboard. 8-)

David
Comment 12 Stina Hallin 2023-09-08 11:30:38 UTC
I tried to sign off, but the checkin was not always returned successfully when I checked the patron details. Sometimes it worked as it should, but I didn't manage to see why it worked sometimes, and sometimes failed. I tried waiting until the sco-page logged out, and sometimes it worked on the first try but not the next. I tried using both the Submit button and return key. Once it worked when I changed home library for the patron.
Comment 13 Emmi Takkinen 2023-09-08 12:39:44 UTC
Setting this as ASSIGNED based on Stinas comment.
Comment 14 Emmi Takkinen 2024-02-02 10:13:42 UTC
(In reply to Stina Hallin from comment #12)
> I tried to sign off, but the checkin was not always returned successfully
> when I checked the patron details. Sometimes it worked as it should, but I
> didn't manage to see why it worked sometimes, and sometimes failed. I tried
> waiting until the sco-page logged out, and sometimes it worked on the first
> try but not the next. I tried using both the Submit button and return key.
> Once it worked when I changed home library for the patron.

I'm unable to repeat this. I was able to return several loans of several different patrons. Both items and patrons had different homebranch than library I was logged in on sco-page. Patch needs rebase, so I'll do that and set this back "Needs Signoff" to get more feedback.
Comment 15 Emmi Takkinen 2024-02-02 10:24:32 UTC
Created attachment 161722 [details] [review]
Bug 22322: Self check-in without log in

One should be able to return loans via SCO without
login required. This patch adds check in box where
patrons can check in their loans with barcode.

To test:
1. Set "SelfCheckoutByLogin" as "cardnumber".
2. Find patron with loan or add one.
3. Go to /cgi-bin/koha/sco/sco-main.pl
4. Return loan by passing items barcode
=> confirm loans is returned succesfully

Sponsored-by: Koha-Suomi Oy

Signed-off-by: Lucy Vaux-Harvey <lucy.vaux-harvey@ptfs-europe.com>
Comment 16 Emmi Takkinen 2024-02-02 10:24:58 UTC
Created attachment 161723 [details] [review]
Bug 22322: Fix QA issues

This patch fixes following QA issues:
- Add missing filters
- Use dt_from_string instead of DateTime->now in sco-main.pl

Following issue is left unchanged, since it is purposeful:
forbidden pattern: Script permissions is authnotrequired => 0,
it could be correct for an OPAC script if it is was you really want error

Sponsored-by: Koha-Suomi Oy
Signed-off-by: hinemoea <hinemoea@inlibro.com>
Comment 17 David Nind 2024-04-29 08:34:03 UTC
The patches no longer apply 8-(...

git bz apply 22322

Bug 22322 - Self-checkin module should provide for automatic logins (like self-checkout)

161722 - Bug 22322: Self check-in without log in
161723 - Bug 22322: Fix QA issues

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 22322: Self check-in without log in
Using index info to reconstruct a base tree...
M	koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt
M	opac/sco/sco-main.pl
Falling back to patching base and 3-way merge...
Auto-merging opac/sco/sco-main.pl
CONFLICT (content): Merge conflict in opac/sco/sco-main.pl
Auto-merging koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt
error: Failed to merge in the changes.
Patch failed at 0001 Bug 22322: Self check-in without log in
Comment 18 Emmi Takkinen 2024-04-29 08:56:31 UTC
Created attachment 165722 [details] [review]
Bug 22322: Self check-in without log in

One should be able to return loans via SCO without
login required. This patch adds check in box where
patrons can check in their loans with barcode.

To test:
1. Set "SelfCheckoutByLogin" as "cardnumber".
2. Find patron with loan or add one.
3. Go to /cgi-bin/koha/sco/sco-main.pl
4. Return loan by passing items barcode
=> confirm loans is returned succesfully

Sponsored-by: Koha-Suomi Oy

Signed-off-by: Lucy Vaux-Harvey <lucy.vaux-harvey@ptfs-europe.com>
Comment 19 Emmi Takkinen 2024-04-29 08:57:00 UTC
Created attachment 165723 [details] [review]
Bug 22322: Fix QA issues

This patch fixes following QA issues:
- Add missing filters
- Use dt_from_string instead of DateTime->now in sco-main.pl

Following issue is left unchanged, since it is purposeful:
forbidden pattern: Script permissions is authnotrequired => 0,
it could be correct for an OPAC script if it is was you really want error

Sponsored-by: Koha-Suomi Oy
Signed-off-by: hinemoea <hinemoea@inlibro.com>
Comment 20 Emmi Takkinen 2024-04-29 08:57:30 UTC
Rebased patches.
Comment 21 David Nind 2024-04-29 09:44:18 UTC
I get an error page if I enter a barcode and press 'Submit':

   Sorry, the requested page is not available
   Error 403

In additional, if I log in to the self checkout system and go to check in the item that way, I get this error:

Can't call method "homebranch" on an undefined value at /kohadevbox/koha/opac/sco/sco-main.pl line 180

    in (eval) at /kohadevbox/koha/opac/sco/sco-main.pl line 180

      177:     if( !$checkinitem ){
      178:         $checkinmessage = "Item not found.";
      179:     }
      180:     my $tobranch = $checkinitem->homebranch;
      181: 
      182:     my ($return_success,$messages,$issueinformation,$borrower) = AddReturn($uibarcode,$branch,undef,$today) unless !$success;
.....

One other comment:
- The title "Self checkout system" doesn't make sense, so maybe it should be changed to "Self service" or "Self service system".