OVH Cloud OVH Cloud

[WSS] : Affichage de liens en fonction du login

5 réponses
Avatar
Nicolas PIEROT
Bonjour,

J'ai créer un bandeau de liens dans un tableau.

Il y a 4 liens de type url.

En fonctionne du login j'aimerais afficher ou pas les liens.

Par contre, je ne peux pas mettre des personnes dans des groupes.
Les logins seront du type :

cltutilisateur : pour les clients.
utilisateur : pour les employes de l'entreprise.

Je souhaite ne pas afficher le lien si le login commence par clt, sinon on
affiche.

Dois-je faire une webpart ?
Ou alors, utiliser une webpart type dataview ?

Merci de votre aide.
--
Nicolas.

MCP 70-229
http://nicolasp-ms.blogspot.com/

5 réponses

Avatar
AnthonyB
Effectivement sous WSS, cette fonctionnalité nécessite d'utiliser une webpart
ou développer sa propre WebPart.

Regardez du côté de notre ami Renaud avec sa Webpart exploitant les feuilles
de style.
On peut faire des merveilles avec ;-)

Petite remarque au passage :
Sous SPS 2003 en revanche les audiences permettent de réaliser cela
nativement ;-)

AnthonyB

"Nicolas PIEROT" a écrit :

Bonjour,

J'ai créer un bandeau de liens dans un tableau.

Il y a 4 liens de type url.

En fonctionne du login j'aimerais afficher ou pas les liens.

Par contre, je ne peux pas mettre des personnes dans des groupes.
Les logins seront du type :

cltutilisateur : pour les clients.
utilisateur : pour les employes de l'entreprise.

Je souhaite ne pas afficher le lien si le login commence par clt, sinon on
affiche.

Dois-je faire une webpart ?
Ou alors, utiliser une webpart type dataview ?

Merci de votre aide.
--
Nicolas.

MCP 70-229
http://nicolasp-ms.blogspot.com/


Avatar
Nicolas PIEROT
J'ai trouve,

J'utilise le webpart dataview/annonce.

Je fais comme un post precedent à part que j'utilise not(start-with;"clt")

Bonne journée.
--
Nicolas.

MCP 70-229
http://nicolasp-ms.blogspot.com/


"Nicolas PIEROT" a écrit :

Bonjour,

J'ai créer un bandeau de liens dans un tableau.

Il y a 4 liens de type url.

En fonctionne du login j'aimerais afficher ou pas les liens.

Par contre, je ne peux pas mettre des personnes dans des groupes.
Les logins seront du type :

cltutilisateur : pour les clients.
utilisateur : pour les employes de l'entreprise.

Je souhaite ne pas afficher le lien si le login commence par clt, sinon on
affiche.

Dois-je faire une webpart ?
Ou alors, utiliser une webpart type dataview ?

Merci de votre aide.
--
Nicolas.

MCP 70-229
http://nicolasp-ms.blogspot.com/


Avatar
AnthonyB
Effectivement, le XSLT permet pas mal de choses sympas aussi ;-)
AnthonyB

"Nicolas PIEROT" a écrit :

J'ai trouve,

J'utilise le webpart dataview/annonce.

Je fais comme un post precedent à part que j'utilise not(start-with;"clt")

Bonne journée.
--
Nicolas.

MCP 70-229
http://nicolasp-ms.blogspot.com/


"Nicolas PIEROT" a écrit :

> Bonjour,
>
> J'ai créer un bandeau de liens dans un tableau.
>
> Il y a 4 liens de type url.
>
> En fonctionne du login j'aimerais afficher ou pas les liens.
>
> Par contre, je ne peux pas mettre des personnes dans des groupes.
> Les logins seront du type :
>
> cltutilisateur : pour les clients.
> utilisateur : pour les employes de l'entreprise.
>
> Je souhaite ne pas afficher le lien si le login commence par clt, sinon on
> affiche.
>
> Dois-je faire une webpart ?
> Ou alors, utiliser une webpart type dataview ?
>
> Merci de votre aide.
> --
> Nicolas.
>
> MCP 70-229
> http://nicolasp-ms.blogspot.com/


Avatar
Nicolas PIEROT
Bonjour,

Peut-on simplifier ce code de webpart xslt ? Merci.

<WebPartPages:DataViewWebPart webpart="true" runat="server"
__WebPartId="{82A75227-6667-41E0-A9A5-F5B9EEC43238}">
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2"
xmlns:dvwp="http://schemas.microsoft.com/WebPart/v2/DataView">
<dvwp:XSL><![CDATA[
<xsl:stylesheet
xmlns:x="http://www.w3.org/2001/XMLSchema"
xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0"
exclude-result-prefixes="xsl ddwrt msxsl"
xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:output
method="html" indent="no"/>
<xsl:param
name="dvt_adhocmode"></xsl:param>
<xsl:param
name="dvt_adhocfiltermode">xsl</xsl:param>
<xsl:param
name="dvt_fieldsort"></xsl:param>
<xsl:param
name="dvt_sortfield"></xsl:param>
<xsl:param
name="dvt_groupfield"></xsl:param>
<xsl:param
name="dvt_groupdisplay"></xsl:param>
<xsl:param
name="dvt_sortdir"></xsl:param>
<xsl:param
name="dvt_groupdir"></xsl:param>
<xsl:param
name="dvt_grouptype"></xsl:param>
<xsl:param
name="dvt_sorttype">text</xsl:param>
<xsl:param
name="dvt_groupsorttype">text</xsl:param>
<xsl:param
name="dvt_filterfield"></xsl:param>
<xsl:param
name="dvt_filterval"></xsl:param>
<xsl:param
name="dvt_filtertype"></xsl:param>
<xsl:param
name="dvt_firstrow">1</xsl:param>
<xsl:param
name="dvt_nextpagedata"></xsl:param>
<xsl:param
name="dvt_apos">'</xsl:param>
<xsl:param
name="filterParam"></xsl:param>
<xsl:param name="UserID"/>
<xsl:template match="/"
xmlns:x="http://www.w3.org/2001/XMLSchema"
xmlns:d="http://schemas.microsoft.com/sharepoint/dsp">
<xsl:call-template
name="dvt_1"/>
</xsl:template>
<xsl:template
name="dvt_1">
<xsl:variable
name="StyleName">Table</xsl:variable>
<xsl:variable
name="Rows" select="/dsQueryResponse/Rows/Row"/>
<xsl:variable
name="RowCount" select="count($Rows)"/>
<xsl:variable
name="IsEmpty" select="$RowCount = 0"/>
<xsl:choose>
<xsl:when
test="$IsEmpty">

<xsl:call-template name="dvt_1.empty"/>
</xsl:when>
<xsl:otherwise>
<table
border="0" width="100%" cellpadding="2" cellspacing="0">
<tr
valign="top">
<th
class="ms-vh" nowrap="true">Titre</th>
<th
class="ms-vh" nowrap="true">Modifié par</th>
<th
class="ms-vh" nowrap="true">Modifié</th>
</tr>

<xsl:call-template name="dvt_1.body">

<xsl:with-param name="Rows" select="$Rows"/>

<xsl:with-param name="FirstRow" select="1"/>

<xsl:with-param name="LastRow" select="$RowCount"/>

</xsl:call-template>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template
name="dvt_1.body">
<xsl:param
name="Rows"/>
<xsl:param
name="FirstRow"/>
<xsl:param
name="LastRow"/>
<xsl:for-each
select="$Rows">
<xsl:variable
name="KeepItemsTogether" select="false()"/>
<xsl:variable
name="HideGroupDetail" select="false()"/>
<xsl:variable
name="GroupStyle" select="'auto'"/>
<xsl:if
test="(position() >= $FirstRow and position() <= $LastRow) or
$KeepItemsTogether">
<xsl:if
test="not($HideGroupDetail)" ddwrt:cf_ignore="1">
<tr
style="display:{$GroupStyle}">
<td
class="ms-vb">
<xsl:value-of select="@Title"/>
</td>

<td class="ms-vb">
<xsl:value-of select="@Editor"/>
</td>

<td class="ms-vb">
<xsl:value-of select="ddwrt:FormatDate(string(@Modified),
1036, 5)"/>
</td>

</tr>

</xsl:if>

</xsl:if>

</xsl:for-each>

</xsl:template>

<xsl:template name="dvt_1.empty">

<xsl:variable name="ViewEmptyText"><xsl:element
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="a">
<xsl:attribute name="href">
<xsl:value-of select="$UserID"/>
</xsl:attribute>
</xsl:element></xsl:variable>
<!--table border='0'
width='100%'-->
<!--tr-->
<!--td
class="ms-vb"-->
<xsl:variable
name="LienTrombinoscope">

http://192.168.113.5:8084/Trombinoscope/Forms/AllItems.aspx
</xsl:variable>
<xsl:if
test="not(starts-with($UserID, 'wssgestion'))">
<!--span-->
<p
align="center" class="ms-vb">
<xsl:element
name="a">

<xsl:attribute name="href">

<xsl:value-of select="$LienTrombinoscope"/>

</xsl:attribute>
Trombinoscope
</xsl:element>
</p>
<!--/span-->
</xsl:if>
<!--/td-->
<!--/tr-->
<!--/table-->
</xsl:template>
</xsl:stylesheet>
]]></dvwp:XSL>
<dvwp:DataQuery><![CDATA[
<udc:ConnectionInfo
xmlns:udc="http://schemas.microsoft.com/data/udc" Purpose="Query"
UDCVersion="1.0" SOAPVersion="1.0">
<udcs:Location
xmlns:udcs="http://schemas.microsoft.com/data/udc/soap">STSDataAdapter</udcs:Location>
<udcs:SOAPAction
xmlns:udcs="http://schemas.microsoft.com/data/udc/soap">http://schemas.microsoft.com/sharepoint/dsp/queryRequest</udcs:SOAPAction>
<soap:Body
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<dsp:queryRequest
xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp">
<dsp:dsQuery resultContent="dataOnly"
columnMapping="attribute" resultRoot="Rows" resultRow="Row"
select="/list[@id='{370BCA6B-09FC-4FF1-A538-006C7A1DEA3E}']">
<dsp:Query>
<dsp:Fields>
<dsp:AllFields/>
</dsp:Fields>
</dsp:Query>
</dsp:dsQuery>
</dsp:queryRequest>
</soap:Body>
<soap:Header
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<dsp:request
xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" document="content"
method="query"/>
<dsp:versions
xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp">
<dsp:version>1.0</dsp:version>
</dsp:versions>
</soap:Header>
</udc:ConnectionInfo>]]></dvwp:DataQuery>
<Title>Annonces</Title><dvwp:NoDefaultStyle>TRUE</dvwp:NoDefaultStyle><dvwp:ListName>{370BCA6B-09FC-4FF1-A538-006C7A1DEA3E}</dvwp:ListName><dvwp:Default>FALSE</dvwp:Default><dvwp:DisplayName>Annonces</dvwp:DisplayName><dvwp:ViewFlag>0</dvwp:ViewFlag><FrameType>None</FrameType>
<dvwp:ParamBindings><![CDATA[
<ParameterBindings
xmlns="http://schemas.microsoft.com/office/fpddw">
<ParameterBinding Name="dvt_adhocmode"
Location="Postback;Connection"/>
<ParameterBinding Name="dvt_adhocfiltermode"
Location="Postback;Connection"/>
<ParameterBinding Name="dvt_fieldsort"
Location="Postback;Connection"/>
<ParameterBinding Name="dvt_sortfield"
Location="Postback;Connection"/>
<ParameterBinding Name="dvt_groupfield"
Location="Postback;Connection"/>
<ParameterBinding Name="dvt_groupdisplay"
Location="Postback;Connection"/>
<ParameterBinding Name="dvt_sortdir"
Location="Postback;Connection"/>
<ParameterBinding Name="dvt_groupdir"
Location="Postback;Connection"/>
<ParameterBinding Name="dvt_grouptype"
Location="Postback;Connection"/>
<ParameterBinding Name="dvt_sorttype"
Location="Postback;Connection"/>
<ParameterBinding Name="dvt_groupsorttype"
Location="Postback;Connection"/>
<ParameterBinding Name="dvt_filterfield"
Location="Postback;Connection"/>
<ParameterBinding Name="dvt_filterval"
Location="Postback;Connection"/>
<ParameterBinding Name="dvt_filtertype"
Location="Postback;Connection"/>
<ParameterBinding Name="dvt_firstrow"
Location="Postback;Connection"/>
<ParameterBinding Name="dvt_nextpagedata"
Location="Postback;Connection"/>
<ParameterBinding Name="dvt_apos"
Location="Postback;Connection"/>
<ParameterBinding Name="filterParam"
Location="Postback;Connection"/>
<ParameterBinding Name="UserID"
Location="CAMLVariable;ServerVariable(LOGON_USER)"
DefaultValue="CurrentUserName"/>
<ParameterBinding Name="Today" Location="CAMLVariable"
DefaultValue="CurrentDate"/>
</ParameterBindings>]]></dvwp:ParamBindings>
<dvwp:DataFields>@ID,ID;@Title,Titre;@Modified,Modifié;@Created,Créé;@Author,Créé
par;@Editor,Modifié par;@Attachments,Pièces
jointes;@Body,Corps;@Expires,Expire;</dvwp:DataFields>
</WebPart>
</WebPartPages:DataViewWebPart>
--
Nicolas.

MCP 70-229
http://nicolasp-ms.blogspot.com/


"AnthonyB" a écrit :

Effectivement, le XSLT permet pas mal de choses sympas aussi ;-)
AnthonyB

"Nicolas PIEROT" a écrit :

> J'ai trouve,
>
> J'utilise le webpart dataview/annonce.
>
> Je fais comme un post precedent à part que j'utilise not(start-with;"clt")
>
> Bonne journée.
> --
> Nicolas.
>
> MCP 70-229
> http://nicolasp-ms.blogspot.com/
>
>
> "Nicolas PIEROT" a écrit :
>
> > Bonjour,
> >
> > J'ai créer un bandeau de liens dans un tableau.
> >
> > Il y a 4 liens de type url.
> >
> > En fonctionne du login j'aimerais afficher ou pas les liens.
> >
> > Par contre, je ne peux pas mettre des personnes dans des groupes.
> > Les logins seront du type :
> >
> > cltutilisateur : pour les clients.
> > utilisateur : pour les employes de l'entreprise.
> >
> > Je souhaite ne pas afficher le lien si le login commence par clt, sinon on
> > affiche.
> >
> > Dois-je faire une webpart ?
> > Ou alors, utiliser une webpart type dataview ?
> >
> > Merci de votre aide.
> > --
> > Nicolas.
> >
> > MCP 70-229
> > http://nicolasp-ms.blogspot.com/


Avatar
Renaud COMTE [MVP]
Oui je pense que l'on peut

Mais le meilleur endroit reste un NG ou un forum PRO xslt

Ici, c'est plutot SharePoint Wolrd ^^
--
Renaud COMTE [MVP]
-------------------------------
http://www.clubSPS.org
http://blog.spsclerics.com/
-------------------------------