public function configure()
 {
     $params = $this->getOption('params');
     $this->unsetTimeStampable();
     $this->setWidget('staff_id', new sfWidgetFormInputHidden());
     $this->setDefault('staff_id', Staff::loggedInId());
     $this->setDefault('task_id', $params['task_id']);
 }
 public function getValidTimeLogTypes()
 {
     $staff_id = Staff::loggedInId();
     $table = Doctrine_Core::getTable('TimeLogType');
     $tlt = $this->getLastTimeLogTypeByStaffId($staff_id);
     $ci = $table->getClockInById($tlt);
     return $table->getByClockIn($ci);
 }
 public function configure()
 {
     $params = $this->getOption('params');
     $fromOptions = array('widget_name' => 'from', 'params' => $params, 'default_date' => '2008-01-01', 'default_time' => '12:00 AM');
     $untilOptions = array('widget_name' => 'until', 'params' => $params, 'default_date' => date('Y-m-d'), 'default_time' => date('h:i A'));
     $this->setWidgets(array('staff_id' => new sfWidgetFormDoctrineChoice(array('label' => 'Employee', 'model' => 'Staff', 'add_empty' => false)), 'from' => new sfJQueryDateTimeWidget($fromOptions), 'until' => new sfJQueryDateTimeWidget($untilOptions)));
     $this->setValidators(array('from' => new sfJQueryDateTimeValidator(array('widget_name' => 'from')), 'until' => new sfJQueryDateTimeValidator(array('widget_name' => 'until'))));
     if (@$params['staff_id']) {
         $this->setDefault('staff_id', $params['staff_id']);
     } else {
         $this->setDefault('staff_id', Staff::loggedInId());
     }
 }
 public function configure()
 {
     $this->unsetTimeStampable();
     $this->setDefault('staff_id', Staff::loggedInId());
     if (!$this->getCurrentUser()->isSuperAdmin()) {
         $staff_input = new sfWidgetFormInputHidden();
         $this->setWidget('staff_id', $staff_input);
     }
     $params = $this->getOption('params');
     $options = array('widget_name' => 'time', 'params' => $params, 'default_date' => date('Y-m-d'), 'default_time' => date('h:i A'));
     $this->setWidget('time_log_type_id', new sfWidgetFormDoctrineChoice(array('model' => 'TimeLog', 'table_method' => 'getValidTimeLogTypes'), array()));
     $this->setWidget('time', new sfJQueryDateTimeWidget($options));
     $this->setValidator('time', new sfJQueryDateTimeValidator(array('widget_name' => 'time')));
 }
 public function configure()
 {
     $params = $this->getOption('params');
     $this->unsetTimeStampable();
     $this->setWidget('staff_id', new sfWidgetFormInputHidden());
     $this->setDefault('staff_id', Staff::loggedInId());
     $this->setDefault('task_id', $params['task_id']);
     if (!$this->getCurrentUser()->isSuperAdmin()) {
         unset($this['is_viewable'], $this['percentage']);
     }
     $this->getOption('params');
     $inOptions = array('widget_name' => 'clock_in', 'params' => $params, 'default_date' => date('Y-m-d'), 'default_time' => date('h:i A'));
     $outOptions = array('widget_name' => 'clock_out', 'params' => $params, 'default_date' => date('Y-m-d'), 'default_time' => date('h:i A'));
     $this->setWidget('clock_in', new sfJQueryDateTimeWidget($inOptions));
     $this->setWidget('clock_out', new sfJQueryDateTimeWidget($outOptions));
     $this->setValidator('clock_in', new sfJQueryDateTimeValidator(array('widget_name' => 'clock_in')));
     $this->setValidator('clock_out', new sfJqueryDateTimeValidator(array('widget_name' => 'clock_out')));
 }
 public function getByStaffId()
 {
     return Doctrine_Query::Create()->from('TaskComment tc')->where('tc.staff_id = ?', Staff::loggedInId())->execute();
 }