|
注意:
1. 代码是在自定义->set up workflow中定义的,
2. 请找到相关的function进行修改。需要具备一定vb代码基础。
3. 不光是Fixed状态,大家可以灵活运用,根据自己的需要
4. 我本人已经试过没有问题.
最后,代码是一行一行整理的,大家要珍惜啊
' variable global to defect module
dim CommentFieldFlag
Function Defects_Bug_CanPost
On Error Resume Next
' checks for Status of "Fixed" and comments flag = true else allows the user post defect
If Not Bug_Fields("BG_BUG_ID").IsNull AND Bug_Fields("BG_STATUS").Value = "Fixed" Then
If CommentFieldFlag = True then
Defects_Bug_CanPost = True
Else
Defects_Bug_CanPost = False
MsgBox "lease add a comment (using the Add Comments button) with information about the fix.",VbInformation ,"No Comment Warning"
End If
Else
Defects_Bug_CanPost = True
End If
'comment out or delete this next line if there by default
'Defects_Bug_CanPost = Project_DefaultRes
On Error GoTo 0
End Function
Sub Defects_Bug_AfterPost
On Error Resume Next
' resets the flag after each defect is posted
CommentFieldFlag = False
On Error GoTo 0
End Sub
Sub Defects_EnterModule
On Error Resume Next
' initialises flag
CommentFieldFlag = False
On Error GoTo 0
End Sub
Sub Defects_Bug_FieldChange(FieldName)
On Error Resume Next
' sets flag for comments when comments updated
If FieldName = "BG_DEV_COMMENTS" then
CommentFieldFlag = True
End If
On Error GoTo 0
End Sub
[ 本帖最后由 joshfang 于 2008-4-25 13:20 编辑 ] |
|