Author: jablko
Date: Thu Sep 17 16:54:39 2009
New Revision: 3396
Log:
Add optimistic lock to actor, information object, and repository forms
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 Thu Sep 17
16:52:40 2009 (r3395)
+++ trunk/apps/qubit/modules/actor/actions/editAction.class.php Thu Sep 17
16:54:39 2009 (r3396)
@@ -43,6 +43,11 @@
$this->form = new sfForm;
+ // Always 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();
$this->newName = new QubitActorName;
Modified:
trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
Thu Sep 17 16:52:40 2009 (r3395)
+++ trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
Thu Sep 17 16:54:39 2009 (r3396)
@@ -174,6 +174,11 @@
$this->form = new sfForm;
$this->form->getValidatorSchema()->setOption('allow_extra_fields', true);
+ // Always 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
$class = new ReflectionClass($this);
Modified: trunk/apps/qubit/modules/repository/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/repository/actions/editAction.class.php Thu Sep
17 16:52:40 2009 (r3395)
+++ trunk/apps/qubit/modules/repository/actions/editAction.class.php Thu Sep
17 16:54:39 2009 (r3396)
@@ -43,6 +43,11 @@
$this->form = new sfForm;
+ // Always 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
-~----------~----~----~----~------~----~------~--~---