]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Administration/templates/Languages.tpl
Release 6.4.0
[Github/sugarcrm.git] / modules / Administration / templates / Languages.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 {sugar_getscript file="cache/include/javascript/sugar_grp_yui_widgets.js"}
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_LANGS_DESC}
47 </td></tr><tr><td><br></td></tr><tr><td colspan='100'>
48
49 <form name="ConfigureLangs" method="POST"  method="POST" action="index.php">
50         <input type="hidden" name="module" value="Administration">
51         <input type="hidden" name="action" value="SaveLanguages">
52         <input type="hidden" id="enabled_langs" name="enabled_langs" value="">
53         <input type="hidden" id="disabled_langs" name="disabled_langs" 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.saveConfigureLangs();this.form.action.value='SaveLanguages'; " 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="ConfigureLangs" class="themeSettings edit view" style='margin-bottom:0px;' border="0" cellspacing="0" cellpadding="0">
68                         <tr>
69                                 <td width='1%'>
70                                         <div id="enabled_div" class="enabled_tab_workarea">
71                                         </div>
72                                 </td>
73                                 <td>
74                                         <div id="disabled_div" class="disabled_tab_workarea">
75                                         </div>
76                                 </td>
77                         </tr>
78                 </table>
79         </div>
80
81         <table border="0" cellspacing="1" cellpadding="1" class="actionsContainer">
82                 <tr>
83                         <td>
84                                 <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button primary" onclick="SUGAR.saveConfigureLangs();this.form.action.value='SaveLanguages'; " type="submit" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}" >
85                                 <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}">
86                         </td>
87                 </tr>
88         </table>
89 </form>
90
91
92 <script type="text/javascript">
93 (function(){ldelim}
94         var enabled_modules = {$enabled_langs};
95         var disabled_modules = {$disabled_langs};
96         var lblEnabled = '{sugar_translate label="LBL_ENABLED_LANGS"}';
97         var lblDisabled = '{sugar_translate label="LBL_DISABLED_LANGS"}';
98         {literal}
99         SUGAR.enabledLangsTable = new YAHOO.SUGAR.DragDropTable(
100                 "enabled_div",
101                 [{key:"label",  label: lblEnabled, width: 200, sortable: false},
102                  {key:"module", label: lblEnabled, hidden:true}],
103                 new YAHOO.util.LocalDataSource(enabled_modules, {
104                         responseSchema: {
105                            resultsList : "modules",
106                            fields : [{key : "module"}, {key : "label"}]
107                         }
108                 }),
109                 {height: "300px"}
110         );
111         SUGAR.disabledLangsTable = new YAHOO.SUGAR.DragDropTable(
112                 "disabled_div",
113                 [{key:"label",  label: lblDisabled, width: 200, sortable: false},
114                  {key:"module", label: lblDisabled, hidden:true}],
115                 new YAHOO.util.LocalDataSource(disabled_modules, {
116                         responseSchema: {
117                            resultsList : "modules",
118                            fields : [{key : "module"}, {key : "label"}]
119                         }
120                 }),
121                 {height: "300px"}
122         );
123         SUGAR.enabledLangsTable.disableEmptyRows = true;
124     SUGAR.disabledLangsTable.disableEmptyRows = true;
125     SUGAR.enabledLangsTable.addRow({module: "", label: ""});
126     SUGAR.disabledLangsTable.addRow({module: "", label: ""});
127         SUGAR.enabledLangsTable.render();
128         SUGAR.disabledLangsTable.render();
129
130         SUGAR.saveConfigureLangs = function()
131         {
132                 var enabledTable = SUGAR.enabledLangsTable;
133                 var modules = [];
134                 for(var i=0; i < enabledTable.getRecordSet().getLength(); i++){
135                         var data = enabledTable.getRecord(i).getData();
136                         if (data.module && data.module != '')
137                             modules[i] = data.module;
138                 }
139                 YAHOO.util.Dom.get('enabled_langs').value = YAHOO.lang.JSON.stringify(modules);
140
141                 var disabledTable = SUGAR.disabledLangsTable;
142                 var modules = [];
143                 for(var i=0; i < disabledTable.getRecordSet().getLength(); i++){
144                         var data = disabledTable.getRecord(i).getData();
145                         if (data.module && data.module != '')
146                             modules[i] = data.module;
147                 }
148                 YAHOO.util.Dom.get('disabled_langs').value = YAHOO.lang.JSON.stringify(modules);
149         }
150 })();
151 {/literal}
152 </script>