Class: CapsuleCRM::Task
Class Method Summary
collapse
Instance Method Summary
collapse
included, #serializer, #to_capsule_json
included
#build_destroy_path, #destroy
#build_create_path, #build_update_path, #create_record, included, #new_record?, #persisted?, #save, #save!, #update_attributes, #update_attributes!, #update_record
Methods included from Inspector
#inspect
Class Method Details
._for_case(case_id) ⇒ Object
._for_opportunity(opportunity_id) ⇒ Object
48
49
50
51
52
53
54
|
# File 'lib/capsule_crm/task.rb', line 48
def self._for_opportunity(opportunity_id)
CapsuleCRM::ResultsProxy.new(
CapsuleCRM::Task.all.select do |task|
task.opportunity_id == opportunity_id
end
)
end
|
._for_party(party_id) ⇒ Object
Also known as:
_for_person, _for_organization
Instance Method Details
#complete ⇒ Object
68
69
70
71
|
# File 'lib/capsule_crm/task.rb', line 68
def complete
CapsuleCRM::Connection.post("/api/task/#{id}/complete")
self
end
|
#create_url ⇒ Object
78
79
80
81
82
83
84
85
86
87
88
|
# File 'lib/capsule_crm/task.rb', line 78
def create_url
if party_id
"party/#{party_id}/task"
elsif opportunity_id
"opportunity/#{opportunity_id}/task"
elsif case_id
"kase/#{case_id}/task"
else
'task'
end
end
|
#owner=(user) ⇒ Object
62
63
64
65
66
|
# File 'lib/capsule_crm/task.rb', line 62
def owner=(user)
user = CapsuleCRM::User.find_by_username(user) if user.is_a?(String)
@owner = user
self
end
|
#reopen ⇒ Object
73
74
75
76
|
# File 'lib/capsule_crm/task.rb', line 73
def reopen
CapsuleCRM::Connection.post("/api/task/#{id}/reopen")
self
end
|