diff --git a/SugarModules/custom/include/IBMConnections/Api/ActivitiesAPI.php b/SugarModules/custom/include/IBMConnections/Api/ActivitiesAPI.php index cacf5d3..779022d 100755 --- a/SugarModules/custom/include/IBMConnections/Api/ActivitiesAPI.php +++ b/SugarModules/custom/include/IBMConnections/Api/ActivitiesAPI.php @@ -523,6 +523,22 @@ public function markToDoCompleted($id, $completed = true) $this->httpClient = $this->getHttpClient(); $newEntry = IBMEditableAtomEntry::createEmptyEditableEntry(); $newEntry->addCategory('todo', 'http://www.ibm.com/xmlns/prod/sn/type', 'To Do'); + + $todoEntry = $this->getActivityNode($id); + $nodeList = $todoEntry->getAtom()->xquery("./snx:assignedto"); + if($nodeList->length > 0) { + $node = $nodeList->item(0); + $assignedTo = array( + "name" => $node->attributes->getNamedItem("name")->textContent, + "id" => $node->attributes->getNamedItem("userid")->textContent, + "email" => $node->textContent + ); + $assignedElt = $newEntry->getDom()->createElement('snx:assignedto'); + $assignedElt->setAttribute('name', $assignedTo['name']); + $assignedElt->setAttribute('userid', $assignedTo['id']); + $newEntry->getEntryNode()->appendChild($assignedElt); + } + if ($completed) { $newEntry->addCategory('completed', 'http://www.ibm.com/xmlns/prod/sn/flags', 'Completed'); } diff --git a/SugarModules/custom/include/IBMConnections/Models/ConnectionsActivity.php b/SugarModules/custom/include/IBMConnections/Models/ConnectionsActivity.php index d3f61f5..97fcac7 100755 --- a/SugarModules/custom/include/IBMConnections/Models/ConnectionsActivity.php +++ b/SugarModules/custom/include/IBMConnections/Models/ConnectionsActivity.php @@ -266,4 +266,9 @@ public static function createActivityNodeFromEntry(IBMAtomEntry $atomEntry, IBMA $GLOBALS['log']->fatal("Unrecognized Activity node type: " . $type['term']); } } + + public function getAtom() + { + return $this->atom; + } }