CSV import: import time field if available

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2016-05-02 20:11:36 +03:00 committed by Dirk Hohndel
parent a83c674139
commit 7ec83ef02a
2 changed files with 16 additions and 3 deletions

View file

@ -4,6 +4,7 @@
<xsl:strip-space elements="*"/>
<xsl:param name="dateField" select="dateField"/>
<xsl:param name="datefmt" select="datefmt"/>
<xsl:param name="starttimeField" select="starttimeField"/>
<xsl:param name="timeField" select="timeField"/>
<xsl:param name="depthField" select="depthField"/>
<xsl:param name="tempField" select="tempField"/>
@ -87,7 +88,17 @@
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="time">
<xsl:value-of select="concat(substring($time, 2, 2), ':', substring($time, 4, 2))"/>
<xsl:choose>
<xsl:when test="$starttimeField >= 0">
<xsl:call-template name="getFieldByIndex">
<xsl:with-param name="index" select="$starttimeField"/>
<xsl:with-param name="line" select="substring-after(substring-after(., $lf), $lf)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(substring($time, 2, 2), ':', substring($time, 4, 2))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<!-- If the dive is CCR, create oxygen and diluent cylinders -->