]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Administration/templates/GlobalSearchSettings.tpl
Release 6.5.6
[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-2012 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 <table width="100%" border="0" cellspacing="0" cellpadding="0">
39 <tr>
40     <td colspan="100">
41         <h2> {$moduleTitle}</h2>
42     </td>
43 </tr>
44 <tr>
45     <td colspan="100">{$MOD.LBL_GLOBAL_SEARCH_SETTINGS_TITLE}</td>
46 </tr>
47 <tr>
48     <td>
49         <br>
50     </td>
51 </tr>
52 <tr>
53 <td colspan="100">
54
55 <script type="text/javascript" src="{sugar_getjspath file='cache/include/javascript/sugar_grp_yui_widgets.js'}"></script>
56 <link rel="stylesheet" type="text/css" href="{sugar_getjspath file='modules/Connectors/tpls/tabs.css'}"/>
57 <form name="GlobalSearchSettings" method="POST">
58         <input type="hidden" name="module" value="Administration">
59         <input type="hidden" name="action" value="saveGlobalSearchSettings">
60         <input type="hidden" name="enabled_modules" value="">
61
62         <table border="0" cellspacing="1" cellpadding="1">
63                 <tr>
64                         <td>
65                         <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}">
66                 <input title="{$MOD.LBL_SAVE_SCHED_BUTTON}" class="button primary schedFullSystemIndex" onclick="SUGAR.FTS.schedFullSystemIndex();" style="{if !$showSchedButton}display:none;{/if}text-decoration: none;" id='schedFullSystemIndexBtn' type="button" name="button" value="{$MOD.LBL_SAVE_SCHED_BUTTON}">
67             <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}">
68                         </td>
69                 </tr>
70         </table>
71
72         <div class='add_table' style='margin-bottom:5px'>
73                 <table id="GlobalSearchSettings" class="GlobalSearchSettings edit view" style='margin-bottom:0px;' border="0" cellspacing="0" cellpadding="0">
74                     <tr>
75                                 <td width='1%'>
76                                         <div id="enabled_div"></div>
77                                 </td>
78                                 <td>
79                                         <div id="disabled_div"></div>
80                                 </td>
81                         </tr>
82                 </table>
83         </div>
84         <table border="0" cellspacing="1" cellpadding="1">
85                 <tr>
86                         <td>
87                                 <input title="{$APP.LBL_SAVE_BUTTON_LABEL}" class="button primary" onclick="SUGAR.saveGlobalSearchSettings();" type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">
88                 <input title="{$MOD.LBL_SAVE_SCHED_BUTTON}" class="button primary schedFullSystemIndex" onclick="SUGAR.FTS.schedFullSystemIndex();" style="{if !$showSchedButton}display:none;{/if}text-decoration: none;" id='schedFullSystemIndex' type="button" name="button" value="{$MOD.LBL_SAVE_SCHED_BUTTON}">
89                 <input title="{$APP.LBL_CANCEL_BUTTON_LABEL}" class="button" onclick="document.GlobalSearchSettings.action.value='';" type="submit" name="button" value="{$APP.LBL_CANCEL_BUTTON_LABEL}">
90                         </td>
91                 </tr>
92         </table>
93 </form>
94
95 <div id='selectFTSModules' class="yui-hidden">
96     <div style="background-color: white; padding: 20px;">
97         <div id='selectFTSModulesTable' ></div>
98         <div style="padding-top: 10px"><input type="checkbox" name="clearDataOnIndex" id="clearDataOnIndex" >&nbsp;{$MOD.LBL_DELETE_FTS_DATA}</div>
99     </div>
100 </div>
101 <script type="text/javascript">
102 (function(){ldelim}
103     var Connect = YAHOO.util.Connect;
104         Connect.url = 'index.php';
105     Connect.method = 'POST';
106     Connect.timeout = 300000;
107         var get = YAHOO.util.Dom.get;
108
109         var enabled_modules = {$enabled_modules};
110         var disabled_modules = {$disabled_modules};
111         var lblEnabled = '{sugar_translate label="LBL_ACTIVE_MODULES"}';
112         var lblDisabled = '{sugar_translate label="LBL_DISABLED_MODULES"}';
113         {literal}
114         SUGAR.globalSearchEnabledTable = new YAHOO.SUGAR.DragDropTable(
115                 "enabled_div",
116                 [{key:"label",  label: lblEnabled, width: 200, sortable: false},
117                  {key:"module", label: lblEnabled, hidden:true}],
118                 new YAHOO.util.LocalDataSource(enabled_modules, {
119                         responseSchema: {fields : [{key : "module"}, {key : "label"}]}
120                 }),
121                 {height: "300px"}
122         );
123         SUGAR.globalSearchDisabledTable = new YAHOO.SUGAR.DragDropTable(
124                 "disabled_div",
125                 [{key:"label",  label: lblDisabled, width: 200, sortable: false},
126                  {key:"module", label: lblDisabled, hidden:true}],
127                 new YAHOO.util.LocalDataSource(disabled_modules, {
128                         responseSchema: {fields : [{key : "module"}, {key : "label"}]}
129                 }),
130                 {height: "300px"}
131         );
132
133         SUGAR.globalSearchEnabledTable.disableEmptyRows = true;
134         SUGAR.globalSearchDisabledTable.disableEmptyRows = true;
135         SUGAR.globalSearchEnabledTable.addRow({module: "", label: ""});
136         SUGAR.globalSearchDisabledTable.addRow({module: "", label: ""});
137         SUGAR.globalSearchEnabledTable.render();
138         SUGAR.globalSearchDisabledTable.render();
139
140     SUGAR.getEnabledModules = function()
141     {
142         var enabledTable = SUGAR.globalSearchEnabledTable;
143         var modules = "";
144         for(var i=0; i < enabledTable.getRecordSet().getLength(); i++)
145         {
146             var data = enabledTable.getRecord(i).getData();
147             if (data.module && data.module != '')
148                 modules += "," + data.module;
149         }
150         return modules;
151     }
152     SUGAR.getEnabledModulesForFTSSched = function()
153     {
154         var enabledTable = SUGAR.FTS.selectedDataTable;
155         var modules = [];
156         var selectedIDs = enabledTable.getSelectedRows();
157         for(var i=0; i < selectedIDs.length; i++)
158         {
159             var data = enabledTable.getRecord(selectedIDs[i]).getData();
160             modules.push(data.module);
161         }
162
163         return modules;
164     }
165     SUGAR.getTranslatedEnabledModules = function()
166     {
167         var enabledTable = SUGAR.globalSearchEnabledTable;
168         var modules = [{module:'', label: SUGAR.language.get('Administration', 'LBL_ALL')}];
169         for(var i=0; i < enabledTable.getRecordSet().getLength(); i++)
170         {
171             var data = enabledTable.getRecord(i).getData();
172             if (data.module && data.module != '')
173             {
174                 var tmp = {'module' : data.module, 'label' : data.label};
175                 modules.push(tmp);
176             }
177         }
178
179         return modules;
180     }
181         SUGAR.saveGlobalSearchSettings = function()
182         {
183                 var enabledTable = SUGAR.globalSearchEnabledTable;
184                 var modules = SUGAR.getEnabledModules();
185                 modules = modules == "" ? modules : modules.substr(1);
186
187                 ajaxStatus.showStatus(SUGAR.language.get('Administration', 'LBL_SAVING'));
188                 Connect.asyncRequest(
189             Connect.method,
190             Connect.url,
191             {success: SUGAR.saveCallBack},
192                         SUGAR.util.paramsToUrl({
193                                 module: "Administration",
194                                 action: "saveglobalsearchsettings",
195                                 enabled_modules: modules
196                         }) + "to_pdf=1"
197         );
198
199                 return true;
200         }
201
202         SUGAR.saveCallBack = function(o)
203         {
204            ajaxStatus.flashStatus(SUGAR.language.get('app_strings', 'LBL_DONE'));
205            if (o.responseText == "true")
206            {
207                window.location.assign('index.php?module=Administration&action=index');
208            } else {
209                YAHOO.SUGAR.MessageBox.show({msg:o.responseText});
210            }
211         }
212 })();
213 {/literal}
214 </script>
215 <script type="text/javascript">
216 </script>