فهرست منبع

Merge branch '6.x-1.x' of git.drupal.org:sandbox/spficklin/1337878 into 6.x-1.x

Stephen Ficklin 11 سال پیش
والد
کامیت
86bd5094d5

+ 23 - 1
tripal_cv/api/tripal_cv.api.inc

@@ -182,7 +182,29 @@ function tripal_cv_get_cv_options() {
   return $options;
 
 }
-
+/**
+ * Retrieve a chado cvterm object with a given name
+ *
+ * @param $cvterm_id
+ *   the cvterm.cvterm_id
+ *
+ * @return
+ *   cvterm array or FALSE on error
+ *
+ * @ingroup tripal_cv_api
+ */
+function tripal_cv_get_cvterm_by_id($cvterm_id) {
+  if (!is_numeric($cvterm_id)) {
+    return FALSE;
+  }
+  $values = array('cvterm_id' => $cvterm_id);
+  $options = array('statement_name' => 'sel_cvterm_id');
+  $r = tripal_core_chado_select('cvterm', array('*'), $values, $options);  
+  if (!$r) {
+    return FALSE;
+  }
+  return $r[0];
+}
 /**
  * Retrieve a chado cvterm object with a given name
  *

+ 1 - 1
tripal_feature/includes/gff_loader.inc

@@ -436,7 +436,7 @@ function tripal_feature_load_gff3($gff_file, $organism_id, $analysis_id,
         $result = chado_query("EXECUTE sel_cvterm_idnasy (%d, '%s', '%s')", $cv->cv_id, $landmark_type, $landmark_type);
         $cvterm = db_fetch_object($result);
         if (!$cvterm) {
-          watchdog('T_gff3_loader', 'cannot find feature term \'%landmark_type\' on line %line_num of the GFF file', 
+          watchdog('T_gff3_loader', 'cannot find feature type \'%landmark_type\' on line %line_num of the GFF file', 
             array('%landmark_type' => $landmark_type, '%line_num' => $line_num), WATCHDOG_ERROR);
           return '';
         }

+ 53 - 3
tripal_pub/api/tripal_pub.api.inc

@@ -506,9 +506,11 @@ function tripal_pub_get_pubs_by_dbxref($pub_dbxref) {
  *   The title of the publication to look for
  * @param type
  *   Optional. The publication type. The value of this field should come from 
- *   the Tripal Pub vocabulary
+ *   the Tripal Pub vocabulary. This should be the type name (e.g. cvterm.name)
  * @param year
  *   Optional. The year the publication was published.
+ * @param series_name
+ *   Optional.  The name of the series (e.g. Journal name)
  * 
  * @return
  *   Returns an array of all the publications that have the provided
@@ -518,7 +520,7 @@ function tripal_pub_get_pubs_by_dbxref($pub_dbxref) {
  * @ingroup tripal_pub_api 
  * 
  */
-function tripal_pub_get_pubs_by_title_type_pyear($title, $type = NULL, $pyear = NULL) {
+function tripal_pub_get_pubs_by_title_type_pyear_series($title, $type = NULL, $pyear = NULL, $series_name = NULL) {
   
   $return = array();
   
@@ -540,7 +542,55 @@ function tripal_pub_get_pubs_by_title_type_pyear($title, $type = NULL, $pyear =
     $values['pyear'] = $pyear;
     $stmnt_suffix .= 'py';
   }
-  $options = array('statement_name' => 'sel_pub_' . $stmnt_suffix);
+  if ($series_name) {
+    $values['series_name'] = strtolower($series_name);
+    $stmnt_suffix .= 'se';
+  }
+  $options = array(
+    'statement_name' => 'sel_pub_' . $stmnt_suffix,
+    'case_insensitive_columns' => array('title', 'series_name'),
+  );
+  $results = tripal_core_chado_select('pub', array('pub_id'), $values, $options);
+  
+  // iterate through any matches and pull out the pub_id
+  foreach ($results as $index => $pub) {
+    $return[] = $pub->pub_id;  
+  }
+  return $return;  
+}
+/**
+ * Returns the list of publications that match a given title, type and year
+ * 
+ * @param title
+ *   The title of the publication to look for
+ * @param type
+ *   Optional. The publication type. The value of this field should come from 
+ *   the Tripal Pub vocabulary. This should be the type name (e.g. cvterm.name)
+ * @param year
+ *   Optional. The year the publication was published.
+ * @param series_name
+ *   Optional.  The name of the series (e.g. Journal name)
+ * 
+ * @return
+ *   Returns an array of all the publications that have the provided
+ *   cross reference. If no publications match, then an empty array
+ *   is returned.
+ *   
+ * @ingroup tripal_pub_api 
+ * 
+ */
+function tripal_pub_get_pub_by_uniquename($name) {
+  
+  $return = array();
+  
+  // build the values array for the query. 
+  $values = array(
+    'uniquename' => $name,
+  );
+  $options = array(
+    'statement_name' => 'sel_pub_un',
+    'case_insensitive_columns' => array('uniquename'),
+  );
   $results = tripal_core_chado_select('pub', array('pub_id'), $values, $options);
   
   // iterate through any matches and pull out the pub_id

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 148 - 141
tripal_pub/files/tpub.obo


+ 38 - 0
tripal_pub/includes/importers/AGL.inc

@@ -3,12 +3,19 @@
  *  
  */
 function tripal_pub_remote_alter_form_AGL(&$form, $form_state) {
+  $num_criteria = $form['num_criteria']['#default_value'];
+  
   // So far we haven't been able to get AGL to filter results to only 
   // include pubs by the XX number days in the past.  So, we will
   // change the 'days' element to be the year to query
   $form['days']['#title'] = t('Year');
   $form['days']['#description']  = t('Please enter a year to limit records by the year they were published, created or modified in the database.');
   
+  // The Journal Name filter doesn't seem to work, so remove it
+  for($i = 1; $i <= $num_criteria; $i++) {
+    unset($form['criteria'][$i]["scope-$i"]['#options']['journal']);
+  }
+  
 }
 /**
  *  
@@ -161,6 +168,24 @@ function tripal_pub_remote_search_AGL($search_array, $num_to_retrieve, $pager_id
         $negate_abstract .= "$op ($search_terms) ";
       }
     }
+    elseif ($scope == 'journal') {
+      if ($first_journal) {
+        $journal .= "($search_terms) ";
+        $first_jounral = 0;
+      }
+      else {
+        $journal .= "$op ($search_terms) ";
+      }
+    }
+    elseif ($scope == 'negate_journal') {
+      if ($first_negate_journal) {
+        $negate_journal .= "($search_terms) ";
+        $first_negate_journal = 0;
+      }
+      else {
+        $negate_journal .= "$op ($search_terms) ";
+      }
+    }
     elseif ($scope == 'id') {
       if ($first_id) {
         $id .= "(" . preg_replace('/AGL:([^\s]*)/', '$1', $search_terms) . ") ";
@@ -201,10 +226,12 @@ function tripal_pub_remote_search_AGL($search_array, $num_to_retrieve, $pager_id
   // now build the CCL string in order 
   $abstract_done = 0;
   $author_done = 0;
+  $journal_done = 0;
   $title_done = 0;
   $id_done = 0;
   $any_done = 0;
   $negate_abstract_done = 0;
+  $negate_journal_done = 0;
   $negate_author_done = 0;
   $negate_title_done = 0;
   $negate_id_done = 0;
@@ -228,6 +255,15 @@ function tripal_pub_remote_search_AGL($search_array, $num_to_retrieve, $pager_id
       $ccl .= "not author=($negate_author) ";
       $negate_author_done = 1;
     }
+    if ($order[$i]['scope'] == 'journal' and !$journal_done) {
+      $op = $order[$i]['op'];
+      $ccl .= "$op journal=($journal) ";
+      $journal_done = 1;
+    }
+    if ($order[$i]['scope'] == 'negate_journal' and !$negate_journal_done) {
+      $ccl .= "not author=($negate_journal) ";
+      $negate_journal_done = 1;
+    }
     if ($order[$i]['scope'] == 'id' and !$id_done) {      
       $op = $order[$i]['op'];
       $ccl .= "$op id=($id) ";
@@ -289,6 +325,7 @@ function tripal_pub_remote_search_AGL($search_array, $num_to_retrieve, $pager_id
     "abstract" => "u=62",
     "id"       => "u=12",
     "year"     => "u=30 r=o", 
+    "journal"  => "u=1033"
   );
   yaz_ccl_conf($yazc, $fields);
     
@@ -304,6 +341,7 @@ function tripal_pub_remote_search_AGL($search_array, $num_to_retrieve, $pager_id
   // save the YAZ connection in the session for use by other functions
   $_SESSION['tripal_pub_AGL_query'][$search_str]['yaz_connection'] = $yazc;
   
+  //dpm($search_array);
   // we want to get the list of pubs using the search terms but using a Drupal style pager
   $pubs = tripal_pager_callback('tripal_pub_AGL_range',  $num_to_retrieve, $pager_id, 
     'tripal_pub_AGL_count', $search_array);

+ 5 - 2
tripal_pub/includes/importers/PMID.inc

@@ -43,6 +43,7 @@ function tripal_pub_remote_search_PMID($search_array, $num_to_retrieve, $pager_i
   $days = $search_array['days'];
 
   $search_str = '';
+  
   for ($i = 1; $i <= $num_criteria; $i++) {
     $search_terms = trim($search_array['criteria'][$i]['search_terms']);
     $scope = $search_array['criteria'][$i]['scope'];
@@ -50,7 +51,7 @@ function tripal_pub_remote_search_PMID($search_array, $num_to_retrieve, $pager_i
     $op = $search_array['criteria'][$i]['operation'];
     
     if ($op) {
-      $search_str .= "$op";
+      $search_str .= "$op ";
     }    
     
     // if this is phrase make sure the search terms are surrounded by quotes
@@ -68,6 +69,9 @@ function tripal_pub_remote_search_PMID($search_array, $num_to_retrieve, $pager_i
     elseif ($scope == 'abstract') {
       $search_str .= $search_terms . '[Title/Abstract]';
     }
+    elseif ($scope == 'journal') {
+      $search_str .= $search_terms . '[Journal]';
+    }
     elseif ($scope == 'id') {
       $search_terms = preg_replace('/PMID:([^\s]*)/', '$1', $search_terms);
       $search_str .=  $search_terms . '[Uid]';      
@@ -86,7 +90,6 @@ function tripal_pub_remote_search_PMID($search_array, $num_to_retrieve, $pager_i
   
   $search_array['limit'] = $num_to_retrieve;
   $search_array['search_string'] = $search_str;  
-  //dpm($search_array);  
   
   unset($_SESSION['tripal_pub_PMID_query']);
   // we want to get the list of pubs using the search terms but using a Drupal style pager

+ 118 - 33
tripal_pub/includes/pub_form.inc

@@ -144,7 +144,7 @@ function chado_pub_form($node, $form_state) {
   $num_properties += chado_pub_node_form_add_pubprop_table_props($form, $form_state, $pub_id, $d_properties, $d_removed);
     
   // add in any new properties that have been added by the user through an AHAH callback  
-  $num_properties += chado_pub_node_form_add_new_props($form, $form_state, $num_new, $d_properties, $d_removed);
+  $num_new = chado_pub_node_form_add_new_props($form, $form_state, $d_properties, $d_removed);
   
   // add an empty row of field to allow for addition of a new property
   chado_pub_node_form_add_new_empty_props($form, $properties_select);
@@ -159,6 +159,10 @@ function chado_pub_form($node, $form_state) {
     '#type' => 'hidden',
     '#value' => $num_new,
   );
+  $form['num_properties'] = array(
+    '#type' => 'hidden',
+    '#value' => $num_properties,
+  );
   
   $form['is_obsolete'] = array(
     '#type' => 'checkbox',
@@ -189,7 +193,9 @@ function chado_pub_validate($node, &$form) {
   $pubplace     = trim($node->pubplace);
   $is_obsolete  = $node->is_obsolete;
   $pub_id       = $node->pub_id;
-
+  $num_properties = $node->num_properties;
+  $num_new = $node->num_new;
+  
   // if this is a delete then don't validate
   if($node->op == 'Delete') {
     return;
@@ -206,49 +212,128 @@ function chado_pub_validate($node, &$form) {
   $options = array('statement_name' => 'sel_pub_ty');
   $cvterm = tripal_core_chado_select('cvterm', array('name'), $values, $options);
   if (count($cvterm) == 0) {
-    $message = t('Invalided publication type.');
+    $message = t('Invalid publication type.');
     form_set_error('type_id', $message);
     return;
   }
-
-  // on an insert (no $pub_id) make sure the publication doesn't already exist
-  if (!$pub_id) {
-    $results = tripal_pub_get_pubs_by_title_type_pyear($title, $cvterm[0]->name, $pyear);   
-    if (count($results) > 0) {
-      $message = t('A publication with this title, type and publication year, already exists.  Cannot add this publication');
-      form_set_error('pyear', $message);
-      return;
+  
+  // get the media name looking at the properties
+  foreach ($node as $element => $value) {
+    // if this is an existing property (either previously in the database or
+    // added via AHAH/AJAX callback)
+    if (preg_match('/^prop_value-(\d+)-(\d+)$/', $element, $matches)) {
+      $prop_type_id = $matches[1];
+      $prop_type = tripal_cv_get_cvterm_by_id($prop_type_id);
+      if($prop_type->name == 'Conference Name' or $prop_type->name == 'Journal Name') {
+        $series_name = $value;
+      }  
+      if($prop_type->name == 'Citation') {
+        $uniquename = $value;
+      }  
+    }
+    // if this is a new property (added by this submit of the form)
+    elseif ($element = 'new_id') {
+      $prop_type = tripal_cv_get_cvterm_by_id($value);
+      if($prop_type->name == 'Conference Name' or $prop_type->name == 'Journal Name') {
+        $series_name = $node->new_value;
+      }
+      if($prop_type->name == 'Citation') {
+        $uniquename = $value;
+      }    
     }
   }
   
-  // on an update, make sure that if the title has changed that it doesn't
-  // conflict with any other publication
+  $skip_duplicate_check = 0; 
+  
+  // if this publication is a Patent then skip the validation below.  Patents can have the title
+  // name and year but be different    
+  if (strcmp($cvterm[0]->name,'Patent') == 0) {
+    $skip_duplicate_check = 1;
+  }
+ 
+  // on an update ($pub_id is set), check to see if there have been  changes to fields that
+  // are used to check for duplicates. If not, then no need to check for duplicates  
   if ($pub_id) {
     // first get the original title, type and year before it was changed
     $values = array('pub_id' => $pub_id);
-    $columns =  array('title','pyear','type_id');
+    $columns =  array('title', 'pyear', 'type_id', 'series_name');
     $options = array('statement_name' => 'sel_pub_id');
-    $pub = tripal_core_chado_select('pub', $columns, $values, $options);
-    
-    // if the title or year doesn't match then it was changed and we want to make
-    // sure it doesn't already exist in another publication
-    if((strcmp($pub[0]->title, $title) != 0) or
-       ($pub[0]->type_id != $type_id) or
-       ($pub[0]->year != $pyear)) {
-      $results = tripal_pub_get_pubs_by_title_type_pyear($title, $cvterm[0]->name, $pyear);
+    $pub = tripal_core_chado_select('pub', $columns, $values, $options);       
 
-      // make sure we don't capture our pub_id in the list (remove it)
-      foreach ($results as $index => $found_pub_id) {
-        if($found_pub_id == $pub_id){
-          unset($results[$index]);
-        }
-      }         
-      if (count($results) > 0) {
-        $message = t('A publication with this title and publication year, already exists.  Cannot update this publication'); 
-        form_set_error('pyear', $message);
-      }
+    // if the title, type,  year or series_name have changed then check the pub 
+    // to see if it is a duplicate of another
+    if((strcmp(strtolower($pub[0]->title), strtolower($title)) == 0) and
+       (strcmp(strtolower($pub[0]->series_name), strtolower($series_name)) == 0) and
+       ($pub[0]->type_id == $type_id) and
+       ($pub[0]->year == $pyear)) {
+       $skip_duplicate_check = 1;
     }
+  }
+  
+  // check to see if a duplicate publication already exists
+  if (!$skip_duplicate_check) {  
+
+    // make sure the publication is unique using the prefereed import duplication check
+    $import_dups_check = variable_get('tripal_pub_import_duplicate_check', 'title_year_media');
+    switch ($import_dups_check) {            
+      case 'title_year':
+        $results = tripal_pub_get_pubs_by_title_type_pyear_series($title, NULL, $pyear, NULL);
+        // make sure we don't capture our pub_id in the list (remove it)
+        foreach ($results as $index => $found_pub_id) {
+          if($found_pub_id == $pub_id){
+            unset($results[$index]);
+          }
+        }         
+        if (count($results) > 0) {
+          $message = t('A publication with this title and publication year, already exists.'); 
+          form_set_error('pyear', $message);
+        }
+        break;        
+      case 'title_year_type':          
+        $results = tripal_pub_get_pubs_by_title_type_pyear_series($title, $cvterm[0]->name, $pyear, NULL);
+    
+        // make sure we don't capture our pub_id in the list (remove it)
+        foreach ($results as $index => $found_pub_id) {
+          if($found_pub_id == $pub_id){
+            unset($results[$index]);
+          }
+        }         
+        if (count($results) > 0) {
+          $message = t('A publication with this title, type and publication year, already exists.'); 
+          form_set_error('pyear', $message);
+        }
+        break;        
+      case 'title_year_media':          
+        $results = tripal_pub_get_pubs_by_title_type_pyear_series($title, NULL, $pyear, $series_name);
+    
+        // make sure we don't capture our pub_id in the list (remove it)
+        foreach ($results as $index => $found_pub_id) {
+          if($found_pub_id == $pub_id){
+            unset($results[$index]);
+          }
+        }         
+        if (count($results) > 0) {
+          $message = t('A publication with this title, media name (e.g. Journal Name) and publication year, already exists.'); 
+          form_set_error('pyear', $message);
+        }
+        break;
+    }      
   } 
+  // even though we are skipping the duplication checks above we must make sure the uniquename is unique 
+  // as that is the offical table constraint
+  else {
+    $results = tripal_pub_get_pub_by_uniquename($uniquename);
+    // make sure we don't capture our pub_id in the list (remove it)
+    foreach ($results as $index => $found_pub_id) {
+      if($found_pub_id == $pub_id){
+        unset($results[$index]);
+      }
+    }         
+    if (count($results) > 0) {
+      $message = t('A publication with this unique citation already exists.'); 
+      form_set_error('uniquename', $message);
+    }  
+  }
 }
 /*
  * 
@@ -289,7 +374,7 @@ function chado_pub_node_form_add_new_empty_props(&$form, $properties_select) {
 /*
  * 
  */
-function chado_pub_node_form_add_new_props(&$form, $form_state, $num_new, &$d_properties, &$d_removed) {
+function chado_pub_node_form_add_new_props(&$form, $form_state, &$d_properties, &$d_removed) {
    
   // first, add in all of the new properties that were added through a previous AHAH callback 
   $j = 0;

+ 13 - 0
tripal_pub/includes/pub_importers.inc

@@ -296,8 +296,13 @@ function tripal_pub_importer_setup_form(&$form_state = NULL, $pub_import_id = NU
     'author'   => 'Author',
     'id'       => 'Accession',
     'title'    => 'Title',
+    'journal'   => 'Journal Name'
   );
 
+  $first_op_choices = array(
+    ''    => '',
+    'NOT' => 'NOT'
+  ); 
   $op_choices = array(
     'AND' => 'AND',
     'OR'  => 'OR',
@@ -346,6 +351,14 @@ function tripal_pub_importer_setup_form(&$form_state = NULL, $pub_import_id = NU
       '#default_value' => $is_phrase,
     );  
     
+    if ($i == 1) {
+      /*
+      $form['criteria'][$i]["operation-$i"] = array(
+        '#type'          => 'select',
+        '#options'       => $first_op_choices,
+        '#default_value' => $operation,
+      );*/
+    }
     if ($i > 1) {
       $form['criteria'][$i]["operation-$i"] = array(
         '#type'          => 'select',

+ 23 - 3
tripal_pub/includes/pub_search.inc

@@ -410,8 +410,9 @@ function tripal_pub_get_search_results($search_array, $limit, $pager_id) {
   $select = "SELECT DISTINCT P.*, CP.nid ";
   $from   = "FROM {pub} P
                LEFT JOIN public.chado_pub CP on P.pub_id = CP.pub_id 
+               INNER JOIN cvterm CVT on CVT.cvterm_id = P.type_id
             ";
-  $where  = "WHERE ";
+  $where  = "WHERE (NOT P.title = 'null') "; // always exclude the dummy pub
   $order  = "ORDER BY P.pyear DESC, P.title ASC";
   $fargs = array(); // arguments for from, inner join clause
   $wargs = array();  // arguments for where clause
@@ -440,6 +441,9 @@ function tripal_pub_get_search_results($search_array, $limit, $pager_id) {
     if ($op == 'NOT') {
       $op = 'AND NOT';
     }
+    if (!$op) {
+      $op = 'AND';
+    }
     
     $action = "= lower('%s')";
     if($mode == 'Contains') {
@@ -473,8 +477,24 @@ function tripal_pub_get_search_results($search_array, $limit, $pager_id) {
       $wargs[] = $value;
     }
     elseif ($type_name == 'Journal Name') {
-      $where .= " $op (lower(P.series_name) $action) ";
-      $wargs[] = $value;             
+      $from .= " LEFT JOIN {pubprop} PP$i ON PP$i.pub_id = P.pub_id AND PP$i.type_id = %d ";      
+      $where .= " $op ((lower(P.series_name) $action and CVT.name = 'Journal Article') OR 
+                       (lower(PP$i.value) $action)) ";
+      $fargs[] = $type_id;
+      $wargs[] = $value;
+      $wargs[] = $value;            
+    }
+    elseif ($type_name == 'Conference Name') {
+      $from .= " LEFT JOIN {pubprop} PP$i ON PP$i.pub_id = P.pub_id AND PP$i.type_id = %d ";      
+      $where .= " $op ((lower(P.series_name) $action and CVT.name = 'Conference Proceedings') OR 
+                       (lower(PP$i.value) $action)) ";
+      $fargs[] = $type_id;
+      $wargs[] = $value;
+      $wargs[] = $value;
+    }
+    elseif ($type_name == 'Publication Type') {
+      $where .= " $op (lower(CVT.name) $action)";
+      $wargs[] = $value;
     }
     elseif ($type_id == 0) { //'Any Field'
       $from .= " LEFT JOIN {pubprop} PP$i ON PP$i.pub_id = P.pub_id ";

+ 2 - 0
tripal_pub/includes/pub_sync.inc

@@ -8,6 +8,8 @@ function tripal_pub_sync_form() {
     '#type' => 'item',
     '#value' => t('Syncing a publication will create a Drupal page for every publicatoin record in the Chado database. Click the button below to sync all publications in Chado that currently are not already synced with Drupal.'),
   );
+  
+
 
   $form['submit'] = array(
     '#type' => 'submit',

+ 28 - 1
tripal_pub/includes/tripal_pub.admin.inc

@@ -19,6 +19,7 @@ function tripal_pub_admin() {
   // add the field set for syncing publications
   if (!$active_jobs) {
     get_tripal_pub_admin_form_select_search_list($form);    
+    get_tripal_pub_admin_form_importing_set($form);
     get_tripal_pub_admin_form_cleanup_set($form);
   }
   else {
@@ -33,7 +34,30 @@ function tripal_pub_admin() {
 
   return system_settings_form($form);
 }
-
+/**
+ *
+ *
+ * @ingroup tripal_pub
+ */
+function get_tripal_pub_admin_form_importing_set(&$form) {
+  $form['import'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Import Settings')
+  );
+  $form['import']['import_duplicate_check'] = array(
+    '#type' => 'radios', 
+    '#title' => t('Unique Constraint'),     
+    '#options' => array(
+      'title_year' => t('Title and Year'), 
+      'title_year_media' => t('Title, Year, Media name (e.g. Journal Name, etc.)'), 
+      'title_year_type' => t('Title, Year, Media type (e.g. Journal, Conference Proceedings, etc.'),
+    ),
+    '#description' => t('During import, Tripal will attempt to find duplicate publications. 
+       There are several options for how to find a duplicate publication.  Choose the
+       option that best suits your needs.'),
+    '#default_value' => variable_get('tripal_pub_import_duplicate_check', 'title_year_media'),
+  );
+}
 
 /**
  *
@@ -115,6 +139,9 @@ function tripal_pub_admin_validate($form, &$form_state) {
     }  
   }
   variable_set('tripal_pub_allowed_search_fields', $allowed_fields);
+  
+  $import_duplicate_check = $form_state['values']['import_duplicate_check'];
+  variable_set('tripal_pub_import_duplicate_check', $import_duplicate_check);
     
   // -------------------------------------
   // Submit the Cleanup Job if selected  

+ 11 - 5
tripal_pub/tripal_pub.module

@@ -189,7 +189,7 @@ function tripal_pub_menu() {
  */
 function tripal_pub_theme() {
 
-  return array(
+  $themes = array(
     // node templates
     'tripal_pub_base' => array(
       'arguments' => array('node' => NULL),
@@ -223,8 +223,10 @@ function tripal_pub_theme() {
     ),
     'chado_pub_node_form' => array(
        'arguments' => array('form'),
-    ),
+    ),   
   );
+  
+  return $themes;
 }
 
 /**
@@ -378,6 +380,10 @@ function chado_pub_insert($node) {
         $publisher = $value;
         unset($properties[$name]);
       }
+      elseif ($name == "Journal Name" or $name == "Conference Name") {
+        $node->series_name = $value;
+        unset($properties[$name]);
+      }
       elseif ($name == "Journal Country" or $name == "Published Location") {
         $pubplace = $value;
         unset($properties[$name]);
@@ -553,8 +559,8 @@ function chado_pub_update($node) {
         $publisher = $value;
         unset($properties[$name]);
       }
-      elseif ($name == "Journal Name") {
-        $series_name = $value;
+      elseif ($name == "Journal Name" or $name == "Conference Name") {
+        $node->series_name = $value;
         unset($properties[$name]);
       }
       elseif ($name == "Journal Country" or $name == "Published Location") {
@@ -579,7 +585,7 @@ function chado_pub_update($node) {
     'pyear'       => trim($node->pyear),
     'is_obsolete' => $node->is_obsolete ? 'true' : 'false', 
     'uniquename'  => trim($node->uniquename),
-    'series_name' => $series_name,
+    'series_name' => trim($node->series_name),
     'volumetitle' => $volumetitle,
     'volume'      => $volume,    
     'issue'       => $issue,    

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است