]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Administration/templates/GlobalSearchSettings.tpl
Release 6.4.0
[Github/sugarcrm.git] / modules / Administration / templates / GlobalSearchSettings.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 <script type="text/javascript" src="cache/include/javascript/sugar_grp_yui_widgets.js"></script>
39 <link rel="stylesheet" type="text/css" href="{sugar_getjspath file='modules/Connectors/tpls/tabs.css'}"/>
40 <form name="GlobalSearchSettings" method="POST">
41         <input type="hidden" name="module" value="Administration">
42         <input type="hidden" name="action" value="updateWirelessEnabledModules">
43         <input type="hidden" name="enabled_modules" value="">
44         
45         <table border="0" cellspacing="1" cellpadding="1">
46                 <tr>
47                         <td>
48                         <input title="{$APP.LBL_SAVE_BUTTON_LABEL}" accessKey="{$APP.LBL_SAVE_BUTTON_TITLE}" class="button primary" onclick="SUGAR.saveGlobalSearchSettings();" type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">
49                         <input title="{$APP.LBL_CANCEL_BUTTON_LABEL}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="document.GlobalSearchSettings.action.value='';" type="submit" name="button" value="{$APP.LBL_CANCEL_BUTTON_LABEL}">
50                         </td>
51                 </tr>
52         </table>
53         
54         <div class='add_table' style='margin-bottom:5px'>
55                 <table id="GlobalSearchSettings" class="GlobalSearchSettings edit view" style='margin-bottom:0px;' border="0" cellspacing="0" cellpadding="0">
56                     <tr>
57                                 <td width='1%'>
58                                         <div id="enabled_div"></div>    
59                                 </td>
60                                 <td>
61                                         <div id="disabled_div"></div>
62                                 </td>
63                         </tr>
64                 </table>
65         </div>
66         
67         <table border="0" cellspacing="1" cellpadding="1">
68                 <tr>
69                         <td>
70                                 <input title="{$APP.LBL_SAVE_BUTTON_LABEL}" accessKey="{$APP.LBL_SAVE_BUTTON_TITLE}" class="button primary" onclick="SUGAR.saveGlobalSearchSettings();" type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">
71                                 <input title="{$APP.LBL_CANCEL_BUTTON_LABEL}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="document.GlobalSearchSettings.action.value='';" type="submit" name="button" value="{$APP.LBL_CANCEL_BUTTON_LABEL}">
72                         </td>
73                 </tr>
74         </table>
75 </form>
76
77 <script type="text/javascript">
78 (function(){ldelim}
79     var Connect = YAHOO.util.Connect;
80         Connect.url = 'index.php';
81     Connect.method = 'POST';
82     Connect.timeout = 300000;
83         var get = YAHOO.util.Dom.get;
84
85         var enabled_modules = {$enabled_modules};
86         var disabled_modules = {$disabled_modules};
87         var lblEnabled = '{sugar_translate label="LBL_ACTIVE_MODULES"}';
88         var lblDisabled = '{sugar_translate label="LBL_DISABLED_MODULES"}';
89         {literal}
90         SUGAR.globalSearchEnabledTable = new YAHOO.SUGAR.DragDropTable(
91                 "enabled_div",
92                 [{key:"label",  label: lblEnabled, width: 200, sortable: false},
93                  {key:"module", label: lblEnabled, hidden:true}],
94                 new YAHOO.util.LocalDataSource(enabled_modules, {
95                         responseSchema: {fields : [{key : "module"}, {key : "label"}]}
96                 }),  
97                 {height: "300px"}
98         );
99         SUGAR.globalSearchDisabledTable = new YAHOO.SUGAR.DragDropTable(
100                 "disabled_div",
101                 [{key:"label",  label: lblDisabled, width: 200, sortable: false},
102                  {key:"module", label: lblDisabled, hidden:true}],
103                 new YAHOO.util.LocalDataSource(disabled_modules, {
104                         responseSchema: {fields : [{key : "module"}, {key : "label"}]}
105                 }),
106                 {height: "300px"}
107         );
108         
109         SUGAR.globalSearchEnabledTable.disableEmptyRows = true;
110         SUGAR.globalSearchDisabledTable.disableEmptyRows = true;
111         SUGAR.globalSearchEnabledTable.addRow({module: "", label: ""});
112         SUGAR.globalSearchDisabledTable.addRow({module: "", label: ""});
113         SUGAR.globalSearchEnabledTable.render();
114         SUGAR.globalSearchDisabledTable.render();
115         
116         SUGAR.saveGlobalSearchSettings = function()
117         {
118                 var enabledTable = SUGAR.globalSearchEnabledTable;
119                 var modules = "";
120                 for(var i=0; i < enabledTable.getRecordSet().getLength(); i++){
121                         var data = enabledTable.getRecord(i).getData();
122                         if (data.module && data.module != '')
123                             modules += "," + data.module;
124                 }
125                 modules = modules == "" ? modules : modules.substr(1);
126                 
127                 ajaxStatus.showStatus(SUGAR.language.get('Administration', 'LBL_SAVING'));
128                 Connect.asyncRequest(
129             Connect.method, 
130             Connect.url, 
131             {success: SUGAR.saveCallBack},
132                         SUGAR.util.paramsToUrl({
133                                 module: "Administration",
134                                 action: "saveglobalsearchsettings",
135                                 enabled_modules: modules
136                         }) + "to_pdf=1"
137         );
138                 
139                 return true;
140         }
141         
142         SUGAR.saveCallBack = function(o)
143         {
144            ajaxStatus.flashStatus(SUGAR.language.get('app_strings', 'LBL_DONE'));
145            if (o.responseText == "true")
146            {
147                window.location.assign('index.php?module=Administration&action=index');
148            } else {
149                YAHOO.SUGAR.MessageBox.show({msg:o.responseText});
150            }
151         }       
152 })();
153 {/literal}
154 </script>