Author: jablko
Date: Tue Oct 12 11:12:01 2010
New Revision: 8069

Log:
Cosmetic change

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

Modified: 
trunk/apps/qubit/modules/informationobject/actions/eventFormComponent.class.php
==============================================================================
--- 
trunk/apps/qubit/modules/informationobject/actions/eventFormComponent.class.php 
    Tue Oct 12 11:04:51 2010        (r8068)
+++ 
trunk/apps/qubit/modules/informationobject/actions/eventFormComponent.class.php 
    Tue Oct 12 11:12:01 2010        (r8069)
@@ -29,26 +29,20 @@
 {
   public function processForm()
   {
-    // If the eventDialog JavaScript has done it's work, then use the array of
-    // updated events
+    $updatedEvents = array($this->request->updateEvent);
     if (isset($this->request->updateEvents))
     {
+      // If event dialog JavaScript has done it's work, then use the array of
+      // updated events
       $updatedEvents = $this->request->updateEvents;
     }
 
-    // - else, grab the new event values from the "newEvent" form
-    else
-    {
-      $updatedEvents = array($this->request->updateEvent);
-    }
-
-    // Loop through actor events
-    foreach ($updatedEvents as $eventFormData)
+    foreach ($updatedEvents as $item)
     {
       // Create new event or update an existing one
-      if (isset($eventFormData['id']) && !isset($this->request->sourceId))
+      if (isset($item['id']) && !isset($this->request->sourceId))
       {
-        $params = 
$this->context->routing->parse(Qubit::pathInfo($eventFormData['id']));
+        $params = $this->context->routing->parse(Qubit::pathInfo($item['id']));
         if (!isset($params['id']) || null === $event = 
QubitEvent::getById($params['id']))
         {
           continue; // If we can't find the object, then skip this row
@@ -60,25 +54,25 @@
       }
 
       // Use existing actor if one is selected (overrides new actor creation)
-      if (0 < strlen($eventFormData['actor']))
+      if (0 < strlen($item['actor']))
       {
-        $params = 
$this->context->routing->parse(Qubit::pathInfo($eventFormData['actor']));
+        $params = 
$this->context->routing->parse(Qubit::pathInfo($item['actor']));
         $event->actorId = $params['id'];
       }
 
-      $event->startDate = $eventFormData['startDate'];
-      $event->endDate = $eventFormData['endDate'];
-      $event->dateDisplay = $eventFormData['dateDisplay'];
+      $event->startDate = $item['startDate'];
+      $event->endDate = $item['endDate'];
+      $event->dateDisplay = $item['dateDisplay'];
 
-      if (0 < strlen($eventFormData['type']))
+      if (0 < strlen($item['type']))
       {
-        $params = 
$this->context->routing->parse(Qubit::pathInfo($eventFormData['type']));
+        $params = 
$this->context->routing->parse(Qubit::pathInfo($item['type']));
         $event->typeId = $params['id'];
       }
 
-      if (0 < strlen($eventFormData['description']))
+      if (0 < strlen($item['description']))
       {
-        $event->description = $eventFormData['description'];
+        $event->description = $item['description'];
       }
       else
       {
@@ -86,13 +80,13 @@
       }
 
       // Save the event if it's valid (has an actor OR date)
-      if (0 < strlen($eventFormData['actor'])
-        || 0 < strlen($eventFormData['startDate'])
-        || 0 < strlen($eventFormData['endDate'])
-        || 0 < strlen($eventFormData['dateDisplay']))
+      if (0 < strlen($item['actor'])
+        || 0 < strlen($item['startDate'])
+        || 0 < strlen($item['endDate'])
+        || 0 < strlen($item['dateDisplay']))
       {
         // Update the "place" object term relation object
-        if (0 < strlen($eventFormData['place']))
+        if (0 < strlen($item['place']))
         {
           // If this event didn't exist or didn't have a 'place' associated
           if (null === $event->id || null === ($place = 
QubitObjectTermRelation::getOneByObjectId($event->id)))
@@ -100,7 +94,7 @@
             $place = new QubitObjectTermRelation;
           }
 
-          $params = 
$this->context->routing->parse(Qubit::pathInfo($eventFormData['place']));
+          $params = 
$this->context->routing->parse(Qubit::pathInfo($item['place']));
           $place->termId = $params['id'];
 
           $event->objectTermRelationsRelatedByobjectId[] = $place;

-- 
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.com/group/qubit-commits?hl=en.

Reply via email to