diff --git a/app/Libraries/Utils.php b/app/Libraries/Utils.php index a67e15dc99..59c4658ce0 100644 --- a/app/Libraries/Utils.php +++ b/app/Libraries/Utils.php @@ -15,6 +15,7 @@ use DateTime; use stdClass; use Carbon; use WePay; +use App\Models\Account; class Utils { @@ -1029,4 +1030,58 @@ class Utils return trans('texts.'.strtolower($day)); }); } + + public static function getDocsUrl($path) + { + $page = ''; + $parts = explode('/', $path); + $first = count($parts) ? $parts[0] : false; + $second = count($parts) > 1 ? $parts[1] : false; + + $entityTypes = [ + 'clients', + 'invoices', + 'payments', + 'recurring_invoices', + 'credits', + 'quotes', + 'tasks', + 'expenses', + 'vendors', + ]; + + if ($path == 'dashboard') { + $page = '/introduction.html#dashboard'; + } elseif (in_array($path, $entityTypes)) { + $page = "/{$path}.html#list-" . str_replace('_', '-', $path); + } elseif (in_array($first, $entityTypes)) { + $action = ($first == 'payments' || $first == 'credits') ? 'enter' : 'create'; + $page = "/{$first}.html#{$action}-" . substr(str_replace('_', '-', $first), 0, -1); + } elseif ($first == 'expense_categories') { + $page = '/expenses.html#expense-categories'; + } elseif ($first == 'settings') { + if ($second == 'bank_accounts') { + $page = ''; // TODO write docs + } elseif (in_array($second, Account::$basicSettings)) { + if ($second == 'products') { + $second = 'product_library'; + } elseif ($second == 'notifications') { + $second = 'email_notifications'; + } + $page = '/settings.html#' . str_replace('_', '-', $second); + } elseif (in_array($second, Account::$advancedSettings)) { + $page = "/{$second}.html"; + } elseif ($second == 'customize_design') { + $page = '/invoice_design.html#customize'; + } + } elseif ($first == 'tax_rates') { + $page = '/settings.html#tax-rates'; + } elseif ($first == 'products') { + $page = '/settings.html#product-library'; + } elseif ($first == 'users') { + $page = '/user_management.html#create-user'; + } + + return url(NINJA_DOCS_URL . $page); + } } diff --git a/docs/payments.rst b/docs/payments.rst index 89070a90e1..c1c3ca5183 100644 --- a/docs/payments.rst +++ b/docs/payments.rst @@ -47,9 +47,6 @@ Want to view archived or deleted payments? Check the box marked Show archived/de - **Deleted payments** are displayed with a red Deleted button. To restore deleted payments, hover on the red Deleted button. A gray Select button will appear. Click on the Select arrow, and select Restore payment in the drop-down list. - **Archived payments** are displayed with an orange Archived button. To restore the archived payment, hover on the orange Archived button. A gray Select button will appear. Click on the Select arrow, and choose Restore payment from the drop-down list. To delete an archived payment, select Delete payment from the drop-down list of the Select button. -Enter Payment -^^^^^^^^^^^^^ - You can enter a new payment directly from the Payments list page by clicking on the blue Enter Payment + button located at the top right side of the page. The Payments / Create page will open. Filter diff --git a/docs/recurring_invoices.rst b/docs/recurring_invoices.rst index bfd245b614..a97d0ec12f 100644 --- a/docs/recurring_invoices.rst +++ b/docs/recurring_invoices.rst @@ -26,9 +26,6 @@ Here is a description of the columns in the recurring invoices list, as displaye - **Archive Recurring**: Invoice Click here to archive the recurring invoice. It will be archived and removed from the Recurring Invoices list page. - **Delete Recurring**: Invoice Click here to delete the recurring invoice. It will be deleted and removed from the Recurring Invoices list page. -New Recurring Invoice -^^^^^^^^^^^^^^^^^^^^^ - You can create a new recurring invoice directly from the Recurring Invoices list page by clicking on the blue New Recurring Invoice + button located at the top right side of the page. The Recurring Invoices / Create page will open. Filter diff --git a/docs/settings.rst b/docs/settings.rst index 1af0f2f517..e45467b890 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -180,7 +180,7 @@ To create a tax rate, complete the two fields: Click the green Save button to create the tax rate. It will now appear on the tax rates list. Product Library -"""""""""""""""" +""""""""""""""" Add products to your product library to make your invoice creation process faster. diff --git a/docs/tasks.rst b/docs/tasks.rst index 0cf1fa75a1..a13af4cd21 100644 --- a/docs/tasks.rst +++ b/docs/tasks.rst @@ -42,9 +42,6 @@ To view the actions, hover your mouse over the Action area of the relevant task .. TIP:: To sort the tasks list according to any of the columns, click on the orange column tab of your choice. A small arrow will appear. If the arrow is pointing up, data is sorted from lowest to highest value. If the arrow is pointing down, data is sorted from highest to lowest value. Click to change the arrow direction. -Create Task -^^^^^^^^^^^ - You can create a new task directly from the Tasks list page by clicking on the blue New Task + button located at the top right side of the page. The Tasks / Create page will open. Filter diff --git a/docs/vendors.rst b/docs/vendors.rst index a0b8237031..1ed3285224 100644 --- a/docs/vendors.rst +++ b/docs/vendors.rst @@ -37,9 +37,6 @@ Here are the available actions in the drop-down list of the Action button, and t .. TIP:: Each vendor you create has its own summary page, where you can view and manage the vendor details. To view a vendor's summary page, click on the vendor name in the Vendors list. You'll be automatically redirected to the vendor's summary page. -New Vendor -^^^^^^^^^^ - You can add a new vendor directly from the Vendors list page by clicking on the blue New Vendor + button located at the top right side of the page. The Vendors / Create page will open. Sorting & Filtering Vendors diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index a2b65f6980..2415782733 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2135,6 +2135,8 @@ $LANG = array( 'raw_html' => 'Raw HTML', 'update' => 'Update', 'invoice_fields_help' => 'Drag and drop fields to change their order and location', + 'new_category' => 'New Category', + ); diff --git a/resources/views/header.blade.php b/resources/views/header.blade.php index 1080dd8a27..4b7b034931 100644 --- a/resources/views/header.blade.php +++ b/resources/views/header.blade.php @@ -522,7 +522,7 @@