3 #This page now points to the url /solpeople/profile/<sp_person_id> in the controller SGN::Controller::People
8 use CXGN
::DB
::Connection
;
12 use CXGN
::People
::Person
;
14 use CXGN
::Phenome
::Locus
;
15 use CXGN
::Cview
::MapFactory
;
16 use CXGN
::Page
::FormattingHelpers qw
/info_section_html page_title_html
17 info_table_html simple_selectbox_html
18 html_optional_show columnar_table_html
/;
21 use CatalystX
::GlobalContext
qw($c);
24 my $page = CXGN::Page->new( "solpeople main menu", "john" );
25 my $dbh = CXGN::DB::Connection->new();
26 my $site_name = $c->config->{project_name};
28 my $sp_person_id = CXGN::Login->new($dbh)->verify_session();
30 my $sp = CXGN::People::Person->new( $dbh, $sp_person_id );
31 unless ($sp_person_id) {
32 $page->error_page( "Login ID not found.",
33 "", "", "Login ID not found: $sp_person_id" );
35 unless ( $sp->get_username() ) {
36 $page->error_page( "Username not found.",
37 "", "", "Username not found for sp_person_id '$sp_person_id'" );
39 my $username = $sp->get_first_name() . " " . $sp->get_last_name();
41 #my $research_update=$sp->get_research_update();
42 #my $contact_update=$sp->get_contact_update();
44 $page->add_style( text => <<EOS);
47 margin: 0px 0px 0px 0px;
55 <script type = "text/javascript">
57 function toggleLayer(whichLayer) {
58 if (document.getElementById) {
59 var style2 = document.getElementById(whichLayer).style;
60 style2.display = style2.display? "":"block";
62 else if (document.all) {
63 var style2 = document.all[whichLayer].style;
64 style2.display = style2.display? "":"block";
66 else if (document.layers) {
67 var style2 = document.layers[whichLayer].style;
68 style2.display = style2.display? "":"block";
71 function showSequence(sequence) {
72 document.getElementById("Heading").innerHTML="<strong>Full sequence: </strong>";
73 document.getElementById("fullSequence").innerHTML=sequence;
75 function hideSequence() {
76 document.getElementById("Heading").innerHTML="";
77 document.getElementById("fullSequence").innerHTML="";
83 print page_title_html("My $site_name");
84 print qq|<div align="center">Welcome <b>$username</b></div>\n|;
86 qq|<div align="right" style="margin-bottom: 0.5em">Not $username? <a href="login.pl?logout=yes">[log out]</a></div>\n|;
87 print info_section_html( title => 'General Tools', contents => <<EOHTML);
88 <a href="personal-info.pl?action=edit&sp_person_id=$sp_person_id">View or update personal (contact and research) information</a><br />
89 <a href="change-account.pl?action=edit&sp_person_id=$sp_person_id">Update account information</a><br />
90 <a href="/forum/topics.pl">Post to SGN forum</a><br />
94 # qq|<div id="queryTable">|
95 # . CXGN::BlastWatch::get_queries( $dbh, $sp_person_id )
97 # print info_section_html( title => 'BLAST Watch', contents => <<EOHTML);
98 # <div style="margin-bottom: 1em">BLAST Watch is an SGN service that lets users submit recurring BLAST queries to SGN. Our software repeats your BLAST search every week and notifies you by email if the BLAST results change.</div>
99 # <a href="/tools/blast/watch/index.pl">Submit a query to SGN BLAST Watch</a><br />
100 # <a href="javascript:toggleLayer('queryTable');" title="View your BLAST Watch queries">View your BLAST Watch queries</a>
104 #return 1 if the first term is eq to one of the other terms given
107 ( grep { $t eq $_ } @_ ) ?
1 : 0;
110 #now assemble the sequencing tools stuff
111 if ( in( $sp->get_user_type, qw
/curator sequencer/ ) ) {
113 #make a form for uploading TPF and AGP files
114 my $tpf_agp_upload = do {
115 if ( $sp->get_user_type eq 'curator' ) {
116 tpf_agp_upload_forms
(<<EOHTML);
117 <!-- the string 'TYPE' will be replaced in each instance by tpf_agp_upload_forms() -->
118 <label for="chrnuminputTYPE">For Chromosome #: </label><input id="chrnuminputTYPE" name="chr" type="text" size="2" maxlength="2" />
121 elsif ( $sp->get_user_type eq 'sequencer'
123 grep { $_ >= 1 && $_ <= 12 }
124 $sp->get_projects_associated_with_person )
128 ? simple_selectbox_html
(
130 choices
=> \
@projects,
131 label
=> 'For Chromosome #:',
133 : qq|For Chromosome
#: <b>$projects[0]</b> <input type="hidden" value="$projects[0]" name="chr" />|;
134 tpf_agp_upload_forms
($chrinput);
138 print info_section_html
( title
=> 'Sequencer Tools', contents
=> <<EOHTML);
139 <a href="attribute_bacs.pl">Attribute a BAC to your chromosome sequencing project</a><br />
140 <a href="/maps/physical/clone_il_view.pl">View/update BAC IL mapping information (list view)</a><br />
141 <div style="vertical-align: middle; font-weight: bold"><a href="/maps/physical/clone_reg.pl">View/update all BAC registry info (list view) <img style="border: none" src="/documents/img/new.gif" /></a></div>
142 <a href="/sequencing/tpf.pl">View TPF Files</a><br />
143 <a href="/sequencing/agp.pl">View AGP Files</a><br />
148 # if( in( $sp->get_user_type(), qw/submitter curator/ ) )
150 # print info_section_html(title => 'EST Submission Pages', contents => <<EOHTML);
151 # <a href="/data-submit/top-level.pl">Data submission start page</a>
155 if ( in( $sp->get_user_type(), qw
/submitter curator/ ) ) {
156 print info_section_html
( title
=> 'QTL data submission',
157 contents
=> <<EOHTML);
158 <a href="/phenome/qtl_form.pl">Upload and analyse your QTL data</a>
162 my @pops = CXGN
::Phenome
::Population
->my_populations($sp_person_id);
165 my $pop_list = my_populations
(@pops);
166 print info_section_html
( title
=> 'Populations', contents
=> $pop_list );
169 #### solGS submitted jobs list ##########
170 my $solgs_jobs = SGN
::Controller
::solGS
::AnalysisQueue
->solgs_analysis_status_log($c);
172 my $solgs_jobs_table;
175 $solgs_jobs_table = columnar_table_html
(
176 headings
=> [ 'Analysis name', 'Submitted on', 'Status', 'Result page'],
182 $solgs_jobs_table = 'You have no submitted jobs.'
185 print info_section_html
(
186 title
=> 'solGS submitted analysis jobs',
187 contents
=> $solgs_jobs_table
193 if ( $sp->get_user_type() eq 'curator' ) {
194 print info_section_html
( title
=> 'Curator Tools', contents
=> <<EOHTML);
195 <a href="/solpeople/admin/crash_test.pl">Test website error handling</a><br />
196 <a href="/solpeople/admin/stats.pl">View user stats</a><br />
197 <a href="/solpeople/admin/quick_create_account.pl">Create new user account</a><br />
198 <a href="/solpeople/admin/create_organization.pl">Create new organization</a>
202 if ( $sp->get_user_type() =~ /curator/i ) {
204 qq| <a href
= "/search/pub_search.pl">Search the SGN publication database
</a><br />|;
206 qq| <a href
= "/search/pub_search.pl?w9b3_assigned_to=$sp_person_id">See your assigned publications
</a><br />|;
208 qq| <a href
= "/search/pub_search.pl?w9b3_status=pending">See publications pending curation
</a><br />|;
210 qq| <a href
= "/chado/fetch_pubmed.pl">Load new publications from PubMed
</a><br />|;
212 print info_section_html
(
213 title
=> 'Literature mining',
214 contents
=> $publications
218 if ( $sp->get_user_type() =~ /submitter|curator|sequencer/i ) {
221 CXGN
::Phenome
::Locus
::get_locus_ids_by_editor
( $dbh, $sp_person_id );
230 my $locus_editor_info = qq { None
.<br
/> };
232 $locus_editor_info = "";
235 for ( my $i = 0 ; $i < ($max) ; $i++ ) {
236 my $locus = CXGN
::Phenome
::Locus
->new( $dbh, $loci[$i] );
237 my $symbol = $locus->get_locus_symbol();
238 my $locus_id = $locus->get_locus_id();
240 $locus_editor_info .=
241 qq { <a href
="/phenome/locus_display.pl?locus_id=$locus_id&action=view">$symbol</a
> };
244 $locus_editor_info .=
245 qq|<br
><b
>and <a href
="/search/locus/>$more more</a></b><br />|;
248 print info_section_html(
249 title => 'Loci with Editor Privileges',
250 contents => $locus_editor_info
254 CXGN::Phenome::Locus::get_locus_ids_by_annotator( $dbh, $sp_person_id );
257 my $max = @annotated_loci;
258 if ( @annotated_loci > 24 ) {
259 $more = @annotated_loci - 24;
263 my ( $locus_annotations, $more_annotations );
265 for ( my $i = 0 ; $i < $top ; $i++ ) {
266 my $locus = CXGN::Phenome::Locus->new( $dbh, $annotated_loci[$i] );
267 my $symbol = $locus->get_locus_symbol();
268 my $locus_id = $locus->get_locus_id();
271 $locus_annotations .=
272 qq | <a href="/locus/$locus_id/view">$symbol</a> |;
276 qq { <a href
="/locus/$locus_id/view">$symbol</a
> };
281 $locus_annotations .= " and $more more, not shown.<br />";
283 $locus_annotations .=
284 html_optional_show
( 'locus_annotations', 'Show more',
285 qq|<div
class="minorbox">$more_annotations</div
> |,
289 $locus_annotations .=
290 qq| <a href
="../phenome/recent_annotated_loci.pl">[View annotated loci by date
]</a
> |;
291 print info_section_html
(
292 title
=> 'Annotated Loci',
293 contents
=> $locus_annotations
296 my $map_factory = CXGN
::Cview
::MapFactory
->new($dbh);
297 my @user_maps = $map_factory->get_user_maps();
300 if ( @user_maps > 0 ) {
302 "<table alt=\"\" ><tr><td><i>Name</i></td><td></td><td></td><td><i>status</i></td></tr>";
303 foreach my $um (@user_maps) {
304 my $public = " (not public) ";
305 if ( $um->get_map()->get_is_public() ) { $public = "(public)"; }
308 . $um->get_short_name()
309 . "</b></td><td> <a href=\"/cview/umap.pl?action=view&user_map_id="
311 . "\" >[view]</a></td><td><a href=\"/cview/umap.pl?action=edit&user_map_id="
313 . "\">[configure]</a></td><td>$public</td></tr>";
320 # print info_section_html(title => 'User Maps', contents=> <<EOHTML);
321 # <a href="/cview/upload_usermap.pl">Upload new user map</a><br />
328 my $user_type = $sp->get_user_type();
330 user
=> qq{ Your current user status is
<b
>$user_type</b>. Please contact <a href="mailto:sgn-feedback\@sgn.cornell.edu">SGN</a> to upgrade to a
<b
>submitter
</b
> account with more privileges
. Submitters can upload user maps
, EST data
, and become locus editors
. },
332 submitter
=> qq{ Your current user status is
<b
>$user_type</b>. You have the maximum user privileges on SGN. Please contact <a href="mailto:sgn-feedback\@sgn.cornell.edu">SGN</a> if you would like to change your user status
.},
334 curator
=> qq{ Your current user status is
<b
>$user_type</b
>. },
336 sequencer
=> qq{ Your current user status is
<b
>$user_type</b
>. You have maximum user privileges on SGN
. },
338 genefamily_editor
=> qq{ Your current user status is
<b
>$user_type</b
>. },
341 print info_section_html
( title
=> 'User Status',
342 contents
=> $user_info->{$user_type} );
346 #returns a string containing a TPF and an AGP upload form,
347 #with the single argument interpolated in
348 sub tpf_agp_upload_forms
{
349 my $chrinput = shift;
350 my ( $chrinput_agp, $chrinput_tpf ) = ( $chrinput, $chrinput );
351 $chrinput_agp =~ s/TYPE/_agp/g;
352 $chrinput_tpf =~ s/TYPE/_tpf/g;
354 <div style="margin-top: 1em">
355 <b>Upload Accessioned Golden Path (AGP) File</b><br />
356 <form action="/sequencing/agp.pl" method="post" enctype="multipart/form-data">
358 <input type="hidden" name="filetype" value="agp" />
359 <label for="agpinput">File: </label>
360 <input id="agpinput" type="file" name="agp_file" value="Upload AGP file" /><input type="submit" value="Submit" />
363 <div style="margin-top: 1em">
364 <b>Upload Tiling Path Format (TPF) File</b><br />
365 <form action="/sequencing/tpf.pl" method="post" enctype="multipart/form-data">
367 <input type="hidden" name="filetype" value="tpf" />
368 <label for="tpfinput">File: </label>
369 <input id="tpfinput" type="file" name="tpf_file" value="Upload TPF file" /><input type="submit" value="Submit" />
379 foreach my $pop (@pops) {
380 my $pop_name = $pop->get_name();
381 my $pop_id = $pop->get_population_id();
382 my $is_public = $pop->get_privacy_status();
383 if ($is_public) { $is_public = 'is publicly available'; }
384 if ( !$is_public ) { $is_public = 'is not publicly available yet'; }
386 qq |<a href
="/qtl/population/$pop_id">$pop_name</a
> <i
>($is_public)</i><br/>|;