Author: sevein
Date: Fri Nov 27 15:10:52 2009
New Revision: 3976
Log:
Add validation for ISAD mandatory fields at show page.
Modified:
trunk/apps/qubit/modules/informationobject/actions/showIsadAction.class.php
Modified:
trunk/apps/qubit/modules/informationobject/actions/showIsadAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/showIsadAction.class.php
Fri Nov 27 00:08:58 2009 (r3975)
+++ trunk/apps/qubit/modules/informationobject/actions/showIsadAction.class.php
Fri Nov 27 15:10:52 2009 (r3976)
@@ -33,11 +33,22 @@
parent::execute($request);
$validatorSchema = new sfValidatorSchema;
+ $validatorSchema->creators = new QubitValidatorCountable(array('required'
=> true), array('required' => $this->context->i18n->__('This archival
description should %1%content at least on creator%2%.', array('%1%' => '<a
href="http://ica-atom.org/docs/index.php?title=RS-1#3.2.1">', '%2%' =>
'</a>'))));
+ $validatorSchema->dates = new QubitValidatorCountable(array('required' =>
true), array('required' => $this->context->i18n->__('This archival description
should %1%content at least one date%2%.', array('%1%' => '<a
href="http://ica-atom.org/docs/index.php?title=RS-1#3.1.3">', '%2%' =>
'</a>'))));
+ $validatorSchema->extentAndMedium = new sfValidatorString(array('required'
=> true), array('required' => $this->context->i18n->__('%1%Extent and medium%2%
- This is a mandatory field.', array('%1%' => '<a
href="http://ica-atom.org/docs/index.php?title=RS-1#I">', '%2%' => '</a>'))));
+ $validatorSchema->identifier = new sfValidatorString(array('required' =>
true), array('required' => $this->context->i18n->__('%1%Identifier%2% - This is
a mandatory field.', array('%1%' => '<a
href="http://ica-atom.org/docs/index.php?title=RS-1#I">', '%2%' => '</a>'))));
+ $validatorSchema->levelOfDescription = new
QubitValidatorLevelOfDescription(array('required' => true), array('required' =>
$this->context->i18n->__('%1%Level of description%2% - This is a mandatory
field.', array('%1%' => '<a
href="http://ica-atom.org/docs/index.php?title=RS-1#I">', '%2%' => '</a>'))));
$validatorSchema->title = new sfValidatorString(array('required' => true),
array('required' => $this->context->i18n->__('This archival description is
untitled. A title is %1%considered essential%2% for international exchange of
descriptive information.', array('%1%' => '<a
href="http://ica-atom.org/docs/index.php?title=RS-1#I">', '%2%' => '</a>'))));
try
{
- $validatorSchema->clean(array('title' =>
$this->informationObject->title));
+ $validatorSchema->clean(array(
+ 'creators' => $this->informationObject->getCreators(),
+ 'dates' => $this->informationObject->getDates(),
+ 'extentAndMedium' => $this->informationObject->extentAndMedium,
+ 'identifier' => $this->informationObject->identifier,
+ 'levelOfDescription' => $this->informationObject,
+ 'title' => $this->informationObject->title));
}
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.