]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Administration/templates/ConfigureTabs.tpl
Release 6.1.4
[Github/sugarcrm.git] / modules / Administration / templates / ConfigureTabs.tpl
1 {*
2 /*********************************************************************************
3  * SugarCRM is a customer relationship management program developed by
4  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
5  * 
6  * This program is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License version 3 as published by the
8  * Free Software Foundation with the addition of the following permission added
9  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
11  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
12  * 
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
16  * details.
17  * 
18  * You should have received a copy of the GNU Affero General Public License along with
19  * this program; if not, see http://www.gnu.org/licenses or write to the Free
20  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301 USA.
22  * 
23  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
24  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
25  * 
26  * The interactive user interfaces in modified source and object code versions
27  * of this program must display Appropriate Legal Notices, as required under
28  * Section 5 of the GNU Affero General Public License version 3.
29  * 
30  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31  * these Appropriate Legal Notices must retain the display of the "Powered by
32  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
33  * technical reasons, the Appropriate Legal Notices must display the words
34  * "Powered by SugarCRM".
35  ********************************************************************************/
36
37 *}
38 <link rel="stylesheet" type="text/css" href="{sugar_getjspath file='modules/Connectors/tpls/tabs.css'}"/>
39 <script type="text/javascript" src="include/javascript/sugar_grp_yui_widgets.js"></script>
40 {overlib_includes}
41 <style>.yui-dt-scrollable .yui-dt-bd {ldelim}overflow-x: hidden;{rdelim}</style>
42
43 <table width="100%" border="0" cellspacing="0" cellpadding="0">
44 <tr><td colspan='100'><h2>{$title}</h2></td></tr>
45 <tr><td colspan='100'>
46 {$MOD.LBL_CONFIG_TABS_DESC}
47 </td></tr><tr><td><br></td></tr><tr><td colspan='100'>
48
49 <form name="ConfigureTabs" method="POST"  method="POST" action="index.php">
50         <input type="hidden" name="module" value="Administration">
51         <input type="hidden" name="action" value="SaveTabs">
52         <input type="hidden" id="enabled_tabs" name="enabled_tabs" value="">
53         <input type="hidden" id="disabled_tabs" name="disabled_tabs" value="">
54         <input type="hidden" name="return_module" value="{$RETURN_MODULE}">
55         <input type="hidden" name="return_action" value="{$RETURN_ACTION}">
56
57         <table border="0" cellspacing="1" cellpadding="1" class="actionsContainer">
58                 <tr>
59                         <td>
60                                 <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button primary" onclick="SUGAR.saveConfigureTabs();this.form.action.value='SaveTabs'; " type="submit" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}" > 
61                                 <input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="this.form.action.value='index'; this.form.module.value='Administration';" type="submit" name="button" value="{$APP.LBL_CANCEL_BUTTON_LABEL}">
62                         </td>
63                 </tr>
64         </table>
65         
66         <div class='add_table' style='margin-bottom:5px'>
67                 <table id="ConfigureTabs" class="themeSettings edit view" style='margin-bottom:0px;' border="0" cellspacing="0" cellpadding="0">
68                         <tr>
69                                 <td>
70                                     <input type='checkbox' name='user_edit_tabs' value=1 class='checkbox' {if !empty($user_can_edit)}CHECKED{/if}>&nbsp;
71                                     <b onclick='document.EditView.user_edit_tabs.checked= !document.EditView.user_edit_tabs.checked' style='cursor:default'>{$MOD.LBL_ALLOW_USER_TABS}</b>
72                                     &nbsp;{sugar_help text=$MOD.LBL_CONFIG_TABS_ALLOW_USERS_HIDE_TABS_HELP}
73                                 </td>
74                         </tr>
75                         <tr>
76                                 <td width='1%'>
77                                         <div id="enabled_div" class="enabled_tab_workarea">
78                                         </div>
79                                 </td>
80                                 <td>
81                                         <div id="disabled_div" class="disabled_tab_workarea">
82                                         </div>
83                                 </td>
84                         </tr>
85                 </table>
86         </div>
87         
88         <div class='add_subpanels' style='margin-bottom:5px'>
89                 <table id="ConfigureSubPanels" class="themeSettings edit view" style='margin-bottom:0px;' border="0" cellspacing="0" cellpadding="0">
90                         <tr>
91                                 <td width='1%'>
92                                         <div id="enabled_subpanels_div"></div>  
93                                 </td>
94                                 <td>
95                                         <div id="disabled_subpanels_div"></div>
96                                 </td>
97                         </tr>
98                 </table>
99         </div>
100         
101         <table border="0" cellspacing="1" cellpadding="1" class="actionsContainer">
102                 <tr>
103                         <td>
104                                 <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button primary" onclick="SUGAR.saveConfigureTabs();this.form.action.value='SaveTabs'; " type="submit" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}" > 
105                                 <input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="this.form.action.value='index'; this.form.module.value='Administration';" type="submit" name="button" value="{$APP.LBL_CANCEL_BUTTON_LABEL}">
106                         </td>
107                 </tr>
108         </table>
109 </form>
110
111
112 <script type="text/javascript">
113 (function(){ldelim}
114         var enabled_modules = {$enabled_tabs};
115         var disabled_modules = {$disabled_tabs};
116         var lblEnabled = '{sugar_translate label="LBL_VISIBLE_TABS"}';
117         var lblDisabled = '{sugar_translate label="LBL_HIDDEN_TABS"}';
118         {literal}
119         SUGAR.enabledTabsTable = new YAHOO.SUGAR.DragDropTable(
120                 "enabled_div",
121                 [{key:"label",  label: lblEnabled, width: 200, sortable: false},
122                  {key:"module", label: lblEnabled, hidden:true}],
123                 new YAHOO.util.LocalDataSource(enabled_modules, {
124                         responseSchema: {
125                            resultsList : "modules",
126                            fields : [{key : "module"}, {key : "label"}]
127                         }
128                 }), 
129                 {height: "300px"}
130         );
131         SUGAR.disabledTabsTable = new YAHOO.SUGAR.DragDropTable(
132                 "disabled_div",
133                 [{key:"label",  label: lblDisabled, width: 200, sortable: false},
134                  {key:"module", label: lblDisabled, hidden:true}],
135                 new YAHOO.util.LocalDataSource(disabled_modules, {
136                         responseSchema: {
137                            resultsList : "modules",
138                            fields : [{key : "module"}, {key : "label"}]
139                         }
140                 }),
141                 {height: "300px"}
142         );
143         SUGAR.enabledTabsTable.disableEmptyRows = true;
144     SUGAR.disabledTabsTable.disableEmptyRows = true;
145     SUGAR.enabledTabsTable.addRow({module: "", label: ""});
146     SUGAR.disabledTabsTable.addRow({module: "", label: ""});
147         SUGAR.enabledTabsTable.render();
148         SUGAR.disabledTabsTable.render();
149         {/literal}
150         var sub_enabled_modules = {$enabled_panels};
151         var sub_disabled_modules = {$disabled_panels};
152         var lblSubEnabled = '{sugar_translate label="LBL_VISIBLE_PANELS"}';
153         var lblSubDisabled = '{sugar_translate label="LBL_HIDDEN_PANELS"}';
154         {literal}
155         SUGAR.subEnabledTable = new YAHOO.SUGAR.DragDropTable(
156                 "enabled_subpanels_div",
157                 [{key:"label",  label: lblSubEnabled, width: 200, sortable: false},
158                  {key:"module", label: lblSubEnabled, hidden:true}],
159                 new YAHOO.util.LocalDataSource(sub_enabled_modules, {
160                         responseSchema: {
161                            fields : [{key : "module"}, {key : "label"}]
162                         }
163                 }),  
164                 {height: "300px"}
165         );
166         SUGAR.subDisabledTable = new YAHOO.SUGAR.DragDropTable(
167                 "disabled_subpanels_div",
168                 [{key:"label",  label: lblSubDisabled, width: 200, sortable: false},
169                  {key:"module", label: lblSubDisabled, hidden:true}],
170                 new YAHOO.util.LocalDataSource(sub_disabled_modules, {
171                         responseSchema: {
172                            fields : [{key : "module"}, {key : "label"}]
173                         }
174                 }),
175                 {height: "300px"}
176         );
177         SUGAR.subEnabledTable.disableEmptyRows = true;
178         SUGAR.subDisabledTable.disableEmptyRows = true;
179         SUGAR.subEnabledTable.addRow({module: "", label: ""});
180         SUGAR.subDisabledTable.addRow({module: "", label: ""});
181         SUGAR.subEnabledTable.render();
182         SUGAR.subDisabledTable.render();
183         
184         SUGAR.saveConfigureTabs = function()
185         {
186                 var enabledTable = SUGAR.enabledTabsTable;
187                 var modules = [];
188                 for(var i=0; i < enabledTable.getRecordSet().getLength(); i++){
189                         var data = enabledTable.getRecord(i).getData();
190                         if (data.module && data.module != '')
191                             modules[i] = data.module;
192                 }
193                 YAHOO.util.Dom.get('enabled_tabs').value = YAHOO.lang.JSON.stringify(modules);
194                 
195                 var disabledTable = SUGAR.subDisabledTable;
196                 var modules = [];
197                 for(var i=0; i < disabledTable.getRecordSet().getLength(); i++){
198                         var data = disabledTable.getRecord(i).getData();
199                         if (data.module && data.module != '')
200                             modules[i] = data.module;
201                 }
202                 YAHOO.util.Dom.get('disabled_tabs').value = YAHOO.lang.JSON.stringify(modules);
203         }
204 })();
205 {/literal}
206 </script>