summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeva <deva>2009-02-12 14:37:14 +0000
committerdeva <deva>2009-02-12 14:37:14 +0000
commit8064990a976bdc65bc798ba6aab978533485eb2d (patch)
treefb768a7c45db84d078da666b8bb17af280e07796
parent01741251d16bfb23a99f315fd1970597938ae5ce (diff)
Made changes according to new formatlanguage attribute on metawidget.
-rw-r--r--server/xml/macros/B.2.1.3.xml9
-rw-r--r--server/xml/macros/B.2.3.xml12
2 files changed, 15 insertions, 6 deletions
diff --git a/server/xml/macros/B.2.1.3.xml b/server/xml/macros/B.2.1.3.xml
index b279bfe..9272594 100644
--- a/server/xml/macros/B.2.1.3.xml
+++ b/server/xml/macros/B.2.1.3.xml
@@ -14,6 +14,10 @@ ${current_eye_disease}</resume>
<queries>
</queries>
<maps>
+ <map name="now">
+ -- Set date to now if no other data available within last 24 hours.
+ return os.time(), os.time() - 24*60*60, 'system'
+ </map>
</maps>
<scripts>
</scripts>
@@ -24,11 +28,12 @@ ${current_eye_disease}</resume>
innerwidget="aktuelle_entry">
<metawidget name="aktuelle_entry" layout="hbox"
- format="${date} - På ${eye} øje er der observeret ${observeret}. Symptomerne er opstået ${when} og er efterfølgende ${then}">
+ formatlanguage="lua"
+ format="return os.date('%e. %b %Y', tonumber(getValue('date'))) .. ' - På ' .. getValue('eye')..' øje er der observeret '..getValue('observeret')..'. Symptomerne er opstået ' .. getValue('when')..' og er efterfølgende '..getValue('then')">
<frame layout="vbox">
<label caption="Dato:"/>
- <datetime name="date" fuzziness="3"/>
+ <datetime name="date" fuzziness="3" map="now"/>
<label caption=""/>
</frame>
diff --git a/server/xml/macros/B.2.3.xml b/server/xml/macros/B.2.3.xml
index 04f80ca..5895a5e 100644
--- a/server/xml/macros/B.2.3.xml
+++ b/server/xml/macros/B.2.3.xml
@@ -12,9 +12,13 @@
Tilføjede et datofelt.
-->
<macro name="B.2.3" version="1.0">
- <resume>I henhold til øjenafdelingens retningslinier dryppes der med:
-${ocgtt.preparation}
-Drypning er foretaget af: ${ocgtt.initials}, den ${ocgtt.date}</resume>
+ <resume language="lua">
+ out = 'I henhold til øjenafdelingens retningslinier dryppes der med:\n'
+ out = out .. getValue('ocgtt.preparation') .. '\n'
+ out = out .. 'Drypning er foretaget af: ' .. getValue('ocgtt.initials')
+ .. ', den ' .. os.date('%e. %b %Y %k:%M', tonumber(getValue('ocgtt.date')))
+ return out
+</resume>
<queries>
</queries>
<maps>
@@ -55,7 +59,7 @@ Drypning er foretaget af: ${ocgtt.initials}, den ${ocgtt.date}</resume>
<label width="200" caption="Drypning foretaget af (initialer):"/>
<lineedit name="ocgtt.initials" regexp="[a-zæøåA-ZÆØÅ]{2,5}" value=""/>
<label width="50" caption=" den "/>
- <datetime name="ocgtt.date" map="now" value=""/>
+ <datetime name="ocgtt.date" fuzziness="5" map="now" value=""/>
</frame>
<!-- Knapper -->