Skip to content

Instantly share code, notes, and snippets.

@jeanph01
Created February 8, 2018 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeanph01/b88357a27dedf2b9ef6809ec181e27be to your computer and use it in GitHub Desktop.
Save jeanph01/b88357a27dedf2b9ef6809ec181e27be to your computer and use it in GitHub Desktop.
Dossiers de niveaux [LL_REPTAG_&inputlabel2 /] à partir de [LL_REPTAG_&inputlabel1 NODEINFO:NAME /] // source https://jsbin.com/fixadej
<!DOCTYPE html>
<!--
* colonne nb de niveaux du dossier
* type de droit s: utilisateur, groupe, groupes X, s
supprimés, publics, groupes projets
* au lieu de partir la matrice, quand on clique sur chemin,
on repart le rapport à partir de ce dossier.
* ajouter le menu de fonction hydrodoc suite au chemin
-->
<html>
<head>
<script type="text/javascript">
var WRConnaitreTailleDossier = '122253648'; // sortie JSON
var WRDroitsUniquesStructure = '122238748';
var LRDroitsUniquesStructure = '122230097';
var SeuilTailleStructure = 20000; // nb elements max pour analyser une structure
</script>
<title>Dossiers de niveaux [LL_REPTAG_&inputlabel2 /] à partir de [LL_REPTAG_&inputlabel1 NODEINFO:NAME /]</title>
[/* Comment the following tag to assist in debugging any changes made to this reportview: */]
[/* LL_WEBREPORT_SUPPRESSERRORLOG */]
[/* Excludes the standard Content Server header from the output. */]
[LL_WEBREPORT_EXCLUDEHEADER /]
[/* Excludes any Appearance HTML elements at the bottom, bottom left and bottom right. */]
[LL_WEBREPORT_APPEARBOTTOMOFF /]
[/* Excludes the Add Item menu from the output. */]
[LL_WEBREPORT_EXCLUDEADDITEM /]
[/* Excludes the news channel from the output. */]
[LL_WEBREPORT_EXCLUDECHANNEL /]
[/* Excludes the standard Livelink footer from the output. */]
[LL_WEBREPORT_EXCLUDEFOOTER /]
[/* Excludes the location display from the output. */]
[LL_WEBREPORT_EXCLUDELOCATIONDISPLAY /]
[/* Excludes the Personal and Enterprise menus etc. */]
[LL_WEBREPORT_EXCLUDEMENU /]
[/* Excludes the Livelink search bar. */]
[LL_WEBREPORT_EXCLUDESEARCH /]
[/* Adds HTML comments with timing information in the display output */]
[LL_WEBREPORT_HIDDENTIMING /]
<!--WebReports version: [LL_REPTAG_SUBVERSION /]-->
[/* Build a version of the URL that includes any search names, subtype parms or page numbers */]
[LL_REPTAG_MYCACHEURL SETVAR:BaseURL /]
[LL_REPTAG_%BaseURL CURRENTVAL SETVAR:FilterURL /]
[LL_REPTAG_'&searchname=' CONCATVAR:FilterURL /]
[LL_REPTAG_&SEARCHNAME CONCATVAR:FilterURL /]
[LL_REPTAG_'&objFilter=' CONCATVAR:FilterURL /]
[LL_REPTAG_&objFilter CONCATVAR:FilterURL /]
[LL_REPTAG_&STARTROW PATCHANGE:'<?+>':'@&startrow=#1' CONCATVAR:FilterURL /]
[LL_REPTAG_&NUMROWS PATCHANGE:'<?+>':'@&numrows=#1' CONCATVAR:FilterURL /]
[LL_REPTAG_MYCACHEURL ESCAPEURL SETVAR:myNextURL /]
[LL_REPTAG_USERID USERPREF:GENERAL:SHOWITEMDESC SETVAR:ShowDescriptions /]
[LL_WEBREPORT_JSLIBS "BASICBROWSE" "BROWSE" "COREAJAX" /]
<script type="text/javascript" src="[LL_REPTAG_LIBPATH /]browse.js"></script>
<style type="">
/* partie #1 : concerne le fait de figer l'entete */
.bodyDiv {
position: absolute;
min-height: 100%;
top: 0px;
width: 100%;
}
#top {
}
#topnav {
position: relative;
width: 100%;
padding: 0;
top: 0px;
display: inline-block;
}
#belowtopnav {
padding-top: 0px;
display: inline-block;
}
#footer {
display: inline-block;
}
table.fixed {
table-layout: fixed;
width: 100%;
word-wrap: break-word;
}
table.fixed td:nth-of-type(1) {
/* dataid */
width:4%;
}
table.fixed td:nth-of-type(2) {
/*SUBTYPE */
text-align:right;
padding-right:2px;
width:100px;
display:none;
}
table.fixed td:nth-of-type(3) {
/* niveau */
text-align:right;
padding-right:2px;
width:2%;
}
table.fixed td:nth-of-type(4) {
/* chemin */
text-align: left;
width:40%;
}
table.fixed td:nth-of-type(5) {
/* taille dossier */
text-align: left;
width:5%;
}
table.fixed td:nth-of-type(6) {
/* profondeur */
text-align: left;
width:5%;
}
table.fixed td:nth-of-type(7) {
/* Nb groupes */
text-align: left;
width:5%;
}
table.fixed td:nth-of-type(8) {
/* Nb groupes X */
text-align: left;
width:5%;
}
table.fixed td:nth-of-type(9) {
/* Nb utilisateurs */
text-align: left;
width:5%;
}
table.fixed td:nth-of-type(10) {
/* Supprimés */
text-align: left;
width:5%;
}
table.fixed td:nth-of-type(11) {
/* notes */
text-align: left;
width:15%;
}
/* Partie #2 : corrige certaines mises en formes heritees du css principal*/
td.comm_main_left {
display: none;
}
/* cacher section qui occupe du real estate...*/
#LLOuterContainer td.comm_main_left {
display: none;
}
/* Partie #3 : concerne la mise en forme de la table de donnees */
.EnteteTable {
background-color: #eee;
}
.cacher {
display: none;
}
.EnteteTable, .tableDonnees {
width: 100%;
border-collapse: collapse;
border: 0;
margin: 0;
padding: 0;
}
/* utilise une classe pour reduire la specificite */
.tableDonnees {
vertical-align: middle;
text-align: center;
}
.tableDonnees td {
padding-left: 2px;
padding-right: 2px;
border-bottom: 1px solid #ddd;
border-right: 1px solid #ddd;
}
.tableDonnees img {
float: none;
border: 0;
}
.EnteteTable td {
padding: 3px 3px 4px 3px;
/* degrade comme dans Livelink */
background: -moz-linear-gradient(top, #ffffff 0%, #e1f3f7 2%, #ccf0fe 33%, #caf0fe 100%);
background: -webkit-linear-gradient(top, #ffffff 0%,#e1f3f7 2%,#ccf0fe 33%,#caf0fe 100%);
background: linear-gradient(to bottom, #ffffff 0%,#e1f3f7 2%,#ccf0fe 33%,#caf0fe 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#caf0fe',GradientType=0 );
vertical-align: top;
text-align: center !important;
}
.rotate-45 {
height: 100px;
min-width: 40px;
padding: 0 !important;
line-height: 0.8;
}
.rotate-45 > div {
position: relative;
/*top: 0px;*/
height: 100%;
transform-origin: bottom left ;
transform: skewX(-45deg);
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
}
.rotate-45 span {
transform-origin: bottom left;
transform: skewX(45deg) rotate(315deg);
position: absolute;
bottom: 2%;
left:60%;
display: inline-block;
width: 100%;
text-align: left;
white-space: nowrap;
}
#logWindow {
display: none;
}
.nowrap {
white-space: nowrap;
}
#selectedBrowsePageObjectFilter, #BrowsePageObjectFilterMenu, tr.MesTaches, #browsesearch {
display:none; /* temporaire */
}
.EnteteTable td > div:first-child {
font-size: larger;
}
img.img16x16 {
height:16px;
width:16px;
border:0;
}
span.sep {display:inline-block;padding:3px
}
</style>
</head>
<body>
<div class="bodyDiv">
<div id="top">
[/* Table with filter, search and pagination controls */]
<table style="width:100%;padding:0; border-collapse:collapse; border:0">
<tr>
<td style="width:10%"></td>
<td width="75%">
<div style="text-align:center">
<h1>Dossiers de niveaux [LL_REPTAG_&inputlabel2 /] à partir de [LL_REPTAG_&inputlabel1 NODEINFO:NAME /]</h1>
</div>
</td>
<td>
</td>
</tr>
</table>
</div>
<div id="topnav">
<table class="EnteteTable fixed">
<tbody>
<tr>
<td class=""><div><span>Data ID</span></div>
</td>
<td class=""><div><span>SUBTYPE</span></div>
</td>
<td class="">
<div><span>Niveau</span></div>
</td>
<td class="">
<div><span>Chemin d'accès</span></div>
</td>
<td class="">
<div><span>Taille dossier (nb éléments)</span></div>
</td>
<td class="">
<div><span>Profondeur (sous-niveau)</span></div>
</td>
<td class="">
<div><span>Nb groupes distincts</span></div>
</td>
<td class="">
<div><span>Nb groupes X distincts</span></div>
</td>
<td class="">
<div><span>Nb utilisateurs distincts</span></div>
</td>
<td class="">
<div><span>Nb d'accès supprimés distincts</span></div>
</td>
<td class="">
<div><span>Notes</span></div>
</td>
</tr>
</tbody>
</table>
</div>
[/* active le mode pagination */]
[LL_REPTAG_@RESPONSEDATA.UsePagination SETVAR:UsePagination /]
[LL_REPTAG_@RESPONSEDATA.PageSize SETVAR:NUMROWS /]
<div id="belowtopnav">
<div>
<table class="tableDonnees fixed">
<tbody>
[LL_WEBREPORT_STARTROW /]
[LL_WEBREPORT_INCLUDEIF "[LL_REPTAG_&filterValue /]" IN "[LL_REPTAG=name /]" /]
[LL_WEBREPORT_IF "[LL_REPTAG_%UsePagination CURRENTVAL /]" == "true" /]
[LL_WEBREPORT_INCLUDERANGE STARTROW:[LL_REPTAG_&STARTROW DEF:1 /] MAXROWS:[LL_REPTAG_%NUMROWS CURRENTVAL /] /]
[LL_WEBREPORT_ENDIF /]
<tr class="[LL_REPTAG_ROWNUM ODDEVEN:browseRow1:browseRow2 /]"
id="tr[LL_REPTAG=Dataid /]">
<td class="dataid"> [LL_REPTAG=Dataid /]
</td>
<td>
[LL_REPTAG=SUBTYPE /]
</td>
<td>
[LL_REPTAG=LEVEL /]
</td>
<td>
<a href="?func=ll&objId=[LL_REPTAG_&objId /]&objAction=RunReport&inputlabel1=[LL_REPTAG=Dataid /]&inputlabel2=2">[LL_REPTAG=CHEMIN /]</a>
</td>
<td class="taille"></td>
<td class="Profondeur"></td>
<td class="NbGroupes"></td>
<td class="NbGroupesX"></td>
<td class="NbUtilisateurs"></td>
<td class="NbSupprimes"></td>
<td class="options"><a href="#">Analyser...</a></td>
</tr>
[LL_WEBREPORT_ENDROW /]
</tbody>
</table>
</div>
<div id="footer">
<div id="BrowsePageRowPagingSectionCell">
<table style="border:0;width:100%">
<tr>
<td width="10%" align="left">
<table>
<tr>
<td nowrap width="20%" align="left" id="menuPageSize"></td>
</tr>
<tr>
<td id="menuPagination"></td>
</tr>
</table>
</td>
<td width="10%" align="LEFT">
<table>
<tr id="miniPageRow2"></tr>
</table>
</td>
<td>
&nbsp;
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<script type="text/javascript">
// Eviter autant que possible de mettre des variables WR directement
// dans le javascript pour decoupler le code
var WRvar = {};
WRvar.ACTUALROWS = parseInt("[LL_REPTAG_ACTUALROWS /]");
WRvar.BASEURL = "[LL_REPTAG_%BASEURL /]";
WRvar.DefaultPageSize = parseInt("[LL_REPTAG_@RESPONSEDATA.DefaultPageSize /]");
WRvar.DefaultPageSizeChoices = "[LL_REPTAG_@RESPONSEDATA.DefaultPageSizeChoices /]";
WRvar.FILTEREDROWS = parseInt("[LL_REPTAG_FILTEREDROWS /]");
WRvar.filterValue = "[LL_REPTAG_&filterValue DEF:'' /]";
WRvar.minimumPageSize = parseInt("[LL_REPTAG_@RESPONSEDATA.MinimumPageSize /]");
WRvar.objFilter = "[LL_REPTAG_&objFilter DEF:'' /]";
WRvar.PageSize = parseInt("[LL_REPTAG_@RESPONSEDATA.PageSize /]");
WRvar.sort = "[LL_REPTAG_&SORT /]";
WRvar.STARTROW = parseInt("[LL_REPTAG_&STARTROW DEF:1 /]");
WRvar.SUPPORTDIR = "[LL_REPTAG_SUPPORTDIR /]";
WRvar.TOTALROWS = parseInt("[LL_REPTAG_TOTALROWS /]");
WRvar.URLPrefix = '[LL_REPTAG_URLPREFIX PATCHANGE:"?*</?+/>?*":#1 /]';
WRvar.UseCollectButton = "[LL_REPTAG_@RESPONSEDATA.UseCollectButton /]";
WRvar.UsePagination = "[LL_REPTAG_@RESPONSEDATA.UsePagination /]";
WRvar.WEBNODE_HTMLLABEL = "[LL_REPTAG_'WEBNODE_HTMLLABEL.FilterByName' XLATE /]";
var defaultPageSize = WRvar.DefaultPageSize;
var minimumPageSize = WRvar.minimumPageSize;
var pageSizeList = WRvar.DefaultPageSizeChoices.replace(/\'/g, "");
var defaultNmSrchLabel = WRvar.WEBNODE_HTMLLABEL;
var isIE = document.all ? 1 : 0;
var pageSize = WRvar.PageSize;
var startRow = WRvar.STARTROW;
var totalRows;
if (WRvar.UsePagination === "true") {
totalRows = WRvar.FILTEREDROWS;
} else {
totalRows = WRvar.TOTALROWS;
} // else
var usePagination = WRvar.UsePagination;
var useCollectButton = WRvar.UseCollectButton;
var showResultsPicker = usePagination && (totalRows > minimumPageSize);
var actualRows = WRvar.ACTUALROWS;
var totalPages = 1;
if (usePagination) {
if ((totalRows % pageSize) == 0) {
totalPages = parseInt(totalRows / pageSize); // All the pages
} else {
totalPages = parseInt((totalRows / pageSize) + 1); // Add an additional page at the end for remaining items
}
usePagination = (totalPages > 1); // the number of results available is less than or equal to the pageSize
}
var pageNum = parseInt((startRow + pageSize - 1) / pageSize); // current page
var subtypeFilter = WRvar.objFilter;
var searchName = WRvar.filterValue;
var filtered = (subtypeFilter || searchName);
var topPickControlOpen = false;
var imgSrc = WRvar.SUPPORTDIR;
function refreshPage(action, value) {
// value may not be passed
var url = WRvar.BASEURL;
switch (action) {
case "subtypefilter":
if (value) {
subtypeFilter = value;
} else {
subtypeFilter = '';
}
startRow = 1;
break;
case "namesearch":
searchName = document.getElementById('srch_fld').value;
startRow = 1;
break;
case "resultchange":
startRow = 1;
pageSize = value;
document.cookie = "LLPageSizeCookie=" + escape(pageSize) + "; path=" + WRvar.URLPrefix;
break;
case "prev":
if (pageNum > 1) {
startRow = (startRow - parseInt(pageSize));
}
break;
case "next":
if (pageNum < totalPages) {
startRow = (parseInt(pageNum) * parseInt(pageSize)) + 1;
}
break;
case "gopage":
startRow = (pageSize * (parseInt(value) - 1)) + 1;
break;
}
url += "&sort=" + WRvar.sort;
url += "&filterValue=" + searchName;
url += "&objFilter=" + subtypeFilter;
if (startRow != 1) { url += "&filteredrows=" + totalRows };
document.location = url + "&startrow=" + startRow + "&numrows=" + pageSize;
}
function ChangeBrowsePageObjectFilter(index, value, temp) {
document.getElementById('selectedBrowsePageObjectFilter').innerHTML = document.getElementById('BrowsePageObjectFilter' + index + 'DivId').innerHTML;
refreshPage('subtypefilter', value);
}
function wr_createPageSizeMenu(selectionList, pick) {
var menuString = "";
menuString +=
'<DIV STYLE="clear:none;" ID="BrowsePageSizeMenu" CLASS="bcMenuSelect" ONCLICK="javascript:ShowBCDropDownMenu(\'showBrowsePageSize\');return false;">' +
' <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%">' +
' <TR>' +
' <TD WIDTH="100%" ID="itemIDMenuSelectTitle" CLASS="bcselectTitle" >' +
' <DIV ID="selectedBrowsePageSize" ONCLICK="javascript:showMenu( \'BrowsePageSizeMenu\', \'\' );return false">';
var tempString = lStr["Select number of items on page"];
menuString += ' <A TITLE="' + tempString + '" HREF="javascript:showMenu( \'BrowsePageSizeMenu\', \'\' );return false" STYLE="font-size:8pt; vertical-align:middle">' + pick + '</A>';
menuString +=
' </DIV>' +
' </TD>' +
' <TD><IMG TITLE="' + tempString + '" CLASS="bcselectArrow" ALT="" SRC="' +
WRvar.SUPPORTDIR + 'bcselectarrow.png" WIDTH="17" HEIGHT="17"></TD>' +
' </TR>' +
' </TABLE>';
menuString += '<DIV STYLE="top:0px;" ID="showBrowsePageSize" CLASS="menu">';
pageSizeArray = selectionList.split(',');
for (i = 0; i < pageSizeArray.length; i++) {
menuString +=
'<DIV ID="BrowsePageSize' + pageSizeArray[i] + 'DivId" CLASS="menuItem" WIDTH="100%" ' +
' ONMOUSEOVER="javascript:hiLight( \'BrowsePageSize' + pageSizeArray[i] + 'DivId\' );" ' +
' ONMOUSEOUT="javascript:loLight( \'BrowsePageSize' + pageSizeArray[i] + 'DivId\' );" ' +
' ONCLICK="javascript:refreshPage( \'resultchange\',\'' + pageSizeArray[i] + '\');">' +
' <A HREF="javascript:refreshPage( \'resultchange\',\'' + pageSizeArray[i] + '\');" STYLE="font-size:8pt; width:100%;">' + pageSizeArray[i] + '</A>' +
'</DIV>';
}
menuString += "</DIV>";
menuString += "</DIV>";
return (menuString);
}
function wr_createPageSelectIcons() {
var menuString = "";
if (usePagination) {
menuString += '<TD>';
menuString += '<DIV ID="PageSelectDiv" CLASS="activePicStyle">';
menuString += '<TABLE WIDTH="100%" cellpadding="0px" cellspacing="0px"><TBODY>';
menuString += '<TR>';
if (pageNum > 1) {
menuString += '<TD onmouseover="imageCell(this, \'page_previous16_mo.gif\', \'PagePrevImg\', true); " ';
menuString += 'onmouseout="imageCell(this, \'page_previous16.gif\', \'PagePrevImg\', false);" ';
menuString += 'onclick="refreshPage(\'prev\');" >';
menuString += "<IMG SRC='" + imgSrc + "page_previous16.gif' Alt='Previous Page' Title='Previous Page' ID='PagePrevImg' class='img16x16' >";
menuString += '</TD>';
} else {
menuString += "<TD><IMG SRC='" + imgSrc + "spacer.gif' ALT='' class='img16x16' ></TD>";
}
menuString += '</TR>';
menuString += '</TBODY></TABLE>';
menuString += '</DIV></TD>';
menuString += "<TD><IMG SRC='" + imgSrc + "spacer.gif' ALT='' WIDTH='2' HEIGHT='4' BORDER='0'></TD>";
// Calculate the boundaries that the control will show
var startAt = Math.max(pageNum - 2, 1);
var endAt = Math.min(totalPages + 1, startAt + 5);
if ((endAt - startAt) < 5) {
// Need to recalculate the startAt point if the calculated
// start is less than 5 from the end
startAt = Math.max(endAt - 5, 1);
}
for (i = startAt; i < endAt; i++) {
menuString += '<TD CLASS="pageSelectorReference" STYLE="margin: 0 4px 0 4px;padding: 0 2px 0 2px;color: #00609e;" ';
menuString += 'pageNumAccess="' + i + '" TITLE="Page ' + i + '" ';
if (i !== pageNum) {
menuString += 'onmouseover=" colourCell(this); " ';
menuString += 'onmouseout=" clearCell(this, true);" ';
menuString += 'style="border: solid 1px #F5F5F5;" ';
menuString += 'onclick="refreshPage( \'gopage\' ,' + i + ');" ';
} else {
menuString += 'style="backgroundColor: white;border: solid 1px #A9B7C6;" ';
}
menuString += ">&nbsp;" + i + "&nbsp;</TD>";
menuString += "<TD><IMG SRC='" + imgSrc + "spacer.gif' ALT='' WIDTH='2' HEIGHT='4' BORDER='0'>";
}
if (pageNum < totalPages) {
menuString += '<TD ';
menuString += 'onmouseover="imageCell(this, \'page_next16_mo.gif\', \'PageNextImg\', true); " ';
menuString += 'onmouseout="imageCell(this, \'page_next16.gif\', \'PageNextImg\', false); " ';
menuString += ' onclick="refreshPage( \'next\')" >';
menuString += "<IMG SRC='" + imgSrc + "page_next16.gif' Alt='" + lStr['Next Page'] + "' Title='" + lStr['Next Page'] + "' ID='PageNextImg' class='img16x16' >";
}
else {
menuString += '<TD>';
menuString += "<IMG SRC='" + imgSrc + "page_next16_ds.gif' class='img16x16' >";
}
menuString += '</TD>';
}
return (menuString);
}
function LocString(instr) { return instr }; // future localization
function imageCell(obj, imageName, idName, usePointer) {
var imgRef = document.getElementById(idName);
if (undefined !== imgRef) {
imgRef.src = imgSrc + imageName;
}
if (true === usePointer) {
obj.style.cursor = "pointer";
} else {
obj.style.cursor = "default";
}
}
function colourCell(obj) {
obj.origColor = obj.style.backgroundColor;
obj.style.backgroundColor = '#E2EBF3';
obj.style.cursor = "pointer";
obj.style.border = "solid 1px #A9B7C6";
}
function clearCell(obj, clearBorder) {
obj.style.backgroundColor = obj.origColor;
obj.style.cursor = "default";
if (true === clearBorder) {
obj.style.border = "";
obj.style.border = "solid 1px #F5F5F5";
}
}
function createPageTable(totalPages, currentPageNum) {
var miniPageTableCell;
var miniPageTable;
var cell;
var cellCount = 0;
var pickControlOpen = false;
miniPageTableCell = document.getElementById('MiniPageTableCell');
if (null != miniPageTableCell) {
if (totalPages <= 1) {
miniPageTableCell.style.display = "none";
return;
} else {
miniPageTableCell.style.display = "";
miniPageTableCell.width = '10%';
}
}
miniPageTable = document.getElementById('MiniPageTable');
if (null == miniPageTable) {
return;
}
if (miniPageTable.getElementsByTagName('TD').length > 0) {
removeChildren(miniPageTable.firstChild);
}
if (isIE) {
miniPageTable.style.filter = "alpha(opacity=80)";
} else {
miniPageTable.style.opacity = ".80";
}
miniPageTable.style.height = "15px";
this.miniPageRow = miniPageTable.insertRow(0);
if (totalPages > 1) {
if (false == topPickControlOpen) {
prevCell = miniPageRow.insertCell(cellCount++);
if (currentPageNum != 1) {
prevCell.onmouseover = function () { imageCell(this, 'page_previous16_mo.gif', 'PagePrev', true); };
prevCell.onmouseout = function () { imageCell(this, 'page_previous16.gif', 'PagePrev', false); };
prevCell.onclick = function () { refreshPage('prev') };
prevCell.align = 'right';
prevCell.innerHTML = "<IMG SRC='" + imgSrc + "page_previous16.gif' Alt='" + LocString("Previous Page") + "' Title='" + LocString("Previous Page") + "' ID='PagePrev' class='img16x16' >";
} else {
prevCell.innerHTML = "<IMG SRC='" + imgSrc + "page_previous16_ds.gif' class='img16x16' >";
}
cell = miniPageRow.insertCell(cellCount++);
cell.innerHTML = "<IMG SRC='" + imgSrc + "spacer.gif' ALT='' WIDTH='2' HEIGHT='4' BORDER='0'>";
inputCell = miniPageRow.insertCell(cellCount++);
inputCell.setAttribute('pageNumAccess', currentPageNum);
inputCell.style.margin = "0px";
inputCell.style.padding = "0px";
inputCell.style.backgroundColor = "#E2EBF3";
inputCell.style.border = "solid 1px #A9B7C6";
inputCell.className = 'pageSelectorReference';
inputCell.innerHTML = "&nbsp;" + currentPageNum + "&nbsp;";
cell = miniPageRow.insertCell(cellCount++);
cell.innerHTML = "<IMG SRC='" + imgSrc + "spacer.gif' ALT='' WIDTH='2' HEIGHT='4' BORDER='0'>";
nextCell = miniPageRow.insertCell(cellCount++);
if (currentPageNum < totalPages) {
nextCell.onmouseover = function () { imageCell(this, 'page_next16_mo.gif', 'PageNext', true); };
nextCell.onmouseout = function () { imageCell(this, 'page_next16.gif', 'PageNext', false); };
nextCell.onclick = function () { refreshPage('next') };
nextCell.align = 'left';
nextCell.innerHTML = "<IMG SRC='" + imgSrc + "page_next16.gif' Alt='" + lStr['Next Page'] + "' Title='" + lStr['Next Page'] + "' ID='PageNext' class='img16x16'>";
}
else {
nextCell.innerHTML = "<IMG SRC='" + imgSrc + "page_next16_ds.gif' class='img16x16'>";
}
cell = miniPageRow.insertCell(cellCount++);
cell.onmouseover = function () { imageCell(this, 'goto_page16_mo.gif', 'gotoPageMiniLinkImg', true); };
cell.onmouseout = function () { imageCell(this, 'goto_page16.gif', 'gotoPageMiniLinkImg', false); };
cell.innerHTML = "<DIV ID='miniActivatePickDiv' CLASS='activateMiniPickDivShow'><a href='javascript:void(0)'" +
' onclick="javascript:createPageEntryControl(\'miniPageRow\');return false;"' + " TITLE='" + lStr['Go to page...'] + "'><IMG SRC='" + imgSrc + "goto_page16.gif' ID='gotoPageMiniLinkImg' class='img16x16' TITLE='" + lStr['Go to page...'] + "'></a></DIV>";
} else {
createPageEntryControl('miniPageRow');
}
}
}
function createPageEntryControl(rowname) {
var cell;
var theRow = eval('this.' + rowname);
removeChildren(theRow);
cell = theRow.insertCell(0);
cell.style.whiteSpace = 'nowrap';
cell.style.color = '#666666';
cell.innerHTML = "&nbsp;&nbsp;&nbsp;";
cell.innerHTML += lStr['Go to page'];
cell.innerHTML += "&nbsp;&nbsp;<INPUT type='text' ID='miniPageInput' CLASS='browsePaginationBarEdit' SIZE='5' MAXLENGTH='20' LIMIT='20' autocomplete='off' onkeypress='pageNumEnter( this, event )' />";
cell = theRow.insertCell(1);
cell.onmouseover = function () { imageCell(this, 'goto_close1216_mo.gif', 'browsePageMiniLinkImg', true); };
cell.onmouseout = function () { imageCell(this, 'goto_close1216.gif', 'browsePageMiniLinkImg', false); };
cell.innerHTML = "<DIV ID='miniBbrowsePickDiv' CLASS='browseMiniPickDivShow'><A HREF='javascript:void(0)' ONCLICK='javascript:topPickControlOpen=false;createPageTable( totalPages, pageNum );return false;' TITLE='" + lStr['Go to page...'] + "'><IMG SRC='" + imgSrc + "goto_close1216.gif' ID='browsePageMiniLinkImg' WIDTH='16' HEIGHT='16' BORDER='0' ALT='" + lStr['Go to page...'] + "'></a></DIV>";
topPickControlOpen = true;
this.timer = setTimeout("setFocus( 'miniPageInput' )", 5);
}
function pageNumEnter(theForm, ev) {
if (!ev) {
ev = window.event;
}
var ch = (ev.charCode) ? ev.charCode : ((ev.which) ? ev.which : ev.keyCode);
if (ch === 13 || ch === 3) {
var pickPageEdit = document.getElementById('pagePickEdit');
var miniPageInput = document.getElementById('miniPageInput');
pickPageEdit = (miniPageInput !== null) ? miniPageInput : pickPageEdit;
if (pickPageEdit !== null) {
var pageNum = parseInt(pickPageEdit.value, 10);
if (isNaN(pageNum)) {
alert("Enter a page number between 1 and " + totalPages);
return false;
} else if (pageNum > totalPages) {
pageNum = totalPages;
} else if (pageNum <= 0) {
pageNum = 1;
}
refreshPage('gopage', pageNum);
if (miniPageInput !== null) {
cancelEvent(ev);
}
if (null !== miniPageInput) {
topPickControlOpen = true;
}
else {
btmPickControlOpen = true;
}
}
}
else if (ch === 27) {
//flipPagePickBack();
}
return true;
}
function checkForCR(e) {
var c = (e.which) ? e.which : e.keyCode;
if (c === 13 || c === 3) {
cancelEvent(e);
return true;
}
return false;
}
function executeNameSearch() {
val = document.getElementById('srch_fld').value;
if (val == defaultNmSrchLabel) { val = '' };
// is this value different than the one we started with?
if (searchName != val) {
refreshPage('namesearch', val);
}
}
function initNameField(val) {
if (val == defaultNmSrchLabel) {
return true;
}
return false;
}
function checkNameKeys(ev, fld) {
fld.style.fontStyle = 'normal';
fld.style.color = '';
if (checkForCR(ev)) { executeNameSearch(); }
}
</script>
<script type="text/javascript">
/* jshint bitwise: false */
var ApparenceHQ = window.ApparenceHQ = window.ApparenceHQ || {};
ApparenceHQ.AppTrousseGestionProjet = ApparenceHQ.AppTrousseGestionProjet || {};
ApparenceHQ.AppTrousseGestionProjet.CodeSecondaire =
function ($$) {
var codePrincipal,
analyseDossier,
detailsDroits,
figerVolet,
parseQueryString,
scriptsWebReports,
scrolltop,
UIGetDataid,
UIGetRangee,
UIGetCase,
WRGetTailleDossier,
Utils;
Utils = ApparenceHQ.AppTrousseGestionProjet.Utils;
// map jquery sur $$
$$ = $$ || window.$;
scriptsWebReports = function () {
// remplace les tags de scripts de WebReports par une version
// qui n'utilise pas les document.write
var filtre, html;
// si un filtre de nom de document est defini, set le input de recherche
filtre = parseQueryString()["filterValue"];
if ((typeof filtre !== "undefined") && (filtre.length > 0)) {
$$('#srch_fld').val(filtre);
} // if
if (showResultsPicker) {
html = '<TABLE WIDTH=100%><TR>';
html += '<TD STYLE="color:#666666;padding:2px 0 2px 0;">' + lStr["Show"];
html += "<IMG SRC='" + WRvar.SUPPORTDIR + "spacer.gif' TITLE='' WIDTH='4' HEIGHT='1' BORDER='0'>";
html += '<TD NOWRAP>';
html += wr_createPageSizeMenu(pageSizeList, pageSize);
html += '</TD>';
html += '<TD NOWRAP STYLE="color:#666666;padding:2px 0 2px 0;">';
html += "<IMG SRC='" + WRvar.SUPPORTDIR + "spacer.gif' ALT='' WIDTH='10' HEIGHT='1' BORDER='0'>items";
html += "<IMG SRC='" + WRvar.SUPPORTDIR + "spacer.gif' TITLE='' WIDTH='4' HEIGHT='1' BORDER='0'>";
html += '</TD></TR></TABLE>';
$$('#menuPageSize').html(html);
}
html = "";
if (usePagination) {
pageTotal = (pageSize > totalRows) ? totalRows : (startRow + pageSize - 1);
pageTotal = (pageTotal <= totalRows) ? pageTotal : (startRow + actualRows - 1);
if (pageTotal == totalRows) {
if (filtered) {
html += String.formatLoc(lStr["n-m of p items (filtered)"], startRow, pageTotal, totalRows);
}
else {
html += String.formatLoc(lStr["n-m of p items"], startRow, pageTotal, totalRows);
}
}
else {
if (filtered) {
html += String.formatLoc(lStr["n-m of about p items (filtered)"], startRow, pageTotal, totalRows);
}
else {
html += String.formatLoc(lStr["n-m of about p items"], startRow, pageTotal, totalRows);
}
}
$$('#miniPageRow2').html(wr_createPageSelectIcons());
} // if
else {
if (filtered) {
html += String.formatLoc(lStr["p items (filtered)"], totalRows);
}
else {
html += String.formatLoc(lStr["p items"], totalRows);
}
}
$$('#menuPagination').html(html);
}; // scriptsWebReports
// re positionne la zone topnav en haut de la fenetre si le
// document scroll
figerVolet = function () {
var top, toptop, below, topnav;
top = scrolltop();
below = document.getElementById("belowtopnav");
topnav = document.getElementById("topnav");
toptop = document.getElementById("top");
if (top > toptop.offsetHeight) {
below.style.paddingTop = (topnav.offsetHeight + 3) + 'px';
topnav.style.position = "fixed";
topnav.style.top = "0";
} else {
below.style.paddingTop = "0";
topnav.style.position = "relative";
} // else
}; // figerVolet
// retourne un tableau JS des parametres url
// on peut les acceder selon parseQueryString() ["nomParametre"]
parseQueryString = function () {
var str, objURL;
str = window.location.search;
objURL = {};
str.replace(new RegExp("([^?=&]+)(=([^&]*))?", "g"),
function ($0, $1, $2, $3) {
objURL[$1] = $3;
}
);
return objURL;
}; // parseQueryString
// indique la position "sommet" du document en cas de scroll
scrolltop = function () {
var top = 0;
if (typeof (window.pageYOffset) == "number") {
top = window.pageYOffset;
} else if (document.body && document.body.scrollTop) {
top = document.body.scrollTop;
} else if (document.documentElement && document.documentElement
.scrollTop) {
top = document.documentElement.scrollTop;
}
return top;
}; // scrolltop
// Fonction principale qui appelle les autres...
codePrincipal = function () {
// Cache les zones vides de l'apparence
// prend tous les td qui sont vides et les cache
$$('td[vAlign][width]:not(.comm_main_right)')
.filter(function () {
return $$.trim($$(this).text()).length === 0;
})
.hide();
// attrape les evenement de chargement de la fenetre, du changement
// de sa dimension, ou du scroll de la souris pour recalculer
// si le menu de tete doit etre fixe ou flottant
window.addEventListener("scroll", figerVolet);
window.addEventListener("resize", figerVolet);
window.addEventListener("load", figerVolet);
$$(document).ready(function () {
scriptsWebReports();
$('td.taille,td.Profondeur,td.NbGroupes,'+
'td.NbGroupesX,td.NbUtilisateurs,td.NbSupprimes,' +
'td.options').click(function clickClicTaille() {
analyseDossier(this);
});
}); //.ready
}; // codePrincipal
// retourne le dataid associe a la rangee ou a la case
// cliquee
UIGetDataid = function ($dom) {
var ret;
try {
$tr = $dom.closest('tr');
ret = $tr.find('.dataid').text();
ret = $.trim(ret);
} catch (e) { } // catch
return ret;
}; // UIGetDataid
UIGetRangee = function (dataid) {
return $('#tr' + dataid);
}; // UIGetRangee
// retourne la case DOM qui est associee au dataid
// avec le classe nommee
UIGetCase = function (dataid, classe) {
return UIGetRangee(dataid).find(classe);
}; // UIGetCase
// appelle le WR qui retourne la taille du dossier en format
// JSON
// si sourceid est defini alors on passe le id d'un LR
// different comme source du WR
// si success2 est defini utilise cette methode pour traiter
// le resultat
WRGetTailleDossier = function (dataid, callback, sourceid) {
var url;
// WR Connaitre la taille d'un dossier
url = "?inputlabel1=" + dataid +
"&func=ll&objId=" + WRConnaitreTailleDossier +
"&objAction=RunReport";
if (typeof sourceid !== "undefined") {
url += "&sourceid=" + sourceid;
} //if
$.ajax({
dataType: "json", // expected format for response
contentType: "application/json", // send as JSON
url: url,
success: function success(data) {
callback(data);
}, // success
error: function error(data) {
console.error('Erreur pour recupérer les données :'+ dataid);
} // success
}); // ajax
}; // WRGetTailleDossier
// analyse en detail le contenu d'un dossier
detailsDroits = function (dataid) {
// indique le traitement
// .Profondeur,
UIGetCase(dataid, ".NbGroupes, .NbGroupesX, .NbUtilisateurs, .NbSupprimes")
.text('analyse...');
WRGetTailleDossier(dataid, function (data) {
var NbGroupes, NbGroupesX, NbUtilisateurs, NbSupprimes;
NbGroupes = NbGroupesX = NbUtilisateurs = NbSupprimes = 0;
//alert(data.length);
$.each(data, function (index, value) {
//alert(index + ": " + value);
switch (data[index].TYPE) {
case "Supprimé": NbSupprimes++; break;
case "groupe": NbGroupes++; break;
case "groupe X": NbGroupesX++; break;
case "utilisateur": NbUtilisateurs++; break;
} // switch
}); // each
UIGetCase(dataid, ".NbGroupes").text(NbGroupes);
UIGetCase(dataid, ".NbGroupesX").text(NbGroupesX);
UIGetCase(dataid, ".NbUtilisateurs").text(NbUtilisateurs);
UIGetCase(dataid, ".NbSupprimes").text(NbSupprimes);
}, LRDroitsUniquesStructure); //WRGetTailleDossier
}; //detailsDroits
analyseDossier = function (dom) {
var $case, $tr, url, dataid, $this;
dataid = UIGetDataid($(dom));
// 1. oter l'evement click de toutes les cases
UIGetCase(dataid, '*').unbind('click');
// indique le traitement
UIGetCase(dataid, '.options')
.text('Vérifie structure ...');
WRGetTailleDossier(dataid, function (data) {
var $case, txt, taille, tailleI;
try {
taille = data[0].TAILLE;
tailleI = parseInt(taille);
} catch (e) {
alert('erreur');
}
UIGetCase(dataid, '.taille').text(taille);
$case = UIGetCase(dataid, '.options')
if (taille > SeuilTailleStructure) {
$case.text('Ce dossier est trop volumineux :( ' +
SeuilTailleStructure + ' élements maximum).');
} else {
$case.html('<a href="?func=ll&objAction=runReport' +
'&objid=' + WRDroitsUniquesStructure +
'&inputlabel1=' + dataid +
'" target="_blank">' +
'Voir détails des droits uniques</a>');
// analyse en detail le contenu d'un dossier
detailsDroits(dataid);
} // else
}); //WRGetTailleDossier
}; //analyseDossier
codePrincipal();
}; // fonction anonyme
ApparenceHQ.AppTrousseGestionProjet.CodeSecondaire(window.jQuery);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment