Skip to content

Commit

Permalink
fix(issue): handle survey expiration
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Mar 11, 2020
1 parent b9aa843 commit cb37daf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion inc/issue.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,15 @@ public function displaySimplified($options = []) {
$satisfaction = new TicketSatisfaction();
if ($satisfaction->getFromDB($options['id'])) {
// show survey form, if any
$satisfaction->showForm($item);
// @see Ticket::displayTabContentForItem()
$duration = Entity::getUsedConfig('inquest_duration', $item->fields['entities_id']);
$date2 = strtotime($satisfaction->fields['date_begin']);
if (($duration == 0)
|| (strtotime("now") - $date2) <= $duration*DAY_TIMESTAMP) {
$satisfaction->showForm($item);
} else {
echo "<p class='center b'>".__('Satisfaction survey expired')."</p>";
}
}

echo "<div class='timeline_box'>";
Expand Down

0 comments on commit cb37daf

Please sign in to comment.