From: Steve Sutton Date: Fri, 16 Mar 2018 20:31:16 +0000 (-0400) Subject: Update member only menu X-Git-Tag: v1.0.0^2~128 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=b96c69fe6f77092610c5bf82e9c41d5500164a4c;p=WP-Plugins%2Fglm-member-db-billing.git Update member only menu Add billing. Don't allow editing of anniversary or renewal dates. --- diff --git a/models/admin/member/billing.php b/models/admin/member/billing.php index d0dae7b..acc47ec 100644 --- a/models/admin/member/billing.php +++ b/models/admin/member/billing.php @@ -129,6 +129,7 @@ class GlmMembersAdmin_member_billing // extends GlmDataBilling $lockedToMember = apply_filters('glm_members_locked_to_member_id', false); if ($lockedToMember) { $memberID = $lockedToMember; + $this->memberID = $memberID; $lockedToMember = $memberID; $lockedWhereT = 'T.ref_type = '.$this->config['ref_type_numb']['Member'].' AND T.ref_dest = '.$memberID; $lockedWhere = 'ref_type = '.$this->config['ref_type_numb']['Member'].' AND ref_dest = '.$memberID; diff --git a/setup/adminMenus.php b/setup/adminMenus.php index affa099..7a6ca6e 100644 --- a/setup/adminMenus.php +++ b/setup/adminMenus.php @@ -49,13 +49,23 @@ * is named the same as the "glm_action" parameter. * */ -if ( current_user_can( 'glm_members_members' ) ) { + +if (isset($this->config['loggedInUser']) && isset($this->config['loggedInUser']['contactUser']) && $this->config['loggedInUser']['contactUser']) { + add_submenu_page( + $mainMenuSlug, + 'Billing', + 'Billing', + 'glm_members_edit_my_entity', + 'glm-members-admin-menu-billing-index', + function() { $this->controller('member', 'billing'); } + ); +} else { add_submenu_page( 'glm-members-admin-menu-members', - 'Billing / Reports', + 'Billing', 'Billing', 'glm_members_members', 'glm-members-admin-menu-billing', - function() { $this->controller('billing', 'index'); } + function() { $this->controller('billing'); } ); } diff --git a/views/admin/billing/editAccount.html b/views/admin/billing/editAccount.html index ea7ad2e..f766b66 100644 --- a/views/admin/billing/editAccount.html +++ b/views/admin/billing/editAccount.html @@ -11,11 +11,15 @@ {if $accountAdded}Account Added{/if}
- - - - - + + + + + + {if $lockedToMember} + + + {/if} {if $accountID} @@ -31,6 +35,7 @@ + {if !$lockedToMember} Anniversary Date @@ -46,6 +51,7 @@ {if $account.fieldFail.renewal_date}

{$account.fieldFail.renewal_date}

{/if}
+ {/if} Billing Email @@ -140,9 +146,13 @@ jQuery(document).ready(function($){ // Setup the date picker for the input field with the name anniversary_date - $('input[name="anniversary_date"]').datepicker(); + $('input[name="anniversary_date"]').datepicker({ + dateFormat: 'mm/dd/yy' + }); // Setup the date picker for the input field with the name renewal_date - $('input[name="renewal_date"]').datepicker(); + $('input[name="renewal_date"]').datepicker({ + dateFormat: 'mm/dd/yy' + }); // Flash certain elements for a short time after display $(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500); diff --git a/views/admin/billing/editInvoice.html b/views/admin/billing/editInvoice.html index 8e09e4c..1c9c5f4 100644 --- a/views/admin/billing/editInvoice.html +++ b/views/admin/billing/editInvoice.html @@ -623,7 +623,7 @@ jQuery(document).ready(function($){ */ dialog = $('#newLineItemDialog').dialog({ autoOpen: false, - minWidth: 400, + minWidth: 550, dialogClass: 'glm-dialog-no-close', modal: true, buttons: { @@ -645,7 +645,7 @@ jQuery(document).ready(function($){ */ customLineItemDialog = $('#newCustomLineItemDialog').dialog({ autoOpen: false, - minWidth: 400, + minWidth: 550, dialogClass: 'glm-dialog-no-close', modal: true, buttons: { @@ -815,7 +815,9 @@ jQuery(document).ready(function($){ }); // Setup the date picker for the input field with the name due_date - $('.datepicker').datepicker(); + $('.datepicker').datepicker({ + dateFormat: 'mm/dd/yy' + }); /** * Change event listener for member account select. diff --git a/views/admin/management/billing.html b/views/admin/management/billing.html index fd73eef..4a29629 100644 --- a/views/admin/management/billing.html +++ b/views/admin/management/billing.html @@ -23,7 +23,7 @@

Payment

- + Payment Methods: {foreach from=$regSettings.fieldData.payment_methods.bitmap item=v}