Author: jablko
Date: Fri Sep 18 11:40:36 2009
New Revision: 3410

Log:
Only add optimistic lock to forms for existing objects

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

Modified: trunk/apps/qubit/modules/actor/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/actor/actions/editAction.class.php Fri Sep 18 
11:38:48 2009        (r3409)
+++ trunk/apps/qubit/modules/actor/actions/editAction.class.php Fri Sep 18 
11:40:36 2009        (r3410)
@@ -43,12 +43,12 @@
       {
         $this->forward404();
       }
-    }
 
-    // Always add optimistic lock
-    $this->form->setDefault('serialNumber', $this->actor->serialNumber);
-    $this->form->setValidator('serialNumber', new sfValidatorInteger);
-    $this->form->setWidget('serialNumber', new sfWidgetFormInputHidden);
+      // Add optimistic lock
+      $this->form->setDefault('serialNumber', $this->actor->serialNumber);
+      $this->form->setValidator('serialNumber', new sfValidatorInteger);
+      $this->form->setWidget('serialNumber', new sfWidgetFormInputHidden);
+    }
 
     //Other Forms of Name
     $this->otherNames = $this->actor->getOtherNames();

Modified: 
trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/editAction.class.php     
Fri Sep 18 11:38:48 2009        (r3409)
+++ trunk/apps/qubit/modules/informationobject/actions/editAction.class.php     
Fri Sep 18 11:40:36 2009        (r3410)
@@ -172,12 +172,12 @@
       {
         $this->forward404();
       }
-    }
 
-    // Always add optimistic lock
-    $this->form->setDefault('serialNumber', 
$this->informationObject->serialNumber);
-    $this->form->setValidator('serialNumber', new sfValidatorInteger);
-    $this->form->setWidget('serialNumber', new sfWidgetFormInputHidden);
+      // Add optimistic lock
+      $this->form->setDefault('serialNumber', 
$this->informationObject->serialNumber);
+      $this->form->setValidator('serialNumber', new sfValidatorInteger);
+      $this->form->setWidget('serialNumber', new sfWidgetFormInputHidden);
+    }
 
     // HACK: Use static::$NAMES in PHP 5.3,
     // http://php.net/oop5.late-static-bindings

Modified: trunk/apps/qubit/modules/repository/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/repository/actions/editAction.class.php    Fri Sep 
18 11:38:48 2009        (r3409)
+++ trunk/apps/qubit/modules/repository/actions/editAction.class.php    Fri Sep 
18 11:40:36 2009        (r3410)
@@ -43,12 +43,12 @@
       {
         $this->forward404();
       }
-    }
 
-    // Always add optimistic lock
-    $this->form->setDefault('serialNumber', $this->repository->serialNumber);
-    $this->form->setValidator('serialNumber', new sfValidatorInteger);
-    $this->form->setWidget('serialNumber', new sfWidgetFormInputHidden);
+      // Add optimistic lock
+      $this->form->setDefault('serialNumber', $this->repository->serialNumber);
+      $this->form->setValidator('serialNumber', new sfValidatorInteger);
+      $this->form->setWidget('serialNumber', new sfWidgetFormInputHidden);
+    }
 
     $this->contactInformation = $this->repository->getContactInformation();
     $this->newContactInformation = new QubitContactInformation;

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