4 use CXGN
::Scrap
::AjaxPage
;
5 use CXGN
::DB
::Connection
;
7 use CXGN
::People
::Person
;
8 use CXGN
::Chado
::Publication
;
12 my $dbh = CXGN
::DB
::Connection
->new();
13 my($login_person_id,$login_user_type)=CXGN
::Login
->new($dbh)->verify_session();
15 if ($login_user_type eq 'curator' || $login_user_type eq 'submitter' || $login_user_type eq 'sequencer') {
18 my $doc = CXGN
::Scrap
::AjaxPage
->new();
19 my ($pub_id, $stat, $curator_id, $action) = $doc->get_encoded_arguments("pub_id", "stat", "curator_id", "action");
20 my $pub=CXGN
::Chado
::Publication
->new($dbh, $pub_id);
23 my $json = JSON
->new();
25 if ($action eq 'assign_curator') {
26 $error{"error"} = "Storing pub_curator works!";
28 $pub->set_curator_id($curator_id);
29 $pub->store_pub_curator();
35 my $jobj = $json->objToJson(\
%error);
36 print STDERR
"JSON FORMAT: $jobj\n";
38 print "Content-Type: text/plain\n\n";
41 #Change the pub_curator status
42 } elsif ($action eq 'change_stat') {
43 $error{"error"} = "Updating pub_curator status to $stat!";
46 $pub->set_status($stat);
47 $pub->set_curated_by($login_person_id);
48 $pub->store_pub_curator();
53 warn "pub_curator update failed! (pub_id= $pub_id, status=$stat, assigned_curator=$curator_id, login_person_id=$login_person_id)"; }
56 #my $subject="[New pub_curator info stored] pub $pub_id";
57 #my $username= $self->get_user()->get_first_name()." ".$self->get_user()->get_last_name();
58 #my $fdbk_body="user $login_person_id has updated pub_curator status =$stat. \n ";
59 #CXGN::Contact::send_email($subject,$fdbk_body, 'sgn-db-curation@sgn.cornell.edu');
60 #CXGN::Feed::update_feed($subject,$fdbk_body);
62 my $jobj = $json->objToJson(\
%error);
63 print STDERR
"JSON FORMAT: $jobj\n";
65 print "Content-Type: text/plain\n\n";