|
@@ -46,6 +46,16 @@ function tripal_pub_node_info() {
|
|
|
function chado_pub_form($node, $form_state) {
|
|
|
$form = array();
|
|
|
|
|
|
+ // Check to make sure that the tripal_pub vocabulary is loaded. If not, then
|
|
|
+ // warn the user that they should load it before continuing.
|
|
|
+ $pub_cv = chado_select_record('cv', array('cv_id'), array('name' => 'tripal_pub'));
|
|
|
+ if (count($pub_cv) == 0) {
|
|
|
+ drupal_set_message(t('The Tripal Pub vocabulary is currently not loaded. ' .
|
|
|
+ 'This vocabulary is required to be loaded before adding ' .
|
|
|
+ 'publications. <br>Please !import',
|
|
|
+ array('!import' => l('load the Tripal Publication vocabulary', 'admin/tripal/loaders/obo_loader'))), 'warning');
|
|
|
+ }
|
|
|
+
|
|
|
// Default values can come in the following ways:
|
|
|
//
|
|
|
// 1) as elements of the $node object. This occurs when editing an existing pub
|
|
@@ -190,7 +200,7 @@ function chado_pub_form($node, $form_state) {
|
|
|
);
|
|
|
|
|
|
$type_cv = tripal_get_default_cv('pub', 'type_id');
|
|
|
- if ($type_cv->name == 'tripal_pub') {
|
|
|
+ if ($type_cv and $type_cv->name == 'tripal_pub') {
|
|
|
|
|
|
// get the list of publication types. In the Tripal publication
|
|
|
// ontologies these are all grouped under the term 'Publication Type'
|
|
@@ -241,13 +251,13 @@ function chado_pub_form($node, $form_state) {
|
|
|
'#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
|
|
|
- suffer taxonomic influence?</a> J Ethnopharmacol. 2013 Apr 19; 146(3):842-52.</pre>'),
|
|
|
+ '#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 ' .
|
|
|
+ 'suffer taxonomic influence?</a> J Ethnopharmacol. 2013 Apr 19; 146(3):842-52.</pre>'),
|
|
|
);
|
|
|
$form['is_obsolete'] = array(
|
|
|
'#type' => 'checkbox',
|
|
@@ -263,7 +273,7 @@ function chado_pub_form($node, $form_state) {
|
|
|
|
|
|
// if the poperty cv is 'tripal_pub' then we need to pass in our own select_options
|
|
|
// for only a subset of the vocabulary
|
|
|
- if ($prop_cv->name == 'tripal_pub') {
|
|
|
+ if ($prop_cv and $prop_cv->name == 'tripal_pub') {
|
|
|
$select_options[] = 'Select a Property';
|
|
|
$sql = "
|
|
|
SELECT
|