vtiger 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/vtiger/base.rb +15 -0
- metadata +4 -4
data/lib/vtiger/base.rb
CHANGED
@@ -37,6 +37,14 @@ class CampaignList < ActiveRecord::Base
|
|
37
37
|
mysql_results=CampaignList.connection.execute("select vtiger_contactdetails.email, vtiger_contactdetails.firstname, vtiger_contactdetails.lastname, vtiger_campaigncontrel.campaignid from vtiger_contactdetails left join vtiger_campaigncontrel on vtiger_contactdetails.contactid=vtiger_campaigncontrel.contactid where vtiger_campaigncontrel.campaignid=#{id} and emailoptout=0;")
|
38
38
|
CampaignList.convert(mysql_results)
|
39
39
|
end
|
40
|
+
def self.find_leads_by_campaign(id)
|
41
|
+
mysql_results=CampaignList.connection.execute("select vtiger_leaddetails.email, vtiger_leaddetails.firstname, vtiger_leaddetails.lastname, vtiger_campaignleadrel.campaignid from vtiger_leaddetails left join vtiger_campaignleadrel on vtiger_leaddetails.leadid=vtiger_campaignleadrel.leadid where vtiger_campaignleadrel.campaignid=#{id};")
|
42
|
+
CampaignList.convert(mysql_results)
|
43
|
+
end
|
44
|
+
def self.find_accounts_by_campaign(id)
|
45
|
+
mysql_results=CampaignList.connection.execute("select vtiger_account.email1, vtiger_account.accountname, vtiger_campaignaccountrel.campaignid from vtiger_account left join vtiger_campaignaccountrel on vtiger_account.accountid=vtiger_campaignaccountrel.accountid where vtiger_campaignaccountrel.campaignid=#{id} and emailoptout=0;;")
|
46
|
+
CampaignList.convert(mysql_results)
|
47
|
+
end
|
40
48
|
end
|
41
49
|
module Vtiger
|
42
50
|
class Base
|
@@ -210,6 +218,13 @@ def accessdatabase(dbhost, dbname, dbuser,dbpasswd)
|
|
210
218
|
CampaignList.scott_connect(dbhost, dbname, dbuser,dbpasswd)
|
211
219
|
|
212
220
|
|
221
|
+
end
|
222
|
+
def get_list_from_campaign(campaignid,type)
|
223
|
+
#self.campaigndb.find_contacts_by_campaign(self.campaigndb,campaignid)
|
224
|
+
list=CampaignList.find_leads_by_campaign(campaignid) if type=='Leads'
|
225
|
+
list=CampaignList.find_accounts_by_campaign(campaignid) if type=='Accounts'
|
226
|
+
list=CampaignList.find_contacts_by_campaign(campaignid) if type=='Contacts'
|
227
|
+
list
|
213
228
|
end
|
214
229
|
def get_contacts_from_campaign(campaignid)
|
215
230
|
#self.campaigndb.find_contacts_by_campaign(self.campaigndb,campaignid)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vtiger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 2
|
10
|
+
version: 0.5.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Scott Sproule
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-11-07 00:00:00 +08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|