]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Administration/SupportPortal.php
Release 6.4.0
[Github/sugarcrm.git] / modules / Administration / SupportPortal.php
1 <?php
2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4  * SugarCRM Community Edition is a customer relationship management program developed by
5  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
6  * 
7  * This program is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU Affero General Public License version 3 as published by the
9  * Free Software Foundation with the addition of the following permission added
10  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13  * 
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
17  * details.
18  * 
19  * You should have received a copy of the GNU Affero General Public License along with
20  * this program; if not, see http://www.gnu.org/licenses or write to the Free
21  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22  * 02110-1301 USA.
23  * 
24  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26  * 
27  * The interactive user interfaces in modified source and object code versions
28  * of this program must display Appropriate Legal Notices, as required under
29  * Section 5 of the GNU Affero General Public License version 3.
30  * 
31  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32  * these Appropriate Legal Notices must retain the display of the "Powered by
33  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34  * technical reasons, the Appropriate Legal Notices must display the words
35  * "Powered by SugarCRM".
36  ********************************************************************************/
37
38
39
40
41
42
43
44 global $mod_strings;
45 global $app_list_strings;
46 global $app_strings;
47 global $theme;
48 global $current_user;
49 global $currentModule;
50
51 switch ($_REQUEST['view']) {
52         case "support_portal":
53                 if (!is_admin($current_user)) sugar_die("Unauthorized access to administration.");
54                 $GLOBALS['log']->info("Administration SupportPortal");
55
56                 $iframe_url = add_http("www.sugarcrm.com/network/redirect.php?tmpl=network");
57         
58         echo getClassicModuleTitle(
59             "Administration", 
60             array(
61                 "<a href='index.php?module=Administration&action=index'>".translate('LBL_MODULE_NAME','Administration')."</a>",
62                $mod_strings['LBL_SUPPORT_TITLE'],
63                ), 
64             false
65             );
66         
67         $sugar_smarty = new Sugar_Smarty();
68         $sugar_smarty->assign('iframeURL', $iframe_url);
69         $sugar_smarty->assign('langHeader', get_language_header());
70         echo $sugar_smarty->fetch('modules/Administration/SupportPortal.tpl');
71
72                 break;
73         default:
74
75                 $send_version = isset($_REQUEST['version']) ? $_REQUEST['version'] : "";
76                 $send_edition = isset($_REQUEST['edition']) ? $_REQUEST['edition'] : "";
77                 $send_lang = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : "";
78                 $send_module = isset($_REQUEST['help_module']) ? $_REQUEST['help_module'] : "";
79                 $send_action = isset($_REQUEST['help_action']) ? $_REQUEST['help_action'] : "";
80                 $send_key = isset($_REQUEST['key']) ? $_REQUEST['key'] : "";
81                 $send_anchor = '';
82                 // awu: Fixes the ProjectTasks pluralization issue -- must fix in later versions.
83                 if ($send_module == 'ProjectTasks')
84                         $send_module = 'ProjectTask';
85         if ($send_module == 'ProductCatalog')
86                 $send_module = 'ProductTemplates';
87         if ($send_module == 'TargetLists')
88                 $send_module = 'ProspectLists';
89         if ($send_module == 'Targets')
90                 $send_module = 'Prospects';                            
91                 // FG - Bug 39819 - Check for custom help files
92                 $helpPath = 'modules/'.$send_module.'/language/'.$send_lang.'.help.'.$send_action.'.html';
93                 if (sugar_is_file("custom/" . $helpPath)) {
94                     $helpPath = 'custom/' . $helpPath;
95                 }
96                 $sugar_smarty = new Sugar_Smarty();
97
98                 //go to the support portal if the file is not found.
99                 // FG - Bug 39820 - Devs can write help files also in english, so skip check for language not equals "en_us" !
100                 if (file_exists($helpPath))
101                 {
102                         $sugar_smarty->assign('helpFileExists', TRUE);
103                         $sugar_smarty->assign('MOD', $mod_strings);
104                         $sugar_smarty->assign('modulename', $send_module);
105                         $sugar_smarty->assign('helpPath', $helpPath);
106                         $sugar_smarty->assign('currentURL', getCurrentURL());
107                         $sugar_smarty->assign('title', $mod_strings['LBL_SUGARCRM_HELP'] . " - " . $send_module);
108                         $sugar_smarty->assign('styleSheet', SugarThemeRegistry::current()->getCSS());
109                         $sugar_smarty->assign('table', "<table class='tabForm'><tr><td>");
110                         $sugar_smarty->assign('endtable', "</td></tr></table>");
111                         $sugar_smarty->assign('charset', $app_strings['LBL_CHARSET']);
112             $sugar_smarty->assign('langHeader', get_language_header());
113                         echo $sugar_smarty->fetch('modules/Administration/SupportPortal.tpl');                  
114                         
115                 } else {
116                         if(empty($send_module)){
117                                 $send_module = 'toc';
118                         }
119                         
120                         $dev_status = 'GA';
121                         //If there is an alphabetic portion between the decimal prefix and integer suffix, then use the
122                         //value there as the dev_status value
123                         $dev_status = getVersionStatus($GLOBALS['sugar_version']);
124                         $send_version = getMajorMinorVersion($GLOBALS['sugar_version']);
125                         $editionMap = array('ENT' => 'Enterprise', 'PRO' => 'Professional', 'CE' => 'Community_Edition');
126                         if(!empty($editionMap[$send_edition])){
127                                 $send_edition = $editionMap[$send_edition];
128                         }
129                         
130                         //map certain modules
131                         $sendModuleMap = array(
132                                                                 'administration' => array(
133                                                                                                         array('name' => 'Administration', 'action' => 'supportportal', 'anchor' => '1910574'),
134                                                                                                         array('name' => 'Administration', 'action' => 'updater', 'anchor' => '1910574'),
135                                                                                                         array('name' => 'Administration', 'action' => 'licensesettings', 'anchor' => '1910574'),
136                                                                                                         array('name' => 'Administration', 'action' => 'diagnostic', 'anchor' => '1111949'),
137                                                                                                         array('name' => 'Administration', 'action' => 'listviewofflineclient', 'anchor' => '1111949'),
138                                                                                                         array('name' => 'Administration', 'action' => 'enablewirelessmodules', 'anchor' => '1111949'),
139                                                                                                         array('name' => 'Administration', 'action' => 'backups', 'anchor' => '1111949'),
140                                                                                                         array('name' => 'Administration', 'action' => 'upgrade', 'anchor' => '1111949'),
141                                                                                                         array('name' => 'Administration', 'action' => 'locale', 'anchor' => '1111949'),
142                                                                                                         array('name' => 'Administration', 'action' => 'themesettings', 'anchor' => '1111949'),
143                                                                                                         array('name' => 'Administration', 'action' => 'passwordmanager', 'anchor' => '1446494'),
144                                                                                                         array('name' => 'Administration', 'action' => 'upgradewizard', 'anchor' => '1168410'),
145                                                                                                         array('name' => 'Administration', 'action' => 'configuretabs', 'anchor' => '1168410'),
146                                                                                                         array('name' => 'Administration', 'action' => 'configuresubpanels', 'anchor' => '1168410'),
147                                                                                                         array('name' => 'Administration', 'action' => 'wizard', 'anchor' => '1168410'),
148                                                                                                 ),
149                                                                 'calls' => array(array('name' => 'Activities')), 
150                                                                 'tasks' => array(array('name' => 'Activities')), 
151                                                                 'meetings' => array(array('name' => 'Activities')), 
152                                                                 'notes' => array(array('name' => 'Activities')),
153                                                                 'calendar' => array(array('name' => 'Activities')),
154                                                                 'configurator' => array(array('name' => 'Administration', 'anchor' => '1878359')),
155                                                                 'upgradewizard' => array(array('name' => 'Administration', 'anchor' => '1878359')),
156                                                                 'schedulers' => array(array('name' => 'Administration', 'anchor' => '1878359')),
157                                                                 'sugarfeed' => array(array('name' => 'Administration', 'anchor' => '1878359')),
158                                                                 'connectors' => array(array('name' => 'Administration', 'anchor' => '1878359')),
159                                                                 'trackers' => array(array('name' => 'Administration', 'anchor' => '1878359')),
160                                                                 'currencies' => array(array('name' => 'Administration', 'anchor' => '1878359')),
161                                                                 'aclroles' => array(array('name' => 'Administration', 'anchor' => '1916499')),
162                                                                 'roles' => array(array('name' => 'Administration', 'anchor' => '1916499')),
163                                                                 'teams' => array(array('name' => 'Administration', 'anchor' => '1916499')),
164                                                                 'users' => array(array('name' => 'Administration', 'anchor' => '1916499'), array('name' => 'Administration', 'action' => 'detailview', 'anchor' => '1916518')),
165                                                                 'modulebuilder' => array(array('name' => 'Administration', 'anchor' => '1168410')),
166                                                                 'studio' => array(array('name' => 'Administration', 'anchor' => '1168410')),
167                                                                 'workflow' => array(array('name' => 'Administration', 'anchor' => '1168410')),
168                                                                 'producttemplates' => array(array('name' => 'Administration', 'anchor' => '1957376')),
169                                                                 'productcategories' => array(array('name' => 'Administration', 'anchor' => '1957376')),
170                                                                 'producttypes' => array(array('name' => 'Administration', 'anchor' => '1957376')),
171                                                                 'manufacturers' => array(array('name' => 'Administration', 'anchor' => '1957376')),
172                                                                 'shippers' => array(array('name' => 'Administration', 'anchor' => '1957376')),
173                                                                 'taxrates' => array(array('name' => 'Administration', 'anchor' => '1957376')),
174                                                                 'releases' => array(array('name' => 'Administration', 'anchor' => '1868932')),
175                                                                 'timeperiods' => array(array('name' => 'Administration', 'anchor' => '1957639')),
176                                                                 'contracttypes' => array(array('name' => 'Administration', 'anchor' => '1957677')),
177                                                                 'contracttype' => array(array('name' => 'Administration', 'anchor' => '1957677')),
178                                                                 'emailman' => array(array('name' => 'Administration', 'anchor' => '1445484')),
179                                                                 'inboundemail' => array(array('name' => 'Administration', 'anchor' => '1445484')),
180                                                                 'emailtemplates' => array(array('name' => 'Emails')),
181                                                                 'prospects' => array(array('name' => 'Campaigns')),
182                                                                 'prospectlists' => array(array('name' => 'Campaigns')),
183                                                                 'reportmaker' => array(array('name' => 'Reports')),
184                                                                 'customqueries' => array(array('name' => 'Reports')),
185                                                                 'quotas' => array(array('name' => 'Forecasts')),
186                                                                 'projecttask' => array(array('name' => 'Projects')),
187                                                                 'project' => array(array('name' => 'Projects'), array('name' => 'Dashboard', 'action' => 'dashboard'), ),
188                                                                 'projecttemplate' => array(array('name' => 'Projects')),
189                                                                 'datasets' => array(array('name' => 'Reports')),
190                                                                 'dataformat' => array(array('name' => 'Reports')),
191                                                                 'employees' => array(array('name' => 'Administration', 'anchor' => '1957677')),
192                                                                 'kbdocuments' => array(array('name' => 'Administration', 'action' => 'kbadminview', 'anchor' => '1957677')),
193                                                          );
194                                                          
195                         if(!empty($sendModuleMap[strtolower($send_module)])){
196                                 $mappings = $sendModuleMap[strtolower($send_module)];
197                                 
198                                 foreach($mappings as $map){
199                                         if(!empty($map['action'])){
200                                                 if($map['action'] == strtolower($send_action)){
201                                                         $send_module = $map['name'];
202                                                         if(!empty($map['anchor'])){
203                                                                 $send_anchor = $map['anchor'];
204                                                         }
205                                                 }
206                                         }else{
207                                                 $send_module = $map['name'];
208                                                 if(!empty($map['anchor'])){
209                                                                 $send_anchor = $map['anchor'];
210                                                 }
211                                         }
212                                 }
213                                 //$send_module = $sendModuleMap[strtolower($send_module)];
214                         }
215                         $sendUrl = "http://www.sugarcrm.com/crm/product_doc.php?edition={$send_edition}&version={$send_version}&lang={$send_lang}&module={$send_module}&help_action={$send_action}&status={$dev_status}&key={$send_key}&anchor={$send_anchor}";
216                         if(!empty($send_anchor)){
217                                 $sendUrl .= "&anchor=".$send_anchor;
218                         }
219                         $iframe_url = $sendUrl;
220                         
221                         header("Location: {$iframe_url}");
222                         
223                         //$sugar_smarty->assign('helpFileExists', FALSE);
224                         //$sugar_smarty->assign('iframeURL', $iframe_url);
225                 }
226                 break;
227
228 }