A new request with request id 14974 has been created by koha-devel-request@lists.koha-community.org. Short info on the request is :

Title : Koha-devel Digest, Vol 191, Issue 11
Category :
Description :
Send Koha-devel mailing list submissions to
    koha-devel@lists.koha-community.org

To subscribe or unsubscribe via the World Wide Web, visit
    https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
or, via email, send a message with subject or body 'help' to
    koha-devel-request@lists.koha-community.org

You can reach the person managing the list at
    koha-devel-owner@lists.koha-community.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Koha-devel digest..."


Today's Topics:

1. Changing the lost card value (Stephen Graham)
2. Re: Changing the lost card value (Jonathan Druart)
3. Re: Changing the lost card value (Stephen Graham)
4. Re: Changing the lost card value (Stephen Graham)


----------------------------------------------------------------------

Message: 1
Date: Mon, 18 Oct 2021 10:47:45 +0000
From: Stephen Graham <s.graham4@herts.ac.uk>
To: koha-devel <koha-devel@lists.koha-community.org>
Subject: [Koha-devel] Changing the lost card value
Message-ID:
    <LO0P265MB262027F727CF9511FD6E5E22E7BC9@LO0P265MB2620.GBRP265.PROD.OUTLOOK.COM>
    
Content-Type: text/plain; charset="utf-8"

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!

Cheers, Stephen

--------------------------------------
Stephen Graham
Library Technology Consultant
Library and Computing Services

University of Hertfordshire
Hatfield, Hertfordshire, AL10 9AB

Tel: +44(0)1707 286111
Ext: 77751
Email: s.graham4@herts.ac.uk<mailto:s.graham4@herts.ac.uk>
Website: herts.ac.uk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20211018/9fb2d51c/attachment-0001.htm>

------------------------------

Message: 2
Date: Mon, 18 Oct 2021 13:36:59 +0200
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
To: Stephen Graham <s.graham4@herts.ac.uk>
Cc: koha-devel <koha-devel@lists.koha-community.org>
Subject: Re: [Koha-devel] Changing the lost card value
Message-ID:
    <CAJzKNY7gcGVDiC8jARUU=t6druuEa92XYN-szEE27aF167p1Ug@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

Hi Stephen,

You can use
Koha::Patrons->find(42)->lost(0)->store;
to set borrowers.lost to 0 for patron with borrowernumber=42.

Cheers,
Jonathan

Le lun. 18 oct. 2021 à 12:47, Stephen Graham <s.graham4@herts.ac.uk> a écrit :
>
> 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!
>
>
>
> Cheers, Stephen
>
>
>
> --------------------------------------
>
> Stephen Graham
>
> Library Technology Consultant
>
> Library and Computing Services
>
>
>
> University of Hertfordshire
>
> Hatfield, Hertfordshire, AL10 9AB
>
>
>
> Tel: +44(0)1707 286111
>
> Ext: 77751
>
> Email: s.graham4@herts.ac.uk
>
> Website: herts.ac.uk
>
>
>
> _______________________________________________
> Koha-devel mailing list
> Koha-devel@lists.koha-community.org
> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : https://www.koha-community.org/
> git : https://git.koha-community.org/
> bugs : https://bugs.koha-community.org/


------------------------------

Message: 3
Date: Mon, 18 Oct 2021 13:03:45 +0000
From: Stephen Graham <s.graham4@herts.ac.uk>
To: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Cc: koha-devel <koha-devel@lists.koha-community.org>
Subject: Re: [Koha-devel] Changing the lost card value
Message-ID:
    <LO0P265MB26200F3FE1BD14A330C82298E7BC9@LO0P265MB2620.GBRP265.PROD.OUTLOOK.COM>
    
Content-Type: text/plain; charset="utf-8"

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?

Stephen

-----Original Message-----
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Sent: 18 October 2021 12:37
To: Stephen Graham <s.graham4@herts.ac.uk>
Cc: koha-devel <koha-devel@lists.koha-community.org>
Subject: Re: [Koha-devel] Changing the lost card value

Hi Stephen,

You can use
Koha::Patrons->find(42)->lost(0)->store;
to set borrowers.lost to 0 for patron with borrowernumber=42.

Cheers,
Jonathan

Le lun. 18 oct. 2021 à 12:47, Stephen Graham <s.graham4@herts.ac.uk> a écrit :
>
> 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!
>
>
>
> Cheers, Stephen
>
>
>
> --------------------------------------
>
> Stephen Graham
>
> Library Technology Consultant
>
> Library and Computing Services
>
>
>
> University of Hertfordshire
>
> Hatfield, Hertfordshire, AL10 9AB
>
>
>
> Tel: +44(0)1707 286111
>
> Ext: 77751
>
> Email: s.graham4@herts.ac.uk
>
> Website: herts.ac.uk
>
>
>
> _______________________________________________
> Koha-devel mailing list
> Koha-devel@lists.koha-community.org
> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : https://www.koha-community.org/ git :
> https://git.koha-community.org/ bugs :
> https://bugs.koha-community.org/

------------------------------

Message: 4
Date: Mon, 18 Oct 2021 13:18:12 +0000
From: Stephen Graham <s.graham4@herts.ac.uk>
To: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Cc: koha-devel <koha-devel@lists.koha-community.org>
Subject: Re: [Koha-devel] Changing the lost card value
Message-ID:
    <LO0P265MB2620154E896E5A61C4E9A462E7BC9@LO0P265MB2620.GBRP265.PROD.OUTLOOK.COM>
    
Content-Type: text/plain; charset="utf-8"

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.

I have the below, it's print User has a lost card, and then bombs out.

my $user = Koha::Patrons->find($userid);
if ($user->lost) {
print "User has a lost card\n";
$user->lost(0)->store();
} else {
print "NO lost card\n";
}

Stephen

-----Original Message-----
From: Stephen Graham
Sent: 18 October 2021 14:04
To: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Cc: koha-devel <koha-devel@lists.koha-community.org>
Subject: RE: [Koha-devel] Changing the lost card value

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?

Stephen

-----Original Message-----
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Sent: 18 October 2021 12:37
To: Stephen Graham <s.graham4@herts.ac.uk>
Cc: koha-devel <koha-devel@lists.koha-community.org>
Subject: Re: [Koha-devel] Changing the lost card value

Hi Stephen,

You can use
Koha::Patrons->find(42)->lost(0)->store;
to set borrowers.lost to 0 for patron with borrowernumber=42.

Cheers,
Jonathan

Le lun. 18 oct. 2021 à 12:47, Stephen Graham <s.graham4@herts.ac.uk> a écrit :
>
> 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!
>
>
>
> Cheers, Stephen
>
>
>
> --------------------------------------
>
> Stephen Graham
>
> Library Technology Consultant
>
> Library and Computing Services
>
>
>
> University of Hertfordshire
>
> Hatfield, Hertfordshire, AL10 9AB
>
>
>
> Tel: +44(0)1707 286111
>
> Ext: 77751
>
> Email: s.graham4@herts.ac.uk
>
> Website: herts.ac.uk
>
>
>
> _______________________________________________
> Koha-devel mailing list
> Koha-devel@lists.koha-community.org
> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : https://www.koha-community.org/ git :
> https://git.koha-community.org/ bugs :
> https://bugs.koha-community.org/

------------------------------

Subject: Digest Footer

_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : https://www.koha-community.org/
git : https://git.koha-community.org/
bugs : https://bugs.koha-community.org/


------------------------------

End of Koha-devel Digest, Vol 191, Issue 11
*******************************************


NOTE: You are receiving this mail because, the Requester/Technician wanted you to get notified on this request creation.