Merge pull request #5243 from solgenomics/topic/observations_upload_catch_error
[sgn.git] / lib / SGN / Controller / BreedersToolbox / GraphicalFiltering.pm
blobe3f79dae29632e47186228fca97dae28cbed65ff
1 use strict;
3 package SGN::Controller::BreedersToolbox::GraphicalFiltering;
5 use Moose;
6 use URI::FromHash 'uri';
7 use Data::Dumper;
8 our $VERSION = '0.01';
10 BEGIN { extends 'Catalyst::Controller'; }
12 sub graphical_filtering :Path('/tools/graphicalfiltering') {
13 my $self =shift;
14 my $c = shift;
15 if (! $c->user) {
16 $c->res->redirect(uri( path => '/user/login', query => { goto_url => $c->req->uri->path_query } ) );
17 return;
19 my $trial_list_id = $c->request->param('trial_list_id');
20 my $plot_list_id = $c->request->param('plot_list_id');
21 my $trial_ids = $c->request->parameters->{'trial_id'};
22 my $ajaxRequestString = "";
24 if (defined $trial_list_id){
25 $ajaxRequestString = "/ajax/plot/common_traits_by/trial_list?trial_list_id=".$trial_list_id;
27 elsif (defined $plot_list_id){
28 $ajaxRequestString = "/ajax/plot/common_traits_by/plot_list?plot_list_id=".$plot_list_id;
30 elsif (defined $trial_ids){
31 $ajaxRequestString = "/ajax/plot/common_traits_by/trials?";
32 foreach my $trial_id (@$trial_ids){
33 $ajaxRequestString .= "trial_id=".$trial_id."&";
36 print STDERR $ajaxRequestString;
37 $c->stash->{ajaxRequestString} = $ajaxRequestString;
39 $c->stash->{template} = '/tools/graphicalfiltering/index.mas';