Module: Teamlab::CrmTasks

Included in:
Crm
Defined in:
lib/teamlab/modules/crm/crm_tasks.rb

Overview

Methods for working with crm tasks

Instance Method Summary collapse

Instance Method Details

#close_task(task_id) ⇒ Object



38
39
40
# File 'lib/teamlab/modules/crm/crm_tasks.rb', line 38

def close_task(task_id)
  @request.put(['task', task_id.to_s, 'close'])
end

#create_task(title, deadline, responsible_id, category_id, options = {}) ⇒ Object



6
7
8
# File 'lib/teamlab/modules/crm/crm_tasks.rb', line 6

def create_task(title, deadline, responsible_id, category_id, options = {})
  @request.post(%w[task], { title: title, deadline: deadline, responsibleId: responsible_id, categoryId: category_id }.merge(options))
end

#create_task_category(title, image_name, options = {}) ⇒ Object



30
31
32
# File 'lib/teamlab/modules/crm/crm_tasks.rb', line 30

def create_task_category(title, image_name, options = {})
  @request.post(%w[task category], { title: title.to_s, imageName: image_name.to_s }.merge(options))
end

#delete_task(id) ⇒ Object



54
55
56
# File 'lib/teamlab/modules/crm/crm_tasks.rb', line 54

def delete_task(id)
  @request.delete(['task', id.to_s])
end

#delete_task_category(category_id) ⇒ Object



58
59
60
# File 'lib/teamlab/modules/crm/crm_tasks.rb', line 58

def delete_task_category(category_id)
  @request.delete(['task', 'category', category_id.to_s])
end

#get_all_task_categoriesObject



18
19
20
# File 'lib/teamlab/modules/crm/crm_tasks.rb', line 18

def get_all_task_categories
  @request.get(%w[task category])
end

#get_task_by_id(task_id) ⇒ Object



22
23
24
# File 'lib/teamlab/modules/crm/crm_tasks.rb', line 22

def get_task_by_id(task_id)
  @request.get(['task', task_id.to_s])
end

#get_task_category(category_id) ⇒ Object



26
27
28
# File 'lib/teamlab/modules/crm/crm_tasks.rb', line 26

def get_task_category(category_id)
  @request.get(['task', 'category', category_id.to_s])
end

#get_task_list_by_filter(options = {}) ⇒ Object



14
15
16
# File 'lib/teamlab/modules/crm/crm_tasks.rb', line 14

def get_task_list_by_filter(options = {})
  @request.get(%w[task filter], options)
end

#resume_task(task_id) ⇒ Object



42
43
44
# File 'lib/teamlab/modules/crm/crm_tasks.rb', line 42

def resume_task(task_id)
  @request.put(['task', task_id.to_s, 'reopen'])
end

#update_task(task_id, title, deadline, category_id, options = {}) ⇒ Object



10
11
12
# File 'lib/teamlab/modules/crm/crm_tasks.rb', line 10

def update_task(task_id, title, deadline, category_id, options = {})
  @request.put(['task', task_id.to_s], { title: title, deadline: deadline, categoryid: category_id }.merge(options))
end

#update_task_categories_order(*titles) ⇒ Object



46
47
48
# File 'lib/teamlab/modules/crm/crm_tasks.rb', line 46

def update_task_categories_order(*titles)
  @request.put(%w[task category reorder], titles: titles.flatten)
end

#update_task_category(category_id, title, options = {}) ⇒ Object



34
35
36
# File 'lib/teamlab/modules/crm/crm_tasks.rb', line 34

def update_task_category(category_id, title, options = {})
  @request.put(['task', 'category', category_id.to_s], { title: title }.merge(options))
end

#update_task_category_icon(id, image_name) ⇒ Object



50
51
52
# File 'lib/teamlab/modules/crm/crm_tasks.rb', line 50

def update_task_category_icon(id, image_name)
  @request.put(['task', 'category', id.to_s, 'icon'], imageName: image_name.to_s)
end