Author: david
Date: Thu Oct 22 16:52:47 2009
New Revision: 3805

Log:
Parse and save event actor ids on informationobect form submit.

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

Modified: 
trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/editAction.class.php     
Thu Oct 22 16:45:35 2009        (r3804)
+++ trunk/apps/qubit/modules/informationobject/actions/editAction.class.php     
Thu Oct 22 16:52:47 2009        (r3805)
@@ -589,20 +589,10 @@
       }
 
       // Use existing actor if one is selected (overrides new actor creation)
-      if (0 < $eventFormData['actorId'] && (null !== 
QubitActor::getById($eventFormData['actorId'])))
+      if (0 < strlen($eventFormData['actor']))
       {
-        $event->setActorId($eventFormData['actorId']);
-      }
-      else if (0 < strlen($eventFormData['newActorName']))
-      {
-        // Create actor
-        $actor = new QubitActor;
-        $actor->setAuthorizedFormOfName($eventFormData['newActorName']);
-        $actor->save();
-
-        // Assign actor to event
-        $event->setActorId($actor->getId());
-        $saveEvent = true;
+        $params = 
$this->context->routing->parse(preg_replace('/.*'.preg_quote($this->request->getPathInfoPrefix(),
 '/').'/', null, $eventFormData['actor']));
+        $event->actorId = $params['id'];
       }
 
       
$event->setStartDate(QubitDate::standardize($eventFormData['startDate']));

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