We need to delete contacts of specific type when this contact type is deleted.

Also we need to show Delete button on the edit contact type form.

Comments

dpovshed’s picture

Assigned: Unassigned » dpovshed

Let me handle these topics, should be related to http://drupal.org/node/1534858

dpovshed’s picture

Please test/review attached patch.

What is done and included in this patch:
- on contact type deletion existing contacts of that type are deleted automatically
(all attached activity will reflects the deletion of contacts in cascade way);
- deletion callback function name now have the same suffix for Activity and Contact (*_delete_callback);
- link to CRM contact type added to admin/structure/crm/ menu
- minor fixes of unused variables/incorrect formatting;

What is NOT done:
- 'Delete' button not added to contact deletion form. The reason is that currently three management tabs have a different design:
admin/structure/crm/relationship-types
admin/structure/crm/contact-types
admin/structure/crm/activity-types

I believe making them to have same look is a topic for a new separate ticket for a person with love to UI stuff.

dpovshed’s picture

StatusFileSize
new12.57 KB

Rework of previous patch according to code review.

in addition to patch in #2 the following was done:

- functional moved from "deletion callback" function type controllers;
- signature of crm_core_contact_type_delete() function standartized;
- minor controller syntax fixes

dpovshed’s picture

Status: Active » Needs review
StatusFileSize
new12.57 KB

Adopting previous patch to current dev version

ygerasimov’s picture

Committed! Thanks God for the codesprint! http://drupalcodesprint.com/

ygerasimov’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 596bdd2 on 7.x-1.x, development, import authored by dpovshed, committed by ygerasimov:
    Issue #1540640 by denikin | dealancer: Delete contacts when deleting...

  • Commit 596bdd2 on 7.x-1.x, development, import, activity_pages authored by dpovshed, committed by ygerasimov:
    Issue #1540640 by denikin | dealancer: Delete contacts when deleting...