Changeset 21

User picture

Author: alfred.sawatzky

(2011/07/21 01:05) 10 months ago

fix problem with incorrect "mandatory?" value for certain case fields in HTML report.

There are a few different ways that a 'mandatory' value can be defined.  See method case_field.mandatory? for details. It is possible that no sw_gis!case_field_mandatory? exists for a field type. In that case, if the field_type='physical', it is implied to be mandatory. If the sw_gis!case_field_mandatory? DOES exist, then we use the explicit value for mandatory.

Affected files

Updated mclib/trunk/modules/mclib_case_html_reporter/resources/base/templates/default/case_dump_field_details.xsl Download diff

2021
37
37
38
	<xsl:template name="show_mandatory">
38
	<xsl:template name="show_mandatory">
39
		<xsl:param name="id"/>
39
		<xsl:param name="id"/>
40
		<xsl:param name="field_type"/>
40
		<xsl:variable name="mandatory"
41
		<xsl:variable name="mandatory"
41
		              select="/mclib_xsl_report/featureMember[@typeName='sw_gis!case_field_mandatory?']/FeatureCollection[@typeName='sw_gis!case_field_mandatory?']/featureMember/Feature[@typeName='sw_gis!case_field_mandatory?' and @identifier=$id]/property[@typeName='mandatory?']"/>
42
			      select="/mclib_xsl_report/featureMember[@typeName='sw_gis!case_field_mandatory?']/FeatureCollection[@typeName='sw_gis!case_field_mandatory?']/featureMember/Feature[@typeName='sw_gis!case_field_mandatory?' and @identifier=$id]/property[@typeName='mandatory?']"/>
42
		<xsl:choose>
43
		<xsl:choose>
43
			<xsl:when test="string-length($mandatory)=0">False</xsl:when>
44
		    <!-- There are a few different ways that a 'mandatory' value can be defined. -->
44
			<xsl:otherwise>
45
		    <!-- See method case_field.mandatory? for details. -->
45
				<xsl:value-of select="$mandatory"/>
46
		    <!-- It is possible that no sw_gis!case_field_mandatory? exists for a field type. -->
46
			</xsl:otherwise>
47
		    <!-- In that case, if the field_type='physical', it is implied to be mandatory. -->
48
		    <!-- If the sw_gis!case_field_mandatory? DOES exist, then we use the explicit value for mandatory. -->
49
		    <xsl:when test="string-length($mandatory)=0 and $field_type='physical'">True</xsl:when>
50
		    <xsl:when test="string-length($mandatory)=0">False</xsl:when>
51
		    <xsl:otherwise>
52
			<xsl:value-of select="$mandatory"/>
53
		    </xsl:otherwise>
47
		</xsl:choose>
54
		</xsl:choose>
48
	</xsl:template>
55
	</xsl:template>
49
56

Updated mclib/trunk/modules/mclib_case_html_reporter/resources/base/templates/default/case_dump_object.xsl Download diff

2021
166
					</xsl:if>
166
					</xsl:if>
167
				</td>
167
				</td>
168
				<td>
168
				<td>
169
					<xsl:call-template name="show_mandatory"><xsl:with-param name="id">
169
					<xsl:call-template name="show_mandatory">
170
								<xsl:value-of select=".//swldy:relationshipProperty[@typeName='mandatory?_rec']/Feature[@typeName='sw_gis!case_field_mandatory?']/@identifier"/>
170
					    <xsl:with-param name="id">
171
							</xsl:with-param></xsl:call-template>
171
						<xsl:value-of select=".//swldy:relationshipProperty[@typeName='mandatory?_rec']/Feature[@typeName='sw_gis!case_field_mandatory?']/@identifier"/>
172
					    </xsl:with-param>
173
					    <xsl:with-param name="field_type">
174
						<xsl:value-of select=".//property[@typeName='type']"/>
175
					    </xsl:with-param>
176
					</xsl:call-template>
172
				</td>
177
				</td>
173
				<td><!-- default -->
178
				<td><!-- default -->
174
					<xsl:call-template name="show_default"><xsl:with-param name="id">
179
					<xsl:call-template name="show_default"><xsl:with-param name="id">