Author: sevein
Date: Wed Sep 30 15:29:46 2009
New Revision: 3620

Log:
Add new property called qubit_id to textnodes (treeview) which content the id 
of the qubit object which represent. This makes easyer to handle parent 
parameter from moveAction and allow us to move a term to root nodes when they 
are shown with different hrefs (e.g.: taxonomies).

Modified:
   trunk/apps/qubit/modules/informationobject/actions/moveAction.class.php
   trunk/apps/qubit/modules/term/actions/moveAction.class.php
   trunk/web/js/treeView.js

Modified: 
trunk/apps/qubit/modules/informationobject/actions/moveAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/moveAction.class.php     
Wed Sep 30 15:23:32 2009        (r3619)
+++ trunk/apps/qubit/modules/informationobject/actions/moveAction.class.php     
Wed Sep 30 15:29:46 2009        (r3620)
@@ -39,8 +39,7 @@
 
       if ($this->form->isValid())
       {
-        $params = 
$this->context->routing->parse(preg_replace('/.*'.preg_quote($this->request->getPathInfoPrefix(),
 '/').'/', null, $this->form->getValue('parent')));
-        $this->informationObject->parentId = $params['id'];
+        $this->informationObject->parentId = $this->form->getValue('parent');
 
         $this->informationObject->save();
 

Modified: trunk/apps/qubit/modules/term/actions/moveAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/term/actions/moveAction.class.php  Wed Sep 30 
15:23:32 2009        (r3619)
+++ trunk/apps/qubit/modules/term/actions/moveAction.class.php  Wed Sep 30 
15:29:46 2009        (r3620)
@@ -39,8 +39,7 @@
 
       if ($this->form->isValid())
       {
-        $params = 
$this->context->routing->parse(preg_replace('/.*'.preg_quote($this->request->getPathInfoPrefix(),
 '/').'/', null, $this->form->getValue('parent')));
-        $this->term->parentId = $params['id'];
+        $this->term->parentId = $this->form->getValue('parent');
 
         $this->term->save();
 

Modified: trunk/web/js/treeView.js
==============================================================================
--- trunk/web/js/treeView.js    Wed Sep 30 15:23:32 2009        (r3619)
+++ trunk/web/js/treeView.js    Wed Sep 30 15:29:46 2009        (r3620)
@@ -12,6 +12,7 @@
           var object = objects.shift();
           var textNode = new YAHOO.widget.TextNode(object, parentNode, 
expands[object.id] !== undefined);
           textNode.isLeaf = object.isLeaf;
+          textNode.qubit_id = object.id;
 
           if (Qubit.treeView.draggable)
           {
@@ -23,7 +24,7 @@
                 var newParent = parentNode.tree.getNodeByElement($('#' + 
id)[0]);
 
                 jQuery.ajax({
-                  data: { parent: newParent.href },
+                  data: { parent: newParent.qubit_id },
                   type: 'POST',
                   url: 
textNode.href.replace(/\/(informationobject|term)\/\D*(\d+)/, '/$1/move/$2')});
 
@@ -73,7 +74,7 @@
                     var newParent = node.tree.getNodeByElement($('#' + id)[0]);
 
                     jQuery.ajax({
-                      data: { parent: newParent.href },
+                      data: { parent: newParent.qubit_id },
                       type: 'POST',
                       url: 
tmp.href.replace(/\/(informationobject|term)\/\D*(\d+)/, '/$1/move/$2')});
 

--~--~---------~--~----~------------~-------~--~----~
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