Changeset 1692

Show
Ignore:
Timestamp:
03/09/10 11:31:49 (5 months ago)
Author:
klemens
Message:

ullFlow -> ullTime integration: added date field

Location:
trunk/plugins/ullFlowPlugin
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/plugins/ullFlowPlugin/lib/form/ullFlowForm.php

    r1688 r1692  
    2828      $this->getWidgetSchema()->offsetSet('duration_seconds', new ullWidgetTimeDurationWrite()); 
    2929      $this->getValidatorSchema()->offsetSet('duration_seconds', new ullValidatorTimeDuration(array('required' => false))); 
     30       
     31      $this->getWidgetSchema()->offsetSet('effort_date', new ullWidgetDateWrite(array(), array('size' => 10))); 
     32      $this->getValidatorSchema()->offsetSet('effort_date', new sfValidatorDate(array('required' => false))); 
    3033    }     
    3134  } 
     
    4346    $this->setDefaults(array_merge($this->getDefaults(),  
    4447        $this->object->getVirtualValuesAsArray())); 
     48         
     49    if (!$this->getDefault('effort_date')) 
     50    { 
     51      $this->setDefault('effort_date', date('Y-m-d'));  
     52    }         
    4553  } 
    4654   
  • trunk/plugins/ullFlowPlugin/modules/ullFlow/lib/BaseUllFlowActions.class.php

    r1688 r1692  
    173173        ))); 
    174174         
    175         $this->saveEffortDuration(); 
     175        $this->saveEffort(); 
    176176 
    177177        if (!$this->isStatusOnlyRequestAction()) 
     
    930930   * @return none 
    931931   */ 
    932   protected function saveEffortDuration() 
     932  protected function saveEffort() 
    933933  { 
    934934    $memory = $this->doc->findLatestMemory(); 
    935935    $projectId = $this->doc->ull_project_id; 
    936936    $duration = $this->generator->getForm()->getValue('duration_seconds'); 
     937    $date = $this->generator->getForm()->getValue('effort_date'); 
    937938     
    938939    if ($duration && $projectId) 
     
    941942      $reporting->ull_project_id = $projectId; 
    942943      $reporting->ull_user_id = sfContext::getInstance()->getUser()->getAttribute('user_id'); 
    943       $reporting->date = date('Y-m-d'); 
     944      $reporting->date = $date; 
    944945      $reporting->duration_seconds = $duration; 
    945946      $reporting->linked_model = 'UllFlowMemory'; 
  • trunk/plugins/ullFlowPlugin/modules/ullFlow/templates/editSuccess.php

    r1688 r1692  
    5454            <?php echo $generator->getForm()->offsetGet('duration_seconds')->renderError() ?> 
    5555            <dfn><?php echo __('Hours : minutes', null, 'ullFlowMessages') ?></dfn> 
     56            &nbsp; <?php echo __('am', null, 'common') ?> 
     57            <?php echo $generator->getForm()->offsetGet('effort_date')->render() ?> 
     58            <?php echo $generator->getForm()->offsetGet('effort_date')->renderError() ?>             
     59             
    5660          </p>         
    5761        <?php endif ?>