User's Requirement
When a User click a button in the Requirements module QC shows the list of Profiles of the connected user.
Proposed Solution
Creation of a custom button on the Requirements toolbar with a "little man" icon that when clicked call a function that returns the Profiles List through a msgbox window.
________________________________________________________________________________
Implementation on the Product
Please refer to explanation on how to create a custom button that you can find in "Toolbar Button Editor" under WorkFlow Script Editor.
Suppose that the name of the Action join to the custom button is
actUserGroupList, we'll do these operations:
1. Call the Sub under Requirements Module
Function ActionCanExecute(ActionName)
On Error Resume Next
Dim Res
Res = True
if ActionName = "actUserGroupList" then
Req_UserGroupList
end if
ActionCanExecute = Res
On Error Goto 0
End Function
2. Main Sub under Requirements Module
Sub Req_UserGroupList
On Error Resume Next
Dim XmsgX, strElenco, arrElenco
XmsgX = "Users' Profiles" & vbNewLine & vbNewLine
strElenco = Req_ElencoProfili
'strElenco is the string variable consists on:
'ProfileName1||ProfileName2||...||ProfileNameN
'Create of an array splitting the variable on pipe ("||") chars if exist.
if instr(strElenco, "||") > 0 then
arrElenco = split(strElenco, "||")
for i = 0 to Ubound(arrElenco) - 1
XmsgX = XmsgX & arrElenco(i) & vbNewLine
next
else
XmsgX = XmsgX & strElenco & vbNewLine
end if
msgbox XmsgX, vbSystemModal + vbInformation, "Quality Center"
On Error Goto 0
End Sub
3. Function that returns the List of Profiles
Function Req_ElencoProfili
On Error Resume Next
Dim Res, thisUsr, theGrList
Res = ""
set thisUsr = TDConnection.Customization.Users.User(User.UserName)
set theGrList = thisUsr.GroupsList
for i=1 to thGrList.Count
Res = Res & i & ". " & thGrList.Item(i).Name & "||"
next
'Remove the last 2 pipes
Res = left(Res, len(Res)-2)
'Returns of the Result to the Function
Req_ElencoProfili = Res
On Error Goto 0
End Function
The result will be something similar to this window:
Questo sito è stato realizzato con Jimdo! Registra il tuo sito gratis su https://it.jimdo.com