]> git.plutz.net Git - confetti/blobdiff - templates/therapy.html.sh
reduced latency, sticky note in therapy view
[confetti] / templates / therapy.html.sh
index 0b3bfbe2574298b5279bd7747d06a374b2cecb54..0c91487cee322764b670f06608a124cf98d7f1fe 100755 (executable)
@@ -79,7 +79,7 @@ cat <<EOF
  --><span class=signature><input type=checkbox name="${sid}_signature" value=pos $sigcheck><button type=submit name=${sid}_sigset value=$sig></button></span>
   </label>
   <div class=tab>
-    <input class="dotmark ov" type="image" name=dotmark value="$sid" src="/therapies/${id%.tpy}_${sid}.png" alt="">
+    <img class="dotmark ov" src="/therapies/${id%.tpy}_${sid}.png" alt="">
     $(n=1; while [ -n "${tpy[${sid}_note${n}]+x}" ]; do
       t_session_note $session_n $n
       n=$(($n+1))
@@ -103,10 +103,10 @@ therapy_sessions(){
 
 cat <<EOF
   <fieldset class="tab">
-    <span class=no>…</span><!--
+    <button class=no type=submit name=new_session value=$sid>+</button><!--
  --><input class=date name=${sid}_date value="" placeholder="$(l10n date)" /><!--
  --><input class=therapist name=${sid}_therapist value="" placeholder="$(l10n therapist)" /><!--
- --><button type=submit name=new_session value=$sid>+</button></span>
+ --><span class=signature><span></span>
     <input type=hidden name="${sid}_note1" value="">
   </fieldset>
 EOF
@@ -125,46 +125,65 @@ case "$tpy[color]" in
 esac
 
 cat <<EOF
-  <h1>Behandlungen</h1>
+<h1>$(l10n therapy)</h1>
 
-  <div class="patient">
-    <h2>$client_name</h2>
-    <a href="?p=prescriptions&amp;client=${id%%.*}.vcf">&lt; $(l10n prescriptionlist)</a>
-  </div>
+<div class="patient">
+  <h2>$client_name</h2>
+  <a href="?p=prescriptions&amp;client=${id%%.*}.vcf">&lt; $(l10n prescriptionlist)</a>
+</div>
 
-  <div class="prescription">
-    <h2>$(l10n therapy_prescription)</h2>
-    <span class="insurance">${mpx[insurance]}</span>
-    <span class="date">${mpx[date]}</span>
-    <label class="checkbox ${mpx[prescreviewed]:+checked}" for="prescreviewed">
-      $([ -n "${mpx[prescreviewed]}" ] && printf %s "$(l10n prescreviewed)" \
-                                       || printf %s "$(l10n prescreview)" )
-    </label>
-    <ul>
-      ${mpx[remidy]:+ <li>${mpx[quantity]}  ${mpx[remidy]}</li>}
-      ${mpx[remidy1]:+<li>${mpx[quantity1]} ${mpx[remidy1]}</li>}
-    </ul>
-
-    ${mpx[addcontrib]:+
-    <label class='checkbox ${mpx[contribconfirm]:+checked}' for="addcontrib">
-      $([ -n "${mpx[contribconfirm]}" ] && printf %s "$(l10n contribconfirm)" ${mpx[contribconfirm]} \
-                                        || printf %s "$(l10n addcontrib)" )
-    </label>
-    }
-  </div>
+<div class="prescription">
+  <h2>$(l10n therapy_prescription)</h2>
+  <span class="insurance">${mpx[insurance]}</span>
+  <span class="date"><label>$(l10n date):</label>${mpx[date]}</span>
+
+  <label class="checkbox ${mpx[prescreviewed]:+checked}" for="prescreviewed">
+    $([ -n "${mpx[prescreviewed]}" ] && printf %s "$(l10n prescreviewed)" \
+                                     || printf %s "$(l10n prescreview)" )
+  </label>
+
+       ${mpx[prescno]:+<span class="prescno">$(l10n presc${mpx[prescno]})</span>}
+  ${mpx[grouptherapy]:+<span class="catalogue">$(l10n grouptherapy)</span>}
+     ${mpx[housecall]:+<span class="catalogue">$(l10n housecall)</span>}
+        ${mpx[report]:+<span class="catalogue">$(l10n report)</span>}
+
+  <ul>
+    ${mpx[remidy]:+ <li>${mpx[quantity]}  ${mpx[remidy]}  ${mpx[quantity_weekly]:+($mpx[quantity_weekly] $(l10n weekly))}</li>}
+    ${mpx[remidy1]:+<li>${mpx[quantity1]} ${mpx[remidy1]} ${mpx[quantity_weekly1]:+($mpx[quantity_weekly1] $(l10n weekly))}</li>}
+  </ul>
+
+  ${mpx[indicator]:+<span class="indicator"><label>$(l10n indicator):</label>${mpx[indicator]}</span>}
+      ${mpx[icd10]:+<span class="icd10">    <label>$(l10n icd10):</label>${mpx[icd10]}</span>}
+
+  ${mpx[addcontrib]:+
+  <label class='checkbox ${mpx[contribconfirm]:+checked}' for="addcontrib">
+    $([ -n "${mpx[contribconfirm]}" ] && printf %s "$(l10n contribconfirm)" ${mpx[contribconfirm]} \
+                                      || printf %s "$(l10n addcontrib)" )
+  </label>
+  }
+</div>
 
 <form method="POST" action="?action=update_therapy">
   <input type="hidden" name="id" value="${id}">
 
+  <input class="stickynote" type="checkbox" name="c_stickynote" id="show_stickynote">
+  <fieldset class="stickynote">
+    <label for="show_stickynote">$(l10n notes)</label>
+    <textarea name="stickynote">${tpy[stickynote]}</textarea>
+    <button type=submit>$(l10n save)</button>
+  </fieldset>
+
   <label class="tab heading">
-    <span class=no>Nr.</span><!--
- --><span class=date>Datum</span><!--
- --><span class=therapist>Therapeut</span><!--
- --><span class=signature>Sig.</span>
+    <span class=no>$(l10n number)</span><!--
+ --><span class=date>$(l10n date)</span><!--
+ --><span class=therapist>$(l10n therapist)</span><!--
+ --><span class=signature>$(l10n signature)</span>
   </label>
+EOF
 
-  $(therapy_sessions)
+therapy_sessions
 
+cat <<EOF
   <fieldset class=color>
     <input class=color type=radio name=color onclick="javascript:setcol('#000')" value="#000" id=c000 $c0><label for=c000></label>
     <input class=color type=radio name=color onclick="javascript:setcol('#00A')" value="#00A" id=c001 $c1><label for=c001></label>
@@ -175,7 +194,7 @@ cat <<EOF
     <input class=color type=radio name=color onclick="javascript:setcol('#AA0')" value="#AA0" id=c110 $c6><label for=c110></label>
     <input class=color type=radio name=color onclick="javascript:setcol('#FFF')" value="#FFF" id=c111 $c7><label for=c111></label>
   </fieldset>
-  <img class="dotmark bg" src="?action=static_file&amp;name=therapy_background.png" alt="">
+  <img class="dotmark bg" src="?static=therapy_background.png" alt="WARNING: Background Image not available!">
   <canvas id="canvas" class="dotmark ov" width="${bg_dim%x*}" height="${bg_dim#*x}"></canvas>
 
   <input type=hidden id=image_serialize name=imagedata value="">
@@ -191,27 +210,27 @@ cat <<EOF
   data=document.getElementById("image_serialize")
 
   function setcol(c) {
-    image.fillStyle = c
-    image_serialize += " fill " + c
+    image.strokeStyle = c
+    if ( c == "#FFF" ) image.lineWidth = 32
+    else image.lineWidth = 4
+    image_serialize += " stroke " + c + " stroke-width " + image.lineWidth
   }
 
   setcol("$tpy[color]")
 
-  function circle(x, y) {
+  function draw(x, y) {
     if ( mouse == 1){
       if ( body.clientWidth >= 800 ){
         sx=Math.floor(cscaleW * (x - canvas.offsetLeft))
         sy=Math.floor(cscaleH * (y - canvas.offsetTop))
       } else { 
-        sx=Math.floor(cscaleW * (x - canvas.offsetLeft + body.scrollLeft))
-        sy=Math.floor(cscaleH * (y - canvas.offsetTop + body.scrollTop))
+        sx=Math.floor(cscaleW * (x - canvas.offsetLeft + window.pageXOffset))
+        sy=Math.floor(cscaleH * (y - canvas.offsetTop + window.pageYOffset))
       }
-      image.beginPath()
-      image.arc( sx, sy, 5, 0, 2 * Math.PI )
-      image.fill()
-      image.closePath()
+      image.lineTo( sx, sy )
+      image.stroke()
 
-      image_serialize += " circle " + sx + "," + sy + " " + (sx-5) + "," + sy
+      image_serialize += " " + sx + "," + sy
     }
   }
 
@@ -221,21 +240,24 @@ cat <<EOF
     cscaleW = canvas.width / canvas.clientWidth
     cscaleH = canvas.height / canvas.clientHeight
 
-    circle(x, y)
+    image_serialize += " polyline"
+    image.beginPath()
+    draw(x, y)
   }
   function drawstop() {
    mouse = 0
+   image.closePath()
    dbg.innerHTML = image_serialize
    data.value = image_serialize
   }
 
-  window.addEventListener( 'mouseup', function() { drawstop() } )
-  canvas.addEventListener( 'mousedown', function(e) { drawstart(e.clientX, e.clientY) } )
-  canvas.addEventListener( 'mousemove', function(e) { circle(e.clientX, e.clientY)    } )
+  window.addEventListener( 'mouseup',   function()   { drawstop() } )
+  canvas.addEventListener( 'mousedown', function(e)  { drawstart(e.clientX, e.clientY) } )
+  canvas.addEventListener( 'mousemove', function(e)  {      draw(e.clientX, e.clientY) } )
 
-  window.addEventListener( 'touchend', function() { drawstop() } )
+  window.addEventListener( 'touchend',   function()  { drawstop() } )
   canvas.addEventListener( 'touchstart', function(e) { drawstart(e.touches[0].clientX, e.touches[0].clientY) } )
-  canvas.addEventListener( 'touchmove', function(e) { circle(e.touches[0].clientX, e.touches[0].clientY)    } )
+  canvas.addEventListener( 'touchmove',  function(e) { e.preventDefault(); draw(e.touches[0].clientX, e.touches[0].clientY) } )
 
   --></script>
 </form>