Skip to content
Snippets Groups Projects
Commit 9425ce47 authored by efalcy's avatar efalcy
Browse files

dev #16803 : allow all users to see sessions (missing files)

parent 1894704b
Branches
Tags
2 merge requests!529Hotline 6.56,!504Dev#16803 display sessions for all users
<?php
/**
* Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* AFI-OPAC 2.0 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class FormationsController extends ZendAfi_Controller_Action {
public function init() {
parent::init();
xdebug_break();
if ('authenticate' == $this->getRequest()->getActionName())
return;
$this->_user = Class_Users::getLoader()->getIdentity();
}
public function indexAction() {
$this->sessions_inscrit = [];
$this->view->formations_by_year = Class_Formation::indexByYear(Class_Formation::getLoader()->findAll());
$this->view->user = $this->_user;
}
public function detailSessionAction() {
if (!$session = Class_SessionFormation::getLoader()->find((int)$this->_getParam('id')))
$this->_redirect('/formations/index');
$this->view->retour_controller="formations";
$this->view->retour_action = $this->_getParam('retour', 'index');
if ($this->view->retour_action=="fiche")
$this->view->retour_controller="abonne";
$this->view->session = $session;
}
}
?>
\ No newline at end of file
<?php
echo $this->renderFormation($this->formation);
?>
<?php
echo $this->openBoite(sprintf('Formation %s: session du %s',
$this->session->getLibelleFormation(),
$this->renderDateRange($this->session->getDateDebut(),
$this->session->getDateFin())));
echo $this->renderSession($this->session);
echo $this->tag('div',
$this->tagAnchor($this->url(['controller' => $this->retour_controller,
'action' => $this->retour_action]
,null,true),
$this->_('Retour')),
['class' => 'actions']);
echo $this->closeBoite(); ;
?>
<?php
echo $this->openBoite('Formations');
if ($this->user && !$this->user->hasRightSuivreFormation())
echo sprintf('<p class="error">%s</p>',
$this->_("Vous n'avez pas les droits suffisants pour vous inscrire à une formation"));
foreach($this->formations_by_year as $year => $formations) {
echo '<div class="formations">';
echo $this->partialCycle('formations/_formation.phtml',
'formation',
$formations,
['first', 'second']);
echo '</div>';
}
echo $this->closeBoite();
?>
<?php echo $this->abonne_RetourFiche(); ?>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment