﻿<ViewDefinitions xmlns="http://www.windex.nl/schemas/viewdefinition/2007">
	<Views>
		<View Name="ProcessPage_IndividualDistributionView" HiddenColumnIds="0;6;7;8;9;10;11;12;13;14" ColumnWidths="auto;auto;auto;70px;60px" DefaultOrderColumn="1">
			<Columns>
				<XsltColumn HeaderText="Naam" OrderBy="DistributionListMember.Party.SortName" Ordinal="1">
					<Transform>
						<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
							<xsl:output method="html" indent="yes"/>
							<xsl:template match="/Row">
								<xsl:choose>
									<xsl:when test="contains(Column[@name='ObjectName']/., ';#')">
										<xsl:value-of select="substring-after(Column[@name='ObjectName']/., ';#')"/>
									</xsl:when>
									<xsl:otherwise>
										<xsl:value-of select="Column[@name='ObjectName']/."/>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:template>
						</xsl:stylesheet>
					</Transform>
				</XsltColumn>
				<XsltColumn HeaderText="Verzonden" OrderBy="Sent" Ordinal="4">
					<Transform>
						<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
							<xsl:output method="html" indent="yes"/>
							<xsl:template match="/Row">
								<xsl:choose>
									<xsl:when test="Column[@name='Sent']/. = ''">
										Nee
									</xsl:when>
									<xsl:otherwise>
										Ja
									</xsl:otherwise>
								</xsl:choose>
							</xsl:template>
						</xsl:stylesheet>
					</Transform>
				</XsltColumn>
				<XsltColumn HeaderText="Bericht" Ordinal="5">
					<Transform>
						<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
							<xsl:output method="html" indent="yes"/>
							<xsl:template match="/Row">
								<xsl:choose>
									<xsl:when test="Column[@name='PartyDocumentName']/. != ''">
										<xsl:choose>
											<xsl:when test="Column[@name='OrganizationDossierUrl']/. != ''">
												<!--Url opbouwen via organisatiedossier + /Verzending -->
												<xsl:variable name="dossierUrl">
													<xsl:value-of select="Column[@name='OrganizationDossierUrl']/."/>
												</xsl:variable>
												<xsl:variable name="documentName">
													<xsl:value-of select="Column[@name='PartyDocumentName']/."/>
												</xsl:variable>
												<a>
													<xsl:attribute name="href">
														<xsl:value-of select="concat($dossierUrl, '/Verzendingen/', $documentName)"/>
													</xsl:attribute>
													Klik hier
												</a>
											</xsl:when>
											<xsl:when test="Column[@name='PartyDossierUrl']/. != ''">
												<!--Url opbouwen via relatiedossier + /Verzending -->
												<xsl:variable name="dossierUrl">
													<xsl:value-of select="Column[@name='PartyDossierUrl']/."/>
												</xsl:variable>
												<xsl:variable name="documentName">
													<xsl:value-of select="Column[@name='PartyDocumentName']/."/>
												</xsl:variable>
												<a>
													<xsl:attribute name="href">
														<xsl:value-of select="concat($dossierUrl, '/Verzendingen/', $documentName)"/>
													</xsl:attribute>
													Klik hier
												</a>
											</xsl:when>
										</xsl:choose>
									</xsl:when>
									<xsl:otherwise>
										<!--Url opbouwen via onderwerpsdossier + map-->
										<xsl:variable name="dossierUrl">
											<xsl:value-of select="Column[@name='SubjectDossierUrl']/."/>
										</xsl:variable>
										<xsl:if test="$dossierUrl != ''">
											<xsl:variable name="folders">
												<xsl:value-of select="Column[@name='SubjectDossierFolders']/."/>
											</xsl:variable>
											<xsl:variable name="folderId">
												<xsl:value-of select="Column[@name='SubjectDossierFolderId']/."/>
											</xsl:variable>
											<xsl:variable name="documentName">
												<xsl:value-of select="Column[@name='SubjectDossierDocumentName']/."/>
											</xsl:variable>

											<xsl:variable name="relativePath">
												<xsl:value-of select="Column[@name='SubjectDossierFolders']//Folder[@Id=$folderId]/@Path"/>
											</xsl:variable>

											<xsl:variable name="determinedUrl">
												<xsl:choose>
													<xsl:when test="$relativePath != ''">
														<xsl:value-of select="concat($relativePath, '/', $documentName)"/>
													</xsl:when>
													<xsl:otherwise>
														<xsl:value-of select="concat($dossierUrl, '/', $documentName)"/>
													</xsl:otherwise>
												</xsl:choose>
											</xsl:variable>

											<a>
												<xsl:attribute name="href">
													<xsl:value-of select="$determinedUrl"/>
												</xsl:attribute>
												Klik hier
											</a>
										</xsl:if>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:template>
						</xsl:stylesheet>
					</Transform>
				</XsltColumn>
			</Columns>
		</View>
		<View Name="ProcessPage_IndividualDistributionForDistributionViewerView" HiddenColumnIds="0;4" ColumnWidths="auto;auto;auto;" DefaultOrderColumn="2" DefaultOrder="Descending">
			<Columns>
				<XsltColumn HeaderText="Verzender" Ordinal="3">
					<Transform>
						<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
							<xsl:output method="html" indent="yes"/>
							<xsl:template match="/Row">
								<xsl:choose>
									<xsl:when test="contains(Column[@name='Sender']/., ';#')">
										<xsl:value-of select="substring-after(Column[@name='Sender']/., ';#')"/>
									</xsl:when>
									<xsl:otherwise>
										<xsl:value-of select="Column[@name='Sender']/."/>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:template>
						</xsl:stylesheet>
					</Transform>
				</XsltColumn>
			</Columns>
		</View>
	</Views>
</ViewDefinitions>