cv for average = 0
[sgn.git] / cgi-bin / phenome / associate_registry.pl
blob414acbc9504a389f0c648a36dfc994d8362865ca
1 use strict;
2 use warnings;
4 use CXGN::Scrap::AjaxPage;
5 use CXGN::DB::Connection;
6 use CXGN::Login;
7 use CXGN::Feed;
9 my $dbh = CXGN::DB::Connection->new();
10 my($login_person_id,$login_user_type)=CXGN::Login->new($dbh)->verify_session();
12 if ($login_user_type eq 'curator' || $login_user_type eq 'submitter') {
15 my $doc = CXGN::Scrap::AjaxPage->new();
16 my ($locus_id, $registry_id, $sp_person_id) = $doc->get_encoded_arguments("locus_id", "registry_id", "sp_person_id");
18 eval {
19 my $registry_query = $dbh->prepare("INSERT INTO phenome.locus_registry (locus_id, registry_id, sp_person_id) VALUES (?, ?, ?)");
21 $registry_query->execute($locus_id, $registry_id, $sp_person_id);
23 if ($@) { warn "locus-registry association failed!"; }
24 else {
26 my $subject="[New registry associated] locus $locus_id";
27 my $fdbk_body="user $login_person_id has associated registry $registry_id with locus $locus_id \n ";
28 CXGN::Contact::send_email($subject,$fdbk_body, 'sgn-db-curation@sgn.cornell.edu');
29 CXGN::Feed::update_feed($subject,$fdbk_body);