PageRenderTime 47ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/modules/Campaigns/DetailView.php

https://bitbucket.org/jhunsinfotech/blue-blues
PHP | 122 lines | 84 code | 24 blank | 14 comment | 20 complexity | bb9e370cfc4bda4c4d7a92b9b97117b3 MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0, LGPL-3.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('include/utils/utils.php');
  12. require_once('user_privileges/default_module_view.php');
  13. $focus = CRMEntity::getInstance($currentModule);
  14. if(isset($_REQUEST['record']) && $_REQUEST['record']!= null )
  15. {
  16. $focus->retrieve_entity_info($_REQUEST['record'],"Campaigns");
  17. $focus->name=$focus->column_fields['campaignname'];
  18. $focus->id = $_REQUEST['record'];
  19. }
  20. if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true')
  21. {
  22. $focus->id = "";
  23. }
  24. global $app_strings,$mod_strings,$theme,$currentModule,$default_module_view,$adb,$list_max_entries_per_page;
  25. $theme_path="themes/".$theme."/";
  26. $image_path=$theme_path."images/";
  27. $smarty = new vtigerCRM_Smarty;
  28. $smarty->assign("MOD", $mod_strings);
  29. $smarty->assign("APP", $app_strings);
  30. $smarty->assign("THEME", $theme);
  31. if (isset($focus->name)) $smarty->assign("NAME", $focus->name);
  32. else $smarty->assign("NAME", "");
  33. $smarty->assign("BLOCKS", getBlocks($currentModule,"detail_view",'',$focus->column_fields));
  34. $smarty->assign("CUSTOMFIELD", $cust_fld);
  35. $smarty->assign("SINGLE_MOD",'Campaign');
  36. $category = getParentTab();
  37. $smarty->assign("CATEGORY",$category);
  38. if(isPermitted("Campaigns","EditView",$_REQUEST['record']) == 'yes')
  39. $smarty->assign("EDIT_DUPLICATE","permitted");
  40. if(isPermitted("Campaigns","Delete",$_REQUEST['record']) == 'yes')
  41. $smarty->assign("DELETE","permitted");
  42. $smarty->assign("IMAGE_PATH", $image_path);
  43. $smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
  44. $smarty->assign("UPDATEINFO",updateInfo($focus->id));
  45. $smarty->assign("ID", vtlib_purify($_REQUEST['record']));
  46. // Module Sequence Numbering
  47. $mod_seq_field = getModuleSequenceField($currentModule);
  48. if ($mod_seq_field != null) {
  49. $mod_seq_id = $focus->column_fields[$mod_seq_field['name']];
  50. } else {
  51. $mod_seq_id = $focus->id;
  52. }
  53. $smarty->assign('MOD_SEQ_ID', $mod_seq_id);
  54. // END
  55. $tabid = getTabid("Campaigns");
  56. $validationData = getDBValidationData($focus->tab_name,$tabid);
  57. $data = split_validationdataArray($validationData);
  58. $smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']);
  59. $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']);
  60. $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']);
  61. $check_button = Button_Check($module);
  62. $smarty->assign("CHECK", $check_button);
  63. $smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule));
  64. if($singlepane_view == 'true')
  65. {
  66. $related_array = getRelatedLists($currentModule,$focus);
  67. $smarty->assign("RELATEDLISTS", $related_array);
  68. require_once('include/ListView/RelatedListViewSession.php');
  69. if(!empty($_REQUEST['selected_header']) && !empty($_REQUEST['relation_id'])) {
  70. RelatedListViewSession::addRelatedModuleToSession(vtlib_purify($_REQUEST['relation_id']),
  71. vtlib_purify($_REQUEST['selected_header']));
  72. }
  73. $open_related_modules = RelatedListViewSession::getRelatedModulesFromSession();
  74. $smarty->assign("SELECTEDHEADERS", $open_related_modules);
  75. }
  76. $smarty->assign("SinglePane_View", $singlepane_view);
  77. $smarty->assign("TODO_PERMISSION",CheckFieldPermission('parent_id','Calendar'));
  78. $smarty->assign("EVENT_PERMISSION",CheckFieldPermission('parent_id','Events'));
  79. $smarty->assign("MODULE",$currentModule);
  80. $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST['record']));
  81. $smarty->assign("RECORDID", $_REQUEST['record']);
  82. $smarty->assign('MAX_RECORDS', $list_max_entries_per_page);
  83. if(PerformancePrefs::getBoolean('DETAILVIEW_RECORD_NAVIGATION', true) && isset($_SESSION[$currentModule.'_listquery'])){
  84. $recordNavigationInfo = ListViewSession::getListViewNavigation($focus->id);
  85. VT_detailViewNavigation($smarty,$recordNavigationInfo,$focus->id);
  86. }
  87. // Record Change Notification
  88. $focus->markAsViewed($current_user->id);
  89. // END
  90. // Gather the custom link information to display
  91. include_once('vtlib/Vtiger/Link.php');
  92. $customlink_params = Array('MODULE'=>$currentModule, 'RECORD'=>$focus->id, 'ACTION'=>vtlib_purify($_REQUEST['action']));
  93. $smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType(getTabid($currentModule), Array('DETAILVIEWBASIC','DETAILVIEW','DETAILVIEWWIDGET'), $customlink_params));
  94. // END
  95. $smarty->assign('DETAILVIEW_AJAX_EDIT', PerformancePrefs::getBoolean('DETAILVIEW_AJAX_EDIT', true));
  96. $smarty->display("DetailView.tpl");
  97. $focus->id = $_REQUEST['record'];
  98. ?>