return $router;
}
+ protected function _initSession() {
+ $session = parent::_initSession();
+ if (!isset($session->medecin)) {
+ $session->medecin = false;
+ }
+ if (!isset($session->personnel)) {
+ $session->personnel = false;
+ }
+ return $session;
+ }
+
/**
*
* @param \Doctrine\DBAL\Schema\Schema $schema
protected function _initAcl() {
$acl = parent::_initAcl();
- $acl->addRole('medecin');
- $acl->addRole('personnel');
+ $acl->addRole('personnel', 'guest');
+ $acl->addRole('medecin', 'guest');
+
$acl->addResource('medecin');
$acl->addResource('personnel');
'rendezvous' => 'Demande de rendez-vous');
$templates['Intranet'] = array('intranetident' => 'Identification',
'intranet' => 'Comptes rendus, actualités');
+ $templates['Médecins'] = array('medecinsident' => 'Identification');
$templates['Redirections'] = array(
'externalredirection' => 'Redirection externe',
'nextredirection' => 'Redirection vers la première sous-rubrique',
seo.robots=false
seo.universalAnalytics = UA-42799235-2
-httpauth.username = ccgm
-httpauth.password = 20ccgm13
-
[testing : production]
dev = true
}
}
+ public function loginmedecin() {
+ if ($this->isAllowed('medecin')) {
+ $this->getSession()->medecin = 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)) {
+ $datas = $this->getCMSDatasOfPage($form->getValue('currentPage'));
$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->addTo($datas['destinataire']);
$mail->setSubject('[CCGM.fr] Demande d\'accès intranet');
$mail->setBodyText('Email du demandeur : ' . $form->getValue('email'));
$mail->send(new CubeIT_Mail_Transport_Mailjet());
}
}
+ public function askmedecin() {
+ $form = new CCGM_Form_Askmedecin();
+ $form->setDefaults($_POST);
+ if ($form->isValid($_POST)) {
+ $datas = $this->getCMSDatasOfPage($form->getValue('currentPage'));
+ $this->_datas->addContent($form->getId(), '<p>Votre demande a bien été envoyée.</p>');
+
+ $mail = new CubeIT_Mail();
+ $mail->setFrom('medecins@ccgm.fr');
+ $mail->addTo($datas['destinataire']);
+ $mail->setSubject('[CCGM.fr] Demande d\'accès médecin');
+
+ $body = '';
+
+ $fields = array('nom' => 'Nom', 'prenom' => 'Prénom', 'lieu' => 'Lieu d\'exercice', 'email' => 'Adresse e-mail', 'telephone' => 'Téléphone');
+ foreach ($fields as $f => $label) {
+ $body.=$label . ' : ' . $form->getValue($f) . "\n";
+ }
+
+ $mail->setBodyText($body);
+ $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();
$res = parent::pageAction();
- if ($this->_currentPage->getTemplate() == 'intranetident') {
+ if ($this->getBootstrap()->getEnvironment() == 'medecins') {
+ $session = $this->getSession();
+ if (!isset($session->medecin) || !$session->medecin) {
+ $this->redirect('http://www.ccgm.fr/Acces-medecin-externe');
+ }
+ }
+
+ if ($this->_currentPage->getTemplate() == 'medecinsident') {
+ if ($this->getSession()->medecin) {
+ $this->redirect('http://medecins.ccgm.fr');
+ }
+ } elseif ($this->_currentPage->getTemplate() == 'intranetident') {
if ($this->getSession()->intranet) {
$fc = $this->_currentPage->getFirstChild();
if (!is_null($fc)) {
}
}
} else if ($ident = $this->_currentPage->findInParents('template', 'intranetident')) {
- fb($ident);
if (!$this->getSession()->intranet) {
$this->redirect($ident->getHref());
}
<?php
class MaintenanceController extends CubeIT_Controller_MaintenanceController {
-}
-
-?>
+}
\ No newline at end of file
$validator = new Zend_Validate_EmailAddress();
$validator->setMessage('E-mail invalide');
+ $page=new CubeIT_Form_Element_CurrentCMSPage('currentPage');
+ $this->addElement($page);
+
$email = new CubeIT_Form_Element_Email('email');
$email->setAttrib('placeholder', 'Adresse e-mail');
$email->setRequired();
$this->addElement($submit);
}
-}
-
-?>
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+class CCGM_Form_Askmedecin extends CubeIT_Form {
+
+ public function init() {
+ parent::init();
+ $this->setId('askmedecin')
+ ->setLegend('Demander un accès')
+ ->setAjax()
+ ->setAction('/ajax/askmedecin');
+
+ $evalidator = new Zend_Validate_EmailAddress();
+ $notempty = new Zend_Validate_NotEmpty();
+
+
+ $page = new CubeIT_Form_Element_CurrentCMSPage('currentPage');
+ $this->addElement($page);
+
+ $prenom = new Zend_Form_Element_Text('prenom');
+ $prenom->setAttrib('placeholder', 'Prénom');
+ $prenom->setRequired();
+ $prenom->addValidator($notempty);
+ $this->addElement($prenom);
+
+ $nom = new Zend_Form_Element_Text('nom');
+ $nom->setAttrib('placeholder', 'Nom');
+ $nom->setRequired();
+ $nom->addValidator($notempty);
+ $this->addElement($nom);
+
+ $lieu = new Zend_Form_Element_Text('lieu');
+ $lieu->setAttrib('placeholder', 'Lieu d\'exercice');
+ $lieu->setRequired();
+ $lieu->addValidator($notempty);
+ $this->addElement($lieu);
+
+ $email = new CubeIT_Form_Element_Email('email');
+ $email->setAttrib('placeholder', 'Adresse e-mail');
+ $email->setRequired();
+ $email->addValidator($evalidator);
+ $this->addElement($email);
+
+ $telephone = new CubeIT_Form_Element_Phone('telephone');
+ $telephone->setAttrib('placeholder', 'Téléphone');
+ $telephone->setRequired();
+ $telephone->addValidator($notempty);
+ $this->addElement($telephone);
+
+ $submit = new Zend_Form_Element_Submit('submit');
+ $this->addElement($submit);
+ }
+
+}
\ No newline at end of file
public function init() {
parent::init();
-
+
$this->removeSubForm('sidebar');
$this->getElement('text')->setAttrib('rows', 3);
- }
-}
+ $destinataire = new CubeIT_Form_Element_Email('destinataire');
+ $destinataire->setLabel('Destinataire des demandes');
+ $this->addElement($destinataire);
+ }
-?>
+}
\ No newline at end of file
public function init() {
parent::init();
}
-}
-
-?>
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+class CCGM_Form_LoginMedecins extends CubeIT_Form {
+
+ public function init() {
+ parent::init();
+ $this->setLegend('Connexion')
+ ->setId('loginmedecin')
+ ->setAjax()
+ ->setAction('/ajax/loginmedecin');
+
+ $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);
+ }
+
+}
+
+?>
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 '<p>Pour accéder à cet espace, veuillez remplir le formulaire ci-dessous.</p>';
echo $form;
echo '</div>';
.forms{
.form{
padding:0 45px;
- height:154px;
+ min-height:154px;
display:inline-block;
box-sizing:border-box;