workshop tient compte des restrictions d'inscriptions

This commit is contained in:
Fred Tempez 2023-11-18 16:34:49 +01:00
parent 3c4e5f7d05
commit 9c23902d63
3 changed files with 119 additions and 104 deletions

View File

@ -165,6 +165,15 @@
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::text('coursesCaptionEnrolmentLimit', [
'label' => 'Limitation date inscription',
'value' => $this->getData(['module', $this->getUrl(0), 'caption', 'enrolmentLimit']),
'help' => 'Classe CSS de la division : workshopEnrolmentLimit'
]); ?>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,14 +1,15 @@
<?php $startRow = 0; ?>
<?php foreach ($this->getData(['course']) as $courseId => $courseValue): ?>
<!-- Filtre de catégorie -->
<?php if ($courseValue['category'] !== $this->getData(['module', $this->getUrl(0), 'config', 'category'])):?>
<?php if ($courseValue['category'] !== $this->getData(['module', $this->getUrl(0), 'config', 'category'])): ?>
<?php continue; ?>
<?php endif; ?>
<?php if ($startRow === 0): ?>
<div class="row workshopRowContainer">
<?php endif; ?>
<!-- Layout en colonnes -->
<div class="workshopItemContainer col<?php echo $this->getData(['module', $this->getUrl(0), 'config', 'layout']); ?>">
<div
class="workshopItemContainer col<?php echo $this->getData(['module', $this->getUrl(0), 'config', 'layout']); ?>">
<!-- Affchage par bloc et bordure -->
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'template']) === true): ?>
<div class="block">
@ -49,7 +50,7 @@
<div class="workshopAccessContainer">
<p>
<span class="workshopAccess">
<?php echo sprintf(helper::translate($module::$coursesAccess[$courseValue['access']] ), helper::dateUTF8('%d %B %Y', $courseValue['openingDate']), helper::dateUTF8('%d %B %Y', $courseValue['closingDate'])) ?>
<?php echo sprintf(helper::translate($module::$coursesAccess[$courseValue['access']]), helper::dateUTF8('%d %B %Y', $courseValue['openingDate']), helper::dateUTF8('%d %B %Y', $courseValue['closingDate'])) ?>
</span>
</p>
</div>
@ -62,8 +63,11 @@
<?php echo $module::$coursesEnrolment[$courseValue['enrolment']]; ?>
</span>
</p>
<?php if ($this->getData(['course', $courseId, 'limitEnrolment']) === true ):?>
<?php echo $this->getData(['module', $this->getUrl(0), 'caption', 'enrolmentLimit']); ?>
<?php echo helper::dateUTF8(' %d %B %Y', $this->getData(['course', $courseId, 'limitEnrolmentDate']), self::$i18nUI) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $courseId, 'limitEnrolmentDate']), self::$i18nUI); ?>
<?php endif; ?>
<?php endif; ?>
<!-- Lien accès au contenu-->
<div class="row">
<div class="col6 workshopLinkContainer">

View File

@ -41,25 +41,26 @@ class workshop extends common
public static $coursesEnrolment = [];
public static $default = [
"config" => array(
"category" => "general",
"title" => true,
"author" => true,
"description" => true,
"access" => true,
"enrolment" => true,
"layout" => 6,
"template" => true
'config' => array(
'category' => 'general',
'title' => true,
'author' => true,
'description' => true,
'access' => true,
'enrolment' => true,
'layout' => 6,
'template' => true
),
"caption" => array(
"accessopen" => "Ouvert",
"accessdate" => "P&eacute;riode d&#039;ouverture du %s au %s",
"accessclose" => "Ferm&eacute;",
"enrolguest" => "Anonyme",
"enrolself" => "Membres",
"enrolselfkey" => "Membres avec cl&eacute;",
"url" => "Acc&eacute;der au contenu",
"unsuscribe" => "Me d&eacute;sinscrire"
'caption' => array(
'accessopen' => 'Ouvert',
'accessdate' => 'P&eacute;riode d&#039;ouverture du %s au %s',
'accessclose' => 'Ferm&eacute;',
'enrolguest' => 'Anonyme',
'enrolself' => 'Membres',
'enrolselfkey' => 'Membres avec cl&eacute;',
'url' => 'Acc&eacute;der au contenu',
'unsuscribe' => 'Me d&eacute;sinscrire',
'enrolmentLimit' => 'Date limite des inscriptions',
)
];
@ -108,6 +109,7 @@ class workshop extends common
'enrolselfkey' => $this->getInput('coursesCaptionSelfKey', helper::FILTER_STRING_SHORT),
'url' => $this->getInput('coursesCaptionUrl', helper::FILTER_STRING_SHORT),
'unsuscribe' => $this->getInput('coursesCaptionUnsuscribe', helper::FILTER_STRING_SHORT),
'enrolmentLimit' => $this->getInput('coursesCaptionEnrolmentLimit', helper::FILTER_STRING_SHORT),
]
]);
// Valeurs en sortie