openInvoice v0.9 Beta Patch 07/08/06 Instructions
----------------------------------------------------------
This patch fixes the use of the template HTML files if
openInvoice is not installed on the web root directly.
The symptoms of the problem is as follows:
When toggling to HTML view of an invoice, you recieve
the following warnings:
Warning:
file(/home/XXXX/public_html/invitemtemplate.html):
failed to open
stream: No such file or directory in
/home/XXXX/public_html/invoice/common.php on line 158
Warning: Invalid argument supplied for foreach() in
/home/XXXX/public_html/invoice/common.php on line 160
Warning: file(/home/XXXX/public_html/invtemplate.html):
failed to open
stream: No such file or directory in
/home/XXXX/public_html/invoice/common.php on line 187
Warning: Invalid argument supplied for foreach() in
/home/XXXX/public_html/invoice/common.php on line 190
Warning:
file(/home/XXXX/public_html/invitemtemplate.html):
failed to open
stream: No such file or directory in
/home/XXXX/public_html/invoice/common.php on line 220
The problem was that openInvoice assumed it was
installed in the web root (public_html for example).
The fix is to create a global "oi_root" element in the
$config array inside config.php and then reference that
variable when loading the template files.
Steps to install:
1. Backup config.php (will need for reference later)
2. Extract all files in the ZIP to where openInvoice is
currently installed (the root of OI).
3. Rename install.php to install.ph_ or remove it if
you've already installed openInvoice
4. Modify config.php file accordingly (since it was
overwritten with the default one when executing step #1)
NOTE: $config["oi_root"] _MUST_ CONTAIN A TRAILING
SLASH!
If you have any more questions, email me @
mazor579@hotmail.com
-Cale
Patch for v0.9 Beta 7/8/06 - Template not found
Logged In: YES
user_id=1954815
Originator: NO
What does this patch fix?
I tried your patch but my method fixes it.
Find these:
$invoiceTemplateFile = $_SERVER['DOCUMENT_ROOT']. "/invtemplate.html";
$itemsTemplateFile = $_SERVER['DOCUMENT_ROOT']."/invitemtemplate.html";
Comment them out or remove them like below:
$invoiceTemplateFile = "invtemplate.html";
$itemsTemplateFile = "invitemtemplate.html";
One Problem solved.
Cheers