Sfoglia il codice sorgente

#2379 events & spaces apps, rus, fixes

RomanL 6 anni fa
parent
commit
3c3743a7d3
31 ha cambiato i file con 381 aggiunte e 46 eliminazioni
  1. 14 13
      modules/base/groups/classes/BxBaseModGroupsAlertsResponse.php
  2. 10 0
      modules/base/groups/classes/BxBaseModGroupsDb.php
  3. 7 0
      modules/base/groups/classes/BxBaseModGroupsGridInvites.php
  4. 7 3
      modules/base/groups/classes/BxBaseModGroupsPageEntry.php
  5. 4 4
      modules/base/groups/template/popup_invite.html
  6. 1 0
      modules/boonex/english/data/langs/system/en.xml
  7. 13 2
      modules/boonex/events/classes/BxEventsConfig.php
  8. 21 0
      modules/boonex/events/classes/BxEventsGridInvites.php
  9. 14 2
      modules/boonex/events/install/langs/en.xml
  10. 3 3
      modules/boonex/events/install/sql/disable.sql
  11. 34 3
      modules/boonex/events/install/sql/enable.sql
  12. 9 0
      modules/boonex/events/install/sql/install.sql
  13. 1 1
      modules/boonex/events/install/sql/uninstall.sql
  14. 50 0
      modules/boonex/events/js/invite_popup.js
  15. 1 0
      modules/boonex/events/template/popup_invite.html
  16. 6 1
      modules/boonex/groups/classes/BxGroupsConfig.php
  17. 3 2
      modules/boonex/groups/install/sql/enable.sql
  18. 0 1
      modules/boonex/groups/js/invite_popup.js
  19. 12 0
      modules/boonex/russian/data/langs/bx_events/ru.xml
  20. 12 0
      modules/boonex/russian/data/langs/bx_groups/ru.xml
  21. 13 1
      modules/boonex/russian/data/langs/bx_spaces/ru.xml
  22. 1 0
      modules/boonex/russian/data/langs/system/ru.xml
  23. 14 3
      modules/boonex/spaces/classes/BxSpacesConfig.php
  24. 21 0
      modules/boonex/spaces/classes/BxSpacesGridInvites.php
  25. 12 0
      modules/boonex/spaces/install/langs/en.xml
  26. 3 3
      modules/boonex/spaces/install/sql/disable.sql
  27. 34 3
      modules/boonex/spaces/install/sql/enable.sql
  28. 9 0
      modules/boonex/spaces/install/sql/install.sql
  29. 1 1
      modules/boonex/spaces/install/sql/uninstall.sql
  30. 50 0
      modules/boonex/spaces/js/invite_popup.js
  31. 1 0
      modules/boonex/spaces/template/popup_invite.html

+ 14 - 13
modules/base/groups/classes/BxBaseModGroupsAlertsResponse.php

@@ -59,20 +59,21 @@ class BxBaseModGroupsAlertsResponse extends BxBaseModProfileAlertsResponse
         if (isset($CNF["TABLE_INVITES"])){
             if (!isset($CNF['OBJECT_CONNECTIONS']) || !($oConnection = BxDolConnection::getObjectInstance($CNF['OBJECT_CONNECTIONS'])))
                 return '';
-
+            
             if($oConnection && $oConnection->isConnected($iSender, $oAlert->iSender)){
-                $oKeys = BxDolKey::getInstance();
-                $iKeyLifetime = $CNF["INVITES_KEYS_LIFETIME"];
-                $sKey = $oKeys->getNewKey(false, $iKeyLifetime);
-                $this->_oModule->_oDb->insertInvite($sKey, $oAlert->iSender, $iSender, $iProfileId);
-              
-                $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $oAlert->iObject . "&key=" . $sKey);
-                sendMailTemplate($this->_oModule->_oConfig->CNF['EMAIL_INVITATION'], 0, $iProfileId, array(
-                    'InviterUrl' => BxDolProfile::getInstance($iSender)->getUrl(),
-                    'InviterDisplayName' => BxDolProfile::getInstance($iSender)->getDisplayName(),
-                    'EntryUrl' => $sEntryUrl,
-                    'EntryTitle' => $oAlert->aExtras['entry_title'],
-                ), BX_EMAIL_NOTIFY);
+                if ($this->_oModule->_oDb->getInviteByInvited($iProfileId, $oAlert->iSender) == 0){
+                    $oKeys = BxDolKey::getInstance();
+                    $iKeyLifetime = $CNF["INVITES_KEYS_LIFETIME"];
+                    $sKey = $oKeys->getNewKey(false, $iKeyLifetime);
+                    $this->_oModule->_oDb->insertInvite($sKey, $oAlert->iSender, $iSender, $iProfileId);
+                    $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $oAlert->iObject . "&key=" . $sKey);
+                    sendMailTemplate($this->_oModule->_oConfig->CNF['EMAIL_INVITATION'], 0, $iProfileId, array(
+                        'InviterUrl' => BxDolProfile::getInstance($iSender)->getUrl(),
+                        'InviterDisplayName' => BxDolProfile::getInstance($iSender)->getDisplayName(),
+                        'EntryUrl' => $sEntryUrl,
+                        'EntryTitle' => $oAlert->aExtras['entry_title'],
+                    ), BX_EMAIL_NOTIFY);
+                }
             }
         }
         else{

+ 10 - 0
modules/base/groups/classes/BxBaseModGroupsDb.php

@@ -128,6 +128,16 @@ class BxBaseModGroupsDb extends BxBaseModProfileDb
         return $this->getRow("SELECT * FROM `" . $CNF["TABLE_INVITES"] . "` WHERE `key` = :key AND group_profile_id = :group_profile_id", $aBindings);
     }
     
+    public function getInviteByInvited($iInvitedProfileId, $iGroupProfileId)
+    {
+        $aBindings = array(
+            'invited_profile_id' => $iInvitedProfileId,
+            'group_profile_id' => $iGroupProfileId
+        );
+        $CNF = $this->_oConfig->CNF; 
+        return $this->getOne("SELECT COUNT(*) FROM `" . $CNF["TABLE_INVITES"] . "` WHERE `invited_profile_id` = :invited_profile_id AND group_profile_id = :group_profile_id", $aBindings);
+    }
+    
     public function updateInviteByKey($sKey, $iGroupProfileId, $sColumn, $sValue)
     {
         $aBindings = array(

+ 7 - 0
modules/base/groups/classes/BxBaseModGroupsGridInvites.php

@@ -21,6 +21,8 @@ class BxBaseModGroupsGridinvites extends BxTemplGrid
         $this->_oModule = BxDolModule::getInstance($this->_sContentModule);
 
         parent::__construct ($aOptions, $oTemplate);
+        
+        $this->_aQueryAppend['profile_id'] = (int)bx_get('profile_id');
     }
     
     protected function _getCellName ($mixedValue, $sKey, $aField, $aRow)
@@ -32,6 +34,11 @@ class BxBaseModGroupsGridinvites extends BxTemplGrid
         return parent::_getCellDefault ($oProfile->getUnit(), $sKey, $aField, $aRow);
     }
     
+    protected function _getCellAdded ($mixedValue, $sKey, $aField, $aRow)
+    {
+        return parent::_getCellDefault(bx_time_js($mixedValue), $sKey, $aField, $aRow);
+    }
+    
     protected function _getActionDelete ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
     {
         $aCheck = checkActionModule(bx_get_logged_profile_id(), 'delete invites', $this->_sContentModule, false);

+ 7 - 3
modules/base/groups/classes/BxBaseModGroupsPageEntry.php

@@ -53,15 +53,19 @@ class BxBaseModGroupsPageEntry extends BxBaseModProfilePageEntry
             
             $aData = $this->_oModule->_oDb->getInviteByKey($sKey,  $this->_oProfile->id());
             if (!isset($aData['invited_profile_id'])){
-                $sRv = _t('_bx_groups_txt_invite_popup_error_invitation_absent');
+                $sRv = _t($CNF['T']['txt_invitation_popup_error_invitation_absent']);
             }
             else{
                 if ($aData['invited_profile_id'] != bx_get_logged_profile_id()){
-                    $sRv = _t('_bx_groups_txt_invite_popup_error_invitation_wrong_user');
+                    $sRv = _t($CNF['T']['txt_invitation_popup_error_wrong_user']);
                 }
                 else{
                     $sRv = $this->_oModule->_oTemplate->parseHtmlByName('popup_invite.html', array(
-                        'PopupId' => $sId
+                        'popup_id' => $sId,
+						'text' => _t($CNF['T']['txt_invitation_popup_text']),
+						'button_accept' => _t($CNF['T']['txt_invitation_popup_accept_button']),
+						'button_decline' => _t($CNF['T']['txt_invitation_popup_decline_button']),
+						
                     ));
                 }
             }

+ 4 - 4
modules/base/groups/template/popup_invite.html

@@ -1,13 +1,13 @@
-<div class="bx-def-padding" id="__PopupId___wrp">
+<div class="bx-def-padding" id="__popup_id___wrp">
     <div class=" bx-form-input-wrapper bx-form-input-wrapper-text">
-        <bx_text:_bx_groups_txt_invite_popup_text />
+        __text__
     </div>
     <div class="bx-def-margin-top bx-clearfix">
         <button class="bx-btn bx-def-margin-thd bx-invite-accept" type="button">
-            <bx_text:_bx_groups_txt_invite_popup_button_accept />
+            __button_accept__
         </button>
         <button class="bx-btn bx-def-margin-thd bx-invite-decline" type="button">
-            <bx_text:_bx_groups_txt_invite_popup_button_decline />
+            __button_decline__
         </button>
     </div>
 </div>

+ 1 - 0
modules/boonex/english/data/langs/system/en.xml

@@ -2643,6 +2643,7 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_mobile_search"><![CDATA[Search]]></string>
 	<string name="_sys_mobile_status"><![CDATA[Status]]></string>
     <string name="_sys_name"><![CDATA[Name]]></string>
+    <string name="_sys_added"><![CDATA[Added]]></string>
     <string name="_sys_next"><![CDATA[Next]]></string>
     <string name="_sys_notification_account"><![CDATA[Accounts created in the last 24 hours:]]></string>
     <string name="_sys_not_available"><![CDATA[n/a]]></string>

+ 13 - 2
modules/boonex/events/classes/BxEventsConfig.php

@@ -38,6 +38,7 @@ class BxEventsConfig extends BxBaseModProfileConfig
             'TABLE_ENTRIES' => $aModule['db_prefix'] . 'data',
             'TABLE_ENTRIES_FULLTEXT' => 'search_fields',
             'TABLE_ADMINS' => $aModule['db_prefix'] . 'admins',
+            'TABLE_INVITES' => $aModule['db_prefix'] . 'invites',
 
             // database fields
             'FIELD_ID' => 'id',
@@ -127,11 +128,13 @@ class BxEventsConfig extends BxBaseModProfileConfig
             'OBJECT_GRID_ADMINISTRATION' => 'bx_events_administration',
             'OBJECT_GRID_COMMON' => 'bx_events_common',
             'OBJECT_GRID_CONNECTIONS' => 'bx_events_fans',
+            'OBJECT_GRID_INVITES' => 'bx_events_invites',
             'OBJECT_CONNECTIONS' => 'bx_events_fans',
             'OBJECT_UPLOADERS_COVER' => array('bx_events_cover_crop'),
             'OBJECT_UPLOADERS_PICTURE' => array('bx_events_picture_crop'),
             
             'BADGES_AVALIABLE' => true,
+            'INVITES_KEYS_LIFETIME' => 86400,
             'ENABLE_FOR_CONTEXT_IN_MODULES' => array('bx_groups'),
 
             'EMAIL_INVITATION' => 'bx_events_invitation',
@@ -204,18 +207,26 @@ class BxEventsConfig extends BxBaseModProfileConfig
                 'menu_item_title_become_fan' => '_bx_events_menu_item_title_become_fan',
             	'txt_all_entries_by_author' => '_bx_events_page_title_browse_by_author',
                 'txt_all_entries_by_context' => '_bx_events_page_title_browse_by_context',
+                'txt_invitation_popup_title' => '_bx_events_txt_invite_popup_title',
+                'txt_invitation_popup_text' => '_bx_events_txt_invite_popup_text',
+				'txt_invitation_popup_accept_button' => '_bx_events_txt_invite_popup_button_accept',
+				'txt_invitation_popup_decline_button' => '_bx_events_txt_invite_popup_button_decline',
+                'txt_invitation_popup_error_invitation_absent' => '_bx_events_txt_invite_popup_error_invitation_absent',
+				'txt_invitation_popup_error_wrong_user' => '_bx_events_txt_invite_popup_error_invitation_wrong_user',
             ),
 
         );
 
         $this->_aJsClasses = array(
             'entry' => 'BxEventsEntry',
-            'manage_tools' => 'BxEventsManageTools'
+            'manage_tools' => 'BxEventsManageTools',
+            'invite_popup' => 'BxEventsInvitePopup'
         );
 
         $this->_aJsObjects = array(
             'entry' => 'oBxEventsEntry',
-            'manage_tools' => 'oBxEventsManageTools'
+            'manage_tools' => 'oBxEventsManageTools',
+            'invite_popup' => 'oBxEventsInvitePopup'
         );
 
         $this->_aGridObjects = array(

+ 21 - 0
modules/boonex/events/classes/BxEventsGridInvites.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Events Events
+ * @ingroup     UnaModules
+ * 
+ * @{
+ */
+
+class BxEventsGridinvites extends BxBaseModGroupsGridInvites
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        $this->_sContentModule = 'bx_events';
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 14 - 2
modules/boonex/events/install/langs/en.xml

@@ -72,10 +72,11 @@
     <string name="_bx_events_form_input_repeat_day_of_week"><![CDATA[Repeat day of week]]></string>
     <string name="_bx_events_form_input_stop_repeating"><![CDATA[Stop repeating]]></string>
 
-	<string name="_bx_events_acl_action_create_profile"><![CDATA[Create Event]]></string>
-	<string name="_bx_events_acl_action_delete_profile"><![CDATA[Delete Event]]></string>
+  <string name="_bx_events_acl_action_create_profile"><![CDATA[Create Event]]></string>
+  <string name="_bx_events_acl_action_delete_profile"><![CDATA[Delete Event]]></string>
 	<string name="_bx_events_acl_action_view_profile"><![CDATA[View Event]]></string>
 	<string name="_bx_events_acl_action_edit_any_profile"><![CDATA[Edit Any Event]]></string>
+  <string name="_bx_events_acl_action_delete_invites"><![CDATA[Delete Invites]]></string>
 
 	<string name="_bx_events_page_title_sys_joined_entries"><![CDATA[Profile Events]]></string>
 	<string name="_bx_events_page_title_joined_entries"><![CDATA[Profile Events]]></string>
@@ -153,6 +154,8 @@
     <string name="_bx_events_page_block_title_fans_link"><![CDATA[Going to <a href="{profile_link}">{display_name}</a>]]></string>
     <string name="_bx_events_page_block_title_fans"><![CDATA[Going]]></string>
     <string name="_bx_events_page_block_title_system_fans"><![CDATA[Going]]></string>
+    <string name="_bx_events_page_block_title_fans_invites"><![CDATA[Приглашения]]></string>
+    <string name="_bx_events_page_block_title_system_invites"><![CDATA[Приглашения]]></string>
     <string name="_bx_events_page_block_title_subscribers_link"><![CDATA[Interested in <a href="{profile_link}">{display_name}</a>]]></string>
     <string name="_bx_events_page_block_title_subscribers"><![CDATA[Interested]]></string>
     <string name="_bx_events_page_block_title_system_subscribers"><![CDATA[Interested]]></string>
@@ -165,6 +168,7 @@
     <string name="_bx_events_page_block_title_system_manage_administration"><![CDATA[Manage All Events]]></string>
     <string name="_bx_events_page_block_title_manage"><![CDATA[Manage Events]]></string>
     <string name="_bx_events_page_block_title_top_profiles"><![CDATA[Top Events]]></string>
+    <string name="_bx_events_page_block_title_joined_profiles"><![CDATA[Joined Events]]></string>
     <string name="_bx_events_page_block_title_past_profiles"><![CDATA[Past Events]]></string>
     <string name="_bx_events_page_block_title_entry_all_actions"><![CDATA[All Actions]]></string>
     <string name="_bx_events_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>
@@ -264,6 +268,8 @@
     <string name="_bx_events_menu_item_title_entries_recent"><![CDATA[New]]></string>
     <string name="_bx_events_menu_item_title_system_entries_search"><![CDATA[Search]]></string>
     <string name="_bx_events_menu_item_title_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_events_menu_item_title_system_entries_joined"><![CDATA[Joined]]></string>
+    <string name="_bx_events_menu_item_title_entries_joined"><![CDATA[Joined]]></string>
     <string name="_bx_events_menu_item_title_system_entries_manage"><![CDATA[Manage]]></string>
     <string name="_bx_events_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
     <string name="_bx_events_menu_item_title_system_entries_home"><![CDATA[Events]]></string>
@@ -315,6 +321,12 @@
     <string name="_bx_events_txt_from_admins"><![CDATA[From Admins]]></string>
     <string name="_bx_events_txt_private_group"><![CDATA[Private event]]></string>
     <string name="_bx_events_txt_from_time_to_time"><![CDATA[{0} - {1}]]></string>
+    <string name="_bx_events_txt_invite_popup_text"><![CDATA[You have been invited to a event. Click the button below to accept the invitation.]]></string>
+    <string name="_bx_events_txt_invite_popup_title"><![CDATA[Invitation to a event]]></string>
+    <string name="_bx_events_txt_invite_popup_button_accept"><![CDATA[Accept]]></string>
+    <string name="_bx_events_txt_invite_popup_button_decline"><![CDATA[Decline]]></string>
+    <string name="_bx_events_txt_invite_popup_error_invitation_absent"><![CDATA[Sorry, an error has occurred. You can not join this event. The invitation is expired or deleted.]]></string>
+    <string name="_bx_events_txt_invite_popup_error_invitation_wrong_user"><![CDATA[Sorry, an error has occurred. You can not join this event. This invitation cannot be used by you.]]></string>
 
 	<string name="_bx_events_alert_action_fan_added"><![CDATA[member joined]]></string>
     <string name="_bx_events_txt_ntfs_fan_added"><![CDATA[Event <b class="bx-ntfs-content-profile">{owner_name}</b> has got a member <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>

+ 3 - 3
modules/boonex/events/install/sql/disable.sql

@@ -38,9 +38,9 @@ DELETE FROM `sys_statistics` WHERE `name` LIKE 'bx_events%';
 DELETE FROM `sys_objects_chart` WHERE `object` LIKE 'bx_events%';
 
 -- GRIDS
-DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_events_administration', 'bx_events_moderation', 'bx_events_common', 'bx_events_fans');
-DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_events_administration', 'bx_events_moderation', 'bx_events_common', 'bx_events_fans');
-DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_events_administration', 'bx_events_moderation', 'bx_events_common', 'bx_events_fans');
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_events_administration', 'bx_events_moderation', 'bx_events_common', 'bx_events_fans', 'bx_events_invites');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_events_administration', 'bx_events_moderation', 'bx_events_common', 'bx_events_fans', 'bx_events_invites');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_events_administration', 'bx_events_moderation', 'bx_events_common', 'bx_events_fans', 'bx_events_invites');
 
 -- ALERTS
 SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_events' LIMIT 1);

+ 34 - 3
modules/boonex/events/install/sql/enable.sql

@@ -106,7 +106,8 @@ INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module
 
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
 ('bx_events_fans', 1, 'bx_events', '_bx_events_page_block_title_system_fans', '_bx_events_page_block_title_fans_link', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_events";s:6:"method";s:10:"fans_table";}', 0, 0, 1, 1),
-('bx_events_fans', 1, 'bx_events', '_bx_events_page_block_title_system_subscribers', '_bx_events_page_block_title_subscribers_link', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:6:"system";s:6:"method";s:19:"subscribed_me_table";s:5:"class";s:23:"TemplServiceConnections";}', 0, 0, 1, 2);
+('bx_events_fans', 1, 'bx_events', '_bx_events_page_block_title_system_subscribers', '_bx_events_page_block_title_subscribers_link', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:6:"system";s:6:"method";s:19:"subscribed_me_table";s:5:"class";s:23:"TemplServiceConnections";}', 0, 0, 1, 2),
+('bx_events_fans', 1, 'bx_events', '_bx_events_page_block_title_system_invites', '_bx_events_page_block_title_fans_invites', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_events";s:6:"method";s:13:"invites_table";}', 0, 0, 1, 3);
 
 -- PAGE: view entry comments
 
@@ -169,6 +170,15 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbo
 ('bx_events_search', 1, 'bx_events', '_bx_events_page_block_title_search_form_cmts', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:8:"get_form";s:6:"params";a:1:{i:0;a:1:{s:6:"object";s:14:"bx_events_cmts";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 3),
 ('bx_events_search', 1, 'bx_events', '_bx_events_page_block_title_search_results_cmts', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_results";s:6:"params";a:1:{i:0;a:2:{s:6:"object";s:14:"bx_events_cmts";s:10:"show_empty";b:1;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 4);
 
+-- PAGE: joined profiles
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_joined_events', '_bx_events_page_title_sys_joined', '_bx_events_page_title_joined', 'bx_events', 5, 2147483647, 1, 'events-joined', 'page.php?i=events-joined', '', '', '', 0, 1, 0, 'BxEventsPageBrowse', 'modules/boonex/events/classes/BxEventsPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_joined_events', 1, 'bx_events', '_bx_events_page_block_title_joined_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_events";s:6:"method";s:21:"browse_joined_entries";s:6:"params";a:2:{i:0;s:12:"{profile_id}";i:1;b:1;}}', 0, 1, 0);
+
+
 -- PAGE: module manage own
 INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
 ('bx_events_manage', '_bx_events_page_title_sys_manage', '_bx_events_page_title_manage', 'bx_events', 5, 2147483647, 1, 'events-manage', 'page.php?i=events-manage', '', '', '', 0, 1, 0, 'BxEventsPageBrowse', 'modules/boonex/events/classes/BxEventsPageBrowse.php');
@@ -318,7 +328,8 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 ('bx_events_submenu', 'bx_events', 'events-past', '_bx_events_menu_item_title_system_entries_past', '_bx_events_menu_item_title_entries_past', 'page.php?i=events-past', '', '', '', '', 2147483647, 1, 1, 3),
 ('bx_events_submenu', 'bx_events', 'events-calendar', '_bx_events_menu_item_title_system_calendar', '_bx_events_menu_item_title_calendar', 'page.php?i=events-calendar', '', '', '', '', 2147483647, 1, 1, 4),
 ('bx_events_submenu', 'bx_events', 'events-search', '_bx_events_menu_item_title_system_entries_search', '_bx_events_menu_item_title_entries_search', 'page.php?i=events-search', '', '', '', '', 2147483647, 1, 1, 5),
-('bx_events_submenu', 'bx_events', 'events-manage', '_bx_events_menu_item_title_system_entries_manage', '_bx_events_menu_item_title_entries_manage', 'page.php?i=events-manage', '', '', '', '', 2147483646, 1, 1, 6);
+('bx_events_submenu', 'bx_events', 'events-joined', '_bx_events_menu_item_title_system_entries_joined', '_bx_events_menu_item_title_entries_joined', 'page.php?i=events-joined', '', '', '', '', 2147483647, 1, 1, 6),
+('bx_events_submenu', 'bx_events', 'events-manage', '_bx_events_menu_item_title_system_entries_manage', '_bx_events_menu_item_title_entries_manage', 'page.php?i=events-manage', '', '', '', '', 2147483646, 1, 1, 7);
 
 -- MENU: view submenu
 
@@ -403,6 +414,10 @@ INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`,
 ('bx_events', 'edit any entry', NULL, '_bx_events_acl_action_edit_any_profile', '', 1, 3);
 SET @iIdActionProfileEditAny = LAST_INSERT_ID();
 
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_events', 'delete invites', NULL, '_bx_events_acl_action_delete_invites', '', 1, 3);
+SET @iIdActionProfileDeleteInvites = LAST_INSERT_ID();
+
 SET @iUnauthenticated = 1;
 SET @iAccount = 2;
 SET @iStandard = 3;
@@ -445,7 +460,11 @@ INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
 
 -- any profile edit
 (@iModerator, @iIdActionProfileEditAny),
-(@iAdministrator, @iIdActionProfileEditAny);
+(@iAdministrator, @iIdActionProfileEditAny),
+
+-- any invites edit
+(@iModerator, @iIdActionProfileDeleteInvites),
+(@iAdministrator, @iIdActionProfileDeleteInvites);
 
 -- METATAGS
 INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
@@ -489,6 +508,18 @@ INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `conf
 ('bx_events_fans', 'single', 'from_admins', '_bx_events_txt_from_admins', '', 0, 30),
 ('bx_events_fans', 'single', 'delete', '', 'remove', 1, 40);
 
+-- GRID: invites
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `responsive`, `override_class_name`, `override_class_file`) VALUES
+('bx_events_invites', 'Sql', 'SELECT `bx_events_invites`.`id`, `bx_events_invites`.`invited_profile_id`, `bx_events_invites`.`added`, `bx_events_invites`.`author_profile_id` FROM `sys_profiles` AS `p` INNER JOIN `sys_accounts` AS `a` ON (`a`.`id` = `p`.`account_id`) INNER JOIN `bx_events_invites` ON `bx_events_invites`.`invited_profile_id` = `p`.`id` ', 'bx_events_invites', 'id', 'bx_events_invites`.`added', '', '', 10, NULL, 'start', '', 'name,email', '', 'auto', '', '', 2147483647, 0, 'BxEventsGridInvites', 'modules/boonex/events/classes/BxEventsGridInvites.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `params`, `order`) VALUES
+('bx_events_invites', 'name', '_sys_name', '33%', '', 10),
+('bx_events_invites', 'added', '_sys_added', '33%', '', 20),
+('bx_events_invites', 'actions', '', '34%', '', 30);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
+('bx_events_invites', 'single', 'delete', '', 'remove', 1, 10);
+
 -- GRIDS: administration
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
 ('bx_events_administration', 'Sql', 'SELECT `td`.*, `td`.`event_name` AS `name`, `ta`.`email` AS `account`, `td`.`added` AS `added_ts`, `tp`.`status` AS `status` FROM `bx_events_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_events'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_events_data', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'event_name', '', 'like', 'reports', '', 192, 'BxEventsGridAdministration', 'modules/boonex/events/classes/BxEventsGridAdministration.php'),

+ 9 - 0
modules/boonex/events/install/sql/install.sql

@@ -225,6 +225,15 @@ CREATE TABLE IF NOT EXISTS `bx_events_scores_track` (
   KEY `vote` (`object_id`, `author_nip`)
 );
 
+CREATE TABLE IF NOT EXISTS `bx_events_invites` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `key` varchar(128) NOT NULL default '0',
+  `group_profile_id` int(11) NOT NULL default '0',
+  `author_profile_id` int(11) NOT NULL default '0',
+  `invited_profile_id` int(11) NOT NULL default '0',
+  `added` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`)
+);
 
 -- STORAGES & TRANSCODERS
 INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES

+ 1 - 1
modules/boonex/events/install/sql/uninstall.sql

@@ -1,6 +1,6 @@
 
 -- TABLES
-DROP TABLE IF EXISTS `bx_events_data`, `bx_events_intervals`, `bx_events_pics`, `bx_events_pics_resized`, `bx_events_cmts`, `bx_events_views_track`, `bx_events_meta_keywords`, `bx_events_meta_locations`, `bx_events_meta_mentions`, `bx_events_fans`, `bx_events_admins`, `bx_events_votes`, `bx_events_votes_track`, `bx_events_reports`, `bx_events_reports_track`, `bx_events_favorites_track`,  `bx_events_scores`, `bx_events_scores_track`;
+DROP TABLE IF EXISTS `bx_events_data`, `bx_events_intervals`, `bx_events_pics`, `bx_events_pics_resized`, `bx_events_cmts`, `bx_events_views_track`, `bx_events_meta_keywords`, `bx_events_meta_locations`, `bx_events_meta_mentions`, `bx_events_fans`, `bx_events_admins`, `bx_events_votes`, `bx_events_votes_track`, `bx_events_reports`, `bx_events_reports_track`, `bx_events_favorites_track`,  `bx_events_scores`, `bx_events_scores_track`, `bx_events_invites`;
 
 -- PROFILES
 DELETE FROM sys_profiles WHERE `type` = 'bx_events';

+ 50 - 0
modules/boonex/events/js/invite_popup.js

@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Events Events
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+function BxEventsInvitePopup(oOptions) {
+	this._sActionsUrl = oOptions.sActionUrl;
+	this._sPopupId = oOptions.sPopupId == undefined ? {} : oOptions.sPopupId;
+	this._sKey = oOptions.sKey == undefined ? {} : oOptions.sKey;
+	this._sAcceptUrl = oOptions.sAcceptUrl == undefined ? {} : oOptions.sAcceptUrl;
+	this._sDeclineUrl = oOptions.sDeclineUrl == undefined ? {} : oOptions.sDeclineUrl;
+	this._iGroupProfileId = oOptions.iGroupProfileId == undefined ? {} : oOptions.iGroupProfileId;
+
+	var $this = this;
+	$(document).ready(function () {
+	    $this.init();
+	});
+}
+
+BxEventsInvitePopup.prototype.init = function () {
+    var $this = this;
+    $('#' + $this._sPopupId + ' .bx-invite-accept').click(function () {
+        $this.onClickAccept();
+    });
+    $('#' + $this._sPopupId + ' .bx-invite-decline').click(function () {
+        $this.onClickDecline();
+    });
+
+    $('#' + $this._sPopupId).dolPopup();
+};
+
+BxEventsInvitePopup.prototype.onClickAccept = function () {
+	var $this = this;
+	$.getJSON($this._sActionsUrl + 'ProcessInvite/' + $this._sKey + '/' + $this._iGroupProfileId + '/1/', function () {
+	    location.href = $this._sAcceptUrl
+	});
+
+};
+
+BxEventsInvitePopup.prototype.onClickDecline = function () {
+    var $this = this;
+    $.getJSON($this._sActionsUrl + 'ProcessInvite/' + $this._sKey + '/' + $this._iGroupProfileId + '/0/', function () {
+        location.href = $this._sDeclineUrl
+    });
+};

+ 1 - 0
modules/boonex/events/template/popup_invite.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/groups/template/popup_invite.html />

+ 6 - 1
modules/boonex/groups/classes/BxGroupsConfig.php

@@ -198,7 +198,12 @@ class BxGroupsConfig extends BxBaseModProfileConfig
                 'menu_item_title_become_fan' => '_bx_groups_menu_item_title_become_fan',
                 'menu_item_title_leave_group' => '_bx_groups_menu_item_title_leave_group',
                 'txt_all_entries_by_author' => '_bx_groups_page_title_browse_by_author',
-                'txt_invitation_popup_title' => '_bx_groups_txt_invite_popup_title'
+                'txt_invitation_popup_title' => '_bx_groups_txt_invite_popup_title',
+				'txt_invitation_popup_text' => '_bx_groups_txt_invite_popup_text',
+				'txt_invitation_popup_accept_button' => '_bx_groups_txt_invite_popup_button_accept',
+				'txt_invitation_popup_decline_button' => '_bx_groups_txt_invite_popup_button_decline',
+				'txt_invitation_popup_error_invitation_absent' => '_bx_groups_txt_invite_popup_error_invitation_absent',
+				'txt_invitation_popup_error_wrong_user' => '_bx_groups_txt_invite_popup_error_invitation_wrong_user',
             ),
 
         );

+ 3 - 2
modules/boonex/groups/install/sql/enable.sql

@@ -472,8 +472,9 @@ INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `fie
 ('bx_groups_invites', 'Sql', 'SELECT `bx_groups_invites`.`id`, `bx_groups_invites`.`invited_profile_id`, `bx_groups_invites`.`added`, `bx_groups_invites`.`author_profile_id` FROM `sys_profiles` AS `p` INNER JOIN `sys_accounts` AS `a` ON (`a`.`id` = `p`.`account_id`) INNER JOIN `bx_groups_invites` ON `bx_groups_invites`.`invited_profile_id` = `p`.`id` ', 'bx_groups_invites', 'id', 'bx_groups_invites`.`added', '', '', 10, NULL, 'start', '', 'name,email', '', 'auto', '', '', 2147483647, 0, 'BxGroupsGridInvites', 'modules/boonex/groups/classes/BxGroupsGridInvites.php');
 
 INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `params`, `order`) VALUES
-('bx_groups_invites', 'name', '_sys_name', '50%', '', 10),
-('bx_groups_invites', 'actions', '', '50%', '', 20);
+('bx_groups_invites', 'name', '_sys_name', '33%', '', 10),
+('bx_groups_invites', 'added', '_sys_added', '33%', '', 20),
+('bx_groups_invites', 'actions', '', '34%', '', 30);
 
 INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
 ('bx_groups_invites', 'single', 'delete', '', 'remove', 1, 10);

+ 0 - 1
modules/boonex/groups/js/invite_popup.js

@@ -44,7 +44,6 @@ BxGroupsInvitePopup.prototype.onClickAccept = function () {
 
 BxGroupsInvitePopup.prototype.onClickDecline = function () {
     var $this = this;
-    console.log(06);
     $.getJSON($this._sActionsUrl + 'ProcessInvite/' + $this._sKey + '/' + $this._iGroupProfileId + '/0/', function () {
         location.href = $this._sDeclineUrl
     });

+ 12 - 0
modules/boonex/russian/data/langs/bx_events/ru.xml

@@ -76,6 +76,7 @@
 	<string name="_bx_events_acl_action_delete_profile"><![CDATA[Удалить событие]]></string>
 	<string name="_bx_events_acl_action_view_profile"><![CDATA[Просмотреть событие]]></string>
 	<string name="_bx_events_acl_action_edit_any_profile"><![CDATA[Редактировать любое событие]]></string>
+	<string name="_bx_events_acl_action_delete_invites"><![CDATA[Удалять приглашения]]></string>
 
 	<string name="_bx_events_page_title_sys_joined_entries"><![CDATA[События профиля]]></string>
 	<string name="_bx_events_page_title_joined_entries"><![CDATA[События профиля]]></string>
@@ -153,6 +154,8 @@
     <string name="_bx_events_page_block_title_fans_link"><![CDATA[Придут на <a href="{profile_link}">{display_name}</a>]]></string>
     <string name="_bx_events_page_block_title_fans"><![CDATA[Придут]]></string>
     <string name="_bx_events_page_block_title_system_fans"><![CDATA[Придут]]></string>
+	<string name="_bx_events_page_block_title_fans_invites"><![CDATA[Invites]]></string>
+    <string name="_bx_events_page_block_title_system_invites"><![CDATA[Invites]]></string>
     <string name="_bx_events_page_block_title_subscribers_link"><![CDATA[Заинтересованы в <a href="{profile_link}">{display_name}</a>]]></string>
     <string name="_bx_events_page_block_title_subscribers"><![CDATA[Заинтересованы]]></string>
     <string name="_bx_events_page_block_title_system_subscribers"><![CDATA[Заинтересованы]]></string>
@@ -165,6 +168,7 @@
     <string name="_bx_events_page_block_title_system_manage_administration"><![CDATA[Управление всеми событиями]]></string>
     <string name="_bx_events_page_block_title_manage"><![CDATA[Управление]]></string>
     <string name="_bx_events_page_block_title_top_profiles"><![CDATA[Популярные события]]></string>
+	<string name="_bx_events_page_block_title_joined_profiles"><![CDATA[Мои события]]></string>
     <string name="_bx_events_page_block_title_past_profiles"><![CDATA[Прошедшие события]]></string>
     <string name="_bx_events_page_block_title_entry_all_actions"><![CDATA[Все действия]]></string>
     <string name="_bx_events_page_block_title_entry_social_sharing"><![CDATA[Поделиться]]></string>
@@ -265,6 +269,8 @@
     <string name="_bx_events_menu_item_title_entries_recent"><![CDATA[Новые]]></string>
     <string name="_bx_events_menu_item_title_system_entries_search"><![CDATA[Поиск]]></string>
     <string name="_bx_events_menu_item_title_entries_search"><![CDATA[Поиск]]></string>
+	<string name="_bx_events_menu_item_title_system_entries_joined"><![CDATA[Участие]]></string>
+    <string name="_bx_events_menu_item_title_entries_joined"><![CDATA[Участие]]></string>
     <string name="_bx_events_menu_item_title_system_entries_manage"><![CDATA[Управление]]></string>
     <string name="_bx_events_menu_item_title_entries_manage"><![CDATA[Управление]]></string>
     <string name="_bx_events_menu_item_title_system_entries_home"><![CDATA[События]]></string>
@@ -316,6 +322,12 @@
     <string name="_bx_events_txt_from_admins"><![CDATA[Из админов]]></string>
     <string name="_bx_events_txt_private_group"><![CDATA[Приватная группа]]></string>
     <string name="_bx_events_txt_from_time_to_time"><![CDATA[{0} - {1}]]></string>
+	<string name="_bx_events_txt_invite_popup_text"><![CDATA[Вы были приглашены на это собыите.  Нажмите кнопку ниже чтобы принять приглашение.]]></string>
+    <string name="_bx_events_txt_invite_popup_title"><![CDATA[Приглашение на собыите]]></string>
+    <string name="_bx_events_txt_invite_popup_button_accept"><![CDATA[Принять]]></string>
+    <string name="_bx_events_txt_invite_popup_button_decline"><![CDATA[Отклонить]]></string>
+    <string name="_bx_events_txt_invite_popup_error_invitation_absent"><![CDATA[Извините, произошла ошибка. Вы не можете присоединиться к этому событию. Приглашение устарело или удалено.]]></string>
+    <string name="_bx_events_txt_invite_popup_error_invitation_wrong_user"><![CDATA[Извините, произошла ошибка. Вы не можете присоединиться к этому событию. Приглашение адресовано не Вам.]]></string>
 
 	<string name="_bx_events_alert_action_fan_added"><![CDATA[присоединение нового участника]]></string>
     <string name="_bx_events_txt_ntfs_fan_added"><![CDATA[У события <b class="bx-ntfs-content-profile">{owner_name}</b> новый участник <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>

+ 12 - 0
modules/boonex/russian/data/langs/bx_groups/ru.xml

@@ -50,6 +50,7 @@
 	<string name="_bx_groups_acl_action_delete_profile"><![CDATA[Удалить группу]]></string>
 	<string name="_bx_groups_acl_action_view_profile"><![CDATA[Просмотреть группу]]></string>
 	<string name="_bx_groups_acl_action_edit_any_profile"><![CDATA[Редактировать любую группу]]></string>
+	<string name="_bx_groups_acl_action_delete_invites"><![CDATA[Удалять приглашения]]></string>
 
 	<string name="_bx_groups_page_title_sys_joined_entries"><![CDATA[Группы профиля]]></string>
 	<string name="_bx_groups_page_title_joined_entries"><![CDATA[Группы профиля]]></string>
@@ -114,6 +115,8 @@
 	<string name="_bx_groups_page_block_title_fans_link"><![CDATA[Участники группы: <a href="{profile_link}">{display_name}</a>]]></string>
 	<string name="_bx_groups_page_block_title_fans"><![CDATA[Участники]]></string>
 	<string name="_bx_groups_page_block_title_system_fans"><![CDATA[Участники]]></string>
+	<string name="_bx_groups_page_block_title_fans_invites"><![CDATA[Приглашения]]></string>
+	<string name="_bx_groups_page_block_title_system_invites"><![CDATA[Приглашения]]></string>
         <string name="_bx_groups_page_block_title_profile_location"><![CDATA[Расположение]]></string>
 	<string name="_bx_groups_page_block_title_profile_comments"><![CDATA[Комментарии]]></string>
     <string name="_bx_groups_page_block_title_profile_comments_link"><![CDATA[Комментарии к <a href="{entry_link}">{title}</a>]]></string>
@@ -124,6 +127,7 @@
 	<string name="_bx_groups_page_block_title_system_manage_administration"><![CDATA[Управление всеми группами]]></string>
 	<string name="_bx_groups_page_block_title_manage"><![CDATA[Управление]]></string>
     <string name="_bx_groups_page_block_title_top_profiles"><![CDATA[Популярные группы]]></string>
+	<string name="_bx_groups_page_block_title_joined_profiles"><![CDATA[Мои группы]]></string>
     <string name="_bx_groups_page_block_title_entry_all_actions"><![CDATA[Все действия]]></string>
     <string name="_bx_groups_page_block_title_entry_social_sharing"><![CDATA[Поделиться]]></string>
     <string name="_bx_groups_page_block_title_categories"><![CDATA[Категории групп]]></string>
@@ -221,6 +225,8 @@
     <string name="_bx_groups_menu_item_title_entries_recent"><![CDATA[Новые]]></string>
     <string name="_bx_groups_menu_item_title_system_entries_search"><![CDATA[Поиск]]></string>
     <string name="_bx_groups_menu_item_title_entries_search"><![CDATA[Поиск]]></string>
+	<string name="_bx_groups_menu_item_title_system_entries_joined"><![CDATA[Участие]]></string>
+    <string name="_bx_groups_menu_item_title_entries_joined"><![CDATA[Участие]]></string>
     <string name="_bx_groups_menu_item_title_system_entries_manage"><![CDATA[Управление]]></string>
     <string name="_bx_groups_menu_item_title_entries_manage"><![CDATA[Управление]]></string>
     <string name="_bx_groups_menu_item_title_system_entries_home"><![CDATA[Группы]]></string>
@@ -269,6 +275,12 @@
     <string name="_bx_groups_txt_to_admins"><![CDATA[В админы]]></string>
     <string name="_bx_groups_txt_from_admins"><![CDATA[Из админов]]></string>
     <string name="_bx_groups_txt_private_group"><![CDATA[Приватная группа]]></string>
+	<string name="_bx_groups_txt_invite_popup_text"><![CDATA[Вы были приглашены в эту группу.  Нажмите кнопку ниже чтобы принять приглашение.]]></string>
+    <string name="_bx_groups_txt_invite_popup_title"><![CDATA[Приглашение в группу]]></string>
+    <string name="_bx_groups_txt_invite_popup_button_accept"><![CDATA[Принять]]></string>
+    <string name="_bx_groups_txt_invite_popup_button_decline"><![CDATA[Отклонить]]></string>
+    <string name="_bx_groups_txt_invite_popup_error_invitation_absent"><![CDATA[Извините, произошла ошибка. Вы не можете вступить в эту группу. Приглашение устарело или удалено.]]></string>
+    <string name="_bx_groups_txt_invite_popup_error_invitation_wrong_user"><![CDATA[Извините, произошла ошибка. Вы не можете вступить в эту группу. Приглашение адресовано не Вам.]]></string>
 
 	<string name="_bx_groups_alert_action_fan_added"><![CDATA[присоединение нового участника]]></string>
     <string name="_bx_groups_txt_ntfs_fan_added"><![CDATA[В группу <b class="bx-ntfs-content-profile">{owner_name}</b> вступил <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>

+ 13 - 1
modules/boonex/russian/data/langs/bx_spaces/ru.xml

@@ -53,6 +53,7 @@
 	<string name="_bx_spaces_acl_action_delete_profile"><![CDATA[Удалить пространство]]></string>
 	<string name="_bx_spaces_acl_action_view_profile"><![CDATA[Просмотреть пространство]]></string>
 	<string name="_bx_spaces_acl_action_edit_any_profile"><![CDATA[Редактировать любую пространство]]></string>
+	<string name="_bx_spaces_acl_action_delete_invites"><![CDATA[Удалять приглашения]]></string>
 
 	<string name="_bx_spaces_page_title_sys_joined_entries"><![CDATA[Пространства профиля]]></string>
 	<string name="_bx_spaces_page_title_joined_entries"><![CDATA[Пространства профиля]]></string>
@@ -119,6 +120,8 @@
 	<string name="_bx_spaces_page_block_title_fans_link"><![CDATA[Участники пространства: <a href="{profile_link}">{display_name}</a>]]></string>
 	<string name="_bx_spaces_page_block_title_fans"><![CDATA[Участники]]></string>
 	<string name="_bx_spaces_page_block_title_system_fans"><![CDATA[Участники]]></string>
+	<string name="_bx_spaces_page_block_title_fans_invites"><![CDATA[Приглашения]]></string>
+	<string name="_bx_spaces_page_block_title_system_invites"><![CDATA[Приглашения]]></string>
         <string name="_bx_spaces_page_block_title_profile_location"><![CDATA[Расположение]]></string>
 	<string name="_bx_spaces_page_block_title_profile_comments"><![CDATA[Комментарии]]></string>
     <string name="_bx_spaces_page_block_title_profile_comments_link"><![CDATA[Комментарии к <a href="{entry_link}">{title}</a>]]></string>
@@ -129,6 +132,7 @@
 	<string name="_bx_spaces_page_block_title_system_manage_administration"><![CDATA[Управление всеми пространствами]]></string>
 	<string name="_bx_spaces_page_block_title_manage"><![CDATA[Управление]]></string>
     <string name="_bx_spaces_page_block_title_top_profiles"><![CDATA[Популярные пространства]]></string>
+	<string name="_bx_spaces_page_block_title_joined_profiles"><![CDATA[Мои пространства]]></string>
     <string name="_bx_spaces_page_block_title_entry_all_actions"><![CDATA[Все действия]]></string>
     <string name="_bx_spaces_page_block_title_entry_social_sharing"><![CDATA[Поделиться]]></string>
     <string name="_bx_spaces_page_block_title_categories"><![CDATA[Категории пространств]]></string>
@@ -221,6 +225,8 @@
     <string name="_bx_spaces_menu_item_title_entries_recent"><![CDATA[Новые]]></string>
     <string name="_bx_spaces_menu_item_title_system_entries_search"><![CDATA[Поиск]]></string>
     <string name="_bx_spaces_menu_item_title_entries_search"><![CDATA[Поиск]]></string>
+	<string name="_bx_spaces_menu_item_title_system_entries_joined"><![CDATA[Участие]]></string>
+	<string name="_bx_spaces_menu_item_title_entries_joined"><![CDATA[Участие]]></string>
     <string name="_bx_spaces_menu_item_title_system_entries_manage"><![CDATA[Управление]]></string>
     <string name="_bx_spaces_menu_item_title_entries_manage"><![CDATA[Управление]]></string>
     <string name="_bx_spaces_menu_item_title_system_entries_home"><![CDATA[Пространства]]></string>
@@ -267,7 +273,13 @@
     <string name="_bx_spaces_txt_to_admins"><![CDATA[В админы]]></string>
     <string name="_bx_spaces_txt_from_admins"><![CDATA[Из админов]]></string>
     <string name="_bx_spaces_txt_private_group"><![CDATA[Приватная пространство]]></string>
-
+	<string name="_bx_spaces_txt_invite_popup_text"><![CDATA[Вы были приглашены в это пространство.  Нажмите кнопку ниже чтобы принять приглашение.]]></string>
+    <string name="_bx_spaces_txt_invite_popup_title"><![CDATA[Приглашение в пространство]]></string>
+    <string name="_bx_spaces_txt_invite_popup_button_accept"><![CDATA[Принять]]></string>
+    <string name="_bx_spaces_txt_invite_popup_button_decline"><![CDATA[Отклонить]]></string>
+    <string name="_bx_spaces_txt_invite_popup_error_invitation_absent"><![CDATA[Извините, произошла ошибка. Вы не можете вступить в это пространство. Приглашение устарело или удалено.]]></string>
+    <string name="_bx_spaces_txt_invite_popup_error_invitation_wrong_user"><![CDATA[Извините, произошла ошибка. Вы не можете вступить в это пространство. Приглашение адресовано не Вам.]]></string>
+	
 	<string name="_bx_spaces_alert_action_fan_added"><![CDATA[присоединение нового участника]]></string>
     <string name="_bx_spaces_txt_ntfs_fan_added"><![CDATA[В пространство <b class="bx-ntfs-content-profile">{owner_name}</b> вступил <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>
     <string name="_bx_spaces_alert_action_join_request"><![CDATA[запрос на присоединение к пространству]]></string>

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

@@ -2630,6 +2630,7 @@
 	<string name="_sys_mobile_search"><![CDATA[Поиск]]></string>
 	<string name="_sys_mobile_status"><![CDATA[Статус]]></string>
     <string name="_sys_name"><![CDATA[Имя]]></string>
+    <string name="_sys_added"><![CDATA[Добавлено]]></string>
     <string name="_sys_next"><![CDATA[Ещё]]></string>
     <string name="_sys_notification_account"><![CDATA[Аккаунты, созданные за последние 24 часа:]]></string>
     <string name="_sys_not_available"><![CDATA[н/д]]></string>

+ 14 - 3
modules/boonex/spaces/classes/BxSpacesConfig.php

@@ -38,6 +38,7 @@ class BxSpacesConfig extends BxBaseModProfileConfig
             'TABLE_ENTRIES' => $aModule['db_prefix'] . 'data',
             'TABLE_ENTRIES_FULLTEXT' => 'search_fields',
             'TABLE_ADMINS' => $aModule['db_prefix'] . 'admins',
+            'TABLE_INVITES' => $aModule['db_prefix'] . 'invites',
 
             // database fields
             'FIELD_ID' => 'id',
@@ -126,11 +127,13 @@ class BxSpacesConfig extends BxBaseModProfileConfig
             'OBJECT_GRID_ADMINISTRATION' => 'bx_spaces_administration',
             'OBJECT_GRID_COMMON' => 'bx_spaces_common',
             'OBJECT_GRID_CONNECTIONS' => 'bx_spaces_fans',
+             'OBJECT_GRID_INVITES' => 'bx_spaces_invites',
             'OBJECT_CONNECTIONS' => 'bx_spaces_fans',
             'OBJECT_UPLOADERS_COVER' => array('bx_spaces_cover_crop'),
             'OBJECT_UPLOADERS_PICTURE' => array('bx_spaces_picture_crop'),
             
             'BADGES_AVALIABLE' => true,
+            'INVITES_KEYS_LIFETIME' => 86400,
 
             'EMAIL_INVITATION' => 'bx_spaces_invitation',
             'EMAIL_JOIN_REQUEST' => 'bx_spaces_join_request',
@@ -195,17 +198,25 @@ class BxSpacesConfig extends BxBaseModProfileConfig
                 'menu_item_title_leave_group_cancel_request' => '_bx_spaces_menu_item_title_leave_space_cancel_request',
                 'menu_item_title_become_fan' => '_bx_spaces_menu_item_title_become_fan',
                 'menu_item_title_leave_group' => '_bx_spaces_menu_item_title_leave_space',
-                'txt_all_entries_by_author' => '_bx_spaces_page_title_browse_by_author'
+                'txt_all_entries_by_author' => '_bx_spaces_page_title_browse_by_author',
+                'txt_invitation_popup_title' => '_bx_spaces_txt_invite_popup_title',
+                'txt_invitation_popup_text' => '_bx_spaces_txt_invite_popup_text',
+				'txt_invitation_popup_accept_button' => '_bx_spaces_txt_invite_popup_button_accept',
+				'txt_invitation_popup_decline_button' => '_bx_spaces_txt_invite_popup_button_decline',
+                'txt_invitation_popup_error_invitation_absent' => '_bx_spaces_txt_invite_popup_error_invitation_absent',
+				'txt_invitation_popup_error_wrong_user' => '_bx_spaces_txt_invite_popup_error_invitation_wrong_user',
             ),
 
         );
 
         $this->_aJsClasses = array(
-            'manage_tools' => 'BxSpacesManageTools'
+            'manage_tools' => 'BxSpacesManageTools',
+            'invite_popup' => 'BxSpacesInvitePopup'
         );
 
         $this->_aJsObjects = array(
-            'manage_tools' => 'oBxSpacesManageTools'
+            'manage_tools' => 'oBxSpacesManageTools',
+            'invite_popup' => 'oBxSpacesInvitePopup'
         );
 
         $this->_aGridObjects = array(

+ 21 - 0
modules/boonex/spaces/classes/BxSpacesGridInvites.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Spaces Spaces
+ * @ingroup     UnaModules
+ * 
+ * @{
+ */
+
+class BxSpacesGridinvites extends BxBaseModGroupsGridInvites
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        $this->_sContentModule = 'bx_spaces';
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 12 - 0
modules/boonex/spaces/install/langs/en.xml

@@ -52,6 +52,7 @@
 	<string name="_bx_spaces_acl_action_delete_profile"><![CDATA[Delete Space]]></string>
 	<string name="_bx_spaces_acl_action_view_profile"><![CDATA[View Space]]></string>
 	<string name="_bx_spaces_acl_action_edit_any_profile"><![CDATA[Edit Any Space]]></string>
+  <string name="_bx_spaces_acl_action_delete_invites"><![CDATA[Delete Invites]]></string>
 	
 	<string name="_bx_spaces_page_title_sys_joined_entries"><![CDATA[Profile Spaces]]></string>
 	<string name="_bx_spaces_page_title_joined_entries"><![CDATA[Profile Spaces]]></string>
@@ -118,6 +119,8 @@
 	<string name="_bx_spaces_page_block_title_fans_link"><![CDATA[Members of <a href="{profile_link}">{display_name}</a>]]></string>
 	<string name="_bx_spaces_page_block_title_fans"><![CDATA[Members]]></string>
 	<string name="_bx_spaces_page_block_title_system_fans"><![CDATA[Members]]></string>
+  <string name="_bx_spaces_page_block_title_fans_invites"><![CDATA[Invites]]></string>
+  <string name="_bx_spaces_page_block_title_system_invites"><![CDATA[Invites]]></string>
         <string name="_bx_spaces_page_block_title_profile_location"><![CDATA[Location]]></string>
 	<string name="_bx_spaces_page_block_title_profile_comments"><![CDATA[Comments]]></string>
 	<string name="_bx_spaces_page_block_title_profile_comments_link"><![CDATA[Comments to <a href="{entry_link}">{title}</a>]]></string>
@@ -128,6 +131,7 @@
 	<string name="_bx_spaces_page_block_title_system_manage_administration"><![CDATA[Manage All Spaces]]></string>
 	<string name="_bx_spaces_page_block_title_manage"><![CDATA[Manage Spaces]]></string>
 	<string name="_bx_spaces_page_block_title_top_profiles"><![CDATA[Top Spaces]]></string>
+  <string name="_bx_spaces_page_block_title_joined_profiles"><![CDATA[Joined Spaces]]></string>
         <string name="_bx_spaces_page_block_title_entry_all_actions"><![CDATA[All Actions]]></string>
 	<string name="_bx_spaces_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>
 	<string name="_bx_spaces_page_block_title_categories"><![CDATA[Spaces Categories]]></string>
@@ -220,6 +224,8 @@
 	<string name="_bx_spaces_menu_item_title_entries_recent"><![CDATA[New]]></string>
 	<string name="_bx_spaces_menu_item_title_system_entries_search"><![CDATA[Search]]></string>
 	<string name="_bx_spaces_menu_item_title_entries_search"><![CDATA[Search]]></string>
+  <string name="_bx_spaces_menu_item_title_system_entries_joined"><![CDATA[Joined]]></string>
+  <string name="_bx_spaces_menu_item_title_entries_joined"><![CDATA[Joined]]></string>
 	<string name="_bx_spaces_menu_item_title_system_entries_manage"><![CDATA[Manage]]></string>
 	<string name="_bx_spaces_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
 	<string name="_bx_spaces_menu_item_title_system_entries_home"><![CDATA[Spaces]]></string>
@@ -266,6 +272,12 @@
 	<string name="_bx_spaces_txt_to_admins"><![CDATA[To Admins]]></string>
 	<string name="_bx_spaces_txt_from_admins"><![CDATA[From Admins]]></string>
 	<string name="_bx_spaces_txt_private_space"><![CDATA[Private space]]></string>
+  <string name="_bx_spaces_txt_invite_popup_text"><![CDATA[You have been invited to a space. Click the button below to accept the invitation.]]></string>
+  <string name="_bx_spaces_txt_invite_popup_title"><![CDATA[Invitation to a space]]></string>
+  <string name="_bx_spaces_txt_invite_popup_button_accept"><![CDATA[Accept]]></string>
+  <string name="_bx_spaces_txt_invite_popup_button_decline"><![CDATA[Decline]]></string>
+  <string name="_bx_spaces_txt_invite_popup_error_invitation_absent"><![CDATA[Sorry, an error has occurred. You can not join this space. The invitation is expired or deleted.]]></string>
+  <string name="_bx_spaces_txt_invite_popup_error_invitation_wrong_user"><![CDATA[Sorry, an error has occurred. You can not join this space. This invitation cannot be used by you.]]></string>
 	
 	<string name="_bx_spaces_alert_action_fan_added"><![CDATA[member joined]]></string>
 	<string name="_bx_spaces_txt_ntfs_fan_added"><![CDATA[Space <b class="bx-ntfs-content-profile">{owner_name}</b> has got a member <b class="bx-ntfs-content-entry">{subentry_sample}</b>]]></string>

+ 3 - 3
modules/boonex/spaces/install/sql/disable.sql

@@ -38,9 +38,9 @@ DELETE FROM `sys_statistics` WHERE `name` LIKE 'bx_spaces%';
 DELETE FROM `sys_objects_chart` WHERE `object` LIKE 'bx_spaces%';
 
 -- GRIDS
-DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_spaces_administration', 'bx_spaces_moderation', 'bx_spaces_common', 'bx_spaces_fans');
-DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_spaces_administration', 'bx_spaces_moderation', 'bx_spaces_common', 'bx_spaces_fans');
-DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_spaces_administration', 'bx_spaces_moderation', 'bx_spaces_common', 'bx_spaces_fans');
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_spaces_administration', 'bx_spaces_moderation', 'bx_spaces_common', 'bx_spaces_fans', 'bx_spaces_invites');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_spaces_administration', 'bx_spaces_moderation', 'bx_spaces_common', 'bx_spaces_fans', 'bx_spaces_invites');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_spaces_administration', 'bx_spaces_moderation', 'bx_spaces_common', 'bx_spaces_fans', 'bx_spaces_invites');
 
 -- ALERTS
 SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_spaces' LIMIT 1);

+ 34 - 3
modules/boonex/spaces/install/sql/enable.sql

@@ -104,7 +104,8 @@ INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module
 ('bx_spaces_fans', 'space-fans', '_bx_spaces_page_title_sys_space_fans', '_bx_spaces_page_title_space_fans', 'bx_spaces', 5, 2147483647, 1, 'page.php?i=space-fans', '', '', '', 0, 1, 0, 'BxSpacesPageEntry', 'modules/boonex/spaces/classes/BxSpacesPageEntry.php');
 
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
-('bx_spaces_fans', 1, 'bx_spaces', '_bx_spaces_page_block_title_system_fans', '_bx_spaces_page_block_title_fans_link', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:10:"fans_table";}', 0, 0, 1, 1);
+('bx_spaces_fans', 1, 'bx_spaces', '_bx_spaces_page_block_title_system_fans', '_bx_spaces_page_block_title_fans_link', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:10:"fans_table";}', 0, 0, 1, 1),
+('bx_spaces_fans', 1, 'bx_spaces', '_bx_spaces_page_block_title_system_invites', '_bx_spaces_page_block_title_fans_invites', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:13:"invites_table";}', 0, 0, 1, 2);
 
 -- PAGE: view entry comments
 INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
@@ -141,6 +142,15 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbo
 ('bx_spaces_search', 1, 'bx_spaces', '_bx_spaces_page_block_title_search_form_cmts', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:8:"get_form";s:6:"params";a:1:{i:0;a:1:{s:6:"object";s:14:"bx_spaces_cmts";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 3),
 ('bx_spaces_search', 1, 'bx_spaces', '_bx_spaces_page_block_title_search_results_cmts', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_results";s:6:"params";a:1:{i:0;a:2:{s:6:"object";s:14:"bx_spaces_cmts";s:10:"show_empty";b:1;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 4);
 
+-- PAGE: joined profiles
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_joined_spaces', '_bx_spaces_page_title_sys_joined', '_bx_spaces_page_title_joined', 'bx_spaces', 5, 2147483647, 1, 'spaces-joined', 'page.php?i=spaces-joined', '', '', '', 0, 1, 0, 'BxSpacesPageBrowse', 'modules/boonex/spaces/classes/BxSpacesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_joined_spaces', 1, 'bx_spaces', '_bx_spaces_page_block_title_joined_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_spaces";s:6:"method";s:21:"browse_joined_entries";s:6:"params";a:2:{i:0;s:12:"{profile_id}";i:1;b:1;}}', 0, 1, 0);
+
+
 -- PAGE: module manage own
 INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
 ('bx_spaces_manage', '_bx_spaces_page_title_sys_manage', '_bx_spaces_page_title_manage', 'bx_spaces', 5, 2147483647, 1, 'spaces-manage', 'page.php?i=spaces-manage', '', '', '', 0, 1, 0, 'BxSpacesPageBrowse', 'modules/boonex/spaces/classes/BxSpacesPageBrowse.php');
@@ -281,7 +291,8 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 ('bx_spaces_submenu', 'bx_spaces', 'spaces-home', '_bx_spaces_menu_item_title_system_entries_recent', '_bx_spaces_menu_item_title_entries_recent', 'page.php?i=spaces-home', '', '', '', '', 2147483647, 1, 1, 1),
 ('bx_spaces_submenu', 'bx_spaces', 'spaces-top', '_bx_spaces_menu_item_title_system_entries_top', '_bx_spaces_menu_item_title_entries_top', 'page.php?i=spaces-top', '', '', '', '', 2147483647, 1, 1, 2),
 ('bx_spaces_submenu', 'bx_spaces', 'spaces-search', '_bx_spaces_menu_item_title_system_entries_search', '_bx_spaces_menu_item_title_entries_search', 'page.php?i=spaces-search', '', '', '', '', 2147483647, 1, 1, 3),
-('bx_spaces_submenu', 'bx_spaces', 'spaces-manage', '_bx_spaces_menu_item_title_system_entries_manage', '_bx_spaces_menu_item_title_entries_manage', 'page.php?i=spaces-manage', '', '', '', '', 2147483646, 1, 1, 4);
+('bx_spaces_submenu', 'bx_spaces', 'spaces-joined', '_bx_spaces_menu_item_title_system_entries_joined', '_bx_spaces_menu_item_title_entries_joined', 'page.php?i=spaces-joined', '', '', '', '', 2147483647, 1, 1, 4),
+('bx_spaces_submenu', 'bx_spaces', 'spaces-manage', '_bx_spaces_menu_item_title_system_entries_manage', '_bx_spaces_menu_item_title_entries_manage', 'page.php?i=spaces-manage', '', '', '', '', 2147483646, 1, 1, 5);
 
 -- MENU: view submenu
 
@@ -362,6 +373,10 @@ INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`,
 ('bx_spaces', 'edit any entry', NULL, '_bx_spaces_acl_action_edit_any_profile', '', 1, 3);
 SET @iIdActionProfileEditAny = LAST_INSERT_ID();
 
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_spaces', 'delete invites', NULL, '_bx_spaces_acl_action_delete_invites', '', 1, 3);
+SET @iIdActionProfileDeleteInvites = LAST_INSERT_ID();
+
 SET @iUnauthenticated = 1;
 SET @iAccount = 2;
 SET @iStandard = 3;
@@ -404,7 +419,11 @@ INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
 
 -- any profile edit
 (@iModerator, @iIdActionProfileEditAny),
-(@iAdministrator, @iIdActionProfileEditAny);
+(@iAdministrator, @iIdActionProfileEditAny),
+
+-- any invites edit
+(@iModerator, @iIdActionProfileDeleteInvites),
+(@iAdministrator, @iIdActionProfileDeleteInvites);
 
 -- METATAGS
 INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
@@ -448,6 +467,18 @@ INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `conf
 ('bx_spaces_fans', 'single', 'from_admins', '_bx_spaces_txt_from_admins', '', 0, 30),
 ('bx_spaces_fans', 'single', 'delete', '', 'remove', 1, 40);
 
+-- GRID: invites
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `responsive`, `override_class_name`, `override_class_file`) VALUES
+('bx_spaces_invites', 'Sql', 'SELECT `bx_spaces_invites`.`id`, `bx_spaces_invites`.`invited_profile_id`, `bx_spaces_invites`.`added`, `bx_spaces_invites`.`author_profile_id` FROM `sys_profiles` AS `p` INNER JOIN `sys_accounts` AS `a` ON (`a`.`id` = `p`.`account_id`) INNER JOIN `bx_spaces_invites` ON `bx_spaces_invites`.`invited_profile_id` = `p`.`id` ', 'bx_spaces_invites', 'id', 'bx_spaces_invites`.`added', '', '', 10, NULL, 'start', '', 'name,email', '', 'auto', '', '', 2147483647, 0, 'BxSpacesGridInvites', 'modules/boonex/spaces/classes/BxSpacesGridInvites.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `params`, `order`) VALUES
+('bx_spaces_invites', 'name', '_sys_name', '33%', '', 10),
+('bx_spaces_invites', 'added', '_sys_added', '33%', '', 20),
+('bx_spaces_invites', 'actions', '', '34%', '', 30);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
+('bx_spaces_invites', 'single', 'delete', '', 'remove', 1, 10);
+
 -- GRIDS: administration
 
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES

+ 9 - 0
modules/boonex/spaces/install/sql/install.sql

@@ -208,6 +208,15 @@ CREATE TABLE IF NOT EXISTS `bx_spaces_scores_track` (
   KEY `vote` (`object_id`, `author_nip`)
 );
 
+CREATE TABLE IF NOT EXISTS `bx_spaces_invites` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `key` varchar(128) NOT NULL default '0',
+  `group_profile_id` int(11) NOT NULL default '0',
+  `author_profile_id` int(11) NOT NULL default '0',
+  `invited_profile_id` int(11) NOT NULL default '0',
+  `added` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`)
+);
 
 -- STORAGES & TRANSCODERS
 INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES

+ 1 - 1
modules/boonex/spaces/install/sql/uninstall.sql

@@ -1,7 +1,7 @@
 
 -- TABLES
 
-DROP TABLE IF EXISTS `bx_spaces_data`, `bx_spaces_pics`, `bx_spaces_pics_resized`, `bx_spaces_cmts`, `bx_spaces_views_track`, `bx_spaces_meta_keywords`, `bx_spaces_meta_locations`, `bx_spaces_meta_mentions`, `bx_spaces_fans`, `bx_spaces_admins`, `bx_spaces_votes`, `bx_spaces_votes_track`, `bx_spaces_reports`, `bx_spaces_reports_track`, `bx_spaces_favorites_track`, `bx_spaces_scores`, `bx_spaces_scores_track`;
+DROP TABLE IF EXISTS `bx_spaces_data`, `bx_spaces_pics`, `bx_spaces_pics_resized`, `bx_spaces_cmts`, `bx_spaces_views_track`, `bx_spaces_meta_keywords`, `bx_spaces_meta_locations`, `bx_spaces_meta_mentions`, `bx_spaces_fans`, `bx_spaces_admins`, `bx_spaces_votes`, `bx_spaces_votes_track`, `bx_spaces_reports`, `bx_spaces_reports_track`, `bx_spaces_favorites_track`, `bx_spaces_scores`, `bx_spaces_scores_track`, `bx_spaces_invites`;
 
 -- PROFILES
 

+ 50 - 0
modules/boonex/spaces/js/invite_popup.js

@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Spaces Spaces
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+function BxSpacesInvitePopup(oOptions) {
+	this._sActionsUrl = oOptions.sActionUrl;
+	this._sPopupId = oOptions.sPopupId == undefined ? {} : oOptions.sPopupId;
+	this._sKey = oOptions.sKey == undefined ? {} : oOptions.sKey;
+	this._sAcceptUrl = oOptions.sAcceptUrl == undefined ? {} : oOptions.sAcceptUrl;
+	this._sDeclineUrl = oOptions.sDeclineUrl == undefined ? {} : oOptions.sDeclineUrl;
+	this._iGroupProfileId = oOptions.iGroupProfileId == undefined ? {} : oOptions.iGroupProfileId;
+
+	var $this = this;
+	$(document).ready(function () {
+	    $this.init();
+	});
+}
+
+BxSpacesInvitePopup.prototype.init = function () {
+    var $this = this;
+    $('#' + $this._sPopupId + ' .bx-invite-accept').click(function () {
+        $this.onClickAccept();
+    });
+    $('#' + $this._sPopupId + ' .bx-invite-decline').click(function () {
+        $this.onClickDecline();
+    });
+
+    $('#' + $this._sPopupId).dolPopup();
+};
+
+BxSpacesInvitePopup.prototype.onClickAccept = function () {
+	var $this = this;
+	$.getJSON($this._sActionsUrl + 'ProcessInvite/' + $this._sKey + '/' + $this._iGroupProfileId + '/1/', function () {
+	    location.href = $this._sAcceptUrl
+	});
+
+};
+
+BxSpacesInvitePopup.prototype.onClickDecline = function () {
+    var $this = this;
+    $.getJSON($this._sActionsUrl + 'ProcessInvite/' + $this._sKey + '/' + $this._iGroupProfileId + '/0/', function () {
+        location.href = $this._sDeclineUrl
+    });
+};

+ 1 - 0
modules/boonex/spaces/template/popup_invite.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/groups/template/popup_invite.html />