]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Home/UnifiedSearchAdvancedForm.tpl
Release 6.4.0
[Github/sugarcrm.git] / modules / Home / UnifiedSearchAdvancedForm.tpl
1 {*
2
3 /*********************************************************************************
4  * SugarCRM Community Edition 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="cache/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' class="search_form">
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 <input type='hidden' id='showGSDiv' name='showGSDiv' value='{$SHOWGSDIV}'>
55         <table width='600' border='0' cellspacing='1'>
56         <tr style='padding-bottom: 10px'>
57                 <td class="submitButtons" colspan='8' nowrap>
58                         <input id='searchFieldMain' class='searchField' type='text' size='80' name='query_string' value='{$query_string}'>
59                     <input type="submit" class="button primary" value="{$LBL_SEARCH_BUTTON_LABEL}">&nbsp;
60                         <a href="#" onclick="javascript:toggleInlineSearch();" style="font-size:12px; font-weight:bold; text-decoration:none; text-shadow:0 1px #FFFFFF;">{$MOD.LBL_SELECT_MODULES}&nbsp;
61             {if $SHOWGSDIV == 'yes'}
62             {capture assign="alt_hide_show"}{sugar_translate label='LBL_ALT_HIDE_OPTIONS'}{/capture}
63                         {sugar_getimage  name="basic_search" ext=".gif" other_attributes='border="0" id="up_down_img" ' alt="$alt_hide_show"}
64                         {else}
65             {capture assign="alt_hide_show"}{sugar_translate label='LBL_ALT_SHOW_OPTIONS'}{/capture}
66                         {sugar_getimage  name="advanced_search" ext=".gif" other_attributes='border="0" id="up_down_img" ' alt="$alt_hide_show"}
67                         {/if}
68                         </a>
69                 </td>
70         </tr>
71         <tr height='5'><td></td></tr>
72         <tr style='padding-top: 10px;'>
73                 <td colspan='8' nowrap'>
74                 <div id='inlineGlobalSearch' class='add_table' {if $SHOWGSDIV != 'yes'}style="display:none;"{/if}>
75                 <table id="GlobalSearchSettings" class="GlobalSearchSettings edit view" style='margin-bottom:0px;' border="0" cellspacing="0" cellpadding="0">
76                     <tr>
77                         <td colspan="2">
78                         {sugar_translate label="LBL_SELECT_MODULES_TITLE" module="Administration"}
79                         </td>
80                     </tr>
81                     <tr>
82                                 <td width='1%'>
83                                         <div id="enabled_div"></div>    
84                                 </td>
85                                 <td>
86                                         <div id="disabled_div"></div>
87                                 </td>
88                         </tr>
89                 </table>
90                 </div>
91                 </td>
92         </tr>
93         </table>
94 </form>
95
96 <script type="text/javascript">
97 {literal}
98 function toggleInlineSearch()
99 {
100     if (document.getElementById('inlineGlobalSearch').style.display == 'none')
101     {
102                 SUGAR.globalSearchEnabledTable.render();
103                 SUGAR.globalSearchDisabledTable.render();    
104         document.getElementById('showGSDiv').value = 'yes'              
105         document.getElementById('inlineGlobalSearch').style.display = '';
106 {/literal}
107         document.getElementById('up_down_img').src='{sugar_getimagepath file="basic_search.gif"}';
108         document.getElementById('up_down_img').setAttribute('alt',"{sugar_translate label='LBL_ALT_HIDE_OPTIONS'}");
109 {literal}
110     }else{
111 {/literal}                      
112         document.getElementById('up_down_img').src='{sugar_getimagepath file="advanced_search.gif"}';
113         document.getElementById('up_down_img').setAttribute('alt',"{sugar_translate label='LBL_ALT_SHOW_OPTIONS'}");
114 {literal}                       
115         document.getElementById('showGSDiv').value = 'no';              
116         document.getElementById('inlineGlobalSearch').style.display = 'none';           
117     }    
118 }
119 {/literal}
120
121
122 var get = YAHOO.util.Dom.get;
123 var enabled_modules = {$enabled_modules};
124 var disabled_modules = {$disabled_modules};
125 var lblEnabled = '{sugar_translate label="LBL_ACTIVE_MODULES" module="Administration"}';
126 var lblDisabled = '{sugar_translate label="LBL_DISABLED_MODULES" module="Administration"}';
127 {literal}
128 SUGAR.saveGlobalSearchSettings = function()
129 {
130         var enabledTable = SUGAR.globalSearchEnabledTable;
131         var modules = "";
132         for(var i=0; i < enabledTable.getRecordSet().getLength(); i++){
133                 var data = enabledTable.getRecord(i).getData();
134                 if (data.module && data.module != '')
135                     modules += "," + data.module;
136         }
137         modules = modules == "" ? modules : modules.substr(1);
138         document.forms['UnifiedSearchAdvancedMain'].elements['search_modules'].value = modules;
139 }
140 {/literal}
141
142 document.getElementById("inlineGlobalSearch").style.display={if $SHOWGSDIV == 'yes'}"";{else}"none";{/if}
143
144 {literal}
145 SUGAR.globalSearchEnabledTable = new YAHOO.SUGAR.DragDropTable(
146         "enabled_div",
147         [{key:"label",  label: lblEnabled, width: 200, sortable: false},
148          {key:"module", label: lblEnabled, hidden:true}],
149         new YAHOO.util.LocalDataSource(enabled_modules, {
150                 responseSchema: {fields : [{key : "module"}, {key : "label"}]}
151         }),  
152         {height: "200px"}
153 );
154
155 SUGAR.globalSearchDisabledTable = new YAHOO.SUGAR.DragDropTable(
156         "disabled_div",
157         [{key:"label",  label: lblDisabled, width: 200, sortable: false},
158          {key:"module", label: lblDisabled, hidden:true}],
159         new YAHOO.util.LocalDataSource(disabled_modules, {
160                 responseSchema: {fields : [{key : "module"}, {key : "label"}]}
161         }),
162         {height: "200px"}
163 );
164
165 SUGAR.globalSearchEnabledTable.disableEmptyRows = true;
166 SUGAR.globalSearchDisabledTable.disableEmptyRows = true;
167 SUGAR.globalSearchEnabledTable.addRow({module: "", label: ""});
168 SUGAR.globalSearchDisabledTable.addRow({module: "", label: ""});
169 SUGAR.globalSearchEnabledTable.render();
170 SUGAR.globalSearchDisabledTable.render();
171 {/literal}
172 </script>