Преглед изворни кода

Merge branch 'master' of github.com:unaio/una

Alex Trofimov пре 6 година
родитељ
комит
605663114a
1 измењених фајлова са 21 додато и 16 уклоњено
  1. 21 16
      template/scripts/BxBaseReport.php

+ 21 - 16
template/scripts/BxBaseReport.php

@@ -271,13 +271,15 @@ class BxBaseReport extends BxDolReport
 		
 		        $oZ = new BxDolAlerts('report', 'do', $iId, $iAuthorId, array('object_system' => $this->_sSystem, 'object_id' => $iObjectId, 'object_author_id' => $iObjectAuthorId, 'type' => $sType, 'text' => $sText));
 		        $oZ->alert();
-                
-                bx_audit(
-                    $iObjectId, 
-                    $this->_sSystem, 
-                    '_sys_audit_action_report',  
-                    $this->_prepareAuditParams($iObjectId, array('type' => $sType, 'text' => $sText))
-                );
+                $mixedParams = $this->_prepareAuditParams($iObjectId, array('type' => $sType, 'text' => $sText));
+                if ($mixedParams){
+                    bx_audit(
+                        $iObjectId, 
+                        $this->_sSystem, 
+                        '_sys_audit_action_report',  
+                        $mixedParams
+                    );
+                }
 
 		        $aReport = $this->_oQuery->getReport($iObjectId);
 		        return array(
@@ -343,17 +345,20 @@ class BxBaseReport extends BxDolReport
     {
         $sModule = $this->_sSystem;
         $oModule = BxDolModule::getInstance($sModule);
-        $CNF = $oModule->_oConfig->CNF;
-
-        $aContentInfo = BxDolRequest::serviceExists($sModule, 'get_all') ? BxDolService::call($sModule, 'get_all', array(array('type' => 'id', 'id' => $iObjectId))) : array();
         
-        $AuditParams = array(
-            'content_title' => isset($CNF['FIELD_TITLE'])  ? $aContentInfo[$CNF['FIELD_TITLE']] : '',
-            'content_info_object' =>  isset($CNF['OBJECT_CONTENT_INFO']) ? $CNF['OBJECT_CONTENT_INFO'] : '',
-            'data' => $aData 
-        );
+        if ($oModule){
+            $CNF = $oModule->_oConfig->CNF;
+
+            $aContentInfo = BxDolRequest::serviceExists($sModule, 'get_all') ? BxDolService::call($sModule, 'get_all', array(array('type' => 'id', 'id' => $iObjectId))) : array();
         
-        return $AuditParams;
+            $AuditParams = array(
+                'content_title' => isset($CNF['FIELD_TITLE'])  ? $aContentInfo[$CNF['FIELD_TITLE']] : '',
+                'content_info_object' =>  isset($CNF['OBJECT_CONTENT_INFO']) ? $CNF['OBJECT_CONTENT_INFO'] : '',
+                'data' => $aData 
+            );
+            return $AuditParams;
+        }
+        return false;
     }
 }