2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
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.
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
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
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.
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.
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 ********************************************************************************/
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 -->
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'>
49 </td></tr><tr><td><br></td></tr><tr><td colspan='100'>
51 <form name="ConfigureSubs" method="POST" method="POST" action="index.php">
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">
67 <table border="0" cellspacing="1" cellpadding="1">
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} ">
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">
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();" >
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>
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>
109 <table border="0" cellspacing="1" cellpadding="1">
112 <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" 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}" 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} ">
121 <script type="text/javascript">
124 var Dom = YAHOO.util.Dom;
125 var Event = YAHOO.util.Event;
126 var DDM = YAHOO.util.DragDropMgr;
129 var enabled_display_vals = '';
130 var disabled_display_vals = '';
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');
141 document.ConfigureSubs.enabled_subs.value = enabled_display_vals != '' ? enabled_display_vals.substr(1,enabled_display_vals.length) : '';
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');
152 document.ConfigureSubs.disabled_subs.value = disabled_display_vals != '' ? disabled_display_vals.substr(1,disabled_display_vals.length) : '';
158 YAHOO.example.DDApp = {
161 new YAHOO.util.DDTarget("enabled_ul");
162 new YAHOO.util.DDTarget("disabled_ul");
164 {foreach from=$enabled_subs key=module item=moduleDisplay}
165 {if $module != $currentTheme}new YAHOO.example.DDList("{$module}");{/if}
168 {foreach from=$disabled_subs key=module item=moduleDisplay}
169 new YAHOO.example.DDList("{$module}");
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;
184 YAHOO.extend(YAHOO.example.DDList, YAHOO.util.DDProxy, {
186 startDrag: function(x, y) {
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");
193 dragEl.innerHTML = clickEl.innerHTML;
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");
200 endDrag: function(e) {
202 var srcEl = this.getEl();
203 var proxy = this.getDragEl();
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(
214 YAHOO.util.Easing.easeOut
216 var proxyid = proxy.id;
217 var thisid = this.id;
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", "");
227 onDragDrop: function(e, id) {
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) {
233 // The position of the cursor at the time of the drop (YAHOO.util.Point)
234 var pt = DDM.interactionInfo.point;
236 // The region occupied by the source element at the time of the drop
237 var region = DDM.interactionInfo.sourceRegion;
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;
253 onDrag: function(e) {
255 // Keep track of the direction of the drag for use during onDragOver
256 var y = Event.getPageY(e);
258 if (y < this.lastY) {
260 } else if (y > this.lastY) {
261 this.goingUp = false;
267 onDragOver: function(e, id) {
269 var srcEl = this.getEl();
270 var destEl = Dom.get(id);
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;
279 p.insertBefore(srcEl, destEl); // insert above
281 p.insertBefore(srcEl, destEl.nextSibling); // insert below
289 Event.onDOMReady(YAHOO.example.DDApp.init, YAHOO.example.DDApp, true);