|
5 | 5 | xmlns:mcrxsl="xalan://org.mycore.common.xml.MCRXMLFunctions"
|
6 | 6 | exclude-result-prefixes="i18n mods xlink mcrxsl">
|
7 | 7 | <xsl:import href="xslImport:modsmeta:metadata/mir-admindata-box.xsl"/>
|
| 8 | + <xsl:param name="WebApplicationBaseURL"/> |
8 | 9 |
|
9 | 10 | <xsl:template match="/">
|
10 | 11 | <xsl:variable name="ID" select="/mycoreobject/@ID"/>
|
|
30 | 31 | <xsl:with-param select="mycoreobject/service/servdates/servdate[@type='createdate']" name="nodes"/>
|
31 | 32 | <xsl:with-param select="i18n:translate('metaData.createdAt')" name="label"/>
|
32 | 33 | </xsl:call-template>
|
33 |
| - <xsl:call-template name="printMetaDate"> |
34 |
| - <xsl:with-param select="mycoreobject/service/servflags/servflag[@type='createdby']" name="nodes"/> |
35 |
| - <xsl:with-param select="i18n:translate('mir.metaData.detailBox.by')" name="label"/> |
| 34 | + |
| 35 | + <xsl:call-template name="print-user-info"> |
| 36 | + <xsl:with-param name="user" select="document(concat('notnull:user:', mycoreobject/service/servflags/servflag[@type='createdby']))"/> |
| 37 | + <xsl:with-param name="label" select="i18n:translate('mir.metaData.detailBox.by')"/> |
36 | 38 | </xsl:call-template>
|
37 | 39 | <xsl:for-each select="mycoreobject/metadata/def.modsContainer/modsContainer/mods:mods/mods:note">
|
38 | 40 | <xsl:variable name="noteType">
|
|
65 | 67 | <xsl:with-param select="mycoreobject/service/servdates/servdate[@type='modifydate']" name="nodes"/>
|
66 | 68 | <xsl:with-param select="i18n:translate('metaData.lastChanged')" name="label"/>
|
67 | 69 | </xsl:call-template>
|
68 |
| - <xsl:call-template name="printMetaDate"> |
69 |
| - <xsl:with-param select="mycoreobject/service/servflags/servflag[@type='modifiedby']" name="nodes"/> |
70 |
| - <xsl:with-param select="i18n:translate('mir.metaData.detailBox.by')" name="label"/> |
| 70 | + <xsl:call-template name="print-user-info"> |
| 71 | + <xsl:with-param name="user" select="document(concat('notnull:user:', mycoreobject/service/servflags/servflag[@type='modifiedby']))"/> |
| 72 | + <xsl:with-param name="label" select="i18n:translate('mir.metaData.detailBox.by')"/> |
71 | 73 | </xsl:call-template>
|
72 | 74 | <!--*** MyCoRe-ID and intern ID *************************** -->
|
73 | 75 | <tr>
|
|
126 | 128 | <xsl:apply-imports/>
|
127 | 129 | </xsl:template>
|
128 | 130 |
|
| 131 | + <xsl:template name="print-user-info"> |
| 132 | + <xsl:param name="user"/> |
| 133 | + <xsl:param name="label"/> |
| 134 | + |
| 135 | + <xsl:variable name="display-name"> |
| 136 | + <xsl:choose> |
| 137 | + <xsl:when test="$user/user/realName"> |
| 138 | + <xsl:value-of select="$user/user/realName"/> |
| 139 | + </xsl:when> |
| 140 | + <xsl:otherwise> |
| 141 | + <xsl:value-of select="$user/user/@name"/> |
| 142 | + </xsl:otherwise> |
| 143 | + </xsl:choose> |
| 144 | + </xsl:variable> |
| 145 | + |
| 146 | + <tr> |
| 147 | + <td class="metaname"> |
| 148 | + <xsl:value-of select="concat($label, ':')"/> |
| 149 | + </td> |
| 150 | + |
| 151 | + <td class="metavalue"> |
| 152 | + <xsl:if test="$user/user/realName"> |
| 153 | + <xsl:attribute name="title"> |
| 154 | + <xsl:value-of select="concat($user/user/@name, '@', $user/user/@realm)"/> |
| 155 | + </xsl:attribute> |
| 156 | + </xsl:if> |
| 157 | + |
| 158 | + <xsl:choose> |
| 159 | + <xsl:when test="mcrxsl:isCurrentUserInRole('admin')"> |
| 160 | + <a href="{$WebApplicationBaseURL}servlets/MCRUserServlet?action=show&id={$user/user/@name}"> |
| 161 | + <xsl:value-of select="$display-name"/> |
| 162 | + </a> |
| 163 | + </xsl:when> |
| 164 | + <xsl:otherwise> |
| 165 | + <xsl:value-of select="$display-name"/> |
| 166 | + </xsl:otherwise> |
| 167 | + </xsl:choose> |
| 168 | + </td> |
| 169 | + </tr> |
| 170 | + </xsl:template> |
129 | 171 | </xsl:stylesheet>
|
0 commit comments