2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
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.
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
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
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.
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.
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 ********************************************************************************/
38 <script type="text/javascript" src="{sugar_getjspath file='cache/include/javascript/sugar_grp_yui_widgets.js'}"></script>
39 <form name="ConfigureAjaxUI" method="POST" method="POST" action="index.php">
40 <input type="hidden" name="module" value="Administration">
41 <input type="hidden" name="action" value="UpdateAjaxUI">
42 <input type="hidden" id="enabled_modules" name="enabled_modules" value="">
43 <input type="hidden" id="disabled_modules" name="disabled_modules" value="">
44 <input type="hidden" name="return_module" value="{$RETURN_MODULE}">
45 <input type="hidden" name="return_action" value="{$RETURN_ACTION}">
48 <p>{sugar_translate label="LBL_CONFIG_AJAX_DESC"}</p><br/>
49 <p>{sugar_translate label="LBL_CONFIG_AJAX_HELP"}</p><br/>
50 <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button primary"
51 onclick="SUGAR.saveConfigureTabs();" type="submit" name="saveButton"
52 value="{$APP.LBL_SAVE_BUTTON_LABEL}" />
53 <input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button"
54 onclick="this.form.action.value='index'; this.form.module.value='Administration';" type="submit" name="CancelButton"
55 value="{$APP.LBL_CANCEL_BUTTON_LABEL}"/>
56 <div class='add_table' style='margin-bottom:5px'>
57 <table id="ConfigureTabs" class="themeSettings edit view" style='margin-bottom:0px;' border="0" cellspacing="0" cellpadding="0">
60 <div id="enabled_div" class="enabled_tab_workarea">
64 <div id="disabled_div" class="disabled_tab_workarea">
72 <script type="text/javascript">
73 var enabled_modules = {$enabled_mods};
74 var disabled_modules = {$disabled_mods};
75 var lblEnabled = '{sugar_translate label="LBL_ACTIVE_MODULES"}';
76 var lblDisabled = '{sugar_translate label="LBL_DISABLED_MODULES"}';
79 SUGAR.enabledModsTable = new YAHOO.SUGAR.DragDropTable(
81 [{key:"label", label: lblEnabled, width: 200, sortable: false},
82 {key:"module", label: lblEnabled, hidden:true}],
83 new YAHOO.util.LocalDataSource(enabled_modules, {
85 resultsList : "modules",
86 fields : [{key : "module"}, {key : "label"}]
91 group: ["enabled_div", "disabled_div"]
94 SUGAR.disabledModsTable = new YAHOO.SUGAR.DragDropTable(
96 [{key:"label", label: lblDisabled, width: 200, sortable: false},
97 {key:"module", label: lblDisabled, hidden:true}],
98 new YAHOO.util.LocalDataSource(disabled_modules, {
100 resultsList : "modules",
101 fields : [{key : "module"}, {key : "label"}]
106 group: ["enabled_div", "disabled_div"]
109 SUGAR.enabledModsTable.disableEmptyRows = true;
110 SUGAR.disabledModsTable.disableEmptyRows = true;
111 SUGAR.enabledModsTable.addRow({module: "", label: ""});
112 SUGAR.disabledModsTable.addRow({module: "", label: ""});
113 SUGAR.enabledModsTable.render();
114 SUGAR.disabledModsTable.render();
116 SUGAR.saveConfigureTabs = function()
118 var disabledTable = SUGAR.disabledModsTable;
120 for(var i=0; i < disabledTable.getRecordSet().getLength(); i++){
121 var data = disabledTable.getRecord(i).getData();
122 if (data.module && data.module != '')
123 modules[i] = data.module;
125 YAHOO.util.Dom.get('disabled_modules').value = YAHOO.lang.JSON.stringify(modules);