From 01b9e646f518c4e4db29ae9e8a6eb1b51c29b8e0 Mon Sep 17 00:00:00 2001 From: Alex Sassmannshausen Date: Mon, 19 Sep 2016 13:12:21 +0200 Subject: [PATCH] Bug 5670: [QA Followup] Don't force ISO dates. * koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt: Use ".datepicker" class for date input, use `$KohaDates` to filter our iso dates. * members/housebound.pl: Use DateTime and Koha::DateUtils to parse incoming date to ISO format. Signed-off-by: Claire Gravely Signed-off-by: Kyle M Hall --- .../prog/en/modules/members/housebound.tt | 27 +++++++------------ members/housebound.pl | 22 ++++++++------- 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt index 604523ad62..4656160f40 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt @@ -14,14 +14,6 @@ Koha › Housebound › Details for [% INCLUDE 'patron-title.inc' %] [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'calendar.inc' %] - - [% INCLUDE 'header.inc' %] @@ -46,7 +38,7 @@ $(document).ready(function() {

Housebound details for [% patron.title %] [% patron.firstname %] [% patron.surname %] ([% patron.cardnumber %])

-
+
[% FOR m IN messages %]
@@ -216,7 +208,7 @@ $(document).ready(function() { [% ELSIF ( method == 'visit_update_or_create' ) %]

Manage housebound deliveries

-
[% IF ( visit ) %] @@ -229,15 +221,16 @@ $(document).ready(function() { Delivery details
  1. - + [% IF ( visit ) %] - + [% ELSE %] - + [% END %] +
    [% INCLUDE 'date-format.inc' %]
  2. @@ -418,7 +411,7 @@ $(document).ready(function() { [% FOREACH entry IN housebound_visits %] [% entry.id %] - [% entry.appointment_date %] ([% entry.day_segment %]) + [% entry.appointment_date | $KohaDates %] ([% entry.day_segment %]) [% INCLUDE 'patron-title.inc' borrowernumber = entry.chooser.borrowernumber category_type = entry.chooser.categorycode firstname = entry.chooser.firstname surname = entry.chooser.surname othernames = entry.chooser.othernames cardnumber = entry.chooser.cardnumber invert_name = 0 %] diff --git a/members/housebound.pl b/members/housebound.pl index 516effc841..a2d506250c 100755 --- a/members/housebound.pl +++ b/members/housebound.pl @@ -28,6 +28,8 @@ use Modern::Perl; use CGI; use C4::Auth; use C4::Output; +use DateTime; +use Koha::DateUtils; use Koha::Libraries; use Koha::Patrons; use Koha::Patron::Categories; @@ -125,11 +127,11 @@ if ( $method eq 'updateconfirm' and $houseboundprofile ) { # We have received input for editing a visit. We must store and return to # simple display. $visit->set({ - borrowernumber => $input->param('borrowernumber') // q{}, - appointment_date => $input->param('date') // q{}, - day_segment => $input->param('segment') // q{}, - chooser_brwnumber => $input->param('chooser') // q{}, - deliverer_brwnumber => $input->param('deliverer') // q{}, + borrowernumber => $input->param('borrowernumber') // q{}, + appointment_date => dt_from_string($input->param('date') // q{}), + day_segment => $input->param('segment') // q{}, + chooser_brwnumber => $input->param('chooser') // q{}, + deliverer_brwnumber => $input->param('deliverer') // q{}, }); my $success = eval { return $visit->store }; push @messages, { type => 'error', code => 'error_on_visit_store' } @@ -139,11 +141,11 @@ if ( $method eq 'updateconfirm' and $houseboundprofile ) { # We have received input for creating a visit. We must store and return # to simple display. my $visit = Koha::Patron::HouseboundVisit->new({ - borrowernumber => $input->param('borrowernumber') // q{}, - appointment_date => $input->param('date') // q{}, - day_segment => $input->param('segment') // q{}, - chooser_brwnumber => $input->param('chooser') // q{}, - deliverer_brwnumber => $input->param('deliverer') // q{}, + borrowernumber => $input->param('borrowernumber') // q{}, + appointment_date => dt_from_string($input->param('date') // q{}), + day_segment => $input->param('segment') // q{}, + chooser_brwnumber => $input->param('chooser') // q{}, + deliverer_brwnumber => $input->param('deliverer') // q{}, }); my $success = eval { return $visit->store }; push @messages, { type => 'error', code => 'error_on_visit_create' } -- 2.39.5