fix: twig add-case

* fix display with admit and close dates
* convert referralType to use enum
* fix display for case level, referral source & 2, county
* remove case documents checkboxes
This commit is contained in:
Ryan Prather 2025-01-21 14:35:53 -05:00
parent 81838608b3
commit a47a5e8adb

View File

@ -30,14 +30,14 @@
<input type='text' name='{{ field_name(form.dcsCaseId) }}' id='case_form_dcsCaseId' class='form-control' required='required'/> <input type='text' name='{{ field_name(form.dcsCaseId) }}' id='case_form_dcsCaseId' class='form-control' required='required'/>
</div> </div>
<div class='input-group input-group-outline mb-3 is-filled'> <div class='input-group input-group-outline mb-3'>
<label for='case_form_admitDate' class='form-label'>Admit Date</label> <label for='case_form_admitDate'></label>
<input type='date' name='{{ field_name(form.admitDate) }}' id='case_form_admitDate' class='form-control'/> <input type='date' name='{{ field_name(form.admitDate) }}' id='case_form_admitDate' class='form-control' title='Admit Date'/>
</div> </div>
<div class='input-group input-group-outline mb-3 is-filled'> <div class='input-group input-group-outline mb-3'>
<label for='case_form_closeDate' class='form-label'>Close Date</label> <label for='case_form_closeDate'></label>
<input type='date' name='{{ field_name(form.closeDate) }}' id='case_form_closeDate' class='form-control'/> <input type='date' name='{{ field_name(form.closeDate) }}' id='case_form_closeDate' class='form-control' title='Close Date'/>
</div> </div>
<div class='input-group input-group-outline mb-3'> <div class='input-group input-group-outline mb-3'>
@ -46,24 +46,30 @@
</div> </div>
<div class='input-group input-group-outline mb-3'> <div class='input-group input-group-outline mb-3'>
<label for='case_form_referralType' class='form-label'>Referral Type</label> <label for='case_form_referralType'></label>
<input type='text' name='{{ field_name(form.referralType) }}' id='case_form_referralType' class='form-control'/> <select name='{{ field_name(form.referralType) }}' id='case_form_referralType' class='form-control' title='Referral Type'>
<option value=''>-- Referral Type --</option>
{% for r in enum('App\\Enums\\Case\\ReferralType').cases() %}
<option value='{{ r.name }}'>{{ r.name }}</option>
{% endfor %}
</select>
</div> </div>
<div class='input-group input-group-outline mb-3 is-filled'> <div class='input-group input-group-outline mb-3'>
<label for='case_form_level' class='form-label'>Level</label> <label for='case_form_level'></label>
<select name='{{ field_name(form.level) }}' id='case_form_level' class='form-control'> <select name='{{ field_name(form.level) }}' id='case_form_level' class='form-control' title='Case Level'>
<option value=''></option> <option value=''>-- Case Level --</option>
{% for l in enum('App\\Enums\\CaseLevel').cases() %} {% for l in enum('App\\Enums\\CaseLevel').cases() %}
<option value='{{ l.value }}'>{{ l.name|replace({'_': ' '})|lower|capitalize }}</option> <option value='{{ l.value }}'>{{ l.name|replace({'_': ' '})|lower|capitalize }}</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
<div class='input-group input-group-outline mb-3 is-filled'> <div class='input-group input-group-outline mb-3'>
<label for='case_form_referralSource' class='form-label'>Referral Source</label> <label for='case_form_referralSource'></label>
<select name='{{ field_name(form.referralSource) }}' id='case_form_referralSource' class='form-control'> <select name='{{ field_name(form.referralSource) }}' id='case_form_referralSource' class='form-control'>
<option value=''></option> <option value=''>-- Referral Source --</option>
{% for src in sources %} {% for src in sources %}
<option value='{{ src.id }}'>{{ src.name}}</option> <option value='{{ src.id }}'>{{ src.name}}</option>
@ -72,24 +78,15 @@
</div> </div>
<div class='input-group input-group-outline mb-3'> <div class='input-group input-group-outline mb-3'>
<label for='case_form_referralSources2' class='form-label'>2nd Referral Source</label> <label for='case_form_referralSources2'></label>
<select name='{{ field_name(form.referralSource2) }}' id='case_form_referralSources2' class='form-control'> <select name='{{ field_name(form.referralSource2) }}' id='case_form_referralSources2' class='form-control'>
<option value=''></option> <option value=''>-- 2nd Referral Source --</option>
{% for src in sources %} {% for src in sources %}
<option value='{{ src.id }}'>{{ src.name }}</option> <option value='{{ src.id }}'>{{ src.name }}</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
<div class='input-group input-group-outline mb-3'>
{% for d in docs %}
<span class='check'>
<input type='checkbox' name='{{ field_name(form.docs) }}[]' id='{{ d.title|replace({' ': '-'}) }}' value='{{ d.id }}'/>
<label for='{{ d.title|replace({' ': '-'}) }}'>{{ d.title }}</label>
</span>
{% endfor %}
</div>
</div> </div>
<div class='col'> <div class='col'>
<div class='input-group input-group-outline mb-3'> <div class='input-group input-group-outline mb-3'>
@ -127,12 +124,12 @@
<input type='text' name='{{ field_name(form.zip) }}' id='case_form_zip' class='form-control'/> <input type='text' name='{{ field_name(form.zip) }}' id='case_form_zip' class='form-control'/>
</div> </div>
<div class='input-group input-group-outline mb-3 is-filled'> <div class='input-group input-group-outline mb-3'>
<label for='case_form_county' class='form-label'>County</label> <label for='case_form_county'></label>
<select name='{{ field_name(form.county) }}' id='case_form_county' class='form-control'> <select name='{{ field_name(form.county) }}' id='case_form_county' class='form-control'>
<option value=''></option> <option value=''>-- County --</option>
{% for c in enum('App\\Enums\\County').cases() %} {% for c in enum('App\\Enums\\County').cases() %}
<option value='{{ c.value }}'>{{ c.name }}</option> <option value='{{ c.value }}'>{{ c.name|lower|capitalize }}</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>