public function getForm($name = null) { javascript('datepicker'); \Layout::addStyle('properties', 'forms.css'); $form = new \PHPWS_Form($name); $form->addHidden('module', 'properties'); $form->addCheck('appalcart', 1); $form->setLabel('appalcart', 'On Appalcart route'); $form->setMatch('appalcart', $this->appalcart); $form->addSelect('campus_distance', array(0 => '0 to 5', 5 => '5 to 10', 10 => '10 to 25', 25 => 'More than 25')); $form->setLabel('campus_distance', 'Miles from campus'); $form->setMatch('campus_distance', $this->campus_distance); $form->addCheck('clubhouse', 1); $form->setLabel('clubhouse', 'Clubhouse'); $form->setMatch('clubhouse', $this->clubhouse); \PHPWS_Core::initModClass('properties', 'User.php'); $contracts = User::getContracts(); $form->addSelect('contract_length', $contracts); $form->setLabel('contract_length', 'Contract length'); $form->setMatch('contract_length', $this->contract_length); $form->addTextarea('description', $this->description); $form->setLabel('description', 'Other property information'); $form->addCheck('airconditioning', 1); $form->setLabel('airconditioning', 'Air Conditioning'); $form->setMatch('airconditioning', $this->airconditioning); $form->addCheck('dishwasher', 1); $form->setLabel('dishwasher', 'Dishwasher'); $form->setMatch('dishwasher', $this->dishwasher); $itypes[NET_DIALUP] = 'Dial Up'; $itypes[NET_CABLE] = 'Cable'; $itypes[NET_DSL] = 'DSL'; $itypes[NET_WIRELESS] = 'Wireless'; $itypes[NET_SATELLITE] = 'Satellite'; $itypes[NET_FIBER] = 'Fiber'; $itypes[NET_BOTH] = 'DSL/Cable'; $form->addSelect('internet_type', $itypes); $form->setLabel('internet_type', 'Internet'); $form->setMatch('internet_type', $this->internet_type); $form->addSelect('laundry_type', array(LAUNDRY_NONE => 'No laundry', LAUNDRY_ON_PREMISES => 'Laundry room on premises', LAUNDRY_HOOKUP => 'Washer/Dryer hook ups in unit', LAUNDRY_IN_UNIT => 'Washer/Dryer in unit')); $form->setLabel('laundry_type', 'Laundry'); $form->setMatch('laundry_type', $this->laundry_type); $form->addText('monthly_rent', $this->getMonthlyRent()); $form->setLabel('monthly_rent', 'Monthly rent'); $form->setSize('monthly_rent', 8, 8); $form->setRequired('monthly_rent'); $form->addText('move_in_date', $this->getMoveInDate()); $form->setLabel('move_in_date', 'Move-in date'); $form->setExtra('move_in_date', 'class="datepicker"'); $form->addText('name', $this->name); $form->setLabel('name', 'Name of property'); $form->setRequired('name'); $form->setSize('name', 50); $form->addCheck('pets_allowed', 1); $form->setLabel('pets_allowed', 'Pets allowed'); $form->setMatch('pets_allowed', $this->pets_allowed); $form->addCheck('sublease', 1); $form->setMatch('sublease', $this->sublease); $form->setLabel('sublease', 'Sublease'); $toptions[TV_NONE] = 'Antenna'; $toptions[TV_CABLE] = 'Cable'; $toptions[TV_SATELLITE] = 'Satellite'; $toptions[TV_FIBER] = 'Fiber'; $form->addSelect('tv_type', $toptions); $form->setLabel('tv_type', 'Television'); $form->setMatch('tv_type', $this->tv_type); $form->addSelect('trash_type', array(TRASH_ON_YOUR_OWN => 'Trash and recycling receptacles not provided', TRASH_ON_PREMISES_NO_RECYCLE => 'Trash receptacles on site. Recycling not provided', TRASH_ON_PREMISES_WITH_RECYCLE => 'Trash and recycling receptacles provided on site', TRASH_PICKUP => 'Curbside pickup for trash and recycling')); $form->setMatch('trash_type', $this->trash_type); $form->setLabel('trash_type', 'Trash removal'); $form->addCheck('workout_room', 1); $form->setMatch('workout_room', $this->workout_room); $form->setLabel('workout_room', 'Workout room'); return $form; }