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;
// Numéro de version
const ZWII_VERSION = '1.7.07';
const ZWII_VERSION = '1.7.08';
// URL autoupdate
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'); ?>
</h4>
<div class="row">
<div class="col12">
<div class="col6">
<?php echo template::checkbox('coursesConfigShowTitle', true, 'Titre', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'title']),
'help' => 'Classe CSS de l\'élément en ligne : workshopTitle'
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="col6">
<?php echo template::checkbox('coursesConfigShowAuthor', true, 'Signature de l\'auteur', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'author']),
'help' => 'Classe CSS de l\'élément en ligne : workshopTitle'
@ -42,28 +40,32 @@
</div>
</div>
<div class="row">
<div class="col12">
<div class="col6">
<?php echo template::checkbox('coursesConfigShowDescription', true, 'Description', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'description']),
'help' => 'Classe CSS de l\'élément en ligne : workshopDescription'
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<div class="col6">
<?php echo template::checkbox('coursesConfigShowAccess', true, 'Modalités d\'ouverture', [
'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 class="row">
<div class="col12">
<div class="col6">
<?php echo template::checkbox('coursesConfigShowEnrolment', true, 'Modalités d\'inscription', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'enrolment']),
'help' => 'Classe CSS de l\'élément en ligne : workshopEnrolment'
]); ?>
</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>

View File

@ -53,7 +53,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::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>
</p>
</div>
@ -92,7 +92,10 @@
</div>
<div class="col6 textAlignRight">
<!-- 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">
<a href="<?php echo helper::baseUrl(); ?>course/unsuscribe/<?php echo $courseId; ?>">
<?php echo $this->getData(['module', $this->getUrl(0), 'caption', 'unsuscribe']); ?>

View File

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