From: Steve Sutton Date: Tue, 23 Jul 2019 15:51:37 +0000 (-0400) Subject: Update form start X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=2388a420a247aee69fc0e1d48a349c0bd12e9bef;p=WP-Plugins%2Fglm-member-db-billing.git Update form start Updating each section of billing to get rid of undefined php notices. --- diff --git a/views/admin/billing/accountSearchForm.html b/views/admin/billing/accountSearchForm.html index 4096dc7..f86f894 100644 --- a/views/admin/billing/accountSearchForm.html +++ b/views/admin/billing/accountSearchForm.html @@ -76,9 +76,9 @@ jQuery(document).ready(function($) { {* Form Start *} {$ui = [ - 'id' => 'searchForm', - 'action' => "{$thisUrl}?page={$thisPage}", - 'method' => 'post' + 'id' => 'searchForm', + 'action' => "{$thisUrl}?page={$thisPage}", + 'method' => 'post' ]} {include file='ui/f6/form-start.html'} diff --git a/views/admin/billing/accounts.html b/views/admin/billing/accounts.html index f7adf21..ba76e9e 100644 --- a/views/admin/billing/accounts.html +++ b/views/admin/billing/accounts.html @@ -139,7 +139,6 @@ e.preventDefault(); accountLinksEmployeesSelected(); var account_id = $(this).data('id'); - console.log('account_id: ', account_id); $('#account-employees-' + account_id).show(); } ); @@ -152,7 +151,6 @@ function accountLinksEmployeesSelected() { accountEmployee = true; - console.log( 'accountHoverId: ', accountHoverId ); $('#account-container-' + accountHoverId).addClass('hide-for-large'); } diff --git a/views/admin/billing/editAccount.html b/views/admin/billing/editAccount.html index 88ceef3..57cdcdd 100644 --- a/views/admin/billing/editAccount.html +++ b/views/admin/billing/editAccount.html @@ -354,7 +354,6 @@ jQuery(document).ready(function($){ $('#glm-billing-employees').on('click', '.glm-billing-employee-del', function(){ - //console.log( 'clicked glm-billing-employee-del on ' ); $(this).parent('.glm-billing-employee').remove(); }); diff --git a/views/admin/billing/editAccountAjax.html b/views/admin/billing/editAccountAjax.html index 6f850e4..728fc36 100644 --- a/views/admin/billing/editAccountAjax.html +++ b/views/admin/billing/editAccountAjax.html @@ -409,7 +409,6 @@ jQuery(document).ready(function($){ $('#glm-billing-employees').on('click', '.glm-billing-employee-del', function(){ - //console.log( 'clicked glm-billing-employee-del on ' ); $(this).parent('.glm-billing-employee').remove(); }); diff --git a/views/admin/billing/editInvoice.html b/views/admin/billing/editInvoice.html index 0987711..be9d42c 100644 --- a/views/admin/billing/editInvoice.html +++ b/views/admin/billing/editInvoice.html @@ -389,9 +389,7 @@ jQuery(document).ready(function($){ valid = valid && checkRequired( line_item_type, lineTips, 'Invoice Type is required!' ); if ( valid ) { - // console.log( 'line_item_type', line_item_type ); var selectedLineItem = $.extend({}, invoiceTypeJSON[line_item_type.val()] ); - // console.log( 'selectedLineItem', selectedLineItem ); if ( selectedLineItem.dynamic_amount.value ) { isDynamicInvoiceType = true; var dynamic_price = $( 'input[name="dynamic_price"]' ); // Dynamic price line item @@ -404,7 +402,6 @@ jQuery(document).ready(function($){ if ( selectedLineItem == undefined ) { // Check that name and amount are not empty } else { - // console.log( 'isDynamicInvoiceType:', isDynamicInvoiceType ); // Check first to see if this line_item_type is already in line_items. // Only for invoice types that are not dynamic amounts if ( isDynamicInvoiceType || ( !isDynamicInvoiceType && !isLineItem( selectedLineItem ) ) ) { @@ -529,7 +526,6 @@ jQuery(document).ready(function($){ valid = valid && checkRequired( billing_zip, accountTips, 'Billing Zip is required!' ); if ( valid ) { - // console.log( newAccountForm.serialize() ); $.ajax({ url: '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=billingAccount&option=add', cache: false, @@ -539,7 +535,6 @@ jQuery(document).ready(function($){ dataType: 'json' }).done(function( msg ){ if ( msg.status === true ) { - // console.log( 'account: ', msg.account ); // TODO: check these function as they don't seem to work! // Reload the account select updateBillingAccountList( msg.account ); @@ -551,7 +546,6 @@ jQuery(document).ready(function($){ if ( msg.fieldFail.account_number ) { alert( 'Account Number must be unique!' ); } - // console.log( 'return', msg ); } }); } @@ -582,9 +576,6 @@ jQuery(document).ready(function($){ * Check field against regular expression. */ function checkRegexp( fieldName, regexp, message, tips ) { - // console.log( 'fieldName: ', fieldName ); - // console.log( 'regexp: ', regexp ); - // console.log( 'message: ', message ); if ( !( regexp.test( fieldName.val() ) ) ) { fieldName.addClass( 'ui-state-error' ); updateTips( tips, message ); @@ -622,7 +613,6 @@ jQuery(document).ready(function($){ dataType: 'json' }).done(function(msg){ availableAccountMembers = []; - // console.log( msg ); for ( index in msg ) { var obj = msg[index]; availableAccountMembers.push( { @@ -631,7 +621,6 @@ jQuery(document).ready(function($){ id: obj.id } ); } - // console.log( 'availableAccountMembers', availableAccountMembers ); // also need to update the source for the autocomplete $('#glm_member_accounts').autocomplete( 'option', @@ -663,7 +652,6 @@ jQuery(document).ready(function($){ dataType: 'json' }).done(function(data){ invoiceTypeJSON = data; - // console.log( 'invoiceTypeJSON', invoiceTypeJSON ); addLineItemToInvoice( invoiceTypeJSON[lineItemId] ); totalInvoice(); }); @@ -759,10 +747,7 @@ jQuery(document).ready(function($){ valid = valid && checkRequired( customFieldAmount, customTips, 'Amount is required!' ); valid = valid && checkRegexp( customFieldAmount, moneyRegex, 'Amount: Use numbers only!', customTips ); - // console.log( 'customFieldName: ', customFieldName.val() ); - // console.log( 'customFieldAmount: ', customFieldAmount.val() ); if ( valid ) { - // console.log('start ajax'); $.ajax({ url: '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=invoiceTypes&option=add', cache: false, @@ -777,12 +762,10 @@ jQuery(document).ready(function($){ dataType: 'json' }).done(function( msg ){ if ( msg.status === true ) { - // console.log( 'msg from addCustomLineItem: ', msg ); updateInvoiceTypeList( msg.invoiceType.id ); // Close the dialog customLineItemDialog.dialog( 'close' ); } else { - // console.log( 'return', msg ); } }); } @@ -864,7 +847,6 @@ jQuery(document).ready(function($){ */ newAccountForm = newAccountDialog.find( '#addAccountForm' ).on( 'submit', function(){ event.preventDefault(); - // console.log('Adding new Account'); }); /** diff --git a/views/admin/billing/editInvoiceType.html b/views/admin/billing/editInvoiceType.html index f311073..d8e2c51 100644 --- a/views/admin/billing/editInvoiceType.html +++ b/views/admin/billing/editInvoiceType.html @@ -49,16 +49,15 @@ {* Form Start *} {$ui = [ - 'id' => 'billing-invoice-type-form', - 'action' => "{$thisUrl}?page={$thisPage}&glm_action==invoiceTypes", - 'method' => 'post', - 'file' => false + 'id' => 'billing-invoice-type-form', + 'action' => "{$thisUrl}?page={$thisPage}&glm_action==invoiceTypes", + 'method' => 'post', + 'file' => false, + 'validate' => true, + 'validateFocusMsg' => true ]} {include file="ui/f6/form-start.html"} -{* Callout Errors *} -{include file='ui/f6/errorCallout.html'} - {if isset($data.fieldData.id)} @@ -191,22 +190,16 @@ - - -{* Form Submit *} -{if isset( $data.fieldData.id )} - {$label = 'Update Invoice Type'} -{else} - {$label = 'Add Invoice Type'} -{/if} -{$ui = [ - 'type' => 'submit', - 'label' => $label, - 'class' => 'primary' -]} -{include file='ui/f6/submit.html'} + {* Form Submit *} + {$ui = [ + 'submit' => true, + 'label' => 'Save Invoice Type', + 'class' => 'primary', + 'cancel' => "{$thisUrl}?page=glm-members-admin-menu-billing&glm_action=invoiceTypes" + ]} + {include file='ui/f6/submit.html'} -Cancel + {* Error Callout *} {include file='ui/f6/errorCallout.html'} @@ -220,26 +213,23 @@ + + + /* + * Edit area tabs + */ + // 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).fadeIn(500).fadeOut(500); + + if('{literal}{$registrationsSettings.fieldData.calendar_view}{/literal}'){ + $("#calendar-view").val('{literal}{$registrationsSettings.fieldData.calendar_view}{/literal}'); + } else { + $("#calendar-view").val("agenda"); + } + }); + diff --git a/views/admin/settings/billing.html b/views/admin/settings/billing.html index b0c1fe0..aafd2dd 100644 --- a/views/admin/settings/billing.html +++ b/views/admin/settings/billing.html @@ -409,7 +409,7 @@ -