FIX_ISSUE
This commit is contained in:
parent
745a6b6049
commit
49ca11bdfb
@ -1316,4 +1316,24 @@ if (!function_exists('map_relationship')) {
|
||||
}
|
||||
|
||||
|
||||
if(!function_exists('add_google_calender_event')){
|
||||
function add_google_calender_event($data){
|
||||
|
||||
$calendar = new \App\Libraries\GoogleCalendarService();
|
||||
|
||||
// Check if user is authenticated without passing tokens manually
|
||||
if (!$calendar->isReady()) {
|
||||
return ['status' => 'failed', 'code' => '404' , 'message' => 'Google Access Token Expired'];
|
||||
}
|
||||
|
||||
try {
|
||||
$response = $calendar->createEvent($data);
|
||||
return ['status' => 'success', 'code' => '200' , 'message' => 'Follow-up Saved', 'response' => $response];
|
||||
} catch (\Exception $e) {
|
||||
return ['status' => 'failed', 'code' => '500' , 'message' => 'Error: ' . $e->getMessage()];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -621,7 +621,7 @@
|
||||
console.log('Business Team Logged in.');
|
||||
}
|
||||
|
||||
getURLParamsForReport()
|
||||
// getURLParamsForReport()
|
||||
})
|
||||
|
||||
$(document).ready(function(){
|
||||
@ -1086,10 +1086,10 @@
|
||||
|
||||
if(res.data.client_type == 2){
|
||||
let data1 = policyListByClient[res.data.client_id];
|
||||
appendPolicies(data1, res.pt_id);
|
||||
appendPolicies(data1, res.data.client_policy_id);
|
||||
}else{
|
||||
let data2 = policy_list[res.data.client_branch_id];
|
||||
appendPolicies(data2, res.pt_id);
|
||||
appendPolicies(data2, res.data.client_policy_id);
|
||||
}
|
||||
|
||||
setTimeout(function(){
|
||||
@ -2957,9 +2957,9 @@
|
||||
|
||||
if (pt_id != 0) {
|
||||
hide_list_show_add();
|
||||
setTimeout(() =>
|
||||
getPolicyTransactionDataForEndorsementEdit(pt_id),
|
||||
1500); // Reduced timeout
|
||||
// setTimeout(() =>
|
||||
getPolicyTransactionDataForEndorsementEdit(pt_id)
|
||||
// 1500); // Reduced timeout
|
||||
} else {
|
||||
show_list_hide_add();
|
||||
}
|
||||
|
||||
@ -460,7 +460,11 @@ table.dataTable thead th {
|
||||
// select2 document ready
|
||||
$(document).ready(function() {
|
||||
|
||||
getClientAndBranchAndPolicy()
|
||||
// getClientAndBranchAndPolicy()
|
||||
getClientAndBranchAndPolicy(function() {
|
||||
getURLParamsForReport();
|
||||
});
|
||||
|
||||
addHTMLInput();
|
||||
|
||||
<?php if (session()->has('create_failed')) : ?>
|
||||
@ -632,7 +636,7 @@ table.dataTable thead th {
|
||||
|
||||
}
|
||||
|
||||
function getClientAndBranchAndPolicy() {
|
||||
function getClientAndBranchAndPolicy(callback) {
|
||||
$.ajax({
|
||||
url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>',
|
||||
type: "GET",
|
||||
@ -652,6 +656,11 @@ table.dataTable thead th {
|
||||
console.log('No data found');
|
||||
}
|
||||
|
||||
// ✅ Data ellam set aanadhuku aparam callback call panrom
|
||||
if (typeof callback === "function") {
|
||||
callback();
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user