Author: jablko
Date: Sun Oct 17 18:13:01 2010
New Revision: 8209
Log:
Drop plural
Added:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedAuthorityRecordComponent.class.php
- copied, changed from r8208,
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedAuthorityRecordsComponent.class.php
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedFunctionComponent.class.php
- copied, changed from r8208,
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedFunctionsComponent.class.php
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedResourceComponent.class.php
- copied, changed from r8208,
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedResourcesComponent.class.php
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedAuthorityRecord.php
- copied unchanged from r8204,
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedAuthorityRecords.php
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedFunction.php
- copied unchanged from r8204,
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedFunctions.php
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedResource.php
- copied unchanged from r8204,
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedResources.php
Deleted:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedAuthorityRecordsComponent.class.php
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedFunctionsComponent.class.php
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedResourcesComponent.class.php
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedAuthorityRecords.php
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedFunctions.php
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedResources.php
Modified:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/editAction.class.php
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/editSuccess.php
Modified:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/editAction.class.php
==============================================================================
---
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/editAction.class.php
Sun Oct 17 17:56:27 2010 (r8208)
+++
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/editAction.class.php
Sun Oct 17 18:13:01 2010 (r8209)
@@ -46,14 +46,14 @@
{
parent::earlyExecute();
- $this->relatedAuthorityRecordsComponent = new
sfIsdfPluginRelatedAuthorityRecordsComponent($this->context, 'sfIsdfPlugin',
'relatedAuthorityRecords');
- $this->relatedAuthorityRecordsComponent->execute($this->request);
+ $this->relatedAuthorityRecordComponent = new
sfIsdfPluginRelatedAuthorityRecordComponent($this->context, 'sfIsdfPlugin',
'relatedAuthorityRecords');
+ $this->relatedAuthorityRecordComponent->execute($this->request);
- $this->relatedFunctionsComponent = new
sfIsdfPluginRelatedFunctionsComponent($this->context, 'sfIsdfPlugin',
'relatedFunctions');
- $this->relatedFunctionsComponent->execute($this->request);
+ $this->relatedFunctionComponent = new
sfIsdfPluginRelatedFunctionComponent($this->context, 'sfIsdfPlugin',
'relatedFunctions');
+ $this->relatedFunctionComponent->execute($this->request);
- $this->relatedResourcesComponent = new
sfIsdfPluginRelatedResourcesComponent($this->context, 'sfIsdfPlugin',
'relatedResources');
- $this->relatedResourcesComponent->execute($this->request);
+ $this->relatedResourceComponent = new
sfIsdfPluginRelatedResourceComponent($this->context, 'sfIsdfPlugin',
'relatedResources');
+ $this->relatedResourceComponent->execute($this->request);
}
/**
@@ -179,9 +179,9 @@
protected function processForm()
{
- $this->relatedAuthorityRecordsComponent->processForm();
- $this->relatedFunctionsComponent->processForm();
- $this->relatedResourcesComponent()->processForm();
+ $this->relatedAuthorityRecordComponent->processForm();
+ $this->relatedFunctionComponent->processForm();
+ $this->relatedResourceComponent()->processForm();
if (isset($this->request->deleteRelations))
{
Copied and modified:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedAuthorityRecordComponent.class.php
(from r8208,
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedAuthorityRecordsComponent.class.php)
==============================================================================
---
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedAuthorityRecordsComponent.class.php
Sun Oct 17 17:56:27 2010 (r8208, copy source)
+++
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedAuthorityRecordComponent.class.php
Sun Oct 17 18:13:01 2010 (r8209)
@@ -17,7 +17,7 @@
* along with Qubit Toolkit. If not, see <http://www.gnu.org/licenses/>.
*/
-class sfIsdfPluginRelatedAuthorityRecordsComponent extends
RelationEditComponent
+class sfIsdfPluginRelatedAuthorityRecordComponent extends RelationEditComponent
{
// Arrays not allowed in class constants
public static
@@ -120,7 +120,7 @@
{
parent::execute($request);
-
$this->form->getWidgetSchema()->setNameFormat('relatedAuthorityRecords[%s]');
+
$this->form->getWidgetSchema()->setNameFormat('relatedAuthorityRecord[%s]');
// Get actors (object) related to this function (subject)
$criteria = new Criteria;
Copied and modified:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedFunctionComponent.class.php
(from r8208,
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedFunctionsComponent.class.php)
==============================================================================
---
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedFunctionsComponent.class.php
Sun Oct 17 17:56:27 2010 (r8208, copy source)
+++
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedFunctionComponent.class.php
Sun Oct 17 18:13:01 2010 (r8209)
@@ -17,7 +17,7 @@
* along with Qubit Toolkit. If not, see <http://www.gnu.org/licenses/>.
*/
-class sfIsdfPluginRelatedFunctionsComponent extends RelationEditComponent
+class sfIsdfPluginRelatedFunctionComponent extends RelationEditComponent
{
// Arrays not allowed in class constants
public static
Copied and modified:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedResourceComponent.class.php
(from r8208,
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedResourcesComponent.class.php)
==============================================================================
---
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedResourcesComponent.class.php
Sun Oct 17 17:56:27 2010 (r8208, copy source)
+++
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedResourceComponent.class.php
Sun Oct 17 18:13:01 2010 (r8209)
@@ -17,7 +17,7 @@
* along with Qubit Toolkit. If not, see <http://www.gnu.org/licenses/>.
*/
-class sfIsdfPluginRelatedResourcesComponent extends RelationEditComponent
+class sfIsdfPluginRelatedResourceComponent extends RelationEditComponent
{
// Arrays not allowed in class constants
public static
Copied:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedAuthorityRecord.php
(from r8204,
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedAuthorityRecords.php)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedAuthorityRecord.php
Sun Oct 17 18:13:01 2010 (r8209, copy of r8204,
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedAuthorityRecords.php)
@@ -0,0 +1,152 @@
+<?php use_helper('Javascript') ?>
+
+<table class="inline" id="relatedEntityDisplay">
+ <caption>
+ <?php echo __('Related authority records') ?>
+ </caption><thead>
+ <tr>
+ <th style="width: 25%">
+ <?php echo __('Identifier/name') ?>
+ </th><th style="width: 30%">
+ <?php echo __('Nature of relationship') ?>
+ </th><th style="width: 20%">
+ <?php echo __('Dates') ?>
+ </th><th style="text-align: center; width: 10%">
+ <?php echo image_tag('delete', array('align' => 'top', 'class' =>
'deleteIcon')) ?>
+ </th>
+ </tr>
+ </thead><tbody>
+ <?php foreach ($relations as $item): ?>
+ <tr id="<?php echo url_for(array($item, 'module' => 'relation')) ?>"
class="related_obj_<?php echo $item->id ?>">
+ <td>
+ <?php echo render_title($item->object) ?>
+ </td><td>
+ <?php echo
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DESCRIPTION_ID) ?>
+ </td><td>
+ <?php if (0 < strlen($dateDisplay =
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DATE_DISPLAY_ID))): ?>
+ <?php echo $dateDisplay ?>
+ <?php elseif (1 < count($dateArray = $item->getDates())): ?>
+ <?php echo __('%1% - %2%', array('%1%' =>
Qubit::renderDate($dateArray['start']), '%2%' =>
Qubit::renderDate($dateArray['end']))) ?>
+ <?php else: ?>
+ <?php echo Qubit::renderDate(array_shift($dateArray)) ?>
+ <?php endif; ?>
+ </td><td style="text-align: center">
+ <input type="checkbox" name="deleteRelations[<?php echo $item->id
?>]" value="delete" class="multiDelete" />
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+</table>
+
+<?php
+
+// Template for new display table rows
+$rowTemplate = '<tr id="{relatedEntity[id]}">'
+ .' <td>'
+ .' {relatedEntity[object]}'
+ .' </td><td>'
+ .' {relatedEntity[description]}'
+ .' </td><td>'
+ .' {relatedEntity[dateDisplay]}'
+ .' </td><td style="text-align: right">'
+ ." $editImage $deleteBtn"
+ .' </td>'
+ .'</tr>';
+
+echo javascript_tag(<<<content
+Drupal.behaviors.dialogRelatedEntity = {
+ attach: function (context)
+ {
+ // Define dialog
+ Qubit.dialogRelatedEntity = new QubitDialog('relatedEntity', {
+ 'displayTable': 'relatedEntityDisplay',
+ 'newRowTemplate': '$rowTemplate',
+ 'handleFieldRender': handleFieldRender }, jQuery);
+
+ // Add edit link/icon to "relatedFunctions" rows
+ jQuery('#relatedEntityDisplay tr').each(function ()
+ {
+ var thisUri = this.id;
+ if (undefined != thisUri)
+ {
+ jQuery('td:last', this).prepend('<a
href="javascript:Qubit.dialogRelatedEntity.open(\'' + thisUri +
'\')">$editImage</a>');
+ }
+ });
+ } }
+
+content
+) ?>
+
+<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
+<!-- NOTE: The dialog.js script cuts this *entire* table and pastes -->
+<!-- it in a YUI dialog object. -->
+<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
+<table class="inline" id="relatedEntity">
+ <caption>
+ <?php echo __('Related authority record') ?>
+ </caption><tbody>
+ <tr>
+ <th colspan="4">
+ <?php echo $form->object
+ ->label(__('Authorized form of name'))
+ ->renderLabel() ?>
+ </th>
+ </tr><tr>
+ <td colspan="4">
+ <?php echo $form->object->render(array('class' =>
'form-autocomplete')) ?>
+ <input class="list" type="hidden" value="<?php echo
url_for(array('module' => 'actor', 'action' => 'autocomplete', 'showOnlyActors'
=> 'true')) ?>"/>
+ <?php echo $form->object
+ ->help(__('Select the name from the drop-down menu; enter the
identifier or the first few letters to narrow the choices. (ISDF 6.1)'))
+ ->renderHelp() ?>
+ </td>
+ </tr><tr>
+ <th colspan="4">
+ <?php echo $form->description
+ ->label(__('Nature of relationship'))
+ ->renderLabel() ?>
+ </th>
+ </tr><tr>
+ <td colspan="4">
+ <?php echo $form->description ?>
+ <?php echo $form->description
+ ->help(__('Describe the nature of the relationship between the
function and the related authority record. (ISDF 6.2)'))
+ ->renderHelp() ?>
+ </td>
+ </tr><tr>
+ <th style="width: 25%">
+ <?php echo $form->startDate
+ ->label(__('Date†'))
+ ->renderLabel() ?>
+ </th><th style="width: 25%">
+ <?php echo $form->endDate
+ ->label(__('End date†'))
+ ->renderLabel() ?>
+ </th><th colspan="2" style="width: 50%">
+ <?php echo $form->dateDisplay
+ ->label(__('Date display†'))
+ ->renderLabel() ?>
+ </th>
+ </tr><tr>
+ <td style="width: 25%">
+ <?php echo $form->startDate ?>
+ <?php echo $form->startDate
+ ->help(__('Enter the start year. Do not use any qualifiers or
typographical symbols to express uncertainty.'))
+ ->renderHelp() ?>
+ </td><td style="width: 25%">
+ <?php echo $form->endDate ?>
+ <?php echo $form->endDate
+ ->help(__('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.'))
+ ->renderHelp() ?>
+ </td><td colspan="2" style="width: 50%">
+ <?php echo $form->dateDisplay ?>
+ <?php echo $form->dateDisplay
+ ->help(__('"Record, when relevant, the start and the end date of the
relationship." (ISDF 6.3) Enter the date as you would like it to appear in the
show page for the function, using qualifiers and/or typographical symbols to
express uncertainty if desired.'))
+ ->renderHelp() ?>
+ </td>
+ </tr><tr>
+ <td colspan="4">
+ <?php echo __('%1% - dates must be specified in ISO-8601 format
(YYYY-MM-DD)', array('%1%' => '†'))?>
+ </td>
+ </tr>
+ </tbody>
+</table>
Copied:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedFunction.php
(from r8204,
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedFunctions.php)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedFunction.php
Sun Oct 17 18:13:01 2010 (r8209, copy of r8204,
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedFunctions.php)
@@ -0,0 +1,246 @@
+<?php use_helper('Javascript') ?>
+
+<table class="inline" id="relatedFunctions">
+ <caption>
+ <?php echo __('Related functions') ?>
+ </caption><thead>
+ <tr>
+ <th style="width: 25%">
+ <?php echo __('Name') ?>
+ </th><th style="width: 15%">
+ <?php echo __('Category') ?>
+ </th><th style="width: 30%">
+ <?php echo __('Description') ?>
+ </th><th style="width: 20%">
+ <?php echo __('Dates') ?>
+ </th><th style="text-align: center; width: 10%">
+ <?php echo image_tag('delete', array('align' => 'top', 'class' =>
'deleteIcon')) ?>
+ </th>
+ </tr>
+ </thead><tbody>
+ <?php foreach ($relations as $item): ?>
+ <tr class="related_obj_<?php echo $item->id ?>" id="<?php echo
url_for(array($item, 'module' => 'relation')) ?>">
+ <td>
+ <?php if ($resource->id == $item->objectId): ?>
+ <?php echo render_title($item->subject) ?>
+ <?php else: ?>
+ <?php echo render_title($item->object) ?>
+ <?php endif; ?>
+ </td><td>
+ <?php echo $item->type ?>
+ </td><td>
+ <?php echo
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DESCRIPTION_ID) ?>
+ </td><td>
+ <?php if (0 < strlen($dateDisplay =
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DATE_DISPLAY_ID))): ?>
+ <?php echo $dateDisplay ?>
+ <?php elseif (1 < count($dateArray = $item->getDates())): ?>
+ <?php echo __('%1% - %2%', array('%1%' =>
Qubit::renderDate($dateArray['start']), '%2%' =>
Qubit::renderDate($dateArray['end']))) ?>
+ <?php else: ?>
+ <?php echo Qubit::renderDate(array_shift($dateArray)) ?>
+ <?php endif; ?>
+ </td><td style="text-align: center">
+ <input type="checkbox" name="deleteRelations[<?php echo $item->id
?>]" value="delete" class="multiDelete"/>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+</table>
+
+<?php
+
+// Define template for new relation table rows added by dialog
+$editImage = image_tag('pencil', array('alt' => 'edit', 'style' => 'align:
top'));
+$deleteBtn = '<button class="delete-small" name="delete"/>';
+
+$rowTemplate = '<tr id="{relation[id]}">'
+ .' <td>'
+ .' {relation[authorizedFormOfName]}'
+ .' </td><td>'
+ .' {relation[category]}'
+ .' </td><td>'
+ .' {relation[description]}'
+ .' </td><td>'
+ .' {relation[dateDisplay]}'
+ .' </td><td style="text-align: right">'
+ ." $editImage $deleteBtn"
+ .' </td>'
+ .'</tr>';
+
+$linkToShow = url_for(array($resource, 'module' => 'function'));
+
+echo javascript_tag(<<<content
+// Add special rendering rules
+var handleFieldRender = function (obj, fname)
+ {
+ var matches = fname.match(/(\w+)\[(\w+)\]/);
+ if (null == matches)
+ {
+ return obj.renderField(fname);
+ }
+
+ switch (matches[2])
+ {
+ case 'dateDisplay':
+
+ if (0 < obj.getField('dateDisplay').value.length)
+ {
+ return obj.getField('dateDisplay').value;
+ }
+ else if (0 < obj.getField('startDate').value.length && 0 <
obj.getField('endDate').value.length)
+ {
+ return obj.getField('startDate').value + ' - ' +
obj.getField('endDate').value;
+ }
+ else
+ {
+ return obj.getField('startDate').value;
+ }
+
+ break;
+
+ default:
+
+ return obj.renderField(fname);
+ }
+ }
+
+Drupal.behaviors.dialog = {
+ attach: function (context)
+ {
+ // Map relation table data to dialog fields
+ var relationTableMap = function (data)
+ {
+ var output = {};
+ for (col in data)
+ {
+ switch(col)
+ {
+ case 'subject':
+ case 'object':
+
+ if ('$linkToShow' != data[col])
+ {
+ output['relation[authorizedFormOfName]'] = data[col];
+ }
+
+ break;
+
+ case 'type':
+ output['relation[category]'] = data[col];
+
+ break;
+
+ default:
+ output['relation[' + col + ']'] = data[col];
+ }
+ }
+
+ return output;
+ }
+
+ // Define dialog
+ Qubit.dialog = new QubitDialog('functionRelation', {
+ 'displayTable': 'relatedFunctions',
+ 'newRowTemplate': '$rowTemplate',
+ 'handleFieldRender': handleFieldRender,
+ 'relationTableMap': relationTableMap }, jQuery);
+
+ // Add edit link/icon to "relatedFunctions" rows
+ jQuery('#relatedFunctions tr').each(function ()
+ {
+ var thisUri = this.id;
+ if (undefined != thisUri)
+ {
+ jQuery('td:last', this).prepend('<a
href="javascript:Qubit.dialog.open(\'' + thisUri + '\')">$editImage</a>');
+ }
+ });
+ } }
+
+content
+) ?>
+
+<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
+<!-- NOTE: The dialog.js script cuts this *entire* table and pastes -->
+<!-- it in a YUI dialog object. -->
+<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
+<table class="inline" id="functionRelation">
+ <caption>
+ <?php echo __('Relationship') ?>
+ </caption><tbody>
+ <tr>
+ <th colspan="4">
+ <?php echo $form->authorizedFormOfName
+ ->label(__('Authorized form of name'))
+ ->renderLabel() ?>
+ </th>
+ </tr><tr>
+ <td colspan="4">
+ <?php echo $form->authorizedFormOfName->render(array('class' =>
'form-autocomplete')) ?>
+ <input class="list" type="hidden" value="<?php echo
url_for(array('module' => 'function', 'action' => 'autocomplete')) ?>"/>
+ <?php echo $form->authorizedFormOfName
+ ->help(__('"Record the authorised form of name and any unique
identifier of the related function." (ISDF 5.3.1)'))
+ ->renderHelp() ?>
+ </td>
+ </tr><tr>
+ <th colspan="4">
+ <?php echo $form->category
+ ->label(__('Category'))
+ ->renderLabel() ?>
+ </th>
+ </tr><tr>
+ <td colspan="4">
+ <?php echo $form->category ?>
+ <?php echo $form->category
+ ->help(__('"Record a general category into which the relationship
being described falls." (ISDF 5.3.2) Select a category from the drop-down menu:
hierarchical, temporal or associative.'))
+ ->renderHelp() ?>
+ </td>
+ </tr><tr>
+ <th colspan="4">
+ <?php echo $form->description
+ ->label(__('Description'))
+ ->renderLabel() ?>
+ </th>
+ </tr><tr>
+ <td colspan="4">
+ <?php echo $form->description ?>
+ <?php echo $form->description
+ ->help(__('"Record a precise description of the nature of the
relationship between the function being described and the related function."
(ISDF 5.3.3) Note that the text entered in this field will also appear in the
related function.'))
+ ->renderHelp() ?>
+ </td>
+ </tr><tr>
+ <th style="width: 25%">
+ <?php echo $form->startDate
+ ->label('Date†')
+ ->renderLabel() ?>
+ </th><th style="width: 25%">
+ <?php echo $form->endDate
+ ->label('End date†')
+ ->renderLabel() ?>
+ </th><th colspan="2" style="width: 50%">
+ <?php echo $form->dateDisplay
+ ->label('Date display†')
+ ->renderLabel() ?>
+ </th>
+ </tr><tr>
+ <td style="width: 25%">
+ <?php echo $form->startDate ?>
+ <?php echo $form->startDate
+ ->help(__('Enter the start year. Do not use any qualifiers or
typographical symbols to express uncertainty.'))
+ ->renderHelp() ?>
+ </td><td style="width: 25%">
+ <?php echo $form->endDate ?>
+ <?php echo $form->endDate
+ ->help(__('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.'))
+ ->renderHelp() ?>
+ </td><td colspan="2" style="width: 50%">
+ <?php echo $form->dateDisplay ?>
+ <?php echo $form->dateDisplay
+ ->help(__('"Record the start and, when relevant, the end date of the
relationship." (ISDF 5.3.4) Enter the date as you would like it to appear in
the show page for the function, using qualifiers and/or typographical symbols
to express uncertainty if desired.'))
+ ->renderHelp() ?>
+ </td>
+ </tr><tr>
+ <td colspan="4">
+ <?php echo __('%1% - dates must be specified in ISO-8601 format
(YYYY-MM-DD)', array('%1%' => '†'))?>
+ </td>
+ </tr>
+ </tbody>
+</table>
Copied:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedResource.php
(from r8204,
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedResources.php)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedResource.php
Sun Oct 17 18:13:01 2010 (r8209, copy of r8204,
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedResources.php)
@@ -0,0 +1,152 @@
+<?php use_helper('Javascript') ?>
+
+<table class="inline" id="relatedResourceDisplay">
+ <caption>
+ <?php echo __('Related resources') ?>
+ </caption><thead>
+ <tr>
+ <th style="width: 25%">
+ <?php echo __('Identifier/title') ?>
+ </th><th style="width: 30%">
+ <?php echo __('Nature of relationship') ?>
+ </th><th style="width: 20%">
+ <?php echo __('Dates') ?>
+ </th><th style="text-align: center; width: 10%">
+ <?php echo image_tag('delete', array('align' => 'top', 'class' =>
'deleteIcon')) ?>
+ </th>
+ </tr>
+ </thead><tbody>
+ <?php foreach ($relations as $item): ?>
+ <tr id="<?php echo url_for(array($item, 'module' => 'relation')) ?>"
class="related_obj_<?php echo $item->id ?>">
+ <td>
+ <?php echo render_title($item->object) ?>
+ </td><td>
+ <?php echo
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DESCRIPTION_ID) ?>
+ </td><td>
+ <?php if (0 < strlen($dateDisplay =
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DATE_DISPLAY_ID))): ?>
+ <?php echo $dateDisplay ?>
+ <?php elseif (1 < count($dateArray = $item->getDates())): ?>
+ <?php echo __('%1% - %2%', array('%1%' =>
Qubit::renderDate($dateArray['start']), '%2%' =>
Qubit::renderDate($dateArray['end']))) ?>
+ <?php else: ?>
+ <?php echo Qubit::renderDate(array_shift($dateArray)) ?>
+ <?php endif; ?>
+ </td><td style="text-align: center">
+ <input type="checkbox" name="deleteRelations[<?php echo $item->id
?>]" value="delete" class="multiDelete" />
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+</table>
+
+<?php
+
+// Template for new display table rows
+$rowTemplate = '<tr id="{relatedResource[id]}">'
+ .' <td>'
+ .' {relatedResource[object]}'
+ .' </td><td>'
+ .' {relatedResource[description]}'
+ .' </td><td>'
+ .' {relatedResource[dateDisplay]}'
+ .' </td><td style="text-align: right">'
+ ." $editImage $deleteBtn"
+ .' </td>'
+ .'</tr>';
+
+echo javascript_tag(<<<content
+Drupal.behaviors.dialog2 = {
+ attach: function (context)
+ {
+ // Define dialog
+ Qubit.dialog2 = new QubitDialog('relatedResource', {
+ 'displayTable': 'relatedResourceDisplay',
+ 'newRowTemplate': '$rowTemplate',
+ 'handleFieldRender': handleFieldRender }, jQuery);
+
+ // Add edit link/icon to "relatedFunctions" rows
+ jQuery('#relatedResourceDisplay tr').each(function ()
+ {
+ var thisUri = this.id;
+ if (undefined != thisUri)
+ {
+ jQuery('td:last', this).prepend('<a
href="javascript:Qubit.dialog2.open(\'' + thisUri + '\')">$editImage</a>');
+ }
+ });
+ } }
+
+content
+) ?>
+
+<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
+<!-- NOTE: The dialog.js script cuts this *entire* table and pastes -->
+<!-- it in a YUI dialog object. -->
+<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
+<table class="inline" id="relatedResource">
+ <caption>
+ <?php echo __('Related resource') ?>
+ </caption><tbody>
+ <tr>
+ <th colspan="4">
+ <?php echo $form->object
+ ->label(__('Title'))
+ ->renderLabel() ?>
+ </th>
+ </tr><tr>
+ <td colspan="4">
+ <?php echo $form->object->render(array('class' =>
'form-autocomplete')) ?>
+ <input class="list" type="hidden" value="<?php echo
url_for(array('module' => 'informationobject', 'action' => 'autocomplete'))
?>"/>
+ <?php echo $form->object
+ ->help(__('Select the title from the drop-down menu; enter the
identifier or the first few letters to narrow the choices. (ISDF 6.1)'))
+ ->renderHelp() ?>
+ </td>
+ </tr><tr>
+ <th colspan="4">
+ <?php echo $form->description
+ ->label(__('Nature of relationship'))
+ ->renderLabel() ?>
+ </th>
+ </tr><tr>
+ <td colspan="4">
+ <?php echo $form->description ?>
+ <?php echo $form->description
+ ->help(__('Describe the nature of the relationship between the
function and the related resource. (ISDF 6.2)'))
+ ->renderHelp() ?>
+ </td>
+ </tr><tr>
+ <th style="width: 25%">
+ <?php echo $form->startDate
+ ->label(__('Date†'))
+ ->renderLabel() ?>
+ </th><th style="width: 25%">
+ <?php echo $form->endDate
+ ->label(__('End date†'))
+ ->renderLabel() ?>
+ </th><th colspan="2" style="width: 50%">
+ <?php echo $form->dateDisplay
+ ->label(__('Date display†'))
+ ->renderLabel() ?>
+ </th>
+ </tr><tr>
+ <td style="width: 25%">
+ <?php echo $form->startDate ?>
+ <?php echo $form->startDate
+ ->help(__('Enter the start year. Do not use any qualifiers or
typographical symbols to express uncertainty.'))
+ ->renderHelp() ?>
+ </td><td style="width: 25%">
+ <?php echo $form->endDate ?>
+ <?php echo $form->endDate
+ ->help(__('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.'))
+ ->renderHelp() ?>
+ </td><td colspan="2" style="width: 50%">
+ <?php echo $form->dateDisplay ?>
+ <?php echo $form->dateDisplay
+ ->help(__('"Record, when relevant, the start and the end date of the
relationship." (ISDF 6.3) Enter the date as you would like it to appear in the
show page for the function, using qualifiers and/or typographical symbols to
express uncertainty if desired.'))
+ ->renderHelp() ?>
+ </td>
+ </tr><tr>
+ <td colspan="4">
+ <?php echo __('%1% - dates must be specified in ISO-8601 format
(YYYY-MM-DD)', array('%1%' => '†'))?>
+ </td>
+ </tr>
+ </tbody>
+</table>
Modified:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/editSuccess.php
==============================================================================
--- trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/editSuccess.php
Sun Oct 17 17:56:27 2010 (r8208)
+++ trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/editSuccess.php
Sun Oct 17 18:13:01 2010 (r8209)
@@ -62,11 +62,11 @@
<legend><?php echo __('Relationships area') ?></legend>
- <?php echo get_partial('relatedFunctions',
$relatedFunctionsComponent->getVarHolder()->getAll()) ?>
+ <?php echo get_partial('relatedFunction',
$relatedFunctionComponent->getVarHolder()->getAll()) ?>
- <?php echo get_partial('relatedAuthorityRecords',
$relatedAuthorityRecordsComponent->getVarHolder()->getAll()) ?>
+ <?php echo get_partial('relatedAuthorityRecord',
$relatedAuthorityRecordComponent->getVarHolder()->getAll()) ?>
- <?php echo get_partial('relatedResources',
$relatedResourcesComponent->getVarHolder()->getAll()) ?>
+ <?php echo get_partial('relatedResource',
$relatedResourceComponent->getVarHolder()->getAll()) ?>
</fieldset>
--
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.