lib/pt/client.rb in pt-0.5.5 vs lib/pt/client.rb in pt-0.5.6

- old
+ new

@@ -39,14 +39,22 @@ else project.activities.all end end + def get_work(project) + project.stories.all(:current_state => 'unscheduled,unstarted,started') + end + def get_my_work(project, user_name) project.stories.all :mywork => user_name end + def get_task_by_id(id) + get_projects.map {|project| project.stories.all(:id => id)}.flatten.first + end + def get_my_open_tasks(project, user_name) project.stories.all :owner => user_name end def get_my_tasks_to_estimate(project, user_name) @@ -76,10 +84,15 @@ def get_tasks_to_assign(project, user_name) project.stories.all.select{ |t| t.owned_by == nil } end + def get_member(project, query) + member = project.memberships.all.select{ |m| m.name.downcase == query.downcase || m.initials.downcase == query.downcase } + member.empty? ? nil : member.first + end + def get_members(project) project.memberships.all end def mark_task_as(project, task, state) @@ -104,6 +117,6 @@ def create_task(project, name, owner, requester, task_type) project.stories.create(:name => name, :owned_by => owner, :requested_by => requester, :story_type => task_type) end -end \ No newline at end of file +end