public function deleteStopDiagnose($request, $response) { /*{{{*/ $backUrl = $_SERVER["HTTP_REFERER"]; $stopDiagnose = DAL::get()->find('stopdiagnose', $request->id); $spaceBusinessRequirement = DAL::get()->find_by_spaceid_and_type('SpaceBusinessRequirement', $stopDiagnose->space->id, ServiceDef::TYPE_BOOKING); BookingClient::getInstance()->deleteStopDiagnose($request->id); SpaceBusinessRequirementClient::getInstance()->addSpaceBusinessRequirementLog($spaceBusinessRequirement->id, $this->curUser->id, BookingLog::TYPE_DOCTOR_DEL_STOP_SCHEDULE); $response->setRedirect($backUrl); //$response->setRedirect($response->router->urlfor('spacebusinessrequirement/updateschedule', array('id'=>$spaceBusinessRequirement->id))); }
public function postSchedule($request, $response) { /*{{{*/ $scheduleList = SpaceBusinessRequirement::$scheduleDef; for ($i = 1; $i < 22; $i++) { $schedule = $request->{"schedule" . $i}; if (count($schedule) == 7 && $schedule['pluscount'] && $schedule['registertime'] && $schedule['address']) { //必选(4项) $scheduleList[$schedule['registerdate']] = $schedule; } } $spaceBusinessRequirementId = $request->spaceBusinessRequirementId; $spaceBusinessRequirement = DAL::get()->find('SpaceBusinessRequirement', $request->id); SpaceBusinessRequirementClient::getInstance()->postSchedule($spaceBusinessRequirement, $scheduleList); SpaceBusinessRequirementClient::getInstance()->addSpaceBusinessRequirementLog($spaceBusinessRequirementId, $this->curInspector->user->id, BookingLog::TYPE_DOCTOR_SCHEDULE); $response->setRedirect($response->router->urlfor('spacebusinessrequirement/updateschedule', array('id' => $request->id))); }
private function _getBookingDiseases($spaceIds) {/*{{{*/ if(empty($spaceIds)) { return array(); } $requirements = SpaceBusinessRequirementClient::getInstance()->getListByTypeAndSpaceIds(ServiceDef::TYPE_BOOKING, $spaceIds); $bookingDiseasesOfSpaceId = array(); foreach($requirements as $spaceId => $r) { $bookingDiseasesOfSpaceId[$spaceId] = $r->disease; } return $bookingDiseasesOfSpaceId; }/*}}}*/