9 use CXGN
::Phenome
::Locus
;
11 use CatalystX
::GlobalContext
qw( $c );
13 my $dbh = $c->dbc->dbh;
15 my $page=CXGN::Page->new("claim_locus_ownership.pl","Naama");
16 my %args=$page->get_all_encoded_arguments();
17 my $locus_id=$args{locus_id};
18 my $locus=CXGN::Phenome::Locus->new($dbh, $locus_id);
19 my $sp_person_id = CXGN::Login->new($dbh)->verify_session();
21 my @owners= $locus->get_owners();
23 my $user = CXGN::People::Person -> new($dbh, $sp_person_id);
24 if ((grep { $_ =~ /^$sp_person_id$/ } @owners) ) {
28 <h3>You are already the owner of the locus.<br>
29 Next time you can click on the 'login' link in the top right corner of every SGN page.<br><br>
30 <a href="/locus/$locus_id/view">Go back</a> to the locus page.</h3>
37 my $username=$user->get_first_name()." ".$user->get_last_name();
38 my $usermail=$user->get_private_email();
39 my $replyto= 'sgn-feedback@sgn.cornell.edu';
42 my $subject="[Locus ownership] Request editor privileges for locus $locus_id";
43 my $fdbk_body="$username has requested to obtain ownership for locus $locus_id\nsp_person_id = $sp_person_id, $usermail";
46 my $user_body= "Dear $username,\n\nYour request for obtaining editor privileges for SGN locus ID $locus_id will be processed shortly.\nA confirmation email will be sent to you once the request is confirmed. After that you should be able now to edit this locus' details.\n\n Thank you for using SGN!\nhttp://www.sgn.cornell.edu/";
52 if ($args{action
} eq 'confirm') {
53 confirm_dialog
($locus_id);
55 elsif ($args{action
} eq 'request') {
59 Your request for edit permissions on locus id: $locus_id<br />
60 has been sent to the SGN development team.<br /><br />
61 A reply will be sent to you shortly.<br /><br />
63 <a href="locus_display.pl?locus_id=$locus_id">Go back</a> to the locus page.
67 CXGN::Contact::send_email($subject,$fdbk_body, 'sgn-db-curation@sgn.cornell.edu');
68 CXGN::Contact::send_email($subject,$user_body, $usermail, $replyto);
79 my $back_link = qq| <a href="locus_display.pl?locus_id=$locus_id">Go back</a> to the locus page without requesting edit privileges|;
84 Request edit privileges for locus id: $locus_id?
85 <input type="hidden" name="action" value="request" />
86 <input type="hidden" name="locus_id" value="$locus_id" />
87 <input type="submit" value="Sumbit request" />