Hele XSLT filen ser sådan ud nu:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="urn:my-scripts">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:apply-templates select="Users"/>
</xsl:template>
<xsl:template match="Users">
<xsl:choose>
<xsl:when test="@IsUserForm = 'False' and @IsSearchResult = 'False'">
<xsl:call-template name="searchUserForm"/>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="@IsSearchResult = 'True'">
<div class="searchResults">
<h1>Medarbejdere</h1>
<p>
<b>
Søgeresultat for "<xsl:value-of disable-output-escaping="yes" select="./FormData/userSearchString/HtmlSearchString"/>":
</b>
</p>
</div>
<div class="sResults">
<table width="100%" cellpadding="0" cellspacing="3" id="members">
<tr>
<th class="name">Navn</th>
<th class="title">Stilling</th>
<th class="phone">Telefon</th>
<th class="email">Email</th>
</tr>
<xsl:apply-templates select="User" mode="LoopUsers" />
</table>
<br/>
<xsl:apply-templates select="@Pages"/>
</div>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="@AllowEdit = 'True' and @Mode = 'Edit'">
<xsl:apply-templates select="User" mode="input"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="User" mode="text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="searchUserForm">
<h1>Medarbejdere</h1>
<p>Her kan du søge efter medarbejdere. Du kan begrænse din søgning til medarbejdere i en bestemt del af organisationen eller med en bestemt stillingsbetegnelse (eller begge)</p>
<div id="searchMedarbejder">
<form method="post" name="userSearchForm" action="" class="medarbejder">
Navn eller telefonummer (eller dele deraf)
<br/>
<input type="hidden" name="userSearchButton" value="Søg"/>
<input>
<xsl:attribute name="type">text</xsl:attribute>
<xsl:attribute name="name">userSearchString</xsl:attribute>
<xsl:attribute name="value"><xsl:value-of select="./FormData/userSearchString/SearchString"/></xsl:attribute>
<xsl:attribute name="onclick">this.value='';</xsl:attribute>
</input>
<input type="Submit" class="cImgButton2" value="Søg"/>
</form>
</div>
</xsl:template>
<xsl:template match="User" mode="LoopUsers">
<xsl:variable name="alphabet">
<letters>
<node>A</node>
<node>B</node>
<node>C</node>
<node>D</node>
<node>E</node>
<node>F</node>
<node>G</node>
<node>H</node>
<node>I</node>
<node>J</node>
<node>K</node>
<node>L</node>
<node>M</node>
<node>N</node>
<node>O</node>
<node>P</node>
<node>Q</node>
<node>R</node>
<node>S</node>
<node>T</node>
<node>U</node>
<node>V</node>
<node>W</node>
<node>X</node>
<node>Y</node>
<node>Z</node>
<node>Æ</node>
<node>Ø</node>
<node>Å</node>
</letters>
</xsl:variable>
<xsl:foreach select="$alphabet/letters">
<!-- Udskriv begyndelses bogstav hvis der findes nogen -->
<xsl:if test="substring(User//Fornavn, 1) = text()">
<!-- Test om der er nogle brugere med begyndelses bogstav fra $alphabet/node -->
<xsl:value-of select="."/>
</xsl:if>
<!-- List dem -->
<xsl:apply-templates select="User[substring(Fornavn,1) = .]" mode="result"/>
</xsl:foreach>
</xsl:template>
<xsl:template match="User" mode="result">
<!--<xsl:variable name="Firstname" select="Fornavn"/>
<xsl:variable name="FirstLetter" select="substring({$FirstName}, 1, 1)"/>-->
<!--<xsl:choose>
<xsl:when test="{$FirstLetter} == {$FirstLetter}">
<tr>
<th class="name">Navn</th>
<th class="title">Stilling</th>
<th class="phone">Telefon</th>
<th class="email">Email</th>
</tr>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>-->
<tr>
<td class="nameresult">
<a href="?userId={Id}">
<xsl:value-of select="Fornavn"/>
<xsl:text> </xsl:text>
<xsl:value-of select="Efternavn"/> (<xsl:value-of select="Kaldenavn"/>)
</a>
</td>
<td class="titleresult">
<xsl:value-of select="Stilling"/>
</td>
<td class="phoneresult">
<xsl:value-of select="Arbejdstelefon"/>
</td>
<td class="emailresult">
<a href="mailto:{Arbejdsemail}">
<xsl:value-of select="Arbejdsemail"/>
</a>
</td>
</tr>
</xsl:template>
<xsl:template match="User" mode="text">
<h1>Medarbejderprofil: <xsl:value-of select="Fornavn"/>
<xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
<xsl:value-of select="Efternavn"/>
</h1>
<table id="profile" cellpadding="0" cellspacing="3" borde="0">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="tdHeadlineBottomPad">Arbejdsinformation</td>
<td> </td>
</tr>
<tr>
<td class="subject">Kaldenavn:</td>
<td class="value">
<div class="personInfo">
<xsl:value-of select="Kaldenavn"/>
</div>
</td>
</tr>
<tr>
<td class="subject">Stilling: </td>
<td class="value">
<div class="personInfo">
<xsl:value-of select="Stilling"/>
</div>
</td>
</tr>
<tr>
<td class="subject">Afdeling: </td>
<td class="value">
<div class="personInfo">
<xsl:value-of select="Afdeling"/>
</div>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="subject">Funktioner: </td>
<td class="value">
<div class="personInfo">
<xsl:value-of select="Funktioner"/>
</div>
</td>
</tr>
<tr>
<td class="headingArea">Område: </td>
<td class="value">
<div class="personInfoArea">
<xsl:value-of select="Omraade"/>
</div>
</td>
</tr>
<tr>
<td class="subject">Adresse, arbejde: </td>
<td class="value">
<div class="personInfo">
<xsl:value-of select="Arbejdsadresse"/>
</div>
</td>
</tr>
<tr>
<td class="subject">Postnr. og by, arbejde: </td>
<td class="value">
<div class="personInfo">
<xsl:value-of select="Arbejdspostnr"/>
<xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
<xsl:value-of select="Arbejdsby"/>
</div>
</td>
</tr>
<tr>
<td class="subject">E-mail, arbejde: </td>
<td class="value">
<xsl:choose>
<xsl:when test="@EditMode='true'">
<input name="Email" value="{Arbejdsemail}" disabled="disabled" class="disabled"/>
</xsl:when>
<xsl:otherwise>
<div class="personInfo">
<a href="mailto:{Arbejdsemail}">
<xsl:value-of select="Arbejdsemail"/>
</a>
</div>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<tr>
<td class="subject">Telefon, arbejde:</td>
<td class="value">
<div class="personInfo">
<xsl:value-of select="Arbejdstelefon"/>
</div>
</td>
</tr>
<tr>
<td class="subject">Mobil, arbejde: </td>
<td class="value">
<div class="personInfo">
<xsl:value-of select="Arbejdsmobil"/>
</div>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="tdHeadlineBottomPad">Privat Information</td>
<td> </td>
</tr>
<tr>
<td class="subject">Adresse, privat: </td>
<td class="value">
<div class="personInfo">
<xsl:value-of select="Privatadresse"/>
</div>
</td>
</tr>
<tr>
<td class="subject">Postnr. og by, privat: </td>
<td class="value">
<div class="personInfo">
<xsl:value-of select="Privatpostnr"/>
<xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
<xsl:value-of select="Privatby"/>
</div>
</td>
</tr>
<tr>
<td class="subject">E-mail, privat: </td>
<td class="value">
<xsl:choose>
<xsl:when test="@EditMode='true'">
<input name="Email" value="{Privatemail}" disabled="disabled" class="disabled"/>
</xsl:when>
<xsl:otherwise>
<div class="personInfo">
<a href="mailto:{Privatemail}">
<xsl:value-of select="Privatemail"/>
</a>
</div>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<tr>
<td class="subject">Telefon, privat:</td>
<td class="value">
<div class="personInfo">
<xsl:value-of select="Privattelefon"/>
</div>
</td>
</tr>
<tr>
<td class="subject">Mobil, privat: </td>
<td class="value">
<div class="personInfo">
<xsl:value-of select="Privatmobil"/>
</div>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="tdHeadlineBottomPad">Interesser</td>
<td> </td>
</tr>
<tr>
<td class="headingArea">Bemærkninger: </td>
<td class="value">
<div class="personInfoArea">
<xsl:value-of select="Bemaerkninger"/>
</div>
</td>
</tr>
</table>
<xsl:if test="../@AllowEdit = 'True'">
<div class="editProfile">
<a href="?userId={Id}&formMode=edit">
<img src="/files/Design/Elements/editProfile.gif" alt="Rediger din profil" width="80" height="20"/>
</a>
</div>
</xsl:if>
<!-- <xsl:apply-templates select="Calendar"/> -->
</xsl:template>
<xsl:template match="User" mode="input">
<h1>Rediger medarbejderprofil</h1>
<div class="editProfileDiv">
<form method="post" name="userEditForm">
<input type="hidden" id="moduleId" name="moduleId" value="{/Users/@ModuleId}"/>
<input type="hidden" id="id" name="id" value="{Id}"/>
<table id="profile" cellpadding="4" cellspacing="0" border="0">
<tr>
<td class="subject">Fornavn:</td>
<td class="value">
<input name="" value="{Fornavn}" disabled="disabled" class="disabled"/>
</td>
</tr>
<tr>
<td class="subject">Efternavn:</td>
<td class="value">
<input name="" value="{Efternavn}" disabled="disabled" class="disabled"/>
</td>
</tr>
<tr>
<td class="subject">Kaldenavn:</td>
<td class="value">
<input name="" value="{Kaldenavn}" class="enabled"/>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="tdHeadline">Arbejdsinformation</td>
<td> </td>
</tr>
<tr>
<td class="subject">Stilling: </td>
<td class="value">
<input name="titel" value="{Titel}" disabled="disabled" class="disabled"/>
</td>
</tr>
<tr>
<td class="subject">Afdeling: </td>
<td class="value">
<input name="" value="{Afdeling}" disabled="disabled" class="disabled"/>
</td>
</tr>
<tr>
<td class="subject">Funktioner: </td>
<td class="value">
<input name="funktioner" value="{Funktioner}" class="enabled"/>
</td>
</tr>
<tr>
<td class="headingArea">Område: </td>
<td class="value">
<textarea name="omraade" rows="4" class="bordertextarea">
<xsl:value-of select="Omraade"/>
</textarea>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="tdHeadline">Privatinformation</td>
<td> </td>
</tr>
<tr>
<td class="subject">Adresse, arbejde: </td>
<td class="value">
<input name="" value="{Arbejdsadresse}" disabled="disabled" class="disabled"/>
</td>
</tr>
<tr>
<td class="subject">Postnr., arbejde: </td>
<td class="value">
<input name="" value="{Arbejdspostnr}" disabled="disabled" class="disabled"/>
</td>
</tr>
<tr>
<td class="subject">By, arbejde: </td>
<td class="value">
<input name="" value="{Arbejdsby}" disabled="disabled" class="disabled"/>
</td>
</tr>
<tr>
<td class="subject">E-mail, arbejde: </td>
<td class="value">
<input name="" value="{Arbejdsemail}" disabled="disabled" class="disabled"/>
</td>
</tr>
<tr>
<td class="subject">Telefon, arbejde:</td>
<td class="value">
<input name="" value="{Arbejdstelefon}" disabled="disabled" class="disabled"/>
</td>
</tr>
<tr>
<td class="subject">Mobil, arbejde:</td>
<td class="value">
<input name="" value="{Arbejdsmobil}" disabled="disabled" class="disabled"/>
</td>
</tr>
<tr>
<td class="subject">Adresse, privat: </td>
<td class="value">
<input name="privatadresse" value="{Privatadresse}" class="enabled"/>
</td>
</tr>
<tr>
<td class="subject">Postnr., privat: </td>
<td class="value">
<input name="privatpostnr" value="{Privatpostnr}" class="enabled"/>
</td>
</tr>
<tr>
<td class="subject">By, privat: </td>
<td class="value">
<input name="privatby" value="{Privatby}" class="enabled"/>
</td>
</tr>
<tr>
<td class="subject">E-mail, privat: </td>
<td class="value">
<input name="privatemail" value="{Privatemail}" class="enabled"/>
</td>
</tr>
<tr>
<td class="subject">Telefon, privat:</td>
<td class="value">
<input name="privattelefon" value="{Privattelefon}" class="enabled"/>
</td>
</tr>
<tr>
<td class="subject">Mobil, privat:</td>
<td class="value">
<input name="privatmobil" value="{Privatmobil}" class="enabled"/>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="tdHeadline">Interesser</td>
<td> </td>
</tr>
<tr>
<td class="headingArea">Bemærkninger: </td>
<td class="value">
<textarea name="bemaerkninger" rows="4" class="bordertextarea">
<xsl:value-of select="Bemaerkninger"/>
</textarea>
</td>
</tr>
<tr>
<td class="headingArea">Interessegrupper:</td>
<xsl:apply-templates select="Interestgroups"/>
</tr>
</table>
<div class="editProfile">
<input name="editUserButton" class="saveProfile" type="submit" value="Opdater"/>     <input type="reset" name="reset" value="Annuller"/>
</div>
</form>
</div>
</xsl:template>
<!-- USER VIEW BEGIN-->
<xsl:template match="Interestgroups">
<td class="value">
<xsl:apply-templates select="Group"/>
</td>
</xsl:template>
<xsl:template match="Group">
<input type="checkbox" class="checkbox" name="interessegrupper" value="{@Id}">
<xsl:if test="@Selected='true'">
<xsl:attribute name="checked">checked</xsl:attribute>
</xsl:if>
<label class="checkBox">
<xsl:value-of select="."/>
</label>
<br/>
</input>
</xsl:template>
<xsl:template match="Calendar">
<br/>
<h1>Kalender</h1>
<xsl:choose>
<xsl:when test="count(Item) = 0">
Der er ikke registreret møder eller aftaler for dagen i dag.
</xsl:when>
<xsl:otherwise>
<table cellspacing="1" border="0" id="calender">
<tr>
<th class="start">Tidspunkt</th>
<th class="subject">Emne</th>
<th class="place">Sted</th>
</tr>
<xsl:apply-templates select="Item"/>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="Item">
<xsl:if test="not(StartDate[@IsBeforeToday = 'True'] and StartTime = '00:00' and EndDate[@IsToday = 'True'] and EndTime = '00:00')">
<!-- Vis ikke, heldagsaftale i går som ikke skal vises idag -->
<tr>
<td class="start">
<xsl:choose>
<xsl:when test="StartDate[@IsBeforeToday = 'True'] and EndDate[@IsToday = 'True']">
Indtil <xsl:value-of select="EndTime"/>
</xsl:when>
<xsl:when test="EndDate[@IsAfterToday = 'True'] and StartDate[@IsBeforeToday = 'True']">
Hele dagen
</xsl:when>
<xsl:when test="StartTime = '00:00' and StartDate[@IsToday = 'True'] and EndTime = '00:00' and EndDate[@IsAfterToday = 'True']">
Hele dagen
</xsl:when>
<xsl:when test="EndDate[@IsAfterToday = 'True'] and StartDate[@IsToday = 'True']">
Fra <xsl:value-of select="StartTime"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="StartTime"/> - <xsl:value-of select="EndTime"/>
</xsl:otherwise>
<!--xsl:when test="StartDate[@IsBeforeToday = 'True'] and EndDate[@IsToday = 'True']">
Indtil <xsl:value-of select="EndTime"/>
</xsl:when>
<xsl:when test="EndDate[@IsAfterToday = 'True'] and StartDate[@IsToday = 'True']">
Fra <xsl:value-of select="StartTime"/>
</xsl:when>
<xsl:when test="EndDate[@IsAfterToday = 'True'] and StartDate[@IsBeforeToday = 'True']">
Hele dagen
</xsl:when>
<xsl:when test="StartTime = '00:00' and EndTime = '00:00'">
Hele dagen
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="StartTime"/> - <xsl:value-of select="EndTime"/>
</xsl:otherwise-->
</xsl:choose>
</td>
<xsl:choose>
<xsl:when test="Sensitivity='2'">
<td class="subject" colspan="2">Privat aftale</td>
</xsl:when>
<xsl:otherwise>
<td class="subject">
<xsl:value-of select="Subject"/>
</td>
<td class="place">
<xsl:value-of select="Location"/>
</td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:if>
</xsl:template>
<!-- USER VIEW END-->
<!--****************** Paging *****************-->
<msxsl:script language="C#" implements-prefix="user"><![CDATA[
public string addPaging(int curr,int max, string url, string search){
int i = 1;
string Output = "";
string Url = url;
string Search = search;
while (i <= max) {
if (i != curr)
{
Output += "<a href='" + Url + "?userSearchForm=go&pageNo=" + i + "&userSearchString=" + Search + "'>" + i + "</a> ";
}
else
{
Output += ("<b>" + i + "</b> ");
}
i++;
}
return Output;
}
]]></msxsl:script>
<xsl:template match="@Pages">
<div class="pageNavigation">
Side <xsl:value-of select="../@CurrentPage"/> af <xsl:value-of select="."/> (i alt <xsl:value-of select="../@Users"/> resultater)<br/>
<xsl:if test="../@Pages>1">
<xsl:value-of select="user:addPaging(../@CurrentPage,../@Pages,./RequestContent/ServerVariables/Entry[@Name='URL'],../FormData/userSearchString/UrlSearchString)" disable-output-escaping="yes"/>
</xsl:if>
<!--
Side <xsl:value-of select="../@CurrentPage" /> af <xsl:value-of select="." /><xsl:if test="../@Pages>1">: <xsl:value-of select="user:addPaging(../@CurrentPage,../@Pages,./RequestContent/ServerVariables/Entry[@Name='URL'],../FormData/userSearchString/UrlSearchString)" disable-output-escaping="yes" /></xsl:if>
-->
<br/>
<br/>
</div>
</xsl:template>
</xsl:stylesheet>