Skip to content

Commit

Permalink
Issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
raja-7453 committed Nov 20, 2019
1 parent cca65b0 commit b92c7ef
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/crm/api/handler/EntityAPIHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public function deletePhoto()
}
}

function getZCRMRecordAsJSON()
public function getZCRMRecordAsJSON()
{
$recordJSON = array();
$apiNameVsValues = $this->record->getData();
Expand Down
1 change: 1 addition & 0 deletions src/crm/api/handler/MassEntityAPIHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 1 addition & 3 deletions src/crm/api/handler/MetaDataAPIHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions src/crm/api/handler/ModuleAPIHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down Expand Up @@ -296,9 +295,6 @@ public function getRelatedListDetails($relatedListId)
}
}




public function getLayouts($allLayoutDetails)
{
$layoutArray = array();
Expand Down
13 changes: 13 additions & 0 deletions src/crm/api/handler/OrganizationAPIHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -109,6 +111,7 @@ public function deleteNotes($noteIds){
throw $exception;
}
}

public function getOrganizationDetails()
{
try {
Expand Down Expand Up @@ -147,6 +150,7 @@ public function getOrganizationTaxes()
throw $exception;
}
}

public function getOrganizationTax($orgTaxId)
{
try {
Expand All @@ -163,6 +167,7 @@ public function getOrganizationTax($orgTaxId)
throw $exception;
}
}

public function createOrganizationTaxes($orgTaxInstances)
{
if (sizeof($orgTaxInstances) > 100) {
Expand Down Expand Up @@ -192,6 +197,7 @@ public function createOrganizationTaxes($orgTaxInstances)
throw $exception;
}
}

public function updateOrganizationTaxes($orgTaxInstances)
{
if (sizeof($orgTaxInstances) > 100) {
Expand Down Expand Up @@ -220,6 +226,7 @@ public function updateOrganizationTaxes($orgTaxInstances)
throw $exception;
}
}

public function deleteOrganizationTax($orgTaxId)
{
try {
Expand All @@ -233,6 +240,7 @@ public function deleteOrganizationTax($orgTaxId)
throw $exception;
}
}

public function deleteOrganizationTaxes($orgTaxIds)
{
if (sizeof($orgTaxIds) > 100) {
Expand All @@ -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']);
Expand Down Expand Up @@ -401,6 +410,7 @@ public function deleteUser($userId)
throw $exception;
}
}

public function constructJSONForZCRMOrgTax($orgTaxInstance)
{
$orgTaxJson = array();
Expand All @@ -420,6 +430,7 @@ public function constructJSONForZCRMOrgTax($orgTaxInstance)

return $orgTaxJson;
}

public function constructJSONForUser($userInstanceArray)
{
$userArray = array();
Expand Down Expand Up @@ -658,6 +669,7 @@ public function getUsers($param_map,$header_map,$type)
throw $exception;
}
}

public function searchUsersByCriteria($criteria,$param_map)
{
try {
Expand All @@ -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');
Expand Down
2 changes: 2 additions & 0 deletions src/crm/api/handler/RelatedListAPIHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -152,6 +153,7 @@ public function addNotes($noteInstances){
throw $exception;
}
}

public function addNote($zcrmNote)
{
try {
Expand Down
4 changes: 2 additions & 2 deletions src/crm/api/handler/TagAPIHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -464,7 +464,7 @@ public function setTagProperties($tagInstance, $tagDetails)
}
}

function getZCRMTagAsJSON($tag)
public function getZCRMTagAsJSON($tag)
{
$recordJSON = array();
if ($tag->getName() != null)
Expand Down
9 changes: 9 additions & 0 deletions src/crm/api/handler/VariableAPIHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function getVariables()
throw $exception;
}
}

private function getVariablesResAsObj($jsonData,$entityInstance)
{
foreach($jsonData as $key=>$value)
Expand Down Expand Up @@ -80,6 +81,7 @@ private function getVariablesResAsObj($jsonData,$entityInstance)
}
}
}

public function getVariable($group)
{
try{
Expand All @@ -106,6 +108,7 @@ public function getVariable($group)
throw $exception;
}
}

private function getVariableResAsObj($jsonData,$entityInstance)
{
foreach($jsonData as $key=>$value)
Expand Down Expand Up @@ -144,6 +147,7 @@ private function getVariableResAsObj($jsonData,$entityInstance)
}
}
}

public function createVariables($variable)
{
try{
Expand All @@ -169,6 +173,7 @@ public function createVariables($variable)
throw $exception;
}
}

private function convertObjectToJson($entityInstance)
{
$variablesJson=array();
Expand Down Expand Up @@ -212,6 +217,7 @@ private function convertObjectToJson($entityInstance)
}
return $variablesJson;
}

public function updateVariables($variable)
{
try{
Expand All @@ -237,6 +243,7 @@ public function updateVariables($variable)
throw $exception;
}
}

public function updateVariable()
{
try{
Expand All @@ -260,6 +267,7 @@ public function updateVariable()
throw $exception;
}
}

public function deleteVariable()
{
try{
Expand All @@ -283,6 +291,7 @@ public function deleteVariable()
throw $exception;
}
}

public function setVariables($variables)
{
$this->variables=$variables;
Expand Down
5 changes: 5 additions & 0 deletions src/crm/api/handler/VariableGroupAPIHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public static function getInstance()
{
return new VariableGroupAPIHandler();
}

public function getVariableGroups()
{
try{
Expand All @@ -41,6 +42,7 @@ public function getVariableGroups()
throw $exception;
}
}

private function getVariableGroupsResAsObj($jsonData,$entityInstance)
{
foreach($jsonData as $key=>$value)
Expand Down Expand Up @@ -68,6 +70,7 @@ private function getVariableGroupsResAsObj($jsonData,$entityInstance)
}
}
}

public function getVariableGroup()
{
try{
Expand All @@ -90,6 +93,7 @@ public function getVariableGroup()
throw $exception;
}
}

private function getVariableGroupResAsObj($jsonData,$entityInstance)
{
foreach($jsonData as $key=>$value)
Expand Down Expand Up @@ -117,6 +121,7 @@ private function getVariableGroupResAsObj($jsonData,$entityInstance)
}
}
}

public function setVariableGroups($variable_groups)
{
$this->variable_groups=$variable_groups;
Expand Down
2 changes: 1 addition & 1 deletion src/crm/bulkapi/handler/BulkWriteAPIHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 2 additions & 0 deletions src/oauth/ZohoOAuthClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ private function __construct($params)
{
$this->zohoOAuthParams = $params;
}

public static function getInstance($params)
{
self::$zohoOAuthClient = new ZohoOAuthClient($params);
Expand Down Expand Up @@ -76,6 +77,7 @@ public function generateAccessTokenFromRefreshToken($refreshToken, $userEmailId)
{
self::refreshAccessToken($refreshToken, $userEmailId);
}

public function refreshAccessToken($refreshToken, $userEmailId)
{

Expand Down

0 comments on commit b92c7ef

Please sign in to comment.