1 package SGN
::Controller
::KinaseClones
;
4 use namespace
::autoclean
;
7 BEGIN { extends
'Catalyst::Controller' }
11 SGN::Controller::KinaseClones - controller to request kinase clones
16 sub form
:Path
('/kinases/clones/form') :Args
(0) {
19 $c->stash->{contact_form_human_question
} = $c->config->{contact_form_human_question
};
20 $c->stash->{contact_form_human_answer_correct
} = 1; # do not show warning on initial screen
21 $c->stash->{template
} = '/kinases/clones/order.mas';
25 sub submit
:Path
('/kinases/clones/submit') :Args
(0) {
27 my ($name, $email, $body, $address, $organization, $contact_form_human_answer) = map { $c->request->param($_) } qw
/name email body address organization contact_form_human_answer /;
29 if ($contact_form_human_answer eq $c->config->{contact_form_human_answer
} and $name and $email and $address and $organization and $body || $ENV{SGN_TEST_MODE
}) {
31 my $host = $c->request->hostname();
32 my $client_ip = $c->request->address();
34 $body = <<END_HEREDOC;
36 This message was sent from SGN TOKN Clones Request form
53 # add the client IP address so we can block abusers
56 $c->stash->{email} = {
57 to => $c->config->{tokn_email},
58 from => $c->config->{tokn_email},
59 subject => "TOKN Clone Request via SGN",
63 $c->forward('View::Email');
65 $c->stash->{message} = "Thank you. Your message has been sent.";
66 $c->stash->{template} = "/generic_message.mas";
73 subject => "TOKN Clone Request via SGN",
74 organization => $organization,
77 foreach my $category (keys %info_fields) {
78 $c->stash->{filled}->{$category} = $info_fields{$category};
81 $c->stash->{name} = $name;
82 $c->stash->{email} = $email;
83 $c->stash->{address} = $address;
84 $c->stash->{subject} = "TOKN Clone Request via SGN";
85 $c->stash->{organization} = $organization;
86 $c->stash->{body} = $body;
87 $c->stash->{contact_form_human_question} = $c->config->{contact_form_human_question};
88 $c->stash->{contact_form_human_answer} = $contact_form_human_answer;
89 $c->stash->{template} = '/kinases/clones/order.mas';
91 #_build_form_page($self, $c, $name, $email, $c->config->{contact_form_human_question}, $contact_form_human_answer, 0, $subject, $body);
95 __PACKAGE__->meta->make_immutable;