? role.patch Index: payment/payment.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/ecommerce/payment/payment.module,v retrieving revision 1.68.2.1 diff -u -r1.68.2.1 payment.module --- payment/payment.module 9 Jun 2006 23:45:14 -0000 1.68.2.1 +++ payment/payment.module 1 Jul 2006 04:11:17 -0000 @@ -162,13 +162,16 @@ ); if (variable_get('payment_recurring', 0)) { - $form['recurring_payments']['on_payment_roles'] = array( - '#type' => 'checkboxes', - '#title' => t('Role inheritance'), - '#default_value' => variable_get('on_payment_roles', ''), - '#options' => user_roles(1), - '#desciption' => t('Optionally, select the roles an user is assigned when they purchase a recurring payment item. The user will be removed from these roles when the item expires. Note: requires cron.') - ); + if (!module_exist('role_membership')) { + $form['recurring_payments']['on_payment_roles'] = array( + '#type' => 'checkboxes', + '#title' => t('Role inheritance'), + '#default_value' => variable_get('on_payment_roles', ''), + '#options' => user_roles(1), + '#desciption' => t('Optionally, select the roles an user is assigned when they purchase a recurring payment item. The user will be removed from these roles when the item expires. Note: requires cron.') + ); + } + $form['recurring_payments']['recurring_notice'] = store_email_form('payment', 'recurring_notice', t('Recurring payment notice e-mail'), t('This text will be e-mailed to customers before their recurring payment expires.')); $form['recurring_payments']['payment_recurring_interval'] = array( '#value' => t('

You can send up to 5 renewal notifications to the customer. Choose at the interval each notfication is sent before the product expires.

') Index: store/store.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/ecommerce/store/store.module,v retrieving revision 1.125.2.2 diff -u -r1.125.2.2 store.module --- store/store.module 9 Jun 2006 00:29:13 -0000 1.125.2.2 +++ store/store.module 1 Jul 2006 04:11:17 -0000 @@ -922,7 +922,18 @@ function store_change_role($txn, $add_to_roles) { $txn = (object)($txn); $u = user_load(array('uid' => $txn->uid)); - $on_payment_roles = array_flip((array) variable_get('on_payment_roles', '')); + + $on_payment_roles = array(); + if (module_exist('role_membership')) { + foreach ((array)$txn->items as $item) { + foreach (role_membership_get_product_role($item->nid) as $rid => $name) { + $on_payment_roles[$rid] = $name; + } + } + } + else { + $on_payment_roles = array_flip((array) variable_get('on_payment_roles', '')); + } $roles = user_roles(); if ($u->uid >= 1 && is_array($on_payment_roles)) {