Ejemplo n.º 1
0
 public function getFormFields()
 {
     $fields = parent::getFormFields();
     /*
             'Status' => "Enum('own, rent, loan')",
             'Amount' => 'Int',
             'HoldsRationCard' => 'Boolean',
             'CardType' => 'VarChar(4)',
             'Type' => "Enum('hut,ollapera,sheet,oddapera,concrete,2level,multilevel,flat')",
             'BuildYear' => 'Int'
     */
     $statusArray = singleton('House')->dbObject('Status')->enumValues();
     $statusField = DropdownField::create('Status', 'Own House/Renting/On Loan', $statusArray);
     $statusField->setEmptyString('All');
     $fields->push($statusField);
     //$fields->push(CheckboxField::create('HoldsRationCard', 'Yes'));
     $options = array('1' => 'Yes', '0' => 'No', '' => 'All');
     $holdsRationCardField = new OptionsetField("HoldsRationCard", 'Holds RationCard', $options, null);
     $fields->push($holdsRationCardField);
     $cardTypes = Config::inst()->get('House', 'CardType');
     $cardTypeField = DropdownField::create('CardType', 'Ration Card Type', $cardTypes);
     $cardTypeField->setEmptyString('select any');
     $fields->push($cardTypeField);
     $typeArray = singleton('House')->dbObject('Type')->enumValues();
     $typeField = DropdownField::create('Type', 'House Type', $typeArray);
     $typeField->setEmptyString('select any');
     $fields->push($typeField);
     $parishes = Parish::get()->map('ID', 'NameWithLocation')->toArray();
     $parishField = DropdownField::create('ParishID', 'Parish')->setSource($parishes);
     $parishField->setEmptyString('All Parish');
     $parishField->setValue(parent::getDefaultParishID());
     $fields->push($parishField);
     return $fields;
 }
 public function getFormFields()
 {
     $fields = parent::getFormFields();
     $typeArray = singleton('Agriculture')->dbObject('Type')->enumValues();
     $typeField = DropdownField::create('Type', 'Type', $typeArray);
     $typeField->setEmptyString('select any');
     $fields->push($typeField);
     $parishes = Parish::get()->map('ID', 'NameWithLocation')->toArray();
     $parishField = DropdownField::create('ParishID', 'Parish')->setSource($parishes);
     $parishField->setEmptyString('All Parish');
     $parishField->setValue(parent::getDefaultParishID());
     $fields->push($parishField);
     return $fields;
 }
 public function getFormFields()
 {
     $fields = parent::getFormFields();
     $options = array('1' => 'Yes', '0' => 'No', '' => 'All');
     $statusField = new OptionsetField("Status", 'Shifted from Urban/Rural area', $options, 1);
     $fields->push($statusField);
     //$fields->push(CheckboxField::create('Status', 'Yes'));
     $parishes = Parish::get()->map('ID', 'NameWithLocation')->toArray();
     $parishField = DropdownField::create('ParishID', 'Parish')->setSource($parishes);
     $parishField->setEmptyString('All Parish');
     $parishField->setValue(parent::getDefaultParishID());
     $fields->push($parishField);
     return $fields;
 }
Ejemplo n.º 4
0
 public function getFormFields()
 {
     $fields = parent::getFormFields();
     //$fields->push(TextField::create('Pincode', 'Pincode'));
     $fields->push(TextField::create('BlockNo', 'Block No'));
     $fields->push(TextField::create('UnitNo', 'Unit No'));
     //$fields->push(CheckboxField::create('IsPanchayat', 'Is Panchayat'));
     //$fields->push(CheckboxField::create('IsMunicipality', 'Is Municipality'));
     //$fields->push(CheckboxField::create('IsCorporation', 'Is Corporation'));
     $parishes = Parish::get()->map('ID', 'NameWithLocation')->toArray();
     $parishField = DropdownField::create('ParishID', 'Parish')->setSource($parishes);
     $parishField->setEmptyString('All Parish');
     $parishField->setValue(parent::getDefaultParishID());
     $fields->push($parishField);
     return $fields;
 }
Ejemplo n.º 5
0
 public function getFormFields()
 {
     $fields = parent::getFormFields();
     //$fields->push(CheckboxField::create('HoldsLand', 'Yes'));
     $options = array('1' => 'Yes', '0' => 'No', '' => 'All');
     $holdsLandField = new OptionsetField("HoldsLand", 'Holds Land', $options, null);
     $fields->push($holdsLandField);
     $landArray = singleton('Land')->dbObject('Area')->enumValues();
     $landField = DropdownField::create('Area', 'Area', $landArray);
     $landField->setEmptyString('select any');
     $fields->push($landField);
     $parishes = Parish::get()->map('ID', 'NameWithLocation')->toArray();
     $parishField = DropdownField::create('ParishID', 'Parish')->setSource($parishes);
     $parishField->setEmptyString('All Parish');
     $parishField->setValue(parent::getDefaultParishID());
     $fields->push($parishField);
     return $fields;
 }