Author: david
Date: Tue Aug 11 11:16:29 2009
New Revision: 2997

Log:
Don't show name of parent term in 'broad term' input if parent is root term.  
Assign orpan terms to children of root term.

Modified:
   trunk/apps/qubit/modules/term/actions/editAction.class.php

Modified: trunk/apps/qubit/modules/term/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/term/actions/editAction.class.php  Tue Aug 11 
11:12:43 2009        (r2996)
+++ trunk/apps/qubit/modules/term/actions/editAction.class.php  Tue Aug 11 
11:16:29 2009        (r2997)
@@ -75,9 +75,9 @@
     // Populate current values for term
     if (null !== $this->term->id)
     {
-      if (null === ($this->parent = $this->term->getParent()))
+      if (QubitTerm::ROOT_ID != $this->term->parentId)
       {
-        $this->parent = new QubitTerm;
+        $this->parent = $this->term->getParent();
       }
 
       $this->scopeNotes = $this->term->getNotesByType($noteTypeId = 
QubitTerm::SCOPE_NOTE_ID, $exclude = null);
@@ -227,14 +227,10 @@
 
   public function updateParent()
   {
-    // If broad term is empty then skip term search
+    // If broad term field is empty then make term a child of the root term
     if (0 == strlen(trim($this->getRequestParameter('broad_term'))))
     {
-      // if this term currently has a parent, clear the parent
-      if (null !== $this->term->parentId)
-      {
-        $this->term->setParentId(null);
-      }
+      $this->term->parentId = QubitTerm::ROOT_ID;
 
       return $this;
     }

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to