function crm_core_relationship_ui_toggle_relationship_status in CRM Core 8.3
Same name and namespace in other branches
- 8 modules/crm_core_relationship_ui/crm_core_relationship_ui.pages.inc \crm_core_relationship_ui_toggle_relationship_status()
- 8.2 modules/crm_core_relationship_ui/crm_core_relationship_ui.pages.inc \crm_core_relationship_ui_toggle_relationship_status()
- 7 modules/crm_core_relationship_ui/crm_core_relationship_ui.pages.inc \crm_core_relationship_ui_toggle_relationship_status()
Relationship toggle status callback.
1 string reference to 'crm_core_relationship_ui_toggle_relationship_status'
- crm_core_relationship_ui_menu in modules/
crm_core_relationship_ui/ crm_core_relationship_ui.module - Implements hook_menu().
File
- modules/
crm_core_relationship_ui/ crm_core_relationship_ui.pages.inc, line 436 - CRM Core Relationship UI Pages.
Code
function crm_core_relationship_ui_toggle_relationship_status($relationship_id, $status) {
$relation = Relation::load($relationship_id);
$relation->crm_core_relationship_status[LANGUAGE_NONE][0]['value'] = $status ? 1 : 0;
entity_save('relation', $relation);
drupal_set_message(t('Relationship status was successfully changed.'));
$path = drupal_get_destination();
drupal_goto($path);
}