From: Steve Sutton Date: Thu, 18 Jul 2019 20:54:21 +0000 (-0400) Subject: working with more ui elemnents and bring in management X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=43772f5cbbdbc0bb640e7034713c8d689f0bb363;p=WP-Plugins%2Fglm-member-db-billing.git working with more ui elemnents and bring in management Bringing in management to the billing side. --- diff --git a/classes/data/dataManagement.php b/classes/data/dataManagement.php index 673b503..1493018 100644 --- a/classes/data/dataManagement.php +++ b/classes/data/dataManagement.php @@ -160,8 +160,8 @@ class GlmDataBillingManagement extends GlmDataAbstract 'authorize_net_test' => array ( 'field' => 'authorize_net_test', 'type' => 'list', - 'list' => $this->config['proc_test_mode'], - 'default' => $this->config['proc_test_mode_numb']['Local Approval Test'], + 'list' => $this->config['billing_proc_test_mode'], + 'default' => $this->config['billing_proc_test_mode_numb']['Local Approval Test'], 'use' => 'a' ), @@ -198,8 +198,8 @@ class GlmDataBillingManagement extends GlmDataAbstract 'merchant_solutions_test' => array ( 'field' => 'merchant_solutions_test', 'type' => 'list', - 'list' => $this->config['proc_test_mode'], - 'default' => $this->config['proc_test_mode_numb']['Local Approval Test'], + 'list' => $this->config['billing_proc_test_mode'], + 'default' => $this->config['billing_proc_test_mode_numb']['Local Approval Test'], 'use' => 'a' ), diff --git a/models/admin/billing/management.php b/models/admin/billing/management.php new file mode 100644 index 0000000..1ec0c00 --- /dev/null +++ b/models/admin/billing/management.php @@ -0,0 +1,293 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release billing.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ + * @link http://dev.gaslightmedia.com/ + */ + +// Load Management Billing data abstract +require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH.'/data/dataManagement.php'; + +/** + * GlmMembersAdmin_management_billing + * + * PHP version 5 + * + * @category Model + * @package GLM Member DB + * @author Chuck Scott + * @license http://www.gaslightmedia.com Gaslightmedia + * @release SVN: $Id: packaging.php,v 1.0 2011/01/25 19:31:47 cscott + * Exp $ + */ +class GlmMembersAdmin_billing_management extends GlmDataBillingManagement +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * dbh Postgres database connection + * + * @var mixed + * @access public + */ + public $config; + /** + * settings used for the schema and tablenames + * + * @var mixed + * @access public + */ +// public $settings = array(); +// /** +// * billing +// * +// * @var bool +// * @access public +// */ +// public $billing = array(); + + /** + * Constructor + * + * This contructor performs the work for this model. This model returns + * an array containing the following. + * + * 'status' + * + * True if successfull and false if there was a fatal failure. + * + * 'view' + * + * A suggested view name that the contoller should use instead of the + * default view for this model or false to indicate that the default view + * should be used. + * + * 'data' + * + * Data that the model is returning for use in merging with the view to + * produce output. + * + * @wpdb object WordPress database object + * + * @return array Array containing status, suggested view, and any data + */ + public function __construct ($wpdb, $config) + { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + // Run constructor for members data class + parent::__construct(false, false); + + } + + /** + * modelAction + * + * @param bool $actionData + * @access public + * @return void + */ + public function modelAction( $actionData = false ) + { + + $option = false; + $settingsUpdated = false; + $settingsUpdateError = false; + $regSettings = false; + $view = 'management'; + $importResults = false; + $totalImports = false; + $numberProcessed = false; + $totalMembers = false; + + // Enqueue GLMA Foundation + wp_enqueue_style( 'Foundation6', GLM_MEMBERS_PLUGIN_URL . '/css/foundation-6.min.css' ); + wp_enqueue_script( 'Foundation6', GLM_MEMBERS_PLUGIN_URL . '/js/foundation-6.min.js' ); + + // echo '
Config: ' . print_r( $this->config, true ) . '
'; + // General settings are always stored in a record with ID=1. + $id = 1; + + // Determine if current user can edit configurations + if ( !current_user_can( 'glm_members_management' ) ) { + return array( + 'status' => false, + 'menuItemRedirect' => 'error', + 'modelRedirect' => 'index', + 'view' => 'admin/error/index.html', + 'data' => array( + 'reason' => 'User does not have rights to make configuration changes.' + ) + ); + } + + // Check for submission option + $option = ''; + if ( isset( $_REQUEST['option'] ) ) { + $option = $_REQUEST['option']; + } + + if ( !isset( $option ) ) { + $option = ''; + } + + switch( $option ) { + + // Update the settings and redisplay the form + case 'submit': + + // Update the general settings + $regSettings = $this->updateEntry( $id ); + + // Check if we were successful + if ( $regSettings['status'] ) { + + $settingsUpdated = true; + $regSettings = $this->editEntry( $id ); + + } else { + $settingsUpdateError = true; + } + + break; + + case 'verifyBillingData': + $view = 'verifyBillingData'; + if ( isset( $_REQUEST['option2'] ) ) { + $option2 = $_REQUEST['option2']; + } + if ( !isset( $option2 ) ) { + $option2 = ''; + } + switch ( $option2 ) { + case 'verify': + require_once GLM_MEMBERS_BILLING_PLUGIN_PATH.'/models/admin/management/verifyBillingData.php'; + // die('here'); + break; + default: + break; + } + break; + + case 'importBillingData': + $view = 'importBillingData'; + if ( isset( $_REQUEST['option2'] ) ) { + $option2 = $_REQUEST['option2']; + } + if ( !isset( $option2 ) ) { + $option2 = ''; + } + switch ( $option2 ) { + case 'import': + require_once GLM_MEMBERS_BILLING_PLUGIN_PATH.'/models/admin/management/importBillingData.php'; + // die('here'); + break; + default: + break; + } + break; + + case 'importAccounts': + $view = 'importAccounts'; + if ( isset( $_REQUEST['option2'] ) ) { + $option2 = $_REQUEST['option2']; + } + if ( !isset( $option2 ) ) { + $option2 = ''; + } + switch ( $option2 ) { + case 'import': + require_once GLM_MEMBERS_BILLING_PLUGIN_PATH.'/models/admin/management/importAccounts.php'; + break; + default: + break; + } + break; + + case 'createInvoices': + $view = 'createInvoices'; + if ( isset( $_REQUEST['option2'] ) ) { + $option2 = $_REQUEST['option2']; + } + if ( !isset( $option2 ) ) { + $option2 = ''; + } + switch ( $option2 ) { + case 'create': + require_once GLM_MEMBERS_BILLING_PLUGIN_PATH.'/models/admin/management/createInvoices.php'; + break; + default: + break; + } + break; + + // Default is to get the current settings and display the form + default: + + // Try to get the first (should be only) entry for general settings. + $regSettings = $this->editEntry( $id ); + + // Check if we didn't get the settings + if ($regSettings === false) { + + $errorMsg = "Unable to load the Billing management settings"; + + trigger_error($errorMsg, E_USER_NOTICE); + + return array( + 'status' => false, + 'menuItemRedirect' => 'error', + 'modelRedirect' => 'index', + 'view' => 'admin/error/index.html', + 'data' => array( + 'reason' => $errorMsg + ) + ); + } + + break; + + } + + // Compile template data + $template_data = array( + 'regSettings' => $regSettings, + 'settingsUpdated' => $settingsUpdated, + 'settingsUpdateError' => $settingsUpdateError, + 'option' => $option, + 'importResults' => $importResults, + 'totalImports' => $totalImports, + 'numberProcessed' => $numberProcessed, + 'start' => ( isset( $start ) ? $start : false ), + 'totalMembers' => $totalMembers, + ); + + // Return status, suggested view, and data to controller + return array( + 'status' => true, + 'menuItemRedirect' => false, + 'modelRedirect' => false, + 'view' => 'admin/billing/' . $view . '.html', + 'data' => $template_data + ); + } +} diff --git a/models/admin/billing/settings.php b/models/admin/billing/settings.php index cfb6758..79d6e7e 100644 --- a/models/admin/billing/settings.php +++ b/models/admin/billing/settings.php @@ -110,7 +110,7 @@ class GlmMembersAdmin_billing_settings extends GlmDataBillingSettings $option2 = false; $enable_members = $this->config['settings']['enable_members']; - if (isset($_REQUEST['option'])) { + if ( isset( $_REQUEST['option'] ) ) { $option = $_REQUEST['option']; } @@ -118,7 +118,7 @@ class GlmMembersAdmin_billing_settings extends GlmDataBillingSettings wp_enqueue_style( 'Foundation6', GLM_MEMBERS_PLUGIN_URL . '/css/foundation-6.min.css' ); wp_enqueue_script( 'Foundation6', GLM_MEMBERS_PLUGIN_URL . '/js/foundation-6.min.js' ); - switch ($option) { + switch ( $option ) { case 'settings': @@ -142,11 +142,11 @@ class GlmMembersAdmin_billing_settings extends GlmDataBillingSettings // Check for submission option $option2 = ''; - if (isset($_REQUEST['option2'])) { + if ( isset( $_REQUEST['option2'] ) ) { $option2 = $_REQUEST['option2']; } - switch($option2) { + switch ( $option2 ) { // Update the settings and redisplay the form case 'submit': @@ -164,7 +164,7 @@ class GlmMembersAdmin_billing_settings extends GlmDataBillingSettings // Update the billing settings settings $billing_settings = $this->updateEntry(1); - if ($billing_settings['status']) { + if ( $billing_settings['status'] ) { $settings_updated = true; } else { $settings_update_error = true; diff --git a/setup/standardTemplateParams.php b/setup/standardTemplateParams.php new file mode 100644 index 0000000..d91438f --- /dev/null +++ b/setup/standardTemplateParams.php @@ -0,0 +1,32 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ + * @link http://dev.gaslightmedia.com/ + */ + +/* + * Standard template parameters available to all templates + * + * This file is "required" by both the front and admin controllers + * inside the controller() function. As such, this runs in the + * context of those controllers. + * + */ + +// Common to both admin and front-end +$smarty->templateAssign('glmPluginName', GLM_MEMBERS_BILLING_PLUGIN_NAME ); + +if ( current_user_can( 'glm_members_management' ) ) { + $smarty->templateAssign('glmMemberManager', true); +} else { + $smarty->templateAssign('glmMemberManager', false); +} diff --git a/setup/validActions.php b/setup/validActions.php index 9bc8f6f..f75376a 100644 --- a/setup/validActions.php +++ b/setup/validActions.php @@ -100,6 +100,7 @@ $glmMembersBillingAddOnValidActions = array( 'settings' => GLM_MEMBERS_BILLING_PLUGIN_SLUG, 'invoiceTypes' => GLM_MEMBERS_BILLING_PLUGIN_SLUG, 'notifications' => GLM_MEMBERS_BILLING_PLUGIN_SLUG, + 'management' => GLM_MEMBERS_BILLING_PLUGIN_SLUG, ), 'member' => array( 'billing' => GLM_MEMBERS_BILLING_PLUGIN_SLUG, diff --git a/views/admin/billing/accountSearchForm.html b/views/admin/billing/accountSearchForm.html index 4e50188..121ace2 100644 --- a/views/admin/billing/accountSearchForm.html +++ b/views/admin/billing/accountSearchForm.html @@ -89,18 +89,18 @@ jQuery(document).ready(function($) {
- +
- +
- +
diff --git a/views/admin/billing/editInvoiceType.html b/views/admin/billing/editInvoiceType.html index 0afdae7..b3ae16b 100644 --- a/views/admin/billing/editInvoiceType.html +++ b/views/admin/billing/editInvoiceType.html @@ -8,194 +8,194 @@ ]} {include file='ui/f6/grid-start.html'} - {* Set $data to $invoiceType *} - {* This is for using the UI elements *} - {$data = $invoiceType} - - {* Invoice Type Updated *} - {$ui = [ - 'label' => 'Invoice Type Updated', - 'active' => $invoiceTypeUpdated, - 'type' => 'success' - ]} - {include file="ui/f6/callout.html"} - - {* Invoice Type Added *} - {$ui = [ - 'label' => 'Invoice Type Added', - 'active' => $invoiceTypeAdded, - 'type' => 'success' - ]} - {include file="ui/f6/callout.html"} - - {* Invoice Type Update Error *} - {$ui = [ - 'label' => 'Invoice Type Update Error', - 'active' => $invoiceTypeUpdateError, - 'type' => 'alert' - ]} - {include file="ui/f6/callout.html"} - - {* Invoice Type Insert Error *} - {$ui = [ - 'label' => 'Invoice Type Added', - 'active' => $invoiceTypeAdded, - 'type' => 'success' - ]} - {include file="ui/f6/callout.html"} - - {* Form Start *} - {$ui = [ - 'id' => 'billing-invoice-type-form', - 'action' => "{$thisUrl}?page={$thisPage}&glm_action==invoiceTypes", - 'method' => 'post', - 'file' => false - ]} - {include file="ui/f6/form-start.html"} - - {* Callout Errors *} - {include file='ui/f6/errorCallout.html'} - - - - {if isset($data.fieldData.id)} - - - {else} - - {/if} - -
- -
- Invoice Type - -
- - {* Invoice Type Name *} - {$ui = [ - 'value' => $data.fieldData.name, - 'field' => 'name', - 'label' => 'Invoice Type Name', - 'required' => $data.fieldRequired.name, - 'errorText' => 'Invoice Type Name is Required', - 'dataError' => $data.fieldFail.name - ]} - {include file='ui/f6/text.html'} - - {* Parent *} - {$ui = [ - 'value' => $data.fieldData.parent.value, - 'field' => 'parent', - 'label' => 'Parent', - 'list' => $invoiceTypes, - 'l_label' => 'name', - 'l_value' => 'id', - 'l_blank' => true, - 'required' => $data.fieldRequired.parent, - 'errorText' => 'Parent is Required', - 'dataError' => $data.fieldFail.parent - ]} - {include file='ui/f6/select.html'} - - {* Member Type *} - {$ui = [ - 'value' => $data.fieldData.member_type.value, - 'field' => 'member_type', - 'label' => 'Member Type', - 'list' => $memberTypes, - 'l_label' => 'name', - 'l_value' => 'id', - 'l_blank' => true, - 'required' => $data.fieldRequired.member_type, - 'errorText' => 'Member Type is Required', - 'dataError' => $data.fieldFail.member_type - ]} - {include file='ui/f6/select.html'} - - {* Amount *} - {$ui = [ - 'value' => $data.fieldData.amount, - 'field' => 'amount', - 'label' => 'Amount', - 'pattern' => 'number', - 'required' => $data.fieldRequired.amount, - 'errorText' => 'Amount is Required', - 'dataError' => $data.fieldFail.amount - ]} - {include file='ui/f6/text.html'} - - {* Dynamic Amount *} - {$ui = [ - 'value' => $data.fieldData.dynamic_amount.value, - 'field' => 'dynamic_amount', - 'label' => 'Dynamic Amount', - 'required' => $data.fieldRequired.dynamic_amount, - 'errortext' => 'Dynamic Amount is Required', - 'helpText' => 'Ask for the amount on Invoice Form', - 'dataError' => $data.fieldFail.dynamic_amount - ]} - {include file='ui/f6/checkbox.html'} - - {* Recurring *} - {$ui = [ - 'value' => $data.fieldData.recurring.value, - 'field' => 'recurring', - 'label' => 'Recurring', - 'required' => $data.fieldRequired.recurring, - 'errortext' => 'Recurring is Required', - 'dataError' => $data.fieldFail.recurring - ]} - {include file='ui/f6/checkbox.html'} - - {* Recurrence *} - {$ui = [ - 'value' => $data.fieldData.recurrence, - 'field' => 'recurrence', - 'label' => 'Recurrence', - 'list' => $recurrenceTypes, - 'l_blank' => true, - 'required' => $data.fieldRequired.recurrence, - 'errorText' => 'Recurrence is Required', - 'dataError' => $data.fieldFail.recurrence - ]} - {include file='ui/f6/select.html'} - - - {* Code *} - {$ui = [ - 'value' => $data.fieldData.qcode, - 'field' => 'qcode', - 'label' => 'Code', - 'required' => $data.fieldRequired.qcode, - 'errorText' => 'Code is Required', - 'dataError' => $data.fieldFail.qcode - ]} - {include file='ui/f6/text.html'} - - {* Category *} - {$ui = [ - 'value' => $data.fieldData.category, - 'field' => 'category', - 'label' => 'Category', - 'required' => $data.fieldRequired.category, - 'errorText' => 'Category is Required', - 'dataError' => $data.fieldFail.category - ]} - {include file='ui/f6/text.html'} - -
- -
- -
- - - - {include file='ui/f6/errorCallout.html'} - - - {include file='ui/f6/form-end.html'} +{* Set $data to $invoiceType *} +{* This is for using the UI elements *} +{$data = $invoiceType} + +{* Invoice Type Updated *} +{$ui = [ + 'label' => 'Invoice Type Updated', + 'active' => $invoiceTypeUpdated, + 'type' => 'success' +]} +{include file="ui/f6/callout.html"} + +{* Invoice Type Added *} +{$ui = [ + 'label' => 'Invoice Type Added', + 'active' => $invoiceTypeAdded, + 'type' => 'success' +]} +{include file="ui/f6/callout.html"} + +{* Invoice Type Update Error *} +{$ui = [ + 'label' => 'Invoice Type Update Error', + 'active' => $invoiceTypeUpdateError, + 'type' => 'alert' +]} +{include file="ui/f6/callout.html"} + +{* Invoice Type Insert Error *} +{$ui = [ + 'label' => 'Invoice Type Added', + 'active' => $invoiceTypeAdded, + 'type' => 'success' +]} +{include file="ui/f6/callout.html"} + +{* Form Start *} +{$ui = [ + 'id' => 'billing-invoice-type-form', + 'action' => "{$thisUrl}?page={$thisPage}&glm_action==invoiceTypes", + 'method' => 'post', + 'file' => false +]} +{include file="ui/f6/form-start.html"} + +{* Callout Errors *} +{include file='ui/f6/errorCallout.html'} + + + +{if isset($data.fieldData.id)} + + +{else} + +{/if} + +
+ +
+ Invoice Type + +
+ + {* Invoice Type Name *} + {$ui = [ + 'value' => $data.fieldData.name, + 'field' => 'name', + 'label' => 'Invoice Type Name', + 'required' => $data.fieldRequired.name, + 'errorText' => 'Invoice Type Name is Required', + 'dataError' => $data.fieldFail.name + ]} + {include file='ui/f6/text.html'} + + {* Parent *} + {$ui = [ + 'value' => $data.fieldData.parent.value, + 'field' => 'parent', + 'label' => 'Parent', + 'list' => $invoiceTypes, + 'l_label' => 'name', + 'l_value' => 'id', + 'l_blank' => true, + 'required' => $data.fieldRequired.parent, + 'errorText' => 'Parent is Required', + 'dataError' => $data.fieldFail.parent + ]} + {include file='ui/f6/select.html'} + + {* Member Type *} + {$ui = [ + 'value' => $data.fieldData.member_type.value, + 'field' => 'member_type', + 'label' => 'Member Type', + 'list' => $memberTypes, + 'l_label' => 'name', + 'l_value' => 'id', + 'l_blank' => true, + 'required' => $data.fieldRequired.member_type, + 'errorText' => 'Member Type is Required', + 'dataError' => $data.fieldFail.member_type + ]} + {include file='ui/f6/select.html'} + + {* Amount *} + {$ui = [ + 'value' => $data.fieldData.amount, + 'field' => 'amount', + 'label' => 'Amount', + 'pattern' => 'number', + 'required' => $data.fieldRequired.amount, + 'errorText' => 'Amount is Required', + 'dataError' => $data.fieldFail.amount + ]} + {include file='ui/f6/text.html'} + + {* Dynamic Amount *} + {$ui = [ + 'value' => $data.fieldData.dynamic_amount.value, + 'field' => 'dynamic_amount', + 'label' => 'Dynamic Amount', + 'required' => $data.fieldRequired.dynamic_amount, + 'errortext' => 'Dynamic Amount is Required', + 'helpText' => 'Ask for the amount on Invoice Form', + 'dataError' => $data.fieldFail.dynamic_amount + ]} + {include file='ui/f6/checkbox.html'} + + {* Recurring *} + {$ui = [ + 'value' => $data.fieldData.recurring.value, + 'field' => 'recurring', + 'label' => 'Recurring', + 'required' => $data.fieldRequired.recurring, + 'errortext' => 'Recurring is Required', + 'dataError' => $data.fieldFail.recurring + ]} + {include file='ui/f6/checkbox.html'} + + {* Recurrence *} + {$ui = [ + 'value' => $data.fieldData.recurrence, + 'field' => 'recurrence', + 'label' => 'Recurrence', + 'list' => $recurrenceTypes, + 'l_blank' => true, + 'required' => $data.fieldRequired.recurrence, + 'errorText' => 'Recurrence is Required', + 'dataError' => $data.fieldFail.recurrence + ]} + {include file='ui/f6/select.html'} + + + {* Code *} + {$ui = [ + 'value' => $data.fieldData.qcode, + 'field' => 'qcode', + 'label' => 'Code', + 'required' => $data.fieldRequired.qcode, + 'errorText' => 'Code is Required', + 'dataError' => $data.fieldFail.qcode + ]} + {include file='ui/f6/text.html'} + + {* Category *} + {$ui = [ + 'value' => $data.fieldData.category, + 'field' => 'category', + 'label' => 'Category', + 'required' => $data.fieldRequired.category, + 'errorText' => 'Category is Required', + 'dataError' => $data.fieldFail.category + ]} + {include file='ui/f6/text.html'} + +
+ +
+ +
+ + + +{include file='ui/f6/errorCallout.html'} + + +{include file='ui/f6/form-end.html'} {include file='ui/f6/grid-end.html'} {*
*} @@ -210,18 +210,18 @@ }) // form validation failed .on('forminvalid.zf.abide', function( ev, frm ) { - ev.preventDefault(); - console.log( 'Form is not valid' ); + //ev.preventDefault(); + //console.log( 'Form is not valid' ); }) // form validation passed .on('formvalid.zf.abide', function( ev, frm ) { - ev.preventDefault(); - console.log( 'Form is valid' ); + //ev.preventDefault(); + //console.log( 'Form is valid' ); }) // to preven form from submitting upon successful validation .on('submit', function( ev ) { - ev.preventDefault(); - console.log( 'Submit for form intercepted' ); + //ev.preventDefault(); + //console.log( 'Submit for form intercepted' ); }); }); diff --git a/views/admin/billing/editNotificationType.html b/views/admin/billing/editNotificationType.html index 840971b..4ecd3eb 100644 --- a/views/admin/billing/editNotificationType.html +++ b/views/admin/billing/editNotificationType.html @@ -6,252 +6,260 @@ {include file='admin/billing/header.html'} -
- - {* Set $data to $notification *} - {* This is for using the UI elements *} - {$data = $notification} - - {* Notification Updated *} - {$ui = [ - 'label' => 'Notification Updated', - 'active' => $notificationUpdated, - 'type' => 'success' - ]} - {include file="ui/f6/callout.html"} - - {* Notification Added *} - {$ui = [ - 'label' => 'Notification Added', - 'active' => $notificationAdded, - 'type' => 'success' - ]} - {include file="ui/f6/callout.html"} - - {* Notification Update Error *} - {$ui = [ - 'label' => 'Notification Update Error', - 'active' => $notificationUpdateError, - 'type' => 'alert' - ]} - {include file="ui/f6/callout.html"} - - {* Notification Insert Error *} - {$ui = [ - 'label' => 'Notification Added', - 'active' => $notificationAdded, - 'type' => 'success' - ]} - {include file="ui/f6/callout.html"} - -
- {if $notification_id} - - - {else} - - {/if} - - {include file='ui/f6/errorCallout.html'} - -
-
- -
- Notification - - {* Name *} - {$ui = [ - 'value' => $data.fieldData.name, - 'field' => 'name', - 'label' => 'Name', - 'required' => $data.fieldRequired.name, - 'errorText' => 'Name is Required', - 'dataError' => $data.fieldFail.name - ]} - {include file='ui/f6/text.html'} - -
-
- Send Notification based on -
+{$ui = [ + 'nowrap' => false, + 'backgroundColor' => '', + 'sectionColor' => '' +]} +{include file='ui/f6/grid-start.html'} + +{*
*} + +{* Set $data to $notification *} +{* This is for using the UI elements *} +{$data = $notification} + +{* Notification Updated *} +{$ui = [ + 'label' => 'Notification Updated', + 'active' => $notificationUpdated, + 'type' => 'success' +]} +{include file="ui/f6/callout.html"} + +{* Notification Added *} +{$ui = [ + 'label' => 'Notification Added', + 'active' => $notificationAdded, + 'type' => 'success' +]} +{include file="ui/f6/callout.html"} + +{* Notification Update Error *} +{$ui = [ + 'label' => 'Notification Update Error', + 'active' => $notificationUpdateError, + 'type' => 'alert' +]} +{include file="ui/f6/callout.html"} + +{* Notification Insert Error *} +{$ui = [ + 'label' => 'Notification Added', + 'active' => $notificationAdded, + 'type' => 'success' +]} +{include file="ui/f6/callout.html"} + + + {if $notification_id} + + + {else} + + {/if} + + {include file='ui/f6/errorCallout.html'} + +
+
+ +
+ Notification + + {* Name *} + {$ui = [ + 'value' => $data.fieldData.name, + 'field' => 'name', + 'label' => 'Name', + 'required' => $data.fieldRequired.name, + 'errorText' => 'Name is Required', + 'dataError' => $data.fieldFail.name + ]} + {include file='ui/f6/text.html'} + +
+
+ Send Notification based on
- -
-
-
-
- -
- - -
-
-
- {* Number *} - {$ui = [ - 'value' => $data.fieldData.send_date_number, - 'field' => 'send_date_number', - 'label' => 'Number', - 'pattern' => 'number', - 'required' => $data.fieldRequired.send_date_number, - 'errorText' => 'Number is Required to be numeric', - 'dataError' => $data.fieldFail.send_date_number - ]} - {include file='ui/f6/text.html'} -
-
- {* Period *} - {$ui = [ - 'value' => $data.fieldData.send_date_period, - 'field' => 'send_date_period', - 'label' => 'Period', - 'list' => $send_date_period, - 'l_blank' => false, - 'required' => $data.fieldRequired.send_date_period, - 'errorText' => 'Period is Required', - 'dataError' => $data.fieldFail.send_date_period - ]} - {include file='ui/f6/select.html'} -
-
- {* When *} - {$ui = [ - 'value' => $data.fieldData.send_date_when, - 'field' => 'send_date_when', - 'label' => 'When', - 'list' => $send_date_when, - 'l_blank' => false, - 'required' => $data.fieldRequired.send_date_when, - 'errorText' => 'When is Required', - 'dataError' => $data.fieldFail.send_date_when - ]} - {include file='ui/f6/select.html'} +
+ +
+
+
+
+ +
+ +
+
+ {* Number *} + {$ui = [ + 'value' => $data.fieldData.send_date_number, + 'field' => 'send_date_number', + 'label' => 'Number', + 'pattern' => 'number', + 'required' => $data.fieldRequired.send_date_number, + 'errorText' => 'Number is Required to be numeric', + 'dataError' => $data.fieldFail.send_date_number + ]} + {include file='ui/f6/text.html'} +
+
+ {* Period *} + {$ui = [ + 'value' => $data.fieldData.send_date_period, + 'field' => 'send_date_period', + 'label' => 'Period', + 'list' => $send_date_period, + 'l_blank' => false, + 'required' => $data.fieldRequired.send_date_period, + 'errorText' => 'Period is Required', + 'dataError' => $data.fieldFail.send_date_period + ]} + {include file='ui/f6/select.html'} +
+
+ {* When *} + {$ui = [ + 'value' => $data.fieldData.send_date_when, + 'field' => 'send_date_when', + 'label' => 'When', + 'list' => $send_date_when, + 'l_blank' => false, + 'required' => $data.fieldRequired.send_date_when, + 'errorText' => 'When is Required', + 'dataError' => $data.fieldFail.send_date_when + ]} + {include file='ui/f6/select.html'} +
-
-
-
- -
- - -
+
+
+
+
+ +
+ +
-
- - {* Send Action *} - {$ui = [ - 'value' => $data.fieldData.send_action, - 'field' => 'send_action', - 'label' => 'Send Action', - 'list' => $send_action, - 'l_blank' => false, - 'required' => $data.fieldRequired.send_action, - 'errorText' => 'Send Action is Required', - 'dataError' => $data.fieldFail.send_action - ]} - {include file='ui/f6/select.html'} +
+
+ + {* Send Action *} + {$ui = [ + 'value' => $data.fieldData.send_action, + 'field' => 'send_action', + 'label' => 'Send Action', + 'list' => $send_action, + 'l_blank' => false, + 'required' => $data.fieldRequired.send_action, + 'errorText' => 'Send Action is Required', + 'dataError' => $data.fieldFail.send_action + ]} + {include file='ui/f6/select.html'} -
+
+ + {* To Email *} + {$ui = [ + 'value' => $data.fieldData.to_email, + 'field' => 'to_email', + 'label' => 'To Email', + 'pattern' => 'email', + 'required' => $data.fieldRequired.to_email, + 'errorText' => 'To Email is Required to be valid email', + 'helpText' => 'Leave this field blank to send notice to proper {$account.email} address', + 'dataError' => $data.fieldFail.to_email + ]} + {include file='ui/f6/text.html'} + + {* Subject *} + {$ui = [ + 'value' => $data.fieldData.subject, + 'field' => 'subject', + 'label' => 'Subject', + 'required' => $data.fieldRequired.subject, + 'errorText' => 'Subject is Required', + 'dataError' => $data.fieldFail.subject + ]} + {include file='ui/f6/text.html'} + + {* From *} + {$ui = [ + 'value' => $data.fieldData.from_header, + 'field' => 'from_header', + 'label' => 'From', + 'pattern' => 'email', + 'required' => $data.fieldRequired.from_header, + 'errorText' => 'From is Required to be valid email', + 'dataError' => $data.fieldFail.from_header + ]} + {include file='ui/f6/text.html'} + + {* Reply To *} + {$ui = [ + 'value' => $data.fieldData.replyto, + 'field' => 'replyto', + 'label' => 'Reply To', + 'required' => $data.fieldRequired.replyto, + 'errorText' => 'Reply To is Required', + 'dataError' => $data.fieldFail.replyto + ]} + {include file='ui/f6/text.html'} + + {* Message *} + {$ui = [ + 'value' => $data.fieldData.message, + 'field' => 'message', + 'label' => 'Message', + 'height' => '250', + 'required' => $data.fieldRequired.message, + 'errortext' => 'Message is Required', + 'dataError' => $data.fieldFail.message + ]} + {include file='ui/f6/editor.html'} + + + + + +
+ + +
+ + Merge Tag Description + +

Merge Tags

+

The "merge tags" listed below may be used in the E-Mail message content + to include certain information about the Account or Invoice. Be sure to + include the "{literal}{{/literal}" and "{literal}}{/literal}" and "$" characters exactly as show.

+ + {html_table loop=$mergeTagsBilling cols=2 table_attr='border=0 width=400' caption='Billing Examples'} + + {html_table loop=$mergeTagsContact cols=2 table_attr='border=0 width=400' caption='Contact Examples'} + + {html_table loop=$mergeTagsInvoice cols=2 table_attr='border=0 width=400' caption='Only available using Immediate Action - Create Invoice'} + + {html_table loop=$mergeTagsPayment cols=2 table_attr='border=0 width=400' caption='Only available using Immediate Action - Received Payment'} + +
- {* To Email *} - {$ui = [ - 'value' => $data.fieldData.to_email, - 'field' => 'to_email', - 'label' => 'To Email', - 'pattern' => 'email', - 'required' => $data.fieldRequired.to_email, - 'errorText' => 'To Email is Required to be valid email', - 'helpText' => 'Leave this field blank to send notice to proper {$account.email} address', - 'dataError' => $data.fieldFail.to_email - ]} - {include file='ui/f6/text.html'} - - {* Subject *} - {$ui = [ - 'value' => $data.fieldData.subject, - 'field' => 'subject', - 'label' => 'Subject', - 'required' => $data.fieldRequired.subject, - 'errorText' => 'Subject is Required', - 'dataError' => $data.fieldFail.subject - ]} - {include file='ui/f6/text.html'} - - {* From *} - {$ui = [ - 'value' => $data.fieldData.from_header, - 'field' => 'from_header', - 'label' => 'From', - 'pattern' => 'email', - 'required' => $data.fieldRequired.from_header, - 'errorText' => 'From is Required to be valid email', - 'dataError' => $data.fieldFail.from_header - ]} - {include file='ui/f6/text.html'} - - {* Reply To *} - {$ui = [ - 'value' => $data.fieldData.replyto, - 'field' => 'replyto', - 'label' => 'Reply To', - 'required' => $data.fieldRequired.replyto, - 'errorText' => 'Reply To is Required', - 'dataError' => $data.fieldFail.replyto - ]} - {include file='ui/f6/text.html'} - - {* Message *} - {$ui = [ - 'value' => $data.fieldData.message, - 'field' => 'message', - 'label' => 'Message', - 'height' => '250', - 'required' => $data.fieldRequired.message, - 'errortext' => 'Message is Required', - 'dataError' => $data.fieldFail.message - ]} - {include file='ui/f6/editor.html'} - - - - - -
- - -
- - Merge Tag Description - -

Merge Tags

-

The "merge tags" listed below may be used in the E-Mail message content - to include certain information about the Account or Invoice. Be sure to - include the "{literal}{{/literal}" and "{literal}}{/literal}" and "$" characters exactly as show.

- - {html_table loop=$mergeTagsBilling cols=2 table_attr='border=0 width=400' caption='Billing Examples'} - - {html_table loop=$mergeTagsContact cols=2 table_attr='border=0 width=400' caption='Contact Examples'} - - {html_table loop=$mergeTagsInvoice cols=2 table_attr='border=0 width=400' caption='Only available using Immediate Action - Create Invoice'} - - {html_table loop=$mergeTagsPayment cols=2 table_attr='border=0 width=400' caption='Only available using Immediate Action - Received Payment'} - -
- -
+
- {include file='ui/f6/errorCallout.html'} + {include file='ui/f6/errorCallout.html'} - + - +{* *} +{include file='ui/f6/grid-end.html'} + +{include file='admin/billing/footer.html'} diff --git a/views/admin/billing/notifications.html b/views/admin/billing/notifications.html index 3a4e6c8..f555b6e 100644 --- a/views/admin/billing/notifications.html +++ b/views/admin/billing/notifications.html @@ -23,14 +23,13 @@ Notification Subject Trigger -   {if $haveNotificationTypes} {assign var="i" value="0"} {foreach $notificationTypes as $t} - + {$t.id}
@@ -49,10 +48,12 @@ Due Date {/if} - -
Delete
+ + + + {/foreach} @@ -63,6 +64,7 @@
+