Bugzilla – Attachment 172860 Details for
Bug 35287
Add additional fields support to ERM licenses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35287: Follow-up 37389: ExtendedAttributes
Bug-35287-Follow-up-37389-ExtendedAttributes.patch (text/plain), 2.40 KB, created by
Paul Derscheid
on 2024-10-17 10:12:42 UTC
(
hide
)
Description:
Bug 35287: Follow-up 37389: ExtendedAttributes
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2024-10-17 10:12:42 UTC
Size:
2.40 KB
patch
obsolete
>From 628093651539947e1af8ed12399192d7a91eb0c7 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 26 Jul 2024 14:24:44 +0000 >Subject: [PATCH] Bug 35287: Follow-up 37389: ExtendedAttributes > >Apply ExtendedAttributes Mixin to AdditionalFields > >To test the ExtendedAttributes mixin search is working: >1) Create 2 or more searchable licenses additional fields >2) Create a new license and enter values in these searchable fields >3) Go to the licenses list, use the column filters to search on more >than one column, verify that the search work as intended (AND operator) > >Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> >--- > Koha/ERM/Licenses.pm | 2 +- > Koha/Objects/Mixin/AdditionalFields.pm | 24 ++++++++++++++++++++++++ > 2 files changed, 25 insertions(+), 1 deletion(-) > >diff --git a/Koha/ERM/Licenses.pm b/Koha/ERM/Licenses.pm >index b1619ee63c..abece2c679 100644 >--- a/Koha/ERM/Licenses.pm >+++ b/Koha/ERM/Licenses.pm >@@ -22,7 +22,7 @@ use Koha::Database; > > use Koha::ERM::License; > >-use base qw(Koha::Objects Koha::Objects::Mixin::AdditionalFields); >+use base qw(Koha::Objects::Mixin::AdditionalFields Koha::Objects); > > =head1 NAME > >diff --git a/Koha/Objects/Mixin/AdditionalFields.pm b/Koha/Objects/Mixin/AdditionalFields.pm >index a412d3215a..8351aba549 100644 >--- a/Koha/Objects/Mixin/AdditionalFields.pm >+++ b/Koha/Objects/Mixin/AdditionalFields.pm >@@ -2,6 +2,8 @@ package Koha::Objects::Mixin::AdditionalFields; > > use Modern::Perl; > >+use base qw(Koha::Objects::Mixin::ExtendedAttributes); >+ > =head1 NAME > > Koha::Objects::Mixin::AdditionalFields >@@ -56,6 +58,28 @@ sub filter_by_additional_fields { > return $class->search(\%conditions, { join => [ ('additional_field_values') x $idx ] }); > } > >+=head3 extended_attributes_config >+ >+=cut >+ >+sub extended_attributes_config { >+ my ($self) = @_; >+ >+ my $tablename_query = $self->extended_attributes_tablename_query; >+ >+ return { >+ 'id_field' => { 'foreign' => 'record_id', 'self' => $self->_resultset->result_source->primary_columns }, >+ 'key_field' => 'field_id', >+ 'schema_class' => 'Koha::Schema::Result::AdditionalFieldValue', >+ }; >+} >+ >+sub extended_attributes_tablename_query { >+ my ($self) = @_; >+ >+ return { 'tablename' => $self->_resultset->result_source->name, 'operator' => '=' }; >+} >+ > =head1 AUTHOR > > Koha Development Team <http://koha-community.org/> >-- >2.47.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 35287
:
158725
|
158726
|
158727
|
158728
|
158729
|
158730
|
158731
|
158732
|
158733
|
158734
|
159634
|
159635
|
159636
|
159637
|
159638
|
159639
|
159640
|
159641
|
159642
|
159643
|
165451
|
165637
|
165638
|
165639
|
165640
|
165641
|
165642
|
165643
|
165644
|
165645
|
165646
|
165647
|
167681
|
169728
|
169729
|
169730
|
169731
|
169732
|
169733
|
169734
|
169735
|
169736
|
169737
|
170448
|
170753
|
172850
|
172851
|
172852
|
172853
|
172854
|
172855
|
172856
|
172857
|
172858
|
172860
|
172861
|
173022
|
173102
|
173103
|
173104
|
173105
|
173106
|
173107
|
173108
|
173109
|
173110
|
173111
|
173112
|
173113
|
173290