Author: jablko
Date: Tue Aug 11 12:06:38 2009
New Revision: 3003

Log:
Use switch to collect some common cases

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

Modified: 
trunk/apps/qubit/modules/informationobject/actions/editDcAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/editDcAction.class.php   
Tue Aug 11 11:50:40 2009        (r3002)
+++ trunk/apps/qubit/modules/informationobject/actions/editDcAction.class.php   
Tue Aug 11 12:06:38 2009        (r3003)
@@ -108,21 +108,6 @@
       {
         switch ($field->getName())
         {
-          case 'accessConditions':
-            $this->informationObject->accessConditions = 
$this->form->getValue('accessConditions');
-
-            break;
-
-          case 'extentAndMedium':
-            $this->informationObject->extentAndMedium = 
$this->form->getValue('extentAndMedium');
-
-            break;
-
-          case 'identifier':
-            $this->informationObject->identifier = 
$this->form->getValue('identifier');
-
-            break;
-
           case 'language':
 
             if (!isset($this->language))
@@ -136,11 +121,6 @@
 
             break;
 
-          case 'locationOfOriginals':
-            $this->informationObject->locationOfOriginals = 
$this->form->getValue('locationOfOriginals');
-
-            break;
-
           case 'relation':
 
             if (!isset($this->relation))
@@ -155,16 +135,6 @@
 
             break;
 
-          case 'scopeAndContent':
-            $this->informationObject->scopeAndContent = 
$this->form->getValue('scopeAndContent');
-
-            break;
-
-          case 'title':
-            $this->informationObject->title = $this->form->getValue('title');
-
-            break;
-
           case 'typeIds':
             $filtered = $flipped = 
array_flip($this->form->getValue('typeIds'));
 
@@ -194,6 +164,16 @@
             }
 
             break;
+
+          case 'accessConditions':
+          case 'extentAndMedium':
+          case 'identifier':
+          case 'locationOfOriginals':
+          case 'scopeAndContent':
+          case 'title':
+            $this->informationObject[$field->getName()] = 
$this->form->getValue($field->getName());
+
+            break;
         }
       }
     }

Modified: 
trunk/apps/qubit/modules/informationobject/actions/editIsadAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/editIsadAction.class.php 
Tue Aug 11 11:50:40 2009        (r3002)
+++ trunk/apps/qubit/modules/informationobject/actions/editIsadAction.class.php 
Tue Aug 11 12:06:38 2009        (r3003)
@@ -246,36 +246,6 @@
       {
         switch ($field->getName())
         {
-          case 'accessConditions':
-            $this->informationObject->accessConditions = 
$this->form->getValue('accessConditions');
-
-            break;
-
-          case 'accruals':
-            $this->informationObject->accruals = 
$this->form->getValue('accruals');
-
-            break;
-
-          case 'acquisition':
-            $this->informationObject->acquisition = 
$this->form->getValue('acquisition');
-
-            break;
-
-          case 'appraisal':
-            $this->informationObject->appraisal = 
$this->form->getValue('appraisal');
-
-            break;
-
-          case 'archivalHistory':
-            $this->informationObject->archivalHistory = 
$this->form->getValue('archivalHistory');
-
-            break;
-
-          case 'arrangement':
-            $this->informationObject->arrangement = 
$this->form->getValue('arrangement');
-
-            break;
-
           case 'creatorIds':
             $filtered = $flipped = 
array_flip($this->form->getValue('creatorIds'));
 
@@ -307,31 +277,6 @@
 
             break;
 
-          case 'descriptionIdentifier':
-            $this->informationObject->descriptionIdentifier = 
$this->form->getValue('descriptionIdentifier');
-
-            break;
-
-          case 'extentAndMedium':
-            $this->informationObject->extentAndMedium = 
$this->form->getValue('extentAndMedium');
-
-            break;
-
-          case 'findingAids':
-            $this->informationObject->findingAids = 
$this->form->getValue('findingAids');
-
-            break;
-
-          case 'identifier':
-            $this->informationObject->identifier = 
$this->form->getValue('identifier');
-
-            break;
-
-          case 'institutionResponsibleIdentifier':
-            $this->informationObject->institutionResponsibleIdentifier = 
$this->form->getValue('institutionResponsibleIdentifier');
-
-            break;
-
           case 'languageOfMaterial':
 
             if (!isset($this->languageOfMaterial))
@@ -350,51 +295,6 @@
 
             break;
 
-          case 'locationOfCopies':
-            $this->informationObject->locationOfCopies = 
$this->form->getValue('locationOfCopies');
-
-            break;
-
-          case 'locationOfOriginals':
-            $this->informationObject->locationOfOriginals = 
$this->form->getValue('locationOfOriginals');
-
-            break;
-
-          case 'physicalCharacteristics':
-            $this->informationObject->physicalCharacteristics = 
$this->form->getValue('physicalCharacteristics');
-
-            break;
-
-          case 'relatedUnitsOfDescription':
-            $this->informationObject->relatedUnitsOfDescription = 
$this->form->getValue('relatedUnitsOfDescription');
-
-            break;
-
-          case 'repositoryId':
-            $this->informationObject->repositoryId = 
$this->form->getValue('repositoryId');
-
-            break;
-
-          case 'reproductionConditions':
-            $this->informationObject->reproductionConditions = 
$this->form->getValue('reproductionConditions');
-
-            break;
-
-          case 'revisionHistory':
-            $this->informationObject->revisionHistory = 
$this->form->getValue('revisionHistory');
-
-            break;
-
-          case 'rules':
-            $this->informationObject->rules = $this->form->getValue('rules');
-
-            break;
-
-          case 'scopeAndContent':
-            $this->informationObject->scopeAndContent = 
$this->form->getValue('scopeAndContent');
-
-            break;
-
           case 'scriptOfDescription':
 
             if (!isset($this->scriptOfDescription))
@@ -421,18 +321,34 @@
 
             break;
 
-          case 'sources':
-            $this->informationObject->sources = 
$this->form->getValue('sources');
-
-            break;
-
           case 'statusId':
             $this->informationObject->descriptionStatusId = 
$this->form->getValue('statusId');
 
             break;
 
+          case 'accessConditions':
+          case 'accruals':
+          case 'acquisition':
+          case 'appraisal':
+          case 'archivalHistory':
+          case 'arrangement':
+          case 'descriptionIdentifier':
+          case 'extentAndMedium':
+          case 'findingAids':
+          case 'identifier':
+          case 'institutionResponsibleIdentifier':
+          case 'locationOfCopies':
+          case 'locationOfOriginals':
+          case 'physicalCharacteristics':
+          case 'relatedUnitsOfDescription':
+          case 'repositoryId':
+          case 'reproductionConditions':
+          case 'revisionHistory':
+          case 'rules':
+          case 'scopeAndContent':
+          case 'sources':
           case 'title':
-            $this->informationObject->title = $this->form->getValue('title');
+            $this->informationObject[$field->getName()] = 
$this->form->getValue($field->getName());
 
             break;
         }

Modified: 
trunk/apps/qubit/modules/informationobject/actions/editModsAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/editModsAction.class.php 
Tue Aug 11 11:50:40 2009        (r3002)
+++ trunk/apps/qubit/modules/informationobject/actions/editModsAction.class.php 
Tue Aug 11 12:06:38 2009        (r3003)
@@ -78,16 +78,6 @@
       {
         switch ($field->getName())
         {
-          case 'accessConditions':
-            $this->informationObject->accessConditions = 
$this->form->getValue('accessConditions');
-
-            break;
-
-          case 'identifier':
-            $this->informationObject->identifier = 
$this->form->getValue('identifier');
-
-            break;
-
           case 'language':
 
             if (!isset($this->language))
@@ -101,11 +91,6 @@
 
             break;
 
-          case 'title':
-            $this->informationObject->title = $this->form->getValue('title');
-
-            break;
-
           case 'typeIds':
             $filtered = $flipped = 
array_flip($this->form->getValue('typeIds'));
 
@@ -135,6 +120,13 @@
             }
 
             break;
+
+          case 'accessConditions':
+          case 'identifier':
+          case 'title':
+            $this->informationObject[$field->getName()] = 
$this->form->getValue($field->getName());
+
+            break;
         }
       }
     }

Modified: 
trunk/apps/qubit/modules/informationobject/actions/editRadAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/editRadAction.class.php  
Tue Aug 11 11:50:40 2009        (r3002)
+++ trunk/apps/qubit/modules/informationobject/actions/editRadAction.class.php  
Tue Aug 11 12:06:38 2009        (r3003)
@@ -474,46 +474,6 @@
       {
         switch ($field->getName())
         {
-          case 'accessConditions':
-            $this->informationObject->accessConditions = 
$this->form->getValue('accessConditions');
-
-            break;
-
-          case 'accruals':
-            $this->informationObject->accruals = 
$this->form->getValue('accruals');
-
-            break;
-
-          case 'acquisition':
-            $this->informationObject->acquisition = 
$this->form->getValue('acquisition');
-
-            break;
-
-          case 'alternateTitle':
-            $this->informationObject->alternateTitle = 
$this->form->getValue('alternateTitle');
-
-            break;
-
-          case 'archivalHistory':
-            $this->informationObject->archivalHistory = 
$this->form->getValue('archivalHistory');
-
-            break;
-
-          case 'arrangement':
-            $this->informationObject->arrangement = 
$this->form->getValue('arrangement');
-
-            break;
-
-          case 'descriptionIdentifier':
-            $this->informationObject->descriptionIdentifier = 
$this->form->getValue('descriptionIdentifier');
-
-            break;
-
-          case 'edition':
-            $this->informationObject->edition = 
$this->form->getValue('edition');
-
-            break;
-
           case 'editionStatementOfResponsibility':
 
             if (!isset($this->editionStatementOfResponsibility))
@@ -528,26 +488,6 @@
 
             break;
 
-          case 'extentAndMedium':
-            $this->informationObject->extentAndMedium = 
$this->form->getValue('extentAndMedium');
-
-            break;
-
-          case 'findingAids':
-            $this->informationObject->findingAids = 
$this->form->getValue('findingAids');
-
-            break;
-
-          case 'identifier':
-            $this->informationObject->identifier = 
$this->form->getValue('identifier');
-
-            break;
-
-          case 'institutionResponsibleIdentifier':
-            $this->informationObject->institutionResponsibleIdentifier = 
$this->form->getValue('institutionResponsibleIdentifier');
-
-            break;
-
           case 'issuingJurisdictionAndDenomination':
 
             if (!isset($this->issuingJurisdictionAndDenomination))
@@ -593,16 +533,6 @@
 
             break;
 
-          case 'locationOfCopies':
-            $this->informationObject->locationOfCopies = 
$this->form->getValue('locationOfCopies');
-
-            break;
-
-          case 'locationOfOriginals':
-            $this->informationObject->locationOfOriginals = 
$this->form->getValue('locationOfOriginals');
-
-            break;
-
           case 'noteOnPublishersSeries':
 
             if (!isset($this->noteOnPublishersSeries))
@@ -673,41 +603,6 @@
 
             break;
 
-          case 'physicalCharacteristics':
-            $this->informationObject->physicalCharacteristics = 
$this->form->getValue('physicalCharacteristics');
-
-            break;
-
-          case 'relatedUnitsOfDescription':
-            $this->informationObject->relatedUnitsOfDescription = 
$this->form->getValue('relatedUnitsOfDescription');
-
-            break;
-
-          case 'repositoryId':
-            $this->informationObject->repositoryId = 
$this->form->getValue('repositoryId');
-
-            break;
-
-          case 'reproductionConditions':
-            $this->informationObject->reproductionConditions = 
$this->form->getValue('reproductionConditions');
-
-            break;
-
-          case 'revisionHistory':
-            $this->informationObject->revisionHistory = 
$this->form->getValue('revisionHistory');
-
-            break;
-
-          case 'rules':
-            $this->informationObject->rules = $this->form->getValue('rules');
-
-            break;
-
-          case 'scopeAndContent':
-            $this->informationObject->scopeAndContent = 
$this->form->getValue('scopeAndContent');
-
-            break;
-
           case 'script':
 
             if (!isset($this->script))
@@ -734,11 +629,6 @@
 
             break;
 
-          case 'sources':
-            $this->informationObject->sources = 
$this->form->getValue('sources');
-
-            break;
-
           case 'standardNumber':
 
             if (!isset($this->standardNumber))
@@ -828,11 +718,6 @@
 
             break;
 
-          case 'title':
-            $this->informationObject->title = $this->form->getValue('title');
-
-            break;
-
           case 'titleProperOfPublishersSeries':
 
             if (!isset($this->titleProperOfPublishersSeries))
@@ -890,6 +775,33 @@
             }
 
             break;
+
+          case 'accessConditions':
+          case 'accruals':
+          case 'acquisition':
+          case 'alternateTitle':
+          case 'archivalHistory':
+          case 'arrangement':
+          case 'descriptionIdentifier':
+          case 'edition':
+          case 'extentAndMedium':
+          case 'findingAids':
+          case 'identifier':
+          case 'institutionResponsibleIdentifier':
+          case 'locationOfCopies':
+          case 'locationOfOriginals':
+          case 'physicalCharacteristics':
+          case 'relatedUnitsOfDescription':
+          case 'repositoryId':
+          case 'reproductionConditions':
+          case 'revisionHistory':
+          case 'rules':
+          case 'scopeAndContent':
+          case 'sources':
+          case 'title':
+            $this->informationObject[$field->getName()] = 
$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