]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Administration/templates/ConfigureTabs.tpl
Release 6.4.0
[Github/sugarcrm.git] / modules / Administration / templates / ConfigureTabs.tpl
1 {*
2 /*********************************************************************************
3  * SugarCRM Community Edition 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="cache/include/javascript/sugar_grp_yui_widgets.js"></script>
40
41 <form name="ConfigureTabs" method="POST"  method="POST" action="index.php">
42 <input type="hidden" name="module" value="Administration">
43 <input type="hidden" name="action" value="SaveTabs">
44 <input type="hidden" id="enabled_tabs" name="enabled_tabs" value="">
45 <input type="hidden" id="disabled_tabs" name="disabled_tabs" value="">
46 <input type="hidden" name="return_module" value="{$RETURN_MODULE}">
47 <input type="hidden" name="return_action" value="{$RETURN_ACTION}">
48
49 <table width="100%" border="0" cellspacing="0" cellpadding="0">
50 <tr><td colspan='100'><h2>{$title}</h2></td></tr>
51 <tr><td colspan='100'>{$MOD.LBL_CONFIG_TABS_DESC}</td></tr>
52 <tr><td><br></td></tr>
53 <tr><td colspan='100'>
54         <table border="0" cellspacing="1" cellpadding="1" class="actionsContainer">
55                 <tr>
56                         <td>
57                                 <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}" > 
58                                 <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}">
59                         </td>
60                 </tr>
61         </table>
62         
63         <div class='add_table' style='margin-bottom:5px'>
64                 <table id="ConfigureTabs" class="themeSettings edit view" style='margin-bottom:0px;' border="0" cellspacing="0" cellpadding="0">
65                         <tr>
66                                 <td>
67                                     <input type='checkbox' name='user_edit_tabs' value=1 class='checkbox' {if !empty($user_can_edit)}CHECKED{/if}>&nbsp;
68                                     <b onclick='document.EditView.user_edit_tabs.checked= !document.EditView.user_edit_tabs.checked' style='cursor:default'>{$MOD.LBL_ALLOW_USER_TABS}</b>
69                                     &nbsp;{sugar_help text=$MOD.LBL_CONFIG_TABS_ALLOW_USERS_HIDE_TABS_HELP}
70                                 </td>
71                         </tr>
72                         <tr>
73                                 <td width='1%'>
74                                         <div id="enabled_div" class="enabled_tab_workarea">
75                                         </div>
76                                 </td>
77                                 <td>
78                                         <div id="disabled_div" class="disabled_tab_workarea">
79                                         </div>
80                                 </td>
81                         </tr>
82                 </table>
83         </div>
84         
85         <div class='add_subpanels' style='margin-bottom:5px'>
86                 <table id="ConfigureSubPanels" class="themeSettings edit view" style='margin-bottom:0px;' border="0" cellspacing="0" cellpadding="0">
87                         <tr>
88                                 <td width='1%'>
89                                         <div id="enabled_subpanels_div"></div>  
90                                 </td>
91                                 <td>
92                                         <div id="disabled_subpanels_div"></div>
93                                 </td>
94                         </tr>
95                 </table>
96         </div>
97         
98         <table border="0" cellspacing="1" cellpadding="1" class="actionsContainer">
99                 <tr>
100                         <td>
101                                 <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}" > 
102                                 <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}">
103                         </td>
104                 </tr>
105         </table>
106 </td></tr>
107 </table>        
108 </form>
109
110 <script type="text/javascript">
111         var enabled_modules = {$enabled_tabs};
112         var disabled_modules = {$disabled_tabs};
113         var lblEnabled = '{sugar_translate label="LBL_VISIBLE_TABS"}';
114         var lblDisabled = '{sugar_translate label="LBL_HIDDEN_TABS"}';
115         {literal}
116         
117         SUGAR.enabledTabsTable = new YAHOO.SUGAR.DragDropTable(
118                 "enabled_div",
119                 [{key:"label",  label: lblEnabled, width: 200, sortable: false},
120                  {key:"module", label: lblEnabled, hidden:true}],
121                 new YAHOO.util.LocalDataSource(enabled_modules, {
122                         responseSchema: {
123                            resultsList : "modules",
124                            fields : [{key : "module"}, {key : "label"}]
125                         }
126                 }), 
127                 {
128                         height: "300px",
129                         group: ["enabled_div", "disabled_div"]
130                 }
131         );
132         SUGAR.disabledTabsTable = new YAHOO.SUGAR.DragDropTable(
133                 "disabled_div",
134                 [{key:"label",  label: lblDisabled, width: 200, sortable: false},
135                  {key:"module", label: lblDisabled, hidden:true}],
136                 new YAHOO.util.LocalDataSource(disabled_modules, {
137                         responseSchema: {
138                            resultsList : "modules",
139                            fields : [{key : "module"}, {key : "label"}]
140                         }
141                 }),
142                 {
143                         height: "300px",
144                         group: ["enabled_div", "disabled_div"]
145                  }
146         );
147         SUGAR.enabledTabsTable.disableEmptyRows = true;
148     SUGAR.disabledTabsTable.disableEmptyRows = true;
149     SUGAR.enabledTabsTable.addRow({module: "", label: ""});
150     SUGAR.disabledTabsTable.addRow({module: "", label: ""});
151         SUGAR.enabledTabsTable.render();
152         SUGAR.disabledTabsTable.render();
153         {/literal}
154         var sub_enabled_modules = {$enabled_panels};
155         var sub_disabled_modules = {$disabled_panels};
156         var lblSubEnabled = '{sugar_translate label="LBL_VISIBLE_PANELS"}';
157         var lblSubDisabled = '{sugar_translate label="LBL_HIDDEN_PANELS"}';
158         {literal}
159         SUGAR.subEnabledTable = new YAHOO.SUGAR.DragDropTable(
160                 "enabled_subpanels_div",
161                 [{key:"label",  label: lblSubEnabled, width: 200, sortable: false},
162                  {key:"module", label: lblSubEnabled, hidden:true}],
163                 new YAHOO.util.LocalDataSource(sub_enabled_modules, {
164                         responseSchema: {
165                            fields : [{key : "module"}, {key : "label"}]
166                         }
167                 }),  
168                 {
169                         height: "300px",
170                         group: ["enabled_subpanels_div", "disabled_subpanels_div"]
171                 }
172         );
173         SUGAR.subDisabledTable = new YAHOO.SUGAR.DragDropTable(
174                 "disabled_subpanels_div",
175                 [{key:"label",  label: lblSubDisabled, width: 200, sortable: false},
176                  {key:"module", label: lblSubDisabled, hidden:true}],
177                 new YAHOO.util.LocalDataSource(sub_disabled_modules, {
178                         responseSchema: {
179                            fields : [{key : "module"}, {key : "label"}]
180                         }
181                 }),
182                 {
183                         height: "300px",
184                         group: ["enabled_subpanels_div", "disabled_subpanels_div"]
185                 }
186         );
187         SUGAR.subEnabledTable.disableEmptyRows = true;
188         SUGAR.subDisabledTable.disableEmptyRows = true;
189         SUGAR.subEnabledTable.addRow({module: "", label: ""});
190         SUGAR.subDisabledTable.addRow({module: "", label: ""});
191         SUGAR.subEnabledTable.render();
192         SUGAR.subDisabledTable.render();
193         
194         SUGAR.saveConfigureTabs = function()
195         {
196                 var enabledTable = SUGAR.enabledTabsTable;
197                 var modules = [];
198                 for(var i=0; i < enabledTable.getRecordSet().getLength(); i++){
199                         var data = enabledTable.getRecord(i).getData();
200                         if (data.module && data.module != '')
201                             modules[i] = data.module;
202                 }
203                 YAHOO.util.Dom.get('enabled_tabs').value = YAHOO.lang.JSON.stringify(modules);
204                 
205                 var disabledTable = SUGAR.subDisabledTable;
206                 var modules = [];
207                 for(var i=0; i < disabledTable.getRecordSet().getLength(); i++){
208                         var data = disabledTable.getRecord(i).getData();
209                         if (data.module && data.module != '')
210                             modules[i] = data.module;
211                 }
212                 YAHOO.util.Dom.get('disabled_tabs').value = YAHOO.lang.JSON.stringify(modules);
213         }
214 {/literal}
215 </script>