Author: sevein
Date: Wed Sep 7 14:50:11 2011
New Revision: 9686
Log:
Use Qubit::renderDate to render dates from the database
Modified:
trunk/apps/qubit/modules/right/templates/_edit.php
trunk/apps/qubit/modules/right/templates/_right.php
trunk/plugins/qtAccessionPlugin/modules/accession/actions/editAction.class.php
trunk/plugins/qtAccessionPlugin/modules/accession/templates/indexSuccess.php
trunk/plugins/qtAccessionPlugin/modules/deaccession/actions/editAction.class.php
trunk/plugins/qtAccessionPlugin/modules/deaccession/templates/indexSuccess.php
Modified: trunk/apps/qubit/modules/right/templates/_edit.php
==============================================================================
--- trunk/apps/qubit/modules/right/templates/_edit.php Wed Sep 7 10:49:08
2011 (r9685)
+++ trunk/apps/qubit/modules/right/templates/_edit.php Wed Sep 7 14:50:11
2011 (r9686)
@@ -35,9 +35,9 @@
<td>
<?php echo $item->object->act ?>
</td><td>
- <?php echo $item->object->startDate ?>
+ <?php echo Qubit::renderDate($item->object->startDate) ?>
</td><td>
- <?php echo $item->object->endDate ?>
+ <?php echo Qubit::renderDate($item->object->endDate) ?>
</td><td style="text-align: center">
<input class="multiDelete" name="deleteRights<?php echo $suffix
?>[]" type="checkbox" value="<?php echo url_for(array($item->object, 'module'
=> 'right')) ?>"/>
</td>
Modified: trunk/apps/qubit/modules/right/templates/_right.php
==============================================================================
--- trunk/apps/qubit/modules/right/templates/_right.php Wed Sep 7 10:49:08
2011 (r9685)
+++ trunk/apps/qubit/modules/right/templates/_right.php Wed Sep 7 14:50:11
2011 (r9686)
@@ -10,9 +10,9 @@
<?php echo render_show(__('Restriction'),
render_value($resource->getRestriction(array('cultureFallback' => true)))) ?>
- <?php echo render_show(__('Start date'),
render_value($resource->startDate)) ?>
+ <?php echo render_show(__('Start date'),
render_value(Qubit::renderDate($resource->startDate))) ?>
- <?php echo render_show(__('End date'), render_value($resource->endDate)) ?>
+ <?php echo render_show(__('End date'),
render_value(Qubit::renderDate($resource->endDate))) ?>
<?php if (isset($resource->rightsHolder)): ?>
<?php echo render_show(__('Rights holder'),
link_to(render_value($resource->rightsHolder), array($resource->rightsHolder,
'module' => 'rightsholder'))) ?>
Modified:
trunk/plugins/qtAccessionPlugin/modules/accession/actions/editAction.class.php
==============================================================================
---
trunk/plugins/qtAccessionPlugin/modules/accession/actions/editAction.class.php
Wed Sep 7 10:49:08 2011 (r9685)
+++
trunk/plugins/qtAccessionPlugin/modules/accession/actions/editAction.class.php
Wed Sep 7 14:50:11 2011 (r9686)
@@ -163,7 +163,7 @@
break;
case 'date':
- $this->form->setDefault('date', $this->resource['date']);
+ $this->form->setDefault('date',
Qubit::renderDate($this->resource['date']));
if (!isset($this->resource->id))
{
@@ -177,7 +177,6 @@
break;
case 'identifier':
-
$this->form->setDefault('identifier', $this->resource['identifier']);
if (!isset($this->resource->id))
Modified:
trunk/plugins/qtAccessionPlugin/modules/accession/templates/indexSuccess.php
==============================================================================
---
trunk/plugins/qtAccessionPlugin/modules/accession/templates/indexSuccess.php
Wed Sep 7 10:49:08 2011 (r9685)
+++
trunk/plugins/qtAccessionPlugin/modules/accession/templates/indexSuccess.php
Wed Sep 7 14:50:11 2011 (r9686)
@@ -14,7 +14,7 @@
<?php echo render_show(__('Accession number'),
render_value($resource->identifier)) ?>
-<?php echo render_show(__('Acquisition date'), render_value($resource->date))
?>
+<?php echo render_show(__('Acquisition date'),
render_value(Qubit::renderDate($resource->date))) ?>
<?php echo render_show(__('Source of acquisition'),
render_value($resource->getSourceOfAcquisition(array('cultureFallback' =>
true)))) ?>
Modified:
trunk/plugins/qtAccessionPlugin/modules/deaccession/actions/editAction.class.php
==============================================================================
---
trunk/plugins/qtAccessionPlugin/modules/deaccession/actions/editAction.class.php
Wed Sep 7 10:49:08 2011 (r9685)
+++
trunk/plugins/qtAccessionPlugin/modules/deaccession/actions/editAction.class.php
Wed Sep 7 14:50:11 2011 (r9686)
@@ -103,17 +103,19 @@
break;
case 'date':
- // If it is a *new* deaccession, set current date as default
+ $this->form->setDefault('date',
Qubit::renderDate($this->resource['date']));
+
if (!isset($this->resource->id))
{
$dt = new DateTime;
$this->form->setDefault('date', $dt->format('Y-m-d'));
- $this->form->setValidator('date', new sfValidatorString);
- $this->form->setWidget('date', new sfWidgetFormInput);
-
- break;
}
+ $this->form->setValidator('date', new sfValidatorString);
+ $this->form->setWidget('date', new sfWidgetFormInput);
+
+ break;
+
case 'identifier':
$this->form->setDefault($name, $this->resource[$name]);
$this->form->setValidator($name, new sfValidatorString);
Modified:
trunk/plugins/qtAccessionPlugin/modules/deaccession/templates/indexSuccess.php
==============================================================================
---
trunk/plugins/qtAccessionPlugin/modules/deaccession/templates/indexSuccess.php
Wed Sep 7 10:49:08 2011 (r9685)
+++
trunk/plugins/qtAccessionPlugin/modules/deaccession/templates/indexSuccess.php
Wed Sep 7 14:50:11 2011 (r9686)
@@ -23,7 +23,7 @@
<?php echo render_show(__('Scope'), render_value($resource->scope)) ?>
-<?php echo render_show(__('Date'), render_value($resource->date)) ?>
+<?php echo render_show(__('Date'),
render_value(Qubit::renderDate($resource->date))) ?>
<?php echo render_show(__('Description'),
render_value($resource->description)) ?>
--
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.