Bug 39078: Fix incorrect variable checks in course reserve details template

This patch adds some variable checks and corrects some others so that
the course reserve detail template doesn't show empty parentheses.

To test, apply the patch and create a course if necessary.

- Add an item to the course.
- After submitting a barcode, check the checkbox next to each option and
  select a different value (item type, collection, etc.).
- View the course details and check the columns for the fields you
  changed. They should display the correct information:
  "Updated field value (Original field value)"
- Add another item but this time don't change any options. The
  information should be display as:
  "Unchanged (Original field value)"
- There should be no instances where it looks like:
  "Field value ()"

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 753659589a)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
This commit is contained in:
Owen Leonard 2025-02-10 16:35:24 +00:00 committed by Baptiste Wojtkowski
parent a098e0079a
commit e46b444ac0
No known key found for this signature in database
GPG Key ID: 47A8A13E10BC0D40
1 changed files with 8 additions and 4 deletions

View File

@ -152,11 +152,15 @@
[% IF cr.course_item.itype_enabled %]
[% IF cr.course_item.enabled == 'yes' %]
<strong>[% ItemTypes.GetDescription( cr.item.effective_itemtype ) | html %]</strong>
[% IF (cr.course_item.itype_storage ) %]
([% ItemTypes.GetDescription( cr.course_item.itype_storage ) | html %])
[% END %]
[% ELSE %]
[% ItemTypes.GetDescription( cr.course_item.itype ) | html %]
[% IF ( cr.item.effective_itemtype ) %]
(<strong>[% ItemTypes.GetDescription( cr.item.effective_itemtype) | html %]</strong>)
[% END %]
[% END %]
[% ELSE %]
<em>Unchanged</em>
[% IF cr.item.itype %]
@ -169,7 +173,7 @@
[% IF cr.course_item.ccode_enabled %]
[% IF cr.course_item.enabled == 'yes' %]
<strong>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => cr.item.ccode ) | html %]</strong>
[% IF cr.item.ccode %]
[% IF cr.course_item.ccode_storage %]
([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => cr.course_item.ccode_storage ) | html %])
[% END %]
[% ELSE %]
@ -189,7 +193,7 @@
[% IF cr.course_item.location_enabled %]
[% IF cr.course_item.enabled == 'yes' %]
<strong>[% AuthorisedValues.GetByCode( 'LOC', cr.item.permanent_location ) | html %]</strong>
[% IF cr.item.permanent_location %]
[% IF cr.course_item.location_storage %]
([% AuthorisedValues.GetByCode( 'LOC', cr.course_item.location_storage ) | html %])
[% END %]
[% ELSE %]
@ -209,7 +213,7 @@
[% IF cr.course_item.homebranch_enabled %]
[% IF cr.course_item.enabled == 'yes' %]
<strong>[% Branches.GetName( cr.item.homebranch ) | html %]</strong>
[% IF cr.item.homebranch %]
[% IF cr.course_item.homebranch_storage %]
([% Branches.GetName( cr.course_item.homebranch_storage ) | html %])
[% END %]
[% ELSE %]
@ -229,7 +233,7 @@
[% IF cr.course_item.holdingbranch_enabled %]
[% IF cr.course_item.enabled == 'yes' %]
<strong>[% Branches.GetName( cr.item.holdingbranch ) | html %]</strong>
[% IF cr.item.holdingbranch %]
[% IF cr.course_item.holdingbranch_storage %]
([% Branches.GetName( cr.course_item.holdingbranch_storage ) | html %])
[% END %]
[% ELSE %]