Author: Derick Rethans (derickr)
Date: 2025-09-10T09:20:59+01:00
Commit:
https://github.com/php/web-wiki/commit/38b4aeab309be95224db2237b23b08a8f5d5ebba
Raw diff:
https://github.com/php/web-wiki/commit/38b4aeab309be95224db2237b23b08a8f5d5ebba.diff
Show vote closure time
Changed paths:
M dokuwiki/lib/plugins/doodle/lang/en/lang.php
M dokuwiki/lib/plugins/doodle/syntax.php
Diff:
diff --git a/dokuwiki/lib/plugins/doodle/lang/en/lang.php
b/dokuwiki/lib/plugins/doodle/lang/en/lang.php
index 39f2388e..e8505078 100644
--- a/dokuwiki/lib/plugins/doodle/lang/en/lang.php
+++ b/dokuwiki/lib/plugins/doodle/lang/en/lang.php
@@ -9,6 +9,7 @@
// info messages
$lang['poll_closed'] = 'This poll has been closed.';
+$lang['poll_close_time'] = 'This poll will close on %s.';
$lang['vote_saved'] = 'Vote has been saved.';
$lang['vote_deleted'] = 'Vote has been deleted.';
diff --git a/dokuwiki/lib/plugins/doodle/syntax.php
b/dokuwiki/lib/plugins/doodle/syntax.php
index 5843901d..c42702ed 100755
--- a/dokuwiki/lib/plugins/doodle/syntax.php
+++ b/dokuwiki/lib/plugins/doodle/syntax.php
@@ -137,11 +137,14 @@ function handle($match, $state, $pos, Doku_Handler
$handler) {
$params['voteType'] = $value;
}
} else
- if ((strcmp($name, "CLOSEON") == 0) &&
- (($timestamp = strtotime($value)) !== false) &&
- (time() > $timestamp) )
- {
- $params['closed'] = 1;
+ if (strcmp($name, "CLOSEON") == 0) {
+ if (($timestamp = strtotime($value)) !== false) {
+ $params['close_on_ts'] = $timestamp;
+
+ if (time() > $timestamp) {
+ $params['closed'] = 1;
+ }
+ }
} else
if (strcmp($name, "CLOSED") == 0) {
$params['closed'] = strcasecmp($value, "TRUE") == 0;
@@ -284,6 +287,8 @@ function render($mode, Doku_Renderer $renderer, $data) {
$this->template['formId'] = $formId;
if ($this->params['closed']) {
$this->template['msg'] = $this->getLang('poll_closed');
+ } else if ($this->params['close_on_ts']) {
+ $this->template['msg'] =
sprintf($this->getLang('poll_close_time'), date('Y-m-d H:i:s e',
$this->params['close_on_ts']));
}
for($col = 0; $col < count($this->choices); $col++) {