Code:
if Request.QueryString("Critere") <> "" then
'on error resume next
'Création du recordset de résultat
'set g_rsResultat = g_oQuery.CreateRecordSet("sequential")
'Gestion des erreurs générées par Copernic à la création du Recordset
if err.number <> 0 or Query.exception <> 1 then%>
<table border="0">
<tr>
<td>
<div class="TexteNormal">
<%If Query.exception <> 1 Then%>
<p><b>La requête n'est pas valide.</b></p>
<p>Essayez à nouveau. Si le problème persiste, soulevez le problème au SSPOC.</p>
<%elseIf err.number <> 0 Then%>
<p><b>Une erreur est survenue sur le serveur.</b></p>
<p><b>No. Erreur :</b> <%Response.write err.number%><br>
<b>Description :</b> <%Response.write err.description%><br>
<b>Requete :</b> <%=g_strQuery%><br>
<b>Colonnes :</b> <%=g_oQuery.Columns%></p>
<p>Essayez une autre requête. Si le problème persiste, soulevez le problème au SSPOC.</p>
<%end If%>
</div>
</td></tr></table>
<%else 'Aucune erreur lors du CreateRecordset
on error goto 0
end if 'err.number <> 0 %>
<table border="0">
<%if err.number = 0 And Query.Exception = 1 then 'Aucune erreur lors du CreateRecordset
dim strImgTypeDoc 'Contient le nom de l'image correspondant au type de document
dim strCategDocPrec 'Contient la catégorie du document précédent
strCategDocPrec = "" %>
<%if g_strSurvol <> "" then
if instr(1, g_strSurvol, ".htm") or instr(1, g_strSurvol, ".html") or instr(1, g_strSurvol, ".asp") then
strImgTypeDoc = "/commun/images/html.gif"
elseif instr(1, g_strSurvol, ".doc") then
strImgTypeDoc = "/commun/images/word.gif"
elseif instr(1, g_strSurvol, ".xsl") then
strImgTypeDoc = "/commun/images/excel.gif"
elseif instr(1, g_strSurvol, ".ppt") then
strImgTypeDoc = "/commun/images/ppt.gif"
elseif instr(1, g_strSurvol, ".pdf") then
strImgTypeDoc = "/commun/images/pdf.gif"
elseif instr(1, g_strSurvol, ".zip") then
strImgTypeDoc = "/commun/images/zip.gif"
else
strImgTypeDoc = "/commun/images/Type_inconnu.gif"
end if %>
<a href="<%=g_strSurvol%>" target="_self" class="TexteNormal"><img border="0" src="<%=strImgTypeDoc%>" align="top" alt="Survol" hspace="2" width="16" height="16">Survol</a>
<%end if
if Query.TotalCount > 0 then
'Remplir le tableau avec les données que l'on veut trier
dim strIndex, pos1, pos2, len2
strIndex = 0
redim TabDocument(10,Query.totalcount-1)
For Each Document In Query.Results
tabDocument(0,strIndex) = Document.fields("@CASCategorieDocDisplay")
tabDocument(1,strIndex) = Document.fields("@persoTitle")
tabDocument(2,strIndex) = Document.Date
tabDocument(3,strIndex) = strIndex+1
for ctrChampReste = 4 to 10
tabDocument(ctrChampReste,strIndex) = ""
next
strIndex = strIndex + 1
next
'Remplir le tableau contenant les ordre de tri pour chaque colonne du tableau à trier
Dim ctrOrdreTri, tabOrdreTri(10)
tabOrdreTri(0) = "d"
tabOrdreTri(1) = "a"
tabOrdreTri(2) = "d"
for ctrOrdreTri = 3 to 10
tabOrdreTri(ctrOrdreTri) = ""
next
'Exécuter le tri
call TriColTab(tabDocument,tabOrdreTri)%>
<!--Test 05-07-2013-->
<div class="arrowlistmenu">
<!--finTest 05-07-2013-->
<%For i = 0 to Ubound(TabDocument,2)
strIndex = tabDocument(3,i)
set Document = Query.Results(strIndex)
'DEE02 strVPath = g_rsResultat("VPath")
strVPath = document.fields("@PostLienWeb")
strVPath = replace(strVPath,"'","'")
strVPath = replace(strVPath,chr(34),""")
strSize = Round(document.FileSize/1024, 0) & "k"
if instr(1,document.fields("@sysFileName"), ".zip") Then
DocType="doc"
strImgTypeDoc= "/commun/images/zip.gif"
elseif instr(1,document.fields("@sysFileName"),".asp") then
strImgTypeDoc = "/commun/images/html.gif"
elseif instr(1,document.fields("@sysFileName"),".doc") then
strImgTypeDoc = "/commun/images/word.gif"
Else
Select Case document.fields("@sysFileType")
Case "html"
strImgTypeDoc = "/commun/images/html.gif"
Case "xls"
strImgTypeDoc= "/commun/images/excel.gif"
Case "doc"
strImgTypeDoc= "/commun/images/word.gif"
Case "ppt"
strImgTypeDoc= "/commun/images/ppt.gif"
Case "pdf"
strImgTypeDoc= "/commun/images/pdf.gif"
Case else
If InStr(document.fields("@sysFileType"), "text/plain") > 0 or InStr(document.fields("@sysFileType"), "richtext") > 0 then
strImgTypeDoc = "/commun/images/text.gif"
else
strImgTypeDoc= "/commun/images/Type_inconu.gif"
end if
End Select
end if
'strVPath = GetWebLink(strVPath)
'Divise les documents par Catégorie (Guides, Gabarits, Exemples..)
'*** LE RECORDSET DOIT ÊTRE TRIÉ PAR CATÉGORIE DE DOCUMENT ***
if document.fields("@CASCategorieDocDisplay") <> strCategDocPrec then%>
<!--Test 08-07-2013 Si i est différent de 0, alors on referme les balises <div> et <ul> pour les sections déroulantes-->
<%if (i <> 0) then%>
</ul>
<%end if %>
<!--finTest 08-07-2013-->
<!--Test 05-07-2013 ***Slm la section <a>***-->
<h4><a class="menuheader expandable"><b><%=document.fields("@CASCategorieDocDisplay")%></b></a></h4>
<ul class="categoryitems">
<!--finTest 05-07-2013-->
<%end if%>
<li>
<span class="TexteNormal" ><a target="_self" href="<%=strVPath%>" ><img src="<%=strImgTypeDoc%>" border="0" hspace="3" WIDTH="16" HEIGHT="16" ><%=document.fields("@persotitle")%></a></span>
<div class="TextePetit" style="color:gray"><%=Year(document.fields("@CACDatePublication")) & "/" & Month(document.fields("@CACDatePublication")) & "/" & Day(document.fields("@CACDatePublication"))%> <%=Unescape(strVPath)%> [<%=strSize%>]</div>
</li>
<%strCategDocPrec = document.fields("@CASCategorieDocDisplay")
Next%>
</div>
<%else 'Aucun enregistrement dans le recordset %>
<tr>
<td colspan="2" class="TexteNormal">Aucun document trouvé en rapport avec "<b><%=g_strTitre%></b>".</td></tr>
<%end if 'g_rsResultat.properties("RowCount") > 0
end if 'error.number = 0 %>
</table>
<%else 'Pas de critère dans le QueryString%>
<table border="0">
<tr>
<td><span class="TexteNormal"><b>Paramètres manquants.</b></span></td></tr>
<tr>
<td><span class="TexteNormal">Cette page doit être chargée en cliquant sur un item du menu de gauche.</span></td></tr>
</table>
<%end if 'Request.QueryString("Critere") <> ""%>
Bookmarks