Commit 81796aeb authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #56034 continue renaming process

parent 97f2e688
Pipeline #1147 failed with stage
in 4 minutes and 13 seconds
......@@ -3,7 +3,7 @@
echo $this->tagAnchor(['action' => 'edit',
'id' => $this->formation->getId()],
$this->boutonIco("type=edit",
'bulle='.$this->_('Modifier la formation')));
'bulle='.$this->_('Modifier l\'activité')));
echo $this->tagAnchor(['action' => ($this->formation->isVisible() ? 'hide' : 'show'),
'id' => $this->formation->getId()],
......@@ -20,6 +20,6 @@
echo $this->tagAnchor(['action' => 'delete',
'id' => $this->formation->getId()],
$this->boutonIco("type=del",
'bulle='.$this->_('Supprimer la formation')));
'bulle='.$this->_('Supprimer l\'activité')));
?>
</div>
......@@ -71,7 +71,7 @@ class AbonneController extends ZendAfi_Controller_Action {
public function inscrireSessionAction() {
$this->_redirectToReferer();
if ((!$session = Class_SessionFormation::find((int)$this->_getParam('id')))
if ((!$session = Class_SessionActivity::find((int)$this->_getParam('id')))
|| $session->isInscriptionClosed())
return $this->_helper->notify($this->_('L\'inscription à cette session est fermée'));
......@@ -79,28 +79,28 @@ class AbonneController extends ZendAfi_Controller_Action {
if (!$session->save())
return $this->_helper->notify(implode('<br/>', $session->getErrors()));
(new Class_Formation_RegistrationMail($session, $this->_user))->send();
(new Class_Activity_RegistrationMail($session, $this->_user))->send();
$this->_helper->notify($this->_('Vous êtes inscrit à la session du %s de la formation %s',
$this->_helper->notify($this->_('Vous êtes inscrit à la session du %s de l\'activité %s',
$this->view->humanDate($session->getDateDebut(), 'd MMMM YYYY'),
$session->getLibelleFormation()));
$session->getLibelleActivity()));
}
public function desinscrireSessionAction() {
if (!$session = Class_SessionFormation::find((int)$this->_getParam('id'))) {
if (!$session = Class_SessionActivity::find((int)$this->_getParam('id'))) {
$this->_helper->notify($this->_('Session non trouvée'));
$this->_redirectToReferer();
return;
}
$this->_user->removeSessionFormation($session);
$this->_user->removeSessionActivity($session);
if ($this->_user->save()) {
$this->_helper->notify($this->_('Vous n\'êtes plus inscrit à la session du %s de la formation %s',
$this->_helper->notify($this->_('Vous n\'êtes plus inscrit à la session du %s de l\'activité %s',
$this->view->humanDate($session->getDateDebut(), 'd MMMM YYYY'),
$session->getLibelleFormation()));
$session->getLibelleActivity()));
(new Class_Formation_UnregistrationMail($session, $this->_user))->send();
(new Class_Activity_UnregistrationMail($session, $this->_user))->send();
};
$this->_redirectToReferer();
......@@ -1174,21 +1174,21 @@ class AbonneController extends ZendAfi_Controller_Action {
}
public function formationsAction() {
public function activitiesAction() {
$this->view->titre = $this->_('S\'inscrire à une formation');
$this->view->sessions = Class_SessionFormation::findAllAvailable($this->_user);
$this->view->sessions = Class_SessionActivity::findAllAvailable($this->_user);
}
public function formationsRegisteredAction() {
public function activitiesRegisteredAction() {
$this->view->titre = $this->_('Mes inscriptions en cours');
$this->view->sessions = Class_SessionFormation::findAllRegistered($this->_user);
$this->view->sessions = Class_SessionActivity::findAllRegistered($this->_user);
}
public function formationsDoneAction() {
public function activitiesDoneAction() {
$this->view->titre = $this->_('Mes formations suivies');
$this->view->sessions = Class_SessionFormation::findAllDone($this->_user);
$this->view->sessions = Class_SessionActivity::findAllDone($this->_user);
}
......
......@@ -20,7 +20,7 @@
*/
class FormationsController extends ZendAfi_Controller_Action {
class ActivitiesController extends ZendAfi_Controller_Action {
public function init() {
parent::init();
$this->_user = Class_Users::getIdentity();
......@@ -28,18 +28,18 @@ class FormationsController extends ZendAfi_Controller_Action {
public function indexAction() {
$this->view->formations_by_year = Class_Formation::indexByYear(Class_Formation::findAll());
$this->view->activities_by_year = Class_Activity::indexByYear(Class_Activity::findAll());
$this->view->user = $this->_user;
}
public function detailSessionAction() {
if (!$session = Class_SessionFormation::find((int)$this->_getParam('id')))
if (!$session = Class_SessionActivity::find((int)$this->_getParam('id')))
return $this->_redirectToReferer();
$this->view->url_retour = ($this->_getParam('retour'))
? $this->_getParam('retour')
: $this->view->url(['controller' => 'formations',
: $this->view->url(['controller' => 'activities',
'action' => 'index'],
null, true);
$this->view->session = $session;
......
......@@ -4,6 +4,7 @@ try {
$adapter->query('ALTER TABLE sessions_formation CHANGE formation_id activity_id INT( 11 )');
$adapter->query('RENAME TABLE formations TO activity');
$adapter->query('RENAME TABLE sessions_formation TO session_activity');
$adapter->query('ALTER TABLE session_formation_inscriptions CHANGE session_formation_id session_activity_id INT( 11 )');
$adapter->query('RENAME TABLE session_formation_inscriptions TO session_activity_inscriptions');
$adapter->query('RENAME TABLE session_formation_interventions TO session_activity_interventions');
} catch(Exception $e) {}
......
......@@ -128,7 +128,7 @@ class Class_AdminVarLoader extends Storm_Model_Loader {
'<a href="' . Class_Url::baseUrl() . '/admin/index/clearcache" >Vider le cache</a>']))->bePrivate(),
'CACHE_DATE' => Class_AdminVar_Meta::newDefault($this->_('Date du dernier vidage manuel du cache'))->bePrivate(),
'FORMATIONS' => Class_AdminVar_Meta::newOnOff($this->_('Activer ou désactiver le module formation'))->bePrivate(),
'ACTIVITY' => Class_AdminVar_Meta::newOnOff($this->_('Activer ou désactiver le module activité'))->bePrivate(),
'BABELTHEQUE_JS' => Class_AdminVar_Meta::newDefault($this->_('URL du javascript Babelthèque à insérer dans l\'OPAC'))->bePrivate(),
'MULTIMEDIA_KEY' => Class_AdminVar_Meta::newDefault($this->_('Clé publique pour le cryptage des données AFI-Multimédia')),
......@@ -520,8 +520,8 @@ class Class_AdminVarLoader extends Storm_Model_Loader {
/**
* @return bool
*/
public function isFormationEnabled() {
return Class_AdminVar::isModuleEnabled('FORMATIONS');
public function isActivityEnabled() {
return Class_AdminVar::isModuleEnabled('ACTIVITY');
}
......
......@@ -37,7 +37,7 @@
class Class_ModeleFusionLoader extends Storm_Model_Loader {
use Trait_Translator;
const TRAINING_TEMPLATE = 'FORMATION_';
const TRAINING_TEMPLATE = 'ACTIVITY_';
public function get($name) {
return $this->findFirstBy(['nom' => $name]);
......@@ -146,9 +146,9 @@ class Class_ModeleFusion extends Storm_Model_Abstract {
public function getMatchesFromContent($content) {
$matches = array();
preg_match_all('/'. //ex: @session_formation.stagiaires[nom, prenom]@
preg_match_all('/'. //ex: @session_activity.stagiaires[nom, prenom]@
'\{'. //delimiteur
'([\w|\.]+)'. //session_formation.stagiaires
'([\w|\.]+)'. //session_activity.stagiaires
'(?:'.
'\[([^\]]+)\]'. // [nom, prenom]
')?'.
......
......@@ -138,8 +138,8 @@ class Class_Systeme_ModulesAccueil extends Class_Systeme_ModulesAbstract {
];
}
Class_Adminvar::isFormationEnabled()
? self::$_modules['FORMATIONS_WIDGET'] = new Class_Systeme_ModulesAccueil_Formations : '' ;
Class_Adminvar::isActivityEnabled()
? self::$_modules['ACTIVITY_WIDGET'] = new Class_Systeme_ModulesAccueil_Activity : '' ;
return self::$_modules;
}
......
......@@ -111,7 +111,7 @@ class Class_Systeme_ModulesMenu extends Class_Systeme_ModulesAbstract {
"ABON_PRETS" => new Class_Systeme_ModulesMenu_AbonnePrets(),
"ABON_CARDS" => new Class_Systeme_ModulesMenu_AbonneCards(),
"ABON_RESAS" => new Class_Systeme_ModulesMenu_AbonneReservations(),
"ABON_FORMATIONS" => new Class_Systeme_ModulesMenu_AbonneFormations(),
"ABON_ACTIVITIES" => new Class_Systeme_ModulesMenu_AbonneActivities(),
"FORM_CONTACT" => new Class_Systeme_ModulesMenu_FormulaireContact(),
"VODECLIC" => new Class_Systeme_ModulesMenu_Vodeclic(),
"TOUTAPPRENDRE" => new Class_Systeme_ModulesMenu_ToutApprendre(),
......
......@@ -19,21 +19,21 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Systeme_ModulesMenu_AbonneFormations extends Class_Systeme_ModulesMenu_Null {
class Class_Systeme_ModulesMenu_AbonneActivities extends Class_Systeme_ModulesMenu_Null {
protected
$_group = Class_Systeme_ModulesMenu::GROUP_MENU_ABONNES,
$_type_module = 'ABON_FORMATIONS',
$_url = ['controller' => 'formations',
$_type_module = 'ABON_ACTIVITIES',
$_url = ['controller' => 'activities',
'action' => 'index'];
public function __construct() {
$this->_libelle = $this->_('Lien vers mes formations');
$this->_libelle = $this->_('Lien vers mes activités');
}
public function isVisibleForProfil($profil) {
return Class_AdminVar::isFormationEnabled();
return Class_AdminVar::isActivityEnabled();
}
}
\ No newline at end of file
......@@ -129,8 +129,8 @@ class Class_UserGroup extends Storm_Model_Abstract {
'referenced_in' => 'id_bib']];
// Les droits sont utilisés comme puissance de 2 (ce sont des masques) pour l'attribut rights_token
const RIGHT_SUIVRE_FORMATION = 0;
const RIGHT_DIRIGER_FORMATION = 1;
const RIGHT_SUIVRE_ACTIVITY = 0;
const RIGHT_DIRIGER_ACTIVITY = 1;
const RIGHT_ACCES_ARTEVOD = 2;
const RIGHT_ACCES_NUMILOG = 3;
const RIGHT_ACCES_CVS = 4;
......@@ -174,8 +174,8 @@ class Class_UserGroup extends Storm_Model_Abstract {
protected static
$_rights_definition =
[
self::RIGHT_SUIVRE_FORMATION => 'Formations: suivre une formation',
self::RIGHT_DIRIGER_FORMATION => 'Formations: diriger une formation' ,
self::RIGHT_SUIVRE_ACTIVITY => 'Activité : suivre une activité',
self::RIGHT_DIRIGER_ACTIVITY => 'Activité : diriger une activité' ,
self::RIGHT_ACCES_ARTEVOD => 'Bibliothèque numérique: accéder à ARTE VOD',
self::RIGHT_ACCES_NUMILOG => 'Bibliothèque numérique: accéder à Numilog',
self::RIGHT_ACCES_CYBERLIBRIS => 'Bibliothèque numérique: accéder à Cyberlibris',
......@@ -228,8 +228,8 @@ class Class_UserGroup extends Storm_Model_Abstract {
public static function getActivatedRightDefinitionList() {
$rights = self::getRightDefinitionList();
$mapping = ['Formation' => [Class_UserGroup::RIGHT_SUIVRE_FORMATION,
Class_UserGroup::RIGHT_DIRIGER_FORMATION],
$mapping = ['Activity' => [Class_UserGroup::RIGHT_SUIVRE_ACTIVITY,
Class_UserGroup::RIGHT_DIRIGER_ACTIVITY],
'ArteVod' => [Class_UserGroup::RIGHT_ACCES_ARTEVOD],
'CVS' => [Class_UserGroup::RIGHT_ACCES_CVS],
'Numilog' => [Class_UserGroup::RIGHT_ACCES_NUMILOG],
......@@ -329,8 +329,8 @@ class Class_UserGroup extends Storm_Model_Abstract {
/**
* Ex:
* group->setRights(array(Class_UserGroup::RIGHT_DIRIGER_FORMATION,
* Class_UserGroup::RIGHT_SUIVRE_FORMATION));
* group->setRights(array(Class_UserGroup::RIGHT_DIRIGER_ACTIVITY,
* Class_UserGroup::RIGHT_SUIVRE_ACTIVITY));
* @param array $rights
*/
public function setRights($rights) {
......@@ -382,8 +382,8 @@ class Class_UserGroup extends Storm_Model_Abstract {
/**
* @return bool
*/
public function hasRightDirigerFormation() {
return $this->hasRight(self::RIGHT_DIRIGER_FORMATION, $this->getRights());
public function hasRightDirigerActivity() {
return $this->hasRight(self::RIGHT_DIRIGER_ACTIVITY, $this->getRights());
}
......@@ -396,14 +396,14 @@ class Class_UserGroup extends Storm_Model_Abstract {
/** @return Class_UserGroup */
public function addRightDirigerFormation() {
return $this->addRight(self::RIGHT_DIRIGER_FORMATION);
public function addRightDirigerActivity() {
return $this->addRight(self::RIGHT_DIRIGER_ACTIVITY);
}
/** @return Class_UserGroup */
public function addRightSuivreFormation() {
return $this->addRight(self::RIGHT_SUIVRE_FORMATION);
public function addRightSuivreActivity() {
return $this->addRight(self::RIGHT_SUIVRE_ACTIVITY);
}
......
......@@ -88,12 +88,12 @@ class UsersLoader extends Storm_Model_Loader {
/**
* @return array
*/
public function findAllByRightDirigerFormation() {
public function findAllByRightDirigerActivity() {
$users = array();
$all_groups = Class_UserGroup::findAll();
foreach ($all_groups as $group) {
if ($group->hasRightDirigerFormation())
if ($group->hasRightDirigerActivity())
$users = array_merge($users , $group->getUsers());
}
......@@ -365,17 +365,17 @@ class Class_Users extends Storm_Model_Abstract {
'role' => 'user',
'order' => 'date_creation desc'],
'session_formation_inscriptions' => ['model' => 'Class_SessionFormationInscription',
'session_activity_inscriptions' => ['model' => 'Class_SessionActivityInscription',
'role' => 'stagiaire'],
'session_formations' => ['through' => 'session_formation_inscriptions'],
'session_activities' => ['through' => 'session_activity_inscriptions'],
'formations' => ['through' => 'session_formation_inscriptions'],
'activities' => ['through' => 'session_activity_inscriptions'],
'session_formation_interventions' => ['model' => 'Class_SessionFormationIntervention',
'session_activity_interventions' => ['model' => 'Class_SessionActivityIntervention',
'role' => 'intervenant'],
'session_interventions' => ['through' => 'session_formation_interventions'],
'session_interventions' => ['through' => 'session_activity_interventions'],
'user_group_memberships' => ['model' => 'Class_UserGroupMembership',
'role' => 'user',
......@@ -861,8 +861,8 @@ class Class_Users extends Storm_Model_Abstract {
/**
* @return bool
*/
public function hasRightSuivreFormation() {
return $this->hasRightToAccess(Class_UserGroup::RIGHT_SUIVRE_FORMATION);
public function hasRightSuivreActivity() {
return $this->hasRightToAccess(Class_UserGroup::RIGHT_SUIVRE_ACTIVITY);
}
......@@ -887,8 +887,8 @@ class Class_Users extends Storm_Model_Abstract {
/**
* @return bool
*/
public function hasRightDirigerFormation() {
return $this->hasRightToAccess(Class_UserGroup::RIGHT_DIRIGER_FORMATION);
public function hasRightDirigerActivity() {
return $this->hasRightToAccess(Class_UserGroup::RIGHT_DIRIGER_ACTIVITY);
}
......@@ -1037,11 +1037,11 @@ class Class_Users extends Storm_Model_Abstract {
if ($this->getRoleLevel()==ZendAfi_Acl_AdminControllerRoles::ABONNE_SIGB)
$this->checkAttribute('idabon',$this->getIdabon(),$this->_("Le numéro de carte est obligatoire pour les abonnés identifiés dans un sigb."));
$this->check($this->hasRightSuivreFormation() or (count($this->getSessionFormations()) === 0),
$this->_('Vous n\'avez pas les droits suffisants pour suivre une formation'));
$this->check($this->hasRightSuivreActivity() or (count($this->getSessionActivities()) === 0),
$this->_('Vous n\'avez pas les droits suffisants pour suivre une activité'));
$this->check($this->hasRightDirigerFormation() or (count($this->getSessionInterventions()) === 0),
$this->_('Vous n\'avez pas les droits suffisants pour diriger une formation'));
$this->check($this->hasRightDirigerActivity() or (count($this->getSessionInterventions()) === 0),
$this->_('Vous n\'avez pas les droits suffisants pour diriger une activité'));
$this->checkAttribute('mail',($this->getMail() || !$this->getIsContactMail()),
......
......@@ -24,7 +24,7 @@ class ZendAfi_Acl_AdminControllerGroup {
protected static $_acl;
protected
$_mapping = ['formation' => Class_UserGroup::RIGHT_DIRIGER_FORMATION,
$_mapping = ['activity' => Class_UserGroup::RIGHT_DIRIGER_ACTIVITY,
'catalogue' => [Class_UserGroup::RIGHT_USER_DOMAINES_SUPPRESSION_LIMIT,
Class_UserGroup::RIGHT_USER_DOMAINES_TOTAL_ACCESS],
'catalogue/domaines' => Class_UserGroup::RIGHT_USER_INDEX_ARTICLES,
......@@ -45,7 +45,7 @@ class ZendAfi_Acl_AdminControllerGroup {
public function __construct() {
$this->_activated = ['formation' => Class_AdminVar::isFormationEnabled(),
$this->_activated = ['activity' => Class_AdminVar::isActivityEnabled(),
'album' => Class_AdminVar::isBibNumEnabled(),
'oai' => Class_AdminVar::isBibNumEnabled(),
'ead' => Class_AdminVar::isBibNumEnabled(),
......
......@@ -20,7 +20,7 @@
*/
class ZendAfi_Controller_Plugin_Manager_SessionFormation extends ZendAfi_Controller_Plugin_Manager_Manager {
class ZendAfi_Controller_Plugin_Manager_SessionActivity extends ZendAfi_Controller_Plugin_Manager_Manager {
public function _getPost() {
$post = parent::_getPost();
foreach(['date_debut', 'date_fin', 'date_limite_inscription'] as $field)
......@@ -35,20 +35,20 @@ class ZendAfi_Controller_Plugin_Manager_SessionFormation extends ZendAfi_Control
public function addAction() {
if (!$formation = Class_Formation::find($this->_getParam('formation_id'))) {
$this->_redirect('admin/formation');
if (!$activity = Class_Activity::find($this->_getParam('activity_id'))) {
$this->_redirect('admin/activity');
return;
}
parent::addAction();
$this->_view->titre = sprintf('Nouvelle session de la formation "%s"',
$formation->getLibelle());
$this->_view->titre = sprintf('Nouvelle session de l\'activité "%s"',
$activity->getLibelle());
}
protected function _updateNewModel($model) {
$model->setFormation(Class_Formation::find($this->_getParam('formation_id')));
$model->setActivity(Class_Activity::find($this->_getParam('activity_id')));
return $this;
}
}
......
......@@ -20,11 +20,11 @@
*/
class ZendAfi_Controller_Plugin_ResourceDefinition_SessionFormation extends ZendAfi_Controller_Plugin_ResourceDefinition_Abstract {
class ZendAfi_Controller_Plugin_ResourceDefinition_SessionActivity extends ZendAfi_Controller_Plugin_ResourceDefinition_Abstract {
public function getDefinitions() {
return ['model' => ['class' => 'Class_SessionFormation',
'name' => 'session_formation',
return ['model' => ['class' => 'Class_SessionActivity',
'name' => 'session_activity',
'order' => 'id'],
'messages' => ['successful_save' => $this->_('Session "%s" sauvegardée'),
......@@ -34,9 +34,9 @@ class ZendAfi_Controller_Plugin_ResourceDefinition_SessionFormation extends Zend
'actions' => ['add' => ['title' => $this->_("Ajouter une session")],
'edit' => ['title' => $this->_("Modifier la session: %s")]],
'form_class_name' => 'ZendAfi_Form_Admin_SessionFormation',
'form_class_name' => 'ZendAfi_Form_Admin_SessionActivity',
'after_delete' => function($model) { $this->_redirect('/admin/formation/index');},
'after_delete' => function($model) { $this->_redirect('/admin/activity/index');},
'after_add' => function($session) { $this->_afterAdd($session); }
];
......@@ -44,7 +44,7 @@ class ZendAfi_Controller_Plugin_ResourceDefinition_SessionFormation extends Zend
protected function _afterAdd($session) {
Class_Formation::find($this->_getParam('formation_id'))->addSession($session)->save();
Class_Activity::find($this->_getParam('activity_id'))->addSession($session)->save();
}
}
......
......@@ -20,43 +20,43 @@
*/
class ZendAfi_View_Helper_Accueil_FormationsWidget extends ZendAfi_View_Helper_Accueil_Base {
class ZendAfi_View_Helper_Accueil_ActivityWidget extends ZendAfi_View_Helper_Accueil_Base {
public function getHTML() {
$this->titre = $this->preferences['titre'];
$selected_formations = $this->_getSelectedFormations();
$selected_formations = $this->_getSelectedActivities();
if(isset($this->preferences['display_number']) && ($display_number = $this->preferences['display_number']))
$selected_formations = array_slice($selected_formations, 0, $display_number);
$this->contenu = $this->view->renderFormationsByGroup($selected_formations, $this->preferences);
$this->contenu = $this->view->renderActivitiesByGroup($selected_formations, $this->preferences);
return $this->getHtmlArray();
}
protected function _getSelectedFormations() {
protected function _getSelectedActivities() {
if(!$selected_formations = array_filter(explode('-', $this->preferences['selected_formations'])))
return [];
$display_order = $this->preferences['display_order'];
if( Class_Systeme_ModulesAccueil_Formations::ORDER_BY_SELECTION == $display_order)
if( Class_Systeme_ModulesAccueil_Activities::ORDER_BY_SELECTION == $display_order)
return $this->_displayBySelection($selected_formations);
if( Class_Systeme_ModulesAccueil_Formations::ORDER_BY_CONTRIBUTORS == $display_order)
if( Class_Systeme_ModulesAccueil_Activities::ORDER_BY_CONTRIBUTORS == $display_order)
return $this->_displayByNumberOfParticipants($selected_formations);
if( Class_Systeme_ModulesAccueil_Formations::ORDER_BY_CREATION_ID == $display_order)
if( Class_Systeme_ModulesAccueil_Activities::ORDER_BY_CREATION_ID == $display_order)
return $this->_displayByCreationDate($selected_formations);
return Class_Formation::findAllBy(['id' => $selected_formations]);
return Class_Activity::findAllBy(['id' => $selected_formations]);
}
protected function _displayBySelection($formations_ids) {
$formations = Class_Formation::findAllBy(['id' => $formations_ids]);
$formations = Class_Activity::findAllBy(['id' => $formations_ids]);
usort($formations, function ($one, $two)
use ($formations_ids){
return array_search($one->getId(),$formations_ids) > array_search($two->getId(),$formations_ids) ? 1: -1;
......@@ -66,7 +66,7 @@ class ZendAfi_View_Helper_Accueil_FormationsWidget extends ZendAfi_View_Helper_A
protected function _displayByNumberOfParticipants($formations) {
$formations = Class_Formation::findAllBy(['id' => $formations]);
$formations = Class_Activity::findAllBy(['id' => $formations]);
usort($formations,
function($formation_one, $formation_two)
{
......@@ -83,7 +83,7 @@ class ZendAfi_View_Helper_Accueil_FormationsWidget extends ZendAfi_View_Helper_A
protected function _displayByCreationDate($formations) {
return Class_Formation::findAllBy(['id' => $formations,
return Class_Activity::findAllBy(['id' => $formations,
'order' => 'id desc']);
}
}
......
......@@ -16,24 +16,24 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_View_Helper_Admin_FormationSubscribers extends ZendAfi_View_Helper_Admin_SubscribeUsers {
protected $_by_right = Class_UserGroup::RIGHT_SUIVRE_FORMATION;
class ZendAfi_View_Helper_Admin_ActivitySubscribers extends ZendAfi_View_Helper_Admin_SubscribeUsers {
protected $_by_right = Class_UserGroup::RIGHT_SUIVRE_ACTIVITY;
public function formationSubscribers($id_session, $search, $page = 0, $items_by_page = 20) {
if(!$session = Class_SessionFormation::find($id_session))
public function activitySubscribers($id_session, $search, $page = 0, $items_by_page = 20) {
if(!$session = Class_SessionActivity::find($id_session))
return '';
$this->_total = Class_SessionFormationInscription::countBy(['session_formation_id' => $id_session]);
$this->_total = Class_SessionActivityInscription::countBy(['session_activity_id' => $id_session]);
$this->_paginator = new Zend_Paginator(new Zend_Paginator_Adapter_Null($this->_total));
$this->_paginator->setItemCountPerPage($items_by_page);
$this->_paginator->setCurrentPageNumber($page);
$this->_paginator->setView($this->view);
$items = $session->getUsersPage($page, $items_by_page);
return $this
......@@ -62,9 +62,9 @@ class ZendAfi_View_Helper_Admin_FormationSubscribers extends ZendAfi_View_Helper
return $this->view->_('Inscrire les stagiaires sélectionnés');
}
protected function _getPagination() {
return $this->view->tag('div', $this->_paginator->render(),
return $this->view->tag('div', $this->_paginator->render(),
['style' => 'text-align:center']);
}
}
......
......@@ -20,35 +20,35 @@
*/
class ZendAfi_View_Helper_RenderFormationsByGroup extends ZendAfi_View_Helper_BaseHelper {
public function renderFormationsByGroup($formations, $preferences) {
if(!array_filter($formations)>0)
class