From a99af639905b8119b9354ebb79be3f87a7758676 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 8 Feb 2019 15:28:13 -0500 Subject: [PATCH] Adding help files Help files for Billing Plugin. Hopefull a good layout for help files. --- index.php | 13 +- setup/help.php | 177 +++++++++++++++++++++++ setup/help/accounts.html | 3 + setup/help/dashboard.html | 10 ++ setup/help/invoices-add.html | 9 ++ setup/help/invoices.html | 3 + setup/help/invoicing-createInvoices.html | 3 + setup/help/invoicing-createLabels.html | 2 + setup/help/invoicing-printInvoices.html | 2 + setup/help/invoicing-sendEmails.html | 3 + setup/help/invoicing.html | 10 ++ setup/help/logs.html | 2 + setup/help/payments-add.html | 3 + setup/help/payments.html | 2 + setup/help/reports-accountsByAge.html | 2 + setup/help/reports-allAccounts.html | 2 + setup/help/reports-closedAccounts.html | 2 + setup/help/reports-noAccounts.html | 2 + setup/help/reports-openAccounts.html | 2 + setup/help/reports-reportGenerator.html | 3 + setup/help/reports.html | 2 + views/admin/billing/subHeader.html | 2 +- 22 files changed, 253 insertions(+), 6 deletions(-) create mode 100644 setup/help.php create mode 100644 setup/help/accounts.html create mode 100644 setup/help/dashboard.html create mode 100644 setup/help/invoices-add.html create mode 100644 setup/help/invoices.html create mode 100644 setup/help/invoicing-createInvoices.html create mode 100644 setup/help/invoicing-createLabels.html create mode 100644 setup/help/invoicing-printInvoices.html create mode 100644 setup/help/invoicing-sendEmails.html create mode 100644 setup/help/invoicing.html create mode 100644 setup/help/logs.html create mode 100644 setup/help/payments-add.html create mode 100644 setup/help/payments.html create mode 100644 setup/help/reports-accountsByAge.html create mode 100644 setup/help/reports-allAccounts.html create mode 100644 setup/help/reports-closedAccounts.html create mode 100644 setup/help/reports-noAccounts.html create mode 100644 setup/help/reports-openAccounts.html create mode 100644 setup/help/reports-reportGenerator.html create mode 100644 setup/help/reports.html diff --git a/index.php b/index.php index b5f3471..dc8875c 100644 --- a/index.php +++ b/index.php @@ -232,7 +232,12 @@ register_deactivation_hook(__FILE__, 'glmMembersBillingPluginDeactivate'); /* * Hooks for testing capabilities provided by this add-on */ -require_once GLM_MEMBERS_BILLING_PLUGIN_SETUP_PATH.'/permissions.php'; +require_once GLM_MEMBERS_BILLING_PLUGIN_SETUP_PATH . '/permissions.php'; + +/** + * Hooks for creating help documentation + */ +require_once GLM_MEMBERS_BILLING_PLUGIN_SETUP_PATH . '/help.php'; /** * Action for the cron tasks. @@ -242,7 +247,5 @@ add_action( GLM_MEMBERS_BILLING_PLUGIN_CRON_HOOK, function(){ trigger_error( print_r( $_REQUEST, true ) ); - }, - 10, - 1 - ); + }, 10, 1 +); diff --git a/setup/help.php b/setup/help.php new file mode 100644 index 0000000..34d5e1a --- /dev/null +++ b/setup/help.php @@ -0,0 +1,177 @@ + + * @author Steve Sutton + * @license http://www.gaslightmedia.com Gaslightmedia + * @release help.php + * @link http://dev.gaslightmedia.com/ + */ + +/* + * Place Help Hooks and Filters here. If this file exists, it will be included + * by the Billing plugin script. + * + * Note that filter and hook callback functions must be included in-line as shown below... + * + * add_filter( 'filter_title', function( $parameter ) { + * // Function code + * }); + * + */ +function loadHelpFile( $screen, $tab ) +{ + $fileName = GLM_MEMBERS_BILLING_PLUGIN_SETUP_PATH . '/help/' . $tab['extra'] . '.html'; + if ( is_file( $fileName ) ) { + echo file_get_contents( $fileName ); + } else { + return false; + } +} + +add_action( 'current_screen', + function () { + $screen = get_current_screen(); + // var_dump($screen); + if ( !isset( $screen ) ) { + return false; + } + if ( $screen->base != 'glm-associate_page_glm-members-admin-menu-billing' ) { + return false; + } + + $helpTabs = array( + array( + 'name' => 'dashboard', + 'title' => 'Dashboard', + ), + array( + 'name' => 'invoices', + 'title' => 'Invoices', + 'subs' => array( + array( + 'name' => 'add', + 'title' => 'Create Invoice', + ), + ), + ), + array( + 'name' => 'payments', + 'title' => 'Payments', + 'subs' => array( + array( + 'name' => 'add', + 'title' => 'Make a Payment', + ), + ), + ), + array( + 'name' => 'accounts', + 'title' => 'Accounts', + ), + array( + 'name' => 'invoicing', + 'title' => 'Invoicing', + 'subs' => array( + array( + 'name' => 'createInvoices', + 'title' => 'Create Invoices', + ), + array( + 'name' => 'printInvoices', + 'title' => 'Print Invoices', + ), + array( + 'name' => 'createLabels', + 'title' => 'Create Labels', + ), + array( + 'name' => 'sendEmails', + 'title' => 'Send Emails', + ), + ), + ), + array( + 'name' => 'reports', + 'title' => 'Reports', + 'subs' => array( + array( + 'name' => 'openAccounts', + 'title' => 'Open Accounts', + ), + array( + 'name' => 'closedAccounts', + 'title' => 'Closed Accounts', + ), + array( + 'name' => 'accountsByAge', + 'title' => 'Accounts By Age', + ), + array( + 'name' => 'reportGenerator', + 'title' => 'Report Generator', + ), + array( + 'name' => 'noAccounts', + 'title' => 'No Accounts', + ), + array( + 'name' => 'allAccounts', + 'title' => 'All Accounts', + ), + ), + ), + array( + 'name' => 'logs', + 'title' => 'Logs', + ), + ); + + foreach ( $helpTabs as $tab ) { + $glmAction = isset( $_REQUEST['glm_action'] ) ? filter_var( $_REQUEST['glm_action'] ) : 'dashboard'; + if ( $glmAction === $tab['name'] ) { + if ( is_file( GLM_MEMBERS_BILLING_PLUGIN_SETUP_PATH . '/help/' . $tab['name'] . '.html' ) ) { + $screen->add_help_tab( + array( + 'id' => 'glm-member-db-billing-help-' . $tab['name'], + 'title' => __( $tab['title'] ), + 'content' => '', + 'callback' => 'loadHelpFile', + 'extra' => $tab['name'], + ) + ); + } + // Check for subs + if ( isset( $tab['subs'] ) && is_array( $tab['subs'] ) ) { + foreach ( $tab['subs'] as $sub ) { + $fileName = GLM_MEMBERS_BILLING_PLUGIN_SETUP_PATH . '/help/' . $glmAction . '-' . $sub['name'] . '.html'; + if ( is_file( GLM_MEMBERS_BILLING_PLUGIN_SETUP_PATH . '/help/' . $glmAction . '-' . $sub['name'] . '.html' ) ) { + $screen->add_help_tab( + array( + 'id' => 'glm-member-db-billing-help-'. $glmAction . '-' . $sub['name'], + 'title' => __( $sub['title'] ), + 'content' => $fileContents, + 'callback' => 'loadHelpFile', + 'extra' => $glmAction . '-' . $sub['name'], + ) + ); + } + } + } + } + } + + // Help sidebars + $screen->set_help_sidebar( + '

' . __( 'For more information:' ) . '

' . + '

' . + __( 'Help Guide' ) . '

' + ); + } +); diff --git a/setup/help/accounts.html b/setup/help/accounts.html new file mode 100644 index 0000000..adced6c --- /dev/null +++ b/setup/help/accounts.html @@ -0,0 +1,3 @@ +

Accounts

+

This is your main Accounts page.

+

Search for an account by Date range, Member account, or any of the status filters (Active, Pending, Overdue, Expired)

diff --git a/setup/help/dashboard.html b/setup/help/dashboard.html new file mode 100644 index 0000000..547bf0a --- /dev/null +++ b/setup/help/dashboard.html @@ -0,0 +1,10 @@ +

Dashboard

+

This is your Billing dashboard

+

From here you can view any Pending or Overdue Accounts

+

You can also +

diff --git a/setup/help/invoices-add.html b/setup/help/invoices-add.html new file mode 100644 index 0000000..7df3b1c --- /dev/null +++ b/setup/help/invoices-add.html @@ -0,0 +1,9 @@ +

Create Invoice

+

From this screen you can create an invoice.

+

Start by typing into the Billing Account field. It will auto complete with the Billing Account name.

+

You can: +

+

diff --git a/setup/help/invoices.html b/setup/help/invoices.html new file mode 100644 index 0000000..f54a1ef --- /dev/null +++ b/setup/help/invoices.html @@ -0,0 +1,3 @@ +

Invoices

+

This is your Main Invoices page. You can search for a date range, Member Account, or by Unpaid Status

+

Each row has links to Member Billing Dashboard, Edit, View, Make a Payment (if unpaid) or Delete

diff --git a/setup/help/invoicing-createInvoices.html b/setup/help/invoicing-createInvoices.html new file mode 100644 index 0000000..6ae2f97 --- /dev/null +++ b/setup/help/invoicing-createInvoices.html @@ -0,0 +1,3 @@ +

Create Invoices

+

From this screen you can create invoices for your billing accounts.

+

First filter the results then click on Create Invoices.

diff --git a/setup/help/invoicing-createLabels.html b/setup/help/invoicing-createLabels.html new file mode 100644 index 0000000..95b52cf --- /dev/null +++ b/setup/help/invoicing-createLabels.html @@ -0,0 +1,2 @@ +

Create Labels

+

Filter the available invoices. Then create labels.

diff --git a/setup/help/invoicing-printInvoices.html b/setup/help/invoicing-printInvoices.html new file mode 100644 index 0000000..331c495 --- /dev/null +++ b/setup/help/invoicing-printInvoices.html @@ -0,0 +1,2 @@ +

Print Invoices

+

Filter the available invoices. Then print.

diff --git a/setup/help/invoicing-sendEmails.html b/setup/help/invoicing-sendEmails.html new file mode 100644 index 0000000..4ef095b --- /dev/null +++ b/setup/help/invoicing-sendEmails.html @@ -0,0 +1,3 @@ +

Send Emails

+

Filter the available invoices. Then Send Emails.

+ diff --git a/setup/help/invoicing.html b/setup/help/invoicing.html new file mode 100644 index 0000000..1c25abc --- /dev/null +++ b/setup/help/invoicing.html @@ -0,0 +1,10 @@ +

Invoicing

+

This is your main invoicing page.

+

Click on one of the sub tabs to: +

+

diff --git a/setup/help/logs.html b/setup/help/logs.html new file mode 100644 index 0000000..489b316 --- /dev/null +++ b/setup/help/logs.html @@ -0,0 +1,2 @@ +

Logs

+

This list out logs from cron jobs such as email notifications.

diff --git a/setup/help/payments-add.html b/setup/help/payments-add.html new file mode 100644 index 0000000..a143f4a --- /dev/null +++ b/setup/help/payments-add.html @@ -0,0 +1,3 @@ +

Make a Payment

+

You can create a payment for a billing account from this one form.

+

Start the lookup by entering text into the Lookup Member Invoices By Account field.

diff --git a/setup/help/payments.html b/setup/help/payments.html new file mode 100644 index 0000000..2131050 --- /dev/null +++ b/setup/help/payments.html @@ -0,0 +1,2 @@ +

Payments

+

This is your Main Payments page. You can search by date range or Member account.

diff --git a/setup/help/reports-accountsByAge.html b/setup/help/reports-accountsByAge.html new file mode 100644 index 0000000..d57ef98 --- /dev/null +++ b/setup/help/reports-accountsByAge.html @@ -0,0 +1,2 @@ +

Accounts By Age

+

This list accounts that are over 60 days past due.

diff --git a/setup/help/reports-allAccounts.html b/setup/help/reports-allAccounts.html new file mode 100644 index 0000000..fdbd7a1 --- /dev/null +++ b/setup/help/reports-allAccounts.html @@ -0,0 +1,2 @@ +

All Accounts

+

This list all accounts.

diff --git a/setup/help/reports-closedAccounts.html b/setup/help/reports-closedAccounts.html new file mode 100644 index 0000000..88abeec --- /dev/null +++ b/setup/help/reports-closedAccounts.html @@ -0,0 +1,2 @@ +

Closed Accounts

+

This list all accounts that are paid.

diff --git a/setup/help/reports-noAccounts.html b/setup/help/reports-noAccounts.html new file mode 100644 index 0000000..8adfe93 --- /dev/null +++ b/setup/help/reports-noAccounts.html @@ -0,0 +1,2 @@ +

No Accounts

+

This list all members without accounts.

diff --git a/setup/help/reports-openAccounts.html b/setup/help/reports-openAccounts.html new file mode 100644 index 0000000..31b2045 --- /dev/null +++ b/setup/help/reports-openAccounts.html @@ -0,0 +1,2 @@ +

Open Accounts

+

This list any accounts with a balance due.

diff --git a/setup/help/reports-reportGenerator.html b/setup/help/reports-reportGenerator.html new file mode 100644 index 0000000..c2b7ab6 --- /dev/null +++ b/setup/help/reports-reportGenerator.html @@ -0,0 +1,3 @@ +

Report Generatoro

+

You can generate reports for your billing accounts

+

Totals are included at the bottom.

diff --git a/setup/help/reports.html b/setup/help/reports.html new file mode 100644 index 0000000..c128e6b --- /dev/null +++ b/setup/help/reports.html @@ -0,0 +1,2 @@ +

Reports

+

This is your main reports page.

diff --git a/views/admin/billing/subHeader.html b/views/admin/billing/subHeader.html index f7fcaf2..dc68cc7 100644 --- a/views/admin/billing/subHeader.html +++ b/views/admin/billing/subHeader.html @@ -1,6 +1,6 @@ -- 2.17.1