From 9b55c17d37e70f784a6890b23a26234216251eb8 Mon Sep 17 00:00:00 2001 From: titima15 Date: Tue, 17 Sep 2024 14:35:44 -0400 Subject: [PATCH] display prefix --- lib/SGN/Controller/BreedersToolbox/Trial.pm | 11 +++++++++++ mason/page/detail_page_2_col_section.mas | 3 ++- mason/transformation/transformation_project.mas | 3 ++- mason/transformation/transformation_project_details.mas | 14 ++++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/lib/SGN/Controller/BreedersToolbox/Trial.pm b/lib/SGN/Controller/BreedersToolbox/Trial.pm index 2895392999..d251b7bd6b 100644 --- a/lib/SGN/Controller/BreedersToolbox/Trial.pm +++ b/lib/SGN/Controller/BreedersToolbox/Trial.pm @@ -373,6 +373,17 @@ sub trial_info : Chained('trial_init') PathPart('') Args(0) { $c->stash->{autogenerated_name_prefixes} = \@prefixes; } + my $name_prefix_cvterm_id = SGN::Model::Cvterm->get_cvterm_row($schema, 'autogenerated_name_prefix', 'project_property')->cvterm_id(); + my $name_prefix_rs = $schema->resultset("Project::Projectprop")->find ({ + project_id => $transformation_project_id, + type_id => $name_prefix_cvterm_id + }); + + if($name_prefix_rs) { + my $prefix = $name_prefix_rs->value; + $c->stash->{prefix} = $prefix; + } + $c->stash->{template} = '/transformation/transformation_project.mas'; } else { diff --git a/mason/page/detail_page_2_col_section.mas b/mason/page/detail_page_2_col_section.mas index b63457b629..4321054bb6 100644 --- a/mason/page/detail_page_2_col_section.mas +++ b/mason/page/detail_page_2_col_section.mas @@ -140,6 +140,7 @@ $analytics_protocol_result_summary => {} #specific to transformation project page $tracking_project_id => undef $autogenerated_name_prefixes => () +$prefix => undef #Specific to activity page $vendor_id => undef @@ -595,7 +596,7 @@ $field_headers => () % if ($info_section_id eq 'transformation_project_details'){ - <& /transformation/transformation_project_details.mas, trial_id=>$trial_id, trial_name=>$trial_name, breeding_program_name=>$breeding_program_name, breeding_program_id=>$breeding_program_id, location_name=>$location_name, country_name=>$country_name, year=>$year, trial_description=>$trial_description, folder_name=>$folder_name, folder_id=>$folder_id, identifier_prefix=>$identifier_prefix, trial_owner => $trial_owner, tracking_project_id => $tracking_project_id, autogenerated_name_prefixes => $autogenerated_name_prefixes &> + <& /transformation/transformation_project_details.mas, trial_id=>$trial_id, trial_name=>$trial_name, breeding_program_name=>$breeding_program_name, breeding_program_id=>$breeding_program_id, location_name=>$location_name, country_name=>$country_name, year=>$year, trial_description=>$trial_description, folder_name=>$folder_name, folder_id=>$folder_id, identifier_prefix=>$identifier_prefix, trial_owner => $trial_owner, tracking_project_id => $tracking_project_id, autogenerated_name_prefixes => $autogenerated_name_prefixes, prefix => $prefix &> % } #End transformation_project_details % if ($info_section_id eq 'transformations_in_project_section'){ <& /transformation/transformations_in_project.mas, trial_id=>$trial_id &> diff --git a/mason/transformation/transformation_project.mas b/mason/transformation/transformation_project.mas index 0a208c66f9..85b268dcde 100644 --- a/mason/transformation/transformation_project.mas +++ b/mason/transformation/transformation_project.mas @@ -28,6 +28,7 @@ $locations_by_program_json $trial_owner => undef $tracking_project_id => undef $autogenerated_name_prefixes => () +$prefix => undef @@ -38,7 +39,7 @@ $autogenerated_name_prefixes => () <& /page/page_title.mas, title=>"Details for ".$trial_name &> -<& /page/detail_page_2_col_section.mas, info_section_collapsed => 0, trial_id => $trial_id, info_section_title => "

Transformation Project Details

", info_section_subtitle => 'View and edit basic information about the project.', buttons_html => '', icon_class => "glyphicon glyphicon-dashboard", info_section_id => "transformation_project_details", trial_name => $trial_name, breeding_program_name => $breeding_program_name, breeding_program_id => $breeding_program_id, location_name => $location_name, country_name => $country_name, year => $year, trial_description => $trial_description, folder_name => $folder_name, folder_id => $folder_id, trial_owner => $trial_owner, tracking_project_id => $tracking_project_id, autogenerated_name_prefixes => $autogenerated_name_prefixes &> +<& /page/detail_page_2_col_section.mas, info_section_collapsed => 0, trial_id => $trial_id, info_section_title => "

Transformation Project Details

", info_section_subtitle => 'View and edit basic information about the project.', buttons_html => '', icon_class => "glyphicon glyphicon-dashboard", info_section_id => "transformation_project_details", trial_name => $trial_name, breeding_program_name => $breeding_program_name, breeding_program_id => $breeding_program_id, location_name => $location_name, country_name => $country_name, year => $year, trial_description => $trial_description, folder_name => $folder_name, folder_id => $folder_id, trial_owner => $trial_owner, tracking_project_id => $tracking_project_id, autogenerated_name_prefixes => $autogenerated_name_prefixes, prefix => $prefix &> <& /page/detail_page_2_col_section.mas, info_section_collapsed => 0, trial_id => $trial_id, info_section_title => "

Active Transformation IDs

", info_section_subtitle => 'View information about ongoing transformation ids in this project.', icon_class => "glyphicon glyphicon-list-alt", info_section_id => "transformations_in_project_section" &> <& /page/detail_page_2_col_section.mas, info_section_collapsed => 0, trial_id => $trial_id, info_section_title => "

Inactive Transformation IDs

", info_section_subtitle => 'View information about completed or terminated transformation ids in this project.', icon_class => "glyphicon glyphicon-ban-circle", info_section_id => "inactive_transformation_ids_in_project_section" &> diff --git a/mason/transformation/transformation_project_details.mas b/mason/transformation/transformation_project_details.mas index a2552ef889..fd9fa14fdc 100644 --- a/mason/transformation/transformation_project_details.mas +++ b/mason/transformation/transformation_project_details.mas @@ -13,6 +13,7 @@ $identifier_prefix $trial_owner $tracking_project_id $autogenerated_name_prefixes => () +$prefix @@ -86,6 +87,19 @@ $autogenerated_name_prefixes => () + Prefix for Transformants + +
+% if ($prefix) { +% print "$prefix"; +% } else { +% print "[No Prefix]"; +% } +
+ + + + Folder -- 2.11.4.GIT