Merge pull request #5243 from solgenomics/topic/observations_upload_catch_error
[sgn.git] / cgi-bin / chado / cvterm.pl
blob6cf0796e2be7f67330f56a4f066d34c1f1eea38b
1 use strict;
2 use warnings;
3 use CGI qw /param/;
4 use CXGN::Chado::Cvterm;
6 # Displays a static cvterm detail page.
8 use CatalystX::GlobalContext qw( $c );
11 my $q = CGI->new();
12 my $dbh = CXGN::DB::Connection->new();
14 my $cvterm_id = $q->param("cvterm_id") + 0;
15 my $cvterm_accession = $q->param("cvterm_name");
16 my $cvterm;
18 if ( $cvterm_accession ) {
19 $cvterm = CXGN::Chado::Cvterm->new_with_accession( $dbh, $cvterm_accession);
20 $cvterm_id = $cvterm->get_cvterm_id();
21 } elsif ( $cvterm_id ) {
22 $cvterm = CXGN::Chado::Cvterm->new( $dbh, $cvterm_id );
25 unless ( $cvterm_id && $cvterm_id =~ m /^\d+$/ ) {
26 $c->throw( is_client_error => 1, public_message => 'Invalid arguments' );
31 $c->forward_to_mason_view(
32 '/chado/cvterm.mas',
33 cvterm => $cvterm,