1.7.08 worhsop liend e désinscription dans les options

This commit is contained in:
Fred Tempez 2024-04-02 18:25:39 +02:00
parent 1cb54d46b1
commit 63541cf83a
4 changed files with 24 additions and 17 deletions

View File

@ -51,7 +51,7 @@ class common
const ACCESS_TIMER = 1800; const ACCESS_TIMER = 1800;
// Numéro de version // Numéro de version
const ZWII_VERSION = '1.7.07'; const ZWII_VERSION = '1.7.08';
// URL autoupdate // URL autoupdate
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/'; const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/';

View File

@ -26,15 +26,13 @@
<?php echo helper::translate('Elements à afficher'); ?> <?php echo helper::translate('Elements à afficher'); ?>
</h4> </h4>
<div class="row"> <div class="row">
<div class="col12"> <div class="col6">
<?php echo template::checkbox('coursesConfigShowTitle', true, 'Titre', [ <?php echo template::checkbox('coursesConfigShowTitle', true, 'Titre', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'title']), 'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'title']),
'help' => 'Classe CSS de l\'élément en ligne : workshopTitle' 'help' => 'Classe CSS de l\'élément en ligne : workshopTitle'
]); ?> ]); ?>
</div> </div>
</div> <div class="col6">
<div class="row">
<div class="col12">
<?php echo template::checkbox('coursesConfigShowAuthor', true, 'Signature de l\'auteur', [ <?php echo template::checkbox('coursesConfigShowAuthor', true, 'Signature de l\'auteur', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'author']), 'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'author']),
'help' => 'Classe CSS de l\'élément en ligne : workshopTitle' 'help' => 'Classe CSS de l\'élément en ligne : workshopTitle'
@ -42,28 +40,32 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col6">
<?php echo template::checkbox('coursesConfigShowDescription', true, 'Description', [ <?php echo template::checkbox('coursesConfigShowDescription', true, 'Description', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'description']), 'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'description']),
'help' => 'Classe CSS de l\'élément en ligne : workshopDescription' 'help' => 'Classe CSS de l\'élément en ligne : workshopDescription'
]); ?> ]); ?>
</div> </div>
</div> <div class="col6">
<div class="row">
<div class="col4">
<?php echo template::checkbox('coursesConfigShowAccess', true, 'Modalités d\'ouverture', [ <?php echo template::checkbox('coursesConfigShowAccess', true, 'Modalités d\'ouverture', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'access']), 'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'access']),
'help' => 'Classes CSS de la division workshopAccessContainer, élément en ligne workshopAccess' 'help' => 'Classe CSS de la division : workshopAccessContainer, élément en ligne : workshopAccess'
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col6">
<?php echo template::checkbox('coursesConfigShowEnrolment', true, 'Modalités d\'inscription', [ <?php echo template::checkbox('coursesConfigShowEnrolment', true, 'Modalités d\'inscription', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'enrolment']), 'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'enrolment']),
'help' => 'Classe CSS de l\'élément en ligne : workshopEnrolment' 'help' => 'Classe CSS de l\'élément en ligne : workshopEnrolment'
]); ?> ]); ?>
</div> </div>
<div class="col6">
<?php echo template::checkbox('coursesConfigShowUnsuscribe', true, 'Désinscription', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'unsuscribe']),
'help' => 'Classe CSS de l\'élément en ligne : workshopUnsuscribe'
]); ?>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -4,7 +4,7 @@
<?php if ( <?php if (
$this->getData(['module', $this->getUrl(0), 'config', 'category']) !== 'all' && $this->getData(['module', $this->getUrl(0), 'config', 'category']) !== 'all' &&
$courseValue['category'] !== $this->getData(['module', $this->getUrl(0), 'config', 'category']) $courseValue['category'] !== $this->getData(['module', $this->getUrl(0), 'config', 'category'])
): ?> ): ?>
<?php continue; ?> <?php continue; ?>
<?php endif; ?> <?php endif; ?>
<?php if ($startRow === 0): ?> <?php if ($startRow === 0): ?>
@ -53,7 +53,7 @@
<div class="workshopAccessContainer"> <div class="workshopAccessContainer">
<p> <p>
<span class="workshopAccess"> <span class="workshopAccess">
<?php echo sprintf(helper::translate($module::$coursesAccess[$courseValue['access']]), helper::dateUTF8('%d %B %Y', $courseValue['openingDate']) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $courseValue['openingDate']) , helper::dateUTF8('%d %B %Y', $courseValue['closingDate']) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $courseValue['closingDate'])) ?> <?php echo sprintf(helper::translate($module::$coursesAccess[$courseValue['access']]), helper::dateUTF8('%d %B %Y', $courseValue['openingDate']) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $courseValue['openingDate']), helper::dateUTF8('%d %B %Y', $courseValue['closingDate']) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $courseValue['closingDate'])) ?>
</span> </span>
</p> </p>
</div> </div>
@ -92,7 +92,10 @@
</div> </div>
<div class="col6 textAlignRight"> <div class="col6 textAlignRight">
<!-- Lien désinscription--> <!-- Lien désinscription-->
<?php if ($this->getData(['enrolment', $courseId, $this->getUser('id')])): ?> <?php if (
$this->getData(['enrolment', $courseId, $this->getUser('id')])
&& $this->getData(['module', $this->getUrl(0), 'config', 'unsuscribe']) === true
): ?>
<span class="workshopUnsuscribe"> <span class="workshopUnsuscribe">
<a href="<?php echo helper::baseUrl(); ?>course/unsuscribe/<?php echo $courseId; ?>"> <a href="<?php echo helper::baseUrl(); ?>course/unsuscribe/<?php echo $courseId; ?>">
<?php echo $this->getData(['module', $this->getUrl(0), 'caption', 'unsuscribe']); ?> <?php echo $this->getData(['module', $this->getUrl(0), 'caption', 'unsuscribe']); ?>

View File

@ -15,8 +15,8 @@
class workshop extends common class workshop extends common
{ {
const VERSION = '1.0'; const VERSION = '1.01';
const REALNAME = 'Liste des contenus'; const REALNAME = 'Liste des espaces';
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json) const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
public static $actions = [ public static $actions = [
@ -49,7 +49,8 @@ class workshop extends common
'access' => true, 'access' => true,
'enrolment' => true, 'enrolment' => true,
'layout' => 6, 'layout' => 6,
'template' => true 'template' => true,
'unsuscribe' => false,
), ),
'caption' => array( 'caption' => array(
'accessopen' => 'Ouvert', 'accessopen' => 'Ouvert',
@ -88,6 +89,7 @@ class workshop extends common
'title' => $this->getInput('coursesConfigShowTitle', helper::FILTER_BOOLEAN), 'title' => $this->getInput('coursesConfigShowTitle', helper::FILTER_BOOLEAN),
'author' => $this->getInput('coursesConfigShowAuthor', helper::FILTER_BOOLEAN), 'author' => $this->getInput('coursesConfigShowAuthor', helper::FILTER_BOOLEAN),
'description' => $this->getInput('coursesConfigShowDescription', helper::FILTER_BOOLEAN), 'description' => $this->getInput('coursesConfigShowDescription', helper::FILTER_BOOLEAN),
'unsuscribe'=> $this->getInput('coursesConfigShowUnsuscribe', helper::FILTER_BOOLEAN),
'access' => $this->getInput('coursesConfigShowAccess', helper::FILTER_BOOLEAN), 'access' => $this->getInput('coursesConfigShowAccess', helper::FILTER_BOOLEAN),
'openingdate' => $this->getInput('coursesConfigShowOpeningDate', helper::FILTER_BOOLEAN), 'openingdate' => $this->getInput('coursesConfigShowOpeningDate', helper::FILTER_BOOLEAN),
'closingdate' => $this->getInput('coursesConfigShowClosingDate', helper::FILTER_BOOLEAN), 'closingdate' => $this->getInput('coursesConfigShowClosingDate', helper::FILTER_BOOLEAN),