index.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. if (cfr('TASKFLOW')) {
  3. if ($ubillingConfig->getAlterParam('TASKSTATES_ENABLED')) {
  4. $taskFlow = new TaskFlow();
  5. if (ubRouting::checkGet($taskFlow::ROUTE_EMREPORT)) {
  6. //Employee report rendering
  7. $windowControls = wf_Link($taskFlow::URL_ME, web_icon_search('Task flow'));
  8. show_window(__('By date') . ' ' . $windowControls, $taskFlow->renderEmployeeReportForm());
  9. show_window(__('Report'), $taskFlow->renderEmployeeReport());
  10. } else {
  11. //Search form rendering
  12. $windowControls = wf_Link($taskFlow::URL_ME . '&' . $taskFlow::ROUTE_EMREPORT . '=true', web_icon_charts('Report'));
  13. show_window(__('Task flow') . ' ' . $windowControls, $taskFlow->renderControls());
  14. }
  15. //Do some fucking search!
  16. if (ubRouting::checkPost($taskFlow::PROUTE_STARTSEARCH)) {
  17. show_window(__('Search results'), $taskFlow->performSearch());
  18. } else {
  19. if (!ubRouting::checkGet($taskFlow::ROUTE_EMREPORT)) {
  20. $randomAdvice = $taskFlow->getAwesomeAdvice();
  21. if (!empty($randomAdvice)) {
  22. show_info(__('Advice of the day') . ': ' . $randomAdvice);
  23. zb_BillingStats(true);
  24. }
  25. }
  26. }
  27. } else {
  28. show_error(__('This module is disabled'));
  29. }
  30. } else {
  31. show_error(__('Access denied'));
  32. }