]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Campaigns/Subscriptions.tpl
Release 6.4.0
[Github/sugarcrm.git] / modules / Campaigns / Subscriptions.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 <link rel="stylesheet" type="text/css" href="{sugar_getjspath file='modules/Connectors/tpls/tabs.css'}"/>
40 <!-- begin includes for overlib -->
41 <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000"></div>
42 <script type="text/javascript" src="{sugar_getjspath file='cache/include/javascript/sugar_grp_overlib.js'}"></script>
43 <!-- end includes for overlib -->
44
45 <table width="100%" border="0" cellspacing="0" cellpadding="0">
46 <tr><td colspan='100'><h2>{$title}</h2></td></tr>
47 <tr><td colspan='100'>
48 {$description}
49 </td></tr><tr><td><br></td></tr><tr><td colspan='100'>
50
51 <form name="ConfigureSubs" method="POST"  method="POST" action="index.php">
52         
53                         <form enctype="multipart/form-data" id="SubsForm" name="SubsForm" method="POST" action="index.php">
54                         <input type="hidden" name="module" value="Campaigns">
55                         <input type="hidden" name="action" value="Subscriptions">
56                         <input type="hidden" name="enabled_subs" value="">
57                         <input type="hidden" name="disabled_subs" value="">
58                         <input type="hidden" name="return_module" value="{$RETURN_MODULE}">
59                         <input type="hidden" name="return_action" value="{$RETURN_ACTION}">
60                         <input type="hidden" name="module_tab" value="{$smarty.request.module_tab}">
61                         <input type="hidden" name="orig_disabled_values" id="orig_disabled_values" value="{$disabled_subs_string}">                                             
62                         <input type="hidden" name="orig_enabled_values" id="orig_enabled_values" value="{$enabled_subs_string}">                                                
63                         <input type="hidden" name="record" value="{$RECORD}">
64                         <input type="hidden" name="subs_action" value="process">                        
65
66
67         <table border="0" cellspacing="1" cellpadding="1">
68                 <tr>
69                         <td>
70                                 <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="save();this.form.action.value='Subscriptions'; " type="submit" name="button" value="  {$APP.LBL_SAVE_BUTTON_LABEL}  " > 
71                                 <input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="this.form.action.value='{$RETURN_ACTION}'; this.form.module.value='{$RETURN_MODULE}';" type="submit" name="button" value="  {$APP.LBL_CANCEL_BUTTON_LABEL}  ">
72                         </td>
73                 </tr>
74         </table>
75
76         <div class='add_table' style='margin-bottom:5px'>
77                 <table id="ConfigureSubs" class="themeSettings edit view" style='margin-bottom:0px;' border="0" cellspacing="0" cellpadding="0">
78                         <tr>
79                                 <td><span><b>{$MOD.LBL_ALREADY_SUBSCRIBED_HEADER}</b></span></td>
80                                 <td><span><b>{$MOD.LBL_UNSUBSCRIBED_HEADER}</b>
81 <img alt="Help" border="0" src="{sugar_getimagepath file='helpInline.gif'}"
82 onmouseover="return overlib('{$MOD.LBL_UNSUBSCRIBED_HEADER_EXPL}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );" onmouseout="return nd();" >
83                                 
84                                 </span></td>
85                         </tr>
86                         <tr>
87                                 <td width='1%'>
88                                         <div id="enabled_div" class="enabled_tab_workarea">
89                                                 <ul id="enabled_ul" class="module_draglist">
90                                                 {foreach from=$enabled_subs key=dirname item=name}
91                                                         <li id="{$dirname}" class="noBullet2">{$name}</li>
92                                                 {/foreach}
93                                                 </ul>
94                                         </div>
95                                 </td>
96                                 <td>
97                                         <div id="disabled_div" class="disabled_tab_workarea">
98                                                 <ul id="disabled_ul" class="module_draglist">
99                                                 {foreach from=$disabled_subs key=dirname item=name}
100                                                         <li id="{$dirname}" class="noBullet2">{$name}</li>
101                                                 {/foreach}
102                                                 </ul>
103                                         </div>
104                                 </td>
105                         </tr>
106                 </table>
107         </div>
108         
109         <table border="0" cellspacing="1" cellpadding="1">
110                 <tr>
111                         <td>
112                                 <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="save();this.form.action.value='Subscriptions'; " type="submit" name="button" value="  {$APP.LBL_SAVE_BUTTON_LABEL}  " > 
113                                 <input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="this.form.action.value='{$RETURN_ACTION}'; this.form.module.value='{$RETURN_MODULE}';" type="submit" name="button" value="  {$APP.LBL_CANCEL_BUTTON_LABEL}  ">
114
115                         </td>
116                 </tr>
117         </table>
118 </form>
119
120
121 <script type="text/javascript">
122 {literal}
123
124 var Dom = YAHOO.util.Dom; 
125 var Event = YAHOO.util.Event; 
126 var DDM = YAHOO.util.DragDropMgr;
127
128 function save() {
129     var enabled_display_vals = '';
130     var disabled_display_vals = '';
131
132     //Get the enabled div elements
133     var elements = document.getElementById('enabled_div');
134     //Get the li elements
135         var enabled_list = YAHOO.util.Dom.getElementsByClassName('noBullet2', 'li', elements);
136     for(var li in enabled_list) {
137         if(typeof enabled_list[li] != 'function') {
138             enabled_display_vals += ',' + enabled_list[li].getAttribute('id');
139         }
140     }
141     document.ConfigureSubs.enabled_subs.value = enabled_display_vals != '' ? enabled_display_vals.substr(1,enabled_display_vals.length) : '';
142     
143     var elements = document.getElementById('disabled_div');
144     //Get the li elements
145         var disabled_list = YAHOO.util.Dom.getElementsByClassName('noBullet2', 'li', elements);
146     for(var li in disabled_list) {
147         if(typeof disabled_list[li] != 'function') {
148             disabled_display_vals += ',' + disabled_list[li].getAttribute('id');
149         }
150     }
151     
152     document.ConfigureSubs.disabled_subs.value = disabled_display_vals != '' ? disabled_display_vals.substr(1,disabled_display_vals.length) : '';
153 }
154
155
156 (function() {
157
158 YAHOO.example.DDApp = { 
159 init: function() { 
160 {/literal}          
161         new YAHOO.util.DDTarget("enabled_ul"); 
162         new YAHOO.util.DDTarget("disabled_ul");
163         
164         {foreach from=$enabled_subs key=module item=moduleDisplay}
165     {if $module != $currentTheme}new YAHOO.example.DDList("{$module}");{/if}
166         {/foreach}      
167          
168         {foreach from=$disabled_subs key=module item=moduleDisplay}
169              new YAHOO.example.DDList("{$module}");
170         {/foreach} 
171 {literal}               
172 }
173 };
174
175 YAHOO.example.DDList = function(id, sGroup, config) { 
176     YAHOO.example.DDList.superclass.constructor.call(this, id, sGroup, config); 
177     var el = this.getDragEl(); 
178     Dom.setStyle(el, "opacity", 0.67);
179     this.goingUp = false; 
180     this.lastY = 0; 
181 }; 
182
183
184 YAHOO.extend(YAHOO.example.DDList, YAHOO.util.DDProxy, {
185
186     startDrag: function(x, y) {
187         
188         // make the proxy look like the source element
189         var dragEl = this.getDragEl();
190         var clickEl = this.getEl();
191         Dom.setStyle(clickEl, "visibility", "hidden");
192
193         dragEl.innerHTML = clickEl.innerHTML;
194
195         Dom.setStyle(dragEl, "color", Dom.getStyle(clickEl, "color"));
196         Dom.setStyle(dragEl, "backgroundColor", Dom.getStyle(clickEl, "backgroundColor"));
197         Dom.setStyle(dragEl, "border", "2px solid gray");
198     },
199
200     endDrag: function(e) {
201
202         var srcEl = this.getEl();
203         var proxy = this.getDragEl();
204
205         // Show the proxy element and animate it to the src element's location
206         Dom.setStyle(proxy, "visibility", "");
207         var a = new YAHOO.util.Motion( 
208             proxy, { 
209                 points: { 
210                     to: Dom.getXY(srcEl)
211                 }
212             }, 
213             0.2, 
214             YAHOO.util.Easing.easeOut 
215         )
216         var proxyid = proxy.id;
217         var thisid = this.id;
218
219         // Hide the proxy and show the source element when finished with the animation
220         a.onComplete.subscribe(function() {
221                 Dom.setStyle(proxyid, "visibility", "hidden");
222                 Dom.setStyle(thisid, "visibility", "");
223             });
224         a.animate();
225     },
226
227     onDragDrop: function(e, id) {
228
229         // If there is one drop interaction, the li was dropped either on the list,
230         // or it was dropped on the current location of the source element.
231         if (DDM.interactionInfo.drop.length === 1) {
232
233             // The position of the cursor at the time of the drop (YAHOO.util.Point)
234             var pt = DDM.interactionInfo.point; 
235
236             // The region occupied by the source element at the time of the drop
237             var region = DDM.interactionInfo.sourceRegion; 
238
239             // Check to see if we are over the source element's location.  We will
240             // append to the bottom of the list once we are sure it was a drop in
241             // the negative space (the area of the list without any list items)
242             if (!region.intersect(pt)) {
243                 var destEl = Dom.get(id);
244                 var destDD = DDM.getDDById(id);
245                 destEl.appendChild(this.getEl());
246                 destDD.isEmpty = false;
247                 DDM.refreshCache();
248             }
249
250         }
251     },
252
253     onDrag: function(e) {
254
255         // Keep track of the direction of the drag for use during onDragOver
256         var y = Event.getPageY(e);
257
258         if (y < this.lastY) {
259             this.goingUp = true;
260         } else if (y > this.lastY) {
261             this.goingUp = false;
262         }
263
264         this.lastY = y;
265     },
266
267     onDragOver: function(e, id) {
268     
269         var srcEl = this.getEl();
270         var destEl = Dom.get(id);
271
272         // We are only concerned with list items, we ignore the dragover
273         // notifications for the list.
274         if (destEl.nodeName.toLowerCase() == "li") {
275             var orig_p = srcEl.parentNode;
276             var p = destEl.parentNode;
277
278             if (this.goingUp) {
279                 p.insertBefore(srcEl, destEl); // insert above
280             } else {
281                 p.insertBefore(srcEl, destEl.nextSibling); // insert below
282             }
283
284             DDM.refreshCache();
285         }
286     }
287 });
288
289 Event.onDOMReady(YAHOO.example.DDApp.init, YAHOO.example.DDApp, true);
290
291 })();
292 {/literal}
293 </script>
294 <!-- END: main -->
295