From c3c636bf7f40ee4945f33bf7d1b776aaf49e9d67 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20V=C3=A9ron?= Date: Wed, 14 Oct 2015 21:51:17 +0200 Subject: [PATCH] Bug 14949: Remove remaining C4::Dates and fix display in admin/categorie.pl This patch removes a remaining C4::Dates from admin/categroie.pl and fixes the display of "Enrollment period" on the confirmation screen for deleting. To verify and test pls. refer to comments #5 and #6 Signed-off-by: Hector Castro Works as advertised Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- admin/categorie.pl | 15 ++++++++++++--- .../prog/en/modules/admin/categorie.tt | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/admin/categorie.pl b/admin/categorie.pl index a848aa4f0b..1d5cd08198 100755 --- a/admin/categorie.pl +++ b/admin/categorie.pl @@ -282,10 +282,19 @@ elsif ( $op eq 'delete_confirm' ) { my $category = $schema->resultset('Category')->find($categorycode); - $category->enrolmentperioddate( - C4::Dates::format_date( $category->enrolmentperioddate() ) ); + if ( $category->enrolmentperioddate + && $category->enrolmentperioddate eq '0000-00-00' ) + { + $category->{'enrolmentperioddate'} = undef; + } - $template->param( category => $category, patrons_in_category => $count ); + $template->param( + category => $category, + description => $category->description, + enrolmentperiod => $category->enrolmentperiod, + enrolmentperioddate => $category->enrolmentperioddate, + patrons_in_category => $count, + ); # END $OP eq DELETE_CONFIRM ################## DELETE_CONFIRMED ################################## diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt index de8a5a7435..f50bd6128b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt @@ -1,4 +1,4 @@ -[% USE KohaDates -%] +[% USE KohaDates %] [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › Patron categories › [% IF ( add_form ) %][% IF ( categorycode ) %]Modify category '[% categorycode |html %]'[% ELSE %]New category[% END %][% END %] [% IF ( delete_confirm ) %][% IF ( patrons_in_category > 0 ) %]Cannot delete: category [% categorycode |html %] in use[% ELSE %]Confirm deletion of category '[% categorycode |html %]'[% END %][% END %] -- 2.39.5