News update

This commit is contained in:
Fred Tempez 2021-05-09 18:19:43 +02:00
parent 15009b3503
commit 54c472675c
3 changed files with 11 additions and 3 deletions

View File

@ -139,6 +139,7 @@ class news extends common {
$this->setData(['module', $this->getUrl(0),'posts', $newsId, [ $this->setData(['module', $this->getUrl(0),'posts', $newsId, [
'content' => $this->getInput('newsAddContent', null), 'content' => $this->getInput('newsAddContent', null),
'publishedOn' => $this->getInput('newsAddPublishedOn', helper::FILTER_DATETIME, true), 'publishedOn' => $this->getInput('newsAddPublishedOn', helper::FILTER_DATETIME, true),
'publishedOff' => $this->getInput('newsAddPublishedOff', helper::FILTER_DATETIME),
'state' => $this->getInput('newsAddState', helper::FILTER_BOOLEAN), 'state' => $this->getInput('newsAddState', helper::FILTER_BOOLEAN),
'title' => $this->getInput('newsAddTitle', helper::FILTER_STRING_SHORT, true), 'title' => $this->getInput('newsAddTitle', helper::FILTER_STRING_SHORT, true),
'userId' => $this->getInput('newsAddUserId', helper::FILTER_ID, true) 'userId' => $this->getInput('newsAddUserId', helper::FILTER_ID, true)

View File

@ -41,19 +41,26 @@
<div class="block"> <div class="block">
<h4>Options de publication</h4> <h4>Options de publication</h4>
<div class="row"> <div class="row">
<div class="col6"> <div class="col4">
<?php echo template::select('newsAddUserId', $module::$users, [ <?php echo template::select('newsAddUserId', $module::$users, [
'label' => 'Auteur', 'label' => 'Auteur',
'selected' => $this->getUser('id') 'selected' => $this->getUser('id')
]); ?> ]); ?>
</div> </div>
<div class="col6"> <div class="col4">
<?php echo template::date('newsAddPublishedOn', [ <?php echo template::date('newsAddPublishedOn', [
'help' => 'La news est consultable à partir du moment ou la date de publication est passée.', 'help' => 'La news est consultable à partir du moment ou la date de publication est passée.',
'label' => 'Date de publication', 'label' => 'Date de publication',
'value' => time() 'value' => time()
]); ?> ]); ?>
</div> </div>
<div class="col4">
<?php echo template::date('newsAddPublishedOff', [
'help' => 'La news est consultable Jusqu\'à cette date si elle est spécifiée. Pour annuler la date de déplublication, sélectionnez une date antérieure à la publication.',
'label' => 'Date de dépublication',
'value' => $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2), 'publishedOff'])
]); ?>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -58,7 +58,7 @@
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::date('newsEditPublishedOff', [ <?php echo template::date('newsEditPublishedOff', [
'help' => 'La news est consultable Jusqu\'à cette date si elle est spécifiée.', 'help' => 'La news est consultable Jusqu\'à cette date si elle est spécifiée. Pour annuler la date de déplublication, sélectionnez une date antérieure à la publication.',
'label' => 'Date de dépublication', 'label' => 'Date de dépublication',
'value' => $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2), 'publishedOff']) 'value' => $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2), 'publishedOff'])
]); ?> ]); ?>