Skip to content

Instantly share code, notes, and snippets.

@styson
Created July 16, 2010 19:59
Show Gist options
  • Save styson/e9e4a571012f598cf068 to your computer and use it in GitHub Desktop.
Save styson/e9e4a571012f598cf068 to your computer and use it in GitHub Desktop.
<%@ Language=JavaScript %>
<% Response.Buffer = true %>
<%
///////////////////////////////////////////////////////////////////////////////
// Product : Dovetail Admin
//
// Series : Dovetail Software Web Series(tm)
//
// Name : workgroupList.asp
//
// Description : AJAX workgroup list builder
//
// Author : Dovetail Software, Inc.
// 4807 Spicewood Springs Rd, Bldg 4 Suite 200
// Austin, TX 78759
// (512) 610-5400
// EMAIL: support@dovetailsoftware.com
// www.dovetailsoftware.com
//
// Platforms : This version supports Clarify 4.5 and later
//
// Copyright (C) 2010 Dovetail Software, Inc.
// All Rights Reserved.
///////////////////////////////////////////////////////////////////////////////
%>
<!--#include file="../include/inc_page_init.asp"-->
<!--#include file="../include/json.asp"-->
<%
Array.prototype.contains = function(element) {
for(var i = 0; i < this.length; i++) {
if(this[i] == element) return true;
}
return false;
};
var lstWorkGroup = FCApp.GetHGbstList("WORKGROUP");
var boWorkgroup = FCSession.CreateGeneric("workgroup");
boWorkgroup.DataFields = "work_group";
boWorkgroup.Query();
var workgroupArray = [];
while(!boWorkgroup.EOF) {
workgroupArray.push(boWorkgroup("work_group").value);
boWorkgroup.MoveNext();
}
Response.Clear();
while(!lstWorkGroup.EOF) {
var title = lstWorkGroup("title");
if(!workgroupArray.contains(title)) {
Response.Write("<div class='workgroup'>" + title + "</div>");
}
lstWorkGroup.MoveNext();
}
boWorkgroup.CloseGeneric();
boWorkgroup=null;
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment