]> _ Git - ccgm.git/commitdiff
WIP #2340 @7.5
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 29 Jan 2019 16:33:46 +0000 (16:33 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 29 Jan 2019 16:33:46 +0000 (16:33 +0000)
13 files changed:
framework/application/Bootstrap.php
framework/application/forms/CMS/Element/ResearchCategories.php [new file with mode: 0644]
framework/application/forms/CMS/Element/ResearchSpecialities.php [new file with mode: 0644]
framework/application/forms/CMS/Research.php [new file with mode: 0644]
framework/application/forms/CMS/ResearchCategories.php [new file with mode: 0644]
framework/application/forms/CMS/ResearchSpecialities.php [new file with mode: 0644]
framework/application/forms/CMS/Sub/Research/Studies.php [new file with mode: 0644]
framework/application/forms/CMS/Sub/Research/Study.php [new file with mode: 0644]
framework/application/models/ResearchCategory.php [new file with mode: 0644]
framework/application/models/ResearchSpeciality.php [new file with mode: 0644]
framework/application/models/ResearchStudy.php [new file with mode: 0644]
framework/application/views/helpers/Rightbar.php
framework/application/views/scripts/templates/research.phtml [new file with mode: 0644]

index ef86a1d05d68adffed7cbe45efbf50d850c96783..591388b4a8107f003c404d4a2b16483b1613889c 100644 (file)
@@ -65,7 +65,11 @@ class Bootstrap extends CubeIT_Bootstrap {
                $templates['Génériques'] = array('text' => 'Page de texte', 'liens' => 'Liens', 'faq' => 'Questions / Réponses', 'temoignages' => 'Témoignages');
                $templates['Accueil'] = array('home' => 'Page d\'accueil');
                $templates['Le centre'] = array('equipes' => 'L\'équipe', 'reunion' => 'Réunion de concertation');
-               $templates['Recherche clinique'] = array('listing' => 'Listing');
+               $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)');
                $templates['Actualités'] = array('news' => 'Actualités');
diff --git a/framework/application/forms/CMS/Element/ResearchCategories.php b/framework/application/forms/CMS/Element/ResearchCategories.php
new file mode 100644 (file)
index 0000000..d0a0b65
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+
+class CCGM_Form_CMS_Element_ResearchCategories extends CubeIT_Form_Element_SelectList {
+
+       public function init() {
+               $this->setBaseForm('CCGM_Form_CMS_ResearchCategories');
+       }
+
+}
diff --git a/framework/application/forms/CMS/Element/ResearchSpecialities.php b/framework/application/forms/CMS/Element/ResearchSpecialities.php
new file mode 100644 (file)
index 0000000..9f5b23d
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+
+class CCGM_Form_CMS_Element_ResearchSpecialities extends CubeIT_Form_Element_MultiCheckboxList {
+
+       public function init() {
+               $this->setBaseForm('CCGM_Form_CMS_ResearchSpecialities');
+       }
+
+}
diff --git a/framework/application/forms/CMS/Research.php b/framework/application/forms/CMS/Research.php
new file mode 100644 (file)
index 0000000..1e9e315
--- /dev/null
@@ -0,0 +1,11 @@
+<?php\r
+\r
+class CCGM_Form_CMS_Research extends CCGM_Form_CMS_Text {\r
+       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
+       }\r
+}\r
diff --git a/framework/application/forms/CMS/ResearchCategories.php b/framework/application/forms/CMS/ResearchCategories.php
new file mode 100644 (file)
index 0000000..13e8357
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+
+class CCGM_Form_CMS_ResearchCategories extends CubeIT_Form_List_Model {
+
+    public function init() {
+        parent::init();
+
+        $id = new Zend_Form_Element_Hidden('id');
+        $id->setLabel('#');
+        $this->addElement($id);
+
+        $name = new Zend_Form_Element_Text('name');
+        $name->setLabel(__('Nom'));
+        $this->addElement($name);
+
+        $icon = new CubeIT_Form_Element_File_Image('icon');
+        $icon->setLabel(__('Icône (SVG)'));
+        $icon->setMaxItems(1);
+        $this->addElement($icon);
+
+        $order = new Zend_Form_Element_Text('sort_order');
+        $order->setLabel('Sort Order');
+        $this->addElement($order);
+
+        $this->setListTitle(__('Catégories de recherche'))
+            ->setNewTitle(__('Créer une catégorie de recherche'))
+            ->setEditTitle(sprintf(__("Edition de la catégorie « %s »"), '$name'))
+            ->setTitleColumn('name')
+            ->setAdditionnalColumns(array('sort_order'))
+            ->setModel('CCGM_Model_ResearchCategory');
+    }
+
+}
diff --git a/framework/application/forms/CMS/ResearchSpecialities.php b/framework/application/forms/CMS/ResearchSpecialities.php
new file mode 100644 (file)
index 0000000..988ac5c
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+
+class CCGM_Form_CMS_ResearchSpecialities extends CubeIT_Form_List_Model {
+
+    public function init() {
+        parent::init();
+
+        $id = new Zend_Form_Element_Hidden('id');
+        $id->setLabel('#');
+        $this->addElement($id);
+
+        $name = new Zend_Form_Element_Text('name');
+        $name->setLabel(__('Nom'));
+        $this->addElement($name);
+
+        $icon = new CubeIT_Form_Element_File_Image('icon');
+        $icon->setLabel(__('Icône (SVG)'));
+        $icon->setMaxItems(1);
+        $this->addElement($icon);
+
+        $this->setListTitle(__('Spécialités'))
+            ->setNewTitle(__('Créer une spécialité'))
+            ->setEditTitle(sprintf(__("Edition de la spécialité « %s »"), '$name'))
+            ->setTitleColumn('name')
+            ->setModel('CCGM_Model_ResearchSpeciality');
+    }
+
+}
diff --git a/framework/application/forms/CMS/Sub/Research/Studies.php b/framework/application/forms/CMS/Sub/Research/Studies.php
new file mode 100644 (file)
index 0000000..8b17600
--- /dev/null
@@ -0,0 +1,14 @@
+<?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');
+    }
+
+}
diff --git a/framework/application/forms/CMS/Sub/Research/Study.php b/framework/application/forms/CMS/Sub/Research/Study.php
new file mode 100644 (file)
index 0000000..91c9a45
--- /dev/null
@@ -0,0 +1,33 @@
+<?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);
+    }
+
+}
diff --git a/framework/application/models/ResearchCategory.php b/framework/application/models/ResearchCategory.php
new file mode 100644 (file)
index 0000000..2581cb6
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+
+class CCGM_Model_ResearchCategory extends CubeIT_Model_Data_Table {
+
+    protected static $_table = 'research_categories';
+    protected $name;
+    protected $icon;
+    protected $sort_order;
+
+    public static function getSchema($schema) {
+        $table = parent::getSchema($schema);
+        $table->addColumn('name', 'string', array('length' => 128));
+        $table->addColumn('icon', 'string', array('length' => 128));
+        $table->addColumn('sort_order', 'smallint', array('unsigned' => true));
+    }
+
+}
diff --git a/framework/application/models/ResearchSpeciality.php b/framework/application/models/ResearchSpeciality.php
new file mode 100644 (file)
index 0000000..fa34c2f
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+class CCGM_Model_ResearchSpeciality extends CubeIT_Model_Data_Table {
+
+    protected static $_table = 'research_specialities';
+    protected $name;
+    protected $icon;
+
+    public static function getSchema($schema) {
+        $table = parent::getSchema($schema);
+        $table->addColumn('name', 'string', array('length' => 128));
+        $table->addColumn('icon', 'string', array('length' => 128));
+    }
+
+}
diff --git a/framework/application/models/ResearchStudy.php b/framework/application/models/ResearchStudy.php
new file mode 100644 (file)
index 0000000..4f01b0a
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+
+class CCGM_Model_ResearchStudy extends CubeIT_Model_Data_Table {
+
+    protected static $_table = 'research_studies';
+    protected $title;
+    protected $description;
+    protected $category;
+    protected $pathology;
+    protected $investigator;
+    protected $specialities;
+
+    public static function getSchema($schema) {
+        $table = parent::getSchema($schema);
+        $table->addColumn('title', 'text');
+        $table->addColumn('description', 'text');
+        $table->addColumn('category', 'integer');
+        $table->addColumn('pathology', 'text');
+        $table->addColumn('investigator', 'text');
+        $table->addColumn('specialities', 'text');
+    }
+
+}
index ccf7a944b323d933105707086b598e332972ecf1..f5ee51c21aa961a526306865848df209132d91d8 100644 (file)
@@ -16,12 +16,17 @@ class CCGM_View_Helper_Rightbar extends Zend_View_Helper_Abstract {
 
                $res = '<aside id="rightbar">';
                $res.=$this->view->imageProcess($s['image'], '', 262, null, array(), 'R');
-               $res.='<section>';
-               $res.=$this->view->markupDotclear($s['text']);
-               $res.='</section>';
+
+               if (trim($s['text']) != '') {
+            $res .= '<section>';
+            $res .= $this->view->markupDotclear($s['text']);
+            $res .= '</section>';
+        }
+
                if (trim($s['text2']) != '') {
                        $res.='<section>' . $this->view->markupDotclear($s['text2']) . '</section>';
                }
+
                $res.='</aside>';
                return $res;
        }
diff --git a/framework/application/views/scripts/templates/research.phtml b/framework/application/views/scripts/templates/research.phtml
new file mode 100644 (file)
index 0000000..c161a14
--- /dev/null
@@ -0,0 +1,12 @@
+<?php\r
+$this->contentWidth = 662;\r
+?>\r
+\r
+<section id="content">\r
+       <div id="c">\r
+               <?php\r
+               echo $this->markupDotclear($this->text);\r
+               ?>\r
+       </div>\r
+       <?php echo $this->rightbar() ?>\r
+</section>
\ No newline at end of file