Skip to content

Commit 439753e

Browse files
authored
Merge pull request majlis-erc#715 from majlis-erc/issue699b
Update relations lookup. majlis-erc#699
2 parents 9712716 + 291bec1 commit 439753e

1 file changed

Lines changed: 14 additions & 49 deletions

File tree

forms/formGenerator/generateXForm.xsl

Lines changed: 14 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,7 @@
12581258
<data xmlns=""><uri></uri></data>
12591259
</xf:instance>
12601260
<!-- Element binds specifically for min/max occurrence -->
1261-
<!-- Does not work due to the way elements are referenced in the form (not named) -->
1261+
<!-- Does not work due to the way elements are referenced in the form (not named)
12621262
<xsl:call-template name="elementBinds">
12631263
<xsl:with-param name="subform" select="$subform"/>
12641264
<xsl:with-param name="xpath" select="$elementPath"/>
@@ -1267,6 +1267,7 @@
12671267
<xsl:with-param name="maxLevel" select="$maxLevel"/>
12681268
<xsl:with-param name="schemaConstraints" select="$schemaConstraints"/>
12691269
</xsl:call-template>
1270+
-->
12701271
</xf:model>
12711272
</head>
12721273
<body>
@@ -2084,15 +2085,14 @@
20842085
<xf:setvalue ref="instance('i-availableElements')/*" value="''"/>
20852086
</xf:trigger>
20862087
</xf:group>
2087-
20882088
<xf:trigger appearance="minimal" ref=".[instance('i-{$subformName}-schemaConstraints')/*[local-name() = local-name(current())]/*:lookup[@form='{$subformName}' or @form=''][@formURL != ''][1]]" class="btn btn-outline-secondary btn-sm controls add showLookup">
2089-
<xf:label> <i class="bi bi-search"/> Lookup </xf:label>
2089+
<xf:label> <i class="bi bi-search"/> Lookup </xf:label>
20902090
<xf:action ev:event="DOMActivate">
20912091
<xf:toggle case="{$grpRepeatID}LookupUnHide" ev:event="DOMActivate"/>
20922092
<xf:load show="embed" targetid="{$grpRepeatID}subformLookup">
2093-
<xf:resource value="instance('i-{$subformName}-schemaConstraints')/*[local-name() = local-name(current())][1]/*:lookup[@form='{$subformName}'][@formURL != ''][1]/@formURL"/>
2093+
<xf:resource value="instance('i-{$subformName}-schemaConstraints')/*[local-name() = local-name(current())][1]/*:lookup[@form='{$subformName}' or @form=''][@formURL != ''][1]/@formURL"/>
20942094
</xf:load>
2095-
<xf:setvalue ref="instance('i-lookup-uri')//uri" value="instance('i-{$subformName}-schemaConstraints')/*[local-name() = local-name(current())][1]/*:lookup[@form='{$subformName}'][@formURL != ''][1]/@api"/>
2095+
<xf:setvalue ref="instance('i-lookup-uri')//uri" value="instance('i-{$subformName}-schemaConstraints')/*[local-name() = local-name(current())][1]/*:lookup[@form='{$subformName}' or @form=''][@formURL != ''][1]/@api"/>
20962096
</xf:action>
20972097
</xf:trigger>
20982098
<xf:trigger appearance="minimal" ref=".[instance('i-{$subformName}-schemaConstraints')/*[local-name() = local-name(current())][1]/*:popup[@formURL != '']]" class="btn btn-outline-secondary btn-sm controls add">
@@ -2230,13 +2230,13 @@
22302230
</xf:trigger>
22312231
</xf:group>
22322232
<xf:trigger appearance="minimal" ref=".[instance('i-{$subformName}-schemaConstraints')/*[local-name() = local-name(current())]/*:lookup[@form='{$subformName}' or @form=''][@formURL != '']]" class="btn btn-outline-secondary btn-sm controls add showLookup">
2233-
<xf:label> <i class="bi bi-search"/> Lookup </xf:label>
2233+
<xf:label> <i class="bi bi-search"/> Lookup </xf:label>
22342234
<xf:action ev:event="DOMActivate">
22352235
<xf:toggle case="{$repeatID}LookupUnHide" ev:event="DOMActivate"/>
22362236
<xf:load show="embed" targetid="{$repeatID}subformLookup">
2237-
<xf:resource value="instance('i-{$subformName}-schemaConstraints')/*[local-name() = local-name(current())]/*:lookup[@form='{$subformName}'][@formURL != '']/@formURL"/>
2237+
<xf:resource value="instance('i-{$subformName}-schemaConstraints')/*[local-name() = local-name(current())]/*:lookup[@form='{$subformName}' or @form=''][@formURL != '']/@formURL"/>
22382238
</xf:load>
2239-
<xf:setvalue ref="instance('i-lookup-uri')//uri" value="instance('i-{$subformName}-schemaConstraints')/*[local-name() = local-name(current())]/*:lookup[@form='{$subformName}'][@formURL != '']/@api"/>
2239+
<xf:setvalue ref="instance('i-lookup-uri')//uri" value="instance('i-{$subformName}-schemaConstraints')/*[local-name() = local-name(current())]/*:lookup[@form='{$subformName}' or @form=''][@formURL != '']/@api"/>
22402240
</xf:action>
22412241
</xf:trigger>
22422242
<xf:trigger appearance="minimal" ref=".[instance('i-{$subformName}-schemaConstraints')/*[local-name() = local-name(current())][1]/*:popup[@formURL != '']]" class="btn btn-outline-secondary btn-sm controls add">
@@ -2367,19 +2367,6 @@
23672367
<xf:label><i xmlns="http://www.w3.org/1999/xhtml" class="bi bi-x"/> <xf:output value="instance('i-{$subformName}-schemaConstraints')/*[local-name() = local-name(current()/parent::*)][1]//*:availableAtts/*:attDef[@ident = name(current())]/@attLabel"/></xf:label>
23682368
<xf:delete ev:event="DOMActivate" ref="."/>
23692369
</xf:trigger>
2370-
<!-- Do a lookup across all data types to insert into box -->
2371-
<!--
2372-
<xf:trigger appearance="minimal" ref=".[instance('i-{$subformName}-schemaConstraints')/*[local-name() = local-name(current())][1]/*:lookup]" class="btn btn-outline-secondary btn-sm controls add showLookup">
2373-
<xf:label> <i class="bi bi-search"/> Lookup </xf:label>
2374-
<xf:action ev:event="DOMActivate">
2375-
<xf:toggle case="{$repeatID}LookupUnHide" ev:event="DOMActivate"/>
2376-
<xf:load show="embed" targetid="{$repeatID}subformLookup">
2377-
<xf:resource value="instance('i-{$subformName}-schemaConstraints')/*[local-name() = local-name(current())][1]/*:lookup/@formURL"/>
2378-
</xf:load>
2379-
<xf:setvalue ref="instance('i-lookup-uri')//uri" value="instance('i-{$subformName}-schemaConstraints')/*[local-name() = local-name(current())][1]/*:lookup/@api"/>
2380-
</xf:action>
2381-
</xf:trigger>
2382-
-->
23832370
</div>
23842371
</div>
23852372
</xf:repeat>
@@ -2777,22 +2764,11 @@
27772764
<xsl:attribute name="formURL" select="concat('form.xq?form=forms/',$configDoc//formName/text(),'/lookup/',@formName,'.xhtml')"/>
27782765
</xsl:otherwise>
27792766
</xsl:choose>
2767+
<!--<xsl:attribute name="formURL" select="concat('form.xq?form=forms/',$configDoc//formName/text(),'/lookup/',@formName,'.xhtml')"/>-->
27802768
<xsl:attribute name="level" select="if(parent::*:subform) then 'subform' else 'toplevel'"/>
27812769
<xsl:attribute name="suppress" select="if(@suppress='true' or @supress='true' or parent::*:subform[@lookup='no']) then 'true' else 'false'"/>
27822770
<xsl:attribute name="form" select="if(parent::*:subform) then string(parent::*:subform/@formName) else ()"/>
27832771
</lookup>
2784-
<!--
2785-
<xsl:choose>
2786-
<xsl:when test="@suppress='true' or parent::*:subform[@lookup='no']"><lookup supress="true"/></xsl:when>
2787-
<xsl:otherwise>
2788-
<lookup>
2789-
<xsl:copy-of select="@*"/>
2790-
<xsl:attribute name="formURL" select="concat('form.xq?form=forms/',$configDoc//formName/text(),'/lookup/',tokenize(@formURL,'/')[last()])"/>
2791-
<xsl:attribute name="level" select="if(parent::*:subform) then 'subform' else 'toplevel'"/>
2792-
</lookup>
2793-
</xsl:otherwise>
2794-
</xsl:choose>
2795-
-->
27962772
</xsl:for-each>
27972773
</xsl:variable>
27982774
<xsl:choose>
@@ -2803,9 +2779,9 @@
28032779
<xsl:copy-of select="$lookupList/*[@level='toplevel']"></xsl:copy-of>
28042780
</xsl:otherwise>
28052781
</xsl:choose>
2806-
<xsl:variable name="popupList">
2807-
<xsl:for-each select="$configDoc/descendant::*:popup[@elementName = $elementName]">
2808-
<popup>
2782+
<xsl:variable name="popupList">
2783+
<xsl:for-each select="$configDoc/descendant::*:popup[@elementName = $elementName]">
2784+
<popup>
28092785
<xsl:copy-of select="@*"/>
28102786
<xsl:choose>
28112787
<xsl:when test="@suppress='true' or @supress='true' or parent::*:subform[@popup='no']"/>
@@ -2826,21 +2802,10 @@
28262802
<xsl:attribute name="suppress" select="if(@suppress='true' or @supress='true' or parent::*:subform[@popup='no']) then 'true' else 'false'"/>
28272803
<xsl:attribute name="form" select="$subformName"/>
28282804
-->
2829-
</popup>
2805+
</popup>
28302806
</xsl:for-each>
2831-
<!--
2807+
</xsl:variable>
28322808
<xsl:choose>
2833-
<xsl:when test="@suppress='true' or parent::*:subform[@lookup='no']"></xsl:when>
2834-
<xsl:otherwise>
2835-
<popup>
2836-
<xsl:copy-of select="@*"/>
2837-
<xsl:attribute name="formURL" select="concat('form.xq?form=forms/',$configDoc/descendant::*:popup[@elementName = $elementName]/@formName,'/index.xhtml')"/>
2838-
</popup>
2839-
</xsl:otherwise>
2840-
</xsl:choose>
2841-
-->
2842-
</xsl:variable>
2843-
<xsl:choose>
28442809
<xsl:when test="$popupList/*[@level='subform'][@form = $subformName]">
28452810
<xsl:copy-of select="$popupList/*[@level='subform']"></xsl:copy-of>
28462811
</xsl:when>

0 commit comments

Comments
 (0)