AntonLV 4 недель назад
Родитель
Сommit
b81dbb8f04
42 измененных файлов с 878 добавлено и 9 удалено
  1. 8 0
      modules/boonex/chat_plus/classes/BxChatPlusModule.php
  2. 3 3
      modules/boonex/chat_plus/install/config.php
  3. 2 1
      modules/boonex/chat_plus/install/langs/en.xml
  4. 1 1
      modules/boonex/chat_plus/install/sql/install.sql
  5. 51 0
      modules/boonex/chat_plus/updates/12.0.0_15.0.0/install/config.php
  6. 13 0
      modules/boonex/chat_plus/updates/12.0.0_15.0.0/install/installer.php
  7. 4 0
      modules/boonex/chat_plus/updates/12.0.0_15.0.0/install/langs/en.xml
  8. 4 0
      modules/boonex/chat_plus/updates/12.0.0_15.0.0/install/sql/install.sql
  9. 98 0
      modules/boonex/chat_plus/updates/12.0.0_15.0.0/source/classes/BxChatPlusModule.php
  10. 70 0
      modules/boonex/chat_plus/updates/12.0.0_15.0.0/source/install/config.php
  11. 36 0
      modules/boonex/chat_plus/updates/12.0.0_15.0.0/source/install/langs/en.xml
  12. 13 0
      modules/boonex/chat_plus/updates/12.0.0_15.0.0/source/install/sql/install.sql
  13. 8 0
      modules/boonex/datafox/classes/BxDataFoxModule.php
  14. 1 0
      modules/boonex/datafox/install/langs/en.xml
  15. 1 1
      modules/boonex/datafox/install/sql/install.sql
  16. 1 1
      modules/boonex/datafox/updates/12.0.0_15.0.0/install/config.php
  17. 4 0
      modules/boonex/datafox/updates/12.0.0_15.0.0/install/langs/en.xml
  18. 4 0
      modules/boonex/datafox/updates/12.0.0_15.0.0/install/sql/install.sql
  19. 154 0
      modules/boonex/datafox/updates/12.0.0_15.0.0/source/classes/BxDataFoxModule.php
  20. 7 0
      modules/boonex/datafox/updates/12.0.0_15.0.0/source/install/langs/en.xml
  21. 13 0
      modules/boonex/datafox/updates/12.0.0_15.0.0/source/install/sql/install.sql
  22. 130 0
      modules/boonex/payment/updates/15.0.2_15.0.3/source/classes/BxPaymentDetails.php
  23. 3 0
      modules/boonex/payment/updates/15.0.2_15.0.3/source/classes/BxPaymentFormDetails.php
  24. 1 0
      modules/boonex/russian/data/langs/bx_chat_plus/ru.xml
  25. 1 0
      modules/boonex/russian/data/langs/bx_datafox/ru.xml
  26. 1 0
      modules/boonex/russian/data/langs/bx_unacon/ru.xml
  27. 3 0
      modules/boonex/russian/updates/15.0.5_15.0.6/install/config.php
  28. 4 0
      modules/boonex/russian/updates/15.0.5_15.0.6/install/langs/bx_chat_plus/ru.xml
  29. 4 0
      modules/boonex/russian/updates/15.0.5_15.0.6/install/langs/bx_datafox/ru.xml
  30. 4 0
      modules/boonex/russian/updates/15.0.5_15.0.6/install/langs/bx_unacon/ru.xml
  31. 39 0
      modules/boonex/russian/updates/15.0.5_15.0.6/source/data/langs/bx_chat_plus/ru.xml
  32. 8 0
      modules/boonex/russian/updates/15.0.5_15.0.6/source/data/langs/bx_datafox/ru.xml
  33. 29 0
      modules/boonex/russian/updates/15.0.5_15.0.6/source/data/langs/bx_unacon/ru.xml
  34. 8 0
      modules/boonex/una_connect/classes/BxUnaConModule.php
  35. 1 0
      modules/boonex/una_connect/install/langs/en.xml
  36. 1 1
      modules/boonex/una_connect/install/sql/install.sql
  37. 1 1
      modules/boonex/una_connect/updates/15.0.0_15.0.1/install/config.php
  38. 4 0
      modules/boonex/una_connect/updates/15.0.0_15.0.1/install/langs/en.xml
  39. 4 0
      modules/boonex/una_connect/updates/15.0.0_15.0.1/install/sql/install.sql
  40. 87 0
      modules/boonex/una_connect/updates/15.0.0_15.0.1/source/classes/BxUnaConModule.php
  41. 29 0
      modules/boonex/una_connect/updates/15.0.0_15.0.1/source/install/langs/en.xml
  42. 20 0
      modules/boonex/una_connect/updates/15.0.0_15.0.1/source/install/sql/install.sql

+ 8 - 0
modules/boonex/chat_plus/classes/BxChatPlusModule.php

@@ -37,6 +37,14 @@ class BxChatPlusModule extends BxDolModule
         header("Location:" . $sLogoUrl);
     }
 
+    public function serviceGetActions($aWidget)
+    {
+        $oInformer = BxDolInformer::getInstance(BxDolStudioTemplate::getInstance());
+        $oInformer->add('sys-module-discontinued', _t('_adm_txt_modules_discontinued', BX_DOL_URL_STUDIO . 'design.php?name=bx_chat_plus', _t('_bx_chat_plus_adm_stg_cpt_type')), BX_INFORMER_ALERT);
+
+        return bx_srv('system', 'get_actions', [$aWidget], 'TemplStudioDesigns');
+    }
+
     function serviceChatBlock ()
     {
         if (!getParam('bx_chat_plus_url'))

+ 3 - 3
modules/boonex/chat_plus/install/config.php

@@ -17,12 +17,12 @@ $aConfig = array(
     'name' => 'bx_chat_plus',
     'title' => 'RocketChat',
     'note' => 'RocketChat integration.',
-    'version' => '12.0.1.DEV',
-    'vendor' => 'BoonEx',
+    'version' => '15.0.0.DEV',
+    'vendor' => 'UNA INC',
     'help_url' => 'http://feed.una.io/?section={module_name}',
 
     'compatible_with' => array(
-        '12.0.x'
+        '15.0.x'
     ),
 
     /**

+ 2 - 1
modules/boonex/chat_plus/install/langs/en.xml

@@ -2,8 +2,9 @@
 <resources name="en" flag="gb" title="English">
 	<string name="_sys_module_chat_plus"><![CDATA[RocketChat]]></string>
 	<string name="_bx_chat_plus"><![CDATA[RocketChat]]></string>
+    <string name="_bx_chat_plus_wgt_cpt"><![CDATA[RocketChat (discontinued)]]></string>
 	<string name="_bx_chat_plus_chat"><![CDATA[Chat]]></string>
-
+    
 	<string name="_bx_chat_plus_setting"><![CDATA[Chat Setting]]></string>
     <string name="_bx_chat_plus_adm_stg_cpt_type"><![CDATA[RocketChat]]></string>
     <string name="_bx_chat_plus_adm_stg_cpt_category_general"><![CDATA[General]]></string>

+ 1 - 1
modules/boonex/chat_plus/install/sql/install.sql

@@ -8,7 +8,7 @@ SET @iPageId = LAST_INSERT_ID();
 SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
 SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
 INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
-(@iPageId, 'bx_chat_plus', 'integrations', '{url_studio}module.php?name=bx_chat_plus', '', 'bx_chat_plus@modules/boonex/chat_plus/|std-icon.svg', '_bx_chat_plus', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
+(@iPageId, 'bx_chat_plus', 'integrations', '{url_studio}module.php?name=bx_chat_plus', '', 'bx_chat_plus@modules/boonex/chat_plus/|std-icon.svg', '_bx_chat_plus_wgt_cpt', '', 'a:4:{s:6:"module";s:12:"bx_chat_plus";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:6:"Module";}');
 INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
 (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
 

+ 51 - 0
modules/boonex/chat_plus/updates/12.0.0_15.0.0/install/config.php

@@ -0,0 +1,51 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'title' => 'RocketChat',
+    'version_from' => '12.0.0',
+    'version_to' => '15.0.0',
+    'vendor' => 'UNA INC',
+
+    'compatible_with' => array(
+        '15.0.0-RC2'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/chat_plus/updates/update_12.0.0_15.0.0/',
+    'home_uri' => 'chat_plus_update_1200_1500',
+
+    'module_dir' => 'boonex/chat_plus/',
+    'module_uri' => 'chat_plus',
+
+    'db_prefix' => 'bx_chat_plus_',
+    'class_prefix' => 'BxChatPlus',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_files' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Chat+',
+
+    /**
+     * Files Section
+     */
+    'delete_files' => array(),
+);

+ 13 - 0
modules/boonex/chat_plus/updates/12.0.0_15.0.0/install/installer.php

@@ -0,0 +1,13 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ */
+
+class BxChatPlusUpdater extends BxDolStudioUpdater
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}

+ 4 - 0
modules/boonex/chat_plus/updates/12.0.0_15.0.0/install/langs/en.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string_add name="_bx_chat_plus_wgt_cpt"><![CDATA[RocketChat (discontinued)]]></string_add>
+</resources>

+ 4 - 0
modules/boonex/chat_plus/updates/12.0.0_15.0.0/install/sql/install.sql

@@ -0,0 +1,4 @@
+-- Studio page and widget
+
+SET @iPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'bx_chat_plus' LIMIT 1);
+UPDATE `sys_std_widgets` SET `caption`='_bx_chat_plus_wgt_cpt', `cnt_actions`='a:4:{s:6:"module";s:12:"bx_chat_plus";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:6:"Module";}' WHERE `page_id`=@iPageId AND `module`='bx_chat_plus';

+ 98 - 0
modules/boonex/chat_plus/updates/12.0.0_15.0.0/source/classes/BxChatPlusModule.php

@@ -0,0 +1,98 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    RocketChat Rocket.Chat integration module
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxChatPlusModule extends BxDolModule
+{
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+    }
+
+    function actionRedirect ()
+    {
+        if (!getParam('bx_chat_plus_url')) {
+            $this->_oTemplate->displayMsg(_t('_bx_chat_plus_not_configured'));
+            return;
+        }
+
+        header("Location:" . getParam('bx_chat_plus_url'), true, 302);
+    }
+
+    function actionLogo ()
+    {
+        if (!($sLogoUrl = BxTemplFunctions::getInstance()->getMainLogoUrl())) {
+            header("HTTP/1.0 404 Not Found");
+            echo '404 Not Found';
+            return;
+        }
+
+        header("Location:" . $sLogoUrl);
+    }
+
+    public function serviceGetActions($aWidget)
+    {
+        $oInformer = BxDolInformer::getInstance(BxDolStudioTemplate::getInstance());
+        $oInformer->add('sys-module-discontinued', _t('_adm_txt_modules_discontinued', BX_DOL_URL_STUDIO . 'design.php?name=bx_chat_plus', _t('_bx_chat_plus_adm_stg_cpt_type')), BX_INFORMER_ALERT);
+
+        return bx_srv('system', 'get_actions', [$aWidget], 'TemplStudioDesigns');
+    }
+
+    function serviceChatBlock ()
+    {
+        if (!getParam('bx_chat_plus_url'))
+           return MsgBox(_t('_bx_chat_plus_not_configured'));
+       
+        $this->_oTemplate->addCss('main.css');
+        $s = $this->_oTemplate->parseHtmlByName('chat_block.html', array('chat_url' => getParam('bx_chat_plus_url')));
+       
+        return array(
+            'content' => $s, 
+            'menu' => array (
+                array (
+                    'title' => _t('_bx_chat_plus_open_in_separate_window'),
+                    'link' => getParam('bx_chat_plus_url'),
+                    'target' => '_blank',
+                ),
+            ),
+        );
+    }
+
+    function serviceHelpdeskCode ()
+    {
+        $sChatUrl = getParam('bx_chat_plus_url');
+        if (!getParam('bx_chat_plus_helpdesk') || !$sChatUrl)
+            return '';
+
+        if (getParam('bx_chat_plus_helpdesk_guest_only') && isLogged())
+            return '';
+
+        $aUrl = parse_url($sChatUrl);
+        $sChatUrl = $aUrl['scheme'] . '://' . $aUrl['host'] . ($aUrl['port'] ? ':' . $aUrl['port'] : '');
+
+        return <<<EOS
+
+<!-- Start of Helpdesk Livechat Script -->
+<script language="javascript">
+(function(w, d, s, u) {
+	w.RocketChat = function(c) { w.RocketChat._.push(c) }; w.RocketChat._ = []; w.RocketChat.url = u;
+	var h = d.getElementsByTagName(s)[0], j = d.createElement(s);
+	j.async = true; j.src = '{$sChatUrl}/packages/rocketchat_livechat/assets/rocket-livechat.js';
+	h.parentNode.insertBefore(j, h);
+})(window, document, 'script', '{$sChatUrl}/livechat');
+</script>
+<!-- End of Helpdesk Livechat Script -->
+
+EOS;
+
+    }
+}
+
+/** @} */

+ 70 - 0
modules/boonex/chat_plus/updates/12.0.0_15.0.0/source/install/config.php

@@ -0,0 +1,70 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    RocketChat Rocket.Chat integration module
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_chat_plus',
+    'title' => 'RocketChat',
+    'note' => 'RocketChat integration.',
+    'version' => '15.0.0',
+    'vendor' => 'UNA INC',
+    'help_url' => 'http://feed.una.io/?section={module_name}',
+
+    'compatible_with' => array(
+        '15.0.0-RC2'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/chat_plus/',
+    'home_uri' => 'chat_plus',
+
+    'db_prefix' => 'bx_chat_plus_',
+    'class_prefix' => 'BxChatPlus',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Chat+',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+    ),
+    'uninstall' => array (
+        'execute_sql' => 1,
+        'update_languages' => 1,
+    ),
+    'enable' => array(
+        'execute_sql' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array(
+        'execute_sql' => 1,
+        'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(
+        //'oauth2' => 'BoonEx OAuth2 Server Module'
+    ),
+);
+
+/** @} */

+ 36 - 0
modules/boonex/chat_plus/updates/12.0.0_15.0.0/source/install/langs/en.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string name="_sys_module_chat_plus"><![CDATA[RocketChat]]></string>
+	<string name="_bx_chat_plus"><![CDATA[RocketChat]]></string>
+    <string name="_bx_chat_plus_wgt_cpt"><![CDATA[RocketChat (discontinued)]]></string>
+	<string name="_bx_chat_plus_chat"><![CDATA[Chat]]></string>
+    
+	<string name="_bx_chat_plus_setting"><![CDATA[Chat Setting]]></string>
+    <string name="_bx_chat_plus_adm_stg_cpt_type"><![CDATA[RocketChat]]></string>
+    <string name="_bx_chat_plus_adm_stg_cpt_category_general"><![CDATA[General]]></string>
+    <string name="_bx_chat_plus_option_url"><![CDATA[Chat URL]]></string>
+    <string name="_bx_chat_plus_option_helpdesk"><![CDATA[Enable Helpdesk Chat]]></string>
+    <string name="_bx_chat_plus_option_helpdesk_guest_only"><![CDATA[Show Helpdesk Chat For Guests Only]]></string>
+
+    <string name="_bx_chat_plus_menu_item_title_entries_home"><![CDATA[Chat]]></string>
+    <string name="_bx_chat_plus_menu_item_title_system_entries_home"><![CDATA[RocketChat]]></string>
+
+    <string name="_bx_chat_plus_page_title_chat"><![CDATA[Chat]]></string>
+    <string name="_bx_chat_plus_page_title_sys_chat"><![CDATA[RocketChat]]></string>
+    <string name="_bx_chat_plus_page_block_title_chat"><![CDATA[Chat]]></string>
+
+	<string name="_bx_chat_plus_not_configured"><![CDATA[Chat isn't configured]]></string>
+	<string name="_bx_chat_plus_open_in_separate_window"><![CDATA[Full-window mode]]></string>
+	<string name="_bx_chat_plus_information"><![CDATA[Information]]></string>
+	<string name="_bx_chat_plus_information_block"><![CDATA[To enable this module, chat server must be installed separately. <br />
+
+Enter the chat URL in this module settings. <br />
+
+Then OAuth login must be configured. <a href="{0}studio/module.php?name=bx_oauth&page=settings">Generate Key & Secret pair</a> in OAuth2 Server module by pointing chat URL and  desired name. <br />
+
+After Key & Secret pair is generated you need to enter them in Chat Administration &gt; OAuth &gt; UNA.
+
+<hr />
+
+To enable Helpdesk Chat you need to enable it in the Chat Administration &gt; Livechat and in this module settings. You don't need to insert JS code, it is added automatically.]]></string>
+</resources>

+ 13 - 0
modules/boonex/chat_plus/updates/12.0.0_15.0.0/source/install/sql/install.sql

@@ -0,0 +1,13 @@
+-- Studio page and widget
+
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_chat_plus', '_bx_chat_plus', '_bx_chat_plus', 'bx_chat_plus@modules/boonex/chat_plus/|std-icon.svg');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, 'bx_chat_plus', 'integrations', '{url_studio}module.php?name=bx_chat_plus', '', 'bx_chat_plus@modules/boonex/chat_plus/|std-icon.svg', '_bx_chat_plus_wgt_cpt', '', 'a:4:{s:6:"module";s:12:"bx_chat_plus";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:6:"Module";}');
+INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
+(@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
+

+ 8 - 0
modules/boonex/datafox/classes/BxDataFoxModule.php

@@ -16,6 +16,14 @@ class BxDataFoxModule extends BxDolModule
         parent::__construct($aModule);
     }
 
+    public function serviceGetActions($aWidget)
+    {
+        $oInformer = BxDolInformer::getInstance(BxDolStudioTemplate::getInstance());
+        $oInformer->add('sys-module-discontinued', _t('_adm_txt_modules_discontinued', BX_DOL_URL_STUDIO . 'design.php?name=bx_datafox', _t('_bx_datafox_adm_stg_cpt_type')), BX_INFORMER_ALERT);
+
+        return bx_srv('system', 'get_actions', [$aWidget], 'TemplStudioDesigns');
+    }
+
     function serviceIncludeCssJs()
     {
         $this->_oTemplate->addCss('datafox.css');

+ 1 - 0
modules/boonex/datafox/install/langs/en.xml

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources name="en" flag="gb" title="English">
 	<string name="_bx_datafox"><![CDATA[Data Fox]]></string>
+    <string name="_bx_datafox_wgt_cpt"><![CDATA[Data Fox (discontinued)]]></string>
     <string name="_bx_datafox_adm_stg_cpt_type"><![CDATA[Data Fox]]></string>
     <string name="_bx_datafox_adm_stg_cpt_category_general"><![CDATA[General]]></string>
 </resources>

+ 1 - 1
modules/boonex/datafox/install/sql/install.sql

@@ -8,7 +8,7 @@ SET @iPageId = LAST_INSERT_ID();
 SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
 SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
 INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
-(@iPageId, 'bx_datafox', 'integrations', '{url_studio}module.php?name=bx_datafox', '', 'bx_datafox@modules/boonex/datafox/|std-icon.svg', '_bx_datafox', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
+(@iPageId, 'bx_datafox', 'integrations', '{url_studio}module.php?name=bx_datafox', '', 'bx_datafox@modules/boonex/datafox/|std-icon.svg', '_bx_datafox_wgt_cpt', '', 'a:4:{s:6:"module";s:10:"bx_datafox";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:6:"Module";}');
 INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
 (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
 

+ 1 - 1
modules/boonex/datafox/updates/12.0.0_15.0.0/install/config.php

@@ -35,7 +35,7 @@ $aConfig = array(
     'install' => array(
         'execute_sql' => 1,
         'update_files' => 1,
-        'update_languages' => 0,
+        'update_languages' => 1,
         'clear_db_cache' => 1,
     ),
 

+ 4 - 0
modules/boonex/datafox/updates/12.0.0_15.0.0/install/langs/en.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string_add name="_bx_datafox_wgt_cpt"><![CDATA[Data Fox (discontinued)]]></string_add>
+</resources>

+ 4 - 0
modules/boonex/datafox/updates/12.0.0_15.0.0/install/sql/install.sql

@@ -0,0 +1,4 @@
+-- Studio page and widget
+
+SET @iPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'bx_datafox' LIMIT 1);
+UPDATE `sys_std_widgets` SET `caption`='_bx_datafox_wgt_cpt', `cnt_actions`='a:4:{s:6:"module";s:10:"bx_datafox";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:6:"Module";}' WHERE `page_id`=@iPageId AND `module`='bx_datafox';

+ 154 - 0
modules/boonex/datafox/updates/12.0.0_15.0.0/source/classes/BxDataFoxModule.php

@@ -0,0 +1,154 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    DataFox Data Fox API integration
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDataFoxModule extends BxDolModule
+{
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+    }
+
+    public function serviceGetActions($aWidget)
+    {
+        $oInformer = BxDolInformer::getInstance(BxDolStudioTemplate::getInstance());
+        $oInformer->add('sys-module-discontinued', _t('_adm_txt_modules_discontinued', BX_DOL_URL_STUDIO . 'design.php?name=bx_datafox', _t('_bx_datafox_adm_stg_cpt_type')), BX_INFORMER_ALERT);
+
+        return bx_srv('system', 'get_actions', [$aWidget], 'TemplStudioDesigns');
+    }
+
+    function serviceIncludeCssJs()
+    {
+        $this->_oTemplate->addCss('datafox.css');
+    }
+
+    function serviceParseText($sHtml)
+    {
+        if (false === strstr($sHtml, '<a '))
+            return $sHtml;
+        
+        $sId = 'bx-datafox-' . md5(microtime());
+
+        // load html with wrapper
+        $dom = new DOMDocument();
+        @$dom->loadHTML('<?xml encoding="UTF-8"><div id="' . $sId . '">' . $sHtml . '</div>');
+        $xpath = new DOMXpath($dom);
+
+        // grab links, also add special classes
+        $aLinks = array();
+        $oLinks = $xpath->evaluate('//a');
+        for ($i = 0; $i < $oLinks->length; $i++) {
+            $oLink = $oLinks->item($i);
+            $sIdLink = $sId . '_' . $i;
+
+            $aLinks[$sIdLink] = $oLink->getAttribute('href');
+
+            $sClasses = $oLink->getAttribute('class');
+            $sClasses = ($sClasses ? preg_replace('/\s*bx-datafox-[a-zA-Z0-9]+_[0-9]+/', '', $sClasses) . ' ' : '') . $sIdLink;
+
+            $oLink->removeAttribute('class');
+            $oLink->setAttribute("class", $sClasses);
+        }
+
+        // remove old code with references
+        $eCont = $dom->getElementById($sId);
+        foreach ($xpath->query('//div[contains(attribute::class, "bx-datafox-companies")]', $eCont) as $e)
+            $e->parentNode->removeChild($e);
+
+        // save the result 
+        if (false === ($s = $dom->saveHTML($dom->getElementsByTagName('div')->item(0)))) // in case of error return original string
+            return $sHtml;
+
+        // strip added tags
+        $sHtml = mb_substr($s, 54, -6); 
+
+        // add new code with references
+        $aCompanies = $this->apiGetCompanies($aLinks);
+
+        $sHtml .= $this->_oTemplate->parseHtmlByName('companies.html', array(
+            'bx_repeat:companies' => $aCompanies,
+            'bx_repeat:companies2' => $aCompanies,
+        ));
+
+        return $sHtml;
+    }
+
+    function apiGetCompanies($aLinks)
+    {
+        $sAccessToken = $this->apiGetAccessToken();
+        $aCompanies = array();
+        $iCounter = 0;
+        foreach ($aLinks as $sId => &$sHref) {
+            if (!($a = $this->apiGetCompanyByUrl($sAccessToken, $sHref, $aCompanies)))
+                continue;
+            $a['link_id'] = $sId;
+            $a['item_number'] = ++$iCounter;
+            unset($a['top_keywords']);
+            $aCompanies[$a['id']] = $a;
+        }
+        return array_values($aCompanies);
+    }
+
+    function apiGetAccessToken()
+    {
+        // make request for token
+        $sHttpCode = null;
+        $s = bx_file_get_contents($this->_oConfig->sApiUrl . 'oauth2/token', array(
+            'grant_type' => 'client_credentials',
+            'scope' => 'full',
+        ), 'post', array(), $sHttpCode, array(
+            'user' => getParam('bx_datafox_id'), 
+            'password' => getParam('bx_datafox_secret'),
+        ));
+
+        if (!$s)
+            return false;
+
+        $o = json_decode($s);
+
+        return $o && isset($o->access_token) ? $o->access_token : '';
+    }
+
+    function apiGetCompanyByUrl($sAccessToken, $sHref, $aCompanies)
+    {
+        $sHost = parse_url($sHref, PHP_URL_HOST);
+        if (!$sHref)
+            return false;
+
+        $a = $this->api($sAccessToken, 'companies', array('url' => $sHost));
+
+        if (!isset($a['total_count']) || !$a['total_count'] && $a['entries'])
+            return false;
+
+        $aCompany = array_pop($a['entries']);
+
+        if (isset($aCompanies[$aCompany['id']]))
+            return false;
+
+        $aCompanyFull = $this->api($sAccessToken, 'companies/' . $aCompany['id'] . '/details');
+
+        return $aCompanyFull;
+    }
+
+    function api($sAccessToken, $sUrlAppend, $aData = array())
+    {
+        $s = bx_file_get_contents($this->_oConfig->sApiUrl . $sUrlAppend, $aData, 'get', array(
+            'Authorization: Bearer ' . $sAccessToken,
+        ));
+
+        if (!$s || !($a = json_decode($s, true)) || (isset($a['object_type']) && 'error' == $a['object_type']))
+            return false;
+
+        return $a;
+    }
+
+}
+
+/** @} */

+ 7 - 0
modules/boonex/datafox/updates/12.0.0_15.0.0/source/install/langs/en.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string name="_bx_datafox"><![CDATA[Data Fox]]></string>
+    <string name="_bx_datafox_wgt_cpt"><![CDATA[Data Fox (discontinued)]]></string>
+    <string name="_bx_datafox_adm_stg_cpt_type"><![CDATA[Data Fox]]></string>
+    <string name="_bx_datafox_adm_stg_cpt_category_general"><![CDATA[General]]></string>
+</resources>

+ 13 - 0
modules/boonex/datafox/updates/12.0.0_15.0.0/source/install/sql/install.sql

@@ -0,0 +1,13 @@
+-- Studio page and widget
+
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_datafox', '_bx_datafox', '_bx_datafox', 'bx_datafox@modules/boonex/datafox/|std-icon.svg');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, 'bx_datafox', 'integrations', '{url_studio}module.php?name=bx_datafox', '', 'bx_datafox@modules/boonex/datafox/|std-icon.svg', '_bx_datafox_wgt_cpt', '', 'a:4:{s:6:"module";s:10:"bx_datafox";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:6:"Module";}');
+INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
+(@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
+

+ 130 - 0
modules/boonex/payment/updates/15.0.2_15.0.3/source/classes/BxPaymentDetails.php

@@ -0,0 +1,130 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Payment Payment
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxPaymentDetails extends BxBaseModPaymentDetails
+{
+    protected $_bIsApi;
+    protected $_sLangsPrefix;
+
+    function __construct()
+    {
+        $this->MODULE = 'bx_payment';
+
+        parent::__construct();
+
+        $this->_bIsApi = bx_is_api();
+        $this->_sLangsPrefix = $this->_oModule->_oConfig->getPrefix('langs');
+    }
+
+    /**
+     * @page service Service Calls
+     * @section bx_payment Payment
+     * @subsection bx_payment-page_blocks Page Blocks
+     * @subsubsection bx_payment-get_block_details get_block_details
+     * 
+     * @code bx_srv('bx_payment', 'get_block_details', [...], 'Details'); @endcode
+     * 
+     * Get page block with payment providers' configuration settings represented as subforms.
+     *
+     * @return an array describing a block to display on the site. All necessary CSS and JS files are automatically added to the HEAD section of the site HTML.
+     * 
+     * @see BxPaymentDetails::serviceGetBlockDetails
+     */
+    /** 
+     * @ref bx_payment-get_block_details "get_block_details"
+     */
+    public function serviceGetBlockDetails($iUserId = BX_PAYMENT_EMPTY_ID, $mixedPaymentProvider = false)
+    {
+        if(!$this->_oModule->isLogged())
+            return ($sMsg = $this->_sLangsPrefix . 'err_required_login') && $this->_bIsApi ? [bx_api_get_msg($sMsg)] : MsgBox(_t($sMsg));
+
+        $iUserId = $iUserId != BX_PAYMENT_EMPTY_ID ? $iUserId : $this->_oModule->getProfileId();
+
+        $aPaymentProviders = [];
+        if(!$mixedPaymentProvider) {
+            $aPaymentProviders = $this->_oModule->_oDb->getProviders([
+                'type' => 'all', 
+                'active' => true, 
+                'order' => true
+            ]);
+
+            if(!empty($aPaymentProviders) && is_array($aPaymentProviders))
+                $aPaymentProviders = array_keys($aPaymentProviders);
+        }
+        else {
+            if(is_array($mixedPaymentProvider))
+                $aPaymentProviders = $mixedPaymentProvider;
+            else if(is_string($mixedPaymentProvider))
+                $aPaymentProviders = [$mixedPaymentProvider];
+        }
+
+        if(!$aPaymentProviders)
+            return ($sMsg = $this->_sLangsPrefix . 'msg_no_results') && $this->_bIsApi ? [bx_api_get_msg($sMsg)] : MsgBox(_t($sMsg));
+
+        $mixedContent = $this->_bIsApi ? [] : '';
+        foreach($aPaymentProviders as $iIndex => $sPaymentProvider) {
+            $mixedForm = $this->getForm($iUserId, $sPaymentProvider);
+
+            if($this->_bIsApi)
+                $mixedContent[] = bx_api_get_block('form', $mixedForm, [
+                    'id' => $iIndex + 1,
+                    'ext' => [
+                        'name' => $mixedForm['attrs']['name'] ?? $this->MODULE,
+                        'request' => ['url' => '/api.php?r=' . $this->MODULE . '/get_block_details/Details', 'immutable' => true]
+                    ]
+                ]);
+            else
+                $mixedContent .= $this->_oModule->_oTemplate->parseHtmlByName('details_form.html', [
+                    'provider' => str_replace('_', '-', $sPaymentProvider),
+                    'form' => $mixedForm
+                ]);
+        }
+
+        if(empty($mixedContent))
+            return ($sMsg = $this->_sLangsPrefix . 'msg_no_results') && $this->_bIsApi ? [bx_api_get_msg($sMsg)] : MsgBox(_t($sMsg));
+
+        return $this->_bIsApi ? $mixedContent : $mixedContent;
+    }
+
+    public function getForm($iProfileId, $sPaymentProvider)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $oForm = BxTemplFormView::getObjectInstance($CNF['OBJECT_FORM_DETAILES'], $CNF['OBJECT_FORM_DETAILES_EDIT']);
+        $oForm->initWithParams($iProfileId, $sPaymentProvider);
+        $oForm->initChecker();
+        if($oForm->isSubmitted()) {
+            if($oForm->isValid()) {
+                $aOptions = $this->_oModule->_oDb->getOptionsByProvider($sPaymentProvider);
+                foreach($aOptions as $aOption) {
+                    $sValue = ($_sValue = $oForm->getCleanValue($aOption['name'])) !== false ? $_sValue : '';
+                    $this->_oModule->_oDb->updateOption($iProfileId, $aOption['id'], bx_process_input($sValue));
+                }
+
+                if(!$this->_bIsApi) {
+                    header('Location: ' . bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=payment-details', ['pp' => $sPaymentProvider])));
+                    return;
+                }
+            }
+            else
+                foreach($oForm->aInputs as $aInput)
+                    if(!empty($aInput['error']) && !empty($aInput['attrs']['bx-data-provider'])) {
+                        $sProviderBlock = 'provider_' . (int)$aInput['attrs']['bx-data-provider'] . '_begin';
+                        if(!empty($oForm->aInputs[$sProviderBlock]))
+                            $oForm->aInputs[$sProviderBlock]['collapsed'] = false;
+                    }
+        }
+
+        return $this->_bIsApi ? $oForm->getCodeAPI() : $oForm->getCode();
+    }
+}
+
+/** @} */

+ 3 - 0
modules/boonex/payment/updates/15.0.2_15.0.3/source/classes/BxPaymentFormDetails.php

@@ -123,6 +123,9 @@ class BxPaymentFormDetails extends BxTemplFormView
                         'func' => $aInput['check_type'],
                         'params' => $aInput['check_params'],
                         'error' => _t($aInput['check_error']),
+                    ],
+                    'db' => [
+                        'pass' => 'Xss',
                     ]
                 ];
 

+ 1 - 0
modules/boonex/russian/data/langs/bx_chat_plus/ru.xml

@@ -2,6 +2,7 @@
 <resources name="ru" flag="ru" title="Russian">
 	<string name="_sys_module_chat_plus"><![CDATA[RocketChat]]></string>
 	<string name="_bx_chat_plus"><![CDATA[RocketChat]]></string>
+    <string name="_bx_chat_plus_wgt_cpt"><![CDATA[RocketChat (прекращено)]]></string>
 	<string name="_bx_chat_plus_chat"><![CDATA[Чат]]></string>
 
 	<string name="_bx_chat_plus_setting"><![CDATA[Настройки чата]]></string>

+ 1 - 0
modules/boonex/russian/data/langs/bx_datafox/ru.xml

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources name="ru" flag="ru" title="Russian">
 	<string name="_bx_datafox"><![CDATA[Data Fox]]></string>
+    <string name="_bx_datafox_wgt_cpt"><![CDATA[Data Fox (прекращено)]]></string>
     <string name="_bx_datafox_adm_stg_cpt_type"><![CDATA[Data Fox]]></string>
     <string name="_bx_datafox_adm_stg_cpt_category_general"><![CDATA[Общие]]></string>
 </resources>

+ 1 - 0
modules/boonex/russian/data/langs/bx_unacon/ru.xml

@@ -2,6 +2,7 @@
 <resources name="ru" flag="ru" title="Russian">
 	<string name="_sys_module_unacon"><![CDATA[UNA-соединение]]></string>
 	<string name="_bx_unacon"><![CDATA[UNA-соединение]]></string>
+	<string name="_bx_unacon_wgt_cpt"><![CDATA[UNA-соединение (прекращено)]]></string>
 	<string name="_bx_unacon_settings"><![CDATA[UNA-соединение]]></string>
 	<string name="_bx_unacon_information_block"><![CDATA[
 Этот модуль может использоваться для захода на сайт используя другой UNA сайт (главный сайт). <br />

+ 3 - 0
modules/boonex/russian/updates/15.0.5_15.0.6/install/config.php

@@ -45,10 +45,13 @@ $aConfig = array(
      */
     'language_category' => array(
         array('name' => 'Albums', 'path' => 'bx_albums/'),
+        array('name' => 'Chat+', 'path' => 'bx_chat_plus/'),
+        array('name' => 'Data Fox', 'path' => 'bx_datafox/'),
         array('name' => 'Market', 'path' => 'bx_market/'),
         array('name' => 'MassMailer', 'path' => 'bx_massmailer/'),
         array('name' => 'Notifications', 'path' => 'bx_notifications/'),
         array('name' => 'Tasks', 'path' => 'bx_tasks/'),
+        array('name' => 'UNA Connect', 'path' => 'bx_unacon/'),
         array('name' => 'System', 'path' => 'system/'),
     ),
 

+ 4 - 0
modules/boonex/russian/updates/15.0.5_15.0.6/install/langs/bx_chat_plus/ru.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="ru" flag="ru" title="Russian">
+	<string_add name="_bx_chat_plus_wgt_cpt"><![CDATA[RocketChat (прекращено)]]></string_add>
+</resources>

+ 4 - 0
modules/boonex/russian/updates/15.0.5_15.0.6/install/langs/bx_datafox/ru.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="ru" flag="ru" title="Russian">
+	<string_add name="_bx_datafox_wgt_cpt"><![CDATA[Data Fox (прекращено)]]></string_add>
+</resources>

+ 4 - 0
modules/boonex/russian/updates/15.0.5_15.0.6/install/langs/bx_unacon/ru.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="ru" flag="ru" title="Russian">
+	<string_add name="_bx_unacon_wgt_cpt"><![CDATA[UNA-соединение (прекращено)]]></string_add>
+</resources>

+ 39 - 0
modules/boonex/russian/updates/15.0.5_15.0.6/source/data/langs/bx_chat_plus/ru.xml

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="ru" flag="ru" title="Russian">
+	<string name="_sys_module_chat_plus"><![CDATA[RocketChat]]></string>
+	<string name="_bx_chat_plus"><![CDATA[RocketChat]]></string>
+    <string name="_bx_chat_plus_wgt_cpt"><![CDATA[RocketChat (прекращено)]]></string>
+	<string name="_bx_chat_plus_chat"><![CDATA[Чат]]></string>
+
+	<string name="_bx_chat_plus_setting"><![CDATA[Настройки чата]]></string>
+    <string name="_bx_chat_plus_adm_stg_cpt_type"><![CDATA[RocketChat]]></string>
+    <string name="_bx_chat_plus_adm_stg_cpt_category_general"><![CDATA[Общие]]></string>
+    <string name="_bx_chat_plus_option_url"><![CDATA[Чат URL]]></string>
+    <string name="_bx_chat_plus_option_helpdesk"><![CDATA[Включить чат поддержки сайта]]></string>
+    <string name="_bx_chat_plus_option_helpdesk_guest_only"><![CDATA[Показывать чат поддержки сайта только для гостей]]></string>
+
+    <string name="_bx_chat_plus_menu_item_title_entries_home"><![CDATA[Чат]]></string>
+    <string name="_bx_chat_plus_menu_item_title_system_entries_home"><![CDATA[RocketChat]]></string>
+
+    <string name="_bx_chat_plus_page_title_chat"><![CDATA[Чат]]></string>
+    <string name="_bx_chat_plus_page_title_sys_chat"><![CDATA[RocketChat]]></string>
+    <string name="_bx_chat_plus_page_block_title_chat"><![CDATA[Чат]]></string>
+
+	<string name="_bx_chat_plus_not_configured"><![CDATA[Чат не сконфигурирован]]></string>
+	<string name="_bx_chat_plus_open_in_separate_window"><![CDATA[Полно-экранный режим]]></string>
+	<string name="_bx_chat_plus_information"><![CDATA[Информация]]></string>
+	<string name="_bx_chat_plus_information_block"><![CDATA[Чат сервер должен быть сконфигурирован, чтобы этот модуль заработал. <br />
+
+Нужно ввести URL чата в настройках этого модуля. <br />
+
+Затем OAuth модуль должен быть сконфигурирован. <a href="{0}studio/module.php?name=bx_oauth&page=settings">Сгенерируйте пару Ключ & Секрет</a> в модуле OAuth2 сервер указав адрес чата и произвольный заголовок. <br />
+
+После того как пара Ключ & Секрет сгенерированы, нужно указать их в чате: <br />
+Администрирование &gt; OAuth &gt; UNA.
+
+<hr />
+
+Чтобы заработала "Служба поддержки" нужно включить эту функцию настройках этого модуля и в чате: Администрирование &gt; Livechat.
+Вставлять специальный JavaScript код не нужно - это делается автоматически.]]></string>
+
+</resources>

+ 8 - 0
modules/boonex/russian/updates/15.0.5_15.0.6/source/data/langs/bx_datafox/ru.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="ru" flag="ru" title="Russian">
+	<string name="_bx_datafox"><![CDATA[Data Fox]]></string>
+    <string name="_bx_datafox_wgt_cpt"><![CDATA[Data Fox (прекращено)]]></string>
+    <string name="_bx_datafox_adm_stg_cpt_type"><![CDATA[Data Fox]]></string>
+    <string name="_bx_datafox_adm_stg_cpt_category_general"><![CDATA[Общие]]></string>
+</resources>
+

+ 29 - 0
modules/boonex/russian/updates/15.0.5_15.0.6/source/data/langs/bx_unacon/ru.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="ru" flag="ru" title="Russian">
+	<string name="_sys_module_unacon"><![CDATA[UNA-соединение]]></string>
+	<string name="_bx_unacon"><![CDATA[UNA-соединение]]></string>
+	<string name="_bx_unacon_wgt_cpt"><![CDATA[UNA-соединение (прекращено)]]></string>
+	<string name="_bx_unacon_settings"><![CDATA[UNA-соединение]]></string>
+	<string name="_bx_unacon_information_block"><![CDATA[
+Этот модуль может использоваться для захода на сайт используя другой UNA сайт (главный сайт). <br />
+Для этого нужно зайти на главный сайт, установить модуль "OAuth2 Server", добавить новый клиентский сайт, указав любой заголовок и следующий URL: <br />
+<strong>{0}</strong><br />
+Затем нужно ввести полученные ключ и секретный код в настройках этого модуля]]></string>
+	<string name="_bx_unacon_profile_error_api_keys"><![CDATA[Пожалуйста, настройте модуль в административной панели (невозможно определить ключи)]]></string>
+	<string name="_bx_unacon_chart"><![CDATA[UNA профили]]></string>
+	<string name="_bx_unacon_auth_title"><![CDATA[Вход через UNA]]></string>
+
+    <string name="_bx_unacon_adm_stg_cpt_type"><![CDATA[UNA-соединение]]></string>
+    <string name="_bx_unacon_option_app_id"><![CDATA[UNA App ID]]></string>
+    <string name="_bx_unacon_option_app_secret"><![CDATA[UNA App Secret]]></string>
+    <string name="_bx_unacon_option_app_url"><![CDATA[URL главного UNA сайта]]></string>
+    <string name="_bx_unacon_option_auto_friends"><![CDATA[Автоматически делать друзьями тех, что уже друг на другом UNA сайте]]></string>
+    <string name="_bx_unacon_option_rewrite"><![CDATA[Использовать преобразованные ссылки на главном UNA сайте]]></string>
+
+	<string name="_bx_unacon_et_password_generated"><![CDATA[UNA-соединение: временный пароль]]></string>
+	<string name="_bx_unacon_et_password_generated_subject"><![CDATA[Временный пароль]]></string>
+	<string name="_bx_unacon_et_password_generated_body"><![CDATA[{email_header}
+<p>Временный пароль - <b>{password}</b></p>
+<p>Его нужно изменить, после первого захода на сайт.</p>
+{email_footer}]]></string>
+</resources>

+ 8 - 0
modules/boonex/una_connect/classes/BxUnaConModule.php

@@ -51,6 +51,14 @@ class BxUnaConModule extends BxBaseModConnectModule
         return $this->_actionHandle();
     }
 
+    public function serviceGetActions($aWidget)
+    {
+        $oInformer = BxDolInformer::getInstance(BxDolStudioTemplate::getInstance());
+        $oInformer->add('sys-module-discontinued', _t('_adm_txt_modules_discontinued', BX_DOL_URL_STUDIO . 'design.php?name=bx_unacon', _t('_bx_unacon_settings')), BX_INFORMER_ALERT);
+
+        return bx_srv('system', 'get_actions', [$aWidget], 'TemplStudioDesigns');
+    }
+
     protected function _makeFriends($iProfileId)
     {
         return parent::__makeFriends($iProfileId);

+ 1 - 0
modules/boonex/una_connect/install/langs/en.xml

@@ -2,6 +2,7 @@
 <resources name="en" flag="gb" title="English">
 	<string name="_sys_module_unacon"><![CDATA[UNA Connect]]></string>
 	<string name="_bx_unacon"><![CDATA[UNA Connect]]></string>
+	<string name="_bx_unacon_wgt_cpt"><![CDATA[UNA Connect (discontinued)]]></string>
 	<string name="_bx_unacon_settings"><![CDATA[UNA Connect]]></string>
 	<string name="_bx_unacon_information_block"><![CDATA[
 This module can be used to login to this site using another UNA site (master site) credentials. <br />

+ 1 - 1
modules/boonex/una_connect/install/sql/install.sql

@@ -15,7 +15,7 @@ SET @iPageId = LAST_INSERT_ID();
 SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
 SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
 INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
-(@iPageId, 'bx_unacon', 'integrations', '{url_studio}module.php?name=bx_unacon', '', 'bx_unacon@modules/boonex/una_connect/|std-icon.svg', '_bx_unacon', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
+(@iPageId, 'bx_unacon', 'integrations', '{url_studio}module.php?name=bx_unacon', '', 'bx_unacon@modules/boonex/una_connect/|std-icon.svg', '_bx_unacon_wgt_cpt', '', 'a:4:{s:6:"module";s:9:"bx_unacon";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:6:"Module";}');
 INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
 (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
 

+ 1 - 1
modules/boonex/una_connect/updates/15.0.0_15.0.1/install/config.php

@@ -35,7 +35,7 @@ $aConfig = array(
     'install' => array(
         'execute_sql' => 1,
         'update_files' => 1,
-        'update_languages' => 0,
+        'update_languages' => 1,
         'clear_db_cache' => 1,
     ),
 

+ 4 - 0
modules/boonex/una_connect/updates/15.0.0_15.0.1/install/langs/en.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string_add name="_bx_unacon_wgt_cpt"><![CDATA[UNA Connect (discontinued)]]></string_add>
+</resources>

+ 4 - 0
modules/boonex/una_connect/updates/15.0.0_15.0.1/install/sql/install.sql

@@ -0,0 +1,4 @@
+-- Studio page and widget
+
+SET @iPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'bx_unacon' LIMIT 1);
+UPDATE `sys_std_widgets` SET `caption`='_bx_unacon_wgt_cpt', `cnt_actions`='a:4:{s:6:"module";s:9:"bx_unacon";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:6:"Module";}' WHERE `page_id`=@iPageId AND `module`='bx_unacon';

+ 87 - 0
modules/boonex/una_connect/updates/15.0.0_15.0.1/source/classes/BxUnaConModule.php

@@ -0,0 +1,87 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaConnect UNA Connect
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxUnaConModule extends BxBaseModConnectModule
+{
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+    }
+
+    /**
+     * Redirect to remote site login form
+     *
+     * @return n/a/ - redirect or HTML page in case of error
+     */
+    function actionStart()
+    {
+        if (isLogged())
+            $this->_redirect ($this -> _oConfig -> sDefaultRedirectUrl);
+
+        if (!$this->_oConfig->sApiID || !$this->_oConfig->sApiSecret || !$this->_oConfig->sApiUrl) {
+            require_once(BX_DIRECTORY_PATH_INC . 'design.inc.php');
+            bx_import('BxDolLanguages');
+            $sCode =  MsgBox( _t('_bx_unacon_profile_error_api_keys') );
+            $this->_oTemplate->getPage(_t('_bx_unacon'), $sCode);            
+        } 
+        else {
+
+            // define redirect URL to the remote site                
+            $sUrl = bx_append_url_params($this->_oConfig->sApiUrl . 'auth', array(
+                'response_type' => 'code',
+                'client_id' => $this->_oConfig->sApiID,
+                'redirect_uri' => $this->_oConfig->sPageHandle,
+                'scope' => $this->_oConfig->sScope,
+                'state' => $this->_genToken(),
+            ));
+            $this->_redirect($sUrl);
+        }
+    }
+
+    function actionHandle()
+    {
+        return $this->_actionHandle();
+    }
+
+    public function serviceGetActions($aWidget)
+    {
+        $oInformer = BxDolInformer::getInstance(BxDolStudioTemplate::getInstance());
+        $oInformer->add('sys-module-discontinued', _t('_adm_txt_modules_discontinued', BX_DOL_URL_STUDIO . 'design.php?name=bx_unacon', _t('_bx_unacon_settings')), BX_INFORMER_ALERT);
+
+        return bx_srv('system', 'get_actions', [$aWidget], 'TemplStudioDesigns');
+    }
+
+    protected function _makeFriends($iProfileId)
+    {
+        return parent::__makeFriends($iProfileId);
+    }
+
+    /**
+     * @param $aProfileInfo - remote profile info
+     * @param $sAlternativeName - suffix to add to NickName to make it unique
+     * @return profile array info, ready for the local database
+     */
+    protected function _convertRemoteFields($aProfileInfo, $sAlternativeName = '')
+    {
+        $aProfileFields = $aProfileInfo;
+
+        $aProfileFields['name'] = $aProfileInfo['profile_display_name'];
+        $aProfileFields['gender'] = isset($aProfileInfo['gender']) ? $aProfileInfo['gender'] : '';
+        $aProfileFields['birthday'] = isset($aProfileInfo['birthday']) ? $aProfileInfo['birthday'] : '';
+        $aProfileFields['fullname'] = $aProfileInfo['profile_display_name'];
+        $aProfileFields['picture'] = $aProfileInfo['picture'];
+        $aProfileFields['allow_view_to'] = getParam('bx_unacon_privacy');
+        
+        return $aProfileFields;
+    }
+}
+
+/** @} */

+ 29 - 0
modules/boonex/una_connect/updates/15.0.0_15.0.1/source/install/langs/en.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string name="_sys_module_unacon"><![CDATA[UNA Connect]]></string>
+	<string name="_bx_unacon"><![CDATA[UNA Connect]]></string>
+	<string name="_bx_unacon_wgt_cpt"><![CDATA[UNA Connect (discontinued)]]></string>
+	<string name="_bx_unacon_settings"><![CDATA[UNA Connect]]></string>
+	<string name="_bx_unacon_information_block"><![CDATA[
+This module can be used to login to this site using another UNA site (master site) credentials. <br />
+To make it work, go to the master site, install "OAuth2 Server" module and add new client site, specify the desired title and the following URL:<br />
+<strong>{0}</strong><br />
+Then enter generated on the master site the Key & Server pair in this module settings.]]></string>
+	<string name="_bx_unacon_profile_error_api_keys"><![CDATA[Please configure the module in admin panel (can't define API key, secret & URL)]]></string>
+	<string name="_bx_unacon_chart"><![CDATA[UNA Profiles]]></string>
+	<string name="_bx_unacon_auth_title"><![CDATA[Login with UNA]]></string>
+
+    <string name="_bx_unacon_adm_stg_cpt_type"><![CDATA[UNA Connect]]></string>
+    <string name="_bx_unacon_option_app_id"><![CDATA[UNA App ID]]></string>
+    <string name="_bx_unacon_option_app_secret"><![CDATA[UNA App Secret]]></string>
+    <string name="_bx_unacon_option_app_url"><![CDATA[Main UNA Site URL]]></string>
+    <string name="_bx_unacon_option_auto_friends"><![CDATA[Auto-friend members if they are already friends on other UNA site]]></string>
+    <string name="_bx_unacon_option_rewrite"><![CDATA[Use rewrite URLs on main UNA site]]></string>
+
+	<string name="_bx_unacon_et_password_generated"><![CDATA[UNA connect temporary password]]></string>
+	<string name="_bx_unacon_et_password_generated_subject"><![CDATA[Temporary password]]></string>
+	<string name="_bx_unacon_et_password_generated_body"><![CDATA[{email_header}
+<p>Temporary password - <b>{password}</b></p>
+<p>Change it after logging-in.</p>
+{email_footer}]]></string>
+</resources>

+ 20 - 0
modules/boonex/una_connect/updates/15.0.0_15.0.1/source/install/sql/install.sql

@@ -0,0 +1,20 @@
+CREATE TABLE `bx_unacon_accounts` (
+  `local_profile` int(10) unsigned NOT NULL,
+  `remote_profile` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`local_profile`),
+  KEY `remote_profile` (`remote_profile`)
+);
+
+-- Studio page and widget
+
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_unacon', '_bx_unacon', '_bx_unacon', 'bx_unacon@modules/boonex/una_connect/|std-icon.svg');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, 'bx_unacon', 'integrations', '{url_studio}module.php?name=bx_unacon', '', 'bx_unacon@modules/boonex/una_connect/|std-icon.svg', '_bx_unacon_wgt_cpt', '', 'a:4:{s:6:"module";s:9:"bx_unacon";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:6:"Module";}');
+INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
+(@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
+