Bugzilla – Attachment 77970 Details for
Bug 15184
Ability to duplicate existing order lines to a given basket
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15184: Add users ?
Bug-15184-Add-users-.patch (text/plain), 2.15 KB, created by
Josef Moravec
on 2018-08-17 06:15:29 UTC
(
hide
)
Description:
Bug 15184: Add users ?
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2018-08-17 06:15:29 UTC
Size:
2.15 KB
patch
obsolete
>From 73e3c73572cbfec7caddb76485c43fb363c0e156 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 27 Jul 2018 15:58:07 -0300 >Subject: [PATCH] Bug 15184: Add users ? > >We certainly do not want this patch. What about users that are notified >on receiving? > >Sponsored-by: BULAC - http://www.bulac.fr/ > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > Koha/Acquisition/Order.pm | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > >diff --git a/Koha/Acquisition/Order.pm b/Koha/Acquisition/Order.pm >index 0619fc1..e0ad79e 100644 >--- a/Koha/Acquisition/Order.pm >+++ b/Koha/Acquisition/Order.pm >@@ -25,6 +25,7 @@ use Koha::Acquisition::Invoices; > use Koha::Database; > use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Items; >+use Koha::Patrons; > use Koha::Subscriptions; > > use base qw(Koha::Object); >@@ -110,6 +111,14 @@ sub add_item { > $rs->create({ ordernumber => $self->ordernumber, itemnumber => $itemnumber }); > } > >+sub add_user { >+ my ( $self, $borrowernumber ) = @_; >+ >+ my $schema = Koha::Database->new->schema; >+ my $rs = $schema->resultset('AqorderUser'); >+ $rs->create({ ordernumber => $self->ordernumber, borrowernumber => $borrowernumber }); >+} >+ > =head3 basket > > my $basket = Koha::Acquisition::Orders->find( $id )->basket; >@@ -177,6 +186,13 @@ sub items { > return Koha::Items->search({ itemnumber => \@itemnumbers }); > } > >+sub users { >+ my ( $self ) = @_; >+ my $users_rs = $self->_result->aqorder_users; >+ my @borrowernumbers = $users_rs->get_column( 'borrowernumber' )->all; >+ return Koha::Patrons->search({ borrowernumber=> \@borrowernumbers }); >+} >+ > sub duplicate_to { > my ( $self, $basket, $default_values ) = @_; > my $new_order; >@@ -221,6 +237,10 @@ sub duplicate_to { > my $new_item = Koha::Item->new($item_info)->store; > $new_order->add_item( $new_item->itemnumber ); > } >+ my $users = $self->users; # Do we want ça? >+ while ( my ($user) = $users->next ) { >+ $new_order->add_user( $user->borrowernumber ); >+ } > } > ); > return $new_order; >-- >2.1.4
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 15184
:
77314
|
77315
|
77316
|
77317
|
77318
|
77513
|
77514
|
77515
|
77516
|
77517
|
77966
|
77967
|
77968
|
77969
|
77970
|
78074
|
78075
|
78076
|
78077
|
78078
|
78277
|
78278
|
78279
|
78280
|
78281
|
78282
|
78283
|
78284
|
78285
|
78340
|
78535
|
78536
|
78537
|
78538
|
78539
|
78697
|
78698
|
78699
|
78700
|
78701
|
78702
|
78703
|
78704
|
78705
|
78706
|
78898
|
78911
|
78927
|
78958
|
78959
|
78960
|
78961
|
78962
|
78963
|
78964
|
78965
|
78966
|
78967
|
78968
|
78969
|
78970
|
80485
|
80486
|
80487
|
80488
|
80489
|
80490
|
80491
|
80492
|
80493
|
80494
|
80495
|
80638
|
81435
|
81436
|
81437
|
81438
|
81439
|
81440
|
81441
|
81442
|
81443
|
81444
|
81445
|
81446
|
81447
|
81448
|
82079