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,95 +1,189 @@
{*+**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.1
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
************************************************************************************}
{* modules/Vtiger/views/DashBoard.php *}
<script>
function getSplashScreen(){
$.ajax({
type: "GET",
url: "index.php?module=SplashScreenAjax&view=SplashScreenAjax",
contentType: "application/json; charset=utf-8",
success: function(result) {
$("#SplashScreen").html(result);
}
});
}
getSplashScreen();
</script>
{strip}
{assign var="roleid" value=$USER_MODEL->get('roleid')}
<div id="SplashScreen"></div>
<div class="dashBoardContainer clearfix">
<div class="tabContainer">
<ul class="nav nav-tabs tabs sortable container-fluid">
{foreach key=index item=TAB_DATA from=$DASHBOARD_TABS}
<li class="{if $TAB_DATA["id"] eq $SELECTED_TAB}active{/if} dashboardTab" data-tabid="{$TAB_DATA["id"]}" data-tabname="{$TAB_DATA["tabname"]}">
<a data-toggle="tab" href="#tab_{$TAB_DATA["id"]}">
<div>
<span class="name textOverflowEllipsis" value="{$TAB_DATA["tabname"]}" style="width:10%">
<strong>{$TAB_DATA["tabname"]}</strong>
</span>
<span class="editTabName hide">
<input type="text" name="tabName"/>
</span>
{if $TAB_DATA["isdefault"] eq 0}
<i class="fa fa-close deleteTab"></i>
{/if}
{*+**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.1
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
************************************************************************************}
{* modules/Vtiger/views/DashBoard.php *}
<script>
function getSplashScreen(){
$.ajax({
type: "GET",
url: "index.php?module=SplashScreenAjax&view=SplashScreenAjax",
contentType: "application/json; charset=utf-8",
success: function(result) {
$("#SplashScreen").html(result);
}
});
}
getSplashScreen();
</script>
{strip}
{assign var="roleid" value=$USER_MODEL->get('roleid')}
<div id="SplashScreen"></div>
<div class="dashBoardContainer clearfix">
<div class="tabContainer">
<ul class="nav nav-tabs tabs sortable container-fluid">
{foreach key=index item=TAB_DATA from=$DASHBOARD_TABS}
<li class="{if $TAB_DATA["id"] eq $SELECTED_TAB}active{/if} dashboardTab" data-tabid="{$TAB_DATA["id"]}" data-tabname="{$TAB_DATA["tabname"]}">
<a data-toggle="tab" href="#tab_{$TAB_DATA["id"]}">
<div>
<span class="name textOverflowEllipsis" value="{$TAB_DATA["tabname"]}" style="width:10%">
<strong>{$TAB_DATA["tabname"]}</strong>
</span>
<span class="editTabName hide">
<input type="text" name="tabName"/>
</span>
{if $TAB_DATA["isdefault"] eq 0}
<i class="fa fa-close deleteTab"></i>
{/if}
<i class="fa fa-bars moveTab hide"></i>
</div>
</a>
</li>
{/foreach}
<!--
{if isGro($roleid) || isVP($roleid) || isDG($roleid)}
<li class="dashboardTab font-large-2" ><a href="index.php?module=CustomDashboard&view=CustomDashboard"><div><strong>Conventions</strong></div></a></li>
{/if}
-->
{if isDG($roleid) || $roleid == 'H8' || isMedecin($roleid)}
{if isVM($roleid)}
<!-- sophal --><li class="dashboardTab" style="font-size: 1.2rem"><a href="index.php?module=MonitoringVmCompte&view=MonitoringVmCompte"><div><strong>Monitoring Promotion Medicale</strong></div></a></li><!-- sophal -->
{else}
<!-- sophal --><li class="dashboardTab" style="font-size: 1.2rem"><a href="index.php?module=MonitoringVMPlanning&view=MonitoringVMPlanning"><div><strong>Monitoring Promotion Medicale</strong></div></a></li><!-- sophal -->
{/if}
{/if}
{if isGro($roleid) || isPharma($roleid) || isDG($roleid)}
<!-- sophal --><li class="dashboardTab" style="font-size: 1.2rem"><a href="index.php?module=MonitoringVpBCTotal&view=MonitoringVpBCTotal"><div><strong>Monitoring Commercial</strong></div></a></li><!-- sophal -->
{/if}
<div class="moreSettings pull-right">
<div class="dropdown dashBoardDropDown">
<button class="btn btn-default reArrangeTabs dropdown-toggle" type="button" data-toggle="dropdown">{vtranslate('LBL_MORE',$MODULE)}
&nbsp;&nbsp;<span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right moreDashBoards">
<li id="newDashBoardLi"{if count($DASHBOARD_TABS) eq $DASHBOARD_TABS_LIMIT}class="disabled"{/if}><a class = "addNewDashBoard" href="#">{vtranslate('LBL_ADD_NEW_DASHBOARD',$MODULE)}</a></li>
<li><a class = "reArrangeTabs" href="#">{vtranslate('LBL_REARRANGE_DASHBOARD_TABS',$MODULE)}</a></li>
</ul>
</div>
<button class="btn-success updateSequence pull-right hide">{vtranslate('LBL_SAVE_ORDER',$MODULE)}</button>
</div>
</ul>
<div class="tab-content">
{foreach key=index item=TAB_DATA from=$DASHBOARD_TABS}
<div id="tab_{$TAB_DATA["id"]}" data-tabid="{$TAB_DATA["id"]}" data-tabname="{$TAB_DATA["tabname"]}" class="tab-pane fade {if $TAB_DATA["id"] eq $SELECTED_TAB}in active{/if}">
{if $TAB_DATA["id"] eq $SELECTED_TAB}
{include file="dashboards/DashBoardTabContents.tpl"|vtemplate_path:$MODULE TABID=$TABID}
{/if}
</div>
{/foreach}
</div>
</div>
</div>
{/strip}

View File

@@ -327,12 +327,15 @@
<span style="font-size: 10pt" class="module-name textOverflowEllipsis">Questionnaire</span>
</a>
</li>
<li style=" padding: 2.5% 2% !important;">
{if !hideStock($roleid)}
<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>
{/if}
{/if}
{if $roleid == 'H8'}
<li style=" padding: 2.5% 2% !important;">
@@ -348,15 +351,17 @@
</a>
</li>
{/if}
{if $roleid == 'H12' || $roleid == 'H11' || $roleid == 'H4' || $roleid == 'H34' || $roleid == 'H36' || $roleid == 'H38' || $roleid == 'H42' || $roleid == 'H44'}
<li style=" padding: 2.5% 2% !important;">
{*if $roleid == 'H34' || $roleid == 'H36' || $roleid == 'H38' || $roleid == 'H42' || $roleid == 'H44' *}
{if $roleid == 'H12' || $roleid == 'H11' || $roleid == '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>
{/if}
{if $roleid != 'H12' && $roleid != 'H11' && $roleid != 'H4' && $roleid != 'H34' && $roleid != 'H36' && $roleid != 'H38' && $roleid != 'H42' && $roleid != 'H44' }
{*&& $roleid != 'H34' && $roleid != 'H36' && $roleid != 'H38' && $roleid != 'H42' && $roleid != 'H44' *}
{if $roleid != 'H12' && $roleid != 'H11' && $roleid != '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>