w3Admin.w3Groups.process

subroutine w3Admin.w3Groups.process(errors)

*

* [00] 28Jun99 jr Initial creation

*

include wbp w3Include

CRT "w3Groups.process"

ids         = 0

description = ""

groupname   = ""

addmembers  = ""

dropmembers = ""                  

deleteit    = ""

errors      = ""

call w3GetVal(ids, "IDS")    ;* ~ delinated list of item ids

convert "~" to @AM in ids

rows = count(ids, @am)       ;* process add separately

for i = 1 to rows

*   get user data

    call w3GetVal(description, "GROUP":i)

    call w3GetVal(addmembers, "]ADD":i)

    call w3GetVal(dropmembers, "]REMOVE":i)

    call w3GetVal(deleteit, "DEL":i)

    if deleteit = "" then deleteit = 0 else deleteit = 1      

    CRT "Group: ":description

    if deleteit then

       call w3GroupEntryDelete(ids<i+1>, errors)

       if errors # "" then errors = "Group ":description:@AM:errors

    end else

       if dropmembers # "" then

          call w3GroupDropMembers(ids<i+1>, dropmembers, errors)

       end

       if addmembers # "" then

         call w3GroupAddMembers(ids<i+1>, addmembers, errors)

       end

       * since we can't tell if the name changed w/o a business rule

       * call, call the name change routine and let it decide

       call w3GroupChangeName(ids<i+1>, description, errors)

    end

next i

*   Check for add

call w3GetVal(description, "GROUP":rows+1)

call w3GetVal(addmembers, "]ADD":rows+1)

if description # "" then

   call w3GroupNew(description, addmembers, errors)

end

   

CRT "Errors: ":errors   

return