Lines 203-214
sub getletter {
Link Here
|
203 |
my ( $module, $code, $branchcode, $message_transport_type ) = @_; |
203 |
my ( $module, $code, $branchcode, $message_transport_type ) = @_; |
204 |
$message_transport_type //= '%'; |
204 |
$message_transport_type //= '%'; |
205 |
|
205 |
|
206 |
if ( C4::Context->preference('IndependentBranches') |
|
|
207 |
and $branchcode |
208 |
and C4::Context->userenv ) { |
209 |
|
210 |
$branchcode = C4::Context->userenv->{'branch'}; |
211 |
} |
212 |
$branchcode //= ''; |
206 |
$branchcode //= ''; |
213 |
|
207 |
|
214 |
my $dbh = C4::Context->dbh; |
208 |
my $dbh = C4::Context->dbh; |
Lines 223-228
sub getletter {
Link Here
|
223 |
my $line = $sth->fetchrow_hashref |
217 |
my $line = $sth->fetchrow_hashref |
224 |
or return; |
218 |
or return; |
225 |
$line->{'content-type'} = 'text/html; charset="UTF-8"' if $line->{is_html}; |
219 |
$line->{'content-type'} = 'text/html; charset="UTF-8"' if $line->{is_html}; |
|
|
220 |
|
221 |
if ( C4::Context->preference('IndependentBranches') |
222 |
and ( (not $line->{'branchcode'}) or ( not ($line->{'branchcode'} eq C4::Context->userenv->{'branch'}) ) ) |
223 |
and not C4::Context->IsSuperLibrarian() ){ |
224 |
return; |
225 |
} |
226 |
|
226 |
return { %$line }; |
227 |
return { %$line }; |
227 |
} |
228 |
} |
228 |
|
229 |
|