Author: jablko
Date: Thu Oct 14 15:57:26 2010
New Revision: 8132

Log:
Add $isdiah

Added:
   trunk/plugins/sfIsdiahPlugin/lib/
   trunk/plugins/sfIsdiahPlugin/lib/sfIsdiahPlugin.class.php   (contents, props 
changed)
Modified:
   
trunk/plugins/sfIsdiahPlugin/modules/sfIsdiahPlugin/actions/editAction.class.php
   
trunk/plugins/sfIsdiahPlugin/modules/sfIsdiahPlugin/actions/indexAction.class.php

Added: trunk/plugins/sfIsdiahPlugin/lib/sfIsdiahPlugin.class.php
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/plugins/sfIsdiahPlugin/lib/sfIsdiahPlugin.class.php   Thu Oct 14 
15:57:26 2010        (r8132)
@@ -0,0 +1,8 @@
+<?php
+
+/*
+ */
+
+class sfIsdiahPlugin extends sfIsaarPlugin
+{
+}

Modified: 
trunk/plugins/sfIsdiahPlugin/modules/sfIsdiahPlugin/actions/editAction.class.php
==============================================================================
--- 
trunk/plugins/sfIsdiahPlugin/modules/sfIsdiahPlugin/actions/editAction.class.php
    Thu Oct 14 15:47:41 2010        (r8131)
+++ 
trunk/plugins/sfIsdiahPlugin/modules/sfIsdiahPlugin/actions/editAction.class.php
    Thu Oct 14 15:57:26 2010        (r8132)
@@ -60,4 +60,11 @@
       'script',
       'descSources',
       'maintenanceNotes');
+
+  protected function earlyExecute()
+  {
+    parent::earlyExecute();
+
+    $this->isdiah = new sfIsdiahPlugin($this->resource);
+  }
 }

Modified: 
trunk/plugins/sfIsdiahPlugin/modules/sfIsdiahPlugin/actions/indexAction.class.php
==============================================================================
--- 
trunk/plugins/sfIsdiahPlugin/modules/sfIsdiahPlugin/actions/indexAction.class.php
   Thu Oct 14 15:47:41 2010        (r8131)
+++ 
trunk/plugins/sfIsdiahPlugin/modules/sfIsdiahPlugin/actions/indexAction.class.php
   Thu Oct 14 15:57:26 2010        (r8132)
@@ -30,19 +30,24 @@
 {
   public function execute($request)
   {
-    // run the core repository show action commands
     parent::execute($request);
 
-    // add ISDIAH specific commands
+    $this->isdiah = new sfIsdiahPlugin($this->resource);
+
     if (QubitAcl::check($this->resource, 'update'))
     {
       $validatorSchema = new sfValidatorSchema;
+      $valuess = array();
+
       $validatorSchema->authorizedFormOfName = new sfValidatorString(array(
         'required' => true), array(
         'required' => $this->context->i18n->__('%1%Authorized form of name%2% 
- This is a %3%mandatory%4% element.', array('%1%' => '<a 
href="http://ica-atom.org/doc/RS-3#5.1.2";>', '%2%' => '</a>', '%3%' => '<a 
href="http://ica-atom.org/doc/RS-3#4.7";>', '%4%' => '</a>'))));
+      $values['authorizedFormOfName'] = 
$this->resource->getAuthorizedFormOfName(array('culltureFallback' => true));
+
       $validatorSchema->identifier = new sfValidatorString(array(
         'required' => true), array(
         'required' => $this->context->i18n->__('%1%Identifier%2% - This is a 
%3%mandatory%4% element.', array('%1%' => '<a 
href="http://ica-atom.org/doc/RS-3#5.1.1";>', '%2%' => '</a>', '%3%' => '<a 
href="http://ica-atom.org/doc/RS-3#4.7";>', '%4%' => '</a>'))));
+      $values['identifier'] = $this->resource->identifier;
 
       $validatorSchema->primaryContact = new sfValidatorAnd(array(
         new QubitValidatorCountable,
@@ -57,21 +62,18 @@
         'required' => true), array(
         'required' => $this->context->i18n->__('%1%Contact information%2% - 
This is a %3%mandatory%4% element.', array('%1%' => '<a 
href="http://ica-atom.org/doc/RS-3#5.2.1";>', '%2%' => '</a>', '%3%' => '<a 
href="http://ica-atom.org/doc/RS-3#4.7";>', '%4%' => '</a>'))));
 
-      $value = array();
-      $value['identifier'] = $this->resource->identifier;
-      $value['authorizedFormOfName'] = 
$this->resource->getAuthorizedFormOfName(array('culltureFallback' => true));
       if (null !== $this->resource->getPrimaryContact())
       {
-        $value['primaryContact']['city'] = 
$this->resource->getPrimaryContact()->getCity(array('culltureFallback' => 
true));
-        $value['primaryContact']['countryCode'] = 
$this->resource->getPrimaryContact()->countryCode;
-        $value['primaryContact']['postalCode'] = 
$this->resource->getPrimaryContact()->postalCode;
-        $value['primaryContact']['region'] = 
$this->resource->getPrimaryContact()->getRegion(array('culltureFallback' => 
true));
-        $value['primaryContact']['streetAddress'] = 
$this->resource->getPrimaryContact()->streetAddress;
+        $values['primaryContact']['city'] = 
$this->resource->getPrimaryContact()->getCity(array('culltureFallback' => 
true));
+        $values['primaryContact']['countryCode'] = 
$this->resource->getPrimaryContact()->countryCode;
+        $values['primaryContact']['postalCode'] = 
$this->resource->getPrimaryContact()->postalCode;
+        $values['primaryContact']['region'] = 
$this->resource->getPrimaryContact()->getRegion(array('culltureFallback' => 
true));
+        $values['primaryContact']['streetAddress'] = 
$this->resource->getPrimaryContact()->streetAddress;
       }
 
       try
       {
-        $validatorSchema->clean($value);
+        $validatorSchema->clean($values);
       }
       catch (sfValidatorErrorSchema $e)
       {

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