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
6 changes: 2 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ jobs:
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
${{ runner.os }}-node-

- name: Install dependencies
run: npm ci
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ jobs:
steps:
- uses: actions/checkout@v5

- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-

- name: Composer install
run: composer -q install

Expand All @@ -35,17 +43,21 @@ jobs:
with:
submodules: true

- name: Cache composer
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('composer.lock') }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-

- name: Cache plugins
- name: Cache test plugins
uses: actions/cache@v4
with:
path: /tmp/*.zip
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('bin/download-test-deps.sh') }}
key: ${{ runner.os }}-test-plugins-${{ hashFiles('bin/download-test-deps.sh') }}
restore-keys: |
${{ runner.os }}-test-plugins-

- name: Composer install
run: composer -q install
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Forms Bridge has the following addons:
- [Rocket.Chat](https://formsbridge.codeccoop.org/documentation/rocket-chat/)
- [Slack](https://formsbridge.codeccoop.org/documentation/slack/)
- [SuiteCRM](https://formsbridge.codeccoop.org/documentation/suitecrm/)
- [Vtiger](https://formsbridge.codeccoop.org/documentation/vtiger/)
- [Zoho CRM](https://formsbridge.codeccoop.org/documentation/zoho-crm/)
- [Zulip](https://formsbridge.codeccoop.org/documentation/zulip/)

Expand Down
7 changes: 1 addition & 6 deletions forms-bridge/addons/suitecrm/class-suitecrm-addon.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,7 @@ public function fetch( $endpoint, $backend ) {
)
);

return $bridge->submit(
array(
'select_fields' => array( 'id', 'name' ),
'max_results' => 100,
)
);
return $bridge->submit( array( 'max_results' => 100 ) );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ public function submit( $payload = array(), $attachments = array() ) {
add_filter(
'http_bridge_request',
static function ( $request ) {
unset( $request['args']['headers']['Authorization'] );
self::$request = $request;
return $request;
},
Expand Down
4 changes: 2 additions & 2 deletions forms-bridge/addons/suitecrm/jobs/contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@
/**
* Creates a new contact and add its ID to the payload.
*
* @param array $payload Bridge payload.
* @param Form_Bridge $bridge Bridge object.
* @param array $payload Bridge payload.
* @param SuiteCRM_Form_Bridge $bridge Bridge object.
*
* @return array
*/
Expand Down
106 changes: 90 additions & 16 deletions forms-bridge/addons/suitecrm/templates/accounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
return array(
'title' => __( 'Accounts', 'forms-bridge' ),
'description' => __(
'Account bridge template. The resulting bridge will convert form submissions into SuiteCRM accounts (companies/organizations).',
'Account form bridge template. The resulting bridge will convert form submissions into SuiteCRM accounts (companies/organizations).',
'forms-bridge'
),
'fields' => array(
Expand All @@ -27,15 +27,11 @@
'value' => 'Contacts',
),
array(
'ref' => '#bridge/custom_fields[]',
'name' => 'assigned_user_id',
'label' => __( 'Assigned User', 'forms-bridge' ),
'description' => __(
'User to assign the account to',
'forms-bridge'
),
'type' => 'select',
'options' => array(
'ref' => '#bridge/custom_fields[]',
'name' => 'assigned_user_id',
'label' => __( 'Assigned User', 'forms-bridge' ),
'type' => 'select',
'options' => array(
'endpoint' => 'Users',
'finger' => array(
'value' => 'entry_list[].id',
Expand Down Expand Up @@ -146,6 +142,10 @@
'value' => 'Entertainment',
'label' => __( 'Entertainment', 'forms-bridge' ),
),
array(
'value' => 'Environmental',
'label' => __( 'Environmental', 'forms-bridge' ),
),
array(
'value' => 'Finance',
'label' => __( 'Finance', 'forms-bridge' ),
Expand All @@ -166,6 +166,10 @@
'value' => 'Insurance',
'label' => __( 'Insurance', 'forms-bridge' ),
),
array(
'value' => 'Machinery',
'label' => __( 'Machinery', 'forms-bridge' ),
),
array(
'value' => 'Manufacturing',
'label' => __( 'Manufacturing', 'forms-bridge' ),
Expand All @@ -174,18 +178,38 @@
'value' => 'Media',
'label' => __( 'Media', 'forms-bridge' ),
),
array(
'value' => 'Not For Profit',
'label' => __( 'Not For Profit', 'forms-bridge' ),
),
array(
'value' => 'Recreation',
'label' => __( 'Recreation', 'forms-bridge' ),
),
array(
'value' => 'Retail',
'label' => __( 'Retail', 'forms-bridge' ),
),
array(
'value' => 'Shipping',
'label' => __( 'Shipping', 'forms-bridge' ),
),
array(
'value' => 'Technology',
'label' => __( 'Technology', 'forms-bridge' ),
),
array(
'value' => 'Telecomunications',
'label' => __( 'Telecomunications', 'forms-bridge' ),
),
array(
'value' => 'Transportation',
'label' => __( 'Transportation', 'forms-bridge' ),
),
array(
'value' => 'Utilities',
'label' => __( 'Utilities', 'forms-bridge' ),
),
array(
'value' => 'Other',
'label' => __( 'Other', 'forms-bridge' ),
Expand All @@ -206,10 +230,30 @@
'value' => 'Cold Call',
'label' => __( 'Cold Call', 'forms-bridge' ),
),
array(
'value' => 'Existing Customer',
'label' => __( 'Existing Customer', 'forms-bridge' ),
),
array(
'value' => 'Employee',
'label' => __( 'Employee', 'forms-bridge' ),
),
array(
'value' => 'Partner',
'label' => __( 'Partner', 'forms-bridge' ),
),
array(
'value' => 'Public Relations',
'label' => __( 'Public Relations', 'forms-bridge' ),
),
array(
'value' => 'Email',
'label' => __( 'Email', 'forms-bridge' ),
),
array(
'value' => 'Direct Mail',
'label' => __( 'Direct Mail', 'forms-bridge' ),
),
array(
'value' => 'Word of mouth',
'label' => __( 'Word of Mouth', 'forms-bridge' ),
Expand All @@ -218,6 +262,14 @@
'value' => 'Campaign',
'label' => __( 'Campaign', 'forms-bridge' ),
),
array(
'value' => 'Conference',
'label' => __( 'Conference', 'forms-bridge' ),
),
array(
'value' => 'Trade Show',
'label' => __( 'Trade Show', 'forms-bridge' ),
),
array(
'value' => 'Other',
'label' => __( 'Other', 'forms-bridge' ),
Expand All @@ -227,9 +279,25 @@
),
),
'bridge' => array(
'endpoint' => 'Contacts',
'method' => 'set_entry',
'workflow' => array( 'account', 'skip-contact' ),
'endpoint' => 'Contacts',
'method' => 'set_entry',
'workflow' => array( 'account', 'skip-contact' ),
'mutations' => array(
array(
array(
'from' => 'email1',
'to' => 'user_email',
'cast' => 'copy',
),
),
array(
array(
'from' => 'user_email',
'to' => 'email1',
'cast' => 'string',
),
),
),
),
'form' => array(
'fields' => array(
Expand All @@ -252,9 +320,15 @@
'required' => true,
),
array(
'label' => __( 'Email', 'forms-bridge' ),
'name' => 'email1',
'type' => 'email',
'label' => __( 'Email', 'forms-bridge' ),
'name' => 'email1',
'type' => 'email',
'required' => true,
),
array(
'label' => __( 'Title', 'forms-bridge' ),
'name' => 'title',
'type' => 'text',
),
array(
'label' => __( 'Phone', 'forms-bridge' ),
Expand Down
35 changes: 29 additions & 6 deletions forms-bridge/addons/suitecrm/templates/contacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
return array(
'title' => __( 'Contacts', 'forms-bridge' ),
'description' => __(
'Contact form template. The resulting bridge will convert form submissions into SuiteCRM contacts.',
'Contact form bridge template. The resulting bridge will convert form submissions into SuiteCRM contacts.',
'forms-bridge'
),
'fields' => array(
Expand Down Expand Up @@ -53,10 +53,30 @@
'value' => 'Cold Call',
'label' => __( 'Cold Call', 'forms-bridge' ),
),
array(
'value' => 'Existing Customer',
'label' => __( 'Existing Customer', 'forms-bridge' ),
),
array(
'value' => 'Employee',
'label' => __( 'Employee', 'forms-bridge' ),
),
array(
'value' => 'Partner',
'label' => __( 'Partner', 'forms-bridge' ),
),
array(
'value' => 'Public Relations',
'label' => __( 'Public Relations', 'forms-bridge' ),
),
array(
'value' => 'Email',
'label' => __( 'Email', 'forms-bridge' ),
),
array(
'value' => 'Direct Mail',
'label' => __( 'Direct Mail', 'forms-bridge' ),
),
array(
'value' => 'Word of mouth',
'label' => __( 'Word of Mouth', 'forms-bridge' ),
Expand All @@ -65,6 +85,14 @@
'value' => 'Campaign',
'label' => __( 'Campaign', 'forms-bridge' ),
),
array(
'value' => 'Conference',
'label' => __( 'Conference', 'forms-bridge' ),
),
array(
'value' => 'Trade Show',
'label' => __( 'Trade Show', 'forms-bridge' ),
),
array(
'value' => 'Other',
'label' => __( 'Other', 'forms-bridge' ),
Expand Down Expand Up @@ -103,11 +131,6 @@
'name' => 'phone_work',
'type' => 'tel',
),
array(
'label' => __( 'Mobile', 'forms-bridge' ),
'name' => 'phone_mobile',
'type' => 'tel',
),
array(
'label' => __( 'Address', 'forms-bridge' ),
'name' => 'primary_address_street',
Expand Down
Loading