CustomerMultiBrowser.vbs
2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
'*********************************
'Show the multi customers selecting browser.
'@author lupeng
'@version 04/08/12
'*********************************
'****************************************************************************************
'Show the multi customers selecting browser, not needed.
'@param inputname the hidden or not input object name, it stores the selected customers' id.
'@param spanname the span object name, it shows the selected customers' name.
'****************************************************************************************
Sub onShowMultiCustomer(inputname, spanname)
Call onShowMultiCustomerBase(inputname, spanname, false)
End Sub
'****************************************************************************************
'Show the multi customers selecting browser, needed.
'@param inputname the hidden or not input object name, it stores the selected customers' id.
'@param spanname the span object name, it shows the selected customers' name.
'****************************************************************************************
Sub onShowMultiCustomerNeeded(inputname, spanname)
Call onShowMultiCustomerBase(inputname, spanname, true)
End Sub
'****************************************************************************************
'Show the multi customers selecting browser, the base function.
'@param inputname the hidden or not input object name, it stores the selected customers' id.
'@param spanname the span object name, it shows the selected customers' name.
'@param needed the flag that whether or not to need input.
'****************************************************************************************
Sub onShowMultiCustomerBase(inputname, spanname, needed)
tmpIds = document.all(inputname).value
retValue = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/CRM/data/MutiCustomerBrowser.jsp?resourceids="&tmpIds)
If (Not IsEmpty(retValue)) Then
If retValue(0) <> "" Then
resourceids = retValue(0)
resourcename = retValue(1)
sHtml = ""
resourceids = Mid(resourceids,2,len(resourceids))
document.all(inputname).value = resourceids
resourcename = Mid(resourcename,2,len(resourcename))
While InStr(resourceids,",") <> 0
curid = Mid(resourceids,1,InStr(resourceids,",")-1)
curname = Mid(resourcename,1,InStr(resourcename,",")-1)
resourceids = Mid(resourceids,InStr(resourceids,",")+1,Len(resourceids))
resourcename = Mid(resourcename,InStr(resourcename,",")+1,Len(resourcename))
sHtml = sHtml&"<A href=/CRM/data/ViewCustomer.jsp?CustomerID="&curid&" target='_blank'>"&curname&"</A> "
Wend
sHtml = sHtml&"<A href=/CRM/data/ViewCustomer.jsp?CustomerID="&resourceids&" target='_blank'>"&resourcename&"</A> "
document.all(spanname).innerHtml = sHtml
Else
document.all(inputname).value = ""
If needed Then
document.all(spanname).innerHtml = "<IMG src='/images/BacoError.gif' align=absMiddle>"
Else
document.all(spanname).innerHtml = ""
End If
End If
End If
End Sub