Bugzilla – Attachment 135487 Details for
Bug 30718
Use flatpickr's altInput option everywhere
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30718: POC - Use flatpickr's altInput
Bug-30718-POC---Use-flatpickrs-altInput.patch (text/plain), 3.78 KB, created by
Jonathan Druart
on 2022-05-31 10:11:12 UTC
(
hide
)
Description:
Bug 30718: POC - Use flatpickr's altInput
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-05-31 10:11:12 UTC
Size:
3.78 KB
patch
obsolete
>From 589ed94a5cb6d8c883febbb30106741c01ca8114 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 31 May 2022 12:10:33 +0200 >Subject: [PATCH] Bug 30718: POC - Use flatpickr's altInput > >--- > .../prog/en/includes/calendar.inc | 7 +++++-- > koha-tmpl/intranet-tmpl/prog/js/members.js | 2 +- > members/memberentry.pl | 20 ------------------- > 3 files changed, 6 insertions(+), 23 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index 47a3f76ec2d..a3a19db4cdd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -35,7 +35,10 @@ > flatpickr.l10ns.default.months = flatpickr_months; > flatpickr.setDefaults({ > allowInput: true, >- dateFormat: flatpickr_dateformat_string, >+ dateFormat: "Y-m-d", >+ altInput: true, >+ altFormat: flatpickr_dateformat_string, >+ altInputClass: 'flatpickr-input', > nextArrow: '<i class="fa fa-fw fa-arrow-right"></i>', > prevArrow: '<i class="fa fa-fw fa-arrow-left"></i>', > time_24hr: flatpickr_timeformat, >@@ -46,7 +49,7 @@ > }, > onReady: function( selectedDates, dateStr, instance ){ > /* When flatpickr instance is created, automatically append a "clear date" link */ >- $(instance.input) >+ $(instance.input).siblings('input.flatpickr') > /* Add a wrapper element so that we can prevent the clear button from wrapping */ > .wrap("<span class='flatpickr_wrapper'></span>") > .attr("autocomplete", "off") >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index 7a9f844a865..f711a19aaca 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -128,7 +128,7 @@ function select_user(borrowernumber, borrower, relationship) { > > function CalculateAge(dateofbirth) { > var today = new Date(); >- var dob = Date_from_syspref(dateofbirth); >+ var dob = new Date(dateofbirth); > var age = {}; > > age.year = today.getFullYear() - dob.getFullYear(); >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 0f369ebc219..3b0be69348b 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -198,19 +198,6 @@ if ( $op eq 'insert' || $op eq 'modify' || $op eq 'save' || $op eq 'duplicate' ) > } > } > >- foreach (qw(dateenrolled dateexpiry dateofbirth password_expiration_date)) { >- next unless exists $newdata{$_}; >- my $userdate = $newdata{$_} or next; >- >- my $formatteddate = eval { output_pref({ dt => dt_from_string( $userdate ), dateformat => 'iso', dateonly => 1 } ); }; >- if ( $formatteddate ) { >- $newdata{$_} = $formatteddate; >- } else { >- $template->param( "ERROR_$_" => 1 ); >- push(@errors,"ERROR_$_"); >- } >- } >- > # check permission to modify login info. > if (ref($borrower_data) && ($borrower_data->{'category_type'} eq 'S') && ! (C4::Auth::haspermission($userenv->{'id'},{'staffaccess'=>1})) ) { > $NoUpdateLogin = 1; >@@ -797,13 +784,6 @@ if (C4::Context->preference('uppercasesurnames')) { > $data{'contactname'} &&= uc( $data{'contactname'} ); > } > >-foreach (qw(dateenrolled dateexpiry dateofbirth password_expiration_date)) { >- if ( $data{$_} ) { >- $data{$_} = eval { output_pref({ dt => dt_from_string( $data{$_} ), dateonly => 1 } ); }; # back to syspref for display >- } >- $template->param( $_ => $data{$_}); >-} >- > if ( C4::Context->preference('ExtendedPatronAttributes') ) { > patron_attributes_form( $template, $extended_patron_attributes, $op ); > } >-- >2.25.1
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 30718
:
135487
|
137516
|
137707
|
137715
|
137803
|
137804
|
137805
|
137806
|
137807
|
137868
|
137869
|
138644
|
138645
|
138646
|
138647
|
138648
|
138649
|
138650
|
138651
|
138652
|
138658
|
138659
|
138748
|
138749
|
138750
|
138751
|
138752
|
138753
|
138754
|
138755
|
138756
|
138757
|
138758
|
138879
|
138980
|
139033
|
139073
|
139074
|
139075
|
139076
|
139077
|
139078
|
139079
|
139080
|
139081
|
139082
|
139083
|
139084
|
139085
|
139453
|
139454
|
139455
|
139456
|
139457
|
139458
|
139459
|
139460
|
139461
|
139462
|
139463
|
139464
|
139465
|
139466
|
139467
|
139468
|
139490
|
139605
|
143175