<?php
 unset($S['adminReport']); $reportDetailsSQL="SELECT * FROM `$DBTReports` WHERE id='".$R['updateIdReport']."'"; $reportDetails=$db->GetRow($reportDetailsSQL); if (!$reportDetails) { if (!is_array($reportDetails)) { writeLog("Could not get report details. SQL: ".$reportDetailsSQL, 'events', 10); } $S['adminReport']['updateIdReport']=0; } else { $S['adminReport']['updateIdReport']=$R['updateIdReport']; } if ($S['adminReport']['updateIdReport']) { $S['adminReport']['idCategory']=$reportDetails['idCategory']; $S['adminReport']['source']=$reportDetails['source']; $S['adminReport']['name']=$reportDetails['name']; $S['adminReport']['fileNameTemplate']=$reportDetails['fileNameTemplate']; $S['adminReport']['description']=$reportDetails['description']; $S['adminReport']['platform']=$reportDetails['platform']; $S['adminReport']['format']=$reportDetails['format']; $S['adminReport']['extension']=$reportDetails['extension']; $S['adminReport']['style']=$reportDetails['style']; $S['adminReport']['filters']=unserialize($reportDetails['filters']); if (!$S['adminReport']['filters']) $S['adminReport']['filters']= []; $S['adminReport']['customFilters']=unserialize($reportDetails['customFilters']); if (!$S['adminReport']['customFilters']) $S['adminReport']['customFilters']= []; $S['adminReport']['columns']=unserialize($reportDetails['columns']); if (!$S['adminReport']['columns']) $S['adminReport']['columns']= []; $S['adminReport']['columnsOrder']=unserialize($reportDetails['columnsOrder']); if (!$S['adminReport']['columnsOrder']) $S['adminReport']['columnsOrder']= []; $S['adminReport']['sorting']=unserialize($reportDetails['sorting']); if (!$S['adminReport']['sorting']) $S['adminReport']['sorting']= []; $S['adminReport']['pivots']=unserialize($reportDetails['pivotTables']); if (!$S['adminReport']['pivots']) $S['adminReport']['pivots']= []; $customColumnsList=unserialize($reportDetails['customColumns']); if ($customColumnsList) { foreach($customColumnsList as $idx=>$col) { if ($col['type']=='remark') { $customColumnsList[$idx]['f']='remark:'.$col['rmSrc'].':'.$col['rmVar']; } elseif ($col['type']=='arrayValue') { $customColumnsList[$idx]['f']='arrayValue:'.$col['arrSrc'].':'.$col['arrKey']; } elseif ($col['type']=='entity') { $customColumnsList[$idx]['f']='entity:'.$col['entType'].':'.$col['idEnt'].':'.$col['attr']; } elseif ($col['type']=='entityValue') { $customColumnsList[$idx]['f']='entityValue:'.$col['entType'].':'.$col['idEnt'].':'.$col['attr']; } } } $S['adminReport']['customColumns']=$customColumnsList; if (!$S['adminReport']['customColumns']) $S['adminReport']['customColumns']= []; $S['adminReport']['extraOptions']['emailRecipients']=unserialize($reportDetails['emailRecipients']); if ($reportDetails['autoGenerate']) { $S['adminReport']['extraOptions']['autoGenerate']=unserialize($reportDetails['autoGenerate']); $S['adminReport']['extraOptions']['autoGenerate']['active']=1; } else { $S['adminReport']['extraOptions']['autoGenerate']= []; } $S['adminReport']['extraOptions']['reportSummary']= []; $S['adminReport']['extraOptions']['reportSummary']['options']=unserialize($reportDetails['summary']); if ($S['adminReport']['extraOptions']['reportSummary']['options']) $S['adminReport']['extraOptions']['reportSummary']['active']=true; } $reportAccessSQL="SELECT idUser FROM `$DBTReportsAccess` WHERE idReport='".$R['updateIdReport']."'"; $reportAccess=$db->GetAll($reportAccessSQL); if (!$reportAccess) { if ( !is_array($reportAccess) ) { writeLog("Could not get report accesses.", 'events', 10); } } else { foreach($reportAccess as $usr) { $S['adminReport']['accessUsers'][$usr['idUser']]=1; } } ?>