Author: jablko
Date: Tue Nov 17 09:21:56 2009
New Revision: 3903
Log:
Check object is valid ISAD, a title is required
Modified:
trunk/apps/qubit/modules/informationobject/actions/showIsadAction.class.php
trunk/apps/qubit/modules/informationobject/templates/showIsadSuccess.php
Modified:
trunk/apps/qubit/modules/informationobject/actions/showIsadAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/showIsadAction.class.php
Tue Nov 17 00:06:50 2009 (r3902)
+++ trunk/apps/qubit/modules/informationobject/actions/showIsadAction.class.php
Tue Nov 17 09:21:56 2009 (r3903)
@@ -32,6 +32,18 @@
{
parent::execute($request);
+ $validatorSchema = new sfValidatorSchema;
+ $validatorSchema->title = new sfValidatorString(array('required' => true));
+
+ try
+ {
+ $validatorSchema->clean(array('title' =>
$this->informationObject->title));
+ }
+ catch (sfValidatorErrorSchema $e)
+ {
+ $this->errorSchema = $e;
+ }
+
// Split notes into "Notes" (general notes), Title notes and Publication
notes
$this->notes = $this->informationObject->getNotesByType(array('noteTypeId'
=> QubitTerm::GENERAL_NOTE_ID));
$this->archivistsNotes =
$this->informationObject->getNotesByType(array('noteTypeId' =>
QubitTerm::ARCHIVIST_NOTE_ID));
Modified:
trunk/apps/qubit/modules/informationobject/templates/showIsadSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/showIsadSuccess.php
Tue Nov 17 00:06:50 2009 (r3902)
+++ trunk/apps/qubit/modules/informationobject/templates/showIsadSuccess.php
Tue Nov 17 09:21:56 2009 (r3903)
@@ -9,6 +9,16 @@
</td>
</tr>
+<?php if (isset($errorSchema)): ?>
+ <div class="messages error">
+ <ul>
+ <?php foreach ($errorSchema as $error): ?>
+ <li><?php echo $error ?></li>
+ <?php endforeach; ?>
+ </ul>
+ </div>
+<?php endif; ?>
+
<?php if (null !== $digitalObject): ?>
<tr>
<td colspan="2">
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---