Bug 1092 - might be nice to have cookie keep track of patron.
Summary: might be nice to have cookie keep track of patron.
Status: RESOLVED MOVED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: PC All
: P2 enhancement (vote)
Assignee: Chris Cormack
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-31 07:04 UTC by Michael Hafen
Modified: 2019-05-04 15:34 UTC (History)
1 user (show)

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


Attachments
proposed patches. (8.72 KB, patch)
2006-05-31 07:05 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-20 23:38:46 UTC


---- Reported by mdhafen@tech.washk12.org 2006-05-31 07:04:54 ----

We are moving from another library software *cough*Follett*cough* which keeps track of which patron is current.  I have added code to Koha to do the same with a cookie.

This uses code from another enhancement I've posted for the cookie variable to always be an array ref, so watch out for @$cookie.



---- Additional Comments From mdhafen@tech.washk12.org 2006-05-31 07:05:08 ----

Created an attachment
proposed patches.





---- Additional Comments From jmf@liblime.com 2007-10-04 14:06:28 ----

neat idea, bumping up to 3.0



--- Bug imported by chris@bigballofwax.co.nz 2010-05-20 23:38 UTC  ---

This bug was previously known as _bug_ 1092 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=1092
Imported an attachment (id=68)

Actual time not defined. Setting to 0.0
The original submitter of attachment 68 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.

Comment 1 Michael Hafen 2010-11-12 15:29:40 UTC
This could also be done with the session instead of a cookie, and I've changed my code to do so.
Comment 2 Chris Cormack 2012-04-08 07:25:27 UTC
Michael, do you want to submit a patch for your code tracking active patron in circulation via the session?
Comment 3 Michael Hafen 2012-04-10 15:06:25 UTC
(In reply to comment #2)

I've been thinking about refactoring this feature (because I haven't rebased in a long time) to use the same cookie as the hold button uses.  Might be a while before I get to that though, so if someone wants to volunteer to work on it that would make me happy.
Comment 4 Katrin Fischer 2014-10-10 23:03:02 UTC
Michael, could you explain a bit more how this should work?
Comment 5 Michael Hafen 2014-10-13 16:52:01 UTC
(In reply to Katrin Fischer from comment #4)
> Michael, could you explain a bit more how this should work?

Sure... I was going to use the cookie tracking from reserves, but I wasn't able to find it.  So I'll have to explain this using my own, very out-dated, code.

This would effect a few pages: circ/circulation.pl, circ/returns.pl, circ/renew.pl, reserve/request.pl, members/moremember.pl

In circulation, request, and moremember you could have code like:

$borrowernumber = $query->param('borrowernumber') || $session->param('borrowernumber');

And in all the pages there would be code like:

if ( $borrower->{borrowernumber} != $session->param('borrowernumber') {
  $session->param('borrowernumber', $borrower->{borrowernumber});
}

With code like this when a borrower's record is loaded through a search, that borrower's number is stored in the session.  After that any access to pages that require a borrower's record to be loaded can present the most recently found borrower by pulling their number from the session instead of the librarian having to search for them.  It's most useful in going into the reserves/request.pl page, which is why there is/used to be code to do the same thing using a cookie.  I think there are links into moremember from return and renew, so this feature isn't as useful there.  Though I have added a link directory to circulation to the top menu, and to the list on the return page so that circulation is one click closer there.
Comment 6 Katrin Fischer 2019-05-04 15:34:10 UTC
(In reply to Michael Hafen from comment #5)
> (In reply to Katrin Fischer from comment #4)
> > Michael, could you explain a bit more how this should work?
> 
> Sure... I was going to use the cookie tracking from reserves, but I wasn't
> able to find it.  So I'll have to explain this using my own, very out-dated,
> code.
> 
> This would effect a few pages: circ/circulation.pl, circ/returns.pl,
> circ/renew.pl, reserve/request.pl, members/moremember.pl
> 
> In circulation, request, and moremember you could have code like:
> 
> $borrowernumber = $query->param('borrowernumber') ||
> $session->param('borrowernumber');
> 
> And in all the pages there would be code like:
> 
> if ( $borrower->{borrowernumber} != $session->param('borrowernumber') {
>   $session->param('borrowernumber', $borrower->{borrowernumber});
> }
> 
> With code like this when a borrower's record is loaded through a search,
> that borrower's number is stored in the session.  After that any access to
> pages that require a borrower's record to be loaded can present the most
> recently found borrower by pulling their number from the session instead of
> the librarian having to search for them.  It's most useful in going into the
> reserves/request.pl page, which is why there is/used to be code to do the
> same thing using a cookie.  I think there are links into moremember from
> return and renew, so this feature isn't as useful there.  Though I have
> added a link directory to circulation to the top menu, and to the list on
> the return page so that circulation is one click closer there.

This sounds a bit like our 'search to hold' feature. Also there is now a 'last patron' feature (showLastPatron preference). Closing this MOVED, please reopen if you disagree!