@@ -, +, @@ course reserves --- C4/CourseReserves.pm | 6 +++--- .../prog/en/modules/course_reserves/add_items-step2.tt | 8 ++++---- .../prog/en/modules/course_reserves/course-details.tt | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) --- a/C4/CourseReserves.pm +++ a/C4/CourseReserves.pm @@ -604,7 +604,7 @@ sub _ModStoredFields { my ( @fields_to_update, @values_to_update ); foreach (@FIELDS) { - if ( $params{$_} ) { + if ( defined($params{$_}) ) { push( @fields_to_update, $_ ); push( @values_to_update, $params{$_} ); } @@ -670,9 +670,9 @@ sub _SwapAllFields { my %course_item_fields; my %item_fields; foreach (@FIELDS) { - if ( $course_item->{$_} ) { + if ( defined( $course_item->{$_} ) ) { $course_item_fields{$_} = $course_item->{$_}; - $item_fields{$_} = $item->{$_}; + $item_fields{$_} = $item->{$_} || q{}; } } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt @@ -39,7 +39,7 @@ LEAVE UNCHANGED [% FOREACH it IN itypes %] - [% IF course_item.itype && ( ( course.enabled == 'yes' && it.itemtype == item.itype ) || ( course.enabled == 'no' && it.itemtype == course_item.itype ) ) %] + [% IF course_item.itype.defined && ( ( course.enabled == 'yes' && it.itemtype == item.itype ) || ( course.enabled == 'no' && it.itemtype == course_item.itype ) ) %] [% it.description | html %] [% ELSE %] [% it.description | html %] @@ -55,7 +55,7 @@ LEAVE UNCHANGED [% FOREACH c IN ccodes %] - [% IF course_item.ccode && ( ( course.enabled == 'yes' && c.authorised_value == item.ccode ) || ( course.enabled == 'no' && c.authorised_value == course_item.ccode ) ) %] + [% IF course_item.ccode.defined && ( ( course.enabled == 'yes' && c.authorised_value == item.ccode ) || ( course.enabled == 'no' && c.authorised_value == course_item.ccode ) ) %] [% c.lib | html %] [% ELSE %] [% c.lib | html %] @@ -70,7 +70,7 @@ LEAVE UNCHANGED [% FOREACH s IN locations %] - [% IF course_item.location && ( ( course.enabled == 'yes' && s.authorised_value == item.location ) || ( course.enabled == 'no' && s.authorised_value == course_item.location ) ) %] + [% IF course_item.location.defined && ( ( course.enabled == 'yes' && s.authorised_value == item.location ) || ( course.enabled == 'no' && s.authorised_value == course_item.location ) ) %] [% s.lib | html %] [% ELSE %] [% s.lib | html %] @@ -84,7 +84,7 @@ LEAVE UNCHANGED [% FOREACH b IN Branches.all() %] - [% IF course_item.holdingbranch && ( ( course.enabled == 'yes' && b.branchcode == item.holdingbranch ) || ( course.enabled == 'no' && b.branchcode == course_item.holdingbranch ) ) %] + [% IF course_item.holdingbranch.defined && ( ( course.enabled == 'yes' && b.value == item.holdingbranch ) || ( course.enabled == 'no' && b.value == course_item.holdingbranch ) ) %] [% b.branchname | html %] [% ELSE %] [% b.branchname | html %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt @@ -84,7 +84,7 @@ [% cr.item.itemcallnumber | html %] [% IF item_level_itypes %] - [% IF cr.course_item.itype %] + [% IF cr.course_item.itype.defined %] [% IF cr.course_item.enabled == 'yes' %] [% ItemTypes.GetDescription( cr.item.itype ) | html %] [% ELSE %] @@ -99,7 +99,7 @@ [% END %] - [% IF cr.course_item.ccode %] + [% IF cr.course_item.ccode.defined %] [% IF cr.course_item.enabled == 'yes' %] [% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) | html %] [% ELSE %] @@ -113,7 +113,7 @@ [% END %] - [% IF cr.course_item.location %] + [% IF cr.course_item.location.defined %] [% IF cr.course_item.enabled == 'yes' %] [% AuthorisedValues.GetByCode( 'LOC', cr.item.location ) | html %] [% ELSE %] @@ -127,7 +127,7 @@ [% END %] - [% IF cr.course_item.holdingbranch %] + [% IF cr.course_item.holdingbranch.defined %] [% IF cr.course_item.enabled == 'yes' %] [% Branches.GetName( cr.item.holdingbranch ) | html %] [% ELSE %] --