Extensions provides a basic method to develop and distribute integrated customisations for Simple Invoices
Previously there was no extension system for Simple Invoices meaning that if a customization to a particular page was required the main Simple Invoices file for that page would have to be edited - Which made it a pain in the ass to develop, to very hard to distribute and pretty much impossible for that customization to be included into the normal Simple Invoices
The Simple Invoices extension system main goal is to make extending Simple Invoices to meet your exact requirement a lot easier and possible to distribute
index.php is the main file in Simple Invoices that does all the work to say what files are to be loaded when and what to present on screen
In the above example url index.php would load the relevant files to show the Manage Invoices page
The extension system provide a way to override and/or extended what is loaded via index.php
In index.php there are checks at each main include section to see if an extension has been enabled and if it has either include the extensions version of the requested file instead of the normal file or include it inconjunction with the normal file
For an extension to be included correctly the same directory structure for the normal file must be repeated in the extensions directory (ie. ./extensions/gene/modules/invoices/itemised.php would replace the normal file ./modules/invoices/itemised.php if the Gene extension was enabled)
To explain how it works i'll use a quick example from the Gene extension
#################### /* Extensions */ #################### //1 = enabled 0 = disabled //name is the director in ./extensions which it lives $extension['gene']['name'] = "gene"; $extension['gene']['description'] = "gene's purchase order based system extension"; $extension['gene']['enabled'] = "0"; $extension['test']['name'] = "test extension"; $extension['test']['description'] = "this is a test"; $extension['test']['enabled'] = "0"; // dev guys to enable extensions via your local.config.php file
#################### /* Extensions */ #################### //1 = enabled 0 = disabled //name is the director in ./extensions which it lives $extension['gene']['name'] = "gene"; $extension['gene']['description'] = "gene's purchase order based system extension"; $extension['gene']['enabled'] = "1"; $extension['test']['name'] = "test extension"; $extension['test']['description'] = "this is a test"; $extension['test']['enabled'] = "0"; // dev guys to enable extensions via your local.config.php file
$extension['gene']['name'] = "gene"; $extension['gene']['description'] = "gene's purchase order based system extension"; $extension['gene']['enabled'] = "1";
Discussion
Tried the 'gene' , enabled it and made a couple invoice & quote. The problem is, instead of it saying PO#, it shows Custom Filed 2 : data The data is correct, custom field words needs to be fixed. Also when I go to save the invoice or quote, it errors BUT makes the form. Good Luck,
Thanks for the update Frank
note: this extension is not complete and very specific to a certain Simple Invoices user
Cheers
Justin