public function configure()
 {
     $this->setWidgets(array('client_service_type' => new sfWidgetFormChoice(array('choices' => ClientServicePeer::getClassKeys())), 'employee_id' => new sfWidgetFormInputHidden(), 'date' => new sfWidgetFormJQueryDate(array('image' => '/images/calendar.png', 'config' => '{}', 'days' => nckTools::generateTwoCharsRange(1, 31), 'months' => nckTools::generateTwoCharsRange(1, 12)), array('class' => 'date'))));
     $this->widgetSchema->setLabels(array('client_service_type' => 'Voucher Type', 'employee_id' => 'Employee', 'date' => 'Vouchers as of Date'));
     $this->setValidators(array('client_service_type' => new sfValidatorPass(), 'employee_id' => new sfValidatorPass(), 'date' => new sfValidatorPass()));
     $this->widgetSchema->setNameFormat('voucher[%s]');
     $this->widgetSchema->setFormFormatterName('list');
 }
 public function configure()
 {
     $this->setWidgets(array('service_type' => new sfWidgetFormSelect(array('choices' => ClientServicePeer::getClassKeys(false))), 'date_month' => new sfWidgetFormSelect(array('choices' => array_combine(range(1, 12), range(1, 12)))), 'date_year' => new sfWidgetFormSelect(array('choices' => array_combine(range(date('Y') - 1, date('Y') + 2), range(date('Y') - 1, date('Y') + 2)))), 'client_id' => new sfWidgetFormInputHidden()));
     $this->widgetSchema->setLabels(array('service_type' => 'Service Type', 'date_month' => 'Month', 'date_year' => 'Year'));
     $this->setValidators(array('service_type' => new sfValidatorPass(), 'date_month' => new sfValidatorPass(), 'date_year' => new sfValidatorPass(), 'client_id' => new sfValidatorPass()));
     $this->setDefaults(array('service_type' => ClientServicePeer::CLASSKEY_CLASSROOM, 'date_month' => date('n'), 'date_year' => date('Y')));
     $this->widgetSchema->setNameFormat('monthlynotes[%s]');
     $this->widgetSchema->setFormFormatterName('list');
 }
 public function configure()
 {
     $this->setWidgets(array('date_month' => new sfWidgetFormSelect(array('choices' => array_combine(range(1, 12), range(1, 12)))), 'date_year' => new sfWidgetFormSelect(array('choices' => array_combine(range(date('Y') - 1, date('Y') + 2), range(date('Y') - 1, date('Y') + 2)))), 'employee_id' => new sfWidgetFormPropelChoice(array('model' => 'Employee', 'add_empty' => 'All', 'order_by' => array('LastName', 'asc'))), 'service_type' => new sfWidgetFormSelect(array('choices' => ClientServicePeer::getClassKeys(false)))));
     $this->widgetSchema->setLabels(array('service_type' => 'Service Type', 'date_month' => 'Month', 'date_year' => 'Year', 'employee_id' => 'Employee'));
     $this->setValidators(array('service_type' => new sfValidatorPass(), 'date_month' => new sfValidatorPass(), 'date_year' => new sfValidatorPass(), 'employee_id' => new sfValidatorPropelChoice(array('model' => 'Employee', 'column' => 'id', 'required' => false))));
     $this->widgetSchema->setNameFormat('dailylog[%s]');
     $this->widgetSchema->setFormFormatterName('list');
     $this->setDefault('date_year', date('Y'));
     $this->setDefault('date_month', date('n'));
 }
Example #4
0
 public function executeInvalidServices(sfWebRequest $request)
 {
     $c = new Criteria();
     // end date before start date
     $cton1 = $c->getNewCriterion(ClientServicePeer::END_DATE, ClientServicePeer::END_DATE . '<' . ClientServicePeer::START_DATE, Criteria::CUSTOM);
     // start date more than 2 years in future
     $cton2 = $c->getNewCriterion(ClientServicePeer::START_DATE, strtotime('+2 years', time()), Criteria::GREATER_THAN);
     $cton1->addOr($cton2);
     // object_type not valid
     $cton3 = $c->getNewCriterion(ClientServicePeer::OBJECT_TYPE, array_keys(ClientServicePeer::getClassKeys(false)), Criteria::NOT_IN);
     $cton1->addOr($cton3);
     // service type not set
     $cton4 = $c->getNewCriterion(ClientServicePeer::SERVICE_ID, null, Criteria::ISNULL);
     $cton1->addOr($cton4);
     $c->add($cton1);
     $this->services = ClientServicePeer::doSelectJoinAll($c);
 }
Example #5
0
 public function configure()
 {
     unset($this['first_name'], $this['last_name'], $this['parent2_first'], $this['parent2_last'], $this['dob'], $this['parent_first'], $this['parent_last'], $this['address'], $this['address_2'], $this['city'], $this['state'], $this['zip'], $this['county_id'], $this['district_id'], $this['home_phone'], $this['work_phone'], $this['cell_phone'], $this['blue_card'], $this['immunizations'], $this['waiting_list'], $this['is_iep'], $this['physical_exp'], $this['notes'], $this['created_at'], $this['updated_at'], $this['service_coordinator_id'], $this['note_entry_kids_list'], $this['pediatrician']);
     $this->widgetSchema['employee_id'] = new sfWidgetFormPropelChoiceMany(array('model' => 'Employee', 'add_empty' => true, 'order_by' => array('LastName', 'asc')));
     $this->widgetSchema['service_id'] = new sfWidgetFormPropelChoiceMany(array('model' => 'Service', 'add_empty' => true, 'order_by' => array('Name', 'asc')));
     #$this->widgetSchema['frequency_id']     = new sfWidgetFormPropelChoice(array('model' => 'Frequency', 'add_empty' => true));
     $this->widgetSchema['start_date'] = new sfWidgetFormFilterDate(array('template' => 'between  - 
                     <a href="#" title="Summer" onclick="javascript:prefillDate(\'client_filters_start_date_from\', \'7\', \'1\', \'' . (date('m') < '7' ? date('Y') : date('Y')) . '\');prefillDate(\'client_filters_start_date_to\', \'7\', \'15\', \'' . (date('m') < '7' ? date('Y') : date('Y')) . '\');return false;">(S)</a>&nbsp;
                     <a href="#" title="Fall" onclick="javascript:prefillDate(\'client_filters_start_date_from\', \'9\', \'1\', \'' . (date('m') < '9' ? date('Y') : date('Y')) . '\');prefillDate(\'client_filters_start_date_to\', \'9\', \'30\', \'' . (date('m') < '9' ? date('Y') : date('Y')) . '\');return false;">(F)</a><br />%from_date%<br />and <br />%to_date%', 'from_date' => new sfWidgetFormJQueryDate(array('image' => '/images/calendar.png', 'config' => '{}'), array('class' => 'filter_date')), 'to_date' => new sfWidgetFormJQueryDate(array('image' => '/images/calendar.png', 'config' => '{}'), array('class' => 'filter_date')), 'with_empty' => false));
     $this->widgetSchema['end_date'] = new sfWidgetFormFilterDate(array('template' => 'between  -
                   <a href="#" title="Summer" onclick="javascript:prefillDate(\'client_filters_end_date_from\', \'8\', \'1\', \'' . (date('m') < '8' ? date('Y') + 1 : date('Y')) . '\');prefillDate(\'client_filters_end_date_to\', \'8\', \'30\', \'' . (date('m') < '8' ? date('Y') + 1 : date('Y')) . '\');return false;">(S)</a>&nbsp;
                   <a href="#" title="Fall" onclick="javascript:prefillDate(\'client_filters_end_date_from\', \'6\', \'1\', \'' . (date('m') < '6' ? date('Y') + 1 : date('Y')) . '\');prefillDate(\'client_filters_end_date_to\', \'6\', \'30\', \'' . (date('m') < '6' ? date('Y') + 1 : date('Y')) . '\');return false;">(F)</a><br />%from_date%<br />and <br />%to_date%', 'from_date' => new sfWidgetFormJQueryDate(array('image' => '/images/calendar.png', 'config' => '{}'), array('class' => 'filter_date')), 'to_date' => new sfWidgetFormJQueryDate(array('image' => '/images/calendar.png', 'config' => '{}'), array('class' => 'filter_date')), 'with_empty' => false));
     #$this->widgetSchema['change_date']      = new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormJQueryDate(array('config' => '{}')), 'to_date' => new sfWidgetFormJQueryDate(array('config' => '{}')), 'with_empty' => true));
     #$this->widgetSchema['icd9_id']          = new sfWidgetFormPropelChoice(array('model' => 'Icd9', 'add_empty' => true));
     #$this->widgetSchema['authorization']    = new sfWidgetFormFilterInput();
     #$this->widgetSchema['physicians_order'] = new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no')));
     $this->widgetSchema['office_id'] = new sfWidgetFormPropelChoiceMany(array('model' => 'Office', 'add_empty' => true));
     $this->widgetSchema['object_type'] = new sfWidgetFormChoice(array('choices' => ClientServicePeer::getClassKeys(), 'multiple' => true));
     $this->validatorSchema['employee_id'] = new sfValidatorPass(array('required' => false));
     $this->validatorSchema['service_id'] = new sfValidatorPass(array('required' => false));
     #$this->validatorSchema['frequency_id']     = new sfValidatorPropelChoice(array('required' => false, 'model' => 'Frequency', 'column' => 'id'));
     $this->validatorSchema['start_date'] = new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false))));
     $this->validatorSchema['end_date'] = new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false))));
     #$this->validatorSchema['change_date']      = new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false))));
     #$this->validatorSchema['icd9_id']          = new sfValidatorPropelChoice(array('required' => false, 'model' => 'Icd9', 'column' => 'id'));
     #$this->validatorSchema['authorization']    = new sfValidatorPass(array('required' => false));
     #$this->validatorSchema['physicians_order'] = new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0)));
     $this->validatorSchema['office_id'] = new sfValidatorPass(array('required' => false));
     $this->validatorSchema['object_type'] = new sfValidatorPass(array('required' => false));
     #$this->widgetSchema['district_id']->setOption('expanded', false);
     $this->widgetSchema['employee_id']->setLabel('Provider');
     $this->widgetSchema['start_date']->setLabel('Start Date Range:');
     $this->widgetSchema['end_date']->setLabel('End Date Range:');
     $this->widgetSchema['service_id']->setLabel('Service Type');
     $this->widgetSchema['office_id']->setLabel('Office');
     $this->widgetSchema['object_type']->setLabel('Client Service');
     if (!sfContext::getInstance()->getUser()->hasCredential('admin')) {
         unset($this['end_date']);
     }
 }