news : add publishoff

This commit is contained in:
Fred Tempez 2021-05-09 17:54:20 +02:00
parent 35efa6f16b
commit 293cf382c0
2 changed files with 10 additions and 2 deletions

View File

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

View File

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