Quotes: a line can have a picture beside its name on the quote, guest link, portal and PDF, uploaded or pulled from a link to a picture or a product page's main picture, fetched only from public addresses and kept as ITFlow's own resized copy in uploads/quote_images; products keep a picture that a quote line added from them copies, Copy Quote copies them, and deleting a line, quote, client or product removes the files; Admin Settings Quotes can switch pictures off; database 3.8.8 adds quote_items.item_image, products.product_image and config_quote_show_images; 26.11.9 changelog entries

This commit is contained in:
johnnyq
2026-11-17 21:25:57 -05:00
parent bd62f4af22
commit 475f27fc7f
27 changed files with 619 additions and 15 deletions

View File

@@ -3,7 +3,8 @@
/*
* Admin > Settings > Quotes (admin/settings_quote.php):
* edit_quote_settings saves the numbering, the footer, who is emailed a
* client's answer and the pricing a line starts with. A next number already
* client's answer, the pricing a line starts with and whether lines show
* their pictures. A next number already
* in use, an email address that isn't one, or a % that can't be used, comes
* back to the page saying so - nothing is saved.
*/
@@ -15,10 +16,14 @@ if (isset($_POST['edit_quote_settings'])) {
validateCSRFToken();
$pricing_columns = quotePricingReady() ? ['config_quote_price_method', 'config_quote_price_percent', 'config_quote_price_presets'] : [];
$before = settingsCurrent(array_merge(['config_quote_prefix', 'config_quote_next_number', 'config_quote_footer', 'config_quote_notification_email'], $pricing_columns));
$image_columns = quoteImagesReady() ? ['config_quote_show_images'] : [];
$before = settingsCurrent(array_merge(['config_quote_prefix', 'config_quote_next_number', 'config_quote_footer', 'config_quote_notification_email'], $pricing_columns, $image_columns));
// What was sent, and what is saved for anything that wasn't
// What was sent, and what is saved for anything that wasn't - a switch sends nothing when off
$in = $_POST + array_map(function ($value) { return (string) $value; }, $before);
if ($image_columns) {
$in['config_quote_show_images'] = empty($_POST['config_quote_show_images']) ? '0' : '1';
}
[$prefix, $number, $errors] = settingsNumberingCheck('quote', $in, $before);
$after = [
@@ -30,6 +35,9 @@ if (isset($_POST['edit_quote_settings'])) {
if ($problem = settingsEmailProblem($after['config_quote_notification_email'])) {
$errors['config_quote_notification_email'] = $problem;
}
if ($image_columns) {
$after['config_quote_show_images'] = $in['config_quote_show_images'];
}
// How a line's price comes from its cost (functions/quote_pricing.php)
if ($pricing_columns) {
$method = quotePriceMethod($in['config_quote_price_method']);