|
@@ -1,8 +1,33 @@
|
|
|
<?php
|
|
|
$currentValue = '';
|
|
|
+$previousValue = '';
|
|
|
+$previousChildReview = null;
|
|
|
if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id === $note->id) {
|
|
|
$parsedReview = json_decode($point->lastChildReview->data);
|
|
|
- $currentValue = $parsedReview->value;
|
|
|
+ if(@$parsedReview->value) {
|
|
|
+ $currentValue = $parsedReview->value;
|
|
|
+ $previousChildReview = \App\Models\Point::where('id', '<', $point->lastChildReview->id)
|
|
|
+ ->where('category', 'REVIEW')
|
|
|
+ ->where('parent_point_id', $point->id)
|
|
|
+ ->orderBy('id', 'DESC')
|
|
|
+ ->first();
|
|
|
+ if($previousChildReview && $previousChildReview->data) {
|
|
|
+ $parsedReview = json_decode($previousChildReview->data);
|
|
|
+ $previousValue = $parsedReview->value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+else {
|
|
|
+ $previousChildReview = \App\Models\Point::where('parent_point_id', $point->id)
|
|
|
+ ->where('category', 'REVIEW')
|
|
|
+ ->orderBy('id', 'DESC')
|
|
|
+ ->first();
|
|
|
+ if($previousChildReview && $previousChildReview->data) {
|
|
|
+ $parsedReview = json_decode($previousChildReview->data);
|
|
|
+ if(@$parsedReview->value) {
|
|
|
+ $previousValue = $parsedReview->value;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
?>
|
|
|
<div visit-moe relative class="d-inline">
|
|
@@ -14,6 +39,15 @@ if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id ==
|
|
|
|
|
|
<p class="mb-2"><b>Review</b></p>
|
|
|
|
|
|
+ <?php if($previousValue): ?>
|
|
|
+ <div class="mb-2">
|
|
|
+ <div class="d-flex align-items-baseline mb-1">
|
|
|
+ <span class="text-sm text-secondary">Previous Review / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
|
|
|
+ </div>
|
|
|
+ <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
|
|
|
+ </div>
|
|
|
+ <?php endif; ?>
|
|
|
+
|
|
|
<div class="mb-2">
|
|
|
<textarea data-name="value" class="form-control form-control-sm" rows="3"><?= $currentValue ?></textarea>
|
|
|
</div>
|