PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / 1.21
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration v1.21
2.1.0 2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 1.40 1.41 All 42 releases
fluent-boards / app / Services / Intergrations / FluentCRM / Init.php

Init.php in FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration 1.21, at app/Services/Intergrations/FluentCRM/Init.php

71 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentBoards\App\Services\Intergrations\FluentCRM;
4
5 use FluentBoards\App\App;
6 use FluentBoards\App\Hooks\Handlers\FluentCrmIntegration;
7 use FluentBoards\App\Services\Intergrations\FluentCRM\Automations\ContactAddedBoardTrigger;
8 use FluentBoards\App\Services\Intergrations\FluentCRM\Automations\ContactAddedTaskTrigger;
9 use FluentBoards\App\Services\Intergrations\FluentCRM\Automations\StageChangedTrigger;
10 use FluentBoards\App\Services\Intergrations\FluentCRM\Automations\TaskCreateAction;
11 use FluentBoards\App\Services\TransStrings;
12
13 class Init
14 {
15 public function __construct()
16 {
17 $this->registerToContactSection();
18
19 (new DeepIntegration())->init();
20 $this->registerAutomationFunnels();
21 }
22
23 public function registerToContactSection()
24 {
25 // (new FluentCrmIntegration())->registerCustomSection();
26 add_action( 'fluent_crm/global_appjs_loaded', function () {
27 $app = App::getInstance();
28
29 $assets = $app['url.assets'];
30
31 $slug = $app->config->get('app.slug');
32 wp_enqueue_script( $slug . '_in_crm', FLUENT_BOARDS_PLUGIN_URL . 'assets/crm-contact-app.js');
33 wp_enqueue_style($slug . '_in_crm', FLUENT_BOARDS_PLUGIN_URL . 'assets/admin/crm-contact-app.css');
34 wp_localize_script($slug . '_in_crm', 'fluentAddonVars', [
35 'slug' => $slug = $app->config->get('app.slug'),
36 'nonce' => wp_create_nonce($slug),
37 'rest' => $this->getRestInfo($app),
38 'ajaxurl' => admin_url('admin-ajax.php'),
39 'asset_url' => $assets,
40 'trans' => TransStrings::getStrings(),
41 'base_url' => fluent_boards_page_url(),
42 ]);
43
44
45 });
46 }
47
48 public function registerAutomationFunnels()
49 {
50 // new ContactAddedBoardTrigger();
51 new ContactAddedTaskTrigger();
52 new StageChangedTrigger();
53
54 new TaskCreateAction();
55 }
56
57
58 protected function getRestInfo($app)
59 {
60 $ns = $app->config->get('app.rest_namespace');
61 $ver = $app->config->get('app.rest_version');
62
63 return [
64 'base_url' => esc_url_raw(rest_url()),
65 'url' => rest_url($ns . '/' . $ver),
66 'nonce' => wp_create_nonce('wp_rest'),
67 'namespace' => $ns,
68 'version' => $ver,
69 ];
70 }
71 }