فهرست منبع

#2381 Inviter: track who invited whom

RomanL 6 سال پیش
والد
کامیت
208b772fbb

+ 5 - 0
modules/boonex/invites/classes/BxInvConfig.php

@@ -31,14 +31,19 @@ class BxInvConfig extends BxBaseModGeneralConfig
             'URL_INVITE' => 'page.php?i=invites-invite',
             'URL_REQUEST' => 'page.php?i=invites-request',
             'URL_REQUESTS' => 'page.php?i=invites-requests',
+            'URL_INVITES' => 'page.php?i=invites-invites',
             
             'TABLE_REQUESTS' => $aModule['db_prefix'] . 'requests',
             'TABLE_INVITES' => $aModule['db_prefix'] . 'invites',
+            'TABLE_ENTRIES' => $aModule['db_prefix'] . 'invites',
+            
+            'FIELD_ADDED' => 'date'
         );
 
         $this->_aObjects = array(
             'alert' => $this->_sName,
             'grid_requests' => $this->_sName . '_requests',
+            'grid_invites' => $this->_sName . '_invites',
             'form_invite' => $this->_sName . '_invite',
             'form_request' => $this->_sName . '_request',
             'form_display_invite_send' => $this->_sName . '_invite_send',

+ 38 - 0
modules/boonex/invites/classes/BxInvDb.php

@@ -67,6 +67,16 @@ class BxInvDb extends BxDolModuleDb
                 $sWhereClause = "AND joined_account_id IS NOT NULL AND `{$this->_sTableInvites}`.`request_id`=:request_id ";
                 $sLimitClause = "LIMIT 1";
                 break;
+            case 'profile_id_by_joined_account_id':
+                $aMethod['name'] = 'getOne';
+                $aMethod['params'][1] = array(
+                    'joined_account_id' => $aParams['value']
+                );
+
+                $sSelectClause = "MAX(`{$this->_sTableInvites}`.`profile_id`)";
+                $sWhereClause = "AND `{$this->_sTableInvites}`.`joined_account_id`=:joined_account_id ";
+                $sLimitClause = "LIMIT 1";
+                break;  
             case 'date_joined_by_request':
                 $aMethod['name'] = 'getOne';
                 $aMethod['params'][1] = array(
@@ -211,6 +221,34 @@ class BxInvDb extends BxDolModuleDb
         return array($aEntries, (int)call_user_func_array(array($this, $aMethod['name']), $aMethod['params']));
     }
     
+    public function getDataForCharts($iDateFrom, $iDateTo, $isInvited = false)
+    {
+        $aBindings = array(
+            'datefrom' => $iDateFrom,
+            'dateto' => $iDateTo
+        );
+        $sQuery = "SELECT DATE(FROM_UNIXTIME(`date`)) AS `period`, YEAR(FROM_UNIXTIME(`date`)) AS `year`, COUNT(*) AS `count` FROM `" . $this->_sTableInvites . "` WHERE `date` >= :datefrom AND `date` <= :dateto " . $this->getAddSqlForCharts($isInvited) . " GROUP BY `period`, `year` ORDER BY `year`, `period` ASC";
+        return $this->getAll($sQuery, $aBindings);
+    }
+    
+    public function getInitValueForCharts($iDateFrom, $isInvited = false)
+    {
+        $aBindings = array(
+            'datefrom' => $iDateFrom
+        );
+        $sQuery = "SELECT COUNT(*) AS `count` FROM " . $this->_sTableInvites . " WHERE `date` < :datefrom " . $this->getAddSqlForCharts($isInvited);
+        return $this->getOne($sQuery, $aBindings);
+    }
+    
+    private function getAddSqlForCharts($isInvited)
+    {
+        $sSqlAdd = "";
+        if ($isInvited){
+            $sSqlAdd = " AND `joined_account_id` IS NOT NULL ";
+        }
+        return $sSqlAdd;
+    }
+    
     private function updateRequestStatusByRequestId($iStatus, $iReqestId)
     {
         $aBindings = array(

+ 282 - 0
modules/boonex/invites/classes/BxInvGridInvites.php

@@ -0,0 +1,282 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Invites Invites
+ * @ingroup     UnaModules
+ * 
+ * @{
+ */
+define('BX_INV_FILTER_STATUS_ACCEPTED', 1);
+define('BX_INV_FILTER_STATUS_NOT_ACCEPTED', 2);
+
+class BxInvGridInvites extends BxTemplGrid
+{
+    protected $_sModule;
+    protected $_oModule;
+
+    protected $_sFilter1Name;
+    protected $_sFilter1Value;
+    protected $_aFilter1Values;
+    protected $_sParamsDivider;
+    
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        parent::__construct ($aOptions, $oTemplate);
+
+        $this->_sModule = 'bx_invites';
+        $this->_oModule = BxDolModule::getInstance($this->_sModule);
+       
+        $this->_sFilter1Name = 'filter1';
+        $this->_aFilter1Values = array(
+            '' => _t('_bx_invites_invites_status_for_filter_all'),
+            BX_INV_FILTER_STATUS_ACCEPTED => _t('_bx_invites_invites_status_for_filter_accepted'),
+            BX_INV_FILTER_STATUS_NOT_ACCEPTED => _t('_bx_invites_invites_status_for_filter_not_accepted'),
+        );
+        
+        $sFilter1 = bx_get($this->_sFilter1Name);
+        if(!empty($sFilter1)) {
+            $this->_sFilter1Value = bx_process_input($sFilter1);
+            $this->_aQueryAppend['filter1'] = $this->_sFilter1Value;
+        }
+        $this->_sParamsDivider = '#-#';
+    }
+    
+    protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
+    {
+        $CNF = $this->_oModule->_oConfig->CNF;
+        $sTableInvites = $CNF['TABLE_INVITES'];
+        
+        if(strpos($sFilter, $this->_sParamsDivider) !== false)
+            list($this->_sFilter1Value, $sFilter) = explode($this->_sParamsDivider, $sFilter);
+        
+        $sFilterSql = "";
+        if(isset($this->_sFilter1Value) && $this->_sFilter1Value != ''){
+            if ($this->_sFilter1Value == BX_INV_FILTER_STATUS_ACCEPTED){
+                $sFilterSql = " AND " . $sTableInvites . ".`joined_account_id` IS NOT NULL";
+            }
+            else{
+                $sFilterSql = " AND " . $sTableInvites . ".`joined_account_id` IS NULL";
+            }
+        }
+        $this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString($sFilterSql);
+        return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
+    }
+    
+    public function performActionAdd()
+    {
+        $sAction = 'add';
+        $oForm = $this->_oModule->getFormObjectInvite();
+        if (!$oForm)
+            return '';
+        $oForm->aInputs['text']['value'] = _t('_bx_invites_msg_invitation');
+        $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?' . bx_encode_url_params($_GET, array('ids', '_r'));
+        $oForm->initChecker();
+        
+        if($oForm->isSubmittedAndValid()) {
+            $sResult = $this->_oModule->processFormObjectInvite($oForm);
+            $aRes = array('msg' => $sResult);
+            echoJson($aRes);
+        }
+        else {
+            $sContent = BxTemplStudioFunctions::getInstance()->popupBox('_bx_invites_form_invite', _t('_bx_invites_form_invite'), $this->_oModule->_oTemplate->parseHtmlByName('popup_invite.html', array(
+                'form_id' => $oForm->id,
+                'form' => $oForm->getCode(true),
+                'object' => $this->_sObject,
+                'action' => $sAction
+            )));
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => true))));
+        }
+    }
+    
+    public function performActionDelete($aParams = array())
+    {
+        $iProfileId = $this->_oModule->getProfileId();
+
+        $mixedAllowed = $this->_oModule->isAllowedDeleteInvite($iProfileId);
+        if($mixedAllowed !== true) {
+            echoJson(array('msg' => $mixedAllowed));
+            exit;
+        }
+
+        $iAffected = 0;
+        $aIds = bx_get('ids');
+        if(!$aIds || !is_array($aIds)) {
+            echoJson(array());
+            exit;
+        }
+
+        $aIdsAffected = array ();
+        foreach($aIds as $iId) {
+            if(!$this->_oModule->_oDb->deleteInvites(array('id' => $iId)))
+                continue;
+
+            $this->_oModule->isAllowedDeleteInvite($iProfileId, true);
+
+            $aIdsAffected[] = $iId;
+            $iAffected++;
+        }
+
+        echoJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_bx_invites_err_delete_invite')));
+    }
+    
+    protected function _getFilterControls ()
+    {
+        parent::_getFilterControls();
+        return  $this->_getFilterSelectOne($this->_sFilter1Name, $this->_sFilter1Value, $this->_aFilter1Values) . $this->_getSearchInput();
+    }
+    
+    protected function _getSearchInput()
+    {
+        $sJsObject = $this->_oModule->_oConfig->getJsObject('main');
+        $aInputSearch = array(
+            'type' => 'text',
+            'name' => 'search',
+            'attrs' => array(
+                'id' => 'bx-grid-search-' . $this->_sObject,
+                'onKeyup' => 'javascript:$(this).off(\'keyup focusout\'); ' . $sJsObject . '.onChangeFilter(this)',
+                'onBlur' => 'javascript:' . $sJsObject . '.onChangeFilter(this)',
+            )
+        );
+
+        $oForm = new BxTemplFormView(array());
+        return $oForm->genRow($aInputSearch);
+    }
+    
+    protected function _getFilterSelectOne($sFilterName, $sFilterValue, $aFilterValues)
+    {
+        if(empty($sFilterName) || empty($aFilterValues))
+            return '';
+
+        $CNF = &$this->_oModule->_oConfig->CNF;
+        $sJsObject = $this->_oModule->_oConfig->getJsObject('main');
+
+        foreach($aFilterValues as $sKey => $sValue)
+            $aFilterValues[$sKey] = _t($sValue);
+
+        $aInputModules = array(
+            'type' => 'select',
+            'name' => $sFilterName,
+            'attrs' => array(
+                'id' => 'bx-grid-' . $sFilterName . '-' . $this->_sObject,
+                'onChange' => 'javascript:' . $sJsObject . '.onChangeFilter(this)'
+            ),
+            'value' => $sFilterValue,
+            'values' => $aFilterValues
+        );
+
+        $oForm = new BxTemplFormView(array());
+        return $oForm->genRow($aInputModules);
+    }
+    
+    protected function _getCellDate($mixedValue, $sKey, $aField, $aRow)
+    {
+        return parent::_getCellDefault(bx_time_js($mixedValue), $sKey, $aField, $aRow);
+    }
+    
+    protected function _getCellDateSeen($mixedValue, $sKey, $aField, $aRow)
+    {
+        if ($mixedValue == 'undefined')
+            return parent::_getCellDefault('', $sKey, $aField, $aRow);
+        return parent::_getCellDefault(bx_time_js($mixedValue), $sKey, $aField, $aRow);
+    }
+    
+    protected function _getCellDateJoined($mixedValue, $sKey, $aField, $aRow)
+    {
+        if ($mixedValue == 'undefined')
+            return parent::_getCellDefault('', $sKey, $aField, $aRow);
+        return parent::_getCellDefault(bx_time_js($mixedValue), $sKey, $aField, $aRow);
+    }
+    
+    protected function _getCellWhoSend($mixedValue, $sKey, $aField, $aRow)
+    {
+        $oProfile = BxDolProfile::getInstanceMagic($aRow['profile_id']);
+        if ($oProfile)
+            return $this->_getProfileCell($oProfile, $sKey, $aField, $aRow);
+       
+        return parent::_getCellDefault('', $sKey, $aField, $aRow);
+    }
+    
+    protected function _getCellJoinedAccount($mixedValue, $sKey, $aField, $aRow)
+    {
+        if ($aRow['joined_account_id'] == '')
+            return parent::_getCellDefault('', $sKey, $aField, $aRow);
+        
+        $oProfile = BxDolProfile::getInstanceAccountProfile($aRow['joined_account_id']);
+        if ($oProfile)
+            return $this->_getProfileCell($oProfile, $sKey, $aField, $aRow);
+        
+        return parent::_getCellDefault('', $sKey, $aField, $aRow);
+    }
+    
+    protected function _getCellRequest($mixedValue, $sKey, $aField, $aRow)
+    {
+        if ($aRow['request_id'] == '')
+            return parent::_getCellDefault('', $sKey, $aField, $aRow);
+        
+        $aRequest = $this->_oModule->_oDb->getRequests(array('type' => 'by_id', 'value' => $aRow['request_id']));
+        if ($aRequest || true){
+            $CNF = &$this->_oModule->_oConfig->CNF;
+            $sLink = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_REQUESTS']);
+            $sLink = bx_append_url_params($sLink, array('filter' => $aRequest['email']));
+            $sAddon = $this->_oTemplate->parseHtmlByName('account_link.html', array(
+                    'href' => $sLink,
+                    'title' => _t('_bx_invites_grid_txt_view_request'),
+                    'content' => _t('_bx_invites_grid_txt_view_request'),
+                    'class' => ''
+            ));
+            return parent::_getCellDefault($sAddon, $sKey, $aField, $aRow);
+        }
+        return parent::_getCellDefault('', $sKey, $aField, $aRow);
+    }
+    
+    protected function _getProfileCell($oProfile, $sKey, $aField, $aRow)
+    {
+    	$sProfile = $oProfile->getDisplayName();
+
+        $oAcl = BxDolAcl::getInstance();
+
+    	$sAccountEmail = '';
+    	$sManageAccountUrl = '';
+    	if($oProfile && $oProfile instanceof BxDolProfile && $oAcl->isMemberLevelInSet(128)) {
+            $sAccountEmail = $oProfile->getAccountObject()->getEmail();
+            $sManageAccountUrl = $this->_getManageAccountUrl($sAccountEmail);
+    	}
+
+        $sAddon = '';
+        if(!empty($sManageAccountUrl))
+            $sAddon = $this->_oTemplate->parseHtmlByName('account_link.html', array(
+                'href' => $sManageAccountUrl,
+                'title' => _t('_bx_invites_grid_txt_account_manager'),
+                'content' => $sAccountEmail,
+                'class' => 'bx-def-font-grayed'
+            ));
+
+        $mixedValue = $oProfile->getUnit(0, array('template' => array('vars' => array('addon' => $sAddon))));
+
+        return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
+    }
+    
+    protected function _getManageAccountUrl($sFilter = '')
+    {
+    	$sModuleAccounts = 'bx_accounts';
+    	if(!BxDolModuleQuery::getInstance()->isEnabledByName($sModuleAccounts))
+    		return '';
+
+		$oModuleAccounts = BxDolModule::getInstance($sModuleAccounts);
+		if(!$oModuleAccounts || empty($oModuleAccounts->_oConfig->CNF['URL_MANAGE_ADMINISTRATION']))
+			return 'cccc';
+
+		$sLink = $oModuleAccounts->_oConfig->CNF['URL_MANAGE_ADMINISTRATION'];
+
+		$sLink = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($sLink);
+		
+		if(!empty($sFilter))
+			$sLink = bx_append_url_params($sLink, array('filter' => $sFilter));
+
+		return $sLink;
+    }
+}
+
+/** @} */

+ 2 - 0
modules/boonex/invites/classes/BxInvGridRequests.php

@@ -28,6 +28,8 @@ class BxInvGridRequests extends BxTemplGrid
     {
         parent::__construct ($aOptions, $oTemplate);
 
+        $this->_aQueryReset = array('order_field', 'order_dir', $this->_aOptions['paginate_get_start'], $this->_aOptions['paginate_get_per_page']);
+        
         $this->_sModule = 'bx_invites';
         $this->_oModule = BxDolModule::getInstance($this->_sModule);
         

+ 60 - 26
modules/boonex/invites/classes/BxInvModule.php

@@ -216,15 +216,29 @@ class BxInvModule extends BxDolModule
      */
     public function serviceGetBlockManageRequests()
     {
-        $this->_oTemplate->addJs('jquery.form.min.js');
-        $this->_oTemplate->addJs('main.js');
-        $oGrid = BxDolGrid::getObjectInstance($this->_oConfig->getObject('grid_requests'));
-        if(!$oGrid)
-            return '';
-
-        $this->_oTemplate->addCss(array('main.css'));
-        $this->_oTemplate->addJsTranslation(array('_sys_grid_search'));
-        return  $this->_oTemplate->getJsCode('main') . $oGrid->getCode();
+        return $this->getBlockManage('requests');
+    }
+    
+    /**
+     * @page service Service Calls
+     * @section bx_invites Invitations
+     * @subsection bx_invites-page_blocks Page Blocks
+     * @subsubsection bx_invites-get_block_manage_invites get_block_manage_requests
+     * 
+     * @code bx_srv('bx_invites', 'get_block_manage_invites', [...]); @endcode
+     * 
+     * Get page block with manage invitations table.
+     *
+     * @return HTML string with block content to display on the site or empty string if something is wrong. All necessary CSS and JS files are automatically added to the HEAD section of the site HTML.
+     * 
+     * @see BxInvModule::serviceGetBlockManageInvites
+     */
+    /** 
+     * @ref bx_invites-get_block_manage_invites "get_block_manage_invites"
+     */
+    public function serviceGetBlockManageInvites()
+    {
+        return $this->getBlockManage('invites');
     }
 
     /**
@@ -269,8 +283,6 @@ class BxInvModule extends BxDolModule
     public function serviceAccountAddFormCheck()
     {
         $sReturn = '';
-        if (!$this->_oConfig->isRegistrationByInvitation())
-            return $sReturn;
 
         $oSession = BxDolSession::getInstance();
         $sKeyCode = $this->_oConfig->getKeyCode();
@@ -345,8 +357,11 @@ class BxInvModule extends BxDolModule
     }
     
     
+    public function attachAccountIdToInvite($iAccountId, $sKey)
+    {
+        $this->_oDb->attachAccountIdToInvite($iAccountId, $sKey);
+    }
     
-
     public function invite($sType, $sEmails, $sText, $mixedLimit = false, $oForm = null)
     {
         $iProfileId = $this->getProfileId();
@@ -448,6 +463,12 @@ class BxInvModule extends BxDolModule
         $aCheckResult = checkActionModule($iProfileId, 'delete request', $this->getName(), $bPerform);
         return $aCheckResult[CHECK_ACTION_RESULT] !== CHECK_ACTION_RESULT_ALLOWED ? $aCheckResult[CHECK_ACTION_MESSAGE] : true;
     }
+    
+    public function isAllowedDeleteInvite($iProfileId, $bPerform = false)
+    {
+        $aCheckResult = checkActionModule($iProfileId, 'delete invite', $this->getName(), $bPerform);
+        return $aCheckResult[CHECK_ACTION_RESULT] !== CHECK_ACTION_RESULT_ALLOWED ? $aCheckResult[CHECK_ACTION_MESSAGE] : true;
+    }
 
     public function getProfileId()
     {
@@ -472,15 +493,6 @@ class BxInvModule extends BxDolModule
         return $oProfile->getAccountId();
     }
 
-    protected function onInvite($iAccountId, $iProfileId)
-    {
-        $this->isAllowedInvite($iProfileId, true);
-
-        //--- Event -> Invite for Alerts Engine ---//
-        bx_alert($this->_oConfig->getObject('alert'), 'invite', 0, $iProfileId);
-        //--- Event -> Invite for Alerts Engine ---//
-    }
-
     public function onRequest($iRequestId)
     {
         //--- Event -> Request for Alerts Engine ---//
@@ -500,7 +512,33 @@ class BxInvModule extends BxDolModule
         bx_import('FormCheckerHelper', $this->_aModule);
         return BxDolForm::getObjectInstance($this->_oConfig->getObject('form_invite'), $sDisplay);
     }
+    
+    protected function getBlockManage($sType)
+    {
+        $this->_oTemplate->addJs('jquery.form.min.js');
+        $this->_oTemplate->addJs('main.js');
+        $oGrid = BxDolGrid::getObjectInstance($this->_oConfig->getObject('grid_' . $sType));
+        if(!$oGrid)
+            return '';
 
+        $this->_oTemplate->addCss(array('main.css'));
+        $this->_oTemplate->addJsTranslation(array('_sys_grid_search'));
+       
+        return array(
+           'menu' => $this->_oTemplate->getMenuForManageBlocks($sType),
+           'content' => $this->_oTemplate->getJsCode2('main', $sType) . $oGrid->getCode()
+       );
+    }
+
+    protected function onInvite($iAccountId, $iProfileId)
+    {
+        $this->isAllowedInvite($iProfileId, true);
+
+        //--- Event -> Invite for Alerts Engine ---//
+        bx_alert($this->_oConfig->getObject('alert'), 'invite', 0, $iProfileId);
+        //--- Event -> Invite for Alerts Engine ---//
+    }
+    
     protected function getJoinLink($sKey)
     {
         $sKeyCode = $this->_oConfig->getKeyCode();
@@ -513,11 +551,7 @@ class BxInvModule extends BxDolModule
     {
         return  BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'SetSeenMark/' . $sKey . "/";
     }
-    
-    public function attachAccountIdToInvite($iAccountId, $sKey)
-    {
-        $this->_oDb->attachAccountIdToInvite($iAccountId, $sKey);
-    }
+
 }
 
 /** @} */

+ 47 - 3
modules/boonex/invites/classes/BxInvResponse.php

@@ -45,9 +45,6 @@ class BxInvResponse extends BxDolAlertsResponse
 
     protected function _processAccountAdded($oAlert)
     {
-        if(!$this->_oModule->_oConfig->isRegistrationByInvitation())
-            return;
-
         $sKeyCode = $this->_oModule->_oConfig->getKeyCode();
         $sKey = BxDolSession::getInstance()->getUnsetValue($sKeyCode);
         if($sKey === false)
@@ -67,6 +64,22 @@ class BxInvResponse extends BxDolAlertsResponse
         return;
     }
 
+    protected function _processProfileAdd($oAlert)
+    {
+        if (getParam('bx_invites_automatically_befriend') != 'on')
+            return;
+        
+        $oProfile = BxDolProfile::getInstanceMagic($oAlert->iObject);
+        if ($oProfile && $oProfile->isActAsProfile()){
+            $iProfileInvitor = $this->_oModule->_oDb->getInvites(array('type' => 'profile_id_by_joined_account_id', 'value' => $oProfile->getAccountId()));
+            if ($iProfileInvitor){
+                $oConnFrinds = BxDolConnection::getObjectInstance('sys_profiles_friends');
+                $oConnFrinds->addConnection($oAlert->iObject, $iProfileInvitor);
+                $oConnFrinds->addConnection($iProfileInvitor, $oAlert->iObject);
+            }
+        }  
+    }
+    
     protected function _processProfileDelete($oAlert)
     {
         $this->_oModule->_oDb->deleteInvites(array('profile_id' => $oAlert->iObject));
@@ -76,6 +89,37 @@ class BxInvResponse extends BxDolAlertsResponse
     {
         $this->_oModule->_oDb->deleteInvitesByAccount(array('joined_account_id' => $oAlert->iObject));
     }
+    
+    protected function _processBxAnalyticsGetModules($oAlert)
+    {
+        $oAlert->aExtras['list'][$this->_oModule->_aModule['name']] = $this->_oModule->_aModule['title'];
+    }
+    
+    protected function _processBxAnalyticsGetReports($oAlert)
+    {
+        if ($this->_oModule->_aModule['name'] == $oAlert->aExtras['module']){
+            $oAlert->aExtras['list'] = array();
+            $oAlert->aExtras['list']['content_total_invited'] = _t('_bx_invites_reports_for_analytics_invited_total');
+            $oAlert->aExtras['list']['content_speed_invited'] = _t('_bx_invites_reports_for_analytics_invited_speed_grows');
+            $oAlert->aExtras['list']['content_total_invitation'] = _t('_bx_invites_reports_for_analytics_invitation_total');
+            $oAlert->aExtras['list']['content_speed_invitation'] = _t('_bx_invites_reports_for_analytics_invitation_speed_grows');
+        }
+    }
+    
+    protected function _processBxAnalyticsGetChartDataLine($oAlert)
+    {
+        if ($this->_oModule->_aModule['name'] == $oAlert->aExtras['module']){
+            $bIsInvited = false; 
+            if (substr_count($oAlert->aExtras['report_name'], '_invited') > 0)
+                $bIsInvited = true; 
+            
+            if (substr_count($oAlert->aExtras['report_name'], '_total_') > 0)
+                $oAlert->aExtras['report_type'] = BX_ANALYTICS_CONTENT_TOTAL;
+            
+            $oAlert->aExtras['data'] = $this->_oModule->_oDb->getDataForCharts($oAlert->aExtras['date_from'], $oAlert->aExtras['date_to'], $bIsInvited);
+            $oAlert->aExtras['prev_value'] = $this->_oModule->_oDb->getInitValueForCharts($oAlert->aExtras['date_from'], $bIsInvited);
+        }
+    }
 }
 
 /** @} */

+ 27 - 4
modules/boonex/invites/classes/BxInvTemplate.php

@@ -184,15 +184,38 @@ class BxInvTemplate extends BxBaseModGeneralTemplate
 
         return BxTemplFunctions::getInstance()->popupBox($sId, $sTitle, $sContent, true);
     }
-
-    public function getJsCode($sType, $aParams = array(), $bWrap = true)
+    
+    public function getJsCode2($sType, $sGridType)
     {
+        $aParams = array();
         $aParams = array_merge(array(
             'aHtmlIds' => $this->_oConfig->getHtmlIds(),
-            'sObjNameGrid' => $this->_oConfig->getObject('grid_requests'),
+            'sObjNameGrid' => $this->_oConfig->getObject('grid_' . $sGridType),
         ), $aParams);
 
-        return parent::getJsCode($sType, $aParams, $bWrap);
+        return parent::getJsCode($sType, $aParams);
+    }
+
+    public function getMenuForManageBlocks($sType)
+    {
+        $CNF = &$this->_oConfig->CNF;
+        
+        $sMenu = '';
+		$oPermalink = BxDolPermalinks::getInstance();
+
+		$aMenuItems = array();
+		$aMenuItems[] = array('id' => 'invites-requests', 'name' => 'invites-requests', 'class' => '', 'link' => $oPermalink->permalink($CNF['URL_REQUESTS']), 'target' => '_self', 'title' => _t('_bx_invites_menu_item_title_manage_requests'), 'active' => 1);
+		$aMenuItems[] = array('id' => 'invites-invites', 'name' => 'invites-invites', 'class' => '', 'link' => $oPermalink->permalink($CNF['URL_INVITES']), 'target' => '_self', 'title' => _t('_bx_invites_menu_item_title_manage_invites'), 'active' => 1);
+
+		if(count($aMenuItems) > 1) {
+	        $oMenu = new BxTemplMenu(array(
+	            'template' => 'menu_vertical.html', 
+	            'menu_items' => $aMenuItems
+	        ), $this);
+	        $oMenu->setSelected($this->getModule()->_aModule['name'], 'invites-' . $sType);
+	        $sMenu = $oMenu->getCode();
+		}
+        return $sMenu;
     }
     
     public function getProfilesByAccount($iAccountId, $iMaxVisible = 2)

+ 33 - 8
modules/boonex/invites/install/langs/en.xml

@@ -49,32 +49,46 @@
 	<string name="_bx_invites_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
   <string name="_bx_invites_grid_action_title_adm_add"><![CDATA[Send invitations]]></string>
 
+  <string name="_bx_invites_grid_invites_column_title_email"><![CDATA[Email]]></string>
+  <string name="_bx_invites_grid_invites_column_title_date"><![CDATA[Date]]></string>
+  <string name="_bx_invites_grid_invites_column_title_who_sent"><![CDATA[Who sent]]></string>
+  <string name="_bx_invites_grid_invites_column_title_date_seen"><![CDATA[Date seen]]></string>
+  <string name="_bx_invites_grid_invites_column_title_joined_account"><![CDATA[Joined account]]></string>
+  <string name="_bx_invites_grid_invites_column_title_date_joined"><![CDATA[Date joined]]></string>
+  <string name="_bx_invites_grid_invites_column_title_request"><![CDATA[Request]]></string>
+  <string name="_bx_invites_grid_txt_account_manager"><![CDATA[Redirect to manage account.]]></string>
+  <string name="_bx_invites_grid_txt_view_request"><![CDATA[View request]]></string>
 
   <!-- Pages and Blocks -->
 	<string name="_bx_invites_page_title_sys_invite"><![CDATA[Invite]]></string>
 	<string name="_bx_invites_page_title_invite"><![CDATA[Invite]]></string>
-        <string name="_bx_invites_page_block_title_system_invite_form"><![CDATA[Invite Form]]></string>
+<string name="_bx_invites_page_block_title_system_invite_form"><![CDATA[Invite Form]]></string>
 	<string name="_bx_invites_page_block_title_invite_form"><![CDATA[Invite]]></string>
 
 	<string name="_bx_invites_page_title_sys_request"><![CDATA[Request Invitation]]></string>
 	<string name="_bx_invites_page_title_request"><![CDATA[Request Invitation]]></string>
 	<string name="_bx_invites_page_block_title_request_form"><![CDATA[Request Invitation]]></string>
 
-	<string name="_bx_invites_page_title_sys_requests"><![CDATA[Manage Requests]]></string>
-	<string name="_bx_invites_page_title_requests"><![CDATA[Manage Requests]]></string>
-	<string name="_bx_invites_page_block_title_requests"><![CDATA[Manage Requests]]></string>
+	<string name="_bx_invites_page_title_sys_requests"><![CDATA[Manage Invites]]></string>
+	<string name="_bx_invites_page_title_invites"><![CDATA[Manage Invites]]></string>
+	<string name="_bx_invites_page_block_title_invites"><![CDATA[Manage Invites]]></string>
 
 	<string name="_bx_invites_page_block_title_invite"><![CDATA[Invite]]></string>
 
+  <string name="_bx_invites_page_title_sys_invites"><![CDATA[Manage Requests]]></string>
+  <string name="_bx_invites_page_title_requests"><![CDATA[Manage Requests]]></string>
+  <string name="_bx_invites_page_block_title_requests"><![CDATA[Manage Requests]]></string>
 
 	<!-- Menus -->
 	<string name="_bx_invites_menu_item_title_system_admt_requests"><![CDATA[Invitation requests]]></string>
 	<string name="_bx_invites_menu_item_title_admt_requests"><![CDATA[Invitations]]></string>
 	<string name="_bx_invites_menu_item_title_requests"><![CDATA[Requests]]></string>
   <string name="_bx_invites_menu_dashboard_manage_tools_addon_counter1_caption"><![CDATA[awaiting]]></string>
-
+  <string name="_bx_invites_menu_item_title_manage_requests"><![CDATA[Manage requests]]></string>
+  <string name="_bx_invites_menu_item_title_manage_invites"><![CDATA[Manage invites]]></string>
 
   <!-- Options -->
+  <string name="_bx_invites_option_automatically_befriend"><![CDATA[Enable automatically befriend inviter and invited]]></string>
 	<string name="_bx_invites_option_count_per_user"><![CDATA[How many invitations one user can send]]></string>
 	<string name="_bx_invites_option_key_lifetime"><![CDATA[Invitation key lifetime (in days)]]></string>
 	<string name="_bx_invites_option_enable_request_invite"><![CDATA[Enable invitation requests by email]]></string>
@@ -87,7 +101,7 @@
 	<string name="_bx_invites_acl_action_invite"><![CDATA[Invite]]></string>
 	<string name="_bx_invites_acl_action_request"><![CDATA[Request Invitation]]></string>
 	<string name="_bx_invites_acl_action_delete_request"><![CDATA[Delete invitation requests]]></string>
-
+  <string name="_bx_invites_acl_action_delete_invite"><![CDATA[Delete invite]]></string>
 
 	<!-- Email Templates -->
 	<string name="_bx_invites_et_invite_form_message"><![CDATA[Invite form message.]]></string>
@@ -137,7 +151,8 @@
 	<string name="_bx_invites_err_limit_reached"><![CDATA[The number of invitations sent by you reached the limit.]]></string>
 	<string name="_bx_invites_err_not_available"><![CDATA[The feature is not available now. Please, try again later.]]></string>
 	<string name="_bx_invites_err_invite"><![CDATA[Cannot send an invitation on request.]]></string>
-	<string name="_bx_invites_err_delete_request"><![CDATA[Cannot delete the request.]]></string>
+	<string name="_bx_invites_err_delete_invite"><![CDATA[Cannot delete the invite.]]></string>
+  <string name="_bx_invites_err_delete_request"><![CDATA[Cannot delete the request.]]></string>
 	<string name="_bx_invites_err_used"><![CDATA[The invitation link isn't available or already used.]]></string>
   <string name="_bx_invites_err_already_send"><![CDATA[The request already sent for this email.]]></string>
   <string name="_bx_invites_err_already_registed"><![CDATA[User with this email already registered. Please use  <a href="{0}">forgot password</a> to restore access to your account.]]></string>
@@ -150,9 +165,19 @@
   <string name="_bx_invites_request_status_for_filter_invited"><![CDATA[Requests with invites]]></string>
   <string name="_bx_invites_request_status_for_filter_seen"><![CDATA[Invite seen]]></string>
   <string name="_bx_invites_request_status_for_filter_joined"><![CDATA[Joined]]></string>
+
+  <string name="_bx_invites_invites_status_for_filter_all"><![CDATA[All invites]]></string>
+  <string name="_bx_invites_invites_status_for_filter_accepted"><![CDATA[Accepted invites]]></string>
+  <string name="_bx_invites_invites_status_for_filter_not_accepted"><![CDATA[Not accepted invites]]></string>
+
   <string name="_bx_invites_title_date_invite_sent"><![CDATA[Date sent]]></string>
   <string name="_bx_invites_title_date_invite_seen"><![CDATA[Date seen]]></string>
-  
+
+  <string name="_bx_invites_reports_for_analytics_invited_total"><![CDATA[Invited - Total numbers]]></string>
+  <string name="_bx_invites_reports_for_analytics_invited_speed_grows"><![CDATA[Invited - Grows speed]]></string>
+  <string name="_bx_invites_reports_for_analytics_invitation_total"><![CDATA[Invitation - Total numbers]]></string>
+  <string name="_bx_invites_reports_for_analytics_invitation_speed_grows"><![CDATA[Invitation - Grows speed]]></string>
+
   <string name="_bx_invites_alert_action_request"><![CDATA[<b class="bx-ntfs-content-profile">{entry_sample}</b> request invitation - <b class="bx-ntfs-content-entry">{entry_caption}</b>]]></string>
   <string name="_bx_invites_alert_action_request_notify_personal"><![CDATA[New requests]]></string>
 </resources>

+ 6 - 0
modules/boonex/invites/install/sql/disable.sql

@@ -25,6 +25,12 @@ DELETE `sys_acl_actions`, `sys_acl_matrix` FROM `sys_acl_actions`, `sys_acl_matr
 DELETE FROM `sys_acl_actions` WHERE `Module` = @sName;
 
 
+-- GRIDS
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_invites_requests', 'bx_invites_invites');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_invites_requests', 'bx_invites_invites');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_invites_requests', 'bx_invites_invites');
+
+
 -- EMAIL TEMPLATES
 DELETE FROM `sys_email_templates` WHERE `Module` = @sName;
 

+ 61 - 3
modules/boonex/invites/install/sql/enable.sql

@@ -20,6 +20,11 @@ INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `lay
 INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
 ('bx_invites_requests', 1, @sName, '_bx_invites_page_block_title_requests', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_invites";s:6:"method";s:25:"get_block_manage_requests";}', 0, 1, 1);
 
+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_invites_invites', '_bx_invites_page_title_sys_invites', '_bx_invites_page_title_invites', @sName, 5, 2147483647, 1, 'invites-invites', 'page.php?i=invites-invites', '', '', '', 0, 1, 0, '', '');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_invites_invites', 1, @sName, '_bx_invites_page_block_title_invites', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_invites";s:6:"method";s:24:"get_block_manage_invites";}', 0, 1, 1);
 
 -- PAGES: add page block on dashboard
 SET @iPBCellDashboard = 3;
@@ -50,8 +55,8 @@ INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `c
 ('bx_invites_enable_request_invite', 'on', @iCategId, '_bx_invites_option_enable_request_invite', 'checkbox', '', '', '', 3),
 ('bx_invites_requests_email', '', @iCategId, '_bx_invites_option_requests_email', 'digit', '', '', '', 4),
 ('bx_invites_enable_reg_by_inv', 'on', @iCategId, '_bx_invites_option_enable_reg_by_inv', 'checkbox', '', '', '', 5),
-('bx_invites_requests_notifications', 'on', @iCategId, '_bx_invites_option_requests_notifications', 'checkbox', '', '', '', 6);
-
+('bx_invites_requests_notifications', 'on', @iCategId, '_bx_invites_option_requests_notifications', 'checkbox', '', '', '', 6),
+('bx_invites_automatically_befriend', 'on', @iCategId, '_bx_invites_option_automatically_befriend', 'checkbox', '', '', '', 7);
 
 -- ACL
 INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
@@ -62,6 +67,10 @@ INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`,
 (@sName, 'delete request', NULL, '_bx_invites_acl_action_delete_request', '', 0, 1);
 SET @iIdActionDeleteRequest = LAST_INSERT_ID();
 
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+(@sName, 'delete invite', NULL, '_bx_invites_acl_action_delete_invite', '', 0, 1);
+SET @iIdActionDeleteInvite = LAST_INSERT_ID();
+
 INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
 (@sName, 'invite', NULL, '_bx_invites_acl_action_invite', '', 1, 1);
 SET @iIdActionInvite = LAST_INSERT_ID();
@@ -85,6 +94,10 @@ INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
 (@iModerator, @iIdActionDeleteRequest),
 (@iAdministrator, @iIdActionDeleteRequest),
 
+-- delete invite
+(@iModerator, @iIdActionDeleteInvite),
+(@iAdministrator, @iIdActionDeleteInvite),
+
 -- invite
 (@iAccount, @iIdActionInvite),
 (@iStandard, @iIdActionInvite),
@@ -96,6 +109,47 @@ INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
 (@iPremium, @iIdActionInvite);
 
 
+-- GRIDS
+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_invites_requests', 'Sql', 'SELECT `bx_inv_requests`.* FROM `bx_inv_requests` WHERE 1', 'bx_inv_requests', 'id', 'status, date', '', '', 20, NULL, 'start', '', 'bx_inv_requests`.`name, bx_inv_requests`.`email', '', 'like', '', '', 192, 'BxInvGridRequests', 'modules/boonex/invites/classes/BxInvGridRequests.php'),
+('bx_invites_invites', 'Sql', 'SELECT `bx_inv_invites`.* FROM `bx_inv_invites` WHERE 1', 'bx_inv_invites', 'id', 'date', '', '', 20, NULL, 'start', '', 'email', '', 'like', '', '', 192, 'BxInvGridInvites', 'modules/boonex/invites/classes/BxInvGridInvites.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_invites_requests', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_invites_requests', 'name', '_bx_invites_grid_column_title_name', '14%', 0, '', '', 2),
+('bx_invites_requests', 'email', '_bx_invites_grid_column_title_email', '14%', 1, '25', '', 3),
+('bx_invites_requests', 'nip', '_bx_invites_grid_column_title_nip', '10%', 0, '15', '', 4),
+('bx_invites_requests', 'date', '_bx_invites_grid_column_title_date', '10%', 0, '20', '', 5),
+('bx_invites_requests', 'joined_account', '_bx_invites_grid_column_title_joined_account', '20%', 0, '20', '', 6),
+('bx_invites_requests', 'status', '_bx_invites_grid_column_title_status', '10%', 0, '15', '', 7),
+('bx_invites_requests', 'actions', '', '20%', 0, '', '', 8),
+
+('bx_invites_invites', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_invites_invites', 'email', '_bx_invites_grid_invites_column_title_email', '15%', 1, '25', '', 2),
+('bx_invites_invites', 'who_send', '_bx_invites_grid_invites_column_title_who_sent', '15%', 0, '', '', 3),
+('bx_invites_invites', 'date', '_bx_invites_grid_invites_column_title_date', '10%', 0, '20', '', 4),
+('bx_invites_invites', 'date_seen', '_bx_invites_grid_invites_column_title_date_seen', '10%', 0, '20', '', 5),
+('bx_invites_invites', 'joined_account', '_bx_invites_grid_invites_column_title_joined_account', '15%', 0, '20', '', 6),
+('bx_invites_invites', 'date_joined', '_bx_invites_grid_invites_column_title_date_joined', '10%', 0, '20', '', 7),
+('bx_invites_invites', 'request', '_bx_invites_grid_invites_column_title_request', '13%', 0, '20', '', 8),
+('bx_invites_invites', 'actions', '', '20%', 0, '', '', 8);
+
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
+('bx_invites_requests', 'bulk', 'invite', '_bx_invites_grid_action_title_adm_invite', '', 0, 0, 1),
+('bx_invites_requests', 'bulk', 'delete', '_bx_invites_grid_action_title_adm_delete', '', 0, 1, 2),
+('bx_invites_requests', 'single', 'info', '_bx_invites_grid_action_title_adm_info', 'info-circle', 1, 0, 1),
+('bx_invites_requests', 'single', 'invite', '_bx_invites_grid_action_title_adm_invite', 'envelope', 1, 0, 2),
+('bx_invites_requests', 'single', 'delete', '_bx_invites_grid_action_title_adm_delete', 'remove', 1, 1, 3),
+('bx_invites_requests', 'single', 'invite_info', '_bx_invites_grid_action_title_adm_invite_info', 'info-circle', 1, 0, 4),
+('bx_invites_requests', 'independent', 'add', '_bx_invites_grid_action_title_adm_add', '', 0, 0, 5),
+
+('bx_invites_invites', 'bulk', 'delete', '_bx_invites_grid_action_title_adm_delete', '', 0, 1, 1),
+('bx_invites_invites', 'single', 'delete', '_bx_invites_grid_action_title_adm_delete', 'remove', 1, 1, 2),
+('bx_invites_invites', 'independent', 'add', '_bx_invites_grid_action_title_adm_add', '', 0, 0, 3);
+
+
+
 -- EMAIL TEMPLATES
 INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES 
 (@sName, '_bx_invites_et_invite_form_message', 'bx_invites_invite_form_message', '_bx_invites_et_invite_form_message_subject', '_bx_invites_et_invite_form_message_body'),
@@ -112,4 +166,8 @@ INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
 ('account', 'add_form', @iHandler),
 ('account', 'added', @iHandler),
 ('account', 'delete', @iHandler),
-('profile', 'delete', @iHandler);
+('profile', 'delete', @iHandler),
+('profile', 'add', @iHandler),
+('bx_analytics', 'get_modules', @iHandler),
+('bx_analytics', 'get_reports', @iHandler),
+('bx_analytics', 'get_chart_data_line', @iHandler);

+ 0 - 25
modules/boonex/invites/install/sql/install.sql

@@ -64,31 +64,6 @@ INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_fo
 ('bx_invites_request_send', 'text', 2147483647, 1, 3),
 ('bx_invites_request_send', 'ifr_do_submit', 2147483647, 1, 4);
 
-
--- GRIDS
-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_invites_requests', 'Sql', 'SELECT `bx_inv_requests`.* FROM `bx_inv_requests` WHERE 1', 'bx_inv_requests', 'id', 'status, date', '', '', 20, NULL, 'start', '', 'bx_inv_requests`.`name, bx_inv_requests`.`email', '', 'like', '', '', 192, 'BxInvGridRequests', 'modules/boonex/invites/classes/BxInvGridRequests.php');
-
-INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
-('bx_invites_requests', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
-('bx_invites_requests', 'name', '_bx_invites_grid_column_title_name', '14%', 0, '', '', 2),
-('bx_invites_requests', 'email', '_bx_invites_grid_column_title_email', '14%', 1, '25', '', 3),
-('bx_invites_requests', 'nip', '_bx_invites_grid_column_title_nip', '10%', 0, '15', '', 4),
-('bx_invites_requests', 'date', '_bx_invites_grid_column_title_date', '10%', 0, '20', '', 5),
-('bx_invites_requests', 'joined_account', '_bx_invites_grid_column_title_joined_account', '20%', 0, '20', '', 6),
-('bx_invites_requests', 'status', '_bx_invites_grid_column_title_status', '10%', 0, '15', '', 7),
-('bx_invites_requests', 'actions', '', '20%', 0, '', '', 8);
-
-INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
-('bx_invites_requests', 'bulk', 'invite', '_bx_invites_grid_action_title_adm_invite', '', 0, 0, 1),
-('bx_invites_requests', 'bulk', 'delete', '_bx_invites_grid_action_title_adm_delete', '', 0, 1, 2),
-('bx_invites_requests', 'single', 'info', '_bx_invites_grid_action_title_adm_info', 'info-circle', 1, 0, 1),
-('bx_invites_requests', 'single', 'invite', '_bx_invites_grid_action_title_adm_invite', 'envelope', 1, 0, 2),
-('bx_invites_requests', 'single', 'delete', '_bx_invites_grid_action_title_adm_delete', 'remove', 1, 1, 3),
-('bx_invites_requests', 'single', 'invite_info', '_bx_invites_grid_action_title_adm_invite_info', 'info-circle', 1, 0, 4),
-('bx_invites_requests', 'independent', 'add', '_bx_invites_grid_action_title_adm_add', '', 0, 0, 5);
-
-
 -- STUDIO PAGE & WIDGET
 INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
 (3, @sName, '_bx_invites', '_bx_invites', 'bx_invites@modules/boonex/invites/|std-icon.svg');

+ 0 - 7
modules/boonex/invites/install/sql/uninstall.sql

@@ -10,13 +10,6 @@ DELETE FROM `sys_form_inputs` WHERE `module` = @sName;
 DELETE FROM `sys_form_displays` WHERE `module` = @sName;
 DELETE FROM `sys_objects_form` WHERE `module` = @sName;
 
-
--- GRIDS
-DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_invites_requests');
-DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_invites_requests');
-DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_invites_requests');
-
-
 -- STUDIO PAGE & WIDGET
 DELETE FROM `tp`, `tw`, `tpw`
 USING `sys_std_pages` AS `tp`, `sys_std_widgets` AS `tw`, `sys_std_pages_widgets` AS `tpw`