From: vincent@cubedesigners.com Date: Fri, 6 Dec 2013 16:29:30 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=bf045fb69663db252654af96fefde1a59a1c3a42;p=ccgm.git --- diff --git a/framework/application/controllers/AjaxController.php b/framework/application/controllers/AjaxController.php index 583f693..0b30adf 100644 --- a/framework/application/controllers/AjaxController.php +++ b/framework/application/controllers/AjaxController.php @@ -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(), '

Votre demande a bien été envoyée.

'); + + $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(); diff --git a/framework/application/controllers/IndexController.php b/framework/application/controllers/IndexController.php index bb6fb38..6846050 100644 --- a/framework/application/controllers/IndexController.php +++ b/framework/application/controllers/IndexController.php @@ -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 index 0000000..a3c0356 --- /dev/null +++ b/framework/application/forms/Askintranet.php @@ -0,0 +1,27 @@ +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 index 0000000..d10f2a2 --- /dev/null +++ b/framework/application/forms/CMS/Intranetident.php @@ -0,0 +1,14 @@ +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 index 0000000..14e0d58 --- /dev/null +++ b/framework/application/forms/CMS/Medecinsident.php @@ -0,0 +1,9 @@ + diff --git a/framework/application/forms/LoginIntranet.php b/framework/application/forms/LoginIntranet.php new file mode 100644 index 0000000..cd6d236 --- /dev/null +++ b/framework/application/forms/LoginIntranet.php @@ -0,0 +1,34 @@ +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('Mot de passe oublié ?'); + //$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 index 0000000..5b98bbc --- /dev/null +++ b/framework/application/views/helpers/Intranetitems.php @@ -0,0 +1,30 @@ +'; + foreach ($items as $item) { + $res.=$this->_item($item); + } + $res.=''; + return $res; + } + + protected function _item($item) { + $res = '
'; + $res.=''; + $res.='

' . $item['titre'] . '

'; + $res.='

' . nl2br($item['text']) . '

'; + 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.='
'; + return $res; + } + +} + +?> diff --git a/framework/application/views/scripts/templates/intranet.phtml b/framework/application/views/scripts/templates/intranet.phtml index ab4fa67..a3075ae 100644 --- a/framework/application/views/scripts/templates/intranet.phtml +++ b/framework/application/views/scripts/templates/intranet.phtml @@ -1,2 +1,10 @@ -headScript()->addScriptAndStyle('intranet') ?> +
+
+ markupDotclear($this->text); + echo $this->intranetitems($this->items) + ?> +
+ rightbar() ?> +
\ No newline at end of file diff --git a/framework/application/views/scripts/templates/intranetident.phtml b/framework/application/views/scripts/templates/intranetident.phtml index fb9e0c3..2b1213f 100644 --- a/framework/application/views/scripts/templates/intranetident.phtml +++ b/framework/application/views/scripts/templates/intranetident.phtml @@ -1,8 +1,27 @@ headScript()->addScriptAndStyle('intranetident'); +$this->showsidebar = false; +?> +
+
+ markupDotclear($this->text); -/* - * 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. - */ + echo '
'; + echo '
'; + $form = new CCGM_Form_LoginIntranet(); + echo '

' . $form->getLegend() . '

'; + echo $form; + echo '
'; + echo '
'; + $form = new CCGM_Form_Askintranet(); + echo '

' . $form->getLegend() . '

'; + echo '

Veuillez indiquer votre e-mail ci-dessous, nous vous enverrons vos paramètres d’accès dans les plus brefs délais.

'; + echo $form; + echo '
'; + + echo '
'; + ?> +
+
\ 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 index 0000000..3fceb7b --- /dev/null +++ b/framework/application/views/scripts/templates/medecinsident.phtml @@ -0,0 +1,27 @@ +headScript()->addScriptAndStyle('intranetident'); +$this->showsidebar = false; +?> +
+
+ markupDotclear($this->text); + + echo '
'; + echo '
'; + $form = new CCGM_Form_LoginMedecins(); + echo '

' . $form->getLegend() . '

'; + echo $form; + echo '
'; + + echo '
'; + $form = new CCGM_Form_Askmedecin(); + echo '

' . $form->getLegend() . '

'; + echo '

Veuillez indiquer votre e-mail ci-dessous, nous vous enverrons vos paramètres d’accès dans les plus brefs délais.

'; + echo $form; + echo '
'; + + echo '
'; + ?> +
+
\ No newline at end of file diff --git a/less/forms.less b/less/forms.less new file mode 100644 index 0000000..9ed411e --- /dev/null +++ b/less/forms.less @@ -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 index 0000000..ed50211 --- /dev/null +++ b/less/intranet.less @@ -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 index 0000000..e1d0cb8 --- /dev/null +++ b/less/intranetident.less @@ -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 index 0000000..ba76754 --- /dev/null +++ b/less/medecinsident.less @@ -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 +*/ + diff --git a/less/rendezvous.less b/less/rendezvous.less index cef6011..553c30a 100644 --- a/less/rendezvous.less +++ b/less/rendezvous.less @@ -1,4 +1,5 @@ @import "constants.less"; +@import "forms.less"; .twocolumns { #content{ @@ -130,40 +131,4 @@ 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