Author: jablko
Date: Tue Aug 11 13:02:45 2009
New Revision: 3007

Log:
Collect other common cases

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

Modified: 
trunk/apps/qubit/modules/informationobject/actions/editIsadAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/editIsadAction.class.php 
Tue Aug 11 12:51:57 2009        (r3006)
+++ trunk/apps/qubit/modules/informationobject/actions/editIsadAction.class.php 
Tue Aug 11 13:02:45 2009        (r3007)
@@ -277,42 +277,19 @@
 
             break;
 
+          case 'languageOfDescription':
           case 'languageOfMaterial':
-
-            if (!isset($this->languageOfMaterial))
-            {
-              $this->languageOfMaterial = new QubitProperty;
-              $this->languageOfMaterial->name = 'languageOfMaterial';
-              $this->informationObject->propertys[] = 
$this->languageOfMaterial;
-            }
-
-            $this->languageOfMaterial->__set('value', 
serialize($this->form->getValue('languageOfMaterial')), array('sourceCulture' 
=> true));
-
-            break;
-
           case 'scriptOfDescription':
-
-            if (!isset($this->scriptOfDescription))
-            {
-              $this->scriptOfDescription = new QubitProperty;
-              $this->scriptOfDescription->name = 'scriptOfDescription';
-              $this->informationObject->propertys[] = 
$this->scriptOfDescription;
-            }
-
-            $this->scriptOfDescription->__set('value', 
serialize($this->form->getValue('scriptOfDescription')), array('sourceCulture' 
=> true));
-
-            break;
-
           case 'scriptOfMaterial':
 
-            if (!isset($this->scriptOfMaterial))
+            if (!isset($this[$field->getName()]))
             {
-              $this->scriptOfMaterial = new QubitProperty;
-              $this->scriptOfMaterial->name = 'scriptOfMaterial';
-              $this->informationObject->propertys[] = $this->scriptOfMaterial;
+              $this[$field->getName()] = new QubitProperty;
+              $this[$field->getName()]->name = $field->getName();
+              $this->informationObject->propertys[] = $this[$field->getName()];
             }
 
-            $this->scriptOfMaterial->__set('value', 
serialize($this->form->getValue('scriptOfMaterial')), array('sourceCulture' => 
true));
+            $this[$field->getName()]->__set('value', 
serialize($this->form->getValue($field->getName())), array('sourceCulture' => 
true));
 
             break;
 

Modified: 
trunk/apps/qubit/modules/informationobject/actions/editRadAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/editRadAction.class.php  
Tue Aug 11 12:51:57 2009        (r3006)
+++ trunk/apps/qubit/modules/informationobject/actions/editRadAction.class.php  
Tue Aug 11 13:02:45 2009        (r3007)
@@ -474,265 +474,47 @@
       {
         switch ($field->getName())
         {
-          case 'editionStatementOfResponsibility':
-
-            if (!isset($this->editionStatementOfResponsibility))
-            {
-              $this->editionStatementOfResponsibility = new QubitProperty;
-              $this->editionStatementOfResponsibility->name = 
'editionStatementOfResponsibility';
-              $this->editionStatementOfResponsibility->scope = 'rad';
-              $this->informationObject->propertys[] = 
$this->editionStatementOfResponsibility;
-            }
-
-            $this->editionStatementOfResponsibility->value = 
serialize($this->form->getValue('editionStatementOfResponsibility'));
-
-            break;
-
-          case 'issuingJurisdictionAndDenomination':
-
-            if (!isset($this->issuingJurisdictionAndDenomination))
-            {
-              $this->issuingJurisdictionAndDenomination = new QubitProperty;
-              $this->issuingJurisdictionAndDenomination->name = 
'issuingJurisdictionAndDenomination';
-              $this->issuingJurisdictionAndDenomination->scope = 'rad';
-              $this->informationObject->propertys[] = 
$this->issuingJurisdictionAndDenomination;
-            }
-
-            $this->issuingJurisdictionAndDenomination->value = 
serialize($this->form->getValue('issuingJurisdictionAndDenomination'));
-
-            break;
-
           case 'language':
-
-            if (!isset($this->language))
-            {
-              $this->language = new QubitProperty;
-              $this->language->name = 'language';
-              $this->informationObject->propertys[] = $this->language;
-            }
-
-            $this->language->__set('value', 
serialize($this->form->getValue('language')), array('sourceCulture' => true));
-
-            break;
-
           case 'languageOfDescription':
+          case 'script':
+          case 'scriptOfDescription':
 
-            if (!isset($this->languageOfDescription))
+            if (!isset($this[$field->getName()]))
             {
-              $this->languageOfDescription = new QubitProperty;
-              $this->languageOfDescription->name = 'languageOfDescription';
-              $this->informationObject->propertys[] = 
$this->languageOfDescription;
+              $this[$field->getName()] = new QubitProperty;
+              $this[$field->getName()]->name = $fiel->getName();
+              $this->informationObject->propertys[] = $this[$field->getName()];
             }
 
-            $this->languageOfDescription->__set('value', 
serialize($this->form->getValue('languageOfDescription')), 
array('sourceCulture' => true));
+            $this[$field->getName()]->__set('value', 
serialize($this->form->getValue($field->getName())), array('sourceCulture' => 
true));
 
             break;
 
+          case 'editionStatementOfResponsibility':
+          case 'issuingJurisdictionAndDenomination':
           case 'noteOnPublishersSeries':
-
-            if (!isset($this->noteOnPublishersSeries))
-            {
-              $this->noteOnPublishersSeries = new QubitProperty;
-              $this->noteOnPublishersSeries->name = 'noteOnPublishersSeries';
-              $this->noteOnPublishersSeries->scope = 'rad';
-              $this->informationObject->propertys[] = 
$this->noteOnPublishersSeries;
-            }
-
-            $this->noteOnPublishersSeries->value = 
serialize($this->form->getValue('noteOnPublishersSeries'));
-
-            break;
-
           case 'numberingWithinPublishersSeries':
-
-            if (!isset($this->numberingWithinPublishersSeries))
-            {
-              $this->numberingWithinPublishersSeries = new QubitProperty;
-              $this->numberingWithinPublishersSeries->name = 
'numberingWithinPublishersSeries';
-              $this->numberingWithinPublishersSeries->scope = 'rad';
-              $this->informationObject->propertys[] = 
$this->numberingWithinPublishersSeries;
-            }
-
-            $this->numberingWithinPublishersSeries->value = 
serialize($this->form->getValue('numberingWithinPublishersSeries'));
-
-            break;
-
           case 'otherTitleInformation':
-
-            if (!isset($this->otherTitleInformation))
-            {
-              $this->otherTitleInformation = new QubitProperty;
-              $this->otherTitleInformation->name = 'otherTitleInformation';
-              $this->otherTitleInformation->scope = 'rad';
-              $this->informationObject->propertys[] = 
$this->otherTitleInformation;
-            }
-
-            $this->otherTitleInformation->value = 
serialize($this->form->getValue('otherTitleInformation'));
-
-            break;
-
           case 'otherTitleInformationOfPublishersSeries':
-
-            if (!isset($this->otherTitleInformationOfPublishersSeries))
-            {
-              $this->otherTitleInformationOfPublishersSeries = new 
QubitProperty;
-              $this->otherTitleInformationOfPublishersSeries->name = 
'otherTitleInformationOfPublishersSeries';
-              $this->otherTitleInformationOfPublishersSeries->scope = 'rad';
-              $this->informationObject->propertys[] = 
$this->otherTitleInformationOfPublishersSeries;
-            }
-
-            $this->otherTitleInformationOfPublishersSeries->value = 
serialize($this->form->getValue('otherTitleInformationOfPublishersSeries'));
-
-            break;
-
           case 'parallelTitleOfPublishersSeries':
-
-            if (!isset($this->parallelTitleOfPublishersSeries))
-            {
-              $this->parallelTitleOfPublishersSeries = new QubitProperty;
-              $this->parallelTitleOfPublishersSeries->name = 
'parallelTitleOfPublishersSeries';
-              $this->parallelTitleOfPublishersSeries->scope = 'rad';
-              $this->informationObject->propertys[] = 
$this->parallelTitleOfPublishersSeries;
-            }
-
-            $this->parallelTitleOfPublishersSeries->value = 
serialize($this->form->getValue('parallelTitleOfPublishersSeries'));
-
-            break;
-
-          case 'script':
-
-            if (!isset($this->script))
-            {
-              $this->script = new QubitProperty;
-              $this->script->name = 'script';
-              $this->informationObject->propertys[] = $this->script;
-            }
-
-            $this->script->__set('value', 
serialize($this->form->getValue('script')), array('sourceCulture' => true));
-
-            break;
-
-          case 'scriptOfDescription':
-
-            if (!isset($this->scriptOfDescription))
-            {
-              $this->scriptOfDescription = new QubitProperty;
-              $this->scriptOfDescription->name = 'scriptOfDescription';
-              $this->informationObject->propertys[] = 
$this->scriptOfDescription;
-            }
-
-            $this->scriptOfDescription->__set('value', 
serialize($this->form->getValue('scriptOfDescription')), array('sourceCulture' 
=> true));
-
-            break;
-
           case 'standardNumber':
-
-            if (!isset($this->standardNumber))
-            {
-              $this->standardNumber = new QubitProperty;
-              $this->standardNumber->name = 'standardNumber';
-              $this->standardNumber->scope = 'rad';
-              $this->informationObject->propertys[] = $this->standardNumber;
-            }
-
-            $this->standardNumber->value = 
serialize($this->form->getValue('standardNumber'));
-
-            break;
-
           case 'statementOfCoordinates':
-
-            if (!isset($this->statementOfCoordinates))
-            {
-              $this->statementOfCoordinates = new QubitProperty;
-              $this->statementOfCoordinates->name = 'statementOfCoordinates';
-              $this->statementOfCoordinates->scope = 'rad';
-              $this->informationObject->propertys[] = 
$this->statementOfCoordinates;
-            }
-
-            $this->statementOfCoordinates->value = 
serialize($this->form->getValue('statementOfCoordinates'));
-
-            break;
-
           case 'statementOfProjection':
-
-            if (!isset($this->statementOfProjection))
-            {
-              $this->statementOfProjection = new QubitProperty;
-              $this->statementOfProjection->name = 'statementOfProjection';
-              $this->statementOfProjection->scope = 'rad';
-              $this->informationObject->propertys[] = 
$this->statementOfProjection;
-            }
-
-            $this->statementOfProjection->value = 
serialize($this->form->getValue('statementOfProjection'));
-
-            break;
-
           case 'statementOfResponsibilityRelatingToPublishersSeries':
-
-            if 
(!isset($this->statementOfResponsibilityRelatingToPublishersSeries))
-            {
-              $this->statementOfResponsibilityRelatingToPublishersSeries = new 
QubitProperty;
-              $this->statementOfResponsibilityRelatingToPublishersSeries->name 
= 'statementOfResponsibilityRelatingToPublishersSeries';
-              
$this->statementOfResponsibilityRelatingToPublishersSeries->scope = 'rad';
-              $this->informationObject->propertys[] = 
$this->statementOfResponsibilityRelatingToPublishersSeries;
-            }
-
-            $this->statementOfResponsibilityRelatingToPublishersSeries->value 
= 
serialize($this->form->getValue('statementOfResponsibilityRelatingToPublishersSeries'));
-
-            break;
-
           case 'statementOfScaleArchitectural':
-
-            if (!isset($this->statementOfScaleArchitectural))
-            {
-              $this->statementOfScaleArchitectural = new QubitProperty;
-              $this->statementOfScaleArchitectural->name = 
'statementOfScaleArchitectural';
-              $this->statementOfScaleArchitectural->scope = 'rad';
-              $this->informationObject->propertys[] = 
$this->statementOfScaleArchitectural;
-            }
-
-            $this->statementOfScaleArchitectural->value = 
serialize($this->form->getValue('statementOfScaleArchitectural'));
-
-            break;
-
           case 'statementOfScaleCartographic':
-
-            if (!isset($this->statementOfScaleCartographic))
-            {
-              $this->statementOfScaleCartographic = new QubitProperty;
-              $this->statementOfScaleCartographic->name = 
'statementOfScaleCartographic';
-              $this->statementOfScaleCartographic->scope = 'rad';
-              $this->informationObject->propertys[] = 
$this->statementOfScaleCartographic;
-            }
-
-            $this->statementOfScaleCartographic->value = 
serialize($this->form->getValue('statementOfScaleCartographic'));
-
-            break;
-
           case 'titleProperOfPublishersSeries':
-
-            if (!isset($this->titleProperOfPublishersSeries))
-            {
-              $this->titleProperOfPublishersSeries = new QubitProperty;
-              $this->titleProperOfPublishersSeries->name = 
'titleProperOfPublishersSeries';
-              $this->titleProperOfPublishersSeries->scope = 'rad';
-              $this->informationObject->propertys[] = 
$this->titleProperOfPublishersSeries;
-            }
-
-            $this->titleProperOfPublishersSeries->value = 
serialize($this->form->getValue('titleProperOfPublishersSeries'));
-
-            break;
-
           case 'titleStatementOfResponsibility':
 
-            if (!isset($this->titleStatementOfResponsibility))
+            if (!isset($this[$field->getName()]))
             {
-              $this->titleStatementOfResponsibility = new QubitProperty;
-              $this->titleStatementOfResponsibility->name = 
'titleStatementOfResponsibility';
-              $this->titleStatementOfResponsibility->scope = 'rad';
-              $this->informationObject->propertys[] = 
$this->titleStatementOfResponsibility;
+              $this[$field->getName()] = new QubitProperty;
+              $this[$field->getName()]->name = $field->getName();
+              $this[$field->getName()]->scope = 'rad';
+              $this->informationObject->propertys[] = $this[$field->getName()];
             }
 
-            $this->titleStatementOfResponsibility->value = 
serialize($this->form->getValue('titleStatementOfResponsibility'));
+            $this[$field->getName()]->value = 
serialize($this->form->getValue($field->getName()));
 
             break;
 

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