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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Specification for a custom import module
Pages: [1]

Author Topic: Specification for a custom import module  (Read 846 times)

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Specification for a custom import module
December 13, 2010, 12:29:53 pm
Idea of this module is to provide a base UI for importing - a stripped down version of the current interfaces available for contacts, contributions, memberships, etc., which allows users to import files into CiviCRM and do complex processing as part of the import.

Hopefully, it will be able to leverage / compliment the api-ification of importing discussed here http://civicrm.org/blogs/lobo/implementing-batch-import-api.

The idea comes from the following use case:

    * We are integrating with a legacy finance system that delivers a record of payments.  We have no chance of people able to get an api for this system or anything similar.  We'll likely move away from this system at some point in the future but need this integration in the mean time.
    * What we are importing is two things: contacts, and contributions.  but there are a few things that we need to do as these objects are going through the system, e.g. depending on the values in the contact csv, we want to create a pending membership; depending on the values in the contributions csv, they should actually be treated as membership imports and the membership end date be moved on by a fixed amount.
    * We want to carry out some actions based on the values of some of the fields in the import, but we don't need to store these fields
    * We don't need to map fields for this custom mapping.

One approach would be to use hook_civicrm_post to fire off these rules (and I could definitley be convinced of that if it seems easier) but this approach would do the following

Allow a user to specify a csv file to upload (like step step 1. Upload Data)

Step 2 - I don't think is necessary because essentially this is fixed in a custom import.

Do some testing (like step 3. Preview)

Report on the import (like step 4. Summary)

We could probably do this using a saved field mapping and some hooks that get fired when these imports are created.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Specification for a custom import module
December 13, 2010, 12:35:30 pm
Hi Michael

This is basically the sort of problems I used an integration with the migrate module to deal with - I did a couple of blogs on it. I have been using it combined with feeds to do csv imports - there are some blogs on the fuzion site about it but can talk to you if you want more info
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Specification for a custom import module

This forum was archived on 2017-11-26.