Author: jablko
Date: Sat Oct 23 09:13:24 2010
New Revision: 8397

Log:
Factor into Qubit::renderDateStartEnd()

Modified:
   trunk/apps/qubit/modules/informationobject/templates/_dates.php
   trunk/apps/qubit/modules/informationobject/templates/_relatedEvents.php
   trunk/apps/qubit/modules/physicalobject/templates/boxListSuccess.php
   trunk/apps/qubit/modules/search/templates/indexSuccess.php
   trunk/apps/qubit/modules/term/templates/browseTermSuccess.php
   trunk/apps/qubit/modules/term/templates/deleteSuccess.php
   trunk/lib/helper/QubitHelper.php
   trunk/plugins/sfEadPlugin/modules/sfEadPlugin/templates/indexSuccess.xml.php
   trunk/plugins/sfIsadPlugin/modules/sfIsadPlugin/templates/fileListSuccess.php
   trunk/plugins/sfIsadPlugin/modules/sfIsadPlugin/templates/indexSuccess.php

Modified: trunk/apps/qubit/modules/informationobject/templates/_dates.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/_dates.php     Sat Oct 
23 08:56:30 2010        (r8396)
+++ trunk/apps/qubit/modules/informationobject/templates/_dates.php     Sat Oct 
23 09:13:24 2010        (r8397)
@@ -3,7 +3,7 @@
     <h3><?php echo __('Date') ?></h3>
     <div>
 
-      <?php echo date_display($item) ?>
+      <?php echo 
Qubit::renderDateStartEnd($item->getDateDisplay(array(cultureFallback => 
true)), $item->startDate, $item->endDate) ?>
 
       <div class="note2" style="margin-left: 1.5em;">
         <?php echo __('Type') ?>: <?php echo $item->type ?>

Modified: 
trunk/apps/qubit/modules/informationobject/templates/_relatedEvents.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/_relatedEvents.php     
Sat Oct 23 08:56:30 2010        (r8396)
+++ trunk/apps/qubit/modules/informationobject/templates/_relatedEvents.php     
Sat Oct 23 09:13:24 2010        (r8397)
@@ -28,7 +28,7 @@
           </div>
         </td><td>
           <div>
-            <?php echo date_display($item) ?>
+            <?php echo 
Qubit::renderDateStartEnd($item->getDateDisplay(array(cultureFallback => 
true)), $item->startDate, $item->endDate) ?>
           </div>
         </td><td style="text-align: right">
           <input class="multiDelete" name="deleteEvents[]" type="checkbox" 
value="<?php echo $item->id ?>"/>

Modified: trunk/apps/qubit/modules/physicalobject/templates/boxListSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/physicalobject/templates/boxListSuccess.php        
Sat Oct 23 08:56:30 2010        (r8396)
+++ trunk/apps/qubit/modules/physicalobject/templates/boxListSuccess.php        
Sat Oct 23 09:13:24 2010        (r8397)
@@ -32,7 +32,7 @@
           <ul>
             <?php foreach ($informationObject->getDates() as $date): ?>
               <li>
-                <?php echo date_display($date) ?> (<?php echo 
$date->getType(array('cultureFallback' => true)) ?>)
+                <?php echo 
Qubit::renderDateStartEnd($date->getDateDisplay(array(cultureFallback => 
true)), $date->startDate, $date->endDate) ?> (<?php echo 
$date->getType(array('cultureFallback' => true)) ?>)
                 <?php if (isset($date->actor)): ?>
                   <?php echo link_to(render_title($date->actor), 
array($date->actor, 'module' => 'actor')) ?>
                 <?php endif; ?>

Modified: trunk/apps/qubit/modules/search/templates/indexSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/search/templates/indexSuccess.php  Sat Oct 23 
08:56:30 2010        (r8396)
+++ trunk/apps/qubit/modules/search/templates/indexSuccess.php  Sat Oct 23 
09:13:24 2010        (r8397)
@@ -42,7 +42,7 @@
             <ul>
               <?php foreach ($informationObject->getDates() as $date): ?>
                 <li>
-                  <?php echo date_display($date) ?> (<?php echo 
$date->getType(array('cultureFallback' => true)) ?>)
+                  <?php echo 
Qubit::renderDateStartEnd($date->getDateDisplay(array(cultureFallback => 
true)), $date->startDate, $date->endDate) ?> (<?php echo 
$date->getType(array('cultureFallback' => true)) ?>)
                   <?php if (isset($date->actor)): ?>
                     <?php echo link_to(render_title($date->actor), 
array($date->actor, 'module' => 'actor')) ?>
                   <?php endif; ?>

Modified: trunk/apps/qubit/modules/term/templates/browseTermSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/term/templates/browseTermSuccess.php       Sat Oct 
23 08:56:30 2010        (r8396)
+++ trunk/apps/qubit/modules/term/templates/browseTermSuccess.php       Sat Oct 
23 09:13:24 2010        (r8397)
@@ -24,7 +24,7 @@
           <ul>
             <?php foreach ($informationObject->getDates() as $date): ?>
               <li>
-                <?php echo date_display($date) ?> (<?php echo 
$date->getType(array('cultureFallback' => true)) ?>)
+                <?php echo 
Qubit::renderDateStartEnd($date->getDateDisplay(array(cultureFallback => 
true)), $date->startDate, $date->endDate) ?> (<?php echo 
$date->getType(array('cultureFallback' => true)) ?>)
                 <?php if (isset($date->actor)): ?>
                   <?php echo link_to(render_title($date->actor), 
array($date->actor, 'module' => 'actor')) ?>
                 <?php endif; ?>

Modified: trunk/apps/qubit/modules/term/templates/deleteSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/term/templates/deleteSuccess.php   Sat Oct 23 
08:56:30 2010        (r8396)
+++ trunk/apps/qubit/modules/term/templates/deleteSuccess.php   Sat Oct 23 
09:13:24 2010        (r8397)
@@ -14,7 +14,7 @@
 
   <ul>
     <?php foreach ($term->events as $event): ?>
-      <li><?php echo date_display($event) ?> (<?php echo render_title($term) 
?>) <?php echo link_to(render_title($event->informationObject), 
array($event->informationObject, 'module' => 'informationobject')) ?></li><?php 
endforeach; ?>
+      <li><?php echo 
Qubit::renderDateStartEnd($event->getDateDisplay(array(cultureFallback => 
true)), $event->startDate, $event->endDate) ?> (<?php echo render_title($term) 
?>) <?php echo link_to(render_title($event->informationObject), 
array($event->informationObject, 'module' => 'informationobject')) ?></li><?php 
endforeach; ?>
   </ul>
 
 <?php endif; ?>

Modified: trunk/lib/helper/QubitHelper.php
==============================================================================
--- trunk/lib/helper/QubitHelper.php    Sat Oct 23 08:56:30 2010        (r8396)
+++ trunk/lib/helper/QubitHelper.php    Sat Oct 23 09:13:24 2010        (r8397)
@@ -226,23 +226,3 @@
 
   return round(($val / pow(1024, $i)), 1).' '.$units[$i];
 }
-
-function date_display($dateObject)
-{
-  $dateDisplay = '';
-
-  if (0 < strlen($dateObject->getDateDisplay(array('cultureFallback' => 
true))))
-  {
-    $dateDisplay = $dateObject->getDateDisplay(array('cultureFallback' => 
true));
-  }
-  else if (isset($dateObject->startDate) && isset($dateObject->endDate))
-  {
-    $dateDisplay = Qubit::renderDate($dateObject->startDate).' - 
'.Qubit::renderDate($dateObject->endDate);
-  }
-  else if (isset($dateObject->startDate))
-  {
-    $dateDisplay = Qubit::renderDate($dateObject->startDate);
-  }
-
-  return $dateDisplay;
-}

Modified: 
trunk/plugins/sfEadPlugin/modules/sfEadPlugin/templates/indexSuccess.xml.php
==============================================================================
--- 
trunk/plugins/sfEadPlugin/modules/sfEadPlugin/templates/indexSuccess.xml.php    
    Sat Oct 23 08:56:30 2010        (r8396)
+++ 
trunk/plugins/sfEadPlugin/modules/sfEadPlugin/templates/indexSuccess.xml.php    
    Sat Oct 23 09:13:24 2010        (r8397)
@@ -79,7 +79,7 @@
     <unitid <?php if ($resource->getRepository()): ?><?php if ($repocode = 
$resource->getRepository()->getIdentifier()): ?><?php echo 
'repositorycode="'.esc_specialchars($repocode).'" ' ?><?php endif; ?><?php if 
($countrycode = $resource->getRepository()->getCountryCode()): ?><?php echo 
'countrycode="'.$countrycode.'"' ?><?php endif;?><?php endif; ?> 
encodinganalog="3.1.1"><?php $isad = new sfIsadPlugin($resource); echo 
esc_specialchars($isad->referenceCode) ?></unitid>
 <?php endif; ?>
 <?php foreach ($resource->getDates() as $date): ?>
-    <unitdate <?php if ($type = $date->getType()->__toString()): ?><?php echo 
'datechar="'.strtolower($type).'" ' ?><?php endif; ?><?php if ($startdate = 
$date->getStartDate()): ?><?php echo 'normal="'?><?php echo 
Qubit::renderDate($startdate) ?><?php if (0 < strlen($enddate = 
$date->getEndDate())): ?><?php echo '/'?><?php echo Qubit::renderDate($enddate) 
?><?php endif; ?><?php echo '"' ?><?php endif; ?> encodinganalog="3.1.3"><?php 
echo esc_specialchars(date_display($date)) ?></unitdate>
+    <unitdate <?php if ($type = $date->getType()->__toString()): ?><?php echo 
'datechar="'.strtolower($type).'" ' ?><?php endif; ?><?php if ($startdate = 
$date->getStartDate()): ?><?php echo 'normal="'?><?php echo 
Qubit::renderDate($startdate) ?><?php if (0 < strlen($enddate = 
$date->getEndDate())): ?><?php echo '/'?><?php echo Qubit::renderDate($enddate) 
?><?php endif; ?><?php echo '"' ?><?php endif; ?> encodinganalog="3.1.3"><?php 
echo 
esc_specialchars(Qubit::renderDateStartEnd($date->getDateDisplay(array(cultureFallback
 => true)), $date->startDate, $date->endDate)) ?></unitdate>
 <?php endforeach; // dates ?>
 <?php if (0 < count($creators = $resource->getCreators())): ?>
     <origination encodinganalog="3.2.1">
@@ -226,7 +226,7 @@
         <unitid <?php if ($descendant->getRepository()): ?><?php if ($repocode 
= $descendant->getRepository()->getIdentifier()): ?><?php echo 
'repositorycode="'.esc_specialchars($repocode).'" ' ?><?php endif; ?><?php if 
($countrycode = $descendant->getRepository()->getCountryCode()): ?><?php echo 
'countrycode="'.$countrycode.'"' ?><?php endif;?><?php endif; ?> 
encodinganalog="3.1.1"><?php echo esc_specialchars($value) ?></unitid>
 <?php endif; ?>
 <?php foreach ($descendant->getDates() as $date): ?>
-        <unitdate <?php if ($type = $date->getType()->__toString()): ?><?php 
echo 'datechar="'.strtolower($type).'" ' ?><?php endif; ?><?php if ($startdate 
= $date->getStartDate()): ?><?php echo 'normal="'?><?php echo 
Qubit::renderDate($startdate) ?><?php if (0 < strlen($enddate = 
$date->getEndDate())): ?><?php echo '/'?><?php echo Qubit::renderDate($enddate) 
?><?php endif; ?><?php echo '"' ?><?php endif; ?> encodinganalog="3.1.3"><?php 
echo esc_specialchars(date_display($date)) ?></unitdate>
+        <unitdate <?php if ($type = $date->getType()->__toString()): ?><?php 
echo 'datechar="'.strtolower($type).'" ' ?><?php endif; ?><?php if ($startdate 
= $date->getStartDate()): ?><?php echo 'normal="'?><?php echo 
Qubit::renderDate($startdate) ?><?php if (0 < strlen($enddate = 
$date->getEndDate())): ?><?php echo '/'?><?php echo Qubit::renderDate($enddate) 
?><?php endif; ?><?php echo '"' ?><?php endif; ?> encodinganalog="3.1.3"><?php 
echo 
esc_specialchars(Qubit::renderDateStartEnd($date->getDateDisplay(array(cultureFallback
 => true)), $date->startDate, $date->endDate)) ?></unitdate>
 <?php endforeach; ?>
 <?php if (0 < count($creators = $descendant->getCreators())): ?>
         <origination encodinganalog="3.2.1">

Modified: 
trunk/plugins/sfIsadPlugin/modules/sfIsadPlugin/templates/fileListSuccess.php
==============================================================================
--- 
trunk/plugins/sfIsadPlugin/modules/sfIsadPlugin/templates/fileListSuccess.php   
    Sat Oct 23 08:56:30 2010        (r8396)
+++ 
trunk/plugins/sfIsadPlugin/modules/sfIsadPlugin/templates/fileListSuccess.php   
    Sat Oct 23 09:13:24 2010        (r8397)
@@ -26,7 +26,7 @@
           <ul>
             <?php foreach ($item->getDates() as $date): ?>
               <li>
-                <?php echo date_display($date) ?> (<?php echo 
$date->getType(array('cultureFallback' => true)) ?>)
+                <?php echo 
Qubit::renderDateStartEnd($date->getDateDisplay(array(cultureFallback => 
true)), $date->startDate, $date->endDate) ?> (<?php echo 
$date->getType(array('cultureFallback' => true)) ?>)
                 <?php if (isset($date->actor)): ?>
                   <?php echo link_to(render_title($date->actor), 
array($date->actor, 'module' => 'actor')) ?>
                 <?php endif; ?>

Modified: 
trunk/plugins/sfIsadPlugin/modules/sfIsadPlugin/templates/indexSuccess.php
==============================================================================
--- trunk/plugins/sfIsadPlugin/modules/sfIsadPlugin/templates/indexSuccess.php  
Sat Oct 23 08:56:30 2010        (r8396)
+++ trunk/plugins/sfIsadPlugin/modules/sfIsadPlugin/templates/indexSuccess.php  
Sat Oct 23 09:13:24 2010        (r8397)
@@ -30,7 +30,7 @@
       <ul>
         <?php foreach ($resource->getDates() as $date): ?>
           <li>
-            <?php echo date_display($date) ?> (<?php echo 
$date->getType(array('cultureFallback' => true)) ?>)
+            <?php echo 
Qubit::renderDateStartEnd($date->getDateDisplay(array(cultureFallback => 
true)), $date->startDate, $date->endDate) ?> (<?php echo 
$date->getType(array('cultureFallback' => true)) ?>)
             <?php if (isset($date->actor)): ?>
               <?php echo link_to(render_title($date->actor), 
array($date->actor, 'module' => 'actor')) ?>
             <?php endif; ?>

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