32 if (isset($user->mail)) {
34 $options_arr = array();
35 $options_arr[
'new'] =
'Create new TPPS Submission';
39 foreach ($states as $state) {
40 if (empty($state[
'tpps_type']) or $state[
'tpps_type'] !=
'tppsc') {
41 if ($state != NULL and isset($state[
'saved_values'][
TPPS_PAGE_1][
'publication'][
'title'])) {
42 $title = ($state[
'saved_values'][
TPPS_PAGE_1][
'publication'][
'title'] != NULL) ? $state[
'saved_values'][TPPS_PAGE_1][
'publication'][
'title'] :
"No Title";
43 $tgdr_id = $state[
'accession'];
44 $options_arr[
"$tgdr_id"] =
"$title";
47 if (isset($state) and !isset($state[
'saved_values'][TPPS_PAGE_1])) {
54 if (count($options_arr) > 1) {
56 $form[
'accession'] = array(
58 '#title' => t(
'Would you like to load an old TPPS submission, or create a new one?'),
59 '#options' => $options_arr,
60 '#default_value' => isset($form_state[
'saved_values'][
'frontpage'][
'accession']) ? $form_state[
'saved_values'][
'frontpage'][
'accession'] :
'new',
65 $form[
'Next'] = array(
67 '#value' => t(
'Continue to TPPS'),
70 $image_path = drupal_get_path(
'module',
'tpps') .
'/images/';
71 $prefix_text =
"<div>Welcome to TPPS!<br><br>The Tripal PopGen Submit (TPPS) workflow provides researchers with a streamlined submission interface for studies resulting from any combination of genotype, phenotype, and environmental data for georeferenced forest trees. ";
72 $prefix_text .=
"You can <a href='/tpps_details/main'><b>view completed studies here</b></a> or pick up where you left off by using the dropdown box found <a href='#tpps_begin_options'><b>here</b></a> (below). Visit the <a href='https://tpps.readthedocs.io/en/latest/index.html'><b>full manual</b></a> for more details and help.<br />";
73 $prefix_text .=
"<figure style=\"text-align:center;\"><img style=\"max-height:100%;max-width:100%;\" src=\"{$image_path}TPPS_front_diagram.png\"></figure>";
74 $prefix_text .=
"TPPS has documentation to assist users with the process of creating a submission, which can be accessed <a target=\"blank\" href=\"https://tpps.readthedocs.io/en/latest/user.html\">here</a>.<br><br></div>";
75 $prefix_text .=
"<div id='tpps_begin_options'>";
76 $suffix_text =
"</div>";
77 if (isset($form[
'accession'])) {
78 $form[
'accession'][
'#prefix'] = $prefix_text;
79 $form[
'accession'][
'#suffix'] = $suffix_text;
82 $form[
'Next'][
'#prefix'] = $prefix_text;
tpps_front_create_form(array &$form, array $form_state)
tpps_delete_submission($accession, $redirect=TRUE)
tpps_load_submission_multiple(array $conditions=array(), $state=TRUE)