PHP/MySQL Expert Needed - Sync SugarCRM Contact to Drupal User
My company uses SugarCRM 6.5 CE to manage our contacts. We like to import our contacts into our Web site, which is managed by Drupal.
From the contact detail view we have create a "Drupal Sync" button in the drop down from the Edit button.
We'd like the programming to first:
A. make sure if the contact has a relationship to an Account record and make sure that the Account has been synced already to Drupal. (If it has, the Account record - in the accounts_cstm table - will have an entry in the drupal_id_c column; or
B. make sure the contact has a relationship with an Account Branch (custom module) and that Branch has a relationship to an Account record and make sure that the Account has been synced already to Drupal. (If it has, the Account record - in the accounts_cstm table - will have an entry in the drupal_id_c column;
- If not, then return an error message.
If it does, then I need the function to create a user in the Drupal database, passing along any data from the create contact form in Sugar that has been entered, as well as get the node id from the Account record from Drupal and use it as the target for the new user in Drupal.
Once created, Sugar should grab the user id and username that Drupal has generated when creating the new user and put them into the SugarCRM contact's PHQ ID and PHQ Username fields.
When done, just a message that says "The contact has been synced to Drupal."
I can attached the two files that we currently use to sync Accounts and their current contacts (as well the Account's Branches and the Branches' Contacts) to Drupal, so you can see what fields we use.
Questions? Let me know. I need this done as soon as possible, of course.
PLEASE NOTE: I will likely hire more than one freelancer to work on this, as I have done in the past, so I can get the results I need in the fastest amount of time.