Skip to content

Commit cb37daf

Browse files
committed
fix(issue): handle survey expiration
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
1 parent b9aa843 commit cb37daf

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

inc/issue.class.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,15 @@ public function displaySimplified($options = []) {
234234
$satisfaction = new TicketSatisfaction();
235235
if ($satisfaction->getFromDB($options['id'])) {
236236
// show survey form, if any
237-
$satisfaction->showForm($item);
237+
// @see Ticket::displayTabContentForItem()
238+
$duration = Entity::getUsedConfig('inquest_duration', $item->fields['entities_id']);
239+
$date2 = strtotime($satisfaction->fields['date_begin']);
240+
if (($duration == 0)
241+
|| (strtotime("now") - $date2) <= $duration*DAY_TIMESTAMP) {
242+
$satisfaction->showForm($item);
243+
} else {
244+
echo "<p class='center b'>".__('Satisfaction survey expired')."</p>";
245+
}
238246
}
239247

240248
echo "<div class='timeline_box'>";

0 commit comments

Comments
 (0)