AntonLV 6 лет назад
Родитель
Сommit
f6c7c83b50

+ 6 - 4
modules/base/groups/classes/BxBaseModGroupsModule.php

@@ -961,14 +961,16 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
 
     public function serviceCheckAllowedViewForProfile ($aDataEntry, $isPerformAction = false, $iProfileId = false)
     {
+        $CNF = &$this->_oConfig->CNF;
+
         $bInvited = false;
-        if (bx_get('key')){
-            $oGroupProfile = BxDolProfile::getInstanceByContentAndType($aDataEntry[$this->_oConfig->CNF['FIELD_ID']], $this->getName());
+        if(!empty($CNF['TABLE_INVITES']) && bx_get('key')){
+            $oGroupProfile = BxDolProfile::getInstanceByContentAndType($aDataEntry[$CNF['FIELD_ID']], $this->getName());
             $mixedInvited = $this->isInvited(bx_get('key'), $oGroupProfile->id());
-            if ($mixedInvited === true)
+            if($mixedInvited === true)
                 $bInvited = true;
         }
-        
+
         if ($this->isFan($aDataEntry[$this->_oConfig->CNF['FIELD_ID']], $iProfileId) || $bInvited)
             return CHECK_ACTION_RESULT_ALLOWED;
 

+ 10 - 10
modules/base/groups/classes/BxBaseModGroupsPageEntry.php

@@ -46,25 +46,25 @@ class BxBaseModGroupsPageEntry extends BxBaseModProfilePageEntry
     public function getCode ()
     {
         $CNF = &$this->_oModule->_oConfig->CNF;
+
         $sRv = '';
-        if (bx_get('key')){
-            $sKey = bx_get('key');
+        $sKey = '';
+        if(!empty($CNF['TABLE_INVITES']) && ($sKey = bx_get('key')) !== false) {
             $sId = $this->_oModule->getName() . '_popup_invite';
-            
+
             $mixedInvited = $this->_oModule->isInvited($sKey, $this->_oProfile->id());
-            if ($mixedInvited === true){
+            if ($mixedInvited === true) {
                 $sRv = $this->_oModule->_oTemplate->parseHtmlByName('popup_invite.html', array(
                     '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']),
-						
+                    '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']),
                 ));
             }
-            else{
+            else
                 $sRv = $mixedInvited;
-            }
         }
+
         $this->_oTemplate->addJs(array('invite_popup.js'));
         return ($sRv != '' ? $this->_oModule->_oTemplate->getJsCode('invite_popup', array(
             'sPopupId' => $sId,

+ 3 - 1
modules/base/profile/classes/BxBaseModProfileTemplate.php

@@ -135,7 +135,9 @@ class BxBaseModProfileTemplate extends BxBaseModGeneralTemplate
         if(empty($sCoverUrl))
             $sCoverUrl = $this->getImageUrl('cover.svg');
 
-        $aTmplVarsMeta = $this->getSnippetMenuVars ($iProfile, $bPublic);
+        $aTmplVarsMeta = array();
+        if(substr($sTemplate, 0, 8) != 'unit_wo_')
+            $aTmplVarsMeta = $this->getSnippetMenuVars ($iProfile, $bPublic);
 
         return array_merge(array (
             'class' => $this->_getUnitClass($aData, $sTemplate),