Author: sevein
Date: Fri Nov 27 19:10:36 2009
New Revision: 3981

Log:
Simple checks for mandatory fields, ICA-ISDIAH

Modified:
   trunk/apps/qubit/modules/repository/actions/showIsdiahAction.class.php
   trunk/apps/qubit/modules/repository/templates/showIsdiahSuccess.php

Modified: trunk/apps/qubit/modules/repository/actions/showIsdiahAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/repository/actions/showIsdiahAction.class.php      
Fri Nov 27 19:09:11 2009        (r3980)
+++ trunk/apps/qubit/modules/repository/actions/showIsdiahAction.class.php      
Fri Nov 27 19:10:36 2009        (r3981)
@@ -34,6 +34,21 @@
     parent::execute($request);
 
     // add ISDIAH specific commands
+    $validatorSchema = new sfValidatorSchema;
+    $validatorSchema->authorizedFormOfName = new 
sfValidatorString(array('required' => true), array('required' => 'Authorized 
form of name'));
+    $validatorSchema->identifier = new sfValidatorString(array('required' => 
true), array('required' => 'Identifier'));
+
+    try
+    {
+      $validatorSchema->clean(array(
+        'authorizedFormOfName' => $this->repository->authorizedFormOfName,
+        'identifier' => $this->repository->identifier));
+    }
+    catch (sfValidatorErrorSchema $e)
+    {
+      $this->errorSchema = $e;
+    }
+
     $this->parallelFormsOfName = $this->repository->getParallelFormsOfName();
     $this->otherFormsOfName = $this->repository->getOtherFormsOfName();
   }

Modified: trunk/apps/qubit/modules/repository/templates/showIsdiahSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/repository/templates/showIsdiahSuccess.php Fri Nov 
27 19:09:11 2009        (r3980)
+++ trunk/apps/qubit/modules/repository/templates/showIsdiahSuccess.php Fri Nov 
27 19:10:36 2009        (r3981)
@@ -7,6 +7,20 @@
   <?php echo link_to_if(SecurityPriviliges::editCredentials($sf_user, 
'repository'), render_title($repository), array('module' => 'repository', 
'action' => 'edit', 'id' => $repository->id), array('title' => __('Edit 
repository'))) ?>
   </td></tr>
 
+<?php if (isset($errorSchema)): ?>
+<tr>
+  <td colspan="2">
+    <div class="messages error">
+      <ul>
+        <?php foreach ($errorSchema as $error): ?>
+          <li><?php echo $error ?></li>
+        <?php endforeach; ?>
+      </ul>
+    </div>
+  </td>
+</tr>
+<?php endif; ?>
+
 <?php if ($repository->getIdentifier()): ?>
   <tr><th><?php echo __('identifier')?></th>
   <td><?php echo $repository->getIdentifier()?>

--

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