Lines 126-140
sub get_opac_new {
Link Here
|
126 |
my ($idnew) = @_; |
126 |
my ($idnew) = @_; |
127 |
my $dbh = C4::Context->dbh; |
127 |
my $dbh = C4::Context->dbh; |
128 |
my $query = q{ |
128 |
my $query = q{ |
129 |
SELECT opac_news.*,branches.branchname |
129 |
SELECT opac_news.*,branches.branchname, |
|
|
130 |
timestamp AS newdate, |
131 |
borrowers.title AS author_title, |
132 |
borrowers.firstname AS author_firstname, |
133 |
borrowers.surname AS author_surname |
130 |
FROM opac_news LEFT JOIN branches |
134 |
FROM opac_news LEFT JOIN branches |
131 |
ON opac_news.branchcode=branches.branchcode |
135 |
ON opac_news.branchcode=branches.branchcode |
|
|
136 |
LEFT JOIN borrowers on borrowers.borrowernumber = opac_news.borrowernumber |
132 |
WHERE opac_news.idnew = ?; |
137 |
WHERE opac_news.idnew = ?; |
133 |
}; |
138 |
}; |
134 |
my $sth = $dbh->prepare($query); |
139 |
my $sth = $dbh->prepare($query); |
135 |
$sth->execute($idnew); |
140 |
$sth->execute($idnew); |
136 |
my $data = $sth->fetchrow_hashref; |
141 |
my $data = $sth->fetchrow_hashref; |
137 |
$data->{$data->{'lang'}} = 1 if defined $data->{lang}; |
142 |
$data->{$data->{'lang'}} = 1 if defined $data->{lang}; |
|
|
143 |
$data->{newdate} = output_pref({ dt => dt_from_string( $data->{newdate} ), dateonly => 1 }); |
138 |
$data->{expirationdate} = output_pref({ dt => dt_from_string( $data->{expirationdate} ), dateonly => 1 }); |
144 |
$data->{expirationdate} = output_pref({ dt => dt_from_string( $data->{expirationdate} ), dateonly => 1 }); |
139 |
$data->{timestamp} = output_pref({ dt => dt_from_string( $data->{timestamp} ), dateonly => 1 }) ; |
145 |
$data->{timestamp} = output_pref({ dt => dt_from_string( $data->{timestamp} ), dateonly => 1 }) ; |
140 |
return $data; |
146 |
return $data; |
141 |
- |
|
|