Prechádzať zdrojové kódy

Fixed bugs in contact module

Stephen Ficklin 11 rokov pred
rodič
commit
d733f38a27

+ 1 - 0
tripal_contact/includes/contact_sync.inc

@@ -79,6 +79,7 @@ function tripal_contact_sync_contacts($job_id = NULL) {
 
   while ($contact = $results->fetchObject()) {
     $new_node = new stdClass();
+    $new_node->uid = $user->uid;
     $new_node->contact_id = $contact->contact_id;
     $new_node->type = 'chado_contact';
     $new_node->title = $contact->name;

+ 8 - 3
tripal_contact/theme/tripal_contact/tripal_contact_teaser.tpl.php

@@ -7,9 +7,14 @@ $contact = $variables['node']->contact; ?>
     print l($node->title, "node/$node->nid", array('html' => TRUE));?>
   </div>
   <div class="tripal-contact-teaser-text tripal-teaser-text"><?php 
-    print substr($contact->description, 0, 650);
-    if (strlen($contact->description) > 650) {
-      print "... " . l("[more]", "node/$node->nid");
+    if ($contact->description) {
+      print substr($contact->description, 0, 650);
+      if (strlen($contact->description) > 650) {
+        print "... " . l("[more]", "node/$node->nid");
+      } 
+    } 
+    else {
+      print $node->title; 
     } ?>
   </div>
 </div>

+ 5 - 0
tripal_contact/tripal_contact.module

@@ -189,6 +189,11 @@ function tripal_contact_theme($existing, $type, $theme, $path) {
       'variables' =>  array(NULL),
       'path' => "$path/theme",
     ),
+    'tripal_contact_teaser' => array(
+      'variables' => array('node' => NULL),
+      'template' => 'tripal_contact_teaser',
+      'path' => "$path/theme/tripal_contact",
+    ),
   );
   return $items;
 }