protected function getTargetPager(sfWebrequest $request, Member $myMember) { $target = $request->getParameter('target'); $options = $this->getOptions($request, 'diary'); $table = Doctrine::getTable('Diary'); switch ($target) { case 'list': $publicFlag = DiaryTable::PUBLIC_FLAG_SNS; $pager = $table->getDiaryPager($options['page'], $options['limit'], $publicFlag); break; case 'list_mine': $pager = $table->getMemberDiaryPager($myMember->id, $options['page'], $options['limit'], $myMember->id); break; case 'list_member': $memberId = $request->getParameter('member_id'); if (!$memberId) { $pager = $table->getMemberDiaryPager($myMember->id, $options['page'], $options['limit'], $myMember->id); } else { $this->forward403If($this->isAccessBlockFromMember($memberId)); $pager = $table->getMemberDiaryPager($memberId, $options['page'], $options['limit'], $myMember->id); } break; case 'list_friend': $pager = $table->getFriendDiaryPager($myMember->id, $options['page'], $options['limit']); break; default: throw new Exception('invalid target'); break; } $pager->init(); return $pager; }
/** * This step asks whether applicant agrees on affirmation */ public function executeStep4(sfWebrequest $request) { $application_temp = ApplicationTempPeer::retrieveByPK($request->getParameter('id')); $this->forward404Unless($application_temp); $is_pilot = $application_temp->getApplicantPilot(); $this->form1 = new ApplicationTempStep1Form($application_temp); $this->form2 = new ApplicationTempStep2Form($application_temp, array('pilot' => $is_pilot)); if ($is_pilot) { $this->form3 = new ApplicationTempStep3Form($application_temp); } $this->form4_widget = $this->getAgreeWidget($this->form2); $this->setTemplate('steps'); }
public function executeShow(sfWebrequest $request) { $this->video = Doctrine_Core::getTable('Video')->find($request->getParameter('id')); $this->forward404Unless($this->video); }
public function executeBusquedapersonalisada(sfWebrequest $request) { $this->quirofano = $request->getParameter('Quirofano'); $this->sala = $request->getParameter('Sala'); $this->nombre = $request->getParameter('Nombre'); $this->año = $request->getParameter("Año"); $this->mes = $request->getParameter("Mes"); $fechainicial = new DateTime("01-" . $this->mes . "-" . $this->año . ""); $fecha['min'] = $fechainicial->format('Y-m-d'); $fechafinal = new DateTime("01-" . $this->mes . "-" . $this->año . ""); $fechafinal->modify('last day of this month'); $fecha['max'] = $fechafinal->format("Y-m-d"); $this->Quirofano = QuirofanoQuery::create()->findOneByNombre("%" . $this->quirofano . "%"); $this->Salas = SalaquirurgicaQuery::create()->findOneByNombre("%" . $this->sala . "%"); $this->cirugias = AgendaQuery::create()->filterByquirofanoid($this->existe($this->Quirofano))->filterBysalaid($this->existe($this->Salas))->filterBypacientename("%" . $this->nombre . "%")->filterByprogramacion($fecha)->filterByCancelada(false)->find(); }