PageRenderTime 63ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/Reports/NewReport0.php

https://bitbucket.org/yousef_fadila/vtiger
PHP | 126 lines | 112 code | 6 blank | 8 comment | 13 complexity | 7a25e99100bffe79ba2eeb17f36745d4 MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0
  1. <?php
  2. /*+********************************************************************************
  3. * The contents of this file are subject to the vtiger CRM Public License Version 1.0
  4. * ("License"); You may not use this file except in compliance with the License
  5. * The Original Code is: vtiger CRM Open Source
  6. * The Initial Developer of the Original Code is vtiger.
  7. * Portions created by vtiger are Copyright (C) vtiger.
  8. * All Rights Reserved.
  9. ********************************************************************************/
  10. require_once('Smarty_setup.php');
  11. require_once("data/Tracker.php");
  12. require_once('include/logging.php');
  13. require_once('include/utils/utils.php');
  14. require_once('modules/Reports/Reports.php');
  15. global $app_strings;
  16. global $app_list_strings;
  17. global $mod_strings;
  18. $current_module_strings = return_module_language($current_language, 'Reports');
  19. global $list_max_entries_per_page;
  20. global $urlPrefix;
  21. $log = LoggerManager::getLogger('report_list');
  22. global $currentModule;
  23. global $image_path;
  24. global $theme;
  25. global $focus_list;
  26. $recordid = vtlib_purify($_REQUEST['record']);
  27. $theme_path="themes/".$theme."/";
  28. $image_path=$theme_path."images/";
  29. $list_report_form = new vtigerCRM_Smarty;
  30. $list_report_form->assign("MOD", $mod_strings);
  31. $list_report_form->assign("APP", $app_strings);
  32. $repObj = new Reports ();
  33. if($recordid!=''){
  34. $oRep = new Reports($recordid);
  35. if($oRep->secmodule!=''){
  36. $sec_mod = split(":",$oRep->secmodule);
  37. $rel_modules = getReportRelatedModules($oRep->primodule,$oRep);
  38. if(!empty($sec_mod)){
  39. foreach($sec_mod as $module){
  40. if(!in_array($module,$rel_modules))
  41. $restricted_modules[] = $module;
  42. else
  43. $sec_module[$module] = 1;
  44. }
  45. }
  46. }
  47. if(vtlib_isModuleActive($oRep->primodule)==false){
  48. echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
  49. echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 80%; position: relative; z-index: 10000000;'>
  50. <table border='0' cellpadding='5' cellspacing='0' width='98%'>
  51. <tbody><tr>
  52. <td rowspan='2' width='11%'><img src='". vtiger_imageurl('denied.gif', $theme) ."' ></td>
  53. <td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'><span class='genHeaderSmall'>".$mod_strings['LBL_NO_ACCESS']." : ".$oRep->primodule." </span></td>
  54. </tr>
  55. <tr>
  56. <td class='small' align='right' nowrap='nowrap'>
  57. <a href='javascript:window.close();'>$app_strings[LBL_CLOSE]</a><br> </td>
  58. </tr>
  59. </tbody></table>
  60. </div>";
  61. echo "</td></tr></table>";die;
  62. }
  63. $list_report_form->assign("RELATEDMODULES",getReportRelatedModules($oRep->primodule,$oRep));
  64. $list_report_form->assign("RECORDID",$recordid);
  65. $list_report_form->assign("REPORTNAME",$oRep->reportname);
  66. $list_report_form->assign("REPORTDESC",$oRep->reportdescription);
  67. $list_report_form->assign("REP_MODULE",$oRep->primodule);
  68. if(!isset($_REQUEST['secondarymodule'])){
  69. $list_report_form->assign("SEC_MODULE",$sec_module);
  70. }
  71. if(!empty($restricted_modules)){
  72. $restrictedmod = implode(",",$restricted_modules);
  73. } else {
  74. $restrictedmod = '';
  75. }
  76. $list_report_form->assign("RESTRICTEDMODULES",$restrictedmod);
  77. $list_report_form->assign("BACK",'false');
  78. }
  79. if($_REQUEST['reportmodule'] != '')
  80. {
  81. if(vtlib_isModuleActive($_REQUEST['reportmodule'])==false || isPermitted($_REQUEST['reportmodule'],'index')!= "yes"){
  82. echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
  83. echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 80%; position: relative; z-index: 10000000;'>
  84. <table border='0' cellpadding='5' cellspacing='0' width='98%'>
  85. <tbody><tr>
  86. <td rowspan='2' width='11%'><img src='". vtiger_imageurl('denied.gif', $theme) ."' ></td>
  87. <td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'><span class='genHeaderSmall'>".$mod_strings['LBL_NO_ACCESS']." : ".getTranslatedString($_REQUEST['reportmodule'],$_REQUEST['reportmodule'])." </span></td>
  88. </tr>
  89. <tr>
  90. <td class='small' align='right' nowrap='nowrap'>
  91. <a href='javascript:window.close();'>$app_strings[LBL_CLOSE]</a><br> </td>
  92. </tr>
  93. </tbody></table>
  94. </div>";
  95. echo "</td></tr></table>";die;
  96. }
  97. $list_report_form->assign("RELATEDMODULES",getReportRelatedModules($_REQUEST['reportmodule'],$repObj));
  98. $list_report_form->assign("REP_MODULE",vtlib_purify($_REQUEST['reportmodule']));
  99. }
  100. if($_REQUEST['reportName'] !='')
  101. {
  102. $list_report_form->assign("RELATEDMODULES",getReportRelatedModules($_REQUEST['primarymodule'],$repObj));
  103. $list_report_form->assign("REPORTNAME",vtlib_purify($_REQUEST['reportName']));
  104. $list_report_form->assign("REPORTDESC",vtlib_purify($_REQUEST['reportDesc']));
  105. $list_report_form->assign("REP_MODULE",vtlib_purify($_REQUEST['primarymodule']));
  106. $sec_mod = split(":",vtlib_purify($_REQUEST['secondarymodule']));
  107. $sec_module = array();
  108. foreach($sec_mod as $module){
  109. $sec_module[$module] = 1;
  110. }
  111. $list_report_form->assign("SEC_MODULE",$sec_module);
  112. $list_report_form->assign("BACK_WALK",'true');
  113. }
  114. $list_report_form->assign("FOLDERID",vtlib_purify($_REQUEST['folder']));
  115. $list_report_form->assign("REP_FOLDERS",$repObj->sgetRptFldr());
  116. $list_report_form->assign("IMAGE_PATH", $image_path);
  117. $list_report_form->assign("THEME_PATH", $theme_path);
  118. $list_report_form->assign("ERROR_MSG", $mod_strings['LBL_NO_PERMISSION']);
  119. $list_report_form->display("ReportsStep0.tpl");
  120. ?>