Membership reports

5 replies [Last post]
sfbayacm
Offline
Joined: 04/08/2011
Status: 
Answered

There was some discussion at http://www.moneyscripts.net/forums/support/2010/09/22/export-reports. The profile_csv module works but provides no membership info.

I'm exploring creation of code and do see that you add memberships to the $user structure when called via user_load. I continue down this path really would like to see this as part of Moneyscripts. Short of this appearing in Moneyscripts, advice on possible helper functions (if any) in the code would be appreciated.

In our particular case we want to maintain postal addresses as part of our DB and extract these for current members to generate labels for old fashioned postal mails. Extracting a csv file would suit our purpose. I recognize that the issue of multiple memberships does complicate things a bit. Repeating the user for each membership would probably be OK.

Leighton Whiting
Offline
Joined: 06/02/2009
The use case you are after is

The use case you are after is too specific to be added as a feature to Membership Suite, since it involves a custom profile field.

I think that the best way would be to expose the user's membership levels to the Profile CSV module, so that you can export it using that module. What do you think about that?

Sincerely,
Leighton Whiting

sfbayacm
Offline
Joined: 04/08/2011
Your solution would work

Leighton,

Using profile_csv is certainly an acceptable solution but might be unnecessary at this point :-). I do have code working to do what I need (although I need to tweak a bit more). I do make a call to ms_membership_get_membership_status_text to get translate the status id to text. There rest of the interface to your system is database queries (although perhaps there are other calls I could be making to your software that would help). If you are willing, I would love your comments/suggestions.

Steve

Leighton Whiting
Offline
Joined: 06/02/2009
It sounds like you've got a

It sounds like you've got a working solution then. Is there anything else that you need to show that you can't find? If so, I could probably help point you in the right direction.

I looked into the profile_csv module and it is hard-coded to only query the profile fields, so there are no hooks for me to implement, which means it would need to be rewritten to even allow me to provide integration. So that path is shot.

In the Drupal 7 version of MS Core, I have a function in place to export drupal's 'theme_table' headers and rows into CSV reports. This is used for the Payments page to let you export CSV reports of the payments. I also had intended to make most of the reports on the site exportable via CVS using these same functions. If you are using Drupal 7, it may be worth taking a look at those.

Sincerely,
Leighton Whiting

sfbayacm
Offline
Joined: 04/08/2011
Yes, I have a solution

Leighton,

I am OK for now. I'm going to email you my code separately. If you have any advice to offer, it would be appreciate. I wish everybody else in Drupal 7 was as up to date as you. The new report capability sounds very nice.

Thanks

Steve

sfbayacm
Offline
Joined: 04/08/2011
You may close this

Leighton,

As per our discussions, my immediate issues are solved. Thanks for glancing at my code.

Steve

Twitter Feed