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 CiviMember (Moderator: Deepak Srivastava) »
  • Modify CiviMember status rules
Pages: [1]

Author Topic: Modify CiviMember status rules  (Read 626 times)

Matthias de MAUROY - CYIM

  • I post occasionally
  • **
  • Posts: 59
  • Karma: 4
  • Working at CYIM
    • CYIM
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • MySQL version: 5.1.66-community-log
  • PHP version: 5.3
Modify CiviMember status rules
March 18, 2014, 04:17:02 am
Hello.

I want to add some features to the membership status workflow. What I'm trying to do is to look if my member did upload all of his mandatory documents (based on price set's informations).

That way if my member did not upload those files his status will stay in Pending. I want to be sure not to do it in the wrong way... Which way is the best to "update" this workflow ?

I'm currently on this task trying to investigate the best way to run it.

Thank's
Matthias de MAUROY
Analyste Web Developpeur
BU WEB
Tél. : +33 (0)2 99 22 83 40
Fax : +33 (0)2 99 22 83 41
Mail : m.mauroy@cyim.com
CYIM
31, rue de la Frébardière
35135 CHANTEPIE
FRANCE

Matthias de MAUROY - CYIM

  • I post occasionally
  • **
  • Posts: 59
  • Karma: 4
  • Working at CYIM
    • CYIM
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • MySQL version: 5.1.66-community-log
  • PHP version: 5.3
Re: Modify CiviMember status rules
March 18, 2014, 04:54:27 am
This function CRM_Member_BAO_Membership::fixMembershipStatusBeforeRenew() is used when saving a contribution is it the only acces point to membership status modification ?

From what I searched it's the only one.
Matthias de MAUROY
Analyste Web Developpeur
BU WEB
Tél. : +33 (0)2 99 22 83 40
Fax : +33 (0)2 99 22 83 41
Mail : m.mauroy@cyim.com
CYIM
31, rue de la Frébardière
35135 CHANTEPIE
FRANCE

KarinG

  • I post frequently
  • ***
  • Posts: 134
  • Karma: 9
  • CiviCRM version: 4+
  • CMS version: Drupal 6 / 7
  • MySQL version: MariaDB
  • PHP version: 5.3/5.4/5.5
Re: Modify CiviMember status rules
March 30, 2014, 05:30:50 pm
Have you considered using hook_civicrm_post for this?
http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+hook+specification

Essentially - you write a Drupal module that contains a hook like this:
yourmodule_civicrm_post( $op, $objectName, $objectId, &$objectRef )

then you can e.g.:
- check to see if a Membership is Created
- if it is -> look for the documents - they would need to be stored in a way so that you can use e.g. cid to look for them
- if the documents exist -> use the API to change status to 'doc complete' [some status you created]
- if the documents do not exist -> use the API to change status to 'pending' [or perhaps a 'doc incomplete']

Hope that helps!




Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Modify CiviMember status rules
March 30, 2014, 07:10:28 pm
Karin's post is likely to be the right answer - but I thought I'd paste the link to the related issue I'm working on - http://forum.civicrm.org/index.php/topic,32013.msg136959.html - basically this is altering the function that calculates membership status to call a hook to assist in calculating it (in my case I was to alter the status depending on membership type)
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

Matthias de MAUROY - CYIM

  • I post occasionally
  • **
  • Posts: 59
  • Karma: 4
  • Working at CYIM
    • CYIM
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • MySQL version: 5.1.66-community-log
  • PHP version: 5.3
Re: Modify CiviMember status rules
March 31, 2014, 12:16:23 am
Karin, Eileen thank you for answering !

You're absolutely right about the hook and I have thought about it but we wanted this feature to be part of CiviCRM, so we override it in the "Custom PHP Path Directory".

And we are doing full review of all custom php files on each upgrade to be up to date.

I hope we are doing this the right way !?

thanks again ;)
Matthias de MAUROY
Analyste Web Developpeur
BU WEB
Tél. : +33 (0)2 99 22 83 40
Fax : +33 (0)2 99 22 83 41
Mail : m.mauroy@cyim.com
CYIM
31, rue de la Frébardière
35135 CHANTEPIE
FRANCE

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Modify CiviMember status rules
March 31, 2014, 12:23:26 am
Generally php over-rides are the hardest sort of customisation to maintain - so if this hook will give you the 'in' you need then I would switch to using it.

However, I think the best outcome would be that either within core or in an extension there would be the ability to
1) have different membership status rules by membership type (I believe the UI to configure this would be 80% of the work in involved)
2) be able to configure a type to have an approval flag (an extra field on the membership table) and not progress the membership status to 'current' until that flag was set.

These 2 seem to be the most common requests from what I have seen & both are fairly generic
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

Matthias de MAUROY - CYIM

  • I post occasionally
  • **
  • Posts: 59
  • Karma: 4
  • Working at CYIM
    • CYIM
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • MySQL version: 5.1.66-community-log
  • PHP version: 5.3
Re: Modify CiviMember status rules
March 31, 2014, 02:17:19 am
Effectively the second one would be perfect for our use !

This is in a way what I do in my over-ride.
I've got an approval checkbox on each contribution (based on custom data) when checked if payment is "ended" then membership is updated to "current".
Matthias de MAUROY
Analyste Web Developpeur
BU WEB
Tél. : +33 (0)2 99 22 83 40
Fax : +33 (0)2 99 22 83 41
Mail : m.mauroy@cyim.com
CYIM
31, rue de la Frébardière
35135 CHANTEPIE
FRANCE

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • Modify CiviMember status rules

This forum was archived on 2017-11-26.