|
@@ -256,7 +256,7 @@ func (u Unit) IsActive() bool {
|
|
|
return u.isActive
|
|
|
}
|
|
|
|
|
|
-func (u *Unit) PrepareChildrenTree() *Unit {
|
|
|
+func (u *Unit) prepareChildrenTree(recursive bool) *Unit {
|
|
|
if u.childrenReady {
|
|
|
return u
|
|
|
}
|
|
@@ -272,7 +272,9 @@ func (u *Unit) PrepareChildrenTree() *Unit {
|
|
|
|
|
|
for idx, _ := range children {
|
|
|
child := &children[idx]
|
|
|
- child.PrepareChildrenTree()
|
|
|
+ if recursive {
|
|
|
+ child.PrepareChildrenTree()
|
|
|
+ }
|
|
|
|
|
|
u.children = append(u.children, child)
|
|
|
}
|
|
@@ -281,6 +283,13 @@ func (u *Unit) PrepareChildrenTree() *Unit {
|
|
|
|
|
|
return u
|
|
|
}
|
|
|
+func (u *Unit) PrepareChildrenTree() *Unit {
|
|
|
+ return u.prepareChildrenTree(true)
|
|
|
+}
|
|
|
+func (u *Unit) PrepareChildren() *Unit {
|
|
|
+ return u.prepareChildrenTree(false)
|
|
|
+}
|
|
|
+
|
|
|
func (units Units) PrepareChildrenTree() Units {
|
|
|
for idx, _ := range units {
|
|
|
units[idx].PrepareChildrenTree()
|
|
@@ -288,6 +297,13 @@ func (units Units) PrepareChildrenTree() Units {
|
|
|
|
|
|
return units
|
|
|
}
|
|
|
+func (units Units) PrepareChildren() Units {
|
|
|
+ for idx, _ := range units {
|
|
|
+ units[idx].PrepareChildren()
|
|
|
+ }
|
|
|
+
|
|
|
+ return units
|
|
|
+}
|
|
|
|
|
|
func GetUnitsHeadedBy(empGUID int) (units Units) {
|
|
|
var formulars Formulars
|