From 26c455074b142f01c39967246542acfeb63042b9 Mon Sep 17 00:00:00 2001 From: Rishad Alam <101513331+RishadAlam@users.noreply.github.com> Date: Sat, 26 Jul 2025 15:22:55 +0600 Subject: [PATCH 01/11] fix: zoho crm task module fetching issue fixed --- includes/Actions/ZohoCRM/RecordApiHelper.php | 9 +++--- .../Actions/ZohoCRM/ZohoCRMController.php | 31 ++++++++++++++++--- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/includes/Actions/ZohoCRM/RecordApiHelper.php b/includes/Actions/ZohoCRM/RecordApiHelper.php index 61abc42a7..d410abaf0 100644 --- a/includes/Actions/ZohoCRM/RecordApiHelper.php +++ b/includes/Actions/ZohoCRM/RecordApiHelper.php @@ -6,12 +6,12 @@ namespace BitCode\FI\Actions\ZohoCRM; -use stdClass; -use WP_Error; -use BitCode\FI\Log\LogHandler; use BitCode\FI\Core\Util\Common; -use BitCode\FI\Core\Util\HttpHelper; use BitCode\FI\Core\Util\DateTimeHelper; +use BitCode\FI\Core\Util\HttpHelper; +use BitCode\FI\Log\LogHandler; +use stdClass; +use WP_Error; /** * Provide functionality for Record insert,upsert @@ -182,6 +182,7 @@ public function execute($integId, $defaultConf, $module, $layout, $fieldValues, } else { $recordApiResponse = $this->insertRecord($module, (object) $requestParams); } + if ((isset($recordApiResponse->status) && $recordApiResponse->status === 'error') || (isset($recordApiResponse->data[0]->status) && $recordApiResponse->data[0]->status === 'error') diff --git a/includes/Actions/ZohoCRM/ZohoCRMController.php b/includes/Actions/ZohoCRM/ZohoCRMController.php index 19f0792da..58cf92d86 100644 --- a/includes/Actions/ZohoCRM/ZohoCRMController.php +++ b/includes/Actions/ZohoCRM/ZohoCRMController.php @@ -6,11 +6,11 @@ namespace BitCode\FI\Actions\ZohoCRM; +use BitCode\FI\Core\Util\HttpHelper; +use BitCode\FI\Flow\FlowController; +use BitCode\FI\Log\LogHandler; use stdClass; use WP_Error; -use BitCode\FI\Log\LogHandler; -use BitCode\FI\Flow\FlowController; -use BitCode\FI\Core\Util\HttpHelper; /** * Provide functionality for ZohoCrm integration @@ -114,14 +114,35 @@ public static function refreshModulesAjaxHelper($queryParams) $authorizationHeader['Authorization'] = "Zoho-oauthtoken {$queryParams->tokenDetails->access_token}"; $modulesMetaResponse = HttpHelper::get($modulesMetaApiEndpoint, null, $authorizationHeader); - if (!is_wp_error($modulesMetaResponse) && (empty($modulesMetaResponse->status) || (!empty($modulesMetaResponse->status) && $modulesMetaResponse->status !== 'error'))) { + + if ( + !is_wp_error($modulesMetaResponse) + && ( + empty($modulesMetaResponse->status) + || ( + !empty($modulesMetaResponse->status) + && $modulesMetaResponse->status !== 'error' + ) + ) + ) { $retriveModuleData = $modulesMetaResponse->modules; $allModules = []; foreach ($retriveModuleData as $key => $value) { - if ((!empty($value->inventory_template_supported) && $value->inventory_template_supported) || \in_array($value->api_name, $zohosIntegratedModules) || \count((array) $value->parent_module) > 0) { + if ( + ( + !empty($value->inventory_template_supported) + && $value->inventory_template_supported + ) + || \in_array($value->api_name, $zohosIntegratedModules) + || ( + \count((array) $value->parent_module) > 0 + && $value->module_name !== 'Tasks' + ) + ) { continue; } + if (!empty($value->api_supported) && $value->api_supported && !empty($value->editable) && $value->editable) { $allModules[$value->api_name] = (object) [ 'plural_label' => $value->plural_label, From a0554691888b199f4ac67afbcdfa8e85a4a73bda Mon Sep 17 00:00:00 2001 From: Rishad Alam <101513331+RishadAlam@users.noreply.github.com> Date: Sat, 2 Aug 2025 16:47:45 +0600 Subject: [PATCH 02/11] feat: wp travel engine trigger added --- .../src/resource/img/integ/wPTravelEngine.webp | Bin 0 -> 5130 bytes includes/Core/Util/AllTriggersName.php | 1 + 2 files changed, 1 insertion(+) create mode 100644 frontend-dev/src/resource/img/integ/wPTravelEngine.webp diff --git a/frontend-dev/src/resource/img/integ/wPTravelEngine.webp b/frontend-dev/src/resource/img/integ/wPTravelEngine.webp new file mode 100644 index 0000000000000000000000000000000000000000..c3436939b0eb34cf900271f0a745ce4f65154f7e GIT binary patch literal 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+|Ehu4PfUU)HK2@DE(`deCz zh#XJdZNZScloH=S6A(x4UU@Ikb+hQEyoY-zyqa9L92)hg;8*A{tq2u{PiFPF0fAs7 zm$TFKi>|0Q6cLn$qumZdvkO00;2o+K!bpguCgeSAq2cYZLT4A**6VVc$vi6bTVha; zKbCY<#pK%SLb}x?K%MH8X@XBh?1+l=LaNkdb1(CbPIK1f$_(z>Ixt47p^jcSIVH8& z34i7K(>a+~8oxXU<0@hIr3!jhU+ zh~Cnw?hNGYq%78%k7Icz$|&EnDPEJ0<~yb zx_0BM@1JDufB!L&Oz4~Ka_&O5#mgo^Os-zv0!v3Gj0T)u>)~O3)yMxZ6OxbbHkvZK zx_;L}g ['name' => 'WPSubscription', 'isPro' => true, 'is_active' => false], 'WpPolls' => ['name' => 'WP-Polls', 'isPro' => true, 'is_active' => false], 'WpSimplePay' => ['name' => 'WP Simple Pay', 'isPro' => true, 'is_active' => false], + 'WPTravelEngine' => ['name' => 'WP Travel Engine', 'isPro' => true, 'is_active' => false], ]; } } From 15d0f66454de189afb6110482e2a437c89c38e28 Mon Sep 17 00:00:00 2001 From: Rishad Alam <101513331+RishadAlam@users.noreply.github.com> Date: Mon, 4 Aug 2025 11:10:36 +0600 Subject: [PATCH 03/11] refactor: zoho crm tasks module utilities --- .../ZohoCRM/ZohoCRMActions.jsx | 244 ++++++++---------- 1 file changed, 113 insertions(+), 131 deletions(-) diff --git a/frontend-dev/src/components/AllIntegrations/ZohoCRM/ZohoCRMActions.jsx b/frontend-dev/src/components/AllIntegrations/ZohoCRM/ZohoCRMActions.jsx index 56f7de155..d976d2c25 100644 --- a/frontend-dev/src/components/AllIntegrations/ZohoCRM/ZohoCRMActions.jsx +++ b/frontend-dev/src/components/AllIntegrations/ZohoCRM/ZohoCRMActions.jsx @@ -14,14 +14,7 @@ import Modal from '../../Utilities/Modal' import TitleModal from '../../Utilities/TitleModal' import { refreshAssigmentRules, refreshOwners, refreshTags } from './ZohoCRMCommonFunc' -export default function ZohoCRMActions({ - crmConf, - setCrmConf, - formFields, - tab, - formID, - setSnackbar -}) { +export default function ZohoCRMActions({ crmConf, setCrmConf, formFields, tab, formID, setSnackbar }) { const [upsertMdl, setUpsertMdl] = useState(false) const [isLoading, setIsLoading] = useState(false) const [actionMdl, setActionMdl] = useState({ show: false, action: () => {} }) @@ -181,13 +174,13 @@ export default function ZohoCRMActions({ ] if (crmConf.default.tags?.[module]) { - arr[0].childs = Object.values(crmConf.default.tags?.[module]).map((tagName) => ({ + arr[0].childs = Object.values(crmConf.default.tags?.[module]).map(tagName => ({ label: tagName, value: tagName })) } - arr[1].childs = formFields.map((itm) => ({ label: itm.label, value: `\${${itm.name}}` })) + arr[1].childs = formFields.map(itm => ({ label: itm.label, value: `\${${itm.name}}` })) return arr } @@ -248,100 +241,21 @@ export default function ZohoCRMActions({
actionHandler(e, 'workflow')} - checked={ - tab === 0 - ? 'workflow' in crmConf.actions - : 'workflow' in crmConf.relatedlists[tab - 1].actions - } - className="wdt-200 mt-4 mr-2" - value="Workflow" - title={__('Workflow', 'bit-integrations')} - subTitle={__('Trigger CRM workflows', 'bit-integrations')} - /> - setActionMdl({ show: 'attachment' })} - checked={ - tab === 0 - ? 'attachment' in crmConf.actions - : 'attachment' in crmConf.relatedlists[tab - 1].actions - } - className="wdt-200 mt-4 mr-2" - value="Attachment" - title={__('Attachment', 'bit-integrations')} - subTitle={__('Add attachments or signatures from Trigger to CRM', 'bit-integrations')} - /> - actionHandler(e, 'approval')} - checked={ - tab === 0 - ? 'approval' in crmConf.actions - : 'approval' in crmConf.relatedlists[tab - 1].actions - } - className="wdt-200 mt-4 mr-2" - value="Approval" - title={__('Approval', 'bit-integrations')} - subTitle={__('Send entries to CRM approval list', 'bit-integrations')} - /> - actionHandler(e, 'blueprint')} - checked={ - tab === 0 - ? 'blueprint' in crmConf.actions - : 'blueprint' in crmConf.relatedlists[tab - 1].actions - } - className="wdt-200 mt-4 mr-2" - value="Blueprint" - title={__('Blueprint', 'bit-integrations')} - subTitle={__('Trigger CRM Blueprint', 'bit-integrations')} - /> - actionHandler(e, 'gclid')} - checked={ - tab === 0 - ? 'gclid' in crmConf.actions - : 'gclid' in crmConf.relatedlists[tab - 1].actions - } - className="wdt-200 mt-4 mr-2" - value="Capture_GCLID" - title={__('Capture GCLID', 'bit-integrations')} - subTitle={__('Sends the click details of AdWords Ads to Zoho CRM', 'bit-integrations')} - /> - - actionHandler(e, 'upsert')} - checked={ - tab === 0 - ? 'upsert' in crmConf.actions - : 'upsert' in crmConf.relatedlists[tab - 1].actions - } - className="wdt-200 mt-4 mr-2" - value="Upsert_Record" - title={__('Upsert Records', 'bit-integrations')} - subTitle={__( - 'The record is updated if it already exists else it is inserted as a new record', - 'bit-integrations' - )} - /> - - setActionMdl({ show: 'tag_rec' })} checked={ - tab === 0 - ? 'tag_rec' in crmConf.actions - : 'tag_rec' in crmConf.relatedlists[tab - 1].actions + tab === 0 ? 'tag_rec' in crmConf.actions : 'tag_rec' in crmConf.relatedlists[tab - 1].actions } className="wdt-200 mt-4 mr-2" value="Tag_Records" @@ -349,17 +263,97 @@ export default function ZohoCRMActions({ subTitle={__('Add a tag to records pushed to Zoho CRM', 'bit-integrations')} /> setActionMdl({ show: 'attachment' })} checked={ tab === 0 - ? 'rec_owner' in crmConf.actions - : 'rec_owner' in crmConf.relatedlists[tab - 1].actions + ? 'attachment' in crmConf.actions + : 'attachment' in crmConf.relatedlists[tab - 1].actions } className="wdt-200 mt-4 mr-2" - value="Record_Owner" - title={__('Record Owner', 'bit-integrations')} - subTitle={__('Add a owner to records pushed to Zoho CRM', 'bit-integrations')} + value="Attachment" + title={__('Attachment', 'bit-integrations')} + subTitle={__('Add attachments or signatures from Trigger to CRM', 'bit-integrations')} /> + + {crmConf.module !== 'Tasks' && ( + <> + actionHandler(e, 'workflow')} + checked={ + tab === 0 + ? 'workflow' in crmConf.actions + : 'workflow' in crmConf.relatedlists[tab - 1].actions + } + className="wdt-200 mt-4 mr-2" + value="Workflow" + title={__('Workflow', 'bit-integrations')} + subTitle={__('Trigger CRM workflows', 'bit-integrations')} + /> + actionHandler(e, 'approval')} + checked={ + tab === 0 + ? 'approval' in crmConf.actions + : 'approval' in crmConf.relatedlists[tab - 1].actions + } + className="wdt-200 mt-4 mr-2" + value="Approval" + title={__('Approval', 'bit-integrations')} + subTitle={__('Send entries to CRM approval list', 'bit-integrations')} + /> + actionHandler(e, 'blueprint')} + checked={ + tab === 0 + ? 'blueprint' in crmConf.actions + : 'blueprint' in crmConf.relatedlists[tab - 1].actions + } + className="wdt-200 mt-4 mr-2" + value="Blueprint" + title={__('Blueprint', 'bit-integrations')} + subTitle={__('Trigger CRM Blueprint', 'bit-integrations')} + /> + actionHandler(e, 'gclid')} + checked={ + tab === 0 ? 'gclid' in crmConf.actions : 'gclid' in crmConf.relatedlists[tab - 1].actions + } + className="wdt-200 mt-4 mr-2" + value="Capture_GCLID" + title={__('Capture GCLID', 'bit-integrations')} + subTitle={__('Sends the click details of AdWords Ads to Zoho CRM', 'bit-integrations')} + /> + + actionHandler(e, 'upsert')} + checked={ + tab === 0 + ? 'upsert' in crmConf.actions + : 'upsert' in crmConf.relatedlists[tab - 1].actions + } + className="wdt-200 mt-4 mr-2" + value="Upsert_Record" + title={__('Upsert Records', 'bit-integrations')} + subTitle={__( + 'The record is updated if it already exists else it is inserted as a new record', + 'bit-integrations' + )} + /> + + + + )}
{__('Select File Upload Fields', 'bit-integrations')}
actionHandler(val, 'attachment')} + onChange={val => actionHandler(val, 'attachment')} options={formFields - .filter((itm) => itm.type === 'file') - .map((itm) => ({ label: itm.label, value: itm.name }))} + .filter(itm => itm.type === 'file') + .map(itm => ({ label: itm.label, value: itm.name }))} /> @@ -417,10 +409,10 @@ export default function ZohoCRMActions({ : crmConf.relatedlists[tab - 1].actions.assignment_rules } className="btcd-paper-inp" - onChange={(e) => actionHandler(e.target.value, 'assignment_rules')}> + onChange={e => actionHandler(e.target.value, 'assignment_rules')}> {crmConf?.default?.assignmentRules?.[module] && - Object.keys(crmConf.default.assignmentRules[module]).map((assignmentName) => ( + Object.keys(crmConf.default.assignmentRules[module]).map(assignmentName => (