public function executeProjectUsers(sfWebRequest $request) { $this->checkProject($request); //Recherche du projet if ($this->ei_project->getProjectId() != null && $this->ei_project->getRefId() != null) { $this->users = doctrine_core::getTable('EiProjectUser')->findByProjectIdAndProjectRef($this->ei_project->getProjectId(), $this->ei_project->getRefId()); } else { $this->users = Doctrine_Core::getTable('EiProjet')->findOneByProjectIdAndRefId($this->ei_project->getProjectId(), $this->ei_project->getRefId())->getEiUsers(); } }
<?php if ($ei_scenario != null && $ei_version != null) { $q = doctrine_core::getTable('EiProfilScenario')->getProfilScenarioByCriteria(null, $ei_scenario->id, $ei_version->id, null, null); if ($q != null && $q->execute()->getFirst()) { ?> <ul> <?php $profils_scenarios = $q->execute(); foreach ($profils_scenarios as $profils_scenario) { ?> <li><?php echo $profils_scenario->getEiProfil()->getNomProfil(); ?> </li> <?php } ?> </ul> <?php } } echo link_to1('+profil', 'eiprofilscenario/new?ei_scenario_id=' . $ei_scenario->id . '&id_version=' . $ei_version->id);
public function executeUpdate(sfWebRequest $request) { $this->checkProject($request); $this->checkProfile($request, $this->ei_project); $this->checkSubject($request, $this->ei_project); $this->ei_campaign = doctrine_core::getTable('EiCampaign')->findOneById($request->getParameter('campaign_id')); $this->checkSubjectCampaign($this->ei_subject, $this->ei_campaign); $this->form = new EiSubjectHasCampaignForm($this->subjectCampaign); $this->form->embedForm('ei_subject_campaign', new EiCampaignForm($this->ei_campaign)); $this->processForm($request, $this->form); $this->setTemplate('edit'); }
public function findState(EiProjet $ei_project, sfWebRequest $request) { $this->ei_subject_state = doctrine_core::getTable('EiSubjectState')->findOneByIdAndProjectIdAndProjectRef($request->getParameter('state_id'), $ei_project->getProjectId(), $ei_project->getRefId()); }
public function executeChooseDelForManySub(sfWebRequest $request) { $this->forward404unless($request->isXmlHttpRequest()); $this->checkProject($request); //Récupération du projet $this->checkProfile($request, $this->ei_project); //Récupération du profil courant $this->delivery_id = intval($request->getParameter('delivery_id')); if ($this->delivery_id == null) { return $this->renderText(json_encode(array('html' => 'Error .Missing delivery parameters ...', 'success' => false))); } $this->ei_delivery = doctrine_core::getTable('EiDelivery')->findOneByProjectIdAndProjectRefAndId($this->project_id, $this->project_ref, $this->delivery_id); if ($this->ei_delivery == null) { return $this->renderText(json_encode(array('html' => 'Error .Delivery nor found with theses parameters ...', 'success' => false))); } $this->selectSubjects = $request->getParameter('selectSubjectTab'); $this->selectSubjectTab = MyFunction::parseSimpleStringToTab($this->selectSubjects); $this->html = "Error on process ... "; $this->success = false; $conn = Doctrine_Manager::connection(); try { $conn->beginTransaction(); if ($this->selectSubjectTab != null && count($this->selectSubjectTab) > 0) { $this->field = 'delivery_id'; $q = 'UPDATE ei_subject SET ' . $this->field . ' =' . $this->delivery_id; $q .= ' WHERE id IN (' . $this->selectSubjects . ')'; $q .= ' AND project_id = ' . $this->project_id; $q .= ' AND project_ref = ' . $this->project_ref; $conn->execute($q); $conn->commit(); $this->html = "success"; $this->success = true; } else { $this->html = "Error. No subject selected ... "; } return $this->renderText(json_encode(array('html' => $this->html, 'success' => $this->success, 'referer' => $request->getReferer()))); } catch (Exception $e) { $conn->rollback(); return $this->renderText(json_encode(array('html' => $this->html, 'success' => $this->success, 'referer' => $request->getReferer()))); } return sfView::NONE; }