- '#value' => t('Currently, feature map management jobs are waiting or are running. Managemment features have been hidden until these jobs complete. Please check back later once these jobs have finished. You can view the status of pending jobs in the Tripal jobs page.'),
- '#value' => t("Drupal allows for assignment of \"taxonomy\" or catagorical terms to " .
- "nodes. These terms allow for advanced filtering during searching. This option allows ".
- "for setting taxonomy only for features that belong to the selected maps below. All other features will be unaffected. To set taxonomy for all features in the site see the Feature Administration page."),
- '#weight' => 1,
+ $form['nothing'] = array(
+ '#markup' => t('There are currently no settings to configure.')
);
);
- $form['taxonify']['tx-maps'] = array(
- '#title' => t('Maps'),
- '#type' => t('checkboxes'),
- '#description' => t("Check the maps whose features you want to reset taxonomy. Note: this list contains all maps, even those that may not be synced."),
- '#value' => t("This option allows for reindexing of only those features that belong to the selected maps below. All other features will be unaffected. To reindex all features in the site see the Feature Administration page."),
- '#weight' => 1,
- );
-
- $form['reindex']['re-maps'] = array(
- '#title' => t('Maps'),
- '#type' => t('checkboxes'),
- '#description' => t("Check the maps whoee features you want to reindex. Note: this list contains all maps, even those that may not be synced."),
- // if we have maps we need to add to the checkbox then
- // build that form element
- if ($added > 0) {
- $lib_boxes['all'] = "All Maps";
-
- $form['reindex']['description'] = array(
- '#type' => 'item',
- '#value' => t("This option allows for the creation of Drupal content for maps in chado. Only the selected maps will be synced."),
- '#weight' => 1,
- );
-
-
- $form['sync']['featuremaps'] = array(
- '#title' => t('Available Maps'),
- '#type' => t('checkboxes'),
- '#description' => t("Check the maps you want to sync. Drupal content will be created for each of the maps listed above. Select 'All Maps' to sync all of them."),
- '#required' => FALSE,
- '#prefix' => '<div id="lib_boxes">',
- '#suffix' => '</div>',
- '#options' => $lib_boxes,
- '#weight' => 2,
- );
- $form['sync']['button'] = array(
- '#type' => 'submit',
- '#value' => t('Sync Maps'),
- '#weight' => 3,
- );
- }
- // we don't have any maps to select from
- else {
- $form['sync']['value'] = array(
- '#value' => t('All maps in Chado are currently synced with Drupal.')
- );
- }
-}
/**
/**
*
*
* @ingroup tripal_featuremap
* @ingroup tripal_featuremap
*/
*/
function tripal_featuremap_admin_validate($form, &$form_state) {
function tripal_featuremap_admin_validate($form, &$form_state) {
- global $user; // we need access to the user info
- $job_args = array();
-
- // Submit the Sync Job if selected
- if ($form_state['values']['op'] == t('Sync Maps')) {
-
- // check to see if the user wants to sync chado and drupal. If
- // so then we need to register a job to do so with tripal
+ $instructions = t('To add additional properties to the drop down. ' . l("Add terms to the featuremap_property vocabulary", "admin/tripal/chado/tripal_cv/cvterm/add") . ".");
- tripal_cv_add_cvterm(array('name' => 'undefined','def' => 'A catch-all for an undefined unit type'),
- 'featuremap_units', 0, 1, 'tripal');
-
- tripal_cv_add_cvterm(array('name' => 'start','def' => 'The start coordinate for a map feature.'),
- 'featurepos_property', 0, 1, 'tripal');
- tripal_cv_add_cvterm(array('name' => 'stop','def' => 'The end coordinate for a map feature'),
- 'featurepos_property', 0, 1, 'tripal');
+ tripal_cv_add_cvterm(
+ array(
+ 'name' => 'cM',
+ 'def' => 'Centimorgan units'
+ ),
+ 'featuremap_units', 0, 1, 'tripal'
+ );
+ tripal_cv_add_cvterm(
+ array(
+ 'name' => 'bp',
+ 'def' => 'Base pairs units'
+ ),
+ 'featuremap_units', 0, 1, 'tripal'
+ );
+ tripal_cv_add_cvterm(
+ array(
+ 'name' => 'bin_unit',
+ 'def' => 'The bin unit'
+ ),
+ 'featuremap_units', 0, 1, 'tripal'
+ );
+ tripal_cv_add_cvterm(
+ array(
+ 'name' => 'marker_order',
+ 'def' => 'Units simply to define marker order.'
+ ),
+ 'featuremap_units', 0, 1, 'tripal'
+ );
+ tripal_cv_add_cvterm(
+ array(
+ 'name' => 'undefined',
+ 'def' => 'A catch-all for an undefined unit type'
+ ),
+ 'featuremap_units', 0, 1, 'tripal'
+ );
+
+ // featurepos properties
+ tripal_cv_add_cvterm(
+ array(
+ 'name' => 'start',
+ 'def' => 'The start coordinate for a map feature.'
+ ),
+ 'featurepos_property', 0, 1, 'tripal'
+ );
+ tripal_cv_add_cvterm(
+ array(
+ 'name' => 'stop',
+ 'def' => 'The end coordinate for a map feature'
+ ),
+ 'featurepos_property', 0, 1, 'tripal'
+ );
// add cvterms for map properties
// add cvterms for map properties
- tripal_cv_add_cvterm(array('name' => 'Map Dbxref','def' => 'A unique identifer for the map in a remote database. The format is a database abbreviation and a unique accession separated by a colon. (e.g. Gramene:tsh1996a)'),
- 'featuremap_property', 0, 1, 'tripal');
- tripal_cv_add_cvterm(array('name' => 'Map Type','def' => 'The type of Map (e.g. QTL, Physical, etc.)'),
- tripal_cv_add_cvterm(array('name' => 'URL','def' => 'A univeral resource locator (URL) reference where the publication can be found. For maps found online, this would be the web address for the map.'),
- 'featuremap_property', 0, 1, 'tripal');
- tripal_cv_add_cvterm(array('name' => 'Population Type','def' => 'A brief descriptoin of the population type used to generate the map (e.g. RIL, F2, BC1, etc).'),
- 'featuremap_property', 0, 1, 'tripal');
- tripal_cv_add_cvterm(array('name' => 'Population Size','def' => 'The size of the population used to construct the map.'),
- 'featuremap_property', 0, 1, 'tripal');
- tripal_cv_add_cvterm(array('name' => 'Methods','def' => 'A brief description of the methods used to construct the map.'),
- 'featuremap_property', 0, 1, 'tripal');
- tripal_cv_add_cvterm(array('name' => 'Software','def' => 'The software used to construct the map.'),
- 'featuremap_property', 0, 1, 'tripal');
+ tripal_cv_add_cvterm(
+ array(
+ 'name' => 'Map Dbxref',
+ 'def' => 'A unique identifer for the map in a remote database. The format is a database abbreviation and a unique accession separated by a colon. (e.g. Gramene:tsh1996a)'
+ ),
+ 'featuremap_property', 0, 1, 'tripal'
+ );
+ tripal_cv_add_cvterm(
+ array(
+ 'name' => 'Map Type',
+ 'def' => 'The type of Map (e.g. QTL, Physical, etc.)'
+ ),
+ 'featuremap_property', 0, 1, 'tripal'
+ );
+ tripal_cv_add_cvterm(
+ array(
+ 'name' => 'Genome Group',
+ 'def' => ''
+ ),
+ 'featuremap_property', 0, 1, 'tripal'
+ );
+ tripal_cv_add_cvterm(
+ array(
+ 'name' => 'URL',
+ 'def' => 'A univeral resource locator (URL) reference where the publication can be found. For maps found online, this would be the web address for the map.'
+ ),
+ 'featuremap_property', 0, 1, 'tripal'
+ );
+ tripal_cv_add_cvterm(
+ array(
+ 'name' => 'Population Type',
+ 'def' => 'A brief description of the population type used to generate the map (e.g. RIL, F2, BC1, etc).'
+ ),
+ 'featuremap_property', 0, 1, 'tripal'
+ );
+ tripal_cv_add_cvterm(
+ array(
+ 'name' => 'Population Size',
+ 'def' => 'The size of the population used to construct the map.'
+ ),
+ 'featuremap_property', 0, 1, 'tripal'
+ );
+ tripal_cv_add_cvterm(
+ array(
+ 'name' => 'Methods',
+ 'def' => 'A brief description of the methods used to construct the map.'
+ ),
+ 'featuremap_property', 0, 1, 'tripal'
+ );
+ tripal_cv_add_cvterm(
+ array(
+ 'name' => 'Software',
+ 'def' => 'The software used to construct the map.'
- '#value' => t('Currently, library management jobs are waiting or are running. . Managemment features have been hidden until these jobs complete. Please check back later once these jobs have finished. You can view the status of pending jobs in the Tripal jobs page.'),
- '#value' => t("Drupal allows for assignment of \"taxonomy\" or catagorical terms to " .
- "nodes. These terms allow for advanced filtering during searching. This option allows ".
- "for setting taxonomy only for features that belong to the selected libraries below. All other features will be unaffected. To set taxonomy for all features in the site see the Feature Administration page."),
- '#weight' => 1,
- );
-
- $form['taxonify']['tx-libraries'] = array(
- '#title' => t('Libraries'),
- '#type' => t('checkboxes'),
- '#description' => t("Check the libraries whose features you want to reset taxonomy. Note: this list contains all libraries, even those that may not be synced."),
- '#value' => t("This option allows for reindexing of only those features that belong to the selected libraries below. All other features will be unaffected. To reindex all features in the site see the Feature Administration page."),
- '#weight' => 1,
- );
-
- $form['reindex']['re-libraries'] = array(
- '#title' => t('Libraries'),
- '#type' => t('checkboxes'),
- '#description' => t("Check the libraries whoee features you want to reindex. Note: this list contains all libraries, even those that may not be synced."),
- // if we have libraries we need to add to the checkbox then
- // build that form element
- if ($added > 0) {
- $lib_boxes['all'] = "All Libraries";
- $form['reindex']['description'] = array(
- '#type' => 'item',
- '#value' => t("This option allows for the creation of Drupal content for libraries in chado. Only the selected libraries will be synced."),
- '#weight' => 1,
- );
- $form['sync']['libraries'] = array(
- '#title' => t('Available Libraries'),
- '#type' => t('checkboxes'),
- '#description' => t("Check the libraries you want to sync. Drupal content will be created for each of the libraries listed above. Select 'All Libraries' to sync all of them."),
- '#required' => FALSE,
- '#prefix' => '<div id="lib_boxes">',
- '#suffix' => '</div>',
- '#options' => $lib_boxes,
- '#weight' => 2,
- );
- $form['sync']['button'] = array(
- '#type' => 'submit',
- '#value' => t('Sync Libraries'),
- '#weight' => 3,
- );
- }
- // we don't have any libraries to select from
- else {
- $form['sync']['value'] = array(
- '#value' => t('All libraries in Chado are currently synced with Drupal.')
- );
- }
-}
/**
/**
*
*
* @ingroup tripal_library
* @ingroup tripal_library
*/
*/
function tripal_library_admin_validate($form, &$form_state) {
function tripal_library_admin_validate($form, &$form_state) {
- global $user; // we need access to the user info
- $job_args = array();
-
- // Submit the Sync Job if selected
- if ($form_state['values']['op'] == t('Sync Libraries')) {
-
- // check to see if the user wants to sync chado and drupal. If
- // so then we need to register a job to do so with tripal
- <div class="tripal_feature-info-box-desc tripal-info-box-desc">This <?php print $feature->type_id->name ?> is derived, or can be located in the following libraries</div>
+ <div class="tripal_library-info-box-desc tripal-info-box-desc">The following terms have been associated with this <?php print $node->library->type_id->name ?>:</div> <?php
+
+ // iterate through each term
+ $i = 0;
+ foreach ($s_terms as $cv => $terms) {
+ // the $headers array is an array of fields to use as the colum headers.
- <div class="tripal_library-info-box-desc tripal-info-box-desc">The following terms have been associated with this <?php print $node->library->type_id->name ?>:</div> <?php
- '#value' => t('Currently, project management jobs are waiting or are running. . Managemment features have been hidden until these jobs complete. Please check back later once these jobs have finished. You can view the status of pending jobs in the Tripal jobs page.'),
- );
- }
+ $form['nothing'] = array(
+ '#markup' => t('There are currently no settings to configure.')
- // if we have projects we need to add to the checkbox then
- // build that form element
- if ($added > 0) {
- $proj_boxes['all'] = "All Projects";
-
- $form['sync']['projects'] = array(
- '#title' => t('Available Projects'),
- '#type' => t('checkboxes'),
- '#description' => t("Check the projects you want to sync. Drupal content will be created for each of the projects listed above. Select 'All Projects' to sync all of them."),
- '#required' => FALSE,
- '#prefix' => '<div id="org_boxes">',
- '#suffix' => '</div>',
- '#options' => $proj_boxes,
- );
- $form['sync']['button'] = array(
- '#type' => 'submit',
- '#value' => t('Submit Sync Job')
- );
- }
- // we don't have any projects to select from
- else {
- $form['sync']['value'] = array(
- '#value' => t('All projects in Chado are currently synced with Drupal.')
- );
- }
- }
- // we don't want to present a form since we have an active job running
- else {
- $form['sync']['value'] = array(
- '#value' => t('Currently, jobs exist related to chado projects. Please check back later for projects that can by synced once these jobs have finished. You can view the status of pending jobs in the Tripal jobs page.')
- );
- }
-}
/**
/**
*
*
* @ingroup tripal_project
* @ingroup tripal_project
*/
*/
function tripal_project_admin_validate($form, &$form_state) {
function tripal_project_admin_validate($form, &$form_state) {
- global $user; // we need access to the user info
- $job_args = array();
-
- if ($form_state['values']['op'] == t('Submit Sync Job')) {
-
- // check to see if the user wants to sync chado and drupal. If
- // so then we need to register a job to do so with tripal
- $projects = $form_state['values']['projects'];
- $do_all = FALSE;
- $to_sync = array();
-
- foreach ($projects as $project_id) {
- if (preg_match("/^all$/i" , $project_id)) {
- $do_all = TRUE;
- }
- if ($project_id and preg_match("/^\d+$/i" , $project_id)) {
- // get the list of projects
- $sql = "SELECT * FROM {project} WHERE project_id = :project_id";
+ // because we are using the project description property as
+ // a replacement for the project.description field and we want the
+ // user to add a description in the field above, we remove the property
+ // from the list.
+ if (strcmp($prop->name, "Project Description")==0) {
+ continue;
+ }
+ $properties[$prop->cvterm_id] = $prop->name;
+ }
+
+ // we want to exclude the project description from being loaded as a stored property
+ // because we want to use the property to replace the project.description field as it is
+ // only 255 characters which isn't large enough. We don't want the user to set it
+ // as a property even though it will be stored as a property.
+ $exclude = array('Project Description');
+ $include = array();
+ $instructions = t('To add properties to the drop down list, you must ' . l("add terms to the project_property vocabulary", "admin/tripal/chado/tripal_cv/cvterm/add") . ".");
+ <div class="tripal_project-info-box-desc tripal-info-box-desc">The following indivuals or groups have particpated in development or execution of this project</div><?php
+
+ // the $headers array is an array of fields to use as the colum headers.
- <div class="tripal_project-info-box-desc tripal-info-box-desc">The following people particpated in development or execution of this project</div><?php
- // if we don't have a default type then set the default to be 'Journal Article'
- if (strcmp($pub_type->name,"Journal Article") == 0 and !$type_id) {
- $type_id = $pub_type->cvterm_id;
- }
- }
-
- $form['type_id'] = array(
- '#type' => 'select',
- '#title' => t('Publication Type'),
- '#options' => $pub_types,
- '#required' => TRUE,
- '#default_value' => $type_id,
- );
- $form['pyear'] = array(
- '#type' => 'textfield',
- '#title' => t('Publication Year'),
- '#default_value' => $pyear,
- '#required' => TRUE,
- '#size' => 5,
- '#description' => t('Enter the year of publication. Also, if available, please add a <b>Publication Date</b> property to specify the full date of publication.'),
- );
- $form['uniquename'] = array(
- '#type' => 'textarea',
- '#title' => t('Citation'),
- '#default_value' => $uniquename,
- '#description' => t('All publications must have a unique citation.
- <b>Please enter the full citation for this publication or leave blank and one will be generated
- automatically if possible</b>. For PubMed style citations list
- the last name of the author followed by initials. Each author should be separated by a comma. Next comes
- the title, followed by the series title (e.g. journal name), publication date (4 digit year, 3 character Month, day), volume, issue and page numbers. You may also use HTML to provide a link in the citation.
- Below is an example: <pre>Medeiros PM, Ladio AH, Santos AM, Albuquerque UP. <a href="http://www.ncbi.nlm.nih.gov/pubmed/23462414" target="_blank">Does the selection of medicinal plants by Brazilian local populations
- '#value' => t('To search for publications enter keywords in the text boxes below. You can limit your search by selecting the field in the dropdown box. Click the plus and minus symbols to add additional fields for searching. '),
+ // if we don't have a default type then set the default to be 'Journal Article'
+ if (strcmp($pub_type->name,"Journal Article") == 0 and !$type_id) {
+ $type_id = $pub_type->cvterm_id;
+ }
+ }
+
+ $form['type_id'] = array(
+ '#type' => 'select',
+ '#title' => t('Publication Type'),
+ '#options' => $pub_types,
+ '#required' => TRUE,
+ '#default_value' => $type_id,
+ );
+ $form['pyear'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Publication Year'),
+ '#default_value' => $pyear,
+ '#required' => TRUE,
+ '#size' => 5,
+ '#description' => t('Enter the year of publication. Also, if available, please add a <b>Publication Date</b> property to specify the full date of publication.'),
+ );
+ $form['uniquename'] = array(
+ '#type' => 'textarea',
+ '#title' => t('Citation'),
+ '#default_value' => $uniquename,
+ '#description' => t('All publications must have a unique citation.
+ <b>Please enter the full citation for this publication or leave blank and one will be generated
+ automatically if possible</b>. For PubMed style citations list
+ the last name of the author followed by initials. Each author should be separated by a comma. Next comes
+ the title, followed by the series title (e.g. journal name), publication date (4 digit year, 3 character Month, day), volume, issue and page numbers. You may also use HTML to provide a link in the citation.
+ Below is an example: <pre>Medeiros PM, Ladio AH, Santos AM, Albuquerque UP. <a href="http://www.ncbi.nlm.nih.gov/pubmed/23462414" target="_blank">Does the selection of medicinal plants by Brazilian local populations