Author: jablko
Date: Tue Oct 12 11:04:51 2010
New Revision: 8068

Log:
Use symfony form for description field

Modified:
   
trunk/apps/qubit/modules/informationobject/actions/eventFormComponent.class.php
   trunk/apps/qubit/modules/informationobject/templates/_eventForm.php
   trunk/plugins/sfDcPlugin/modules/sfDcPlugin/templates/editSuccess.php
   trunk/plugins/sfModsPlugin/modules/sfModsPlugin/templates/editSuccess.php
   trunk/plugins/sfRadPlugin/modules/sfRadPlugin/actions/editAction.class.php
   trunk/plugins/sfRadPlugin/modules/sfRadPlugin/templates/editSuccess.php

Modified: 
trunk/apps/qubit/modules/informationobject/actions/eventFormComponent.class.php
==============================================================================
--- 
trunk/apps/qubit/modules/informationobject/actions/eventFormComponent.class.php 
    Tue Oct 12 10:46:01 2010        (r8067)
+++ 
trunk/apps/qubit/modules/informationobject/actions/eventFormComponent.class.php 
    Tue Oct 12 11:04:51 2010        (r8068)
@@ -144,6 +144,9 @@
 
     
$this->form->getWidgetSchema()->dateDisplay->setHelp($this->context->i18n->__('Enter
 free-text information, including qualifiers or typographical symbols to 
express uncertainty, to change the way the date displays.  If this field is not 
used, the default will be the start and end years only.'));
 
+    $this->form->setValidator('description', new sfValidatorString);
+    $this->form->setWidget('description', new sfWidgetFormInput);
+
     $this->form->setValidator('endDate', new sfValidatorString);
     $this->form->setWidget('endDate', new sfWidgetFormInput);
 

Modified: trunk/apps/qubit/modules/informationobject/templates/_eventForm.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/_eventForm.php Tue Oct 
12 10:46:01 2010        (r8067)
+++ trunk/apps/qubit/modules/informationobject/templates/_eventForm.php Tue Oct 
12 11:04:51 2010        (r8068)
@@ -176,18 +176,16 @@
       </td>
     </tr><tr>
       <th colspan="3">
-        <?php echo __('Event note') ?>
+        <?php echo $form->description
+          ->label(__('Event note'))
+          ->renderLabel() ?>
       </th>
     </tr><tr>
       <td colspan="3" class="noline">
 
-        <input name="updateEvent[description]"/>
+        <?php echo $form->description->render() ?>
 
-        <?php if (isset($help['description'])): ?>
-          <div class="description">
-            <?php echo $help['description'] ?>
-          </div>
-        <?php endif; ?>
+        <?php echo $form->description->renderHelp() ?>
 
       </td>
     </tr>

Modified: trunk/plugins/sfDcPlugin/modules/sfDcPlugin/templates/editSuccess.php
==============================================================================
--- trunk/plugins/sfDcPlugin/modules/sfDcPlugin/templates/editSuccess.php       
Tue Oct 12 10:46:01 2010        (r8067)
+++ trunk/plugins/sfDcPlugin/modules/sfDcPlugin/templates/editSuccess.php       
Tue Oct 12 11:04:51 2010        (r8068)
@@ -28,7 +28,7 @@
     ->label(__('Title').' <span class="form-required" title="'.__('This is a 
mandatory element.').'">*</span>'), $resource) ?>
 
   <div class="form-item">
-    <label for="events"><?php echo __('Names and dates') ?></label>
+    <label><?php echo __('Names and dates') ?></label>
     <?php echo get_partial('informationobject/relatedEvents', array('resource' 
=> $resource)) ?>
     <?php echo get_partial('informationobject/eventForm', 
$eventComponent->getVarHolder()->getAll()) ?>
   </div>

Modified: 
trunk/plugins/sfModsPlugin/modules/sfModsPlugin/templates/editSuccess.php
==============================================================================
--- trunk/plugins/sfModsPlugin/modules/sfModsPlugin/templates/editSuccess.php   
Tue Oct 12 10:46:01 2010        (r8067)
+++ trunk/plugins/sfModsPlugin/modules/sfModsPlugin/templates/editSuccess.php   
Tue Oct 12 11:04:51 2010        (r8068)
@@ -26,7 +26,7 @@
     ->help(__('A word, phrase, character, or group of characters, normally 
appearing in a resource, that names it or the work contained in it. Choice and 
format of titles should be governed by a content standard such as the 
Anglo-American Cataloging Rules, 2nd edition (AACR2), Cataloguing Cultural 
Objects (CCO), or Describing Archives: A Content Standard (DACS). Details such 
as capitalization, choosing among the forms of titles presented on an item, and 
use of abbreviations should be determined based on the rules in a content 
standard. One standard should be chosen and used consistently for all records 
in a set.')), $resource) ?>
 
   <div class="form-item">
-    <label for="events"><?php echo __('Names and origin info') ?></label>
+    <label><?php echo __('Names and origin info') ?></label>
     <?php echo get_partial('informationobject/relatedEvents', array('resource' 
=> $resource)) ?>
   </div>
 

Modified: 
trunk/plugins/sfRadPlugin/modules/sfRadPlugin/actions/editAction.class.php
==============================================================================
--- trunk/plugins/sfRadPlugin/modules/sfRadPlugin/actions/editAction.class.php  
Tue Oct 12 10:46:01 2010        (r8067)
+++ trunk/plugins/sfRadPlugin/modules/sfRadPlugin/actions/editAction.class.php  
Tue Oct 12 11:04:51 2010        (r8068)
@@ -104,8 +104,9 @@
     $this->eventComponent = new 
InformationObjectEventFormComponent($this->context, 'informationobject', 
'eventForm');
     $this->eventComponent->execute($this->request);
 
-    
$this->eventComponent->form->getWidgetSchema()->dateDisplay->setHelp($this->context->i18n->__('"Give
 the date(s) of creation of the unit being described either as a single date, 
or range of dates (for inclusive dates and/or predominant dates).  Always give 
the inclusive dates.  When providing predominant dates, specify them as such, 
preceded by the word predominant..." (1.4B2).  Record probable and uncertain 
dates in square brackets, using the conventions described in RAD 1.4B5.'));
-    
$this->eventComponent->form->getWidgetSchema()->place->setHelp($this->context->i18n->__("\"For
 an item, transcribe a place of publication, distribution, etc., in the form 
and the grammatical case in which it appears.\" (RAD 1.4C1) 
{$this->eventComponent->form->getWidgetSchema()->place->getHelp()}"));
+    
$this->eventComponent->form->getWidgetSchema()->dateDisplay->setHelp($this->context->i18n->__('"Give
 the date(s) of creation of the unit being described either as a single date, 
or range of dates (for inclusive dates and/or predominant dates).  Always give 
the inclusive dates.  When providing predominant dates, specify them as such, 
preceded by the word predominant..." (1.4B2) Record probable and uncertain 
dates in square brackets, using the conventions described in 1.4B5.'));
+    
$this->eventComponent->form->getWidgetSchema()->description->setHelp($this->context->i18n->__('"Make
 notes on dates and any details pertaining to the dates of creation, 
publication, or distribution, of the unit being described that are not included 
in the Date(s) of creation, including publication, distribution, etc., area and 
that are considered to be important." (1.8B8) "Make notes on the date(s) of 
accumulation or collection of the unit being described." (1.8B8a)'));
+    
$this->eventComponent->form->getWidgetSchema()->place->setHelp($this->context->i18n->__("\"For
 an item, transcribe a place of publication, distribution, etc., in the form 
and the grammatical case in which it appears.\" (1.4C1) 
{$this->eventComponent->form->getWidgetSchema()->place->getHelp()}"));
     
$this->eventComponent->form->getWidgetSchema()->type->setHelp($this->context->i18n->__('Select
 the type of activity that established the relation between the authority 
record and the archival description (e.g. creation, accumulation, collection, 
publication, etc.)'));
   }
 

Modified: 
trunk/plugins/sfRadPlugin/modules/sfRadPlugin/templates/editSuccess.php
==============================================================================
--- trunk/plugins/sfRadPlugin/modules/sfRadPlugin/templates/editSuccess.php     
Tue Oct 12 10:46:01 2010        (r8067)
+++ trunk/plugins/sfRadPlugin/modules/sfRadPlugin/templates/editSuccess.php     
Tue Oct 12 11:04:51 2010        (r8068)
@@ -171,8 +171,7 @@
 
     <div class="form-item">
       <label for=""><?php echo __('Add new name and/or origin info') ?></label>
-      <?php echo get_partial('informationobject/eventForm', 
$eventComponent->getVarHolder()->getAll() + array('help' => array(
-        'description' => __('"Make notes on dates and any details pertaining 
to the dates of creation, publication, or distribution, of the unit being 
described that are not included in the Date(s) of creation, including 
publication, distribution, etc., area and that are considered to be important. 
" (RAD 1.8B8) "Make notes on the date(s) of accumulation or collection of the 
unit being described." RAD 1.8B8a)')))) ?>
+      <?php echo get_partial('informationobject/eventForm', 
$eventComponent->getVarHolder()->getAll()) ?>
     </div>
 
   </fieldset> <!-- #datesOfCreationArea -->

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