Currently user relations page duplicates all user relations in both 'active' and 'inactive' lists. Attached patch fixes this problem. It add 'status' field to crm_core relations and modify default view to filter relations properly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dealancer’s picture

In general it looks and works good, but there is some minor and important things to do:

* right now field_crm_relation_status is not blocked so it is impossible to delete it. Please look on how crm_core_participants in activity field are implemented, which makes them blocked, hence impossible to delete.

* Name field_crm_relation_status is not so good. It is better to have field_relationship_status, field_crm_core_relationship_status, as we use relationship term for relations between contacts.

* Switching of active or inactive seems to be not so easy for user (http://awesomescreenshot.com/098w38jd1). We need to find better way to do it.

Also some minor things:

+++ b/modules/crm_core_relationship_ui/crm_core_relationship_ui.moduleundefined
@@ -195,8 +195,13 @@ function crm_core_relationship_ui_field_formatter_info_alter(&$info) {
+    'label' => t('Related Contact(Human)'),

Can we add space character between 't' and '('. and let's replace 'Human' on 'Human readable'.

+++ b/modules/crm_core_relationship_ui/crm_core_relationship_ui.moduleundefined
@@ -195,8 +195,13 @@ function crm_core_relationship_ui_field_formatter_info_alter(&$info) {
+    'label' => t('Related Contact Relations table view'),

Related Contact (Table) sounds better.

dealancer’s picture

Thinking about how UI should be done there are different possibilities:

A) User sees Activate or Deactivate link, when clicking on this link relationship status is updated and the row in the table moves from Inactive table into active table (or vice verse).

B) User sees Activate or Deactivate link, when clicking on it, relationship is updated, however the row in the table does not move into other table, but user sees Undo activation (or just deactivate), or Undo deactivation (or just activate) link.

C) Users sees separate column with a checkbox for activation or deactivation (save button is not shown) - the most easy way to do, as we can hide save button by changing editable fields settings.

D) We can use VBO instead.

RoSk0’s picture

Renamed "status" field. Removed "editablefields" from dependencies. Created custom form to toggle relationship status and modified relationships view accordingly.

dealancer’s picture

Looks great, ready for committing.

dealancer’s picture

Looks great, ready for committing.

dealancer’s picture

Status: Needs review » Reviewed & tested by the community
RoSk0’s picture

Assigned: Unassigned » RoSk0
Status: Reviewed & tested by the community » Closed (fixed)

Commited in 7d9e50e.

  • Commit 7d9e50e on 7.x-1.x, development, import by RoSk0:
    Issue #1908306 by RoSk0: Added status field to crm_core relationships.
    
  • Commit 5b1ddb0 on 7.x-1.x, development, import by RoSk0:
    Issue #1908306 by RoSk0: Added missed "Friend" relation renaming and...
  • Commit 85b32e4 on 7.x-1.x, development, import by RoSk0:
    Issue #1908306 by RoSk0: Added updating status for existing...

  • Commit 7d9e50e on 7.x-1.x, development, import, activity_pages by RoSk0:
    Issue #1908306 by RoSk0: Added status field to crm_core relationships.
    
  • Commit 5b1ddb0 on 7.x-1.x, development, import, activity_pages by RoSk0:
    Issue #1908306 by RoSk0: Added missed "Friend" relation renaming and...
  • Commit 85b32e4 on 7.x-1.x, development, import, activity_pages by RoSk0:
    Issue #1908306 by RoSk0: Added updating status for existing...