Exemplo n.º 1
0
 $filter_data['selected_branch_options'] = Misc::arrayIntersectByKey((array) $filter_data['branch_ids'], $branch_options);
 //Get departments
 $dlf = new DepartmentListFactory();
 $dlf->getByCompanyId($current_company->getId());
 $department_options = Misc::prependArray($all_array_option, $dlf->getArrayByListFactory($dlf, FALSE, TRUE));
 $filter_data['src_department_options'] = Misc::arrayDiffByKey((array) $filter_data['department_ids'], $department_options);
 $filter_data['selected_department_options'] = Misc::arrayIntersectByKey((array) $filter_data['department_ids'], $department_options);
 //Get employee titles
 $utlf = new UserTitleListFactory();
 $utlf->getByCompanyId($current_company->getId());
 $user_title_options = Misc::prependArray($all_array_option, $utlf->getArrayByListFactory($utlf, FALSE, TRUE));
 $filter_data['src_user_title_options'] = Misc::arrayDiffByKey((array) $filter_data['user_title_ids'], $user_title_options);
 $filter_data['selected_user_title_options'] = Misc::arrayIntersectByKey((array) $filter_data['user_title_ids'], $user_title_options);
 //Get Log Actions
 $lf = new LogFactory();
 $log_action_options = Misc::prependArray($all_array_option, $lf->getOptions('action'));
 $filter_data['src_log_action_options'] = Misc::arrayDiffByKey((array) $filter_data['log_action_ids'], $log_action_options);
 $filter_data['selected_log_action_options'] = Misc::arrayIntersectByKey((array) $filter_data['log_action_ids'], $log_action_options);
 //Get table names
 $log_table_name_options = Misc::prependArray($all_array_option, $lf->getOptions('table_name'));
 $filter_data['src_log_table_name_options'] = Misc::arrayDiffByKey((array) $filter_data['log_table_name_ids'], $log_table_name_options);
 $filter_data['selected_log_table_name_options'] = Misc::arrayIntersectByKey((array) $filter_data['log_table_name_ids'], $log_table_name_options);
 //Get column list
 $filter_data['src_column_options'] = Misc::arrayDiffByKey((array) $filter_data['column_ids'], $columns);
 $filter_data['selected_column_options'] = Misc::arrayIntersectByKey((array) $filter_data['column_ids'], $columns);
 //Get primary/secondary order list
 $filter_data['sort_options'] = $columns;
 $filter_data['sort_direction_options'] = Misc::getSortDirectionArray();
 //$filter_data['group_by_options'] = Misc::prependArray( array('0' => TTi18n::gettext('No Grouping')), $static_columns );
 $saved_report_options = $ugdlf->getByUserIdAndScriptArray($current_user->getId(), $_SERVER['SCRIPT_NAME']);
 $generic_data['saved_report_options'] = $saved_report_options;