From 17f6a606c6e197662c8be93904f2d9bcbcf9ce4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Tue, 14 Jan 2025 20:02:22 +0100 Subject: [PATCH] 1.17.02 bug inscription --- core/module/course/course.php | 6 ++++++ core/module/course/view/suscribe/suscribe.php | 11 +++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/core/module/course/course.php b/core/module/course/course.php index 6639dc4..fb6a08f 100644 --- a/core/module/course/course.php +++ b/core/module/course/course.php @@ -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: diff --git a/core/module/course/view/suscribe/suscribe.php b/core/module/course/view/suscribe/suscribe.php index edd41e5..934da4d 100644 --- a/core/module/course/view/suscribe/suscribe.php +++ b/core/module/course/view/suscribe/suscribe.php @@ -3,7 +3,7 @@
Auteur : " . $this->signature($this->getData(['course', $this->getUrl(2), 'author'])) . ""; ?> Description : " . $this->getData(['course', $this->getUrl(2), 'description']) . "

"; ?> - + Disponibilité : " . course::$courseAccess[$this->getData(['course', $this->getUrl(2), 'access'])]; ?> getData(['course', $this->getUrl(2), 'access']) === course::COURSE_ACCESS_DATE): ?> 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 @@ '; ?> Inscription : " . course::$courseEnrolment[$this->getData(['course', $this->getUrl(2), 'enrolment'])] . '.'; ?> - - getData(['course', $this->getUrl(2), 'limitEnrolment']) === true && $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']) <= time()):?> + + getData(['course', $this->getUrl(2), 'limitEnrolment']) === true && $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']) <= time()): ?> getData(['course', $this->getUrl(2), 'limitEnrolmentDate']), self::$i18nUI) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']), self::$i18nUI); ?> @@ -50,12 +50,11 @@
- 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()) - ), ]); ?>