Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ protected void assertEqualsIgnoreCase(String message, String expected, String ac
}

public void assertUserCreated(String user) {
driver.waitFor(ExpectedConditions.titleContains("Nutzerdaten anzeigen:" + user));
driver.waitFor(ExpectedConditions.titleContains("Nutzerdaten anzeigen: " + user));
}

public void assertValidationErrorVisible() {
Expand Down
54 changes: 48 additions & 6 deletions mir-module/src/main/resources/xsl/metadata/mir-admindata-box.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
xmlns:mcrxsl="xalan://org.mycore.common.xml.MCRXMLFunctions"
exclude-result-prefixes="i18n mods xlink mcrxsl">
<xsl:import href="xslImport:modsmeta:metadata/mir-admindata-box.xsl"/>
<xsl:param name="WebApplicationBaseURL"/>

<xsl:template match="/">
<xsl:variable name="ID" select="/mycoreobject/@ID"/>
Expand All @@ -30,9 +31,10 @@
<xsl:with-param select="mycoreobject/service/servdates/servdate[@type='createdate']" name="nodes"/>
<xsl:with-param select="i18n:translate('metaData.createdAt')" name="label"/>
</xsl:call-template>
<xsl:call-template name="printMetaDate">
<xsl:with-param select="mycoreobject/service/servflags/servflag[@type='createdby']" name="nodes"/>
<xsl:with-param select="i18n:translate('mir.metaData.detailBox.by')" name="label"/>

<xsl:call-template name="print-user-info">
<xsl:with-param name="user" select="document(concat('notnull:user:', mycoreobject/service/servflags/servflag[@type='createdby']))"/>
<xsl:with-param name="label" select="i18n:translate('mir.metaData.detailBox.by')"/>
</xsl:call-template>
<xsl:for-each select="mycoreobject/metadata/def.modsContainer/modsContainer/mods:mods/mods:note">
<xsl:variable name="noteType">
Expand Down Expand Up @@ -65,9 +67,9 @@
<xsl:with-param select="mycoreobject/service/servdates/servdate[@type='modifydate']" name="nodes"/>
<xsl:with-param select="i18n:translate('metaData.lastChanged')" name="label"/>
</xsl:call-template>
<xsl:call-template name="printMetaDate">
<xsl:with-param select="mycoreobject/service/servflags/servflag[@type='modifiedby']" name="nodes"/>
<xsl:with-param select="i18n:translate('mir.metaData.detailBox.by')" name="label"/>
<xsl:call-template name="print-user-info">
<xsl:with-param name="user" select="document(concat('notnull:user:', mycoreobject/service/servflags/servflag[@type='modifiedby']))"/>
<xsl:with-param name="label" select="i18n:translate('mir.metaData.detailBox.by')"/>
</xsl:call-template>
<!--*** MyCoRe-ID and intern ID *************************** -->
<tr>
Expand Down Expand Up @@ -126,4 +128,44 @@
<xsl:apply-imports/>
</xsl:template>

<xsl:template name="print-user-info">
<xsl:param name="user"/>
<xsl:param name="label"/>

<xsl:variable name="display-name">
<xsl:choose>
<xsl:when test="$user/user/realName">
<xsl:value-of select="$user/user/realName"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$user/user/@name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<tr>
<td class="metaname">
<xsl:value-of select="concat($label, ':')"/>
</td>

<td class="metavalue">
<xsl:if test="$user/user/realName">
<xsl:attribute name="title">
<xsl:value-of select="concat($user/user/@name, '@', $user/user/@realm)"/>
</xsl:attribute>
</xsl:if>

<xsl:choose>
<xsl:when test="mcrxsl:isCurrentUserInRole('admin')">
<a href="{$WebApplicationBaseURL}servlets/MCRUserServlet?action=show&amp;id={$user/user/@name}">
<xsl:value-of select="$display-name"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$display-name"/>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
2 changes: 1 addition & 1 deletion mir-module/src/main/resources/xsl/modsdetails-external.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@
</li -->
</xsl:when>
<xsl:otherwise>
<li>
<li class="dropdown-item">
<xsl:value-of select="i18n:translate('object.locked')" />
</li>
</xsl:otherwise>
Expand Down
17 changes: 15 additions & 2 deletions mir-module/src/main/resources/xsl/user.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

<xsl:variable name="PageID" select="'show-user'" />

<xsl:variable name="PageTitle" select="concat(i18n:translate('component.user2.admin.userDisplay'),/user/@name)" />
<xsl:variable name="PageTitle">
<xsl:call-template name="user-display-name"/>
</xsl:variable>

<xsl:param name="step" />
<xsl:param name="MCR.ORCID.LinkURL" />
Expand Down Expand Up @@ -79,7 +81,7 @@
</div>
<div class="clearfix" />
<h2>
<xsl:value-of select="concat(i18n:translate('component.user2.admin.userDisplay'),@name)" />
<xsl:call-template name="user-display-name"/>
</h2>
<xsl:if test="$step = 'confirmDelete'">
<div class="section alert alert-danger">
Expand Down Expand Up @@ -429,4 +431,15 @@
</xsl:if>
</xsl:template>

<xsl:template name="user-display-name">
<xsl:choose>
<xsl:when test="/user/realName">
<xsl:value-of select="concat(i18n:translate('component.user2.admin.userDisplay'), ' ', /user/realName)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(i18n:translate('component.user2.admin.userDisplay'), ' ', /user/@name)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

</xsl:stylesheet>
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@
</xsl:template>
<xsl:template match="td[@class='metavalue']" mode="newMetadata" priority="2">
<dd>
<xsl:if test="@title">
<xsl:attribute name="title">
<xsl:value-of select="@title"/>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="node()|*"/>
</dd>
</xsl:template>
Expand Down
Loading