vtiger 0.5.6 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/vtiger/commands.rb +21 -0
- metadata +4 -4
data/lib/vtiger/commands.rb
CHANGED
@@ -187,6 +187,27 @@ module Vtiger
|
|
187
187
|
return res["success"],values
|
188
188
|
|
189
189
|
end
|
190
|
+
#extraparams like ',cf_579'
|
191
|
+
# one day ago --- Time.now-60*60*24
|
192
|
+
# eg v.find_items_by_date_and_key_null('Contacts',to_s,'cf_579',"")
|
193
|
+
def find_items_by_date_and_key_null(element,date,key, extraparam=nil)
|
194
|
+
puts "in query by date and not null "
|
195
|
+
queryparams=''
|
196
|
+
queryparams=",#{extraparam}" if extraparam!=nil
|
197
|
+
t=Time.parse(date)
|
198
|
+
y=t.strftime('%Y-%m-%d')
|
199
|
+
action_string=ERB::Util.url_encode("select id,#{key}#{queryparams} from #{element} where createdtime like '#{y}%' and #{key} LIKE '';")
|
200
|
+
puts "action string:" +action_string
|
201
|
+
res = http_ask_get(self.endpoint_url+"operation=query&sessionName=#{self.session_name}&query="+action_string)
|
202
|
+
puts "TT RES: #{res["result"]} class: #{res["result"].class}"
|
203
|
+
values=res["result"] if res["success"]==true #comes back as array
|
204
|
+
#puts values.inspect
|
205
|
+
# return the account id
|
206
|
+
# ticketlist=[]
|
207
|
+
# values.each {|v| ticketlist << v['ticket_no'] }
|
208
|
+
return res["success"],values
|
209
|
+
|
210
|
+
end
|
190
211
|
def get_campaigns
|
191
212
|
puts "in get campaigns"
|
192
213
|
action_string=ERB::Util.url_encode("select id,campaignname from Campaigns;")
|
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: 5
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 7
|
10
|
+
version: 0.5.7
|
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: 2011-
|
18
|
+
date: 2011-02-09 00:00:00 +08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|