Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

101 Zeilen
3.9KB

  1. <%
  2. '=======================================================================================================================
  3. ' BUSINESS HELPERS: domain vocabulary (touch methods, outcomes, statuses) and list query-string building
  4. '=======================================================================================================================
  5. ' Touch methods and outcomes: Array(key, label)
  6. Function Businesses_Methods()
  7. Businesses_Methods = Array(Array("call", "Call"), Array("email", "Email"), Array("visit", "Visit"), Array("mail", "Mailed"))
  8. End Function
  9. Function Businesses_Outcomes()
  10. Businesses_Outcomes = Array( _
  11. Array("no_answer", "No answer"), _
  12. Array("left_voicemail", "Left voicemail"), _
  13. Array("spoke_with_someone", "Spoke with someone"), _
  14. Array("interested", "Interested"), _
  15. Array("follow_up_later", "Follow up later"), _
  16. Array("not_interested", "Not interested"), _
  17. Array("wrong_number", "Wrong number"), _
  18. Array("remove", "Remove from list") _
  19. )
  20. End Function
  21. ' Label for a key in one of the Array(key, label) lists above (the key itself when unknown).
  22. Function Businesses_Label(list, key)
  23. Dim item
  24. Businesses_Label = key & ""
  25. For Each item In list
  26. If item(0) = key Then Businesses_Label = item(1)
  27. Next
  28. End Function
  29. Function Businesses_IsKey(list, key)
  30. Dim item
  31. Businesses_IsKey = False
  32. For Each item In list
  33. If item(0) = key Then Businesses_IsKey = True
  34. Next
  35. End Function
  36. Function Businesses_StatusLabel(s)
  37. Select Case s
  38. Case "new": Businesses_StatusLabel = "New"
  39. Case "contacted": Businesses_StatusLabel = "Contacted"
  40. Case "follow_up": Businesses_StatusLabel = "Follow-up"
  41. Case "removed": Businesses_StatusLabel = "Removed"
  42. Case Else: Businesses_StatusLabel = s & ""
  43. End Select
  44. End Function
  45. Function Businesses_StatusClass(s)
  46. Select Case s
  47. Case "new": Businesses_StatusClass = "text-bg-secondary"
  48. Case "contacted": Businesses_StatusClass = "text-bg-info"
  49. Case "follow_up": Businesses_StatusClass = "text-bg-warning"
  50. Case "removed": Businesses_StatusClass = "text-bg-dark"
  51. Case Else: Businesses_StatusClass = "text-bg-light"
  52. End Select
  53. End Function
  54. ' Splits pasted text like "a@x.com;b@y.com" (also commas, spaces, new lines) into addresses.
  55. ' Returns Dictionary("valid" -> Dictionary(lowercased email -> 1), "invalid" -> Dictionary(index -> text)).
  56. Function BulkLog_ParseEmails(text)
  57. Dim re, parts, p, valid, invalid, result
  58. Set valid = CreateObject("Scripting.Dictionary")
  59. Set invalid = CreateObject("Scripting.Dictionary")
  60. Set re = New RegExp
  61. re.Pattern = "^[^@\s;,]+@[^@\s;,]+\.[^@\s;,]+$"
  62. parts = Split(Replace(Replace(Replace(Replace(text & "", vbCrLf, ";"), vbLf, ";"), ",", ";"), vbTab, ";"), ";")
  63. For Each p In parts
  64. p = LCase(Trim(Replace(p, " ", "")))
  65. If Len(p) > 0 And Len(p) <= 255 Then
  66. If re.Test(p) Then
  67. valid(p) = 1
  68. Else
  69. invalid.Add invalid.Count, Left(p, 80)
  70. End If
  71. End If
  72. Next
  73. Set result = CreateObject("Scripting.Dictionary")
  74. Set result("valid") = valid
  75. Set result("invalid") = invalid
  76. Set BulkLog_ParseEmails = result
  77. End Function
  78. ' Query string for the list: current filters with optional page / sort overrides.
  79. Function Businesses_QS(f, page, sort, dir)
  80. Dim k, s
  81. s = ""
  82. For Each k In Array("q", "industry", "area", "status", "show", "contacted", "phone")
  83. If f.Exists(k) Then
  84. If Len(f(k)) > 0 Then s = s & "&" & k & "=" & Server.URLEncode(f(k))
  85. End If
  86. Next
  87. If Len(sort) > 0 Then s = s & "&sort=" & Server.URLEncode(sort)
  88. If Len(dir) > 0 Then s = s & "&dir=" & Server.URLEncode(dir)
  89. If page > 1 Then s = s & "&page=" & page
  90. If Len(s) > 0 Then Businesses_QS = "?" & Mid(s, 2) Else Businesses_QS = ""
  91. End Function
  92. %>

Powered by TurnKey Linux.