Bugzilla – Attachment 83330 Details for
Bug 21999
C4::Circulation::AddIssue uses DBIx::Class directly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21999: Move attributes to a variable to not dup them
Bug-21999-Move-attributes-to-a-variable-to-not-dup.patch (text/plain), 2.70 KB, created by
Jonathan Druart
on 2018-12-17 21:29:54 UTC
(
hide
)
Description:
Bug 21999: Move attributes to a variable to not dup them
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-12-17 21:29:54 UTC
Size:
2.70 KB
patch
obsolete
>From d6001956bd9d533a6cd2e24d795cd086e81b7ffa Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 17 Dec 2018 18:26:47 -0300 >Subject: [PATCH] Bug 21999: Move attributes to a variable to not dup them > >Avoid c/p as much as possible :) > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > C4/Circulation.pm | 32 +++++++++++++------------------- > 1 file changed, 13 insertions(+), 19 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index dc285f0d9c..17df54b80b 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1355,30 +1355,24 @@ sub AddIssue { > } > $datedue->truncate( to => 'minute' ); > >- $issue = >- Koha::Checkouts->find( { itemnumber => $item->{'itemnumber'} } ); >+ my $issue_attributes = { >+ borrowernumber => $borrower->{'borrowernumber'}, >+ issuedate => $issuedate->strftime('%Y-%m-%d %H:%M:%S'), >+ date_due => $datedue->strftime('%Y-%m-%d %H:%M:%S'), >+ branchcode => C4::Context->userenv->{'branch'}, >+ onsite_checkout => $onsite_checkout, >+ auto_renew => $auto_renew ? 1 : 0, >+ }; >+ >+ $issue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } ); > if ($issue) { >- $issue->set( >- { >- borrowernumber => $borrower->{'borrowernumber'}, >- issuedate => $issuedate->strftime('%Y-%m-%d %H:%M:%S'), >- date_due => $datedue->strftime('%Y-%m-%d %H:%M:%S'), >- branchcode => C4::Context->userenv->{'branch'}, >- onsite_checkout => $onsite_checkout, >- auto_renew => $auto_renew ? 1 : 0 >- } >- )->store; >+ $issue->set($issue_attributes)->store; > } > else { > $issue = Koha::Checkout->new( > { >- borrowernumber => $borrower->{'borrowernumber'}, >- itemnumber => $item->{'itemnumber'}, >- issuedate => $issuedate->strftime('%Y-%m-%d %H:%M:%S'), >- date_due => $datedue->strftime('%Y-%m-%d %H:%M:%S'), >- branchcode => C4::Context->userenv->{'branch'}, >- onsite_checkout => $onsite_checkout, >- auto_renew => $auto_renew ? 1 : 0 >+ itemnumber => $item->{itemnumber}, >+ %$issue_attributes, > } > )->store; > } >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21999
:
83215
|
83216
|
83244
|
83245
|
83327
|
83328
|
83329
| 83330