<?php
 $EASY_AUTHENTICATE=true; include("_config/addCfg.php"); include("_includes/addInc.php"); if (!$S['adminReport']['customFilters']) $S['adminReport']['customFilters']= []; $reportSource=$S['adminReport']['source']; if ($reportSource) { if ($reportSource) { loadReportConfigs($reportSource, 'columns'); @include($MODULE_REL_PATH."_lang/".$S['global']['lang']."/_customLoad/reports/".$reportSource."/columns.lang.php"); } } if ($R['customFilters']) $S['adminReport']['customFilters']=$R['customFilters']; if (strlen($R['addColumn'])>0) { if ( $S['adminReport']['customFilters'][$R['addColumn']] ) { unset($S['adminReport']['customFilters'][$R['addColumn']]); } $newCol=$R['addColumn']; $S['adminReport']['customFilters'][$newCol]= ['v'=>true, 'd'=>'']; if ($CFG['reportsManagement']['adminReport']['columnsList'][$reportSource][$newCol]) { if ($CFG['reportsManagement']['adminReport']['columnsList'][$reportSource][$newCol]['type']=="numeric") $S['adminReport']['customFilters'][$newCol]['operation']=$CFG['reportsManagement']['adminReport']['customFilters']['numericDefaultOperation']; if ($CFG['reportsManagement']['adminReport']['columnsList'][$reportSource][$newCol]['type']=="price") $S['adminReport']['customFilters'][$newCol]['operation']=$CFG['reportsManagement']['adminReport']['customFilters']['priceDefaultOperation']; if ($CFG['reportsManagement']['adminReport']['columnsList'][$reportSource][$newCol]['type']=="string") $S['adminReport']['customFilters'][$newCol]['operation']=$CFG['reportsManagement']['adminReport']['customFilters']['stringDefaultOperation']; } else { $S['adminReport']['customFilters'][$newCol]['operation']=$CFG['reportsManagement']['adminReport']['customFilters']['stringDefaultOperation']; } } if (strlen($R['deleteColumn'])) { unset($S['adminReport']['customFilters'][$R['deleteColumn']]); } if ($reportSource and !$S['adminReport']['customFilters']) { $showMessage['info'] = $_LANG['reportsManagement']['admin']['customFilters']['noFiltersMsg']; } $customFiltersList=$S['adminReport']['customFilters']; foreach($customFiltersList as $col=>$filter) { if (!is_numeric($col)) { $customFiltersList[$col]['type']=$CFG['reportsManagement']['adminReport']['columnsList'][$reportSource][$col]['type']; } else { $customFiltersList[$col]['type']='string'; } if (!is_numeric($col)) { if ($S['adminReport']['columns'][$col]['n']) { $customFiltersList[$col]['columnOriginalName']=$S['adminReport']['columns'][$col]['n']; } else { $customFiltersList[$col]['columnOriginalName']=$_LANG['reports']['columnNames'][$reportSource][$col]; } } else { $customFiltersList[$col]['columnOriginalName']=$S['adminReport']['customColumns'][$col]['n']; } if (($customFiltersList[$col]['type']=="numeric" or $customFiltersList[$col]['type']=="price") and !$filter['operation']) { if ($filter['values']) $customFiltersList[$col]['operation']="values"; else $customFiltersList[$col]['operation']="inclClosedInterval"; } } $smarty->assign('reportSource', $reportSource); $smarty->assign('customFiltersList', $customFiltersList); $smarty->display("index_stepContent_customFilters_filtersList.tpl"); ?>