|
Lines 51-57
sub add_opac_new {
Link Here
|
| 51 |
my $dbh = C4::Context->dbh; |
51 |
my $dbh = C4::Context->dbh; |
| 52 |
my $sth = $dbh->prepare("INSERT INTO opac_news (title, new, lang, expirationdate, timestamp, number) VALUES (?,?,?,?,?,?)"); |
52 |
my $sth = $dbh->prepare("INSERT INTO opac_news (title, new, lang, expirationdate, timestamp, number) VALUES (?,?,?,?,?,?)"); |
| 53 |
$sth->execute($title, $new, $lang, $expirationdate, $timestamp, $number); |
53 |
$sth->execute($title, $new, $lang, $expirationdate, $timestamp, $number); |
| 54 |
$sth->finish; |
|
|
| 55 |
return 1; |
54 |
return 1; |
| 56 |
} |
55 |
} |
| 57 |
|
56 |
|
|
Lines 69-75
sub upd_opac_new {
Link Here
|
| 69 |
WHERE idnew = ? |
68 |
WHERE idnew = ? |
| 70 |
"); |
69 |
"); |
| 71 |
$sth->execute($title, $new, $lang, $expirationdate, $timestamp,$number,$idnew); |
70 |
$sth->execute($title, $new, $lang, $expirationdate, $timestamp,$number,$idnew); |
| 72 |
$sth->finish; |
|
|
| 73 |
return 1; |
71 |
return 1; |
| 74 |
} |
72 |
} |
| 75 |
|
73 |
|
|
Lines 79-85
sub del_opac_new {
Link Here
|
| 79 |
my $dbh = C4::Context->dbh; |
77 |
my $dbh = C4::Context->dbh; |
| 80 |
my $sth = $dbh->prepare("DELETE FROM opac_news WHERE idnew IN ($ids)"); |
78 |
my $sth = $dbh->prepare("DELETE FROM opac_news WHERE idnew IN ($ids)"); |
| 81 |
$sth->execute(); |
79 |
$sth->execute(); |
| 82 |
$sth->finish; |
|
|
| 83 |
return 1; |
80 |
return 1; |
| 84 |
} else { |
81 |
} else { |
| 85 |
return 0; |
82 |
return 0; |
|
Lines 95-101
sub get_opac_new {
Link Here
|
| 95 |
$data->{$data->{'lang'}} = 1 if defined $data->{lang}; |
92 |
$data->{$data->{'lang'}} = 1 if defined $data->{lang}; |
| 96 |
$data->{expirationdate} = format_date($data->{expirationdate}); |
93 |
$data->{expirationdate} = format_date($data->{expirationdate}); |
| 97 |
$data->{timestamp} = format_date($data->{timestamp}); |
94 |
$data->{timestamp} = format_date($data->{timestamp}); |
| 98 |
$sth->finish; |
|
|
| 99 |
return $data; |
95 |
return $data; |
| 100 |
} |
96 |
} |
| 101 |
|
97 |
|
| 102 |
- |
|
|