From 88ae016eaac59056cfd7fbd299e0159ab53cd35b Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 13 Sep 2012 09:25:16 -0400 Subject: [PATCH] Bug 8215 - Add Course Reserves - QA Followup * Fix perlcritic error. * Add warnings if DEPARTMENT or TERM authorised values are not defined. * Enable datatables on courses table, hide old search. Signed-off-by: Jonathan Druart --- course_reserves/add_items.pl | 9 ++-- .../en/modules/course_reserves/course-reserves.tt | 19 +++++++- .../prog/en/modules/course_reserves/course.tt | 48 ++++++++++++-------- 3 files changed, 51 insertions(+), 25 deletions(-) diff --git a/course_reserves/add_items.pl b/course_reserves/add_items.pl index e810837..5e8ad86 100755 --- a/course_reserves/add_items.pl +++ b/course_reserves/add_items.pl @@ -51,16 +51,19 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( flagsrequired => { coursereserves => 'add_reserves' }, } ); -$template->param( ERROR_BARCODE_NOT_FOUND => $barcode ) unless ( $barcode && $item && $action eq 'lookup' ); +$template->param( ERROR_BARCODE_NOT_FOUND => $barcode ) + unless ( $barcode && $item && $action eq 'lookup' ); $template->param( course => GetCourse($course_id) ); if ( $action eq 'lookup' ) { my $course_item = GetCourseItem( itemnumber => $item->{'itemnumber'} ); - my $course_reserve = GetCourseReserve( + my $course_reserve = ($course_item) + ? GetCourseReserve( course_id => $course_id, ci_id => $course_item->{'ci_id'} - ) if ($course_item); + ) + : undef; $template->param( item => $item, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt index 8f6e58b..f3016bc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt @@ -2,7 +2,20 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Course reserves [% INCLUDE 'doc-head-close.inc' %] - + + + +[% INCLUDE 'datatables-strings.inc' %] + + + @@ -32,6 +45,7 @@ + + + -->

Courses

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt index bb3feae..a6928b2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt @@ -90,17 +90,21 @@ function RemoveInstructor( cardnumber ) {
  1. - + + + [% FOREACH d IN departments %] + [% IF d.authorised_value == department %] + + [% ELSE %] + + [% END %] [% END %] - [% END %] - + + [% ELSE %] + No DEPARTMENT authorised values found! Please create one or more authorised values with the category DEPARTMENT. + [% END %]
  2. @@ -120,17 +124,21 @@ function RemoveInstructor( cardnumber ) {
  3. - + + + [% FOREACH t IN terms %] + [% IF t.authorised_value == term %] + + [% ELSE %] + + [% END %] [% END %] - [% END %] - + + [% ELSE %] + No TERM authorised values found! Please create one or more authorised values with the category TERM. + [% END %]
  4. -- 1.7.10.4