FIX_UNLAYER_EDITOR,FEAT_SIDEBAR_EXTENDED,FIX_MAIL_HELPER_SRINIVAS

This commit is contained in:
Srinivas-Saravanan 2025-01-22 11:24:25 +05:30
parent 209f66b484
commit 5c35f32a3f
6 changed files with 177 additions and 106 deletions

View File

@ -1658,7 +1658,7 @@ class MasterController extends AdminController
$email_id = CLI::getOption('to') ? CLI::getOption('to') : $email_id;
$res = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Mail Via CLI', 'message' => $message,'attachments' => $attachments,'common'=>$common]);
echo "Inside the master controller";
print_r($res);
print_r($res['data']['zepto_api']);
}
@ -1669,10 +1669,11 @@ class MasterController extends AdminController
["filePath" => ROOTPATH."public/sample_excel/sample_inception.xls","fileName" => "sample_inception.xls"],
["filePath" => ROOTPATH."public/assets/images/login_bg.jpg","fileName" => "login_bg.jpg"]
];
$email_id = 'srinivas.saravanan@venbainfotech.com';
$email_id = 'hariharan@nhanceindia.in';
$common = ['mail_type'=>'test_mail_cli'];
$bcc = "vijayalakshmi@nhanceindia.in,vitvelz@gmail.com,velmurugan.s@venbainfotech.com,hariharan@nhanceindia.in,hariharan@jubiliant.in,srinivas.saravanan@venbainfotech.com";
// Send email and get response
$result = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Mail Via CLI', 'message' => $message,'attachments' => $attachments,'common'=>$common]);
$result = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Mail Via CLI','bcc'=>$bcc ,'message' => $message,'attachments' => $attachments,'common'=>$common]);
log_message('error',json_encode($result));

View File

@ -15,7 +15,7 @@ class ExcelSanitizeHelper
"\x0A", "\x0B", "\x0C", "\x0D", "\x0E", "\x0F", "\x10", "\x11", "\x12", "\x13",
"\x14", "\x15", "\x16", "\x17", "\x18", "\x19", "\x1A", "\x1B", "\x1C", "\x1D",
"\x1E", "\x1F", "\x7F", "_x000D_", "_x000A_", "_x0009_", "_x0008_", "_x0007_",
"_x0006_", "_x0005_", "_x0004_", "_x0003_", "_x0002_", "_x0001_"
"_x0006_", "_x0005_", "_x0004_", "_x0003_", "_x0002_", "_x0001_","\u200C"
];
/**

View File

@ -325,31 +325,42 @@ class MailHelper
// Add CC recipients if provided
if (!empty($cc)) {
$postData['cc'] = [];
// Handle both string and array inputs for CC
$ccEmails = is_array($cc) ? $cc : [$cc];
foreach ($ccEmails as $ccEmail) {
$postData['cc'][] = [
$ccList = explode(',', $cc);
$ccList = array_map('trim', $ccList);
$postData['cc'] = array_map(function($email) {
return [
'email_address' => [
'address' => $ccEmail
'address' => $email
]
];
}
}, $ccList);
}
// Add BCC if present
if (!empty($bcc)) {
$bccList = explode(',', $bcc);
$bccList = array_map('trim', $bccList);
$postData['bcc'] = array_map(function($email) {
return [
'email_address' => [
'address' => $email
]
];
}, $bccList);
}
// Add BCC recipients if provided
if (!empty($bcc)) {
$postData['bcc'] = [];
// Handle both string and array inputs for BCC
$bccEmails = is_array($bcc) ? $bcc : [$bcc];
foreach ($bccEmails as $bccEmail) {
$postData['bcc'][] = [
'email_address' => [
'address' => $bccEmail
]
];
}
}
// if (!empty($bcc)) {
// $postData['bcc'] = [];
// // Handle both string and array inputs for BCC
// $bccEmails = is_array($bcc) ? $bcc : [$bcc];
// foreach ($bccEmails as $bccEmail) {
// $postData['bcc'][] = [
// 'email_address' => [
// 'address' => $bccEmail
// ]
// ];
// }
// }
// Handle attachments
if (!empty($attachments)) {

View File

@ -671,61 +671,98 @@
<?php if((get_role_id() == 1 || get_role_id() == 5) && (in_array(BUSINESS_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team()))) { ?>
<li>
<a href="#sidebarDashboards" data-toggle="collapse" class="waves-effect">
<i class="mdi mdi-format-list-bulleted"></i>
<span class="badge badge-success badge-pill float-right">2</span>
<span> Policy Transactions </span>
</a>
<div class="collapse" id="sidebarDashboards">
<ul class="nav-second-level">
<li>
<a href="<?= base_url('/policy_tranction/inception/list') ?>">Policy</a>
</li>
<li>
<a href="<?= base_url('/policy_tranction/endorsement/list') ?>">Endorsement</a>
</li>
<li>
<a href="#policyTransactions" data-toggle="collapse" class="waves-effect">
<i class="mdi mdi-format-list-bulleted"></i>
<span class="badge badge-success badge-pill float-right">2</span>
<span> Policy Transactions </span>
</a>
<div class="collapse" id="policyTransactions">
<ul class="nav-second-level">
<li>
<a href="#policyTransactions" data-toggle="collapse" class="waves-effect">
<i class="mdi mdi-format-list-bulleted"></i>
<?php if (in_array(FINANCE_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team())) { ?>
<span>Policy Transactions</span>
</a>
<div class="collapse" id="policyTransactions">
<ul>
<li>
<a href="<?= base_url('/policy_tranction/inception/list') ?>">Policy</a>
</li>
<li>
<a href="<?= base_url('/policy_tranction/endorsement/list') ?>">Endorsement</a>
</li>
<li>
<a href="<?= base_url('/policy_tranction/statement/list') ?>">Statement upload</a>
</li>
<?php if (in_array(FINANCE_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team())) { ?>
<li>
<a href="<?= base_url('/policy_tranction/statement/list') ?>">Statement Upload</a>
</li>
</ul>
</div>
</li>
<li>
<a href="#policyReports" data-toggle="collapse" class="waves-effect">
<i class="ri-file-chart-fill"></i>
<span> Policy Reports </span>
</a>
<div class="collapse" id="policyReports">
<ul class="nav-third-level">
<li>
<a href="<?= base_url('/policy_tranction/report/list') ?>">BDS</a>
</li>
<li>
<a href="<?= base_url('/policy_tranction/report/report-varience-list') ?>">Variance</a>
</li>
<li>
<a href="<?= base_url('/policy_tranction/report/report-outstanding-list') ?>">Outstanding</a>
</li>
<?php } ?>
</ul>
</div>
</li>
<li>
<li>
<a href="#policyMasters" data-toggle="collapse" class="waves-effect">
<i class="mdi mdi-timer-sand"></i>
<span> Policy Pending Actions </span>
</a>
<div class="collapse" id="policyReports">
<ul class="nav-third-level">
<a href="<?= base_url('/policy_tranction/report/report-finance-list') ?>">Finance Team</a>
</li>
<?php } ?>
<li>
<a href="<?= base_url('/policy_tranction/report/list') ?>">BDS</a>
</li>
<li>
<a href="<?= base_url('/policy_tranction/report/report-varience-list') ?>">Variance</a>
</li>
<li>
<a href="<?= base_url('/policy_tranction/report/report-outstanding-list') ?>">Outstanding</a>
</li>
<li>
<a href="<?= base_url('/policy_tranction/report/report-finance-list') ?>">Finance Team</a>
</li>
<?php if (in_array(BUSINESS_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team())) { ?>
<li>
<a href="<?= base_url('/policy_tranction/report/report-business-list') ?>">Business Team</a>
</li>
</li></ul></div>
<li>
<a href="#policyMasters" data-toggle="collapse" class="waves-effect">
<i class="ri-database-2-line"></i>
<span> Masters </span>
</a>
<div class="collapse" id="policyReports">
<ul class="nav-third-level">
<li>
<a href="<?= base_url('/master/cash_deposite/list') ?>">CD Master</a>
</li>
<li>
<a href="<?= base_url('/master/vehicle/list') ?>">Vehicle Master</a>
</li>
</ul></div>
</li>
<li>
<a href="<?= base_url('/dmsSearch') ?>"><i class="ri-book-open-line"></i><span> Documents</span></a>
</li>
</ul>
</div>
</li>
<?php } ?>
<?php if (in_array(BUSINESS_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team())) { ?>
<li>
<a href="<?= base_url('/policy_tranction/report/report-business-list') ?>">Business Team</a>
</li>
<?php } ?>
<li>
<a href="<?= base_url('/master/cash_deposite/list') ?>">CD Master</a>
</li>
<li>
<a href="<?= base_url('/master/vehicle/list') ?>">Vehicle Master</a>
</li>
<li>
<a href="<?= base_url('/dmsSearch') ?>">Documents</a>
</li>
</ul>
</div>
</li>
<?php } ?>

View File

@ -1802,40 +1802,13 @@ function getMailTemplateData(element) {
const design = JSON.parse(res.mail_content_json);
editorInstance.loadDesign(design);
console.log("Design loaded successfully");
$('iframe').on('load', function() {
console.log('Iframe loaded.');
const iframe = $(this);
// Overlay the branding area
const overlay = $('<div>', {
css: {
position: 'absolute',
bottom: '0', // Adjust based on branding position
left: '0',
width: iframe.width(),
height: '30px', // Adjust height to cover branding
backgroundColor: 'white',
zIndex: '9999',
pointerEvents: 'none',
},
});
const iframeParent = iframe.parent();
if (iframeParent.css('position') === 'static') {
iframeParent.css('position', 'relative');
}
iframeParent.append(overlay);
console.log('Overlay added to hide branding.');
});
hideBranding();
} catch (error) {
console.error("Error parsing mail content JSON:", error);
toastr.error('Error loading email template');
}
}else{
hideBranding()
}
});
};
@ -1852,6 +1825,29 @@ function getMailTemplateData(element) {
$('.testmail').toggle(!!res.id);
$('#attachment_table').toggle(!!res.id);
$('.setid').attr('data-id', res.id || '');
}else{
console.log("Inside else");
let retryCount = 0;
const initWithRetry = function() {
initializeEditor(function(editorInstance) {
if (!editorInstance && retryCount < 3) {
console.log(`Retrying editor initialization (${retryCount + 1}/3)...`);
retryCount++;
setTimeout(initWithRetry, 1000);
return;
}
if (!editorInstance) {
console.error("Editor initialization failed after retries");
toastr.error('Editor initialization failed. Please refresh the page.');
return;
}
hideBranding();
});
};
initWithRetry();
}
$('.loader').fadeOut();
@ -1926,6 +1922,32 @@ $('#account_maneger_summary_mail_form').submit(function (event) {
});
});
function hideBranding(){
$('iframe').on('load', function() {
console.log('Iframe loaded.');
const iframe = $(this);
// Overlay the branding area
const overlay = $('<div>', {
css: {
position: 'absolute',
bottom: '0', // Adjust based on branding position
left: '0',
width: iframe.width(),
height: '30px', // Adjust height to cover branding
backgroundColor: 'white',
zIndex: '9999',
pointerEvents: 'none',
},
});
const iframeParent = iframe.parent();
if (iframeParent.css('position') === 'static') {
iframeParent.css('position', 'relative');
}
iframeParent.append(overlay);
console.log('Overlay added to hide branding.');
});
}
</script>

View File

@ -213,7 +213,7 @@ $(document).ready(function() {
for (var i = 0; i < data.body.length; i++) {
for (var j = 0; j < data.body[i].length; j++) {
// Check if the column is the 9th index (10th column)
if (j === 9) { // 8 is the 9th index (0-based)
if (j === 9) {
data.body[i][j] = '\u200C' + data.body[i][j];
}
}