Development

Changeset 3297

You must first sign up to be able to contribute.

Changeset 3297

Show
Ignore:
Timestamp:
01/16/07 20:37:06 (2 years ago)
Author:
chtito
Message:

sync with [3291] and [3294]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/actions/actions.class.php

    r3287 r3297  
    194194      { 
    195195        $dateFormat = new sfDateFormat($this->getUser()->getCulture()); 
    196         <?php $inputPattern = ($type == 'date' ? 'd' : 'g'); ?> 
    197         <?php $outputPattern = ($type == 'date' ? 'i' : 'I'); ?> 
    198         $value = $dateFormat->format($<?php echo $this->getSingularName() ?>['<?php echo $name ?>'], '<?php echo $outputPattern ?>', $dateFormat->getInputPattern('<?php echo $inputPattern ?>')); 
    199           <?php echo $this->getColumnSetter($column, '$value') ?>; 
     196<?php  
     197$inputPattern = ($type == 'date' ? 'd' : 'g'); 
     198$outputPattern = ($type == 'date' ? 'i' : 'I');  
     199?> 
     200        // if this is a direct date input (rich == true) 
     201        if (!is_array($<?php echo $this->getSingularName() ?>['<?php echo $name ?>'])) 
     202        { 
     203          try 
     204          { 
     205            $value = $dateFormat->format($<?php echo $this->getSingularName() ?>['<?php echo $name ?>'], '<?php echo $outputPattern ?>', $dateFormat->getInputPattern('<?php echo $inputPattern ?>')); 
     206          } 
     207          catch (sfException $e) 
     208          { 
     209            // not a valid date 
     210          } 
     211        } 
     212        else // rich == false 
     213        { 
     214          $value_array = $<?php echo $this->getSingularName() ?>['<?php echo $name ?>']; 
     215          $value = $value_array['year'].'-'.$value_array['month'].'-'.$value_array['day'].(isset($value_array['hour']) ? ' '.$value_array['hour'].':'.$value_array['minute'].(isset($value_array['second']) ? ':'.$value_array['second'] : '') : '');  
     216        } 
     217        <?php echo $this->getColumnSetter($column, '$value') ?>; 
    200218      } 
    201219      else