Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add support for private.timetracker.search API method

  • Loading branch information...
commit 2e00031f14fac7a8fa613330ab85e317035f16e2 1 parent 79210da
Jesse Newland authored May 24, 2010
1  TODO
@@ -8,7 +8,6 @@ private.request.getTimeEvents
8 8
 private.request.getMailboxes
9 9
 private.request.merge
10 10
 private.filter.getColumnNames
11  
-private.timetracker.search
12 11
 private.user.getFilters
13 12
 private.user.preferences
14 13
 private.util.getActiveStaff
4  lib/help_spot.rb
@@ -58,6 +58,10 @@ def filter(id, options = {})
58 58
     api_request(:get, 'private.filter.get', options.merge(:xFilter => id), {:collection => 'filter', :item => 'request'})
59 59
   end
60 60
 
  61
+  def search_time_events(options = {})
  62
+    api_request(:get, 'private.timetracker.search', options, {:collection => 'time_events', :item => 'event'})
  63
+  end
  64
+
61 65
 private
62 66
 
63 67
   def api_request(http_method, method, options = {}, munge_options = {})
29  spec/fixtures/private.timetracker.search.xml
... ...
@@ -0,0 +1,29 @@
  1
+<?xml version="1.0" encoding="iso-8859-1"?>
  2
+<time_events>
  3
+  <event>
  4
+    <xTimeId>4502</xTimeId>
  5
+    <xRequest>12481</xRequest>
  6
+    <xPerson>Ian Landsman</xPerson>
  7
+    <iSeconds>5400</iSeconds>
  8
+    <dtGMTDate>June  9, 2008</dtGMTDate>
  9
+    <dtGMTDateAdded>June  9 2008, 11:48 AM</dtGMTDateAdded>
  10
+    <tDescription>Fixed 3rd floor network printer</tDescription>
  11
+    <sUserId>76548</sUserId>
  12
+    <sFirstName>Ian</sFirstName>
  13
+    <sLastName>Landsman</sLastName>
  14
+    <sEmail>ian@userscape.com</sEmail>
  15
+  </event>
  16
+  <event>
  17
+    <xTimeId>4503</xTimeId>
  18
+    <xRequest>12481</xRequest>
  19
+    <xPerson>Ian Landsman</xPerson>
  20
+    <iSeconds>5400</iSeconds>
  21
+    <dtGMTDate>June  9, 2008</dtGMTDate>
  22
+    <dtGMTDateAdded>June  9 2008, 11:49 AM</dtGMTDateAdded>
  23
+    <tDescription>Fixed 4th floor network printer</tDescription>
  24
+    <sUserId>76548</sUserId>
  25
+    <sFirstName>Ian</sFirstName>
  26
+    <sLastName>Landsman</sLastName>
  27
+    <sEmail>ian@userscape.com</sEmail>
  28
+  </event>
  29
+</time_events>
8  spec/help_spot_spec.rb
@@ -84,4 +84,12 @@
84 84
       requests.first.tNote.should == 'I would like to be able to upload documents over 1 gigabyte.'
85 85
     end
86 86
   end
  87
+  describe 'time tracking events' do
  88
+    it "can be searched" do
  89
+      @help_spot.stub_get('/api/index.php?method=private.timetracker.search&start_time=1', 'private.timetracker.search.xml')
  90
+      time_events = @help_spot.search_time_events(:start_time => 1)
  91
+      time_events.size.should == 2
  92
+      time_events.first.iSeconds.should == "5400"
  93
+    end
  94
+  end
87 95
 end

0 notes on commit 2e00031

Please sign in to comment.
Something went wrong with that request. Please try again.