Bug 18355: Display permanent location with cart location
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 1 Oct 2018 14:23:48 +0000 (11:23 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 13 Jan 2020 13:57:58 +0000 (13:57 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt

index a569a45..9b2d57d 100644 (file)
                     <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) | html %] [% END %]</td>
                     <td class="homebranch">
                         [% Branches.GetName(item.homebranch) | html %]
-                        <span class="shelvingloc">[% item.location | html %]</span>
+                        <span class="shelvingloc">
+                            [%# 1 - If permanent location is defined %]
+                            [%#   a - display the description if available, display the code if not %]
+                            [%#   b - display the current location in parens %]
+                            [%# 2 - If permanent location is not defined, but location is defined %]
+                            [%#   a - display the current location description if available, display the code if not %]
+                            [%# 3 - If neither are defined, show nothing %]
+                            [% IF item.permanent_location %]
+                                [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.permanent_location ) | html %]
+                                [% IF item.location AND item.location != item.permanent_location %]
+                                    ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %])
+                                [% END %]
+                            [% ELSIF item.location %]
+                                [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.permanent_location ) | html %]
+                            [% END %]
+                        </span>
                     </td>
                     [% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %]
                     <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %]</td>