diff --git a/application/Bootstrap.php b/application/Bootstrap.php index 1de8a4a10..ed76b4302 100644 --- a/application/Bootstrap.php +++ b/application/Bootstrap.php @@ -22,6 +22,8 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap 'auth' => __DIR__ . '/modules/auth/controllers', 'default' => __DIR__ . '/modules/default/controllers', 'file' => __DIR__ . '/modules/file/controllers', + 'help' => __DIR__ . '/modules/help/controllers', + 'print' => __DIR__ . '/modules/print/controllers', 'search' => __DIR__ . '/modules/search/controllers', 'user' => __DIR__ . '/modules/user/controllers', )); diff --git a/application/modules/default/controllers/AideController.php b/application/modules/default/controllers/AideController.php deleted file mode 100644 index ca027b8a7..000000000 --- a/application/modules/default/controllers/AideController.php +++ /dev/null @@ -1,108 +0,0 @@ -theme = Zend_Registry::get('theme'); - } - - /** - * Afficher bulle pour les nouveautés - */ - public function newAction() - { - $nbNewsMax = 5; - $nbJourGlisssant = 5; - - $user = new Scores_Utilisateur(); - $date = $user->getDateDerniereConnexion(); - $nouveautes = array(); - if ( $date!=null || $date!='0000-00-00 00:00:00' ) - { - $time = mktime(0, 0, 0, date('m'), date('d')-$nbJourGlisssant, date('Y')); - $dateglissant = date('Y-m-d', $time); - $now = date('Y-m-d'); - - $nouveautesM = new Application_Model_Nouveautes(); - $sql = $nouveautesM->select() - ->where("date>='".$dateglissant."' AND date<='".$now."'") - ->order('date DESC') - ->limit($nbNewsMax); - $nouveautes = $nouveautesM->fetchAll($sql); - } - $this->view->assign('nouveautes', $nouveautes); - } - - /** - * Afficher la liste des nouveautés - */ - public function newlisteAction() - { - $this->view->headTitle()->prepend('Nouveautés'); - - $request = $this->getRequest(); - - //Selection - $nouveautesM = new Application_Model_Nouveautes(); - $sql = $nouveautesM->select() - ->from('nouveautes', array('categorie', 'intitule', "date", 'fichier')) - ->order('date DESC'); - $nouveautes = $nouveautesM->fetchAll($sql); - $this->view->assign('nouveautes', $nouveautes); - - } - - /** - * Affichage et validation de "cgu" - * Conditions d’accès à l'extranet - */ - public function cguAction() - { - $this->_helper->layout()->disableLayout(); - $request = $this->getRequest(); - - $accept = $request->getParam('accept', 0); - - if ( $accept == 1 ) { - require_once 'Scores/WsScores.php'; - $ws = new WsScores(); - $accept = $ws->setCGU(); - Zend_Registry::get('firebug')->info($accept); - if ($accept) { - //Put in session - $auth = Zend_Auth::getInstance(); - $identity = $auth->getIdentity(); - $identity->acceptationCGU = date('Y-m-d H:i:s'); - $auth->getStorage()->write($identity); - //Redirect - $this->redirect('/'); - } - } - } - - - /** - * Afficher des propriétés du navigateur - * Compatibilités et version - */ - public function navinfoAction() - { - $bootstrap = $this->getInvokeArg('bootstrap'); - $userAgent = $bootstrap->getResource('useragent'); - - $device = $userAgent->getDevice(); - - echo $device->getFeature('browser_compatibility').'
'; - echo $device->getFeature('browser_version').'
'; - - echo "
";
-	    print_r($device);
-	    echo "
"; - exit; - } - - -} \ No newline at end of file diff --git a/application/modules/default/views/default/scripts/aide/new.phtml b/application/modules/default/views/default/scripts/aide/new.phtml deleted file mode 100644 index a69c95760..000000000 --- a/application/modules/default/views/default/scripts/aide/new.phtml +++ /dev/null @@ -1,19 +0,0 @@ -nouveautes)>0 ) {?> -
-

- -Nouveau ! - -nouveautes as $nouveaute) {?> - -intitule?> - -nouveautes) ) {?>, - -
-Cliquez sur les intitulés pour consulter le document, -ou ici pour retrouver la liste des modifications -

-
- \ No newline at end of file diff --git a/application/modules/default/views/default/scripts/aide/newliste.phtml b/application/modules/default/views/default/scripts/aide/newliste.phtml deleted file mode 100644 index 610d7fa5e..000000000 --- a/application/modules/default/views/default/scripts/aide/newliste.phtml +++ /dev/null @@ -1,42 +0,0 @@ - - -
-

Nouveautés

-
- -
- -

Liste par date

-
- - - - - - - - - -nouveautes)>0 ){?> -nouveautes as $nouveau) {?> - - - - - - - - -
DateIntituléCatégorie
date,8,2).'/'.substr($nouveau->date,5,2).'/'.substr($nouveau->date,0,4)?> - - intitule?> - categorie?>
-
- -
\ No newline at end of file diff --git a/application/modules/help/controllers/CguController.php b/application/modules/help/controllers/CguController.php new file mode 100644 index 000000000..bebfc5b8f --- /dev/null +++ b/application/modules/help/controllers/CguController.php @@ -0,0 +1,31 @@ +_helper->layout()->disableLayout(); + $request = $this->getRequest(); + + $accept = $request->getParam('accept', 0); + + if ( $accept == 1 ) { + require_once 'Scores/WsScores.php'; + $ws = new WsScores(); + $accept = $ws->setCGU(); + Zend_Registry::get('firebug')->info($accept); + if ($accept) { + //Put in session + $auth = Zend_Auth::getInstance(); + $identity = $auth->getIdentity(); + $identity->acceptationCGU = date('Y-m-d H:i:s'); + $auth->getStorage()->write($identity); + //Redirect + $this->redirect('/'); + } + } + } +} \ No newline at end of file diff --git a/application/modules/help/controllers/NewsController.php b/application/modules/help/controllers/NewsController.php new file mode 100644 index 000000000..d02c5d864 --- /dev/null +++ b/application/modules/help/controllers/NewsController.php @@ -0,0 +1,55 @@ +theme = Zend_Registry::get('theme'); + } + + /** + * Afficher bulle pour les nouveautés + */ + public function indexAction() + { + $nbNewsMax = 5; + $nbJourGlisssant = 5; + + $user = new Scores_Utilisateur(); + $date = $user->getDateDerniereConnexion(); + $nouveautes = array(); + if ( $date!=null || $date!='0000-00-00 00:00:00' ){ + $time = mktime(0, 0, 0, date('m'), date('d')-$nbJourGlisssant, date('Y')); + $dateglissant = date('Y-m-d', $time); + $now = date('Y-m-d'); + + $nouveautesM = new Application_Model_Nouveautes(); + $sql = $nouveautesM->select() + ->where("date>='".$dateglissant."' AND date<='".$now."'") + ->order('date DESC') + ->limit($nbNewsMax); + $nouveautes = $nouveautesM->fetchAll($sql); + } + $this->view->assign('nouveautes', $nouveautes); + } + + /** + * Afficher la liste des nouveautés + */ + public function listeAction() + { + $this->view->headTitle()->prepend('Nouveautés'); + + $request = $this->getRequest(); + + //Selection + $nouveautesM = new Application_Model_Nouveautes(); + $sql = $nouveautesM->select() + ->from('nouveautes', array('categorie', 'intitule', "date", 'fichier')) + ->order('date DESC'); + $nouveautes = $nouveautesM->fetchAll($sql); + $this->view->assign('nouveautes', $nouveautes); + } +} \ No newline at end of file diff --git a/application/modules/default/views/default/scripts/aide/cgu.phtml b/application/modules/help/views/default/scripts/cgu/index.phtml similarity index 100% rename from application/modules/default/views/default/scripts/aide/cgu.phtml rename to application/modules/help/views/default/scripts/cgu/index.phtml diff --git a/library/Application/Controller/Plugin/Auth.php b/library/Application/Controller/Plugin/Auth.php index dd9770f6a..b7d26d91b 100644 --- a/library/Application/Controller/Plugin/Auth.php +++ b/library/Application/Controller/Plugin/Auth.php @@ -88,9 +88,9 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract } // --- Check CGU - if ( $controller!='aide' && $action!='cgu' || $controller!='user' && $action!='logout') { + if ($module!='help' && $controller!='cgu' || $module!='auth') { if ( empty($identity->acceptationCGU) || $identity->acceptationCGU=='0000-00-00 00:00:00' ) { - $request->setModuleName('default')->setControllerName('aide')->setActionName('cgu'); + $request->setModuleName('help')->setControllerName('cgu')->setActionName('index'); } } @@ -117,17 +117,14 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract } // --- Pas Authentifié else { - if ( $request->isXmlHttpRequest() ) { $request->setModuleName('auth')->setControllerName('user')->setActionName('logout') ->setParam('ajax', 1); } else { - $session = new Zend_Session_Namespace('login'); $session->url = $_SERVER['REQUEST_URI']; $request->setModuleName('auth')->setControllerName('user')->setActionName('login'); } - } } }