From 6a1e7923eec3be8c416d5deadbd3e5d6bfff09c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Wed, 14 Oct 2015 21:51:17 +0200 Subject: [PATCH] [PASSED QA] 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 --- admin/categorie.pl | 15 ++++++++++++--- .../intranet-tmpl/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 a848aa4..1d5cd08 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 92a6a28..2280c6c 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 %] -- 1.9.1