From faf88a340e489361db5ae804ef0bb3fff7f29098 Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Thu, 26 May 2022 11:37:58 +0530 Subject: [PATCH 1/5] Gmeet API created. --- api/application/controllers/PD_Controller.php | 62 ++++++++++++------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 02428358..7ec02030 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -793,10 +793,10 @@ class PD_Controller extends REST_Controller { /****************END OF ADDTIONAL REQUIREMENTS SECTION*******************************************/ //create gmeet link - if($pd_id != null && $pd_id != '' && ($pd_details['fk_pd_type'] == 2 || $pd_details['fk_pd_type'] == 3)) - { - $this->createGmeetLink($pdid); - } + // if($pd_id != null && $pd_id != '' && ($pd_details['fk_pd_type'] == 2 || $pd_details['fk_pd_type'] == 3)) + // { + // $this->createGmeetLink($pd_id); + // } if($pd_id != null || $pd_id != '' && $count != 0) { @@ -11887,28 +11887,44 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post() /**** create gmeet link for smart and tele pd and update it in pd trigger table */ - // function createGmeetLink_get() - function createGmeetLink($pdid) + function createGmeetLink_get() + // function createGmeetLink($pdid) { - // $pdid = $this->get('pdid'); + $pdid = $this->get('pdid'); $this->load->library('Googleapi'); $pd_details = $this->PD_Model->getPDMasterDetails($pdid); - $event = array( - 'summary' => 'PD for case -'.$pd_details[0]['pd_sno'].' & Applicant ID - '.$pd_details[0]['lender_applicant_id'], - 'start' => Date('Y-m-d'), - 'end' => Date('Y-m-d'), - 'pdid' => $pdid, - - ); - - $event_data = $this->googleapi->addGoogleCalenterEvent($event); - if(is_object($event_data)) - { - $meet_code = isset($event_data['conferenceData']['conferenceId']) ? $event_data['conferenceData']['conferenceId'] : null; - $meet_id = isset($event_data['id']) ? $event_data['id'] : null; - $where_condition_array = array('pd_id' => $pdid); - $this->PD_Model->updateRecords(['gmeet_code' => $meet_code,'gmeet_id' => $meet_id],PDTRIGGER,$where_condition_array); - } + + if($pd_details[0]['gmeet_code'] == null && ($pd_details[0]['fk_pd_type'] == 2 || $pd_details[0]['fk_pd_type'] == 3)) + { + $event = array( + 'summary' => 'PD for case -'.$pd_details[0]['pd_sno'].' & Applicant ID - '.$pd_details[0]['lender_applicant_id'], + 'start' => Date('Y-m-d'), + 'end' => Date('Y-m-d'), + 'pdid' => $pdid, + + ); + + $event_data = $this->googleapi->addGoogleCalenterEvent($event); + if(is_object($event_data)) + { + $meet_code = isset($event_data['conferenceData']['conferenceId']) ? $event_data['conferenceData']['conferenceId'] : null; + $meet_id = isset($event_data['id']) ? $event_data['id'] : null; + $where_condition_array = array('pd_id' => $pdid); + $this->PD_Model->updateRecords(['gmeet_code' => $meet_code,'gmeet_id' => $meet_id],PDTRIGGER,$where_condition_array); + + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['data'] = ['gmeet_code' => $meet_code]; + $this->response($data,REST_Controller::HTTP_OK); + } + } + else + { + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NO_CONTENT; + $data['msg'] = 'gmeet already created'; + $this->response($data,REST_Controller::HTTP_OK); + } From 75f9fa9e065a5e08cb99c72972de3d59d6fb5d14 Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Thu, 26 May 2022 12:03:55 +0530 Subject: [PATCH 2/5] gmeet time scheduling for One Hour enabled --- api/application/controllers/PD_Controller.php | 14 +++++++++----- api/application/libraries/Googleapi.php | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 06ddfa92..d16e7f80 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -11885,20 +11885,24 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post() function createGmeetLink_get() // function createGmeetLink($pdid) { + + // echo Date('Y-m-d').'T'. Date('H:i:s', (strtotime(Date('H:i:s') . '+ 1 hour'))); + // die(); $pdid = $this->get('pdid'); $this->load->library('Googleapi'); $pd_details = $this->PD_Model->getPDMasterDetails($pdid); + // print_r($pd_details); - if($pd_details[0]['gmeet_code'] == null && ($pd_details[0]['fk_pd_type'] == 2 || $pd_details[0]['fk_pd_type'] == 3)) + if(!$pd_details[0]['gmeet_code'] && ($pd_details[0]['fk_pd_type'] == 2 || $pd_details[0]['fk_pd_type'] == 3)) { $event = array( - 'summary' => 'PD for case -'.$pd_details[0]['pd_sno'].' & Applicant ID - '.$pd_details[0]['lender_applicant_id'], - 'start' => Date('Y-m-d'), - 'end' => Date('Y-m-d'), + 'summary' => 'PD for '.$pd_details[0]['title_name'].' '.$pd_details[0]['main_applicant'].' & case no -'.$pd_details[0]['pd_sno'].' & Applicant ID - '.$pd_details[0]['lender_applicant_id'], + 'start' => Date('Y-m-d').'T'.Date('H:i:s'), + 'end' => Date('Y-m-d').'T'. Date('H:i:s', (strtotime(Date('H:i:s') . '+ 1 hour'))), 'pdid' => $pdid, ); - + // print_r($event);die(); $event_data = $this->googleapi->addGoogleCalenterEvent($event); if(is_object($event_data)) { diff --git a/api/application/libraries/Googleapi.php b/api/application/libraries/Googleapi.php index b2b98023..cf9ec229 100644 --- a/api/application/libraries/Googleapi.php +++ b/api/application/libraries/Googleapi.php @@ -144,11 +144,11 @@ class Googleapi 'location' => 'Online', 'description' => '', 'start' => array( - 'dateTime' => $eventdata['start'].'T00:00:00', + 'dateTime' => $eventdata['start'], 'timeZone' => 'Asia/Kolkata', ), 'end' => array( - 'dateTime' => $eventdata['end'].'T00:00:00', + 'dateTime' => $eventdata['end'], 'timeZone' => 'Asia/Kolkata', ),"conferenceData" => [ "createRequest"=> [ From 29a3703f83d5c1ca0813ef14b9d7d863b8b5ddcb Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 26 May 2022 08:17:57 +0000 Subject: [PATCH 3/5] cet_salespd_helper.php edited online with Bitbucket --- api/application/helpers/cet_salespd_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/application/helpers/cet_salespd_helper.php b/api/application/helpers/cet_salespd_helper.php index d6a2b51d..d4268517 100644 --- a/api/application/helpers/cet_salespd_helper.php +++ b/api/application/helpers/cet_salespd_helper.php @@ -63,7 +63,7 @@ class CET_SALESPD curl_setopt( $ch,CURLOPT_POSTFIELDS, $output_data); $result = curl_exec($ch ); $response = json_decode($result); - log_message('ERROR',"CET APP SALES PDID (".$pdid.") ".$log_msg."PullSalesPDData api response :".json_encode($response)); + log_message('ERROR',"CET APP SALES PDID (".$pdid.") "."PullSalesPDData api response :".json_encode($response)); curl_close( $ch ); } From c8374e89f42a0581db8e585f7263ce4284f72688 Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Fri, 27 May 2022 22:33:06 +0530 Subject: [PATCH 4/5] bugs fixed --- api/application/controllers/Test.php | 2 +- api/application/models/Entity_Management_Model.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/application/controllers/Test.php b/api/application/controllers/Test.php index f4df771d..06855ee9 100644 --- a/api/application/controllers/Test.php +++ b/api/application/controllers/Test.php @@ -135,7 +135,7 @@ class Test extends REST_Controller { } } //update face api result in main table - $where_condition_array = array('pd_id' => $pd_id); + $where_condition_array = array('pd_id' => $pdid); $this->PD_Model->updateRecords(['faceapi_result' => json_encode($res_data)],PDTRIGGER,$where_condition_array); //delete local files if created diff --git a/api/application/models/Entity_Management_Model.php b/api/application/models/Entity_Management_Model.php index 04f80789..30da3659 100644 --- a/api/application/models/Entity_Management_Model.php +++ b/api/application/models/Entity_Management_Model.php @@ -14,7 +14,7 @@ class Entity_Management_Model extends SPARQ_Model { { $result_data = array(); - $this->db->SELECT('ENTITY.entity_id, ENTITY.full_name, ENTITY.short_name,ENTITY.createdon, ENTITY.fk_createdby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby, ENTITY.updatedon, ENTITY.fk_updatedby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, ENTITY.isactive,ENTITY.fk_entity_type_id,ENTITYTYPE.name as entity_name,ENTITY.is_otp_enabled,ENTITY.is_score_card_enabled,ENTITY.is_sms_enabled,ENTITY.is_mail_enabled,ENTITY.is_app_notify_enabled'); + $this->db->SELECT('ENTITY.entity_id, ENTITY.full_name, ENTITY.short_name,ENTITY.createdon, ENTITY.fk_createdby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby, ENTITY.updatedon, ENTITY.fk_updatedby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, ENTITY.isactive,ENTITY.fk_entity_type_id,ENTITYTYPE.name as entity_name,ENTITY.is_otp_enabled,ENTITY.is_score_card_enabled,ENTITY.is_sms_enabled,ENTITY.is_mail_enabled,ENTITY.is_app_notify_enabled,ENTITY.is_face_api_enabled'); $this->db->FROM(ENTITY.' as ENTITY'); $this->db->JOIN(USERPROFILE.' as USERPROFILE','ENTITY.fk_createdby = USERPROFILE.userid','LEFT'); $this->db->JOIN(USERPROFILE.' as USERPROFILE1','ENTITY.fk_updatedby = USERPROFILE1.userid','LEFT'); From d43aaa045ed0e1d51ad463e5a4331cbf475c348e Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Sat, 28 May 2022 12:00:14 +0530 Subject: [PATCH 5/5] video bugs fixed --- api/application/controllers/Test.php | 2 ++ api/application/helpers/video_grabber_helper.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api/application/controllers/Test.php b/api/application/controllers/Test.php index 06855ee9..727281f2 100644 --- a/api/application/controllers/Test.php +++ b/api/application/controllers/Test.php @@ -189,6 +189,7 @@ class Test extends REST_Controller { $driveFilesList = $this->googleapi->getDriveFilesList($pd_details[0]['gmeet_code']); if(count($driveFilesList)) { + log_message('ERROR','###Videos Found'.count($driveFilesList).' - PDID - '. $pdid); foreach ($driveFilesList as $key => $file) { $this->handleGoolgeVideoFile($file,$pd_details); @@ -201,6 +202,7 @@ class Test extends REST_Controller { } else { + log_message('ERROR','###Videos not found/not available in drive yet Found'.count($driveFilesList).' - PDID - '. $pdid); $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_NO_CONTENT; // $data['msg'] = 'Officers Records Not Found!'; diff --git a/api/application/helpers/video_grabber_helper.php b/api/application/helpers/video_grabber_helper.php index b032e616..ad06153e 100644 --- a/api/application/helpers/video_grabber_helper.php +++ b/api/application/helpers/video_grabber_helper.php @@ -33,7 +33,7 @@ class video_grabber_helper foreach ($video_info as $key => $value) { $video_name = $value['composition_id'].'.mp4'; - if($value['is_uploaded']){$video_name = $value['composition_id'];} + if($value['is_uploaded'] || $value['vps'] == 'google'){$video_name = $value['composition_id'];} $file_name = $video_name; if($value['s3_copied'])