From b92c7ef81f226ccae167f3df9b2d82b14ad4c4bc Mon Sep 17 00:00:00 2001 From: raja-7453 Date: Wed, 20 Nov 2019 20:24:14 +0530 Subject: [PATCH] Issue fix --- src/crm/api/handler/EntityAPIHandler.php | 2 +- src/crm/api/handler/MassEntityAPIHandler.php | 1 + src/crm/api/handler/MetaDataAPIHandler.php | 4 +--- src/crm/api/handler/ModuleAPIHandler.php | 6 +----- src/crm/api/handler/OrganizationAPIHandler.php | 13 +++++++++++++ src/crm/api/handler/RelatedListAPIHandler.php | 2 ++ src/crm/api/handler/TagAPIHandler.php | 4 ++-- src/crm/api/handler/VariableAPIHandler.php | 9 +++++++++ src/crm/api/handler/VariableGroupAPIHandler.php | 5 +++++ src/crm/bulkapi/handler/BulkWriteAPIHandler.php | 2 +- src/oauth/ZohoOAuthClient.php | 2 ++ 11 files changed, 38 insertions(+), 12 deletions(-) diff --git a/src/crm/api/handler/EntityAPIHandler.php b/src/crm/api/handler/EntityAPIHandler.php index 70f1fa72..e2b59b6c 100644 --- a/src/crm/api/handler/EntityAPIHandler.php +++ b/src/crm/api/handler/EntityAPIHandler.php @@ -252,7 +252,7 @@ public function deletePhoto() } } - function getZCRMRecordAsJSON() + public function getZCRMRecordAsJSON() { $recordJSON = array(); $apiNameVsValues = $this->record->getData(); diff --git a/src/crm/api/handler/MassEntityAPIHandler.php b/src/crm/api/handler/MassEntityAPIHandler.php index 9d8ca6e0..b8118562 100644 --- a/src/crm/api/handler/MassEntityAPIHandler.php +++ b/src/crm/api/handler/MassEntityAPIHandler.php @@ -76,6 +76,7 @@ public function createRecords($records, $trigger,$lar_id) throw $e; } } + public function upsertRecords($records, $trigger,$lar_id,$duplicate_check_fields) { if (sizeof($records) > 100) { diff --git a/src/crm/api/handler/MetaDataAPIHandler.php b/src/crm/api/handler/MetaDataAPIHandler.php index fa73ad49..64da6e23 100644 --- a/src/crm/api/handler/MetaDataAPIHandler.php +++ b/src/crm/api/handler/MetaDataAPIHandler.php @@ -155,15 +155,12 @@ public function getZCRMModule($moduleDetails) return $crmModuleInstance; } - - public function getRelatedListProperties($relatedListProperties) { $relatedListPropInstance = ZCRMRelatedListProperties::getInstance(); $relatedListPropInstance->setSortBy(array_key_exists("sort_by", $relatedListProperties) ? $relatedListProperties['sort_by'] : null); $relatedListPropInstance->setSortOrder(array_key_exists("sort_order", $relatedListProperties) ? $relatedListProperties['sort_order'] : null); $relatedListPropInstance->setFields(array_key_exists("fields", $relatedListProperties) ? $relatedListProperties['fields'] : null); - return $relatedListPropInstance; } @@ -220,6 +217,7 @@ public function constructCriteria($criteria,&$index) } return $criteria_instance; } + /** * Method to process the given custom view details and set them in ZCRMCustomView instance * Input:: custom view details as array diff --git a/src/crm/api/handler/ModuleAPIHandler.php b/src/crm/api/handler/ModuleAPIHandler.php index e3286816..93241561 100644 --- a/src/crm/api/handler/ModuleAPIHandler.php +++ b/src/crm/api/handler/ModuleAPIHandler.php @@ -37,8 +37,7 @@ public static function getInstance(ZCRMModule $module) public function getModuleDetails() { - $this->module = MetaDataAPIHandler::getInstance()->getModule($this->module->getAPIName()) - ->getData(); + $this->module = MetaDataAPIHandler::getInstance()->getModule($this->module->getAPIName())->getData(); } /** @@ -296,9 +295,6 @@ public function getRelatedListDetails($relatedListId) } } - - - public function getLayouts($allLayoutDetails) { $layoutArray = array(); diff --git a/src/crm/api/handler/OrganizationAPIHandler.php b/src/crm/api/handler/OrganizationAPIHandler.php index a0baa83d..9e262a79 100644 --- a/src/crm/api/handler/OrganizationAPIHandler.php +++ b/src/crm/api/handler/OrganizationAPIHandler.php @@ -63,6 +63,7 @@ public function getNotes($param_map,$header_map){ throw $exception; } } + public function createNotes($noteInstances){ if (sizeof($noteInstances) > 100) { throw new ZCRMException(APIConstants::API_MAX_NOTES_MSG, APIConstants::RESPONSECODE_BAD_REQUEST); @@ -92,6 +93,7 @@ public function createNotes($noteInstances){ throw $exception; } } + public function deleteNotes($noteIds){ if (sizeof($noteIds) > 100) { throw new ZCRMException(APIConstants::API_MAX_NOTES_MSG, APIConstants::RESPONSECODE_BAD_REQUEST); @@ -109,6 +111,7 @@ public function deleteNotes($noteIds){ throw $exception; } } + public function getOrganizationDetails() { try { @@ -147,6 +150,7 @@ public function getOrganizationTaxes() throw $exception; } } + public function getOrganizationTax($orgTaxId) { try { @@ -163,6 +167,7 @@ public function getOrganizationTax($orgTaxId) throw $exception; } } + public function createOrganizationTaxes($orgTaxInstances) { if (sizeof($orgTaxInstances) > 100) { @@ -192,6 +197,7 @@ public function createOrganizationTaxes($orgTaxInstances) throw $exception; } } + public function updateOrganizationTaxes($orgTaxInstances) { if (sizeof($orgTaxInstances) > 100) { @@ -220,6 +226,7 @@ public function updateOrganizationTaxes($orgTaxInstances) throw $exception; } } + public function deleteOrganizationTax($orgTaxId) { try { @@ -233,6 +240,7 @@ public function deleteOrganizationTax($orgTaxId) throw $exception; } } + public function deleteOrganizationTaxes($orgTaxIds) { if (sizeof($orgTaxIds) > 100) { @@ -251,6 +259,7 @@ public function deleteOrganizationTaxes($orgTaxIds) throw $exception; } } + public function getZCRMorgTax($orgTaxDetails){ $orgTaxInstance=ZCRMOrgTax::getInstance($orgTaxDetails['name'], $orgTaxDetails['id']); $orgTaxInstance->setValue($orgTaxDetails['display_label']); @@ -401,6 +410,7 @@ public function deleteUser($userId) throw $exception; } } + public function constructJSONForZCRMOrgTax($orgTaxInstance) { $orgTaxJson = array(); @@ -420,6 +430,7 @@ public function constructJSONForZCRMOrgTax($orgTaxInstance) return $orgTaxJson; } + public function constructJSONForUser($userInstanceArray) { $userArray = array(); @@ -658,6 +669,7 @@ public function getUsers($param_map,$header_map,$type) throw $exception; } } + public function searchUsersByCriteria($criteria,$param_map) { try { @@ -683,6 +695,7 @@ public function searchUsersByCriteria($criteria,$param_map) throw $exception; } } + public function getAllUsers($param_map,$header_map) { return self::getUsers($param_map,$header_map,'AllUsers'); diff --git a/src/crm/api/handler/RelatedListAPIHandler.php b/src/crm/api/handler/RelatedListAPIHandler.php index d2f0b3a1..9f5bf9cb 100644 --- a/src/crm/api/handler/RelatedListAPIHandler.php +++ b/src/crm/api/handler/RelatedListAPIHandler.php @@ -126,6 +126,7 @@ public function getAttachments($param_map) throw $exception; } } + public function addNotes($noteInstances){ if (sizeof($noteInstances) > 100) { throw new ZCRMException(APIConstants::API_MAX_NOTES_MSG, APIConstants::RESPONSECODE_BAD_REQUEST); @@ -152,6 +153,7 @@ public function addNotes($noteInstances){ throw $exception; } } + public function addNote($zcrmNote) { try { diff --git a/src/crm/api/handler/TagAPIHandler.php b/src/crm/api/handler/TagAPIHandler.php index c1009b51..6525501f 100644 --- a/src/crm/api/handler/TagAPIHandler.php +++ b/src/crm/api/handler/TagAPIHandler.php @@ -24,7 +24,7 @@ public static function getInstance($zcrmmodule = null) return new TagAPIHandler($zcrmmodule); } - public function getTags($param_map,$header_map) + public function getTags() { try { @@ -464,7 +464,7 @@ public function setTagProperties($tagInstance, $tagDetails) } } - function getZCRMTagAsJSON($tag) + public function getZCRMTagAsJSON($tag) { $recordJSON = array(); if ($tag->getName() != null) diff --git a/src/crm/api/handler/VariableAPIHandler.php b/src/crm/api/handler/VariableAPIHandler.php index 75ebd5bf..5ea4342b 100644 --- a/src/crm/api/handler/VariableAPIHandler.php +++ b/src/crm/api/handler/VariableAPIHandler.php @@ -42,6 +42,7 @@ public function getVariables() throw $exception; } } + private function getVariablesResAsObj($jsonData,$entityInstance) { foreach($jsonData as $key=>$value) @@ -80,6 +81,7 @@ private function getVariablesResAsObj($jsonData,$entityInstance) } } } + public function getVariable($group) { try{ @@ -106,6 +108,7 @@ public function getVariable($group) throw $exception; } } + private function getVariableResAsObj($jsonData,$entityInstance) { foreach($jsonData as $key=>$value) @@ -144,6 +147,7 @@ private function getVariableResAsObj($jsonData,$entityInstance) } } } + public function createVariables($variable) { try{ @@ -169,6 +173,7 @@ public function createVariables($variable) throw $exception; } } + private function convertObjectToJson($entityInstance) { $variablesJson=array(); @@ -212,6 +217,7 @@ private function convertObjectToJson($entityInstance) } return $variablesJson; } + public function updateVariables($variable) { try{ @@ -237,6 +243,7 @@ public function updateVariables($variable) throw $exception; } } + public function updateVariable() { try{ @@ -260,6 +267,7 @@ public function updateVariable() throw $exception; } } + public function deleteVariable() { try{ @@ -283,6 +291,7 @@ public function deleteVariable() throw $exception; } } + public function setVariables($variables) { $this->variables=$variables; diff --git a/src/crm/api/handler/VariableGroupAPIHandler.php b/src/crm/api/handler/VariableGroupAPIHandler.php index 7ea45fe8..35ced11a 100644 --- a/src/crm/api/handler/VariableGroupAPIHandler.php +++ b/src/crm/api/handler/VariableGroupAPIHandler.php @@ -15,6 +15,7 @@ public static function getInstance() { return new VariableGroupAPIHandler(); } + public function getVariableGroups() { try{ @@ -41,6 +42,7 @@ public function getVariableGroups() throw $exception; } } + private function getVariableGroupsResAsObj($jsonData,$entityInstance) { foreach($jsonData as $key=>$value) @@ -68,6 +70,7 @@ private function getVariableGroupsResAsObj($jsonData,$entityInstance) } } } + public function getVariableGroup() { try{ @@ -90,6 +93,7 @@ public function getVariableGroup() throw $exception; } } + private function getVariableGroupResAsObj($jsonData,$entityInstance) { foreach($jsonData as $key=>$value) @@ -117,6 +121,7 @@ private function getVariableGroupResAsObj($jsonData,$entityInstance) } } } + public function setVariableGroups($variable_groups) { $this->variable_groups=$variable_groups; diff --git a/src/crm/bulkapi/handler/BulkWriteAPIHandler.php b/src/crm/bulkapi/handler/BulkWriteAPIHandler.php index 018e8105..83c132d1 100644 --- a/src/crm/bulkapi/handler/BulkWriteAPIHandler.php +++ b/src/crm/bulkapi/handler/BulkWriteAPIHandler.php @@ -227,7 +227,7 @@ private function getZCRMBulkWriteFieldMappingJSONObject(ZCRMBulkWriteFieldMappin { $fieldMappingJSON["api_name"] = $fieldMappingObj->getFieldAPIName(); } - if ($fieldMappingObj->getIndex() == 0 || $fieldMappingObj->getIndex() != null) + if ($fieldMappingObj->getIndex() >= 0 && $fieldMappingObj->getIndex() != null) { $fieldMappingJSON["index"] = $fieldMappingObj->getIndex(); } diff --git a/src/oauth/ZohoOAuthClient.php b/src/oauth/ZohoOAuthClient.php index 36c2e009..87383efa 100644 --- a/src/oauth/ZohoOAuthClient.php +++ b/src/oauth/ZohoOAuthClient.php @@ -19,6 +19,7 @@ private function __construct($params) { $this->zohoOAuthParams = $params; } + public static function getInstance($params) { self::$zohoOAuthClient = new ZohoOAuthClient($params); @@ -76,6 +77,7 @@ public function generateAccessTokenFromRefreshToken($refreshToken, $userEmailId) { self::refreshAccessToken($refreshToken, $userEmailId); } + public function refreshAccessToken($refreshToken, $userEmailId) {