Bugzilla – Attachment 174564 Details for
Bug 37398
Initialize a datepicker on all date/datetime fields when adding/editing items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37398: Do not rely on the columns names but data type instead
Bug-37398-Do-not-rely-on-the-columns-names-but-dat.patch (text/plain), 2.24 KB, created by
Marcel de Rooy
on 2024-11-15 10:42:08 UTC
(
hide
)
Description:
Bug 37398: Do not rely on the columns names but data type instead
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-11-15 10:42:08 UTC
Size:
2.24 KB
patch
obsolete
>From a905ce9aa1a1c18b7ae337963317d044688c4872 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 24 Sep 2024 09:46:56 +0200 >Subject: [PATCH] Bug 37398: Do not rely on the columns names but data type > instead >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/UI/Form/Builder/Item.pm | 14 +++++--------- > 1 file changed, 5 insertions(+), 9 deletions(-) > >diff --git a/Koha/UI/Form/Builder/Item.pm b/Koha/UI/Form/Builder/Item.pm >index f426ece8dd..cbc52522c3 100644 >--- a/Koha/UI/Form/Builder/Item.pm >+++ b/Koha/UI/Form/Builder/Item.pm >@@ -147,13 +147,9 @@ sub generate_subfield_form { > } > } > >- if ( defined $subfield->{kohafield} && $subfield->{kohafield} =~ /items\.(replacementpricedate|dateaccessioned|datelastborrowed|onloan)/) { >- $subfield_data{datetype} = 'date'; >- } >- >- if ( defined $subfield->{kohafield} && $subfield->{kohafield} =~ /items\.(datelastseen|damaged_on|itemlost_on|withdrawn_on|deleted_on)/) { >- $subfield_data{datetype} = 'datetime'; >- } >+ my $columns = Koha::Items->_resultset->result_source->columns_info; >+ $subfield_data{data_type} = >+ defined $subfield->{kohafield} ? $columns->{ $subfield->{kohafield} =~ s|^items\.||r }->{data_type} : undef; > > $subfield_data{visibility} = "display:none;" > if ( ( $subfield->{hidden} > 4 ) || ( $subfield->{hidden} <= -4 ) ); >@@ -323,14 +319,14 @@ sub generate_subfield_form { > authtypecode => $subfield->{authtypecode}, > }; > } >- elsif ( defined $subfield_data{datetype} && $subfield_data{datetype} eq 'date' ) { >+ elsif ( defined $subfield_data{data_type} && $subfield_data{data_type} eq 'date' ) { > $subfield_data{marc_value} = { > type => 'date_field', > id => $subfield_data{id}, > value => $value, > } > } >- elsif ( defined $subfield_data{datetype} && $subfield_data{datetype} eq 'datetime' ) { >+ elsif ( defined $subfield_data{data_type} && $subfield_data{data_type} eq 'datetime' ) { > $subfield_data{marc_value} = { > type => 'datetime_field', > id => $subfield_data{id}, >-- >2.39.5
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 37398
:
171416
|
171417
|
171419
|
171420
|
171421
|
171422
|
171423
|
171424
|
171881
|
171882
|
171919
|
171963
|
172187
|
172188
|
172189
|
172190
|
172191
|
172192
|
172193
|
172194
|
172195
|
172196
|
174558
|
174559
|
174560
|
174561
|
174562
|
174563
| 174564 |
174565
|
174566