Type: New Feature
Affects Version/s: None
Fix Version/s: 1.0
This functionality allows users with appropriate permissions to add, edit and de-activate relationship types (crm_relationship_type records).
NOTE: Until we move forward with role permissioning, any logged in user will have access to this.
NOTE: Keep in mind that we will be building very similar admin-config functionality for editing location types, categories, and ???
1. Add the following link below the <select> for relationship types at the top of the New Relationship form:
"Add or Edit relationship types for your site..."
1.1 Link takes user to 'Manage Relationship Types' page
1.2 Retain referer page in session so we can return user to where they came from on completion of task (or on Cancel)
1.3 This functionality should live under the crm/admin/reltype path in the menu array (contact.module)
2. Manage Relationship Types
2.1 Implementation is similar to contact/note page - with 4 'op' conditions:
browse (default), add, edit, view
2.2 Browse 'op' (selectors)
2.2.1 Display 2 conditional selector-style tables of relationship_type records - one for 'Relatiionship Types' (where is_active = TRUE). And a second selector for Deactivated Relationship Types (is_active = FALSE). Selectors are only displayed if there are rel types. If there are no 'active' types, display message status (this is an unexpected case since we will be delivering several 'reserved' types:
<div class="message status">There are no Relationship Types. You can <a href="..op=add">add one</a> now.</div>
2.2.2 Pager is conditionally included for both, altho we don't expect to have that many in most installations.
2.2.3 Selector table columns for active rel types:
- Relationship A to B
- Relationship B to A
- Contact Type A
- Contact Type B
- View | Edit | Deactivate
2.3.4 For Deactivated Relationship Types selector, cols are:
- same as above except replace Deactivate w/ Reactivate
2.2.5 All columns are sortable.
2.2.6 is_reserved type rows - Edit and Deactivate links are suppressed. Assign additional class "reserved" to these rows (e.g. <tr class="even-row reserved"> ) so we can display them differently if desired.
2.3 Add / Edit form (appears above selectors when op=add or op=edit). Form fields:
- "Relationship Label for A to B" (<input type=tex />t)
- "Relationship Label for B to A" (<input type=text />)
- Contact Type A (<select />, use contact_type enum, null option = '
any contact type')
- Contact Type B (<select />, use contact_type enum, null option = '
any contact type')
- Description (<textarea />)
- Buttons: [Save] [Cancel]
Save and Cancel return to op=browse
2.3.1 Label for A to B is required. Contact_type can be null for one or both directions. If Label B to A is blank, insert the value in the "A to B" field on Save.
2.4 Done button on bottom of page returns to referer page.