Lines 41-47
BEGIN {
Link Here
|
41 |
@ISA = qw(Exporter); |
41 |
@ISA = qw(Exporter); |
42 |
@EXPORT = qw( |
42 |
@EXPORT = qw( |
43 |
&GetPrinters &GetPrinter |
43 |
&GetPrinters &GetPrinter |
44 |
&getitemtypeinfo |
|
|
45 |
&GetItemTypesCategorized |
44 |
&GetItemTypesCategorized |
46 |
&getallthemes |
45 |
&getallthemes |
47 |
&getFacets |
46 |
&getFacets |
Lines 123-167
sub GetItemTypesCategorized {
Link Here
|
123 |
return ($dbh->selectall_hashref($query,'itemtype')); |
122 |
return ($dbh->selectall_hashref($query,'itemtype')); |
124 |
} |
123 |
} |
125 |
|
124 |
|
126 |
=head2 getitemtypeinfo |
|
|
127 |
|
128 |
$itemtype = &getitemtypeinfo($itemtype, [$interface]); |
129 |
|
130 |
Returns information about an itemtype. The optional $interface argument |
131 |
sets which interface ('opac' or 'intranet') to return the imageurl for. |
132 |
Defaults to intranet. |
133 |
|
134 |
=cut |
135 |
|
136 |
sub getitemtypeinfo { |
137 |
my ($itemtype, $interface) = @_; |
138 |
my $dbh = C4::Context->dbh; |
139 |
require C4::Languages; |
140 |
my $language = C4::Languages::getlanguage(); |
141 |
my $it = $dbh->selectrow_hashref(q| |
142 |
SELECT |
143 |
itemtypes.itemtype, |
144 |
itemtypes.description, |
145 |
itemtypes.rentalcharge, |
146 |
itemtypes.notforloan, |
147 |
itemtypes.imageurl, |
148 |
itemtypes.summary, |
149 |
itemtypes.checkinmsg, |
150 |
itemtypes.checkinmsgtype, |
151 |
itemtypes.sip_media_type, |
152 |
COALESCE( localization.translation, itemtypes.description ) AS translated_description |
153 |
FROM itemtypes |
154 |
LEFT JOIN localization ON itemtypes.itemtype = localization.code |
155 |
AND localization.entity = 'itemtypes' |
156 |
AND localization.lang = ? |
157 |
WHERE itemtypes.itemtype = ? |
158 |
|, undef, $language, $itemtype ); |
159 |
|
160 |
$it->{imageurl} = getitemtypeimagelocation( ( ( defined $interface && $interface eq 'opac' ) ? 'opac' : 'intranet' ), $it->{imageurl} ); |
161 |
|
162 |
return $it; |
163 |
} |
164 |
|
165 |
=head2 getitemtypeimagedir |
125 |
=head2 getitemtypeimagedir |
166 |
|
126 |
|
167 |
my $directory = getitemtypeimagedir( 'opac' ); |
127 |
my $directory = getitemtypeimagedir( 'opac' ); |