One of my clients requested a feature which I added to the UC Roles module. The client wanted have relative expiration dates conform to their publication cycle. They publish a set of monthly reports on a given day of that month, e.g. on the 15th, so they want roles to expire on that day. For example, if it is 2009/10/09, and a customer purchases a role for a year, the expiration date would need to be 2010/10/15. Customers that purchase after the given day of the month essentially get an extra month, e.g. if it is 2009/10/31, then the role should expire on 2010/11/15.

I have attached a patch that proposes how this might be done. What do you think?

CommentFileSizeAuthor
adjust-expiration-uc-roles.patch3.12 KBthisgeek
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hefox’s picture

It looks like I need this patch also (to the first of the month :>), so subscribing and will test when I get a development box up for that site.

hefox’s picture

Haven't tested it yet, but the variable_set instead of using a field in the uc_roles_products table; that looks like the appropriate place for it.

hefox’s picture

Nvm about above, didn't find that setting page until later.

Doesn't work for when the role expiration date has been overriden (say default 1 year, product overrides to 2 years). Moved the code up before the if else and works fine. (in _uc_roles_product_get_expiration). (Svn is a bit messy for making patch, so too lazy to repatch).

TR’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev
Component: Code » Roles

New features should go into 7.x-3.x first.

TR’s picture

TR’s picture

Version: 7.x-3.x-dev » 8.x-4.x-dev
Issue summary: View changes