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