Changes for page homeopathsSheet

Last modified by Jip-jan Alunkel on March 26, 17:31

From version 1.31
edited by Jip-jan Alunkel
on March 07, 22:27
Change comment: There is no comment for this version
To version 1.37
edited by Jip-jan Alunkel
on March 07, 23:17
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -32,16 +32,16 @@
32 32  <div id="${spaceTitle}" class="box sheet_properties">
33 33   <h2>Details</h2>
34 34  #set($classProperties = {
35 - 'practiceName': {'type': 'string'},
36 - 'pmStreet': {'type': 'string'},
37 - 'pmHousenumber': {'type': 'string'},
38 - 'pmPostcode': {'type': 'string'},
39 - 'pmCity': {'type': 'string'},
40 - 'pmCounty': {'type': 'string'},
41 - 'pmState': {'type': 'string'},
42 - 'pmCountry': {'type': 'string'},
43 - 'certification': {'type': 'bool'},
44 - 'certificationFrom': {'type': 'string'}
35 + 'practiceName': {'type': 'string', 'opener': 0},
36 + 'pmStreet': {'type': 'string', 'opener': 0},
37 + 'pmHousenumber': {'type': 'string', 'opener': 0},
38 + 'pmPostcode': {'type': 'string', 'opener': 0},
39 + 'pmCity': {'type': 'string', 'opener': 0},
40 + 'pmCounty': {'type': 'string', 'opener': 0},
41 + 'pmState': {'type': 'string', 'opener': 0},
42 + 'pmCountry': {'type': 'string', 'opener': 0},
43 + 'certification': {'type': 'bool', 'opener': 1},
44 + 'certificationFrom': {'type': 'string', 'opener': 0, 'parent': 'certification'}
45 45  })
46 46  #foreach($property in $classProperties.keySet())
47 47   #if($theDocObj.getProperty($property))
... ... @@ -74,25 +74,41 @@
74 74   "use_captcha": "false"
75 75   })
76 76   #set($thisObj = {})
77 + #set($children = {})
77 77   #foreach($item in $classProperties.keySet())
79 + #if($classProperties[item].parent)
80 + #set($discard = $children[$classProperties[item].parent].add($classProperties[item]))
81 + #end
82 + #end
83 +$children
84 + #foreach($item in $classProperties.keySet())
78 78   #set($label = $services.localization.render("homeopaths.classproperty.${item}"))
79 79   #if($theDocObj.getProperty($item))
80 80   #set($value = $theDocObj.getProperty($item).value)
81 - #else
82 - #set($value = "")
88 + #if($classProperties[$item].type == "bool")
89 + #set($newElem = {
90 + "id" : "$item",
91 + "type" : "checkbox",
92 + "required" : "false",
93 + "label" : "$label",
94 + "value" : "$value",
95 + "data-opener" : "true"
96 + })
97 + #else
98 +## #if($classProperties[$item].opener)
99 + #set($newElem = {
100 + "id": "$item",
101 + "type": "text",
102 + "required" : "false",
103 + "label" : "$label",
104 + "data-create-xobj" : "true",
105 + "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
106 + "data-xobj-fieldname" : "$item",
107 + "value": "$value"
108 + })
109 + #end
110 + #set($thisObj["$item"] = $newElem)
83 83   #end
84 - $classProperties[$item].type
85 - #set($newElem = {
86 - "id": "$item",
87 - "type": "text",
88 - "required" : "false",
89 - "label" : "$label",
90 - "data-create-xobj" : "true",
91 - "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
92 - "data-xobj-fieldname" : "$item",
93 - "value": "$value"
94 - })
95 - #set($thisObj["$item"] = $newElem)
96 96   #end
97 97   #set($practiceName = {
98 98   "id": "practiceName",