CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • What is it going to take to get 'has Drupal Account' on the Merge screen
Pages: [1]

Author Topic: What is it going to take to get 'has Drupal Account' on the Merge screen  (Read 809 times)

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
What is it going to take to get 'has Drupal Account' on the Merge screen
July 05, 2010, 07:57:57 pm
Hi - all of our clients are at risking of deleting the CiviCRM record that has the Drupal User Account when doing a merge as there is no flag for this. To avoid this involves opening both records and checking.

Any suggestion as to how much work is involved in this in case we can get it done.
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: What is it going to take to get 'has Drupal Account' on the Merge screen
July 05, 2010, 08:48:43 pm

adding a warning about this via a formRule (and a resubmit) or maybe via a javascript check or when rendering the form is probably between 2-4 hours of work.

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: What is it going to take to get 'has Drupal Account' on the Merge screen
July 11, 2010, 04:38:27 pm
This is an awesome idea peterd and it's just about time for my summer contribution to CiviCRM.

If it's between 2-4 hours, and peterd hasn't already sponsored it.... I'll sponsor Web Access to do it.
« Last Edit: July 11, 2010, 04:42:07 pm by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: What is it going to take to get 'has Drupal Account' on the Merge screen
July 11, 2010, 04:57:35 pm
Stoob - I have someone looking at doing this this week - and was similarly up for 2-4 hours - so if you are happy, i will keep you posted, and if it looks like it will be more than i want to swallow - or if i need to shift it to webaccess, i will be back in touch

unless of course your contribution - or others, just come and join the party - could take this on the next level ie so that the 'drupal account' can be transfered from A to B, if that seems desirable.

Otherwise I guess the workflow will be
- if only one has Drupal account then if necessary flip so that that Contact is Person B (if i am right and B is the one that is kept)
- if two have Drupal accounts - then check which you want and ... as above ...

Ideally the Drupal user account name/id would be shown and a 'merge' flag would enable the 'left' contact drupal account to overwrite the 'right' contacts.
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

TwoMice

  • I post frequently
  • ***
  • Posts: 214
  • Karma: 16
    • Emphanos
  • CiviCRM version: Always current stable version
  • CMS version: Drupal 7
Re: What is it going to take to get 'has Drupal Account' on the Merge screen
July 11, 2010, 05:57:30 pm
For what it's worth, I recently had to (okay, wanted to) add the CiviCRM ID of each record to the Merge Contacts screen.  This was not so hard to do using hook_civicrm_buildForm in a Drupal module.

Code: [Select]
mymodule_civicrm_buildForm($formName, &$form) {
    if ($formName == 'CRM_Contact_Form_Merge') {
        // In the "merge" form, we want to show CID for both records, for user sanity.
       
        // First get the Smarty object because we'll be referenceing template variables directly.
        $tpl = CRM_Core_Smarty::singleton();
       
        // Now create an array of the row we need to add, pulling the values from Smarty template vars.
        $row = array(
            'main'  => $tpl->_tpl_vars['main_cid'],
            'other' => $tpl->_tpl_vars['other_cid'],
            'title' => 'CiviCRM ID',
        );
       
        // Grab the $rows template variable and unshift our new row onto the front of that array.
        $rows = $tpl->_tpl_vars['rows'];
        array_unshift($rows, $row);
       
        // Re-assign the modified $rows variable.
        $tpl->assign('rows', $rows);
       
        // Done.
    }
}

One could pretty easily modify this to get UF user IDs, something like this:
Quote
        require_once 'CRM/Core/BAO/UFMatch.php';
        $row = array(
            'main'  => getUFId( $tpl->_tpl_vars['main_cid'] ),
            'other' => getUFId( $tpl->_tpl_vars['other_cid'] ),
            'title' => 'Drupal User ID',
        );

Obviously this makes no attempt to actually merge Drupal user accounts.  Also not sure if this solution fits your situation, but it did work for me with little trouble.

Best luck.

- Allen
Please consider contributing to help improve CiviCRM with the Make it Happen! initiative.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • What is it going to take to get 'has Drupal Account' on the Merge screen

This forum was archived on 2017-11-26.