64 |
&delsuggestion |
&delsuggestion |
65 |
&countsuggestion |
&countsuggestion |
66 |
&changestatus |
&changestatus |
67 |
|
&findsuggestion_from_biblionumber |
68 |
); |
); |
69 |
|
|
70 |
=item SearchSuggestion |
=item SearchSuggestion |
192 |
} |
} |
193 |
|
|
194 |
sub changestatus { |
sub changestatus { |
195 |
my ($suggestionid,$status,$managedby) = @_; |
my ($suggestionid,$status,$managedby,$biblionumber) = @_; |
196 |
my $dbh = C4::Context->dbh; |
my $dbh = C4::Context->dbh; |
197 |
my $sth; |
my $sth; |
198 |
if ($managedby>0) { |
if ($managedby>0) { |
199 |
$sth = $dbh->prepare("update suggestions set status=?,managedby=? where suggestionid=?"); |
if ($biblionumber) { |
200 |
$sth->execute($status,$managedby,$suggestionid); |
$sth = $dbh->prepare("update suggestions set status=?,managedby=?,biblionumber=? where suggestionid=?"); |
201 |
|
$sth->execute($status,$managedby,$biblionumber,$suggestionid); |
202 |
|
} else { |
203 |
|
$sth = $dbh->prepare("update suggestions set status=?,managedby=? where suggestionid=?"); |
204 |
|
$sth->execute($status,$managedby,$suggestionid); |
205 |
|
} |
206 |
} else { |
} else { |
207 |
$sth = $dbh->prepare("update suggestions set status=? where suggestionid=?"); |
if ($biblionumber) { |
208 |
$sth->execute($status,$suggestionid); |
$sth = $dbh->prepare("update suggestions set status=?,biblionumber=? where suggestionid=?"); |
209 |
|
$sth->execute($status,$biblionumber,$suggestionid); |
210 |
|
} else { |
211 |
|
$sth = $dbh->prepare("update suggestions set status=? where suggestionid=?"); |
212 |
|
$sth->execute($status,$suggestionid); |
213 |
|
} |
214 |
|
|
215 |
} |
} |
216 |
# check mail sending. |
# check mail sending. |
243 |
# warn "sending email to $emailinfo->{byemail} from $emailinfo->{libemail} to notice new status $emailinfo->{status} for $emailinfo->{title} / $emailinfo->{author}"; |
# warn "sending email to $emailinfo->{byemail} from $emailinfo->{libemail} to notice new status $emailinfo->{status} for $emailinfo->{title} / $emailinfo->{author}"; |
244 |
} |
} |
245 |
|
|
246 |
|
sub findsuggestion_from_biblionumber { |
247 |
|
my ($dbh,$biblionumber) = @_; |
248 |
|
my $sth = $dbh->prepare("select suggestionid from suggestions where biblionumber=?"); |
249 |
|
$sth->execute($biblionumber); |
250 |
|
my ($biblionumber) = $sth->fetchrow; |
251 |
|
return $biblionumber; |
252 |
|
} |
253 |
|
|
254 |
=back |
=back |
255 |
|
|
256 |
=head1 SEE ALSO |
=head1 SEE ALSO |