fix: DocumentController
move case documents to member documents first draft of signing
This commit is contained in:
@ -0,0 +1,59 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
{{ block('nav', 'internal/libs/nav.html.twig') }}
|
||||
|
||||
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
|
||||
{{ block('topnav', 'internal/libs/top-nav.html.twig') }}
|
||||
|
||||
<div class="container-fluid py-2">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card my-4">
|
||||
<div class="card-header p-0 position-relative mt-n4 mx-3 z-index-2">
|
||||
<div class="d-flex justify-content-between bg-gradient-dark shadow-dark border-radius-lg pt-4 pb-3 ps-3 p-2">
|
||||
<div>
|
||||
<h6 class="text-white text-capitalize ps-3">Assigned Case Documents</h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body px-0 pb-2">
|
||||
<div class="table-responsive p-0">
|
||||
<table class="table align-items-center mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Title</th>
|
||||
<th class='text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7'>Client Signed</th>
|
||||
<th class='text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7'>Case Worker Signed</th>
|
||||
<th class="text-secondary opacity-7"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for d in docs %}
|
||||
<tr>
|
||||
<td>{{ d.document.title }}</td>
|
||||
<td class='text-center'>{% if d.clientSigned %}{{ d.clientSigned|date('M j, Y H:i:s', company_timezone) }}{% endif %}</td>
|
||||
<td class='text-center'>{% if d.workerSigned %}{{ d.workerSigned|date('M j, Y H:i:s', company_timezone) }}{% endif %}</td>
|
||||
<td>
|
||||
<a href='{{ path('app_member_sign_case_doc', {memberId: d.client.id, docId: d.document.id}) }}' class='text-secondary' title='Edit Member'>
|
||||
<i class="material-symbols-rounded opacity-5">edit</i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
{% endblock %}
|
||||
|
||||
{% block page_js %}{% endblock %}
|
||||
|
||||
{% block page_css %}{% endblock %}
|
@ -0,0 +1,119 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container">
|
||||
<h1>Sign Member Document</h1>
|
||||
<h3>{{ doc.document.title }}</h3>
|
||||
<p>{{ doc.document.updated|date('M j, Y h:i:s a', company_timezone) }}</p>
|
||||
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
<div class='row'>
|
||||
{{ doc.document.renderHtml()|
|
||||
replace({'{{ doc.client.email }}': doc.client.email})|
|
||||
replace({'{{ doc.client.phone }}': doc.client.phone})|
|
||||
raw
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div class='row'>
|
||||
<div class='col'>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
{% if doc.document.inExtras(enum('App\\Enums\\DocumentExtras').CLIENT_NAME) %}
|
||||
<input type='text' name='clientName' id='clientName' value='{{ doc.client.name }}'/>
|
||||
{% endif %}
|
||||
|
||||
{% if doc.document.inExtras(enum('App\\Enums\\DocumentExtras').CLIENT_SIGNATURE) %}
|
||||
<button id='clearClientSignature'>Clear Signature</button><br />
|
||||
<canvas id='clientSignatureCanvas'></canvas>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if doc.document.inExtras(enum('App\\Enums\\DocumentExtras').PROVIDER_SIGNATURE) %}
|
||||
<div class='row'>
|
||||
<div class='col'>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
{% if doc.document.inExtras(enum('App\\Enums\\DocumentExtras').PROVIDER_NAME) %}
|
||||
<input type='text' name='providerName' id='providerName' value='{{ doc.caseWorker.name }}'/>
|
||||
{% endif %}
|
||||
|
||||
<button id='clearProviderSignature'>Clear Signature</button><br/>
|
||||
<canvas id='providerSignatureCanvas'></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<button type="submit" class="btn btn-primary">Complete</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block page_js %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/signature_pad@5.0.4/dist/signature_pad.umd.min.js"></script>
|
||||
<script type='text/javascript'>
|
||||
window.onload = initializeSignatureBlocks;
|
||||
var clientCanvas = document.getElementById('clientSignatureCanvas');
|
||||
var providerCanvas = document.getElementById('providerSignatureCanvas');
|
||||
var providerSaveSignature = JSON.parse('{{ caseWorkerSignature|raw }}');
|
||||
var clientPad = null;
|
||||
var providerPad = null
|
||||
function initializeSignatureBlocks() {
|
||||
if (providerCanvas) {
|
||||
createProviderSignatureBlock();
|
||||
}
|
||||
if (clientCanvas) {
|
||||
createClientSignatureBlock();
|
||||
}
|
||||
}
|
||||
function createProviderSignatureBlock() {
|
||||
providerPad = new SignaturePad(providerCanvas);
|
||||
const ratio = Math.max(window.devicePixelRatio || 1, 1);
|
||||
providerCanvas.width = providerCanvas.offsetWidth * ratio;
|
||||
providerCanvas.height = providerCanvas.offsetHeight * ratio;
|
||||
providerCanvas.getContext("2d").scale(ratio, ratio);
|
||||
if (providerSaveSignature) {providerPad.fromData(providerSaveSignature);}
|
||||
|
||||
document.getElementById('clearProviderSignature').addEventListener('click', clearProviderSignature);
|
||||
}
|
||||
function createClientSignatureBlock() {
|
||||
clientPad = new SignaturePad(clientCanvas);
|
||||
const ratio = Math.max(window.devicePixelRatio || 1, 1);
|
||||
clientCanvas.width = clientCanvas.offsetWidth * ratio;
|
||||
clientCanvas.height = clientCanvas.offsetHeight * ratio;
|
||||
clientCanvas.getContext("2d").scale(ratio, ratio);
|
||||
|
||||
document.getElementById('clearClientSignature').addEventListener('click', clearClientSignature);
|
||||
}
|
||||
|
||||
function clearClientSignature(e) {
|
||||
e.preventDefault();
|
||||
clientPad.clear();
|
||||
}
|
||||
|
||||
function clearProviderSignature(e) {
|
||||
e.preventDefault();
|
||||
providerPad.clear();
|
||||
}
|
||||
|
||||
function saveSignatureBlock() {
|
||||
document.getElementById('signature').value = JSON.stringify(pad.toData());
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block page_css %}
|
||||
<style rel='stylesheet'>
|
||||
#clientSignatureCanvas, #providerSignatureCanvas {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
background-color: white;
|
||||
border: solid 1px black;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
@ -76,7 +76,7 @@
|
||||
<a href='{{ path('app_case_edit_member', {caseId: case.id, memberId: member.id}) }}' class='text-secondary' title='Edit Member'>
|
||||
<i class="material-symbols-rounded opacity-5">edit</i>
|
||||
</a>
|
||||
<a href='{{ path('app_assign_case_documents', {caseId: case.id, memberId: member.id}) }}' class='text-secondary' title='Assign Case Document'>
|
||||
<a href='{{ path('app_display_case_doc', {memberId: member.id}) }}' class='text-secondary' title='Sign Case Document'>
|
||||
<i class='material-symbols-rounded opacity-5'>content_copy</i>
|
||||
</a>
|
||||
</td>
|
||||
|
Reference in New Issue
Block a user