Hello,
I am attempting to change the way the file name for the generated PDF quote is written. I have made most of the changes, but I am stuck on one thing. Here is an example of how it currently is:
Quotation_12345-CustomerOfficeABC.pdf
I would like to know the syntax that would be needed to create spaces in the company name. For example:
Quotation_12345-Customer Office ABC.pdf
Here is what my syntax looks like in standard.php:
I have tried backslash characters in the preg_replace function, but to no avail.:PHP Code:$GLOBALS['log']->info("Quote layout view: Standard");
$quotesub = preg_replace("#[^A-Z0-9\-_\.]#i","", $focus->name);
$filename = ($focus->quote_num);
if (!empty($quotesub)) {
$filename .= "-{$quotesub}";
}
$filename = $mod_strings['LBL_PROPOSAL']. "_{$filename}.pdf";
Nothing I do works. If I just leave a space between the parenthesis it only shows the first word in the customer name and drops the rest and the file extension. I know this is probably really simple, so any help on how to do this would be great. Thanks!PHP Code:$quotesub = preg_replace("#[^A-Z0-9\-_\.]#i","(something goes here)", $focus->name);


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks