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