]> _ Git - ccgm.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 6 Dec 2013 16:29:30 +0000 (16:29 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 6 Dec 2013 16:29:30 +0000 (16:29 +0000)
15 files changed:
framework/application/controllers/AjaxController.php
framework/application/controllers/IndexController.php
framework/application/forms/Askintranet.php [new file with mode: 0644]
framework/application/forms/CMS/Intranetident.php [new file with mode: 0644]
framework/application/forms/CMS/Medecinsident.php [new file with mode: 0644]
framework/application/forms/LoginIntranet.php [new file with mode: 0644]
framework/application/views/helpers/Intranetitems.php [new file with mode: 0644]
framework/application/views/scripts/templates/intranet.phtml
framework/application/views/scripts/templates/intranetident.phtml
framework/application/views/scripts/templates/medecinsident.phtml [new file with mode: 0644]
less/forms.less [new file with mode: 0644]
less/intranet.less [new file with mode: 0644]
less/intranetident.less [new file with mode: 0644]
less/medecinsident.less [new file with mode: 0644]
less/rendezvous.less

index 583f6930894fc4aab794cd8473001db6f9fb6784..0b30adf65d3d3d5af200524deec6eac49c7a3d75 100644 (file)
@@ -2,6 +2,33 @@
 
 class AjaxController extends CubeIT_Controller_AjaxController {
 
+       public function loginintranet() {
+               if ($this->isAllowed('personnel')) {
+                       $this->getSession()->intranet = true;
+                       $this->_datas->addReload();
+               } else {
+                       $this->_datas->addError('user');
+                       $this->_datas->addError('password');
+               }
+       }
+
+       public function askintranet() {
+               $form = new CCGM_Form_Askintranet();
+               $form->setDefaults($_POST);
+               if ($form->isValid($_POST)) {
+                       $this->_datas->addContent($form->getId(), '<p>Votre demande a bien été envoyée.</p>');
+
+                       $mail = new CubeIT_Mail();
+                       $mail->setFrom('intranet@ccgm.fr');
+                       $mail->addTo('test@cubedesigners.com');
+                       $mail->setSubject('[CCGM.fr] Demande d\'accès intranet');
+                       $mail->setBodyText('Email du demandeur : ' . $form->getValue('email'));
+                       $mail->send(new CubeIT_Mail_Transport_Mailjet());
+               } else {
+                       $this->_datas->refreshForm($form);
+               }
+       }
+
        public function rdv() {
                $data = $this->getCMSDatasOfPage($_POST['page']);
                $form = new CCGM_Form_Rendezvous();
index bb6fb38d2631dfc7ade5e517985ad26fe92b72c5..684605073a8db02e38e918f6acfd1badcdc97774 100644 (file)
@@ -5,8 +5,23 @@ class IndexController extends CubeIT_Controller_IndexController {
        public function pageAction() {
                $this->view->showbreadcrubms = $this->view->showsidebar = $this->view->showtopimage = true;
                $this->view->contentWidth = 769;
-               return parent::pageAction();
+
+               $res = parent::pageAction();
+
+               if ($this->_currentPage->getTemplate() == 'intranetident') {
+                       if ($this->getSession()->intranet) {
+                               $fc = $this->_currentPage->getFirstChild();
+                               if (!is_null($fc)) {
+                                       $this->redirect($fc->getHref());
+                               }
+                       }
+               } else if ($ident = $this->_currentPage->findInParents('template', 'intranetident')) {
+                       fb($ident);
+                       if (!$this->getSession()->intranet) {
+                               $this->redirect($ident->getHref());
+                       }
+               }
+               return $res;
        }
 
 }
-
diff --git a/framework/application/forms/Askintranet.php b/framework/application/forms/Askintranet.php
new file mode 100644 (file)
index 0000000..a3c0356
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+
+class CCGM_Form_Askintranet extends CubeIT_Form {
+
+       public function init() {
+               parent::init();
+               $this->setId('askintranet')
+                               ->setLegend('Demander un accès')
+                               ->setAjax()
+                               ->setAction('/ajax/askintranet');
+
+               $validator = new Zend_Validate_EmailAddress();
+               $validator->setMessage('E-mail invalide');
+
+               $email = new CubeIT_Form_Element_Email('email');
+               $email->setAttrib('placeholder', 'Adresse e-mail');
+               $email->setRequired();
+               $email->addValidator($validator);
+               $this->addElement($email);
+
+               $submit = new Zend_Form_Element_Submit('submit');
+               $this->addElement($submit);
+       }
+
+}
+
+?>
diff --git a/framework/application/forms/CMS/Intranetident.php b/framework/application/forms/CMS/Intranetident.php
new file mode 100644 (file)
index 0000000..d10f2a2
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+
+class CCGM_Form_CMS_Intranetident extends CCGM_Form_CMS_Text {
+
+       public function init() {
+               parent::init();
+               
+               $this->removeSubForm('sidebar');
+               $this->getElement('text')->setAttrib('rows', 3);
+       }
+
+}
+
+?>
diff --git a/framework/application/forms/CMS/Medecinsident.php b/framework/application/forms/CMS/Medecinsident.php
new file mode 100644 (file)
index 0000000..14e0d58
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+
+class CCGM_Form_CMS_Medecinsident extends CCGM_Form_CMS_Intranetident{
+       public function init() {
+               parent::init();
+       }
+}
+
+?>
diff --git a/framework/application/forms/LoginIntranet.php b/framework/application/forms/LoginIntranet.php
new file mode 100644 (file)
index 0000000..cd6d236
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+class CCGM_Form_LoginIntranet extends CubeIT_Form {
+
+       public function init() {
+               parent::init();
+               $this->setLegend('Connexion')
+                               ->setId('loginintranet')
+                               ->setAjax()
+                               ->setAction('/ajax/loginintranet');
+
+               $login = new Zend_Form_Element_Hidden('login');
+               $login->setValue(1);
+               $this->addElement($login);
+
+               $email = new CubeIT_Form_Element_Email('user');
+               $email->setAttrib('placeholder', 'Adresse e-mail');
+               $this->addElement($email);
+
+               $password = new Zend_Form_Element_Password('password');
+               $password->setAttrib('placeholder', 'Mot de passe');
+               $this->addElement($password);
+
+               $forgot = new CubeIT_Form_Element_Html('forgot');
+               $forgot->setLabel('<a href="/ajaxpopup/forgot" class="popup">Mot de passe oublié ?</a>');
+               //$this->addElement($forgot);
+
+               $submit = new Zend_Form_Element_Submit('submit');
+               $this->addElement($submit);
+       }
+
+}
+
+?>
diff --git a/framework/application/views/helpers/Intranetitems.php b/framework/application/views/helpers/Intranetitems.php
new file mode 100644 (file)
index 0000000..5b98bbc
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+
+class CCGM_View_Helper_Intranetitems extends Zend_View_Helper_Abstract {
+
+       public function intranetitems($items) {
+               $res = '<section class="items">';
+               foreach ($items as $item) {
+                       $res.=$this->_item($item);
+               }
+               $res.='</section>';
+               return $res;
+       }
+
+       protected function _item($item) {
+               $res = '<article>';
+               $res.='<ul><li>' . $this->view->dateTime($item['date'], Zend_Date::DATE_LONG) . '</li></ul>';
+               $res.='<h3>' . $item['titre'] . '</h3>';
+               $res.='<p>' . nl2br($item['text']) . '</p>';
+               if ($item['lien']['url']) {
+                       $res.=$this->view->link($item['lien']['label'], $item['lien']['url']);
+               } else if (CubeIT_Util_Cms::containFiles($item['lien']['file'])) {
+                       $res.=$this->view->linkCMSFile($item['lien']['label'], $item['lien']['file']);
+               }
+               $res.='</article>';
+               return $res;
+       }
+
+}
+
+?>
index ab4fa67a01a0faa5e9ef79cc221abc59b8c9bb82..a3075ae9fb4f4d6dfce3e4bf8d82e561dd40c4b4 100644 (file)
@@ -1,2 +1,10 @@
-<?php\r
-\r
+<?php $this->headScript()->addScriptAndStyle('intranet') ?>\r
+<section id="content">\r
+       <div id="c">\r
+               <?php\r
+               echo $this->markupDotclear($this->text);\r
+               echo $this->intranetitems($this->items)\r
+               ?>\r
+       </div>\r
+       <?php echo $this->rightbar() ?>\r
+</section>
\ No newline at end of file
index fb9e0c3df3f9df03a4d95c24d7787e3ecad6f4e5..2b1213f6f56ee51dd22c53125eecab284f9875e8 100644 (file)
@@ -1,8 +1,27 @@
 <?php\r
+$this->headScript()->addScriptAndStyle('intranetident');\r
+$this->showsidebar = false;\r
+?>\r
+<section id="content">\r
+       <div id="c">\r
+               <?php\r
+               echo $this->markupDotclear($this->text);\r
 \r
-/* \r
- * To change this license header, choose License Headers in Project Properties.\r
- * To change this template file, choose Tools | Templates\r
- * and open the template in the editor.\r
- */\r
+               echo '<div class="forms">';\r
+               echo '<div class="form fleft">';\r
+               $form = new CCGM_Form_LoginIntranet();\r
+               echo '<h3>' . $form->getLegend() . '</h3>';\r
+               echo $form;\r
+               echo '</div>';\r
 \r
+               echo '<div class="form fright">';\r
+               $form = new CCGM_Form_Askintranet();\r
+               echo '<h3>' . $form->getLegend() . '</h3>';\r
+               echo '<p>Veuillez indiquer votre e-mail ci-dessous, nous vous enverrons vos paramètres d’accès dans les plus brefs délais.</p>';\r
+               echo $form;\r
+               echo '</div>';\r
+\r
+               echo '</div>';\r
+               ?>\r
+       </div>\r
+</section>
\ No newline at end of file
diff --git a/framework/application/views/scripts/templates/medecinsident.phtml b/framework/application/views/scripts/templates/medecinsident.phtml
new file mode 100644 (file)
index 0000000..3fceb7b
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+$this->headScript()->addScriptAndStyle('intranetident');
+$this->showsidebar = false;
+?>
+<section id="content">
+       <div id="c">
+               <?php
+               echo $this->markupDotclear($this->text);
+
+               echo '<div class="forms">';
+               echo '<div class="form fleft">';
+               $form = new CCGM_Form_LoginMedecins();
+               echo '<h3>' . $form->getLegend() . '</h3>';
+               echo $form;
+               echo '</div>';
+
+               echo '<div class="form fright">';
+               $form = new CCGM_Form_Askmedecin();
+               echo '<h3>' . $form->getLegend() . '</h3>';
+               echo '<p>Veuillez indiquer votre e-mail ci-dessous, nous vous enverrons vos paramètres d’accès dans les plus brefs délais.</p>';
+               echo $form;
+               echo '</div>';
+
+               echo '</div>';
+               ?>
+       </div>
+</section>
\ No newline at end of file
diff --git a/less/forms.less b/less/forms.less
new file mode 100644 (file)
index 0000000..9ed411e
--- /dev/null
@@ -0,0 +1,35 @@
+.field(){
+       color:#c7c5c5;
+       font-family: @Ubuntu;
+       font-weight: 300;
+       font-size:13px;
+       color:#696969;
+       border:1px solid #c7c5c5;
+       border-radius: 5px;
+       background-color:#f6f4f4;
+       height:38px;
+       padding:10px;
+       margin-bottom: 15px;
+       font-style: italic;
+
+       &::-webkit-input-placeholder {
+               .placeholderstyle;
+       }
+
+       &:-moz-placeholder { /* Firefox 18- */
+               .placeholderstyle;
+       }
+
+       &::-moz-placeholder {  /* Firefox 19+ */
+               .placeholderstyle;
+       }
+
+       &:-ms-input-placeholder {  
+               .placeholderstyle;
+       }
+}
+
+.placeholderstyle(){
+       color:#696969;
+       font-style: italic;
+}
\ No newline at end of file
diff --git a/less/intranet.less b/less/intranet.less
new file mode 100644 (file)
index 0000000..ed50211
--- /dev/null
@@ -0,0 +1,27 @@
+#content section.items{
+       article{
+               margin:0 0 45px 0;
+               time{
+                       font-style: italic;
+               }
+               
+               ul{
+                       margin:0;
+               }
+
+               h3{
+                       text-transform: none;
+                       font-size: 16px;
+                       font-weight: 500; 
+                       margin:25px 0;
+               }
+
+               p{
+                       margin:25px 0;
+               }
+
+               a{
+                       color:#009bda;
+               }
+       }
+}
\ No newline at end of file
diff --git a/less/intranetident.less b/less/intranetident.less
new file mode 100644 (file)
index 0000000..e1d0cb8
--- /dev/null
@@ -0,0 +1,86 @@
+@import "forms.less";
+
+#content{
+       .forms{
+               .form{
+                       padding:0 45px;
+                       height:154px;
+                       display:inline-block;
+                       box-sizing:border-box;
+
+                       h3{
+                               font-size:16px;
+                               margin:0 0 20px 0;
+                               position: relative;
+                               left:-30px;
+                               padding:0 0 0 30px;
+                               background-image: url("../images/arrow-li.svg");
+                               background-position: 0 5px;
+                       }
+
+                       p{
+                               margin:15px 0 15px 0;
+                               font-size:13px;
+                               line-height: 20px;
+                               font-style: italic;
+                               height:40px;
+                       }
+
+                       &.fleft{
+                               width:390px;
+                               padding:0 45px 0 30px;
+                       }
+
+                       &.fright{
+                               width:590px;
+                               border-left:1px solid #c2c2c2;
+                               padding:0 30px 0 45px;
+                       }
+
+                       form{
+                               position:relative;
+
+                               .error{
+                                       input,select{
+                                               border-color:#f8a3a3;
+                                       }
+                               }
+
+                               input,select{
+                                       &.error{
+                                               border-color:#f8a3a3;
+                                       }
+                               }
+
+                               input,select{
+                                       .field;
+                                       width:263px;
+                                       margin:0 0 13px 0;
+                                       height:38px;
+                               }
+
+                               .submit{
+                                       position:absolute;
+                                       left:275px;
+                                       bottom:13px;
+                                       height:38px;
+                                       text-indent: -6666px;
+                                       width:38px;
+                                       border-radius: 3px;
+                                       background-color:#0ea6db;
+                                       background-image: url("../images/arrow-nav-1.svg");
+                                       background-position: 50% 50%;
+                                       padding:0;
+                               }
+
+                               .popup{
+                                       position:absolute;
+                                       left:0px;
+                                       bottom:-13px;
+                                       font-size:13px;
+                                       color:#0ea6db;
+                               }
+                       }
+               }
+       }
+}
\ No newline at end of file
diff --git a/less/medecinsident.less b/less/medecinsident.less
new file mode 100644 (file)
index 0000000..ba76754
--- /dev/null
@@ -0,0 +1,10 @@
+/*
+To change this license header, choose License Headers in Project Properties.
+To change this template file, choose Tools | Templates
+and open the template in the editor.
+*/
+/* 
+    Created on : 6 déc. 2013, 17:24:12
+    Author     : Vincent
+*/
+
index cef601196f4965f95401f9202918151bb1914b72..553c30a53286098baea3c97bc498b9c1d4462aa2 100644 (file)
@@ -1,4 +1,5 @@
 @import "constants.less";
+@import "forms.less";
 
 .twocolumns {
        #content{
                float: none;
                text-decoration: none;
        }
-}
-
-.field(){
-       color:#c7c5c5;
-       font-family: @Ubuntu;
-       font-weight: 300;
-       font-size:13px;
-       color:#696969;
-       border:1px solid #c7c5c5;
-       border-radius: 5px;
-       background-color:#f6f4f4;
-       height:38px;
-       padding:10px;
-       margin-bottom: 15px;
-       font-style: italic;
-
-       &::-webkit-input-placeholder {
-               .placeholderstyle;
-       }
-
-       &:-moz-placeholder { /* Firefox 18- */
-               .placeholderstyle;
-       }
-
-       &::-moz-placeholder {  /* Firefox 19+ */
-               .placeholderstyle;
-       }
-
-       &:-ms-input-placeholder {  
-               .placeholderstyle;
-       }
-}
-
-.placeholderstyle(){
-       color:#696969;
-       font-style: italic;
 }
\ No newline at end of file