feat: Enhance email functionality and PDF generation for Sales Orders

- Enabled SMTP debugging in PHPMailer for better error tracking.
- Added a "Test send email" link in the Inventory Detail View for quick email testing.
- Implemented automatic PDF generation and email sending upon Sales Order creation.
- Created a new action for sending Sales Order emails with attached PDFs.
- Added a new AJAX action for testing outgoing email server configurations.
- Updated outgoing server settings to use new SMTP credentials.
- Improved email templates for better user experience.
- Added test scripts for validating PDF generation and email sending.
This commit is contained in:
BACHIR SOULDI
2026-02-17 15:59:31 +01:00
parent 2794e62571
commit 2a647b138a
46 changed files with 25100 additions and 1296 deletions

View File

@@ -1,4 +1,4 @@
<?php /* Smarty version Smarty-3.1.7, created on 2025-09-26 16:22:51
<?php /* Smarty version Smarty-3.1.7, created on 2025-09-30 08:46:30
compiled from "C:\xampp\htdocs\sophalcrm\includes\runtime/../../layouts/v7\modules\Vtiger\ModalFooter.tpl" */ ?>
<?php /*%%SmartyHeaderCode:35691707368d6bddb322281-34526287%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
@@ -7,7 +7,7 @@ $_valid = $_smarty_tpl->decodeProperties(array (
'2627944103942efed50bd439d9d1dbdcc67dc480' =>
array (
0 => 'C:\\xampp\\htdocs\\sophalcrm\\includes\\runtime/../../layouts/v7\\modules\\Vtiger\\ModalFooter.tpl',
1 => 1758796678,
1 => 1759179619,
2 => 'file',
),
),
@@ -15,6 +15,8 @@ $_valid = $_smarty_tpl->decodeProperties(array (
'function' =>
array (
),
'version' => 'Smarty-3.1.7',
'unifunc' => 'content_68d6bddb32583',
'variables' =>
array (
'BUTTON_NAME' => 0,
@@ -23,8 +25,6 @@ $_valid = $_smarty_tpl->decodeProperties(array (
'BUTTON_LABEL' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.7',
'unifunc' => 'content_68d6bddb32583',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_68d6bddb32583')) {function content_68d6bddb32583($_smarty_tpl) {?>
<div class="modal-footer "><center><?php if ($_smarty_tpl->tpl_vars['BUTTON_NAME']->value!=null){?><?php $_smarty_tpl->tpl_vars['BUTTON_LABEL'] = new Smarty_variable($_smarty_tpl->tpl_vars['BUTTON_NAME']->value, null, 0);?><?php }else{ ?><?php ob_start();?><?php echo vtranslate('LBL_SAVE',$_smarty_tpl->tpl_vars['MODULE']->value);?>

View File

@@ -1,4 +1,4 @@
<?php /* Smarty version Smarty-3.1.7, created on 2025-09-26 16:15:58
<?php /* Smarty version Smarty-3.1.7, created on 2025-09-30 08:19:20
compiled from "C:\xampp\htdocs\sophalcrm\includes\runtime/../../layouts/v7\modules\Vtiger\Footer.tpl" */ ?>
<?php /*%%SmartyHeaderCode:147362918768d6bc3e892923-48997099%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
@@ -7,7 +7,7 @@ $_valid = $_smarty_tpl->decodeProperties(array (
'710e620183d7eba30794adcdaa65a6b9b5aba915' =>
array (
0 => 'C:\\xampp\\htdocs\\sophalcrm\\includes\\runtime/../../layouts/v7\\modules\\Vtiger\\Footer.tpl',
1 => 1758796679,
1 => 1759179585,
2 => 'file',
),
),
@@ -15,13 +15,13 @@ $_valid = $_smarty_tpl->decodeProperties(array (
'function' =>
array (
),
'version' => 'Smarty-3.1.7',
'unifunc' => 'content_68d6bc3e9002c',
'variables' =>
array (
'LANGUAGE_STRINGS' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.7',
'unifunc' => 'content_68d6bc3e9002c',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_68d6bc3e9002c')) {function content_68d6bc3e9002c($_smarty_tpl) {?>

View File

@@ -1,4 +1,4 @@
<?php /* Smarty version Smarty-3.1.7, created on 2025-09-26 16:17:25
<?php /* Smarty version Smarty-3.1.7, created on 2025-09-30 09:14:25
compiled from "C:\xampp\htdocs\sophalcrm\includes\runtime/../../layouts/v7\modules\Vtiger\partials\SidebarAppMenu.tpl" */ ?>
<?php /*%%SmartyHeaderCode:88911824368d6bc952ae0a7-57885333%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
@@ -7,7 +7,7 @@ $_valid = $_smarty_tpl->decodeProperties(array (
'833e7fc50cbf769ba11253f5188fa344a967b92e' =>
array (
0 => 'C:\\xampp\\htdocs\\sophalcrm\\includes\\runtime/../../layouts/v7\\modules\\Vtiger\\partials\\SidebarAppMenu.tpl',
1 => 1758796685,
1 => 1759223637,
2 => 'file',
),
),
@@ -15,6 +15,8 @@ $_valid = $_smarty_tpl->decodeProperties(array (
'function' =>
array (
),
'version' => 'Smarty-3.1.7',
'unifunc' => 'content_68d6bc952e7ed',
'variables' =>
array (
'USER_MODEL' => 0,
@@ -38,8 +40,6 @@ $_valid = $_smarty_tpl->decodeProperties(array (
'DOCUMENTS_MODULE_MODEL' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.7',
'unifunc' => 'content_68d6bc952e7ed',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_68d6bc952e7ed')) {function content_68d6bc952e7ed($_smarty_tpl) {?>
@@ -394,12 +394,15 @@ $_smarty_tpl->tpl_vars['moduleModel']->_loop = true;
<span style="font-size: 10pt" class="module-name textOverflowEllipsis">Questionnaire</span>
</a>
</li>
<li style=" padding: 2.5% 2% !important;">
<?php if (!hideStock($_smarty_tpl->tpl_vars['roleid']->value)){?>
<li style=" padding: 2.5% 2% !important;">
<a style=" color:#ffffff; " href="?module=EtatStockReporting&view=EtatStockReporting">
<!--<span class="fa fa-cog module-icon"></span>-->
<span style="font-size: 10pt" class="module-name textOverflowEllipsis">Stock</span>
</a>
</li>
<?php }?>
<?php }?>
<?php if ($_smarty_tpl->tpl_vars['roleid']->value=='H8'){?>
<li style=" padding: 2.5% 2% !important;">
@@ -415,15 +418,17 @@ $_smarty_tpl->tpl_vars['moduleModel']->_loop = true;
</a>
</li>
<?php }?>
<?php if ($_smarty_tpl->tpl_vars['roleid']->value=='H12'||$_smarty_tpl->tpl_vars['roleid']->value=='H11'||$_smarty_tpl->tpl_vars['roleid']->value=='H4'||$_smarty_tpl->tpl_vars['roleid']->value=='H34'||$_smarty_tpl->tpl_vars['roleid']->value=='H36'||$_smarty_tpl->tpl_vars['roleid']->value=='H38'||$_smarty_tpl->tpl_vars['roleid']->value=='H42'||$_smarty_tpl->tpl_vars['roleid']->value=='H44'){?>
<li style=" padding: 2.5% 2% !important;">
<?php if ($_smarty_tpl->tpl_vars['roleid']->value=='H12'||$_smarty_tpl->tpl_vars['roleid']->value=='H11'||$_smarty_tpl->tpl_vars['roleid']->value=='H4'){?>
<li style=" padding: 2.5% 2% !important;">
<a style=" color:#ffffff; " href="?module=EtatStockReporting&view=EtatStockReporting">
<!--<span class="fa fa-cog module-icon"></span>-->
<span style="font-size: 10pt" class="module-name textOverflowEllipsis">Stock</span>
</a>
</li>
<?php }?>
<?php if ($_smarty_tpl->tpl_vars['roleid']->value!='H12'&&$_smarty_tpl->tpl_vars['roleid']->value!='H11'&&$_smarty_tpl->tpl_vars['roleid']->value!='H4'&&$_smarty_tpl->tpl_vars['roleid']->value!='H34'&&$_smarty_tpl->tpl_vars['roleid']->value!='H36'&&$_smarty_tpl->tpl_vars['roleid']->value!='H38'&&$_smarty_tpl->tpl_vars['roleid']->value!='H42'&&$_smarty_tpl->tpl_vars['roleid']->value!='H44'){?>
<?php if ($_smarty_tpl->tpl_vars['roleid']->value!='H12'&&$_smarty_tpl->tpl_vars['roleid']->value!='H11'&&$_smarty_tpl->tpl_vars['roleid']->value!='H4'){?>
<li style=" padding: 2.5% 2% !important;">
<a style=" color:#ffffff; " href="?module=ExportData&view=ExportData">
<span style="font-size: 10pt" class="module-name textOverflowEllipsis">Export Data</span>

View File

@@ -1,4 +1,4 @@
<?php /* Smarty version Smarty-3.1.7, created on 2025-09-27 18:02:08
<?php /* Smarty version Smarty-3.1.7, created on 2025-10-15 15:23:42
compiled from "C:\xampp\htdocs\sophalcrm\includes\runtime/../../layouts/v7\modules\Events\uitypes\Multireference.tpl" */ ?>
<?php /*%%SmartyHeaderCode:157938834968d826a00c4717-78770212%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
@@ -7,7 +7,7 @@ $_valid = $_smarty_tpl->decodeProperties(array (
'b307425d1b338e6a92e5cdf7e1d4fa12929b2d14' =>
array (
0 => 'C:\\xampp\\htdocs\\sophalcrm\\includes\\runtime/../../layouts/v7\\modules\\Events\\uitypes\\Multireference.tpl',
1 => 1758796609,
1 => 1759105402,
2 => 'file',
),
),
@@ -15,6 +15,8 @@ $_valid = $_smarty_tpl->decodeProperties(array (
'function' =>
array (
),
'version' => 'Smarty-3.1.7',
'unifunc' => 'content_68d826a01474f',
'variables' =>
array (
'FIELD_MODEL' => 0,
@@ -30,8 +32,6 @@ $_valid = $_smarty_tpl->decodeProperties(array (
'RELATED_CONTACTS' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.7',
'unifunc' => 'content_68d826a01474f',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_68d826a01474f')) {function content_68d826a01474f($_smarty_tpl) {?>

View File

@@ -1,4 +1,4 @@
<?php /* Smarty version Smarty-3.1.7, created on 2025-09-26 16:17:23
<?php /* Smarty version Smarty-3.1.7, created on 2025-10-25 18:34:43
compiled from "C:\xampp\htdocs\sophalcrm\includes\runtime/../../layouts/v7\modules\Vtiger\partials\Topbar.tpl" */ ?>
<?php /*%%SmartyHeaderCode:82061580868d6bc93909675-76245406%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
@@ -7,7 +7,7 @@ $_valid = $_smarty_tpl->decodeProperties(array (
'b62713acd22803ca6b3ad6d54ce71cdbcc4dc22a' =>
array (
0 => 'C:\\xampp\\htdocs\\sophalcrm\\includes\\runtime/../../layouts/v7\\modules\\Vtiger\\partials\\Topbar.tpl',
1 => 1758796685,
1 => 1761417278,
2 => 'file',
),
),
@@ -15,6 +15,8 @@ $_valid = $_smarty_tpl->decodeProperties(array (
'function' =>
array (
),
'version' => 'Smarty-3.1.7',
'unifunc' => 'content_68d6bc93933c4',
'variables' =>
array (
'MODULE' => 0,
@@ -37,8 +39,6 @@ $_valid = $_smarty_tpl->decodeProperties(array (
'IMAGE_INFO' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.7',
'unifunc' => 'content_68d6bc93933c4',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_68d6bc93933c4')) {function content_68d6bc93933c4($_smarty_tpl) {?>