diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 1155dba3..c8fe85c4 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) { @@ -11883,28 +11883,48 @@ 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'); + + // 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); - $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); - } + // print_r($pd_details); + + 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 '.$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)) + { + $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); + } diff --git a/api/application/controllers/Test.php b/api/application/controllers/Test.php index f4df771d..727281f2 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 @@ -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/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 ); } 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']) 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"=> [ 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');