class Teamlab::Crm

Public Class Methods

new() click to toggle source
# File lib/teamlab/modules/crm.rb, line 3
def initialize
  @request = Teamlab::Request.new('crm')
end

Public Instance Methods

add_case_contact(case_id, contact_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 711
def add_case_contact(case_id, contact_id)
  @request.post(['case', case_id.to_s, 'contact'], contactId: contact_id)
end
add_contact_address(contact_id, category, address, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 507
def add_contact_address(contact_id, category, address, options = {})
  @request.post(['contact', contact_id.to_s, 'data', 'address', category.to_s], { address: address.to_s }.merge(options))
end
add_contact_info(contact_id, infotype, data, category, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 491
def add_contact_info(contact_id, infotype, data, category, options = {})
  @request.post(['contact', contact_id.to_s, 'data'], { infoType: infotype, data: data, category: category }.merge(options))
end
add_contact_tag_to_group(entity_type, entity_id, tag) click to toggle source
# File lib/teamlab/modules/crm.rb, line 207
def add_contact_tag_to_group(entity_type, entity_id, tag)
  @request.post([entity_type.to_s, entity_id.to_s, 'tag', 'group'], tagName: tag)
end
add_deal_to_contact(contact_id, opportunity_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 211
def add_deal_to_contact(contact_id, opportunity_id)
  @request.post(['contact', contact_id.to_s, 'opportunity', opportunity_id.to_s])
end
add_opportunity_contact(opportunity_id, contact_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 48
def add_opportunity_contact(opportunity_id, contact_id)
  @request.post(['opportunity', opportunity_id.to_s, 'contact', contact_id.to_s])
end
add_persons_to_company(company_id, person_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 499
def add_persons_to_company(company_id, person_id)
  @request.post(['contact', 'company', company_id.to_s, 'person'], personId: person_id)
end
add_tag(entity_type, entity_id, tag_name) click to toggle source
# File lib/teamlab/modules/crm.rb, line 635
def add_tag(entity_type, entity_id, tag_name)
  @request.post([entity_type.to_s, entity_id.to_s, 'tag'], tagName: tag_name)
end
add_tag_group_to_entity(entity_type, entity_id, tag_name) click to toggle source
TODO: OPTIONAL VARIABLES =====================================================
# File lib/teamlab/modules/crm.rb, line 625
def add_tag_group_to_entity(entity_type, entity_id, tag_name)
  @request.post([entity_type.to_s, 'taglist'], entityId: entity_id, tagName: tag_name)
end
add_tag_to_batch_contacts(tags, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 203
def add_tag_to_batch_contacts(tags, options = {})
  @request.post(%w(contact filter taglist), { tags: tags }.merge(options))
end
add_tag_to_case_group_by_filter(tag_name, options = {}) click to toggle source
TODO: OPTIONAL VARIABLES =====================================================
# File lib/teamlab/modules/crm.rb, line 619
def add_tag_to_case_group_by_filter(tag_name, options = {})
  @request.post(%w(case filter taglist), { tagName: tag_name }.merge(options))
end
add_tag_to_opportunity_group(tag_name, options = {}) click to toggle source
TODO: OPTIONAL VARIABLES =====================================================
# File lib/teamlab/modules/crm.rb, line 631
def add_tag_to_opportunity_group(tag_name, options = {})
  @request.post(%w(opportunity filter taglist), { tagName: tag_name }.merge(options))
end
associate_file_with_entity(entity_type, entity_id, *fileids) click to toggle source
# File lib/teamlab/modules/crm.rb, line 585
def associate_file_with_entity(entity_type, entity_id, *fileids)
  @request.post([entity_type, entity_id, 'files'], files: fileids.flatten)
end
change_contact_photo(contact_id, photo) click to toggle source
TODO: MULTIPART-FORM DATA =====================================================
# File lib/teamlab/modules/crm.rb, line 307
def change_contact_photo(contact_id, photo)
  @request.put(['contact', contact_id.to_s, 'changephoto'], photo: photo)
end
change_contact_photo_by_url(contact_id, photo_url) click to toggle source
# File lib/teamlab/modules/crm.rb, line 543
def change_contact_photo_by_url(contact_id, photo_url)
  @request.put(['contact', contact_id.to_s, 'changephotobyurl'], photourl: photo_url)
end
close_case(case_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 731
def close_case(case_id)
  @request.put(['case', case_id.to_s, 'close'])
end
close_task(task_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 419
def close_task(task_id)
  @request.put(['task', task_id.to_s, 'close'])
end
create_case(title, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 707
def create_case(title, options = {})
  @request.post(%w(case), { title: title }.merge(options))
end
create_company(company_name, managers, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 195
def create_company(company_name, managers, options = {})
  @request.post(%w(contact company), { companyName: company_name, managerList: managers }.merge(options))
end
create_contact_status(title, color, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 187
def create_contact_status(title, color, options = {})
  @request.post(%w(contact status), { title: title, color: color }.merge(options))
end
create_contact_type(title, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 183
def create_contact_type(title, options = {})
  @request.post(%w(contact type), { title: title }.merge(options))
end
create_event(contact_id, content, category_id, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 363
def create_event(contact_id, content, category_id, options = {})
  @request.post(%w(history), { contactId: contact_id, content: content, categoryId: category_id }.merge(options))
end
create_history_category(title, image_name, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 367
def create_history_category(title, image_name, options = {})
  @request.post(%w(history category), { title: title.to_s, imageName: image_name.to_s }.merge(options))
end
create_invoice(number, issue_date, client_id, due_date, language, currency, exchange_rate, terms, invoice_line, options) click to toggle source
# File lib/teamlab/modules/crm.rb, line 165
def create_invoice(number, issue_date, client_id, due_date, language, currency, exchange_rate, terms, invoice_line, options)
  @request.post(%w(invoice), {number: number, issueDate: issue_date, contactId: client_id, dueDate: due_date,
                              language: language, currency: currency, exchangeRate: exchange_rate, terms: terms,
                              invoiceLines: invoice_line}.merge(options))
end
create_invoice_item(title, description, price, stock_keeping_unit, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 175
def create_invoice_item(title, description, price, stock_keeping_unit, options = {})
  @request.post(%w(invoiceitem), { title: title, description: description, price: price, sku: stock_keeping_unit.to_s }.merge(options))
end
create_invoice_line(invoice_id, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 171
def create_invoice_line(invoice_id, options = {})
  @request.post(%w(invoiceline), { invoiceId: invoice_id }.merge(options))
end
create_invoice_tax(name, description, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 179
def create_invoice_tax(name, description, options = {})
  @request.post(%w(invoice tax), { name: name, description: description }.merge(options))
end
create_opportunity(stage_id, title, responsible_id, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 40
def create_opportunity(stage_id, title, responsible_id, options = {})
  @request.post(%w(opportunity), { stageId: stage_id, title: title, responsibleid: responsible_id }.merge(options))
end
create_opportunity_stage(title, color, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 44
def create_opportunity_stage(title, color, options = {})
  @request.post(%w(opportunity stage), { title: title, color: color }.merge(options))
end
create_person(first_name, last_name, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 191
def create_person(first_name, last_name, options = {})
  @request.post(%w(contact person), { firstName: first_name, lastName: last_name }.merge(options))
end
create_tag(entity_type, tag_name) click to toggle source
# File lib/teamlab/modules/crm.rb, line 613
def create_tag(entity_type, tag_name)
  @request.post([entity_type.to_s, 'tag'], tagName: tag_name)
end
create_task(title, deadline, responsible_id, category_id, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 161
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 = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 407
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
create_task_group(title, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 199
def create_task_group(title, options = {})
  @request.post(%w(contact task group), { title: title }.merge(options))
end
create_task_template(container_id, title, options = {}) click to toggle source
TODO: OPTIONAL VARIABLES =====================================================
# File lib/teamlab/modules/crm.rb, line 673
def create_task_template(container_id, title, options = {})
  @request.post(['tasktemplatecontainer', container_id.to_s, 'tasktemplate'], { title: title }.merge(options))
end
create_task_template_container(entity_type, title) click to toggle source
# File lib/teamlab/modules/crm.rb, line 667
def create_task_template_container(entity_type, title)
  @request.post([entity_type.to_s, 'tasktemplatecontainer'], title: title)
end
create_txt(entity_type, entity_id, title, content) click to toggle source
# File lib/teamlab/modules/crm.rb, line 589
def create_txt(entity_type, entity_id, title, content)
  @request.post([entity_type.to_s, entity_id.to_s, 'files', 'text'], title: title, content: content)
end
create_user_field(entity_type, label, field_type, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 763
def create_user_field(entity_type, label, field_type, options = {})
  @request.post([entity_type.to_s, 'customfield'], { fieldType: field_type, label: label }.merge(options))
end
delete_batch_contacts_by_filter(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 327
def delete_batch_contacts_by_filter(options = {})
  @request.delete(%w(contact filter), options)
end
delete_batch_invoices(*invoice_ids) click to toggle source
# File lib/teamlab/modules/crm.rb, line 319
def delete_batch_invoices(*invoice_ids)
  @request.delete(%w(invoice), [invoiceids: invoice_ids.flatten])
end
delete_batch_items(*ids) click to toggle source
# File lib/teamlab/modules/crm.rb, line 323
def delete_batch_items(*ids)
  @request.delete(%w(invoiceitem), ids: ids.flatten)
end
delete_case(case_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 747
def delete_case(case_id)
  @request.delete(['case', case_id.to_s])
end
delete_case_contact(case_id, contact_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 751
def delete_case_contact(case_id, contact_id)
  @request.delete(['case', case_id.to_s, 'contact', contact_id.to_s])
end
delete_case_group(*case_ids) click to toggle source
# File lib/teamlab/modules/crm.rb, line 739
def delete_case_group(*case_ids)
  @request.delete(%w(case), caseIds: case_ids.flatten)
end
delete_case_group_by_filter(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 743
def delete_case_group_by_filter(options = {})
  @request.delete(%w(case filter), options)
end
delete_contact(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 551
def delete_contact(id)
  @request.delete(['contact', id.to_s])
end
delete_contact_address(contact_id, information_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 567
def delete_contact_address(contact_id, information_id)
  @request.delete(['contact', contact_id.to_s, 'data', 'address', information_id.to_s])
end
delete_contact_group(*contact_ids) click to toggle source
# File lib/teamlab/modules/crm.rb, line 511
def delete_contact_group(*contact_ids)
  @request.put(%w(contact), contactids: contact_ids.flatten)
end
delete_contact_info(contact_id, info_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 559
def delete_contact_info(contact_id, info_id)
  @request.delete(['contact', contact_id.to_s, 'data', info_id.to_s])
end
delete_contact_status(contact_status_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 347
def delete_contact_status(contact_status_id)
  @request.delete('contact', 'status', contact_status_id)
end
delete_contact_type(contact_type_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 555
def delete_contact_type(contact_type_id)
  @request.delete(['contact', 'type', contact_type_id.to_s])
end
delete_deal_from_contact(contact_id, opportunity_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 351
def delete_deal_from_contact(contact_id, opportunity_id)
  @request.delete(['contact', contact_id.to_s, 'opportunity', opportunity_id.to_s])
end
delete_file(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 597
def delete_file(id)
  @request.post(['files', id.to_s])
end
delete_history_category(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 387
def delete_history_category(id)
  @request.delete(['history', 'category', id.to_s])
end
delete_invoice(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 339
def delete_invoice(id)
  @request.delete(['invoice', id.to_s])
end
delete_invoice_item(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 331
def delete_invoice_item(id)
  @request.delete(['invoiceitem', id.to_s])
end
delete_invoice_line(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 343
def delete_invoice_line(id)
  @request.delete(['invoiceline', id.to_s])
end
delete_invoice_tax(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 335
def delete_invoice_tax(id)
  @request.delete(['invoice', 'tax', id.to_s])
end
delete_opportunity(opportunity_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 97
def delete_opportunity(opportunity_id)
  @request.delete(['opportunity', opportunity_id.to_s])
end
delete_opportunity_contact(opportunity_id, contact_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 101
def delete_opportunity_contact(opportunity_id, contact_id)
  @request.delete(['opportunity', opportunity_id.to_s, 'contact', contact_id.to_s])
end
delete_opportunity_group(*opportunity_ids) click to toggle source
# File lib/teamlab/modules/crm.rb, line 85
def delete_opportunity_group(*opportunity_ids)
  @request.delete(%w(opportunity), opportunityids: opportunity_ids.flatten)
end
delete_opportunity_group_by_filter(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 89
def delete_opportunity_group_by_filter(options = {})
  @request.delete(%w(opportunity filter), options)
end
delete_opportunity_stage(stage_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 93
def delete_opportunity_stage(stage_id)
  @request.delete(['opportunity', 'stage', stage_id.to_s])
end
delete_person_from_company(company_id, person_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 563
def delete_person_from_company(company_id, person_id)
  @request.delete(['contact', 'company', company_id.to_s, 'person'], personId: person_id)
end
delete_tag(entity_type, tag_name) click to toggle source
# File lib/teamlab/modules/crm.rb, line 639
def delete_tag(entity_type, tag_name)
  @request.delete([entity_type.to_s, 'tag'], tagName: tag_name)
end
delete_task(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 435
def delete_task(id)
  @request.delete(['task', id.to_s])
end
delete_task_category(category_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 439
def delete_task_category(category_id)
  @request.delete(['task', 'category', category_id.to_s])
end
delete_task_template(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 691
def delete_task_template(id)
  @request.delete(['tasktemplatecontainer', 'tasktemplate', id.to_s])
end
delete_task_template_container(container_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 687
def delete_task_template_container(container_id)
  @request.delete(['tasktemplatecontainer', container_id.to_s])
end
delete_unused_tags(entity_type) click to toggle source
# File lib/teamlab/modules/crm.rb, line 643
def delete_unused_tags(entity_type)
  @request.delete([entity_type.to_s, 'tag', 'unused'])
end
delete_user_field(entity_type, field_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 779
def delete_user_field(entity_type, field_id)
  @request.delete([entity_type.to_s, 'customfield', field_id.to_s])
end
get_all_case_contacts(case_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 703
def get_all_case_contacts(case_id)
  @request.get(['case', case_id.to_s, 'contact'])
end
get_all_categories(info_type) click to toggle source
# File lib/teamlab/modules/crm.rb, line 467
def get_all_categories(info_type)
  @request.get(['contact', 'data', info_type.to_s, 'category'])
end
get_all_contact_info_types() click to toggle source
# File lib/teamlab/modules/crm.rb, line 451
def get_all_contact_info_types
  @request.get(%w(contact data infotype))
end
get_all_contact_tags(contact_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 605
def get_all_contact_tags(contact_id)
  @request.get(['contact', contact_id.to_s, 'tag'])
end
get_all_contact_types() click to toggle source
# File lib/teamlab/modules/crm.rb, line 443
def get_all_contact_types
  @request.get(%w(contact type))
end
get_all_history_categories() click to toggle source
# File lib/teamlab/modules/crm.rb, line 359
def get_all_history_categories
  @request.get(%w(history category))
end
get_all_opportunity_contacts(opportunity_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 32
def get_all_opportunity_contacts(opportunity_id)
  @request.get(['opportunity', opportunity_id.to_s, 'contact'])
end
get_all_opportunity_stages() click to toggle source

region Opportunity

# File lib/teamlab/modules/crm.rb, line 8
def get_all_opportunity_stages
  @request.get(%w(opportunity stage))
end
get_all_task_categories() click to toggle source
# File lib/teamlab/modules/crm.rb, line 395
def get_all_task_categories
  @request.get(%w(task category))
end
get_case_by_id(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 699
def get_case_by_id(id)
  @request.get(['case', id.to_s])
end
get_case_list(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 695
def get_case_list(options = {})
  @request.get(%w(case filter), options)
end
get_cases_by_prefix(contact_id, prefix) click to toggle source
# File lib/teamlab/modules/crm.rb, line 117
def get_cases_by_prefix(contact_id, prefix)
  @request.get(%w(case byprefix), contactId: contact_id, prefix: prefix)
end
get_company_linked_persons_list(company_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 471
def get_company_linked_persons_list(company_id)
  @request.get(['contact', 'company', company_id.to_s, 'person'])
end
get_contact_by_id(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 447
def get_contact_by_id(id)
  @request.get(['contact', id.to_s])
end
get_contact_info(contact_id, contact_info_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 463
def get_contact_info(contact_id, contact_info_id)
  @request.get(['contact', contact_id.to_s, 'data', contact_info_id.to_s])
end
get_contact_information_by_type(contact_id, info_type) click to toggle source
# File lib/teamlab/modules/crm.rb, line 475
def get_contact_information_by_type(contact_id, info_type)
  @request.get(['contact', contact_id.to_s, 'data', info_type.to_s])
end
get_contact_status_by_id(contact_status_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 153
def get_contact_status_by_id(contact_status_id)
  @request.get(['contact', 'status', contact_status_id.to_s])
end
get_contact_statuses() click to toggle source
# File lib/teamlab/modules/crm.rb, line 121
def get_contact_statuses
  @request.get(%w(contact status))
end
get_contact_type(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 459
def get_contact_type(id)
  @request.get(['contact', 'type', id.to_s])
end
get_contact_upcoming_tasks(*contact_ids) click to toggle source
# File lib/teamlab/modules/crm.rb, line 411
def get_contact_upcoming_tasks(*contact_ids)
  @request.post(%w(contact task near), contactid: contact_ids.flatten)
end
get_contacts_by_filter(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 133
def get_contacts_by_filter(options = {})
  @request.get(%w(contact filter), options)
end
get_contacts_by_project_id(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 455
def get_contacts_by_project_id(id)
  @request.get(['contact', 'project', id.to_s])
end
get_contacts_for_mail(*contact_ids) click to toggle source
# File lib/teamlab/modules/crm.rb, line 113
def get_contacts_for_mail(*contact_ids)
  @request.get(%w(contact mail), contactids: contact_ids.flatten)
end
get_currency_list() click to toggle source
# File lib/teamlab/modules/crm.rb, line 12
def get_currency_list
  @request.get(%w(settings currency))
end
get_entity_invoices(entity_type, entity_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 157
def get_entity_invoices(entity_type, entity_id)
  @request.get([entity_type.to_s, 'invoicelist', entity_id.to_s])
end
get_entity_tags(entity_type, entity_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 609
def get_entity_tags(entity_type, entity_id)
  @request.get([entity_type.to_s, 'tag', entity_id.to_s])
end
get_event_list_by_filter(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 355
def get_event_list_by_filter(options = {})
  @request.get(%w(history filter), options)
end
get_file_list(entity_type, entity_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 581
def get_file_list(entity_type, entity_id)
  @request.get([entity_type.to_s, entity_id.to_s, 'files'])
end
get_invoice_by_id(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 145
def get_invoice_by_id(id)
  @request.get(['invoice', id.to_s])
end
get_invoice_items_by_filter(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 141
def get_invoice_items_by_filter(options = {})
  @request.get(%w(invoiceitem filter), options)
end
get_invoice_sample() click to toggle source
# File lib/teamlab/modules/crm.rb, line 125
def get_invoice_sample
  @request.get(%w(invoice sample))
end
get_invoice_taxes() click to toggle source

region General

# File lib/teamlab/modules/crm.rb, line 109
def get_invoice_taxes
  @request.get(%w(invoice tax))
end
get_invoices_by_filter(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 129
def get_invoices_by_filter(options = {})
  @request.get(%w(invoice filter), options)
end
get_opportunity_by_id(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 28
def get_opportunity_by_id(id)
  @request.get(['opportunity', id.to_s])
end
get_opportunity_list(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 16
def get_opportunity_list(options = {})
  @request.get(%w(opportunity filter), options)
end
get_opportunity_stage(stage_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 24
def get_opportunity_stage(stage_id)
  @request.get(['opportunity', 'stage', stage_id.to_s])
end
get_result_of_convertation(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 20
def get_result_of_convertation(options = {})
  @request.get(%w(settings currency convert), options)
end
get_root_folder_id() click to toggle source

region Files

# File lib/teamlab/modules/crm.rb, line 577
def get_root_folder_id
  @request.get(%w(files root))
end
get_settings() click to toggle source
# File lib/teamlab/modules/crm.rb, line 137
def get_settings
  @request.get(%w(invoice settings))
end
get_simple_contacts(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 149
def get_simple_contacts(options = {})
  @request.get(%w(contact simple filter), options)
end
get_summary_table(currency) click to toggle source
# File lib/teamlab/modules/crm.rb, line 36
def get_summary_table(currency)
  @request.get(['settings', 'currency', currency.to_s, 'summarytable'])
end
get_tags_for_entity_type(entity_type) click to toggle source
# File lib/teamlab/modules/crm.rb, line 601
def get_tags_for_entity_type(entity_type)
  @request.get([entity_type.to_s, 'tag'])
end
get_task_by_id(task_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 399
def get_task_by_id(task_id)
  @request.get(['task', task_id.to_s])
end
get_task_category(category_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 403
def get_task_category(category_id)
  @request.get(['task', 'category', category_id.to_s])
end
get_task_list_by_filter(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 391
def get_task_list_by_filter(options = {})
  @request.get(%w(task filter), options)
end
get_task_template(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 659
def get_task_template(id)
  @request.get(['tasktemplatecontainer', 'tasktemplate', id.to_s])
end
get_task_template_container(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 655
def get_task_template_container(id)
  @request.get(['tasktemplatecontainer', id.to_s])
end
get_task_template_container_list(entity_type) click to toggle source
# File lib/teamlab/modules/crm.rb, line 651
def get_task_template_container_list(entity_type)
  @request.get([entity_type.to_s, 'tasktemplatecontainer'])
end
get_task_template_list_by_container_id(id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 663
def get_task_template_list_by_container_id(id)
  @request.get(['tasktemplatecontainer', id.to_s, 'tasktemplate'])
end
get_user_field_list(entity_type) click to toggle source
# File lib/teamlab/modules/crm.rb, line 759
def get_user_field_list(entity_type)
  @request.get([entity_type.to_s, 'customfield', 'definitions'])
end
get_user_field_values(entity_type, entity_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 755
def get_user_field_values(entity_type, entity_id)
  @request.get([entity_type.to_s, entity_id.to_s, 'customfield'])
end
group_contact_info(*items) click to toggle source
# File lib/teamlab/modules/crm.rb, line 479
def group_contact_info(*items)
  @request.post(%w(contact data), items: items.flatten)
end
group_contact_info_update(*items) click to toggle source
# File lib/teamlab/modules/crm.rb, line 515
def group_contact_info_update(*items)
  @request.put(%w(contact data), items: items.flatten)
end
merge_contacts(from_contact_id, to_contact_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 519
def merge_contacts(from_contact_id, to_contact_id)
  @request.put(%w(contact merge), fromcontactid: from_contact_id, tocontactid: to_contact_id)
end
quick_company_list_creation(*names) click to toggle source
# File lib/teamlab/modules/crm.rb, line 487
def quick_company_list_creation(*names)
  @request.post(%w(contact company quick), companyName: names.flatten)
end
quick_person_list_creation(data) click to toggle source
# File lib/teamlab/modules/crm.rb, line 483
def quick_person_list_creation(data)
  @request.post(%w(contact person quick), data: data)
end
remove_contact_from_project(contact_id, project_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 571
def remove_contact_from_project(contact_id, project_id)
  @request.delete(['contact', contact_id.to_s, 'project', project_id.to_s])
end
remove_tag(entity_type, entity_id, tag_name) click to toggle source
# File lib/teamlab/modules/crm.rb, line 647
def remove_tag(entity_type, entity_id, tag_name)
  @request.delete([entity_type.to_s, entity_id.to_s, 'tag'], tagName: tag_name)
end
resume_case(case_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 727
def resume_case(case_id)
  @request.put(['case', case_id.to_s, 'reopen'])
end
resume_task(task_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 423
def resume_task(task_id)
  @request.put(['task', task_id.to_s, 'reopen'])
end
save_number_settings(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 257
def save_number_settings(options = {})
  @request.put(%w(invoice settings name), options)
end
save_smtp_settings(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 219
def save_smtp_settings(options = {})
  @request.put(%w(settings smtp), options)
end
save_terms_settings(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 277
def save_terms_settings(options = {})
  @request.put(%w(invoice settings terms), options)
end
set_access_to_batch_contact(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 261
def set_access_to_batch_contact(options = {})
  @request.put(%w(contact filter access), options)
end
set_case_access_rights(case_ids, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 715
def set_case_access_rights(case_ids, options = {})
  @request.put(%w(case access), { caseId: case_ids }.merge(options))
end
set_case_access_rights_by_filter(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 723
def set_case_access_rights_by_filter(options = {})
  @request.put(%w(case filter access), options)
end
set_contact_access_rights(contact_id, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 531
def set_contact_access_rights(contact_id, options = {})
  @request.put(['contact', contact_id.to_s, 'access'], options)
end
set_contacts_access_rights(contact_ids, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 523
def set_contacts_access_rights(contact_ids, options = {})
  @request.put(%w(contact access), { contactId: contact_ids }.merge(options))
end
set_is_portal_configured(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 215
def set_is_portal_configured(options = {})
  @request.put(%w(settings), options)
end
set_opportunity_access_rights(opportunity_ids, is_private, *users) click to toggle source
# File lib/teamlab/modules/crm.rb, line 52
def set_opportunity_access_rights(opportunity_ids, is_private, *users)
  @request.put(%w(opportunity access), opportunityid: opportunity_ids.to_a.flatten, isPrivate: is_private, accessList: users.flatten)
end
set_opportunity_access_rights_for_users(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 64
def set_opportunity_access_rights_for_users(options = {})
  @request.put(%w(opportunity filter access), options)
end
set_rights_to_case(case_id, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 735
def set_rights_to_case(case_id, options = {})
  @request.put(['case', case_id.to_s, 'access'], options)
end
set_rights_to_opportunity(opportunity_id, is_private, access_list) click to toggle source
# File lib/teamlab/modules/crm.rb, line 77
def set_rights_to_opportunity(opportunity_id, is_private, access_list)
  @request.put(['opportunity', opportunity_id.to_s, 'access'], isPrivate: is_private, accessList: access_list)
end
set_user_field_value(entity_type, entity_id, field_id, field_value) click to toggle source
# File lib/teamlab/modules/crm.rb, line 767
def set_user_field_value(entity_type, entity_id, field_id, field_value)
  @request.post([entity_type.to_s, entity_id.to_s, 'customfield', field_id.to_s], fieldValue: field_value)
end
update_case(case_id, title, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 719
def update_case(case_id, title, options = {})
  @request.put(['case', case_id.to_s], { title: title }.merge(options))
end
update_company(company_id, company_name, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 535
def update_company(company_id, company_name, options = {})
  @request.put(['contact', 'company', company_id.to_s], { companyName: company_name.to_s }.merge(options))
end
update_company_and_participants_status(company_id, contact_status_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 315
def update_company_and_participants_status(company_id, contact_status_id)
  @request.put(['contact', 'company', company_id.to_s, 'status'], contactStatusId: contact_status_id)
end
update_contact_address(contact_id, information_id, address, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 547
def update_contact_address(contact_id, information_id, address, options = {})
  @request.put(['contact', contact_id.to_s, 'data', 'address', information_id.to_s], { address: address }.merge(options))
end
update_contact_info(information_id, contact_id, data, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 539
def update_contact_info(information_id, contact_id, data, options = {})
  @request.put(['contact', contact_id.to_s, 'data', information_id.to_s], { data: data }.merge(options))
end
update_contact_status(id, title, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 243
def update_contact_status(id, title, options = {})
  @request.put(['contact', 'status', id.to_s], { title: title.to_s }.merge(options))
end
update_contact_status_by_id(contact_id, contact_status_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 297
def update_contact_status_by_id(contact_id, contact_status_id)
  @request.put(['contact', contact_id, 'status'], contactStatusid: contact_status_id)
end
update_contact_status_color(status_id, color) click to toggle source
# File lib/teamlab/modules/crm.rb, line 289
def update_contact_status_color(status_id, color)
  @request.put(['contact', 'status', status_id.to_s, 'color'], color: color)
end
update_contact_type(id, title, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 239
def update_contact_type(id, title, options = {})
  @request.put(['contact', 'type', id.to_s], { title: title }.merge(options))
end
update_contact_types_order(*titles) click to toggle source
# File lib/teamlab/modules/crm.rb, line 527
def update_contact_types_order(*titles)
  @request.put(%w(contact type reorder), titles: titles.flatten)
end
update_crm_contact_status_settings(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 281
def update_crm_contact_status_settings(options = {})
  @request.put(%w(contact status settings), options)
end
update_crm_contact_tag_setting(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 253
def update_crm_contact_tag_setting(options = {})
  @request.put(%w(contact tag settings), options)
end
update_crm_currency(currency) click to toggle source
# File lib/teamlab/modules/crm.rb, line 223
def update_crm_currency(currency)
  @request.put(%w(settings currency), {currency: currency})
end
update_history_categories_order(*titles) click to toggle source
# File lib/teamlab/modules/crm.rb, line 375
def update_history_categories_order(*titles)
  @request.put(%w(history category reorder), titles: titles.flatten)
end
update_history_category(id, title, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 371
def update_history_category(id, title, options = {})
  @request.put(['history', 'category', id.to_s], { title: title }.merge(options))
end
update_history_category_icon(id, icon_name) click to toggle source
# File lib/teamlab/modules/crm.rb, line 379
def update_history_category_icon(id, icon_name)
  @request.put(['history', 'category', id.to_s, 'icon'], imageName: icon_name.to_s)
end
update_invoice(id, options = {}) click to toggle source
TODO: OPTIONAL VARIABLES =====================================================
# File lib/teamlab/modules/crm.rb, line 249
def update_invoice(id, options = {})
  @request.put(['invoice', id.to_s], options)
end
update_invoice_item(id, title, description, price, stock_keeping_unit, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 231
def update_invoice_item(id, title, description, price, stock_keeping_unit, options = {})
  @request.put(['invoiceitem', id.to_s], { title: title, description: description, price: price, sku: stock_keeping_unit.to_s }.merge(options))
end
update_invoice_line(invoice_line_id, invoice_id, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 301
def update_invoice_line(invoice_line_id, invoice_id, options = {})
  @request.put(['invoiceline', invoice_line_id], { invoiceId: invoice_id }.merge(options))
end
update_invoice_patch_status(status, invoice_ids) click to toggle source
# File lib/teamlab/modules/crm.rb, line 285
def update_invoice_patch_status(status, invoice_ids)
  @request.put(['invoice', 'status', status.to_s], invoiceids: invoice_ids)
end
update_invoice_tax(id, name, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 235
def update_invoice_tax(id, name, options = {})
  @request.put(['invoice', 'tax', id.to_s], { name: name }.merge(options))
end
update_opportunity(opportunity_id, contact_id, title, responsible_id, stage_id, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 68
def update_opportunity(opportunity_id, contact_id, title, responsible_id, stage_id, options = {})
  @request.put(['opportunity', opportunity_id.to_s], { contactId: contact_id, title: title, responsibleid: responsible_id,
                                                       stageid: stage_id }.merge(options))
end
update_opportunity_stage(id, title, color, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 56
def update_opportunity_stage(id, title, color, options = {})
  @request.put(['opportunity', 'stage', id.to_s], { title: title, color: color }.merge(options))
end
update_opportunity_stage_color(stage_id, color) click to toggle source
# File lib/teamlab/modules/crm.rb, line 73
def update_opportunity_stage_color(stage_id, color)
  @request.put(['opportunity', 'stage', stage_id.to_s, 'color'], color: color)
end
update_opportunity_stages_order(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 60
def update_opportunity_stages_order(options = {})
  @request.put(%w(opportunity stage reorder), options)
end
update_opportunity_to_stage(opportunity_id, stage_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 81
def update_opportunity_to_stage(opportunity_id, stage_id)
  @request.put(['opportunity', opportunity_id.to_s, 'stage', stage_id.to_s], stageid: stage_id)
end
update_organisation_address(text) click to toggle source
# File lib/teamlab/modules/crm.rb, line 269
def update_organisation_address(text)
  @request.put(%w(settings organisation address), {companyAddress: text})
end
update_organisation_company_name(title) click to toggle source
# File lib/teamlab/modules/crm.rb, line 265
def update_organisation_company_name(title)
  @request.put(%w(settings organisation base), {companyName: title})
end
update_person(id, first_name, last_name, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 293
def update_person(id, first_name, last_name, options = {})
  @request.put(['contact', 'person', id.to_s], { firstName: first_name, lastName: last_name }.merge(options))
end
update_person_and_its_company_status(person_id, contact_status_id) click to toggle source
# File lib/teamlab/modules/crm.rb, line 311
def update_person_and_its_company_status(person_id, contact_status_id)
  @request.put(['contact', 'person', person_id.to_s, 'status'], contactStatusId: contact_status_id)
end
update_selected_user_field(entity_type, user_field_id, label, field_type, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 771
def update_selected_user_field(entity_type, user_field_id, label, field_type, options = {})
  @request.put([entity_type.to_s, 'customfield', user_field_id.to_s], { fieldType: field_type, label: label }.merge(options))
end
update_statuses_contact_order(options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 273
def update_statuses_contact_order(options = {})
  @request.put(%w(contact status reorder), options)
end
update_task(task_id, title, deadline, category_id, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 227
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) click to toggle source
# File lib/teamlab/modules/crm.rb, line 427
def update_task_categories_order(*titles)
  @request.put(%w(task category reorder), titles: titles.flatten)
end
update_task_category(category_id, title, options = {}) click to toggle source
# File lib/teamlab/modules/crm.rb, line 415
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) click to toggle source
# File lib/teamlab/modules/crm.rb, line 431
def update_task_category_icon(id, image_name)
  @request.put(['task', 'category', id.to_s, 'icon'], imageName: image_name.to_s)
end
update_task_template(container_id, task_template_id, title, options = {}) click to toggle source
TODO: OPTIONAL VARIABLES =====================================================
# File lib/teamlab/modules/crm.rb, line 683
def update_task_template(container_id, task_template_id, title, options = {})
  @request.put(['tasktemplatecontainer', container_id.to_s, 'tasktemplate'], { id: task_template_id.to_s, title: title }.merge(options))
end
update_task_template_container(container_id, title) click to toggle source
# File lib/teamlab/modules/crm.rb, line 677
def update_task_template_container(container_id, title)
  @request.put(['tasktemplatecontainer', container_id.to_s], title: title)
end
update_user_fields_order(entity_type, *field_ids) click to toggle source
# File lib/teamlab/modules/crm.rb, line 775
def update_user_fields_order(entity_type, *field_ids)
  @request.put([entity_type.to_s, 'customfield', 'reorder'], fieldIds: field_ids.flatten)
end
upload_file(entity_type, entity_id, file) click to toggle source
# File lib/teamlab/modules/crm.rb, line 593
def upload_file(entity_type, entity_id, file)
  @request.post([entity_type.to_s, entity_id.to_s, 'files', 'upload'], somefile: File.new(file))
end