*
* Also note that parameters will be in the context of the main admin controller constructor.
*/
-add_filter(
- 'glm-member-db-dashboard-member-widgets',
- function( $member = null ){
- return $this->controller( 'dashboard', 'billing', $member );
- },
- 9,
- 1
-);
-
-/**
- * Setup cron task request to run billingFlagExpiredUsers
- *
- * Run only once per day. Everyday.
- */
-add_filter(
- 'glm_associate_cron_request',
- function( $cron_task ){
- $new_cron = array(
- array(
- 'menu' => 'ajax',
- 'action' => 'billingFlagExpiredUsers',
- 'daysOfWeek' => false,
- 'times' => array( 5 ),
- 'params' => array()
- )
+if (isset($this->config['loggedInUser']) && isset($this->config['loggedInUser']['contactUser']) && $this->config['loggedInUser']['contactUser']) {
+ $memberBillingEnabled = $this->config['settings']['member_billing_enabled'];
+ if ( $memberBillingEnabled ) {
+ add_filter(
+ 'glm-member-db-dashboard-member-widgets',
+ function( $member = null ){
+ return $this->controller( 'dashboard', 'billing', $member );
+ },
+ 9,
+ 1
);
- return array_merge( $cron_task, $new_cron );
}
-);
+}
-add_filter(
- 'glm_associate_cron_request',
- function( $cron_task ){
- $new_cron = array(
- array(
- 'menu' => 'ajax',
- 'action' => 'billingFixActiveUsers',
- 'daysOfWeek' => false,
- 'times' => array( 6 ),
- 'params' => array()
- )
- );
- return array_merge( $cron_task, $new_cron );
- }
-);
+$renewalDayStatic = $this->config['settings']['renewal_day_static'];
+if ( !$renewalDayStatic ) {
+ /**
+ * Setup cron task request to run billingFlagExpiredUsers
+ *
+ * Run only once per day. Everyday.
+ */
+ add_filter(
+ 'glm_associate_cron_request',
+ function( $cron_task ){
+ $new_cron = array(
+ array(
+ 'menu' => 'ajax',
+ 'action' => 'billingFlagExpiredUsers',
+ 'daysOfWeek' => false,
+ 'times' => array( 5 ),
+ 'params' => array()
+ )
+ );
+ return array_merge( $cron_task, $new_cron );
+ }
+ );
-/**
- * Setup cron task request to run billingSetupQueue
- *
- * Run only once per day. Everyday.
- */
-add_filter(
- 'glm_associate_cron_request',
- function( $cron_task ) {
- $new_cron = array(
- array(
- 'menu' => 'ajax',
- 'action' => 'billingSetupQueue',
- 'daysOfWeek' => false,
- 'times' => array( 3 ),
- 'params' => array()
- )
- );
- return array_merge( $cron_task, $new_cron );
- }
-);
+ add_filter(
+ 'glm_associate_cron_request',
+ function( $cron_task ){
+ $new_cron = array(
+ array(
+ 'menu' => 'ajax',
+ 'action' => 'billingFixActiveUsers',
+ 'daysOfWeek' => false,
+ 'times' => array( 6 ),
+ 'params' => array()
+ )
+ );
+ return array_merge( $cron_task, $new_cron );
+ }
+ );
-/**
- * Setup cron task request to run billingRunQueue
- *
- * Run only once per day. Everyday.
- */
-add_filter(
- 'glm_associate_cron_request',
- function( $cron_task ) {
- $new_cron = array(
- array(
- 'menu' => 'ajax',
- 'action' => 'billingRunQueue',
- 'daysOfWeek' => false,
- 'times' => array( 4 ),
- 'params' => array()
- )
- );
- return array_merge( $cron_task, $new_cron );
- }
-);
+ /**
+ * Setup cron task request to run billingSetupQueue
+ *
+ * Run only once per day. Everyday.
+ */
+ add_filter(
+ 'glm_associate_cron_request',
+ function( $cron_task ) {
+ $new_cron = array(
+ array(
+ 'menu' => 'ajax',
+ 'action' => 'billingSetupQueue',
+ 'daysOfWeek' => false,
+ 'times' => array( 3 ),
+ 'params' => array()
+ )
+ );
+ return array_merge( $cron_task, $new_cron );
+ }
+ );
+
+ /**
+ * Setup cron task request to run billingRunQueue
+ *
+ * Run only once per day. Everyday.
+ */
+ add_filter(
+ 'glm_associate_cron_request',
+ function( $cron_task ) {
+ $new_cron = array(
+ array(
+ 'menu' => 'ajax',
+ 'action' => 'billingRunQueue',
+ 'daysOfWeek' => false,
+ 'times' => array( 4 ),
+ 'params' => array()
+ )
+ );
+ return array_merge( $cron_task, $new_cron );
+ }
+ );
+}
/**
* Filter returning the html for the billing field form (contact)
<fieldset>
<legend>Billing Information</legend>
- <div class="glm-billing-field glm-billing-left-half">
- <div class="glm-billing-label glm-required">
- First Name
- </div>
- <div class="glm-billing-input">
- <input type="text" name="billing_fname" value="{$account.fieldData.billing_fname}" required />
+ {if $settings.billing_contact_name_enabled}
+ <div class="glm-billing-field glm-billing">
+ <div class="glm-billing-label glm-required">
+ Billing Contact Name
+ </div>
+ <div class="glm-billing-input">
+ <input type="text" name="billing_contact_name" value="{$account.fieldData.billing_contact_name}" required />
+ </div>
</div>
- </div>
- <div class="glm-billing-field glm-billing-right-half">
- <div class="glm-billing-label glm-required">
- Last Name
+ {else}
+ <div class="glm-billing-field glm-billing-left-half">
+ <div class="glm-billing-label glm-required">
+ First Name
+ </div>
+ <div class="glm-billing-input">
+ <input type="text" name="billing_fname" value="{$account.fieldData.billing_fname}" required />
+ </div>
</div>
- <div class="glm-billing-input">
- <input type="text" name="billing_lname" value="{$account.fieldData.billing_lname}" required />
+ <div class="glm-billing-field glm-billing-right-half">
+ <div class="glm-billing-label glm-required">
+ Last Name
+ </div>
+ <div class="glm-billing-input">
+ <input type="text" name="billing_lname" value="{$account.fieldData.billing_lname}" required />
+ </div>
</div>
- </div>
+ {/if}
<div class="glm-billing-field">
<div class="glm-billing-label glm-required">
Address