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-2012 SugarCRM Inc.
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.
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
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
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.
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.
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 ********************************************************************************/
38 $_REQUEST['edit']='true';
40 require_once('include/SugarFolders/SugarFolders.php');
45 global $app_list_strings;
49 $ie = new InboundEmail();
50 $focus = new SugarFolder();
51 $javascript = new Javascript();
52 /* Start standard EditView setup logic */
54 if(isset($_REQUEST['record'])) {
55 $GLOBALS['log']->debug("In EditGroupFolder view, about to retrieve record: ".$_REQUEST['record']);
56 $result = $focus->retrieve($_REQUEST['record']);
59 sugar_die($app_strings['ERROR_NO_RECORD']);
63 $GLOBALS['log']->info("SugarFolder Edit View");
64 /* End standard EditView setup logic */
66 // TEMPLATE ASSIGNMENTS
67 $smarty = new Sugar_Smarty();
69 $smarty->assign('mod_strings', $mod_strings);
70 $smarty->assign('app_strings', $app_strings);
71 $smarty->assign('theme', $theme);
72 $smarty->assign('sugar_version', $sugar_version);
73 $smarty->assign('GRIDLINE', $gridline);
74 $smarty->assign('MODULE', 'InboundEmail');
75 $smarty->assign('RETURN_MODULE', 'InboundEmail');
76 $smarty->assign('RETURN_ID', $focus->id);
77 $smarty->assign('RETURN_ACTION', "");
78 $smarty->assign('ID', $focus->id);
81 $ret = $focus->getFoldersForSettings($current_user);
82 $groupFolders = Array();
83 $groupFoldersOrig = array();
84 foreach($ret['groupFolders'] as $key => $value) {
85 if(!empty($focus->id)) {
86 if ($value['id'] == $focus->id) {
90 $groupFolders[$value['id']] = $value['name'];
91 $groupFoldersOrig[] = $value['origName'];
93 $groupFolderName = "";
94 $addToGroupFolder = "";
95 $createGroupFolderStyle = "display:''";
96 $editGroupFolderStyle = "display:''";
97 if(!empty($focus->id)) {
98 $groupFolderName = $focus->name;
100 if(!empty($focus->id)) {
101 $addToGroupFolder = $focus->parent_folder;
103 if(!empty($focus->id)) {
104 $createGroupFolderStyle = "display:none;";
106 $editGroupFolderStyle = "display:none;";
108 $smarty->assign('createGroupFolderStyle', $createGroupFolderStyle);
109 $smarty->assign('editGroupFolderStyle', $editGroupFolderStyle);
111 $smarty->assign('groupFolderName', $groupFolderName);
112 $json = getJSONobj();
113 $smarty->assign('group_folder_array', $json->encode($groupFoldersOrig));
114 $smarty->assign('group_folder_options', get_select_options_with_id($groupFolders, $addToGroupFolder));
117 $smarty->assign('CSS',SugarThemeRegistry::current()->getCSS());
120 $smarty->assign('languageStrings', getVersionedScript("cache/jsLanguage/{$GLOBALS['current_language']}.js", $GLOBALS['sugar_config']['js_lang_version']));
121 echo $smarty->fetch("modules/Emails/templates/_createGroupFolder.tpl");