// Path of the Master database:
var DBNameHTML = "/clients/yunio/yunio-internet.nsf";
// Path of the current database:
var DBNameHTML_C = "";
var sPathName = document.location.pathname;
var iNSFPos = sPathName.toUpperCase().indexOf( ".NSF" );
if( iNSFPos == -1 ){
var iSlashPos = sPathName.indexOf( "/", 1 );
DBNameHTML_C = sPathName.substring( 0, iSlashPos );
} else {
DBNameHTML_C = sPathName.substring( 0, iNSFPos + 4 );
}
var iCountGlobal = 0;
// View entry objects array
var aVE = new Array();
// Array with pointer to the view entry objects array
var aVI = new Array();
function TDB( className ) { document.write( "
" ) }
function TDE() { document.write( " | " ) }
function TRB( className) { document.write( "" ) }
function TRE() { document.write( "
" ) }
function openDoc( docID ) {
// Opens the document given by DocumentUniqueID in read mode.
document.location = DBNameHTML_C + "/0/" + docID + "?OpenDocument";
}
function viewEntry( v1 , v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20 ) {
// Object constructor
this.v1 = v1; this.v2 = v2; this.v3 = v3; this.v4 = v4; this.v5 = v5; this.v6 = v6; this.v7 = v7; this.v8 = v8; this.v9 = v9; this.v10 = v10;
this.v11 = v11; this.v12 = v12; this.v13 = v13; this.v14 = v14; this.v15 = v15; this.v16 = v16; this.v17 = v17; this.v18 = v18; this.v19 = v19; this.v20 = v20;
}
function viewIndex( iPtr, sortItem ) {
// Object constructor
this.iPtr = iPtr;
this.sortItem = sortItem;
}
function findIndex( sSortItem ) {
if( iCountGlobal == 0 ) return 0;
for( var i=0; i < iCountGlobal; i++ ) {
if( sSortItem < aVI[i].sortItem ) {
return i;
}
}
return iCountGlobal;
}
function vE( v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20 ) {
// Create an object instance in the array
// 1=Title, 2=DocID, 3=Summary, 4=docType, 5=Keywords, 6=PublishingDate, 7=docAddress, 8=docPC, 9=docCity, 10=docCountry, 11=docPhone, 12=docFax, 13=docWWW, 14=docEmail, 15=docImageStoreDoc, 16=docImageName ) {
// Original Sorting Routine by vE
// oViewEntry = new viewEntry( v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20 );
// Here you define what value this script should sort on, in this example v1
// viewIndex( iCountGlobal, v1 );
// oViewIndex = new viewIndex( iCountGlobal, v6 );
// Changed sorting routine, date (year, month, day) displaying date as (day month, year)
oViewEntry = new viewEntry( v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20 );
//change date format
iDashPos = v6.split( '-' );
altDate = iDashPos[2] + iDashPos[1] + iDashPos[0];
//sort on altDate
oViewIndex = new viewIndex( iCountGlobal, altDate );
if (aVE.push ) {
pushed = aVE.push( oViewEntry );
aVI.splice( findIndex( oViewIndex.sortItem ), 0, oViewIndex );
} else {
// push method is not supported, using concat
aVE = aVE.concat( oViewEntry );
if( aVE.splice ) {
aVI.splice( findIndex( oViewIndex.sortItem), 0, oViewIndex );
} else {
// splice method is not supported, using slice to construct the new array.
var iIndex = findIndex( oViewIndex.sortItem );
aStart = aVI.slice( 0, iIndex );
aEnd = aVI.slice( iIndex );
aVI = aStart.concat( oViewIndex, aEnd );
}
}
iCountGlobal++;
}
function writeTable() {
// Write out the final HTML
var sRowClass;
// Enable the next line to reverse the views' sorting:
aVI.reverse();
if( aVE.length == 0 ) {
TRB('');
TDB( 'Even' );
document.write( '-' );
TDE()
TRE();
} else {
var iMaxLength = aVE.length;
if( aVE.length < iMaxLength ){
iMaxLength = aVE.length;
}
//aViewEntries.reverse();
for( var i=0; i < iMaxLength; i++ ) {
TRB('');
TDB( sRowClass );
document.write( '' + aVE[aVI[i].iPtr].v1 + '
');
document.write( '' + aVE[aVI[i].iPtr].v6 + '
');
document.write( '' + aVE[aVI[i].iPtr].v3 + '');
document.write( '
');
// Alternatief voor als je wil dat de hele DIV tag klikbaar is, zonder gebruik te maken van A HREF:
// document.write( '' + aVE[aVI[i].iPtr].v1 + '
');
TDE();
TRE();
}
}
}