RomanL 5 лет назад
Родитель
Сommit
b134c2ad4d
3 измененных файлов с 9 добавлено и 10 удалено
  1. 4 4
      inc/classes/BxDolAuditGrid.php
  2. 1 1
      install/sql/system.sql
  3. 4 5
      template/scripts/BxBaseAuditGrid.php

+ 4 - 4
inc/classes/BxDolAuditGrid.php

@@ -53,7 +53,8 @@ class BxDolAuditGrid extends BxTemplGrid
         $this->_aFilterProfileValues[''] = _t('_sys_audit_filter_profile_select');
         foreach($aProfiles as $iProfile){
             $oProfile = BxDolProfile::getInstance($iProfile);
-            $this->_aFilterProfileValues[$iProfile] = $oProfile->getDisplayName();
+			if ($oProfile)
+				$this->_aFilterProfileValues[$iProfile] = $oProfile->getDisplayName();
         }
 
     	$sFilterProfile = bx_get($this->_sFilterProfileName);
@@ -110,9 +111,8 @@ class BxDolAuditGrid extends BxTemplGrid
         
         if(bx_get('content_id') && is_numeric(bx_get('content_id')))
             $this->_aOptions['source'] .= $this->oDb->prepareAsString(" AND `content_id` = ?", (int)bx_get('content_id'));
-        if(bx_get('actor_id')  && is_numeric(bx_get('actor_id')))
-            $this->_aOptions['source'] .= $this->oDb->prepareAsString(" AND `profile_id` = ?", (int)bx_get('actor_id'));
-        if(bx_get('context_id')  && is_numeric(bx_get('context_id')))
+        
+		if(bx_get('context_id')  && is_numeric(bx_get('context_id')))
             $this->_aOptions['source'] .= $this->oDb->prepareAsString(" AND `context_profile_id` = ?", (int)bx_get('context_id'));
         
         return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);

+ 1 - 1
install/sql/system.sql

@@ -4376,7 +4376,7 @@ INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `fie
 ('sys_studio_categories', 'Sql', 'SELECT * FROM `sys_categories` WHERE 1 ', 'sys_categories', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'value', '', 'like', '', '', 'BxTemplStudioFormsCategories', ''),
 ('sys_studio_groups_roles', 'Sql', 'SELECT * FROM `sys_form_pre_values` WHERE 1 ', 'sys_form_pre_values', 'id', 'Order', '', '', 20, NULL, 'start', '', '', 'LKey', 'like', '', '', 'BxTemplStudioFormsGroupsRoles', ''),
 
-('sys_audit_administration', 'Sql', 'SELECT * FROM `sys_audit` WHERE 1 ', 'sys_audit', 'id', 'added', '', '', 20, NULL, 'start', '', 'value', '', 'like', 'content_module,profile_id,content_id,context_profile_id,added', 'action_lang_key', 'BxTemplAuditGrid', ''),
+('sys_audit_administration', 'Sql', 'SELECT * FROM `sys_audit` WHERE 1 ', 'sys_audit', 'id', 'added', '', '', 20, NULL, 'start', '', 'value', '', 'like', 'content_module,profile_id,content_id,author_id,context_profile_id,added', 'action_lang_key', 'BxTemplAuditGrid', ''),
 
 ('sys_badges_administration', 'Sql', 'SELECT * FROM `sys_badges` WHERE 1 ', 'sys_badges', 'id', 'added', '', '', 20, NULL, 'start', '', 'text', '', 'like', '', '', 'BxTemplStudioBadgesGrid', ''),
 

+ 4 - 5
template/scripts/BxBaseAuditGrid.php

@@ -46,12 +46,11 @@ class BxBaseAuditGrid extends BxDolAuditGrid
     {
         $mixedValue = '';
         if ($aRow['content_id'] > 0){
-            $iAuthorProfileId = BxDolRequest::serviceExists($aRow['content_module'], 'get_author') ? BxDolService::call($aRow['content_module'], 'get_author', array($aRow['content_id'])) : '';
-            $oProfile = BxDolProfile::getInstance($iAuthorProfileId);
-            if ($oProfile){
-                $mixedValue = BxDolTemplate::getInstance()->parseLink($oProfile->getUrl(), $oProfile->getDisplayName());
+			$sLink = BxDolRequest::serviceExists($aRow['content_module'], 'get_link') ? BxDolService::call($aRow['content_module'], 'get_link', array($aRow['content_id'])) : '';
+			$sTitle = BxDolRequest::serviceExists($aRow['content_module'], 'get_title') ? BxDolService::call($aRow['content_module'], 'get_title', array($aRow['content_id'])) : '';
+            if ($sLink){
+                $mixedValue = BxDolTemplate::getInstance()->parseLink($sLink, $sTitle);
             }
-            
         }
         return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
     }