<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body>A new request with request id 14974 has been created by koha-devel-request@lists.koha-community.org. Short info on the request is : <br><br>Title : Koha-devel Digest, Vol 191, Issue 11<br>Category : <br>Description : <div>Send Koha-devel mailing list submissions to<br>    koha-devel@lists.koha-community.org<br><br>To subscribe or unsubscribe via the World Wide Web, visit<br>    https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel<br>or, via email, send a message with subject or body 'help' to<br>    koha-devel-request@lists.koha-community.org<br><br>You can reach the person managing the list at<br>    koha-devel-owner@lists.koha-community.org<br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of Koha-devel digest..."<br><br><br>Today's Topics:<br><br>   1. Changing the lost card value (Stephen Graham)<br>   2. Re: Changing the lost card value (Jonathan Druart)<br>   3. Re: Changing the lost card value (Stephen Graham)<br>   4. Re: Changing the lost card value (Stephen Graham)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Mon, 18 Oct 2021 10:47:45 +0000<br>From: Stephen Graham <s.graham4@herts.ac.uk><br>To: koha-devel <koha-devel@lists.koha-community.org><br>Subject: [Koha-devel] Changing the lost card value<br>Message-ID:<br>    <LO0P265MB262027F727CF9511FD6E5E22E7BC9@LO0P265MB2620.GBRP265.PROD.OUTLOOK.COM><br>    <br>Content-Type: text/plain; charset="utf-8"<br><br>Sorry if this is a basic question. I've searched through the Koha::Patron and C4::Members perldoc and had a quick look through the memberentry.pl code to see how this handles it, but I can't seem to work out how it done. I want to change the value of the lost card field to zero. I can see the "lost" field in the borrowers table, so could update the value directly via SQL, but there must be a Koha method that I can use to do this? Any help/advice much appreciated!<br><br>Cheers, Stephen<br><br>--------------------------------------<br>Stephen Graham<br>Library Technology Consultant<br>Library and Computing Services<br><br>University of Hertfordshire<br>Hatfield, Hertfordshire, AL10 9AB<br><br>Tel: +44(0)1707 286111<br>Ext: 77751<br>Email: s.graham4@herts.ac.uk<mailto:s.graham4@herts.ac.uk><br>Website: herts.ac.uk<br><br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20211018/9fb2d51c/attachment-0001.htm><br><br>------------------------------<br><br>Message: 2<br>Date: Mon, 18 Oct 2021 13:36:59 +0200<br>From: Jonathan Druart <jonathan.druart@bugs.koha-community.org><br>To: Stephen Graham <s.graham4@herts.ac.uk><br>Cc: koha-devel <koha-devel@lists.koha-community.org><br>Subject: Re: [Koha-devel] Changing the lost card value<br>Message-ID:<br>    <CAJzKNY7gcGVDiC8jARUU=t6druuEa92XYN-szEE27aF167p1Ug@mail.gmail.com><br>Content-Type: text/plain; charset="UTF-8"<br><br>Hi Stephen,<br><br>You can use<br>  Koha::Patrons->find(42)->lost(0)->store;<br>to set borrowers.lost to 0 for patron with borrowernumber=42.<br><br>Cheers,<br>Jonathan<br><br>Le lun. 18 oct. 2021 à 12:47, Stephen Graham <s.graham4@herts.ac.uk> a écrit :<br>><br>> Sorry if this is a basic question. I’ve searched through the Koha::Patron and C4::Members perldoc and had a quick look through the memberentry.pl code to see how this handles it, but I can’t seem to work out how it done. I want to change the value of the lost card field to zero. I can see the “lost” field in the borrowers table, so could update the value directly via SQL, but there must be a Koha method that I can use to do this? Any help/advice much appreciated!<br>><br>><br>><br>> Cheers, Stephen<br>><br>><br>><br>> --------------------------------------<br>><br>> Stephen Graham<br>><br>> Library Technology Consultant<br>><br>> Library and Computing Services<br>><br>><br>><br>> University of Hertfordshire<br>><br>> Hatfield, Hertfordshire, AL10 9AB<br>><br>><br>><br>> Tel: +44(0)1707 286111<br>><br>> Ext: 77751<br>><br>> Email: s.graham4@herts.ac.uk<br>><br>> Website: herts.ac.uk<br>><br>><br>><br>> _______________________________________________<br>> Koha-devel mailing list<br>> Koha-devel@lists.koha-community.org<br>> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel<br>> website : https://www.koha-community.org/<br>> git : https://git.koha-community.org/<br>> bugs : https://bugs.koha-community.org/<br><br><br>------------------------------<br><br>Message: 3<br>Date: Mon, 18 Oct 2021 13:03:45 +0000<br>From: Stephen Graham <s.graham4@herts.ac.uk><br>To: Jonathan Druart <jonathan.druart@bugs.koha-community.org><br>Cc: koha-devel <koha-devel@lists.koha-community.org><br>Subject: Re: [Koha-devel] Changing the lost card value<br>Message-ID:<br>    <LO0P265MB26200F3FE1BD14A330C82298E7BC9@LO0P265MB2620.GBRP265.PROD.OUTLOOK.COM><br>    <br>Content-Type: text/plain; charset="utf-8"<br><br>Thanks Jonathan. I understand that the find method returns a Patron object, but don't understand where lost comes from. It's not a method in Patron is it? I guess it's a shortcut to update any individual database field value?
<br>
<br>Stephen
<br>
<br>-----Original Message-----
<br>From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 
<br>Sent: 18 October 2021 12:37
<br>To: Stephen Graham <s.graham4@herts.ac.uk>
<br>Cc: koha-devel <koha-devel@lists.koha-community.org>
<br>Subject: Re: [Koha-devel] Changing the lost card value
<br>
<br>Hi Stephen,
<br>
<br>You can use
<br>  Koha::Patrons->find(42)->lost(0)->store;
<br>to set borrowers.lost to 0 for patron with borrowernumber=42.
<br>
<br>Cheers,
<br>Jonathan
<br>
<br>Le lun. 18 oct. 2021 à 12:47, Stephen Graham <s.graham4@herts.ac.uk> a écrit :
<br>>
<br>> Sorry if this is a basic question. I’ve searched through the Koha::Patron and C4::Members perldoc and had a quick look through the memberentry.pl code to see how this handles it, but I can’t seem to work out how it done. I want to change the value of the lost card field to zero. I can see the “lost” field in the borrowers table, so could update the value directly via SQL, but there must be a Koha method that I can use to do this? Any help/advice much appreciated!
<br>>
<br>>
<br>>
<br>> Cheers, Stephen
<br>>
<br>>
<br>>
<br>> --------------------------------------
<br>>
<br>> Stephen Graham
<br>>
<br>> Library Technology Consultant
<br>>
<br>> Library and Computing Services
<br>>
<br>>
<br>>
<br>> University of Hertfordshire
<br>>
<br>> Hatfield, Hertfordshire, AL10 9AB
<br>>
<br>>
<br>>
<br>> Tel: +44(0)1707 286111
<br>>
<br>> Ext: 77751
<br>>
<br>> Email: s.graham4@herts.ac.uk
<br>>
<br>> Website: herts.ac.uk
<br>>
<br>>
<br>>
<br>> _______________________________________________
<br>> Koha-devel mailing list
<br>> Koha-devel@lists.koha-community.org
<br>> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
<br>> website : https://www.koha-community.org/ git : 
<br>> https://git.koha-community.org/ bugs : 
<br>> https://bugs.koha-community.org/
<br><br>------------------------------<br><br>Message: 4<br>Date: Mon, 18 Oct 2021 13:18:12 +0000<br>From: Stephen Graham <s.graham4@herts.ac.uk><br>To: Jonathan Druart <jonathan.druart@bugs.koha-community.org><br>Cc: koha-devel <koha-devel@lists.koha-community.org><br>Subject: Re: [Koha-devel] Changing the lost card value<br>Message-ID:<br>    <LO0P265MB2620154E896E5A61C4E9A462E7BC9@LO0P265MB2620.GBRP265.PROD.OUTLOOK.COM><br>    <br>Content-Type: text/plain; charset="utf-8"<br><br>Actually I just testing this now and cannot get it to work. I'm getting an error about not being able to write to the plack-opac-error.log file. I'm logged in as the usual koha user, and it's for a non-web script - never seen that before. I guess it's not working and it's trying to log the error to the plack log. 
<br>
<br>I have the below, it's print User has a lost card, and then bombs out.
<br>
<br>my $user = Koha::Patrons->find($userid);
<br>if ($user->lost) {
<br>        print "User has a lost card\n";
<br>        $user->lost(0)->store();
<br>} else {
<br>        print "NO lost card\n";
<br>}
<br>
<br>Stephen
<br>
<br>-----Original Message-----
<br>From: Stephen Graham 
<br>Sent: 18 October 2021 14:04
<br>To: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
<br>Cc: koha-devel <koha-devel@lists.koha-community.org>
<br>Subject: RE: [Koha-devel] Changing the lost card value
<br>
<br>Thanks Jonathan. I understand that the find method returns a Patron object, but don't understand where lost comes from. It's not a method in Patron is it? I guess it's a shortcut to update any individual database field value?
<br>
<br>Stephen
<br>
<br>-----Original Message-----
<br>From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 
<br>Sent: 18 October 2021 12:37
<br>To: Stephen Graham <s.graham4@herts.ac.uk>
<br>Cc: koha-devel <koha-devel@lists.koha-community.org>
<br>Subject: Re: [Koha-devel] Changing the lost card value
<br>
<br>Hi Stephen,
<br>
<br>You can use
<br>  Koha::Patrons->find(42)->lost(0)->store;
<br>to set borrowers.lost to 0 for patron with borrowernumber=42.
<br>
<br>Cheers,
<br>Jonathan
<br>
<br>Le lun. 18 oct. 2021 à 12:47, Stephen Graham <s.graham4@herts.ac.uk> a écrit :
<br>>
<br>> Sorry if this is a basic question. I’ve searched through the Koha::Patron and C4::Members perldoc and had a quick look through the memberentry.pl code to see how this handles it, but I can’t seem to work out how it done. I want to change the value of the lost card field to zero. I can see the “lost” field in the borrowers table, so could update the value directly via SQL, but there must be a Koha method that I can use to do this? Any help/advice much appreciated!
<br>>
<br>>
<br>>
<br>> Cheers, Stephen
<br>>
<br>>
<br>>
<br>> --------------------------------------
<br>>
<br>> Stephen Graham
<br>>
<br>> Library Technology Consultant
<br>>
<br>> Library and Computing Services
<br>>
<br>>
<br>>
<br>> University of Hertfordshire
<br>>
<br>> Hatfield, Hertfordshire, AL10 9AB
<br>>
<br>>
<br>>
<br>> Tel: +44(0)1707 286111
<br>>
<br>> Ext: 77751
<br>>
<br>> Email: s.graham4@herts.ac.uk
<br>>
<br>> Website: herts.ac.uk
<br>>
<br>>
<br>>
<br>> _______________________________________________
<br>> Koha-devel mailing list
<br>> Koha-devel@lists.koha-community.org
<br>> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
<br>> website : https://www.koha-community.org/ git : 
<br>> https://git.koha-community.org/ bugs : 
<br>> https://bugs.koha-community.org/
<br><br>------------------------------<br><br>Subject: Digest Footer<br><br>_______________________________________________<br>Koha-devel mailing list<br>Koha-devel@lists.koha-community.org<br>https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel<br>website : https://www.koha-community.org/<br>git : https://git.koha-community.org/<br>bugs : https://bugs.koha-community.org/<br><br><br>------------------------------<br><br>End of Koha-devel Digest, Vol 191, Issue 11<br>*******************************************<br></div><br><br>NOTE: You are receiving this mail because, the Requester/Technician wanted you to get notified on this request creation.<br></body></html>