Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions bitwpfi.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,26 @@
* Plugin Name: Bit Integrations
* Plugin URI: https://bitapps.pro/bit-integrations
* Description: Bit Integrations is a platform that integrates with over 200+ different platforms to help with various tasks on your WordPress site, like WooCommerce, Form builder, Page builder, LMS, Sales funnels, Bookings, CRM, Webhooks, Email marketing, Social media and Spreadsheets, etc
* Version: 2.0.1
* Version: 2.0.2
* Author: Automation & Integration Plugin - Bit Apps
* Author URI: https://bitapps.pro
* Text Domain: bit-integrations
* Requires PHP: 7.0
* Requires at least: 5.1
* Tested up to: 6.4.3
* Tested up to: 6.5.3
* Domain Path: /languages
* License: gpl2+
* License: GPLv2 or later
*/

/***
* If try to direct access plugin folder it will Exit
**/
// If try to direct access plugin folder it will Exit
if (!defined('ABSPATH')) {
exit;
}
global $btcbi_db_version;
$btcbi_db_version = '1.0';

// Define most essential constants.
define('BTCBI_VERSION', '2.0.1');
define('BTCBI_VERSION', '2.0.2');
define('BTCBI_PLUGIN_MAIN_FILE', __FILE__);

require_once plugin_dir_path(__FILE__) . 'includes/loader.php';
Expand All @@ -38,9 +36,9 @@ function btcbi_activate_plugin($network_wide)
esc_html__('Error Activating', 'bit-integrations')
);
}
if (version_compare(PHP_VERSION, '5.6.0', '<')) {
if (version_compare(PHP_VERSION, '7.0', '<')) {
wp_die(
esc_html__('Forms Integrationsw requires PHP version 5.6.', 'bit-integrations'),
esc_html__('Forms Integrationsw requires PHP version 7.0.', 'bit-integrations'),
esc_html__('Error Activating', 'bit-integrations')
);
}
Expand Down
3 changes: 2 additions & 1 deletion frontend-dev/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ function App() {
<a
target="_blank"
href="https://wordpress.org/plugins/bit-integrations/#reviews"
className="app-link"
className="app-link green blink"
rel="noreferrer"
>
{/* <marquee behavior="scroll" direction="up"></marquee> */}
{__('Review us', 'bit-integrations')}
</a>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,9 @@ import TableCheckBox from '../../Utilities/TableCheckBox'
import 'react-multiple-select-dropdown-lite/dist/index.css'
import Loader from '../../Loaders/Loader'

export default function ClickupActions({ clickupConf, setClickupConf, loading, setLoading }) {
export default function ClickupActions({ clickupConf, setClickupConf, formFields, loading, setLoading }) {
const [actionMdl, setActionMdl] = useState({ show: false, action: () => { } })

const followUps = [
{ label: 'Yes', value: 'yes' },
{ label: 'No', value: 'no' },
]

const taskTypes = [
{ label: 'New Business', value: 'New Business' },
{ label: 'Existing Business', value: 'Existing Business' },
]

const actionHandler = (e, type) => {
const newConf = { ...clickupConf }

if (type === 'tag') {
if (e.target?.checked) {
getAllTags(clickupConf, setClickupConf, setLoading)
newConf.actions.tag = true
} else {
setActionMdl({ show: false })
delete newConf.actions.tag
}
}

setActionMdl({ show: type })
setClickupConf({ ...newConf })
}

const clsActionMdl = () => {
setActionMdl({ show: false })
}
Expand All @@ -51,50 +24,27 @@ export default function ClickupActions({ clickupConf, setClickupConf, loading, s

return (
<div className="pos-rel d-flx flx-wrp">
{(clickupConf.actionName === 'task') && <TableCheckBox checked={clickupConf?.selectedTag?.length || false} onChange={(e) => actionHandler(e, 'tag')} className="wdt-200 mt-4 mr-2" value="tag" title={__('Add Tag', 'bit - integrations')} subTitle={__('Add an tag')} />}
{/* {(clickupConf.actionName === 'deal') && <TableCheckBox checked={clickupConf?.selectedTeam?.length || false} onChange={(e) => actionHandler(e, 'team')} className="wdt-200 mt-4 mr-2" value="team" title={__('Add Team', 'bit - integrations')} subTitle={__('Add an team')} />} */}
{/* {(clickupConf.actionName === 'task') && <TableCheckBox checked={clickupConf?.selectedCurrency?.length || false} onChange={(e) => actionHandler(e, 'currency')} className="wdt-200 mt-4 mr-2" value="currency" title={__('Add Currency', 'bit - integrations')} subTitle={__('Add a currency')} />} */}
{/* {(clickupConf.actionName === 'deal') && <TableCheckBox checked={clickupConf?.selectedStage?.length || false} onChange={(e) => actionHandler(e, 'stage')} className="wdt-200 mt-4 mr-2" value="stage" title={__('Add Stage', 'bit - integrations')} subTitle={__('Add a stage')} />} */}
{<TableCheckBox checked={clickupConf?.attachment || false} onChange={() => setActionMdl({ show: 'attachment' })} className="wdt-200 mt-4 mr-2" value="attachment" title={__('Add Attachment', 'bit - integrations')} subTitle={__('Add attachment in the task')} />}

<ConfirmModal
className="custom-conf-mdl"
mainMdlCls="o-v"
btnClass="blue"
btnTxt={__('Ok', 'bit-integrations')}
show={actionMdl.show === 'tag'}
show={actionMdl.show === 'attachment'}
close={clsActionMdl}
action={clsActionMdl}
title={__('Tags', 'bit-integrations')}
title={__('Select file upload field', 'bit-integrations')}
>
<div className="btcd-hr mt-2 mb-2" />
<div className="mt-2">
{__('Select Tag', 'bit-integrations')}
</div>

{
loading.tags ? (
<Loader style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
height: 45,
transform: 'scale(0.5)',
}}
/>
)
: (
<div className="flx flx-between mt-2">
<MultiSelect
options={clickupConf?.tags?.map(tag => ({ label: tag.name, value: tag.id }))}
className="msl-wrp-options"
defaultValue={clickupConf?.selectedTag}
onChange={val => setChanges(val, 'selectedTag')}
singleSelect
/>
<button onClick={() => getAllTags(clickupConf, setClickupConf, setLoading)} className="icn-btn sh-sm ml-2 mr-2 tooltip" style={{ '--tooltip-txt': `${__('Refresh Tags', 'bit-integrations')}'` }} type="button">&#x21BB;</button>
</div>
)
}
<div className="btcd-hr mt-2" />
<div className="mt-2">{__('Select file upload field', 'bit-integrations')}</div>
<MultiSelect
defaultValue={clickupConf?.attachment}
className="mt-2 w-9"
onChange={(val) => setChanges(val, 'attachment')}
options={formFields.filter(itm => (itm.type === 'file')).map(itm => ({ label: itm.label, value: itm.name }))}
closeOnSelect
/>
</ConfirmModal>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ export const getCustomFields = (confTmp, setConf, setLoading) => {

bitsFetch(requestParams, "clickup_fetch_custom_fields").then((result) => {
if (result && result.success) {
// const newConf = { ...confTmp };
// if (result.data) {
// newConf.customFields = result.data;
// }
// setConf(newConf);
setConf((oldConf) => {
const newConf = { ...oldConf };
if (!newConf.default) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,15 @@ export default function ClickupIntegLayout({ formFields, handleInput, clickupCon
<div className="txt-center btcbi-field-map-button mt-2"><button onClick={() => addFieldMap(clickupConf.field_map.length, clickupConf, setClickupConf, false)} className="icn-btn sh-sm" type="button">+</button></div>
<br />
<br />
{/* <div className="mt-4"><b className="wdt-100">{__('Actions', 'bit-integrations')}</b></div>
<div className="mt-4"><b className="wdt-100">{__('Actions', 'bit-integrations')}</b></div>
<div className="btcd-hr mt-1" />
<ClickupActions
clickupConf={clickupConf}
setClickupConf={setClickupConf}
formFields={formFields}
loading={loading}
setLoading={setLoading}
/> */}
/>
</div>
)}
</>
Expand Down
30 changes: 18 additions & 12 deletions frontend-dev/src/components/AllIntegrations/EditFormInteg.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { getAllThriveApprenticeCourse, getAllThriveApprenticeLesson, getAllThriv
import { getAllUMrole } from '../Triggers/TriggerHelpers/UltimateMemberHelper/UltimatedMemberCommonFunction'
import { getAllGroundhoggTags } from '../Triggers/TriggerHelpers/GroundhoggHelper/GroundhoggCommonFunction'
import { create } from 'mutative'
import { getFluentBookingEvents } from '../Triggers/TriggerHelpers/FluentBookingHelper/FluentBookingCommonFunction.js'

function EditFormInteg({ setSnackbar, className = '' }) {
const [forms, setForms] = useState([])
Expand All @@ -43,7 +44,7 @@ function EditFormInteg({ setSnackbar, className = '' }) {
draftFlow.flow_details[type] = val
}))
}
// console.log(flow.flow_details)

const handle = (e) => {
const tmpInteg = { ...flow }
const { name, value } = e.target
Expand All @@ -62,17 +63,19 @@ function EditFormInteg({ setSnackbar, className = '' }) {
baseDataLoad(flow.triggered_entity, tmpInteg)
}

const loadFormFields = bitsFetch(queryData, `${flow.triggered_entity.toLowerCase()}/get/form`).then((res) => {
if (res.success) {
setFormFields(res.data.fields)
}
return res.data
})
toast.promise(loadFormFields, {
success: __('Form fields Refresh successfully', 'bit-integrations'),
error: __('Error Occurred', 'bit-integrations'),
loading: __('Loading Form Fields...'),
})
if (flow.triggered_entity !== 'FluentBooking') {
const loadFormFields = bitsFetch(queryData, `${flow.triggered_entity.toLowerCase()}/get/form`).then((res) => {
if (res.success) {
setFormFields(res.data.fields)
}
return res.data
})
toast.promise(loadFormFields, {
success: __('Form fields Refresh successfully', 'bit-integrations'),
error: __('Error Occurred', 'bit-integrations'),
loading: __('Loading Form Fields...'),
})
}
}

const baseDataLoad = (trigger, data) => {
Expand Down Expand Up @@ -236,6 +239,9 @@ function EditFormInteg({ setSnackbar, className = '' }) {
getAllUMrole(data, setFlow)
}
}
if (trigger = 'fluentBooking') {
getFluentBookingEvents(data, setFlow)
}
}

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
UltimateMemberStateIH,
affiliateStateIH,
buddybossStateIH,
fluentBookingStateIH,
fluentCrmStateIH,
groundhoggStateIH,
jetEngineStateIH,
Expand Down Expand Up @@ -82,6 +83,9 @@ export const saveIntegConfig = async (
} else if (flow.triggered_entity === "TutorLms") {
const dataFlow = edit ? flow?.flow_details : flow?.triggerData;
tmpConf = tutorlmsStateIH(tmpConf, dataFlow);
} else if (flow.triggered_entity === "FluentBooking") {
const dataFlow = edit ? flow?.flow_details : flow?.triggerData;
tmpConf = fluentBookingStateIH(tmpConf, dataFlow, flow.triggered_entity_id);
} else if (flow.triggered_entity === "WC") {
const dataFlow = edit ? flow?.flow_details : flow?.triggerData;
tmpConf = wooCommerceStateIH(tmpConf, dataFlow);
Expand Down Expand Up @@ -247,6 +251,9 @@ export const saveActionConf = async ({
} else if (flow.triggered_entity === "TutorLms") {
const dataFlow = edit ? flow?.flow_details : flow?.triggerData;
tmpConf = tutorlmsStateIH(tmpConf, dataFlow);
} else if (flow.triggered_entity === "FluentBooking") {
const dataFlow = edit ? flow?.flow_details : flow?.triggerData;
tmpConf = fluentBookingStateIH(tmpConf, dataFlow, flow.triggered_entity_id);
} else if (flow.triggered_entity === "WC") {
const dataFlow = edit ? flow?.flow_details : flow?.triggerData;
tmpConf = wooCommerceStateIH(tmpConf, dataFlow);
Expand Down Expand Up @@ -428,13 +435,11 @@ export const handleAuthorize = (
return;
}
setIsLoading(true);
const apiEndpoint = `https://accounts.zoho.${
confTmp.dataCenter
}/oauth/v2/auth?scope=${scopes}&response_type=code&client_id=${
confTmp.clientId
}&prompt=Consent&access_type=offline&state=${encodeURIComponent(
window.location.href
)}/redirect&redirect_uri=${encodeURIComponent(`${btcbi.api.base}`)}/redirect`;
const apiEndpoint = `https://accounts.zoho.${confTmp.dataCenter
}/oauth/v2/auth?scope=${scopes}&response_type=code&client_id=${confTmp.clientId
}&prompt=Consent&access_type=offline&state=${encodeURIComponent(
window.location.href
)}/redirect&redirect_uri=${encodeURIComponent(`${btcbi.api.base}`)}/redirect`;
const authWindow = window.open(
apiEndpoint,
integ,
Expand Down Expand Up @@ -521,9 +526,8 @@ const tokenHelper = (
) {
setSnackbar({
show: true,
msg: `${__("Authorization failed Cause:", "bit-integrations")}${
result.data.data || result.data
}. ${__("please try again", "bit-integrations")}`,
msg: `${__("Authorization failed Cause:", "bit-integrations")}${result.data.data || result.data
}. ${__("please try again", "bit-integrations")}`,
});
} else {
setSnackbar({
Expand Down
2 changes: 1 addition & 1 deletion frontend-dev/src/components/Flow/New/SelectTrigger.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default function SelectTrigger() {
>
{(allTriggers?.data[inte]?.isPro && !isPro) && (
<div className="pro-filter">
<span className="txt-pro"><a href="https://bitapps.pro/bit-integrations" target="_blank" rel="noreferrer">{__('Premium', 'bit-integrations')}</a></span>
<span className="txt-pro"><a href="https://bitapps.pro/bit-integrations" target="_blank" rel="noreferrer">{__('Pro', 'bit-integrations')}</a></span>
</div>
)}
<GetLogo name={inte} extension="webp" />
Expand Down
19 changes: 13 additions & 6 deletions frontend-dev/src/components/Triggers/ActionHook.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,20 @@ const ActionHook = () => {
}
}

const info = `<h4>Setup Action Hook</h4>
<a className="btcd-link" href="https://bitapps.pro/docs/bit-integrations/trigger-hooks" target="_blank" rel="noreferrer">${__('Bit Integrations Trigger Hooks', 'bit-integrations')}</a>
<br />
<a className="btcd-link" href="https://bitapps.pro/docs/bit-integrations/trigger/action-hook-integrations" target="_blank" rel="noreferrer">${__('Details on Documentation', 'bit-integrations')}</a>
const info = `<h4>Please follow the simple steps below to setup Action Hook</h4>
<ul>
<li>Click on the <b>Fetch</b> button & Submit your <b>Form</b> to get the form data</li>
</ul>`
<li>Click <b>Fetch</b></li>
<li>Submit <b>Integrable Form</b></li>
<li>Click <b>Next</b> and <b>Go</b></b></li>
</ul>
<h5>
<a className="btcd-link" href="https://bitapps.pro/docs/bit-integrations/trigger-hooks" target="_blank" rel="noreferrer">${__('Bit Integrations Trigger Hooks', 'bit-integrations')}</a>
<br />
More Details on
<a className="btcd-link" href="https://bitapps.pro/docs/bit-integrations/trigger/action-hook-integrations" target="_blank" rel="noreferrer">${__('Documentation', 'bit-integrations')}</a>
or
<a className="btcd-link" href="#" target="_blank" rel="noreferrer">${__('Youtube Tutorials', 'bit-integrations')}</a>
</h5>`

return (
<div className="trigger-custom-width">
Expand Down
15 changes: 11 additions & 4 deletions frontend-dev/src/components/Triggers/CustomFormSubmission.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,18 @@ const CustomFormSubmission = () => {
}
}, [])

const info = `<h4>Setup ${newFlow?.triggerDetail?.name}</h4>
<a className="btcd-link" href=${newFlow?.triggerDetail?.documentation_url} target="_blank" rel="noreferrer">${__('More Details on Documentation', 'bit-integrations')}</a>
const info = `<h4>Please follow the simple steps below to setup ${newFlow?.triggerDetail?.name}</h4>
<ul>
<li>Click on the <b>Fetch</b> button then Submit your <b>Form</b> to get the form data</li>
</ul>`
<li>Click <b>Fetch</b></li>
<li>Submit <b>The Form</b></li>
<li>Click <b>Next</b> and <b>Go</b></b></li>
</ul>
<h5>
More Details on
<a className="btcd-link" href=${newFlow?.triggerDetail?.documentation_url} target="_blank" rel="noreferrer">${__('Documentation', 'bit-integrations')}</a>
or
<a className="btcd-link" href=${newFlow?.triggerDetail?.tutorial_url} target="_blank" rel="noreferrer">${__('Youtube Tutorials', 'bit-integrations')}</a>
</h5>`

return (
<div className="trigger-custom-width">
Expand Down
Loading