|
@@ -215,14 +215,14 @@ else {
|
|
|
|
|
|
<div class="d-flex align-items-center">
|
|
<div class="d-flex align-items-center">
|
|
<div visit-moe>
|
|
<div visit-moe>
|
|
- <form start show url="/api/visitPoint/upsertNoteSingleton" class="mcp-theme-1" id="<?= $segment->uid ?>-relevance-form">
|
|
|
|
|
|
+ <form start show url="/api/visitPoint/upsertNoteSingleton" class="d-none" id="<?= $segment->uid ?>-relevance-form">
|
|
<input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
|
|
<input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
|
|
<input type="hidden" name="category" value="GOALS_RELEVANT_TO_NOTE">
|
|
<input type="hidden" name="category" value="GOALS_RELEVANT_TO_NOTE">
|
|
<input type="hidden" name="data">
|
|
<input type="hidden" name="data">
|
|
<button submit class="btn btn-sm btn-info font-weight-bold">Save Relevance</button>
|
|
<button submit class="btn btn-sm btn-info font-weight-bold">Save Relevance</button>
|
|
</form>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
- <div visit-moe large class="ml-2 max-width-500px">
|
|
|
|
|
|
+ <div visit-moe large class="max-width-500px">
|
|
<a href="#" start show class="btn btn-sm btn btn-outline-primary">+ Add new goal, added during this visit</a>
|
|
<a href="#" start show class="btn btn-sm btn btn-outline-primary">+ Add new goal, added during this visit</a>
|
|
<form url="/api/visitPoint/addTopLevelDuringVisit" class="mcp-theme-1 max-width-500px min-width-500px">
|
|
<form url="/api/visitPoint/addTopLevelDuringVisit" class="mcp-theme-1 max-width-500px min-width-500px">
|
|
<input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
|
|
<input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
|
|
@@ -347,6 +347,10 @@ else {
|
|
uids = uids.filter(_x => _x !== uid);
|
|
uids = uids.filter(_x => _x !== uid);
|
|
}
|
|
}
|
|
$('#<?= $segment->uid ?>-relevance-form').find('[name="data"]').val(JSON.stringify(uids));
|
|
$('#<?= $segment->uid ?>-relevance-form').find('[name="data"]').val(JSON.stringify(uids));
|
|
|
|
+
|
|
|
|
+ // auto save
|
|
|
|
+ $('#<?= $segment->uid ?>-relevance-form [submit]').trigger('click');
|
|
|
|
+
|
|
return false;
|
|
return false;
|
|
});
|
|
});
|
|
|
|
|
|
@@ -357,6 +361,11 @@ else {
|
|
$(this).closest('form').find('.help-text[data-category="' + this.value + '"]').removeClass('d-none');
|
|
$(this).closest('form').find('.help-text[data-category="' + this.value + '"]').removeClass('d-none');
|
|
});
|
|
});
|
|
|
|
|
|
- parentSegment.find('.chk-relevance').trigger('change');
|
|
|
|
|
|
+ // pre-fill relevance data
|
|
|
|
+ let uids = [];
|
|
|
|
+ $('[data-segment-template-name="<?= $segment->segmentTemplate->internal_name ?>"] .chk-relevance:checked').each(function() {
|
|
|
|
+ uids.push($(this).attr('data-uid'));
|
|
|
|
+ });
|
|
|
|
+ $('#<?= $segment->uid ?>-relevance-form').find('[name="data"]').val(JSON.stringify(uids));
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|