<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- habilitation.v01.xsl contient tous les templates d'affichage des informations d'une habilitation de CDM-fr v2 -->

<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	exclude-result-prefixes="xsl xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:xhtml="http://www.w3.org/1999/xhtml">
	
    <!-- AJOUT ROT Template Habilitation -->
	<xsl:variable name="vNode" select="key('objet',$idP)" />

	<xsl:template name="tHabilitationHabiliID">
		<xsl:value-of select="$vNode/habilitation/habiliId"/>
	</xsl:template>
	
	<xsl:template name="tHabilitationLegalRef">
		<xsl:value-of select="$vNode/habilitation/legalRef[@blockLang=$_lang or not(@blockLang)]"/>
	</xsl:template>

	<xsl:template name="tHabilitationHabiliObject">
		<xsl:if test="$vNode/habilitation/habiliObject/refProgram">
			<ul>
				<xsl:apply-templates select="$vNode/habilitation/habiliObject/refProgram"/>
			</ul>
		</xsl:if>
	</xsl:template>

	<xsl:template name="tHabilitationDiplomaType">
		<xsl:value-of select="$vNode/habilitation/@diplomaType"/>
	</xsl:template>

	<xsl:template name="tHabilitationOrganization">
		<xsl:value-of select="$vNode/habilitation/@Organization"/>
	</xsl:template>

	<xsl:template name="tHabilitationFieldFieldNameFree">
		<xsl:value-of select="$vNode/habilitation/field/fieldName/free/text[@language=$_lang or not(@language)]"/>
	</xsl:template>

	<xsl:template name="tHabilitationFieldFieldPurpose">
		<xsl:value-of select="$vNode/habilitation/field/@fieldPurpose"/>
	</xsl:template>

	<xsl:template name="tHabilitationFieldFieldPrimaryDomainName">
		<xsl:value-of select="$vNode/habilitation/field/@primaryDomainName"/>
	</xsl:template>
	
	<xsl:template name="tHabilitationFieldFieldOtherDomainName">
		<xsl:value-of select="$vNode/habilitation/field/@otherDomainName"/>
	</xsl:template>

	<xsl:template name="tHabilitationFieldFieldFieldTimingInfoRenewalDateDate">
		<xsl:value-of select="$vNode/habilitation/field/fieldTimingInfo/renewalDateDate[@blockLang=$_lang or not(@blockLang)]/@date"/>
	</xsl:template>
	
	<xsl:template name="tHabilitationFieldSpeciality">
		<xsl:if test="$vNode/habilitation/field/speciality">
			<ul>
				<xsl:apply-templates select="$vNode/habilitation/field/speciality"/>
			</ul>
		</xsl:if>
	</xsl:template>
	
	<xsl:template match="speciality">
		<li><xsl:value-of select="specialityName/text[@language=$_lang or not(@language)]"/></li>
		<ul>
			<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libDateRenouvellement'"/></xsl:call-template>
			<xsl:value-of select="specialityTimingInfo/renewalDateDate[@blockLang=$_lang or not(@blockLang)]/@date"/></li>
			<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libDureeHabilitation'"/></xsl:call-template>
			<xsl:value-of select="specialityTimingInfo/@duration"/></li>
			<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libObjectif'"/></xsl:call-template>
			<xsl:value-of select="@specialityPurpose"/></li>
			<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libCohabilitation'"/></xsl:call-template>
			<xsl:apply-templates select="cohabilitation"/></li>
		</ul>
	</xsl:template>

	<xsl:template match="cohabilitation">
		<xsl:choose>
				<xsl:when test="exists='false'"><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libAucuneCohabilitation'"/></xsl:call-template></xsl:when>
				<xsl:when test="exists='true'">
					<ul>
						<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libCodeRNE'"/></xsl:call-template> <xsl:value-of select="listOfOrgUnit/@cohabilitationRole"/> : 
							<xsl:choose>
								<xsl:when test="count(listOfOrgUnit/refOrgUnit)>1">
									<ul>
										<xsl:for-each select="listOfOrgUnit/refOrgUnit">
											<li><xsl:value-of select="@ref"/></li>
										</xsl:for-each>
									</ul>
								</xsl:when>
								<xsl:otherwise>
									<xsl:value-of select="listOfOrgUnit/refOrgUnit/@ref"/>
									<!-- a tester <xsl:apply-templates match="listOfOrgUnit/refOrgUnit"/>-->
								</xsl:otherwise>
							</xsl:choose>
						</li>
					</ul>
				</xsl:when>
			</xsl:choose>
	</xsl:template>

	
	<xsl:template match="licProNatName">
		<h3><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libLicencePro'"/></xsl:call-template></h3>
		<p><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libDenomNationale'"/></xsl:call-template><xsl:value-of select="Name"/></p>
		<p><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libSecteurProf'"/></xsl:call-template><xsl:value-of select="sectAct"/></p>
	</xsl:template>
	
	<xsl:template match="contexteEtEnjeux">
		<h3><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libContexteEtEnjeux'"/></xsl:call-template></h3>
		<p><xsl:apply-templates select="contexteEtEnjeuxInfo"/></p>
		<p><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libSchema'"/></xsl:call-template><xsl:apply-templates select="webLink"/></p>
	</xsl:template>
	
	<xsl:template match="habiliRequest">
		<h3><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libHabiliRequest'"/></xsl:call-template></h3>
		<ul>
			<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libDateCreationFormation'"/></xsl:call-template><xsl:value-of select="habiliTiming/habiliCreatDate/@date"/></li>
			<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libDateRenouvellementFormation'"/></xsl:call-template><xsl:value-of select="habiliTiming/habiliRenewDate/@date"/></li>
			<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libDureeHabilitation'"/></xsl:call-template><xsl:value-of select="habiliTiming/habiliWishDuration"/></li>
			<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libTypeDemande'"/></xsl:call-template><xsl:value-of select="habiliReqType"/></li>
			<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libDateCA'"/></xsl:call-template><xsl:value-of select="habiliReqDates/dateCA/@date"/></li>
			<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libDateCEVU'"/></xsl:call-template><xsl:value-of select="habiliReqDates/dateCEVU/@date"/></li>
			<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libDateCS'"/></xsl:call-template><xsl:value-of select="habiliReqDates/dateCS/@date"/></li>
		</ul>
	</xsl:template>

	<xsl:template match="partnership">
		<h3><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libPartenariat'"/></xsl:call-template></h3>
		<ul>
			<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libDenomPrincipale'"/></xsl:call-template><xsl:value-of select="partnerName/text[@lang=$_lang]"/></li>
			<li><xsl:apply-templates select="partnershipInfo/infoBlock"/></li>
			<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libCodeRNE'"/></xsl:call-template><xsl:value-of select="refOrgUnit/@ref"/></li>
			<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libPolitiqueStage'"/></xsl:call-template><xsl:apply-templates select="training/trainingStrategy"/></li>
		</ul>
	</xsl:template>

	<xsl:template match="equivalence">
		<h3><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libEquivalence'"/></xsl:call-template></h3>
	</xsl:template>

	<xsl:template match="i13nProg">
		<h3><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libOrganisationEtudeEtranger'"/></xsl:call-template></h3>
		<ul>
			<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libNomProgramme'"/></xsl:call-template><xsl:value-of select="i13ProgName/text[@language=$_lang or not(@language)]"/></li>
			<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libModaliteBiDiplomation'"/></xsl:call-template><xsl:value-of select="i13ProgPartner/partnershipInfo/diploma[@agreement='bidiplomation']/description/text[@language=$_lang or not(@language)]"/></li>
			<li><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libInformation'"/></xsl:call-template><xsl:apply-templates select="i13ProgInfo"/></li>
		</ul>
	</xsl:template>
	
	<xsl:template match="relatedPrograms">
		<h3><xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libLiensAutresProg'"/></xsl:call-template></h3>
		<xsl:apply-templates select="relationInfo"/>
	</xsl:template>

    <!-- FIN AJOUT ROT Template Habilitation -->

</xsl:stylesheet>