$templates['Recherche clinique'] = array(
//'listing' => 'Listing',
'research' => 'Recherche clinique',
- 'researchStudies' => 'Études cliniques',
);
$templates['Parcours patient'] = array('parcours' => 'Parcours', 'soins' => 'Soins support');
$templates['Traitements'] = array('traitement' => 'Traitement (Texte avec accordéon)');
return $templates;
}
+
+ protected function _makeNavigationOnePage(&$navigation, $r, $t, $isAdmin, $locale = false) {
+ $page = parent::_makeNavigationOnePage($navigation, $r, $t, $isAdmin, $locale);
+
+ if (!$page) {
+ return;
+ }
+
+ if ($page->getTemplate() == 'research') {
+ $this->addResearchCategoriesPages($page, $locale, $isAdmin);
+ }
+ }
+
+
+ /**
+ *
+ * @param CubeIT_Navigation_Page_Locale $page
+ */
+ protected function addResearchCategoriesPages($page, $locale, $isAdmin) {
+ //$datas = $this->getCMSDatasOfNavigationPage($page);
+
+ // How the URLs should be formed for the research category pages
+ $URL_template = '/Recherche-clinique/%name%'; // Important: must have leading slash or pages will show as not found!
+
+ $db = Zend_Db_Table::getDefaultAdapter();
+ $s = $db->select()->from('research_categories')
+ ->order('id ASC');
+ $q = $s->query();
+
+ while ($r = $q->fetch()) {
+
+ //$r = CubeIT_Util_Cms::unserialize($r, $locale);
+ if ($r->name == '') {
+ continue;
+ }
+
+ $online = true;
+
+ $pageTitle = sprintf(__('Essais sur les cancers en %s'), strtolower($r->name));
+
+ $p = new CubeIT_Navigation_Page_Locale();
+ $p->setController('ResearchCategories');
+ $p->setId($page->getId() . '/' . $r->id);
+ //$p->setAutoUri($r, $datas['seourl_stu'], $page->getLocale());
+ $p->setAutoUri($r, $URL_template);
+ $p->setSitemap($online);
+ $p->setTitle($pageTitle);
+ $p->setEditable(false);
+ $p->setParams(array('research_category_id' => $r->id));
+ $p->setOnline($online);
+ $p->setDomain($page->getDomain());
+ $p->setLabel($pageTitle); // Used in breadcrumbs + sidebar menu
+ $page->addPage($p);
+ }
+ }
+
protected function _makeURL($r, $seoUrl, $locale, $title, $parent, $isAdmin) {
if ($locale) {
$navLocales = $this->getNavigationLocales($isAdmin);
--- /dev/null
+<?php
+
+class ResearchCategoriesController extends CubeIT_Controller_PageController {
+
+ public function indexAction() {
+
+ $parent = $this->view->currentPage->getParent();
+ $parent_data = $this->getBootstrap()->getCMSDatasOfNavigationPage($parent);
+ $this->view->datas = $parent_data;
+
+ // Todo: inner join for category name etc?
+
+ $db = Zend_Db_Table::getDefaultAdapter();
+ $s = $db->select()->from('research_studies')
+ ->order('id DESC')
+ ->where('category = ?', $this->getRequest()->getParam('research_category_id'));
+ $q = $s->query();
+
+// if (!$q->rowCount()) {
+// $this->_404();
+// return;
+// }
+
+// $r = CubeIT_Util_Cms::unserialize($q->fetch());
+ $this->view->parent_title = $parent_data['shortTitle'];
+ $this->view->sidebar = $parent_data['sidebar'];
+// $this->view->titre = $r->titre;
+ $this->view->studies = $q->fetchAll();
+ }
+
+}
--- /dev/null
+<?php
+
+class CCGM_Form_CMS_Element_ResearchStudies extends CubeIT_Form_Element_List {
+
+ public function init() {
+ parent::init();
+
+ $this->setBaseForm(new CCGM_Form_CMS_ResearchStudies());
+ $this->clearDecorators();
+ }
+
+}
public function init() {\r
parent::init();\r
\r
- $studies = new CCGM_Form_CMS_Sub_Research_Studies();\r
- $studies->setLegend('Études Cliniques');\r
- $this->addSubForm($studies, 'studies');\r
+ $studies = new CCGM_Form_CMS_Element_ResearchStudies('studies');\r
+ $studies->setLabel('Gestion des études cliniques');\r
+ $this->addElement($studies);\r
}\r
}\r
--- /dev/null
+<?php
+
+class CCGM_Form_CMS_ResearchStudies extends CubeIT_Form_List_Model {
+
+ public function init() {
+ parent::init();
+
+ $id = new CubeIT_Form_Element_Id();
+ $this->addElement($id);
+
+ $title = new Zend_Form_Element_Text('title');
+ $title->setLabel('Titre');
+ $this->addElement($title);
+
+ $code = new CubeIT_Form_Element_Markitup('description');
+ $code->setLabel('Description');
+ $this->addElement($code);
+
+ $localisation = new CCGM_Form_CMS_Element_ResearchCategories('category');
+ $localisation->setLabel('Localisation');
+ $this->addElement($localisation);
+
+ $pathology = new Zend_Form_Element_Textarea('pathology');
+ $pathology->setLabel('Pathologie');
+ $this->addElement($pathology);
+
+ $investigator = new Zend_Form_Element_Text('investigator');
+ $investigator->setLabel('Investigateur');
+ $this->addElement($investigator);
+
+ $specialities = new CCGM_Form_CMS_Element_ResearchSpecialities('specialities');
+ $specialities->setLabel('Spécialités');
+ $this->addElement($specialities);
+
+ $this->setListTitle(__('Études Cliniques'))
+ ->setNewTitle(__('Créer une étude'))
+ ->setEditTitle(sprintf(__("Edition de l'étude « %s »"), '$name'))
+ ->setTitleColumn('title')
+ ->setModel('CCGM_Model_ResearchStudy');
+ }
+
+}
+++ /dev/null
-<?php
-
-class CCGM_Form_CMS_Sub_Research_Studies extends CubeIT_Form_Multi_SubForm {
-
- public function init() {
- parent::init();
-
- $study = new CCGM_Form_CMS_Sub_Research_Study();
- $this->setBaseSubForm($study);
- $this->setBaseLegend('Edition de l\'étude « $title »');
- $this->setNewLegend('Nouvelle étude');
- }
-
-}
+++ /dev/null
-<?php
-
-class CCGM_Form_CMS_Sub_Research_Study extends CubeIT_Form_SubForm {
-
- public function init() {
- parent::init();
-
- $title = new Zend_Form_Element_Text('title');
- $title->setLabel('Titre');
- $this->addElement($title);
-
- $code = new CubeIT_Form_Element_Markitup('description');
- $code->setLabel('Description');
- $this->addElement($code);
-
- $localisation = new CCGM_Form_CMS_Element_ResearchCategories('category');
- $localisation->setLabel('Localisation');
- $this->addElement($localisation);
-
- $pathology = new Zend_Form_Element_Textarea('pathology');
- $pathology->setLabel('Pathologie');
- $this->addElement($pathology);
-
- $investigator = new Zend_Form_Element_Text('investigator');
- $investigator->setLabel('Investigateur');
- $this->addElement($investigator);
-
- $specialities = new CCGM_Form_CMS_Element_ResearchSpecialities('specialities');
- $specialities->setLabel('Spécialités');
- $this->addElement($specialities);
- }
-
-}
--- /dev/null
+<?php
+
+$this->headTitle($this->currentPage->title . ' / ' . $this->currentPage->getParent()->getTitle(), 'SET');
+$this->showsidebar = false;
+
+?>
+
+<section id="content">
+ <div id="c">
+ <h1><?= $this->parent_title ?></h1>
+ <h2><?= $this->currentPage->label ?></h2>
+
+ <pre>
+ <?php print_r($this->studies); ?>
+ </pre>
+
+ </div>
+ <?php echo $this->rightbar() ?>
+</section>
<?php\r
+$this->showsidebar = false;\r
$this->contentWidth = 662;\r
?>\r
\r
?>\r
</div>\r
<?php echo $this->rightbar() ?>\r
-</section>
\ No newline at end of file
+</section>\r