summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Model/ProjectAnalytic.php6
-rw-r--r--app/Template/file/screenshot.php2
2 files changed, 5 insertions, 3 deletions
diff --git a/app/Model/ProjectAnalytic.php b/app/Model/ProjectAnalytic.php
index 1ee8a405..8ac22626 100644
--- a/app/Model/ProjectAnalytic.php
+++ b/app/Model/ProjectAnalytic.php
@@ -119,8 +119,8 @@ class ProjectAnalytic extends Base
$stats['total_cycle_time'] += empty($task['date_started']) ? 0 : ($task['date_completed'] ?: time()) - $task['date_started'];
}
- $stats['avg_lead_time'] = (int) ($stats['total_lead_time'] / $stats['count']);
- $stats['avg_cycle_time'] = (int) ($stats['total_cycle_time'] / $stats['count']);
+ $stats['avg_lead_time'] = $stats['count'] > 0 ? (int) ($stats['total_lead_time'] / $stats['count']) : 0;
+ $stats['avg_cycle_time'] = $stats['count'] > 0 ? (int) ($stats['total_cycle_time'] / $stats['count']) : 0;
return $stats;
}
@@ -174,7 +174,7 @@ class ProjectAnalytic extends Base
// Calculate average for each column
foreach ($columns as $column_id => $column_title) {
- $stats[$column_id]['average'] = (int) ($stats[$column_id]['time_spent'] / $stats[$column_id]['count']);
+ $stats[$column_id]['average'] = $stats[$column_id]['count'] > 0 ? (int) ($stats[$column_id]['time_spent'] / $stats[$column_id]['count']) : 0;
}
return $stats;
diff --git a/app/Template/file/screenshot.php b/app/Template/file/screenshot.php
index 89d9324c..73b72eae 100644
--- a/app/Template/file/screenshot.php
+++ b/app/Template/file/screenshot.php
@@ -15,3 +15,5 @@
<?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
</div>
</form>
+
+<p class="alert alert-info"><?= t('This feature does not work with all browsers.') ?></p> \ No newline at end of file