w3Admin.w3Groups.form

subroutine w3Admin.w3Groups.form(errorMessages)

*

* Creates the w3Groups maintenance Web form

*

* [00] 28Jun99 jr Initial creation

* [01] 06Jan99 jr Use one template, w3Groups

*

include wbp w3Include

include bp w3Admin.Include

CRT "w3Admin.w3Groups.form"

 

* Files opened and background set by w3Group.driver

call w3HtmlInit(w3Admin.background,"")

subs = ""

subs<-1> =  "#HEADLINE#":@VM:"FlashCONNECT Group Maintenance"

subs<-1> =  "##TITLE##":@VM:"FlashCONNECT Group Maintenance"

call w3HtmlHeader("",subs)

* insert any error messages

if not(assigned(errorMessages)) then errorMessages = ""

if errorMessages # "" then

   call w3Admin.InsertErrors(errorMessages)

end

call w3HtmlFormBeg(w3_NP,"")

* set up formname, table definition

call w3HtmlInsertSection("w3Groups", "","head")

* get a table of all members and their names

users = ""

call w3Admin.w3Users.GetIdName(users, status) ;* A1 = Id, A2 = name

if status # "" then

   call w3Admin.InsertErrors(status)

   return

end

call w3Admin.w3Groups.GetInfo(groupname, description, groupmembers, groupnonmembers)

if status # "" then

   call w3Admin.InsertErrors(status)

   return

end

numGroups = dcount(groupname, @AM)

*   add existing groups

IdList=""

for i = 1 to numGroups

*   insert the group name to the start of the member list

    subs = ""

    subs<-1> = "#ROW#":@VM:i

    subs<-1> = "#GROUP#":@VM:description<i>

    IdList := "~":groupname<i>

    call w3HtmlInsertSection("w3Groups", subs,"detail1")

    numMembers = dcount(groupmembers<i>, @VM)

    for j = 1 to numMembers               

*   convert the user id to a name                

        id = groupmembers<i,j>

        locate(id, users, 1; loc) then

             name = users<2, loc>

             if trim(name) = "" then name = id

             subs = ""

             subs<-1>="#VALUE#":@VM:name

             subs<-1>="#NAME#" :@VM:id

             call w3HtmlInsertSection("w3Groups", subs,"select.option")

        end

    next j

    subs = ""

    subs<-1> = "#ROW#":@VM:i

    call w3HtmlInsertSection("w3Groups", subs,"detail2")

    numNonmembers = dcount(groupnonmembers<i>, @VM)

    for j = 1 to numNonmembers

*   convert the user id to a name                

        id = groupnonmembers<i,j>

        locate(id, users, 1; loc) then

             name = users<2, loc>

             if trim(name) = "" then name = id

             subs = ""

             subs<-1>="#VALUE#":@VM:name

             subs<-1>="#NAME#" :@VM:id

             call w3HtmlInsertSection("w3Groups", subs, "select.option")

        end

    next j

  

    subs = ""

    subs<-1> = "#ROW#":@VM:i

    call w3HtmlInsertSection("w3Groups", subs, "detail3")

next i

subs = ""

subs<-1> = "#ROW#":@VM:i

call w3HtmlInsertSection("w3Groups", subs, "add1")

numNonmembers = dcount(users<1>, @Vm)

for j = 1 to numNonmembers

    id   = users<1, j>

    name = users<2, j>

    if trim(name) = "" then name = id

    subs = ""

    subs<-1>="#VALUE#":@VM:name

    subs<-1>="#NAME#" :@VM:id

    call w3HtmlInsertSection("w3Groups", subs, "select.option")

next j

call w3HtmlInsertSection("w3Groups","", "add2")

subs = ""

subs<-1> = "#IDS#":@VM:IdList

call w3HtmlInsertSection("w3Groups",subs, "end")

call w3HtmlFormEnd

*  Get the path which got us here so we can set it in the template

Action = ""

call w3Action(Action, "")

subs   = "#ACTION#":@vm:Action

call w3HtmlFooter("",subs)

return