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="cache/include/javascript/sugar_grp_yui_widgets.js"></script>
40 <link rel="stylesheet" type="text/css" href="{sugar_getjspath file='modules/Connectors/tpls/tabs.css'}"/>
41 <style>.yui-dt-scrollable .yui-dt-bd {ldelim}overflow-x: hidden;{rdelim}</style>
43 <table width="100%" border="0" cellspacing="0" cellpadding="0">
44 <tr><td colspan='100'><h2>{$title}</h2></td></tr>
45 <tr><td><i class="info">{$msg}</i></td></tr>
48 <form name="ConfigureShortcutBar" method="POST" method="POST" action="index.php">
49 <input type="hidden" name="module" value="Administration">
50 <input type="hidden" name="action" value="ConfigureShortcutBar">
51 <input type="hidden" id="enabled_modules" name="enabled_modules" value="">
52 <input type="hidden" name="return_module" value="{$RETURN_MODULE}">
53 <input type="hidden" name="return_action" value="{$RETURN_ACTION}">
56 <p>{$MOD.LBL_CONFIGURE_SHORTCUT_BAR_HELP}</p>
58 <table border="0" cellspacing="1" cellpadding="1">
62 <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button primary" onclick="SUGAR.saveShortcutBar();" type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}" >
63 <input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="this.form.action.value='{$RETURN_ACTION}'; this.form.module.value='{$RETURN_MODULE}';" type="submit" name="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} ">
67 <div class='add_table' style='margin-bottom:5px'>
68 <table id="ConfigureTabs" class="themeSettings edit view" style='margin-bottom:0px;' border="0" cellspacing="0" cellpadding="0">
71 <div id="enabled_div"></div>
74 <div id="disabled_div"></div>
80 <table border="0" cellspacing="1" cellpadding="1">
83 <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" class="button primary" onclick="SUGAR.saveShortcutBar();" type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}" >
84 <input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" class="button" onclick="this.form.action.value='{$RETURN_ACTION}'; this.form.module.value='{$RETURN_MODULE}';" type="submit" name="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} ">
90 <script type="text/javascript">
92 var Connect = YAHOO.util.Connect;
93 Connect.url = 'index.php';
94 Connect.method = 'POST';
95 Connect.timeout = 300000;
97 var enabled_modules = {$enabled_modules};
98 var disabled_modules = {$disabled_modules};
99 var lblEnabled = '{sugar_translate label="LBL_ACTIVE_MODULES"}';
100 var lblDisabled = '{sugar_translate label="LBL_DISABLED_MODULES"}';
102 SUGAR.prodEnabledTable = new YAHOO.SUGAR.DragDropTable(
104 [{key:"label", label: lblEnabled, width: 200, sortable: false},
105 {key:"module", label: lblEnabled, hidden:true}],
106 new YAHOO.util.LocalDataSource(enabled_modules, {
108 resultsList : "modules",
109 fields : [{key : "module"}, {key : "label"}]
114 SUGAR.prodDisabledTable = new YAHOO.SUGAR.DragDropTable(
116 [{key:"label", label: lblDisabled, width: 200, sortable: false},
117 {key:"module", label: lblDisabled, hidden:true}],
118 new YAHOO.util.LocalDataSource(disabled_modules, {
120 resultsList : "modules",
121 fields : [{key : "module"}, {key : "label"}]
126 SUGAR.prodEnabledTable.disableEmptyRows = true;
127 SUGAR.prodDisabledTable.disableEmptyRows = true;
128 SUGAR.prodEnabledTable.addRow({module: "", label: ""});
129 SUGAR.prodDisabledTable.addRow({module: "", label: ""});
130 SUGAR.prodEnabledTable.render();
131 SUGAR.prodDisabledTable.render();
133 SUGAR.saveShortcutBar = function()
135 var enabledTable = SUGAR.prodEnabledTable;
137 if ( enabledTable.getRecordSet().getLength() > 11) //Max 10 + empty line
139 alert('{/literal}{sugar_translate label="LBL_ERROR_PROD_BAR_NUM_MODULES"}{literal}');
142 for(var i=0; i < enabledTable.getRecordSet().getLength(); i++){
143 var data = enabledTable.getRecord(i).getData();
144 if (data.module && data.module != '')
145 modules[i] = data.module;
148 ajaxStatus.showStatus(SUGAR.language.get('Administration', 'LBL_SAVING'));
149 //YAHOO.SUGAR.MessageBox.show({title:"saving",msg:"Saving",close:false})
150 Connect.asyncRequest(
153 {success: SUGAR.saveCallBack},
154 'to_pdf=1&module=Administration&action=ConfigureShortcutBar&enabled_modules=' + YAHOO.lang.JSON.stringify(modules)
159 SUGAR.saveCallBack = function(o)
161 ajaxStatus.flashStatus(SUGAR.language.get('app_strings', 'LBL_DONE'));
162 if (o.responseText == "true")
164 window.location.assign('index.php?module=Administration&action=ConfigureShortcutBar');
168 YAHOO.SUGAR.MessageBox.show({msg:o.responseText});