]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Connectors/tpls/search_properties.tpl
Release 6.2.3
[Github/sugarcrm.git] / modules / Connectors / tpls / search_properties.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
39 <div id="{$source_id}_add_tables" class="sources_table_div">
40 {foreach from=$display_data key=module item=data}
41 <table border="0" cellspacing="1" cellpadding="1" name="{$module}" id="{$module}">
42 <tr>
43 <td colspan="2"><span><font size="3">{sugar_translate label=$module}</font></span></td>
44 </tr>
45 <tr>
46 <td><b>{$mod.LBL_DEFAULT}</b></td>
47 <td><b>{$mod.LBL_AVAILABLE}</b></td>
48 </tr>
49 <tr>
50 <td>
51 <div class="enabled_workarea" id="{$source_id}:{$module}:enabled_div">
52 <ul class="draglist" id="{$source_id}:{$module}:enabled_ul">
53 {foreach from=$data.enabled key=enabled_id item=enabled_value}
54 <li class="noBullet2" id="{$source_id}:{$module}:{$enabled_id}">{$enabled_value}</li>
55 {/foreach}
56 </ul>
57 </div>
58 </td>
59 <td>
60 <div class="disabled_workarea" id="{$source_id}:{$module}:disabled_div">
61 <ul class="draglist" id="{$source_id}:{$module}:disabled_ul">
62 {foreach from=$data.disabled key=disabled_id item=disabled_value}
63 <li class="noBullet2" id="{$source_id}:{$module}:{$disabled_id}">{$disabled_value}</li>
64 {/foreach}
65 </ul>
66 </div>
67 </td>
68 </tr>
69 </table>
70 <hr/>
71 {/foreach}
72 </div>
73
74 <script type="text/javascript">
75 {literal}
76
77 var Dom = YAHOO.util.Dom; 
78 var Event = YAHOO.util.Event; 
79 var DDM = YAHOO.util.DragDropMgr;
80
81 (function() {
82
83 YAHOO.example.DDApp = { 
84 init: function() { 
85 {/literal}          
86 {foreach from=$modules_sources key=module item=field_defs}  
87     new YAHOO.util.DDTarget("{$source_id}:{$module}:enabled_ul", "{$source_id}:{$module}"); 
88         new YAHOO.util.DDTarget("{$source_id}:{$module}:disabled_ul", "{$source_id}:{$module}"); 
89         {foreach from=$field_defs key=index item=field}
90              new YAHOO.example.DDList("{$source_id}:{$module}:{$index}", "{$source_id}:{$module}");
91         {/foreach}
92 {/foreach}    
93 {literal}               
94 }
95 };
96
97 YAHOO.example.DDList = function(id, sGroup, config) { 
98             YAHOO.example.DDList.superclass.constructor.call(this, id, sGroup, config); 
99             var el = this.getDragEl(); 
100             Dom.setStyle(el, "opacity", 0.67);
101             this.goingUp = false; 
102             this.lastY = 0; 
103 }; 
104
105
106 YAHOO.extend(YAHOO.example.DDList, YAHOO.util.DDProxy, {         
107             startDrag: function(x, y) { 
108                 // make the proxy look like the source element 
109                 var dragEl = this.getDragEl(); 
110                 var clickEl = this.getEl(); 
111                 Dom.setStyle(clickEl, "visibility", "hidden"); 
112                 dragEl.innerHTML = clickEl.innerHTML; 
113                 Dom.setStyle(dragEl, "color", Dom.getStyle(clickEl, "color")); 
114                 Dom.setStyle(dragEl, "backgroundColor", Dom.getStyle(clickEl, "backgroundColor")); 
115                 Dom.setStyle(dragEl, "border", "2px solid gray");
116                 Dom.setStyle(dragEl, "cursor", "pointer");  
117             }, 
118          
119             endDrag: function(e) { 
120          
121                 var srcEl = this.getEl(); 
122                 var proxy = this.getDragEl(); 
123          
124                 // Show the proxy element and animate it to the src element's location 
125                 Dom.setStyle(proxy, "visibility", ""); 
126                 var a = new YAHOO.util.Motion(  
127                     proxy, {  
128                         points: {  
129                             to: Dom.getXY(srcEl) 
130                         } 
131                     },  
132                     0.2,  
133                     YAHOO.util.Easing.easeOut  
134                 ) 
135                 var proxyid = proxy.id; 
136                 var thisid = this.id; 
137          
138                 // Hide the proxy and show the source element when finished with the animation 
139                 a.onComplete.subscribe(function() { 
140                         Dom.setStyle(proxyid, "visibility", "hidden"); 
141                         Dom.setStyle(thisid, "visibility", ""); 
142                     }); 
143                 a.animate(); 
144             }, 
145          
146             onDragDrop: function(e, id) {        
147                 // If there is one drop interaction, the li was dropped either on the list, 
148                 // or it was dropped on the current location of the source element. 
149                 if (typeof(DDM.interactionInfo) != 'undefined' && DDM.interactionInfo.drop.length === 1) { 
150          
151                     // The position of the cursor at the time of the drop (YAHOO.util.Point) 
152                     var pt = DDM.interactionInfo.point;  
153          
154                     // The region occupied by the source element at the time of the drop 
155                     var region = DDM.interactionInfo.sourceRegion;  
156                     // Check to see if we are over the source element's location.  We will 
157                     // append to the bottom of the list once we are sure it was a drop in 
158                     // the negative space (the area of the list without any list items) 
159                     if (!region.intersect(pt)) { 
160                         var destEl = Dom.get(id);
161                         var destDD = DDM.getDDById(id); 
162                         destEl.appendChild(this.getEl()); 
163                         destDD.isEmpty = false; 
164                         DDM.refreshCache(); 
165                     } 
166          
167                 } 
168             }, 
169          
170             onDrag: function(e) { 
171          
172                 // Keep track of the direction of the drag for use during onDragOver 
173                 var y = Event.getPageY(e); 
174          
175                 if (y < this.lastY) { 
176                     this.goingUp = true; 
177                 } else if (y > this.lastY) { 
178                     this.goingUp = false; 
179                 } 
180          
181                 this.lastY = y; 
182             }, 
183             
184             onDragOver: function(e, id) { 
185                 var srcEl = this.getEl(); 
186                 var destEl = Dom.get(id);
187          
188                 if (destEl.nodeName.toLowerCase() == "li") { 
189                     var orig_p = srcEl.parentNode; 
190                     var p = destEl.parentNode; 
191                         if (this.goingUp) { 
192                         p.insertBefore(srcEl, destEl); // insert above 
193                     } else { 
194                         p.insertBefore(srcEl, destEl.nextSibling); // insert below 
195                     } 
196                         DDM.refreshCache(); 
197                 }  else if(destEl.nodeName.toLowerCase() == "ul") {
198                     var p = destEl.parentNode;
199                 blank_list = p.lastChild;
200                 if(!blank_list.id) {
201                     destEl.appendChild(srcEl);
202                 } else {
203                         blank_list.insertBefore(srcEl, destEl.nextSibling);
204                 }
205                 DDM.refreshCache(); 
206                 }
207             } 
208         }); 
209
210  
211 YAHOO.util.Event.onDOMReady(function(){
212       YAHOO.example.DDApp.init();
213  });
214
215 })();
216 {/literal}
217 </script>
218
219 {if $no_searchdefs_defined}
220 <h3>{$mod.ERROR_NO_SEARCHDEFS_DEFINED}</h3>
221 {/if}