vtiger 0.4.7 → 0.4.9

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/bin/query.rb CHANGED
@@ -33,7 +33,7 @@ require 'pp'
33
33
  cmd = Vtiger::Commands.new()
34
34
  cmd.challenge(options)
35
35
  cmd.login(options)
36
- cmd.query(options)
36
+ puts cmd.query(options)
37
37
  # consumer_session.close
38
38
  # puts "#{result}"
39
39
  # sleep(1)
@@ -144,6 +144,20 @@ module Vtiger
144
144
  return res["success"],ticketlist
145
145
 
146
146
  end
147
+
148
+ def get_campaigns
149
+ puts "in get campaigns"
150
+ action_string=ERB::Util.url_encode("select id,campaignname from Campaigns;")
151
+ # puts "action string:" +action_string
152
+ res = http_ask_get(self.endpoint_url+"operation=query&sessionName=#{self.session_name}&query="+action_string)
153
+ puts "TT RES: #{res["result"]} class: #{res["result"].class}"
154
+ values=res["result"] if res["success"]==true #comes back as array
155
+ #puts values.inspect
156
+ # return the account id
157
+ ## values.each {|v| ticketlist << v['ticket_no'] }
158
+ return res["success"],values
159
+
160
+ end
147
161
  def check_open_tt_by_contact(contact)
148
162
  puts "in query open tt by contact"
149
163
  action_string=ERB::Util.url_encode("select id,ticket_no from HelpDesk where parent_id = '#{contact}' and ticketstatus like 'Open';")
data/test/test_vtiger.rb CHANGED
@@ -17,7 +17,17 @@ class TestVtiger < Test::Unit::TestCase
17
17
  assert challenge,"challenge is false"
18
18
  assert login,"login is false"
19
19
  end
20
-
20
+ def test_get_campaigns
21
+ cmd = Vtiger::Commands.new()
22
+ @options[:username]='admin'
23
+ challenge=cmd.challenge(@options)
24
+ login=cmd.login(@options)
25
+ success,values=cmd.get_campaigns()
26
+ assert challenge,"challenge is false "
27
+ assert login,"login should succeed"
28
+ assert success,"find campaigns should success"
29
+ puts "CAMPAIGNS #{values}"
30
+ end
21
31
  def test_api_login
22
32
  Vtiger::Api.api_settings = {
23
33
  :username => 'admin',
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: 1
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 7
10
- version: 0.4.7
9
+ - 9
10
+ version: 0.4.9
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-07-18 00:00:00 +08:00
18
+ date: 2010-10-22 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies: []
21
21