]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Home/UnifiedSearchAdvancedForm.tpl
Release 6.2.0beta4
[Github/sugarcrm.git] / modules / Home / UnifiedSearchAdvancedForm.tpl
1 {*
2
3 /*********************************************************************************
4  * SugarCRM is a customer relationship management program developed by
5  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
6  * 
7  * This program is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU Affero General Public License version 3 as published by the
9  * Free Software Foundation with the addition of the following permission added
10  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13  * 
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
17  * details.
18  * 
19  * You should have received a copy of the GNU Affero General Public License along with
20  * this program; if not, see http://www.gnu.org/licenses or write to the Free
21  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22  * 02110-1301 USA.
23  * 
24  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26  * 
27  * The interactive user interfaces in modified source and object code versions
28  * of this program must display Appropriate Legal Notices, as required under
29  * Section 5 of the GNU Affero General Public License version 3.
30  * 
31  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32  * these Appropriate Legal Notices must retain the display of the "Powered by
33  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34  * technical reasons, the Appropriate Legal Notices must display the words
35  * "Powered by SugarCRM".
36  ********************************************************************************/
37
38
39
40
41 *}
42
43 <script type="text/javascript" src="{sugar_getjspath file='include/javascript/sugar_grp_yui_widgets.js'}"></script>
44 <link rel="stylesheet" type="text/css" href="{sugar_getjspath file='modules/Connectors/tpls/tabs.css'}"/>
45
46 <form name='UnifiedSearchAdvancedMain' action='index.php' onsubmit="SUGAR.saveGlobalSearchSettings();" method='POST'>
47 <input type='hidden' name='module' value='Home'>
48 <input type='hidden' name='query_string' value='test'>
49 <input type='hidden' name='advanced' value='true'>
50 <input type='hidden' name='action' value='UnifiedSearch'>
51 <input type='hidden' name='search_form' value='false'>
52 <input type='hidden' name='search_modules' value=''>
53 <input type='hidden' name='skip_modules' value=''>
54         <table width='600' class='edit view' border='0' cellspacing='1'>
55         <tr style='padding-bottom: 10px'>
56                 <td colspan='8' nowrap>
57                         <input id='searchFieldMain' class='searchField' type='text' size='80' name='query_string' value='{$query_string}'>
58                     <input type="submit" class="button primary" value="{$LBL_SEARCH_BUTTON_LABEL}">&nbsp;
59                         <a href='javascript:toggleInlineSearch()' style='color: #005A9B; text-decoration:none; font-weight: bold;'>{$MOD.LBL_SELECT_MODULES}&nbsp;
60             {if $SHOWGSDIV == 'yes'}
61                         <img src='{sugar_getimagepath file="basic_search.gif"}' id='up_down_img' border=0>
62                         {else}
63                         <img src='{sugar_getimagepath file="advanced_search.gif"}' id='up_down_img' border=0>
64                         {/if}
65                         </a>
66                         <input type='hidden' id='showGSDiv' name='showGSDiv' value='{$SHOWGSDIV}'>
67                 </td>
68         </tr>
69         <tr height='5'><td></td></tr>
70         <tr style='padding-top: 10px;'>
71                 <td colspan='8' nowrap'>
72                 <div id='inlineGlobalSearch' class='add_table'>
73                 <table id="GlobalSearchSettings" class="GlobalSearchSettings edit view" style='margin-bottom:0px;' border="0" cellspacing="0" cellpadding="0">
74                     <tr>
75                         <td colspan="2">
76                         {sugar_translate label="LBL_SELECT_MODULES_TITLE" module="Administration"}
77                         </td>
78                     </tr>
79                     <tr>
80                                 <td width='1%'>
81                                         <div id="enabled_div"></div>    
82                                 </td>
83                                 <td>
84                                         <div id="disabled_div"></div>
85                                 </td>
86                         </tr>
87                 </table>
88                 </div>
89                 </td>
90         </tr>
91         </table>
92 </form>
93
94 <script type="text/javascript">
95 {literal}
96 function toggleInlineSearch()
97 {
98     if (document.getElementById('inlineGlobalSearch').style.display == 'none')
99     {
100                 SUGAR.globalSearchEnabledTable.render();
101                 SUGAR.globalSearchDisabledTable.render();    
102         document.getElementById('showGSDiv').value = 'yes'              
103         document.getElementById('inlineGlobalSearch').style.display = '';
104 {/literal}      
105         document.getElementById('up_down_img').src='{sugar_getimagepath file="basic_search.gif"}';
106 {literal}
107     }else{
108 {/literal}                      
109         document.getElementById('up_down_img').src='{sugar_getimagepath file="advanced_search.gif"}';
110 {literal}                       
111         document.getElementById('showGSDiv').value = 'no';              
112         document.getElementById('inlineGlobalSearch').style.display = 'none';           
113     }    
114 }
115 {/literal}
116
117
118 var get = YAHOO.util.Dom.get;
119 var enabled_modules = {$enabled_modules};
120 var disabled_modules = {$disabled_modules};
121 var lblEnabled = '{sugar_translate label="LBL_ACTIVE_MODULES" module="Administration"}';
122 var lblDisabled = '{sugar_translate label="LBL_DISABLED_MODULES" module="Administration"}';
123 {literal}
124
125 SUGAR.globalSearchEnabledTable = new YAHOO.SUGAR.DragDropTable(
126         "enabled_div",
127         [{key:"label",  label: lblEnabled, width: 200, sortable: false},
128          {key:"module", label: lblEnabled, hidden:true}],
129         new YAHOO.util.LocalDataSource(enabled_modules, {
130                 responseSchema: {fields : [{key : "module"}, {key : "label"}]}
131         }),  
132         {height: "200px"}
133 );
134
135 SUGAR.globalSearchDisabledTable = new YAHOO.SUGAR.DragDropTable(
136         "disabled_div",
137         [{key:"label",  label: lblDisabled, width: 200, sortable: false},
138          {key:"module", label: lblDisabled, hidden:true}],
139         new YAHOO.util.LocalDataSource(disabled_modules, {
140                 responseSchema: {fields : [{key : "module"}, {key : "label"}]}
141         }),
142         {height: "200px"}
143 );
144
145 SUGAR.globalSearchEnabledTable.disableEmptyRows = true;
146 SUGAR.globalSearchDisabledTable.disableEmptyRows = true;
147 SUGAR.globalSearchEnabledTable.addRow({module: "", label: ""});
148 SUGAR.globalSearchDisabledTable.addRow({module: "", label: ""});
149 SUGAR.globalSearchEnabledTable.render();
150 SUGAR.globalSearchDisabledTable.render();
151
152 SUGAR.saveGlobalSearchSettings = function()
153 {
154         var enabledTable = SUGAR.globalSearchEnabledTable;
155         var modules = "";
156         for(var i=0; i < enabledTable.getRecordSet().getLength(); i++){
157                 var data = enabledTable.getRecord(i).getData();
158                 if (data.module && data.module != '')
159                     modules += "," + data.module;
160         }
161         modules = modules == "" ? modules : modules.substr(1);
162         document.forms['UnifiedSearchAdvancedMain'].elements['search_modules'].value = modules;
163 }
164 {/literal}
165
166 var handleHideShow = function()
167 {ldelim}
168
169 {if $SHOWGSDIV == 'yes'}
170         document.getElementById("inlineGlobalSearch").style.display="";
171 {else}
172         document.getElementById("inlineGlobalSearch").style.display="none";
173 {/if}   
174
175 {rdelim};
176
177 YAHOO.util.Event.onDOMReady(handleHideShow); 
178
179 </script>