Bug 17657: Fix locations of item types images

Koha::ItemType->image_location takes the interface in parameter or
default to OPAC.
From the item types admin page, we need to specify the intranet
interface to retrieve the correct image's url

Test plan:
Go on the item types admin page, see the source of the page and find the
image' urls.
=> Without this patch, they point to the OPAC
=> With this patch, the location is correct

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
This commit is contained in:
Jonathan Druart 2016-11-18 08:23:16 +00:00 committed by Mason James
parent d51ee0f22b
commit 044b67ce21
1 changed files with 9 additions and 3 deletions

View File

@ -185,7 +185,7 @@ Item types administration
<a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a>
</li>
[% END %]
[% IF itemtype.image_location.match('^http') %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#remote">Remote image</a></li>
[% IF itemtype.image_location('intranet').match('^http') %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#remote">Remote image</a></li>
</ul>
<div id="none">
<ul>
@ -319,7 +319,8 @@ Item types administration
<tr>
<th scope="row">Image</th>
<td>
[% IF itemtype.image_location %]<img src="[% itemtype.image_location %]" alt="" />[% END %]
[% SET image_location = itemtype.image_location('intranet') %]
[% IF image_location %]<img src="[% image_location %]" alt="" />[% END %]
</td>
</tr>
[% END %]
@ -352,7 +353,12 @@ Item types administration
</thead>
[% FOREACH itemtype IN itemtypes %]
<tr>
[% UNLESS Koha.Preference('noItemTypeImages') %] <td>[% IF itemtype.image_location %]<img src="[% itemtype.image_location %]" alt="" />[% ELSE %]&nbsp;[% END %]</td>[% END %]
[% UNLESS Koha.Preference('noItemTypeImages') %]
<td>
[% SET image_location = itemtype.image_location('intranet') %]
[% IF image_location %]<img src="[% image_location %]" alt="" />[% ELSE %]&nbsp;[% END %]
</td>
[% END %]
<td>
<a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&amp;itemtype=[% itemtype.itemtype |html %]">
[% itemtype.itemtype %]