issuer field on prescription document
[confetti] / templates / edit_prescription.sh
index dac7270..b7a9af4 100755 (executable)
@@ -135,7 +135,6 @@ $( for n in {0..10}; do
     "$(l10n quantity_weekly)" "${mpx[quantity_weekly$n]}"
 done )
 
-
 <br>
 <p class="indicator_codes">
 <label for="indicator">$(l10n indicator)</label>
@@ -149,6 +148,21 @@ done )
 <label for="indicator_reading">$(l10n indicator_reading)</label>
 <textarea id="indicator_reading" name="indicator_reading" placeholder="$(l10n indicator_reading)">${mpx[indicator_reading]}</textarea>
 </p>
+<br>
+<p class="issuer">
+  <label>$(l10n issuer)</label>
+  <input type="radio" name="issuer_select" value="list" id="issuer_select_list" checked /><label for="issuer_select_list">$(l10n issuer_from_list)</label><!--
+  --><input type="radio" name="issuer_select" value="other" id="issuer_other"><label for="issuer_other">$(l10n issuer_other)</label>
+  <select class="item" name="issuer">
+    <option value="" disabled="disabled" $([ -z "${mpx[issuer]}" ] && printf 'selected' )>$(l10n issuer)...</option>
+    $(list_prescription_issuers |while read f; do
+      [ "$f" = "$mpx[issuer]" ] \
+      && printf '<option value="%s" selected>%s</option>' "$f" "$f" \
+      || printf '<option value="%s">%s</option>' "$f" "$f"
+    done)
+  </select>
+  <input type="text" name="issuer_other" value="" placeholder="$(l10n issuer)..." />
+</p>
 </fieldset>
 
 <fieldset class="controls">