1.17.02 bug inscription

This commit is contained in:
Fred Tempez 2025-01-14 20:02:22 +01:00
parent b95d341dfa
commit 17f6a606c6
2 changed files with 11 additions and 6 deletions

View File

@ -82,6 +82,8 @@ class course extends common
public static $userStat = [];
public static $courseAvailable = false;
public function index()
{
// Tableau à transmettre à la fvue
@ -1590,9 +1592,13 @@ class course extends common
}
}
// L'étudiant est-il inscrit
// Etat du cours
self::$courseAvailable = $this->courseIsAvailable($this->getUrl(2));
// Message d'inscription
self::$swapMessage['submitLabel'] = helper::translate('M\'inscrire');
self::$swapMessage['enrolmentMessage'] = '';
self::$swapMessage['enrolmentKey'] = '';
// L'étudiant est-il inscrit ?
if ($this->courseIsUserEnroled($courseId) === false) {
switch ($this->getData(['course', $courseId, 'enrolment'])) {
case self::COURSE_ENROLMENT_SELF:

View File

@ -3,7 +3,7 @@
<div class="col12">
<?php echo "<h3>Auteur : " . $this->signature($this->getData(['course', $this->getUrl(2), 'author'])) . "</h3>"; ?>
<?php echo "<p>Description : " . $this->getData(['course', $this->getUrl(2), 'description']) . "</p>"; ?>
<!--Restriction de date limite d'ouverture-->
<!--Restriction de date limite d'ouverture-->
<?php echo "<p>Disponibilité : " . course::$courseAccess[$this->getData(['course', $this->getUrl(2), 'access'])]; ?>
<?php if ($this->getData(['course', $this->getUrl(2), 'access']) === course::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); ?>
@ -12,8 +12,8 @@
<?php endif; ?>
<?php echo '</p>'; ?>
<?php echo "<p>Inscription : " . course::$courseEnrolment[$this->getData(['course', $this->getUrl(2), 'enrolment'])] . '.'; ?>
<!--Restriction de date limite d'insription-->
<?php if ($this->getData(['course', $this->getUrl(2), 'limitEnrolment']) === true && $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']) <= time()):?>
<!--Restriction de date limite d'insription-->
<?php if ($this->getData(['course', $this->getUrl(2), 'limitEnrolment']) === true && $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']) <= time()): ?>
<?php echo helper::translate(' Les inscriptions sont closes depuis le ') ?>
<?php echo helper::dateUTF8('%d %B %Y', $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']), self::$i18nUI) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']), self::$i18nUI); ?>
<?php endif; ?>
@ -50,12 +50,11 @@
</div>
<?php else: ?>
<div class="col3 offset7">
<?php echo template::submit('courseSwapSubmit', [
<?php echo template::submit('courseSwapSubmit', [
'value' => course::$swapMessage['submitLabel'],
'disabled' => !($this->courseIsAvailable($this->getUrl(2))
'disabled' => course::$courseAvailable === false
&& !($this->getData(['course', $this->getUrl(2), 'limitEnrolment']) === true
&& $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']) <= time())
),
]); ?>
</div>
<?php endif; ?>