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();
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;
}
}
-
--- /dev/null
+<?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);
+ }
+
+}
+
+?>
--- /dev/null
+<?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);
+ }
+
+}
+
+?>
--- /dev/null
+<?php
+
+class CCGM_Form_CMS_Medecinsident extends CCGM_Form_CMS_Intranetident{
+ public function init() {
+ parent::init();
+ }
+}
+
+?>
--- /dev/null
+<?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);
+ }
+
+}
+
+?>
--- /dev/null
+<?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;
+ }
+
+}
+
+?>
-<?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
<?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
--- /dev/null
+<?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
--- /dev/null
+.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
--- /dev/null
+#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
--- /dev/null
+@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
--- /dev/null
+/*
+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
+*/
+
@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