forked from ZwiiCMS-Team/ZwiiCampus
Enrolment OKAY
This commit is contained in:
parent
6b6ce19064
commit
b5eff6f9b8
@ -368,7 +368,7 @@ class course extends common
|
||||
$userId,
|
||||
$this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']),
|
||||
$userValue['lastPageId'],
|
||||
helper::dateUTF8('%d %B %Y - %H:%M',$userValue['lastDateVisited']),
|
||||
helper::dateUTF8('%d %B %Y - %H:%M', $userValue['lastDateVisited']),
|
||||
template::button('courseDelete' . $userId, [
|
||||
'class' => 'categoryDelete buttonRed',
|
||||
'href' => helper::baseUrl() . 'course/categoryDelete/' . $userId,
|
||||
@ -456,7 +456,6 @@ class course extends common
|
||||
break;
|
||||
// Auto avec ou sans clé
|
||||
case self::COURSE_ENROLMENT_SELF:
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $courseId;
|
||||
$redirect .= 'course/enrol/' . $courseId;
|
||||
$message = helper::translate('Veuillez vous inscrire');
|
||||
break;
|
||||
@ -508,17 +507,18 @@ class course extends common
|
||||
switch ($this->getData(['course', $courseId, 'enrolment'])) {
|
||||
case self::COURSE_ENROLMENT_SELF:
|
||||
$this->courseEnrolUser($courseId, $userId);
|
||||
// Stocker la sélection
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $courseId;
|
||||
break;
|
||||
case self::COURSE_ENROLMENT_SELF_KEY:
|
||||
if ($this->getInput('courseSwapEnrolmentKey') === $this->getData(['course', $courseId, 'enrolmentKey'])) {
|
||||
$this->courseEnrolUser($courseId, $userId);
|
||||
// Stocker la sélection
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $courseId;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Stocker la sélection
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $courseId;
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl()
|
||||
@ -526,22 +526,26 @@ class course extends common
|
||||
}
|
||||
}
|
||||
// L'étudiant est-il inscrit
|
||||
self::$swapMessage['submitLabel'] = 'Se connecter';
|
||||
self::$swapMessage['submitLabel'] = helper::translate('M\'inscrire');
|
||||
self::$swapMessage['enrolmentMessage'] = '';
|
||||
self::$swapMessage['enrolmentKey'] = '';
|
||||
if ($this->courseIsUserEnroled($courseId) === false) {
|
||||
switch ($this->getData(['course', $courseId, 'enrolment'])) {
|
||||
case self::COURSE_ENROLMENT_GUEST:
|
||||
case self::COURSE_ENROLMENT_SELF:
|
||||
self::$swapMessage['submitLabel'] = helper::translate('M\'inscrire');
|
||||
if ($userId == '') {
|
||||
self::$swapMessage['enrolmentMessage'] = helper::translate('Connectez-vous pour accéder à ce cours.');
|
||||
self::$swapMessage['submitLabel'] = helper::translate('Connexion');
|
||||
}
|
||||
break;
|
||||
case self::COURSE_ENROLMENT_SELF_KEY:
|
||||
if ($userId) {
|
||||
if ($userId == '') {
|
||||
self::$swapMessage['enrolmentMessage'] = helper::translate('Connectez-vous pour accéder à ce cours.');
|
||||
self::$swapMessage['submitLabel'] = helper::translate('Connexion');
|
||||
} else {
|
||||
self::$swapMessage['submitLabel'] = helper::translate('Connexion');
|
||||
self::$swapMessage['enrolmentKey'] = template::text('courseSwapEnrolmentKey', [
|
||||
'label' => helper::translate('Clé d\'inscription'),
|
||||
]);
|
||||
} else {
|
||||
self::$swapMessage['enrolmentMessage'] = helper::translate('Connectez-vous pour accéder à ce cours.');
|
||||
}
|
||||
break;
|
||||
case self::COURSE_ENROLMENT_MANUAL:
|
||||
|
@ -3,7 +3,7 @@
|
||||
<div class="col12">
|
||||
<?php echo "<h3>Auteur : " . $this->getData(['course', $this->getUrl(2), 'author']) . "</h3>"; ?>
|
||||
<?php echo "<p>Description : " . $this->getData(['course', $this->getUrl(2), 'description']) . "</p>"; ?>
|
||||
<?php echo "<p>Disponibilité : " . $module::$courseAccess[$this->getData(['course', $this->getUrl(2), 'access'])] ; ?>
|
||||
<?php echo "<p>Disponibilité : " . $module::$courseAccess[$this->getData(['course', $this->getUrl(2), 'access'])]; ?>
|
||||
<?php if ($this->getData(['course', $this->getUrl(2), 'access']) === $module::COURSE_ACCESS_DATE): ?>
|
||||
<?php $from = helper::dateUTF8('%d %B %Y', $this->getData(['course', $this->getUrl(2), 'openingDate']), self::$i18nUI) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $this->getUrl(2), 'openingDate']), self::$i18nUI); ?>
|
||||
<?php $to = helper::dateUTF8('%d %B %Y', $this->getData(['course', $this->getUrl(2), 'closingDate']), self::$i18nUI) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $this->getUrl(2), 'closingDate']), self::$i18nUI); ?>
|
||||
@ -32,13 +32,22 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3 offset7">
|
||||
<?php echo template::submit('courseSwapSubmit', [
|
||||
'value' => $module::$swapMessage['submitLabel'],
|
||||
'disabled' => !$module->courseIsAvailable($this->getUrl(2)),
|
||||
'ico' => ''
|
||||
]); ?>
|
||||
</div>
|
||||
<?php if ($module::$swapMessage['submitLabel'] === 'Connexion'): ?>
|
||||
<div class="col2 offset8">
|
||||
<?php echo template::button('courseConnect', [
|
||||
'href' => helper::baseUrl(true) . 'user/login',
|
||||
'value' => template::ico('login'),
|
||||
'help' => 'Connexion',
|
||||
]); ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="col3 offset6">
|
||||
<?php echo template::submit('courseSwapSubmit', [
|
||||
'value' => $module::$swapMessage['submitLabel'],
|
||||
'disabled' => !$module->courseIsAvailable($this->getUrl(2)),
|
||||
'ico' => ''
|
||||
]); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php echo template::formClose(); ?>
|
Loading…
Reference in New Issue
Block a user