/[koha]/koha/C4/Suggestions.pm
ViewVC logotype

Diff of /koha/C4/Suggestions.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4.2.2 by hdl, Fri Aug 26 12:21:49 2005 UTC revision 1.4.2.3 by tipaul, Thu Dec 1 17:27:55 2005 UTC
# Line 64  Suggestions done by other can be seen wh Line 64  Suggestions done by other can be seen wh
64                                  &delsuggestion                                  &delsuggestion
65                                  &countsuggestion                                  &countsuggestion
66                                  &changestatus                                  &changestatus
67                                    &findsuggestion_from_biblionumber
68                          );                          );
69    
70  =item SearchSuggestion  =item SearchSuggestion
# Line 191  sub countsuggestion { Line 192  sub countsuggestion {
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.
# Line 232  sendmail(%mail); Line 243  sendmail(%mail);
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

Legend:
Removed from v.1.4.2.2  
changed lines
  Added in v.1.4.2.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26