bug fix. Now it tests correctly if either of the tests evaluate to false or not
[sgn.git] / cgi-bin / phenome / qtl_form.pl
blobea07bd66cbcb33aaea49b04306e572580b622367
2 =head1 DESCRIPTION
3 creates all the web forms for the qtl data submission
4 and sends the data to qtl_load.pl for processing
5 and loading it to the database.
7 =head1 AUTHOR
8 Isaak Y Tecle (iyt2@cornell.edu)
10 =cut
12 use strict;
13 use warnings;
15 use CXGN::Login;
17 use CatalystX::GlobalContext qw( $c );
19 my $dbh = $c->dbc->dbh;
20 my $login = CXGN::Login->new($dbh);
21 my $sp_person_id = $login->verify_session();
22 my $cgi = CGI->new();
23 my %args = $cgi->Vars;
24 my $type = $args{type};
25 my $pop_id = $args{pop_id};
27 if ($sp_person_id)
29 my $guide
30 = qq | <a href="http://docs.google.com/View?id=dgvczrcd_1c479cgfb">Guidelines</a> |;
32 if ( !$type )
34 $c->forward_to_mason_view( '/qtl/qtl_form/intro.mas',
35 pop_id => $pop_id,
36 guide => $guide
39 elsif ( $type eq 'pop_form' )
41 $c->forward_to_mason_view( '/qtl/qtl_form/pop_form.mas',
42 guide => $guide );
45 elsif ( $type eq 'trait_form' )
47 $c->forward_to_mason_view( '/qtl/qtl_form/trait_form.mas',
48 pop_id => $pop_id,
49 guide => $guide
53 elsif ( $type eq 'pheno_form' )
55 $c->forward_to_mason_view( '/qtl/qtl_form/pheno_form.mas',
56 pop_id => $pop_id,
57 guide => $guide
62 elsif ( $type eq 'geno_form' )
64 $c->forward_to_mason_view( '/qtl/qtl_form/geno_form.mas',
65 pop_id => $pop_id,
66 guide => $guide
71 elsif ( $type eq 'stat_form' )
73 $c->forward_to_mason_view( '/qtl/qtl_form/stat_form.mas',
74 pop_id => $pop_id,
75 guide => $guide,
76 referer=> $c->req->path
81 elsif ( $type eq 'confirm' )
83 $c->forward_to_mason_view( '/qtl/qtl_form/confirm.mas',
84 pop_id => $pop_id,
85 guide => $guide