vtiger 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/query.rb +2 -2
- data/lib/vtiger/commands.rb +22 -0
- metadata +4 -4
data/bin/query.rb
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
# == Synopsis
|
3
3
|
# Query the vtiger server
|
4
4
|
# == Usage
|
5
|
-
#
|
5
|
+
# query.rb -u website -n username -k accesskey -q sql_query string
|
6
6
|
#
|
7
7
|
# == Useful commands
|
8
|
-
#
|
8
|
+
# query.rb -u democrm.estormtech.com -n scott -k xxxxx -q 'select * from Accounts;'
|
9
9
|
# == Author
|
10
10
|
# Scott Sproule --- Ficonab.com (scott.sproule@ficonab.com)
|
11
11
|
# == Copyright
|
data/lib/vtiger/commands.rb
CHANGED
@@ -144,6 +144,28 @@ module Vtiger
|
|
144
144
|
return res["success"],ticketlist
|
145
145
|
|
146
146
|
end
|
147
|
+
#extraparams like ',cf_579'
|
148
|
+
# one day ago --- Time.now-60*60*24
|
149
|
+
# eg v.find_items_by_date('Contacts',to_s,'cf_579')
|
150
|
+
|
151
|
+
def find_items_by_date(element,date,extraparam=nil)
|
152
|
+
puts "in query by date "
|
153
|
+
queryparams=''
|
154
|
+
queryparams=",#{extraparam}" if extraparam!=nil
|
155
|
+
t=Time.parse(date)
|
156
|
+
y=t.strftime('%Y-%m-%d')
|
157
|
+
action_string=ERB::Util.url_encode("select id#{queryparams} from #{element} where createdtime like '#{y}%';")
|
158
|
+
# puts "action string:" +action_string
|
159
|
+
res = http_ask_get(self.endpoint_url+"operation=query&sessionName=#{self.session_name}&query="+action_string)
|
160
|
+
puts "TT RES: #{res["result"]} class: #{res["result"].class}"
|
161
|
+
values=res["result"] if res["success"]==true #comes back as array
|
162
|
+
#puts values.inspect
|
163
|
+
# return the account id
|
164
|
+
# ticketlist=[]
|
165
|
+
# values.each {|v| ticketlist << v['ticket_no'] }
|
166
|
+
return res["success"],values
|
167
|
+
|
168
|
+
end
|
147
169
|
|
148
170
|
def get_campaigns
|
149
171
|
puts "in get 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: 3
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 4
|
10
|
+
version: 0.5.4
|
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:
|
18
|
+
date: 2011-01-15 00:00:00 +08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|