Răsfoiți Sursa

#281 Groups: connections re-structurization

Alex Trofimov 10 ani în urmă
părinte
comite
5a4383795d

+ 0 - 19
modules/base/profile/classes/BxBaseModProfileModule.php

@@ -427,25 +427,6 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolPro
         return $isConnected ? _t('_sys_txt_access_denied') : CHECK_ACTION_RESULT_ALLOWED;
     }
 
-    protected function _checkAllowedConnectContent (&$aDataEntry, $isPerformAction, $sObjConnection, $isMutual, $isInvertResult, $isSwap = false)
-    {
-        if (!$this->_iProfileId)
-            return _t('_sys_txt_access_denied');
-
-        $CNF = &$this->_oConfig->CNF;
-
-        $oConn = BxDolConnection::getObjectInstance($sObjConnection);
-        if ($isSwap)
-            $isConnected = $oConn->isConnected($aDataEntry[$CNF['FIELD_ID']], $this->_iProfileId, $isMutual);
-        else
-            $isConnected = $oConn->isConnected($this->_iProfileId, $aDataEntry[$CNF['FIELD_ID']], $isMutual);
-
-        if ($isInvertResult)
-            $isConnected = !$isConnected;
-
-        return $isConnected ? _t('_sys_txt_access_denied') : CHECK_ACTION_RESULT_ALLOWED;
-    }
-
     protected function _buildRssParams($sMode, $aArgs)
     {
         $aParams = array ();

+ 12 - 6
modules/boonex/groups/classes/BxGroupsDb.php

@@ -19,31 +19,37 @@ class BxGroupsDb extends BxBaseModProfileDb
         parent::__construct($oConfig);
     }
 
-    public function toAdmins ($iContentId, $mixedFansIds)
+    public function toAdmins ($iGroupProfileId, $mixedFansIds)
     {
         if (is_array($mixedFansIds))
             foreach ($mixedFansIds as $iFanId)
                 $this->toAdmins ($iFanId);
 
         $iFanId = (int)$mixedFansIds;
-        $sQuery = $this->prepare("INSERT IGNORE INTO `" . $this->_oConfig->CNF['TABLE_ADMINS'] . "` SET `content_id` = ?, `fan_id` = ?", $iContentId, $iFanId);
+        $sQuery = $this->prepare("INSERT IGNORE INTO `" . $this->_oConfig->CNF['TABLE_ADMINS'] . "` SET `group_profile_id` = ?, `fan_id` = ?", $iGroupProfileId, $iFanId);
         return $this->res($sQuery);
     }
 
-    public function fromAdmins ($iContentId, $mixedFansIds)
+    public function fromAdmins ($iGroupProfileId, $mixedFansIds)
     {
         if (is_array($mixedFansIds))
             foreach ($mixedFansIds as $iFanId)
                 $this->toAdmins ($iFanId);
 
         $iFanId = (int)$mixedFansIds;
-        $sQuery = $this->prepare("DELETE FROM `" . $this->_oConfig->CNF['TABLE_ADMINS'] . "` WHERE `content_id` = ? AND `fan_id` = ?", $iContentId, $iFanId);
+        $sQuery = $this->prepare("DELETE FROM `" . $this->_oConfig->CNF['TABLE_ADMINS'] . "` WHERE `group_profile_id` = ? AND `fan_id` = ?", $iGroupProfileId, $iFanId);
         return $this->res($sQuery);
     }
 
-    public function isAdmin ($iContentId, $iFanId)
+    public function deleteAdmins ($iGroupProfileId)
     {
-        $sQuery = $this->prepare("SELECT `id` FROM `" . $this->_oConfig->CNF['TABLE_ADMINS'] . "` WHERE `content_id` = ? AND `fan_id` = ?", $iContentId, $iFanId);
+        $sQuery = $this->prepare("DELETE FROM `" . $this->_oConfig->CNF['TABLE_ADMINS'] . "` WHERE `group_profile_id` = ?", $iGroupProfileId);
+        return $this->res($sQuery);
+    }
+
+    public function isAdmin ($iGroupProfileId, $iFanId)
+    {
+        $sQuery = $this->prepare("SELECT `id` FROM `" . $this->_oConfig->CNF['TABLE_ADMINS'] . "` WHERE `group_profile_id` = ? AND `fan_id` = ?", $iGroupProfileId, $iFanId);
         return $this->getOne($sQuery) ? true : false;
     }
 }

+ 1 - 1
modules/boonex/groups/classes/BxGroupsFormEntry.php

@@ -27,7 +27,7 @@ class BxGroupsFormEntry extends BxBaseModProfileFormEntry
 			$this->aInputs[$CNF['FIELD_ALLOW_VIEW_TO']]['db']['pass'] = 'Xss';
 		}
 
-        if(!isset($this->aInputs['initial_members']['value'])) {
+        if (isset($this->aInputs['initial_members']) && !isset($this->aInputs['initial_members']['value'])) {
             $this->aInputs['initial_members']['value'] = array(bx_get_logged_profile_id());
         }
     }

+ 11 - 11
modules/boonex/groups/classes/BxGroupsGridConnections.php

@@ -11,7 +11,7 @@
 
 class BxGroupsGridConnections extends BxDolGridConnections
 {
-    protected $_iContentId;
+    protected $_iGroupProfileId;
     protected $_oModule;
     protected $_oConnection;
 
@@ -32,13 +32,13 @@ class BxGroupsGridConnections extends BxDolGridConnections
             return;
 
         $aProfileInfo = $oProfile->getInfo();
-        $this->_iContentId = $aProfileInfo['content_id'];
+        $this->_iGroupProfileId = $oProfile->id();
 
-        $aContentInfo = BxDolService::call($aProfileInfo['type'], 'get_content_info_by_id', array($this->_iContentId));
+        $aContentInfo = BxDolService::call($aProfileInfo['type'], 'get_content_info_by_id', array($aProfileInfo['content_id']));
         if (CHECK_ACTION_RESULT_ALLOWED === $this->_oModule->checkAllowedEdit($aContentInfo) || $oProfile->id() == bx_get_logged_profile_id())
             $this->_bOwner = true;
 
-        $aSQLParts = $this->_oConnection->getConnectedInitiatorsAsSQLParts('p', 'id', $this->_iContentId, $this->_bOwner ? false : true);
+        $aSQLParts = $this->_oConnection->getConnectedInitiatorsAsSQLParts('p', 'id', $this->_iGroupProfileId, $this->_bOwner ? false : true);
         $this->addMarkers(array(
             'profile_id' => $oProfile->id(),
             'join_connections' => $aSQLParts['join'],
@@ -49,7 +49,7 @@ class BxGroupsGridConnections extends BxDolGridConnections
     protected function _getActionAccept ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
     {
         if (isset($aRow[$this->_aOptions['field_id']]))
-            $a['attr']['bx_grid_action_data'] = $aRow[$this->_aOptions['field_id']] . ':' . $this->_iContentId;
+            $a['attr']['bx_grid_action_data'] = $aRow[$this->_aOptions['field_id']] . ':' . $this->_iGroupProfileId;
 
         return parent::_getActionAccept ($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
     }
@@ -57,14 +57,14 @@ class BxGroupsGridConnections extends BxDolGridConnections
     protected function _getActionDelete ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
     {
         if (isset($aRow[$this->_aOptions['field_id']]))
-            $a['attr']['bx_grid_action_data'] = $aRow[$this->_aOptions['field_id']] . ':' . $this->_iContentId;
+            $a['attr']['bx_grid_action_data'] = $aRow[$this->_aOptions['field_id']] . ':' . $this->_iGroupProfileId;
 
         return parent::_getActionDelete ($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
     }
 
     protected function _getActionToAdmins ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
     {
-        if ($this->_oModule->_oDb->isAdmin($this->_iContentId, $aRow[$this->_aOptions['field_id']]))
+        if ($this->_oModule->_oDb->isAdmin($this->_iGroupProfileId, $aRow[$this->_aOptions['field_id']]))
             return '';
 
         return $this->_getAction_Admins ($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
@@ -72,7 +72,7 @@ class BxGroupsGridConnections extends BxDolGridConnections
 
     protected function _getActionFromAdmins ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
     {
-        if (!$this->_oModule->_oDb->isAdmin($this->_iContentId, $aRow[$this->_aOptions['field_id']]))
+        if (!$this->_oModule->_oDb->isAdmin($this->_iGroupProfileId, $aRow[$this->_aOptions['field_id']]))
             return '';
 
         return $this->_getAction_Admins ($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
@@ -80,14 +80,14 @@ class BxGroupsGridConnections extends BxDolGridConnections
 
     protected function _getAction_Admins ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
     {
-        if (!$this->_oConnection->isConnected($aRow[$this->_aOptions['field_id']], $this->_iContentId, true))
+        if (!$this->_oConnection->isConnected($aRow[$this->_aOptions['field_id']], $this->_iGroupProfileId, true))
             return '';
 
-        if (CHECK_ACTION_RESULT_ALLOWED !== $this->_oModule->checkAllowedManageAdmins($this->_iContentId))
+        if (CHECK_ACTION_RESULT_ALLOWED !== $this->_oModule->checkAllowedManageAdmins($this->_iGroupProfileId))
             return '';
 
         if (isset($aRow[$this->_aOptions['field_id']]))
-            $a['attr']['bx_grid_action_data'] = $aRow[$this->_aOptions['field_id']] . ':' . $this->_iContentId;
+            $a['attr']['bx_grid_action_data'] = $aRow[$this->_aOptions['field_id']] . ':' . $this->_iGroupProfileId;
 
         return parent::_getActionDefault ($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
     }

+ 1 - 1
modules/boonex/groups/classes/BxGroupsMenuView.php

@@ -23,7 +23,7 @@ class BxGroupsMenuView extends BxBaseModProfileMenuView
         if ($this->_oProfile && isLogged()) {
 
             $oConn = BxDolConnection::getObjectInstance($this->_oModule->_oConfig->CNF['OBJECT_CONNECTIONS']);
-            if ($oConn->isConnectedNotMutual(bx_get_logged_profile_id(), $this->_aProfileInfo['content_id'])) {
+            if ($oConn->isConnectedNotMutual(bx_get_logged_profile_id(), $this->_oProfile->id())) {
                 $this->addMarkers(array(
                     'title_add_fan' => _t('_bx_groups_menu_item_title_become_fan_sent'),
                     'title_remove_fan' => _t('_bx_groups_menu_item_title_leave_group_cancel_request'),

+ 22 - 12
modules/boonex/groups/classes/BxGroupsModule.php

@@ -46,16 +46,19 @@ class BxGroupsModule extends BxBaseModProfileModule
         return $aFieldsProfile;
     }
 
-    public function serviceAddMutualConnection ($iContentId, $iInitiatorId, $iIgnoreJoinConfirmation = false)
-    {
-        $aContentInfo = $this->_oDb->getContentInfoById((int)$iContentId);
+    public function serviceAddMutualConnection ($iGroupProfileId, $iInitiatorId, $iIgnoreJoinConfirmation = false)
+    {        
+        if (!($oGroupProfile = BxDolProfile::getInstance($iGroupProfileId)))
+            return false;
+
+        $aContentInfo = $this->_oDb->getContentInfoById((int)$oGroupProfile->getContentId());
         if (!$aContentInfo || (!$iIgnoreJoinConfirmation && $aContentInfo['join_confirmation']))
             return false;
 
         if (!($oConnection = BxDolConnection::getObjectInstance($this->_oConfig->CNF['OBJECT_CONNECTIONS'])))
             return false;
 
-        return $oConnection->addConnection((int)$iContentId, (int)$iInitiatorId);
+        return $oConnection->addConnection($oGroupProfile->id(), (int)$iInitiatorId);
     }
 
     public function serviceFansTable ()
@@ -78,8 +81,11 @@ class BxGroupsModule extends BxBaseModProfileModule
         if (!$aContentInfo)
             return false;
 
+        if (!($oGroupProfile = BxDolProfile::getInstanceByContentAndType($iContentId, $this->getName())))
+            return false;
+
         bx_import('BxDolConnection');
-        $s = $this->serviceBrowseConnectionsQuick ($iContentId, $this->_oConfig->CNF['OBJECT_CONNECTIONS'], BX_CONNECTIONS_CONTENT_TYPE_CONTENT, true);
+        $s = $this->serviceBrowseConnectionsQuick ($oGroupProfile->id(), $this->_oConfig->CNF['OBJECT_CONNECTIONS'], BX_CONNECTIONS_CONTENT_TYPE_CONTENT, true);
         if (!$s)
             return MsgBox(_t('_sys_txt_empty'));
         return $s;
@@ -100,7 +106,8 @@ class BxGroupsModule extends BxBaseModProfileModule
      */
     public function checkAllowedView ($aDataEntry, $isPerformAction = false)
     {
-        if (($oConnection = BxDolConnection::getObjectInstance($this->_oConfig->CNF['OBJECT_CONNECTIONS'])) && $oConnection->isConnected(bx_get_logged_profile_id(), $aDataEntry[$this->_oConfig->CNF['FIELD_ID']], true))
+        $oGroupProfile = BxDolProfile::getInstanceByContentAndType($aDataEntry[$this->_oConfig->CNF['FIELD_ID']], $this->getName());
+        if ($oGroupProfile && ($oConnection = BxDolConnection::getObjectInstance($this->_oConfig->CNF['OBJECT_CONNECTIONS'])) && $oConnection->isConnected(bx_get_logged_profile_id(), $oGroupProfile->id(), true))
             return CHECK_ACTION_RESULT_ALLOWED;
 
         return parent::checkAllowedView ($aDataEntry, $isPerformAction);
@@ -111,7 +118,7 @@ class BxGroupsModule extends BxBaseModProfileModule
      */
     public function checkAllowedFanAdd (&$aDataEntry, $isPerformAction = false)
     {
-        return $this->_checkAllowedConnectContent ($aDataEntry, $isPerformAction, $this->_oConfig->CNF['OBJECT_CONNECTIONS'], true, false);
+        return $this->_checkAllowedConnect ($aDataEntry, $isPerformAction, $this->_oConfig->CNF['OBJECT_CONNECTIONS'], true, false);
     }
 
     /**
@@ -119,9 +126,9 @@ class BxGroupsModule extends BxBaseModProfileModule
      */
     public function checkAllowedFanRemove (&$aDataEntry, $isPerformAction = false)
     {
-        if (CHECK_ACTION_RESULT_ALLOWED === $this->_checkAllowedConnectContent ($aDataEntry, $isPerformAction, 'sys_profiles_friends', false, true, true))
+        if (CHECK_ACTION_RESULT_ALLOWED === $this->_checkAllowedConnect ($aDataEntry, $isPerformAction, $this->_oConfig->CNF['OBJECT_CONNECTIONS'], false, true, true))
             return CHECK_ACTION_RESULT_ALLOWED;
-        return $this->_checkAllowedConnectContent ($aDataEntry, $isPerformAction, $this->_oConfig->CNF['OBJECT_CONNECTIONS'], false, true, false);
+        return $this->_checkAllowedConnect ($aDataEntry, $isPerformAction, $this->_oConfig->CNF['OBJECT_CONNECTIONS'], false, true, false);
     }
 
     public function checkAllowedManageAdmins ($mixedDataEntry, $isPerformAction = false)
@@ -133,21 +140,24 @@ class BxGroupsModule extends BxBaseModProfileModule
 
     public function checkAllowedEdit ($aDataEntry, $isPerformAction = false)
     {
-        if ($this->_oDb->isAdmin($aDataEntry[$this->_oConfig->CNF['FIELD_ID']], bx_get_logged_profile_id()))
+        $oGroupProfile = BxDolProfile::getInstanceByContentAndType($aDataEntry[$this->_oConfig->CNF['FIELD_ID']], $this->getName());
+        if ($this->_oDb->isAdmin($oGroupProfile->id(), bx_get_logged_profile_id()))
             return CHECK_ACTION_RESULT_ALLOWED;
         return parent::checkAllowedEdit ($aDataEntry, $isPerformAction);
     }
 
     public function checkAllowedChangeCover ($aDataEntry, $isPerformAction = false)
     {
-        if ($this->_oDb->isAdmin($aDataEntry[$this->_oConfig->CNF['FIELD_ID']], bx_get_logged_profile_id()))
+        $oGroupProfile = BxDolProfile::getInstanceByContentAndType($aDataEntry[$this->_oConfig->CNF['FIELD_ID']], $this->getName());
+        if ($this->_oDb->isAdmin($oGroupProfile->id(), bx_get_logged_profile_id()))
             return CHECK_ACTION_RESULT_ALLOWED;
         return parent::checkAllowedChangeCover ($aDataEntry, $isPerformAction);
     }
 
     public function checkAllowedDelete (&$aDataEntry, $isPerformAction = false)
     {
-        if ($this->_oDb->isAdmin($aDataEntry[$this->_oConfig->CNF['FIELD_ID']], bx_get_logged_profile_id()))
+        $oGroupProfile = BxDolProfile::getInstanceByContentAndType($aDataEntry[$this->_oConfig->CNF['FIELD_ID']], $this->getName());
+        if ($this->_oDb->isAdmin($oGroupProfile->id(), bx_get_logged_profile_id()))
             return CHECK_ACTION_RESULT_ALLOWED;
         return parent::checkAllowedDelete ($aDataEntry, $isPerformAction);
     }

+ 2 - 1
modules/boonex/groups/classes/BxGroupsPrivacy.php

@@ -49,7 +49,8 @@ class BxGroupsPrivacy extends BxTemplPrivacy
         if (!($oConnection = BxDolConnection::getObjectInstance($this->_oModule->_oConfig->CNF['OBJECT_CONNECTIONS'])))
             return false;
 
-        return $oConnection->isConnected($iViewerId, $iObjectId, true);
+        $oGroupProfile = BxDolProfile::getInstanceByContentAndType($iObjectId, $this->MODULE);
+        return $oConnection->isConnected($iViewerId, $oGroupProfile->id(), true);
     }
 
     function isSecretGroupAccess ($iObjectOwnerId, $iViewerId, $iObjectId)

+ 0 - 1
modules/boonex/groups/classes/BxGroupsSearchResult.php

@@ -88,7 +88,6 @@ class BxGroupsSearchResult extends BxBaseModProfileSearchResult
                     'type' => 'INNER',
                     'table' => 'bx_groups_fans',
                     'mainField' => 'id',
-                    'mainTable' => 'bx_groups_data',
                     'onField' => 'content',
                     'joinFields' => array('initiator'),
                 );

+ 6 - 4
modules/boonex/groups/classes/BxGroupsTemplate.php

@@ -30,18 +30,20 @@ class BxGroupsTemplate extends BxBaseModProfileTemplate
 
         $oConn = BxDolConnection::getObjectInstance($CNF['OBJECT_CONNECTIONS']);
 
+        $oGroupProfile = BxDolProfile::getInstanceByContentAndType($aData[$CNF['FIELD_ID']], $this->MODULE);
+
         if (!$isPublic) {
             $aVars['thumb_url'] = $this->getImageUrl('no-picture-thumb.png');
             $aVars['content_url'] = 'javascript:void(0);';
             $aVars['title'] = _t('_bx_groups_txt_private_group');
         }
         $aVars['cover_url'] = $isPublic ? $this->urlCover ($aData, true) : $this->getImageUrl('cover.jpg');
-        $aVars['members'] = $isPublic ? _t('_bx_groups_txt_N_fans', $oConn ? $oConn->getConnectedInitiatorsCount($aData[$CNF['FIELD_ID']], true) : 0) : ' ';
+        $aVars['members'] = $isPublic ? _t('_bx_groups_txt_N_fans', $oConn ? $oConn->getConnectedInitiatorsCount($oGroupProfile->id(), true) : 0) : ' ';
         $aVars['bx_if:btn'] = array (
-            'condition' => isLogged() && !$oConn->isConnected(bx_get_logged_profile_id(), $aData[$CNF['FIELD_ID']], true),
+            'condition' => isLogged() && !$oConn->isConnected(bx_get_logged_profile_id(), $oGroupProfile->id(), true),
             'content' => array (
-                'id' => $aData[$CNF['FIELD_ID']],
-                'title' => $oConn->isConnectedNotMutual(bx_get_logged_profile_id(), $aData[$CNF['FIELD_ID']]) ? _t('_bx_groups_menu_item_title_become_fan_sent') : _t('_bx_groups_menu_item_title_become_fan'),
+                'id' => $oGroupProfile->id(),
+                'title' => $oConn->isConnectedNotMutual(bx_get_logged_profile_id(), $oGroupProfile->id()) ? _t('_bx_groups_menu_item_title_become_fan_sent') : _t('_bx_groups_menu_item_title_become_fan'),
                 'object' => $CNF['OBJECT_CONNECTIONS'],
             ),
         );

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

@@ -117,7 +117,7 @@ INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module
 ('bx_groups_joined', 'joined-groups', '_bx_groups_page_title_sys_joined_entries', '_bx_groups_page_title_joined_entries', 'bx_groups', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxGroupsPageJoinedEntries', 'modules/boonex/groups/classes/BxGroupsPageJoinedEntries.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_groups_joined', 1, 'bx_groups', '_bx_groups_page_block_title_sys_joined_entries', '_bx_groups_page_block_title_joined_entries', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_groups\";s:6:\"method\";s:21:\"browse_joined_entries\";}', 0, 0, 1, 1);
+('bx_groups_joined', 1, 'bx_groups', '_bx_groups_page_block_title_sys_joined_entries', '_bx_groups_page_block_title_joined_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_groups";s:6:"method";s:21:"browse_joined_entries";s:6:"params";a:2:{i:0;i:0;i:1;b:1;}}', 0, 0, 1, 1);
 
 -- PAGE: add block to homepage
 SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = 'sys_home' AND `cell_id` = 1 ORDER BY `order` DESC LIMIT 1);
@@ -159,7 +159,7 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 ('bx_groups_view_actions', 'bx_groups', '_bx_groups_menu_set_title_view_profile_actions', 0);
 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('bx_groups_view_actions', 'bx_groups', 'profile-fan-add', '_bx_groups_menu_item_title_system_become_fan', '{title_add_fan}', 'javascript:void(0)', 'bx_conn_action(this, \'bx_groups_fans\', \'add\', \'{content_id}\')', '', 'user-plus', '', 0, 2147483647, 1, 0, 5),
+('bx_groups_view_actions', 'bx_groups', 'profile-fan-add', '_bx_groups_menu_item_title_system_become_fan', '{title_add_fan}', 'javascript:void(0)', 'bx_conn_action(this, \'bx_groups_fans\', \'add\', \'{profile_id}\')', '', 'user-plus', '', 0, 2147483647, 1, 0, 5),
 ('bx_groups_view_actions', 'bx_groups', 'profile-subscribe-add', '_bx_groups_menu_item_title_system_subscribe', '_bx_groups_menu_item_title_subscribe', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_subscriptions\', \'add\', \'{profile_id}\')', '', 'check', '', 0, 2147483647, 1, 0, 20),
 ('bx_groups_view_actions', 'bx_groups', 'profile-actions-more', '_bx_groups_menu_item_title_system_more_actions', '_bx_groups_menu_item_title_more_actions', 'javascript:void(0)', 'bx_menu_popup(''bx_groups_view_actions_more'', this, {}, {profile_id:{profile_id}});', '', 'cog', 'bx_groups_view_actions_more', 1, 2147483647, 1, 0, 9999);
 
@@ -172,7 +172,7 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 ('bx_groups_view_actions_more', 'bx_groups', '_bx_groups_menu_set_title_view_profile_actions_more', 0);
 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('bx_groups_view_actions_more', 'bx_groups', 'profile-fan-remove', '_bx_groups_menu_item_title_system_leave_group', '{title_remove_fan}', 'javascript:void(0)', 'bx_conn_action(this, \'bx_groups_fans\', \'remove\', \'{content_id}\')', '', 'user-times', '', 2147483647, 1, 0, 10),
+('bx_groups_view_actions_more', 'bx_groups', 'profile-fan-remove', '_bx_groups_menu_item_title_system_leave_group', '{title_remove_fan}', 'javascript:void(0)', 'bx_conn_action(this, \'bx_groups_fans\', \'remove\', \'{profile_id}\')', '', 'user-times', '', 2147483647, 1, 0, 10),
 ('bx_groups_view_actions_more', 'bx_groups', 'profile-subscribe-remove', '_bx_groups_menu_item_title_system_unsubscribe', '_bx_groups_menu_item_title_unsubscribe', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_subscriptions\', \'remove\', \'{profile_id}\')', '', 'check', '', 2147483647, 1, 0, 20),
 ('bx_groups_view_actions_more', 'bx_groups', 'edit-group-cover', '_bx_groups_menu_item_title_system_edit_cover', '_bx_groups_menu_item_title_edit_cover', 'page.php?i=edit-group-cover&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 30),
 ('bx_groups_view_actions_more', 'bx_groups', 'edit-group-profile', '_bx_groups_menu_item_title_system_edit_profile', '_bx_groups_menu_item_title_edit_profile', 'page.php?i=edit-group-profile&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 40),

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

@@ -82,7 +82,7 @@ CREATE TABLE IF NOT EXISTS `bx_groups_fans` (
 -- TABLE: admins
 CREATE TABLE IF NOT EXISTS `bx_groups_admins` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
-  `content_id` int(10) unsigned NOT NULL,
+  `group_profile_id` int(10) unsigned NOT NULL,
   `fan_id` int(10) unsigned NOT NULL,
   PRIMARY KEY (`id`),
   UNIQUE KEY `admin` (`content_id`,`fan_id`)