vtiger 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/vtiger/commands.rb +21 -1
  2. metadata +4 -4
@@ -166,7 +166,27 @@ module Vtiger
166
166
  return res["success"],values
167
167
 
168
168
  end
169
-
169
+ #extraparams like ',cf_579'
170
+ # one day ago --- Time.now-60*60*24
171
+ # eg v.find_items_by_date_and_key_not_null('Contacts',to_s,'cf_579',"")
172
+ def find_items_by_date_and_key_not_null(element,date,key, extraparam=nil)
173
+ puts "in query by date and not null "
174
+ queryparams=',key'
175
+ queryparams=",#{extraparam}" if extraparam!=nil
176
+ t=Time.parse(date)
177
+ y=t.strftime('%Y-%m-%d')
178
+ action_string=ERB::Util.url_encode("select id#{queryparams} from #{element} where createdtime like '#{y}%' and #{key} != '';")
179
+ # puts "action string:" +action_string
180
+ res = http_ask_get(self.endpoint_url+"operation=query&sessionName=#{self.session_name}&query="+action_string)
181
+ puts "TT RES: #{res["result"]} class: #{res["result"].class}"
182
+ values=res["result"] if res["success"]==true #comes back as array
183
+ #puts values.inspect
184
+ # return the account id
185
+ # ticketlist=[]
186
+ # values.each {|v| ticketlist << v['ticket_no'] }
187
+ return res["success"],values
188
+
189
+ end
170
190
  def get_campaigns
171
191
  puts "in get campaigns"
172
192
  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: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 4
10
- version: 0.5.4
9
+ - 5
10
+ version: 0.5.5
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-01-15 00:00:00 +08:00
18
+ date: 2011-01-30 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies: []
21
21