Author: jablko
Date: Thu Oct 7 17:22:54 2010
New Revision: 8023
Log:
Use symfony form for place 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
Thu Oct 7 17:11:44 2010 (r8022)
+++
trunk/apps/qubit/modules/informationobject/actions/eventFormComponent.class.php
Thu Oct 7 17:22:54 2010 (r8023)
@@ -139,6 +139,11 @@
$this->form->getWidgetSchema()->actor->setHelp($this->context->i18n->__('Use
the actor name field to link an authority record to this description. Search
for an existing name in the authority records by typing the first few
characters of the name. Alternatively, type a new name to create and link to a
new authority record.'));
+ $this->form->setValidator('place', new sfValidatorString);
+ $this->form->setWidget('place', new sfWidgetFormSelect(array('choices' =>
array())));
+
+
$this->form->getWidgetSchema()->place->setHelp($this->context->i18n->__('Search
for an existing term in the places taxonomy by typing the first few characters
of the term name. Alternatively, type a new term to create and link to a new
place term.'));
+
// Event types, Dublin Core is restricted
$eventTypes = QubitTerm::getEventTypes();
if ('sfDcPlugin' == $request->getParameter('module'))
Modified: trunk/apps/qubit/modules/informationobject/templates/_eventForm.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/_eventForm.php Thu Oct
7 17:11:44 2010 (r8022)
+++ trunk/apps/qubit/modules/informationobject/templates/_eventForm.php Thu Oct
7 17:22:54 2010 (r8023)
@@ -102,6 +102,7 @@
</th>
</tr><tr>
<td colspan="3" class="noline">
+
<?php echo $form->actor->render(array('class' => 'form-autocomplete'))
?>
<?php if (QubitAcl::check(QubitActor::getRoot(), 'create')): ?>
@@ -119,7 +120,7 @@
->label(__('Event type'))
->renderLabel() ?>
</th><th style="width: 40%">
- <?php echo __('Place') ?>
+ <?php echo $form->place->renderLabel() ?>
</th>
</tr><tr>
<td colspan="2" class="noline">
@@ -130,7 +131,7 @@
</td><td class="noline">
- <select id="updateEventPlace" name="updateEvent[place]"
class="form-autocomplete"></select>
+ <?php echo $form->place->render(array('class' => 'form-autocomplete'))
?>
<?php if
(QubitAcl::check(QubitTaxonomy::getById(QubitTaxonomy::PLACE_ID),
'createTerm')): ?>
<input class="add" type="hidden" value="<?php echo
url_for(array('module' => 'term', 'action' => 'create', 'taxonomyId' =>
QubitTaxonomy::PLACE_ID)) ?> #name"/>
@@ -138,11 +139,7 @@
<input class="list" type="hidden" value="<?php echo
url_for(array('module' => 'term', 'action' => 'autocomplete', 'taxonomyId' =>
QubitTaxonomy::PLACE_ID)) ?>"/>
- <?php if (isset($help['place'])): ?>
- <div class="description">
- <?php echo $help['place'] ?>
- </div>
- <?php endif; ?>
+ <?php echo $form->place->renderHelp() ?>
</td>
</tr><tr>
Modified: trunk/plugins/sfDcPlugin/modules/sfDcPlugin/templates/editSuccess.php
==============================================================================
--- trunk/plugins/sfDcPlugin/modules/sfDcPlugin/templates/editSuccess.php
Thu Oct 7 17:11:44 2010 (r8022)
+++ trunk/plugins/sfDcPlugin/modules/sfDcPlugin/templates/editSuccess.php
Thu Oct 7 17:22:54 2010 (r8023)
@@ -33,7 +33,6 @@
<label for="events"><?php echo __('Names and dates') ?></label>
<?php echo get_partial('informationobject/relatedEvents', array('resource'
=> $resource)) ?>
<?php echo get_partial('informationobject/eventForm',
$eventComponent->getVarHolder()->getAll() + array('help' => array(
- 'place' => __('Search for an existing term in the Places taxonomy by
typing the first few characters of the term name. Alternatively, type a new
term to create and link to a new place term.'),
'startDate' => __('Enter the start year. Do not use any qualifiers or
typographical symbols to express uncertainty.'),
'endDate' => __('Enter the end year. Do not use any qualifiers or
typographical symbols to express uncertainty. If the start and end years are
the same, enter data only in the "Date" field and leave the "End date" blank.'),
'dateDisplay' => __('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.')))) ?>
Modified:
trunk/plugins/sfModsPlugin/modules/sfModsPlugin/templates/editSuccess.php
==============================================================================
--- trunk/plugins/sfModsPlugin/modules/sfModsPlugin/templates/editSuccess.php
Thu Oct 7 17:11:44 2010 (r8022)
+++ trunk/plugins/sfModsPlugin/modules/sfModsPlugin/templates/editSuccess.php
Thu Oct 7 17:22:54 2010 (r8023)
@@ -35,7 +35,6 @@
<div class="form-item">
<label><?php echo __('Add new name and/or origin info') ?></label>
<?php echo get_partial('informationobject/eventForm',
$eventComponent->getVarHolder()->getAll() + array('help' => array(
- 'place' => __('Search for an existing term in the Places taxonomy by
typing the first few characters of the term name. Alternatively, type a new
term to create and link to a new place term.'),
'startDate' => __('Enter the start year. Do not use any qualifiers or
typographical symbols to express uncertainty.'),
'endDate' => __('Enter the end year. Do not use any qualifiers or
typographical symbols to express uncertainty. If the start and end years are
the same, enter data only in the "Date" field and leave the "End date" blank.'),
'dateDisplay' => __('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.')))) ?>
Modified:
trunk/plugins/sfRadPlugin/modules/sfRadPlugin/actions/editAction.class.php
==============================================================================
--- trunk/plugins/sfRadPlugin/modules/sfRadPlugin/actions/editAction.class.php
Thu Oct 7 17:11:44 2010 (r8022)
+++ trunk/plugins/sfRadPlugin/modules/sfRadPlugin/actions/editAction.class.php
Thu Oct 7 17:22:54 2010 (r8023)
@@ -104,6 +104,7 @@
$this->eventComponent = new
InformationObjectEventFormComponent($this->context, 'informationobject',
'eventForm');
$this->eventComponent->execute($this->request);
+
$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()->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
Thu Oct 7 17:11:44 2010 (r8022)
+++ trunk/plugins/sfRadPlugin/modules/sfRadPlugin/templates/editSuccess.php
Thu Oct 7 17:22:54 2010 (r8023)
@@ -174,7 +174,6 @@
<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(
- 'place' => __('"For an item, transcribe a place of publication,
distribution, etc., in the form and the grammatical case in which it appears."
(RAD 1.4C1) Search for an existing term in the Places taxonomy by typing the
first few characters of the term name. Alternatively, type a new term to create
and link to a new place term.'),
'startDate' => __('Enter the start year. Do not use any qualifiers or
typographical symbols to express uncertainty.'),
'endDate' => __('Enter the end year. Do not use any qualifiers or
typographical symbols to express uncertainty. If the start and end years are
the same, enter data only in the "Date" field and leave the "End date" blank.'),
'dateDisplay' => __('"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.'),
--
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.