]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Studio/TabGroups/EditViewTabs.tpl
Release 6.5.0
[Github/sugarcrm.git] / modules / Studio / TabGroups / EditViewTabs.tpl
1 {*
2 /*********************************************************************************
3  * SugarCRM Community Edition is a customer relationship management program developed by
4  * SugarCRM, Inc. Copyright (C) 2004-2012 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
40 *}
41
42 <br />
43 <script type="text/javascript" src="{sugar_getjspath file='modules/Studio/JSTransaction.js'}" ></script>
44 <script>
45         var jstransaction = new JSTransaction();
46 </script>
47 <script type="text/javascript" src="{sugar_getjspath file='modules/Studio/studiotabgroups.js'}"></script>
48 <script type="text/javascript" src="{sugar_getjspath file='modules/Studio/ygDDListStudio.js'}"></script>
49 <script type="text/javascript" src="{sugar_getjspath file='modules/Studio/studiodd.js'}" ></script>
50 <script type="text/javascript" src="{sugar_getjspath file='modules/Studio/studio.js'}" ></script>
51 {literal}
52 <style type='text/css'>
53 .slot {
54         border-width:1px;border-color:#999999;border-style:solid;padding:0px 1px 0px 1px;margin:2px;cursor:move;
55
56 }
57
58
59 .slotSub {
60         border-width:1px;border-color:#006600;border-style:solid;padding:0px 1px 0px 1px;margin:2px;cursor:move;
61
62 }
63 .slotB {
64         border-width:0;cursor:move;
65
66 }
67 .listContainer
68 {
69         margin-left: 4;
70         padding-left: 4;
71         margin-right: 4;
72         padding-right: 4;
73         list-style-type: none;
74 }
75
76  ul.listContainer
77 {
78         margin-left: 10px;
79         margin-right: 10px;
80         padding-left: 0;
81 }
82
83 div.noBullet li, .nobullet
84 {
85     list-style-type: none;
86 }
87
88 ul#trash
89 {
90     padding: 0px;
91     margin: 0px;
92 }
93
94 .tdContainer{
95         border: thin solid gray;
96         padding: 10;
97 }
98
99 </style>
100 {/literal}
101 <h2 >{$title}</h2>
102 <p>{$MOD.LBL_GROUP_TAB_WELCOME}</p>
103 <br/>
104 <table cellspacing=2>
105 <button style='cursor:default' onmousedown='this.className="buttonOn";return false;'
106             onmouseup='this.className="button"' onmouseout='this.className="button"'
107             onclick='studiotabs.generateForm("edittabs");document.edittabs.submit()'>
108             {$MOD.LBL_BTN_SAVEPUBLISH}</button>
109 </table>
110 <p />
111 <form name='edittabs' id='edittabs' method='POST' action='index.php'>
112 <input type="hidden" name="slot_count" id="slot_count" value="" />
113 <table  cellpadding="0" cellspacing="0" border="0" width="100%">
114 <tr>
115         <td width="100%" class='dataLabel' colspan=2>
116         {$MOD.LBL_TABGROUP_LANGUAGE}&nbsp;
117         {html_options name='grouptab_lang' options=$available_languages selected=$tabGroupSelected_lang onchange=" tabLanguageChange(this)"}
118         {sugar_help text=$MOD.LBL_TAB_GROUP_LANGUAGE_HELP}
119         </td>
120 </tr>
121 </table>
122 <table><tr><td valign='top' nowrap class="edit view" style="width: auto;">
123 <table  cellpadding="0" cellspacing="0" width="100%"   id='s_field_delete'>
124                                                         <tr><td ><ul id='trash' class='listContainer'>
125 <li class='nobullet' id='trashcan'><table>
126   <tr>
127         <td>{$recycleImage}</td>
128         <td><br />{$MOD.LBL_DELETE_MODULE}</td>
129   </tr>
130   </table></li>
131
132 </ul>
133                                                 </td></tr></table>
134
135
136 <div class='noBullet' style="padding-left: 20px;"><h2>{$MOD.LBL_MODULES}</h2>
137 <ul class='listContainer'>
138 {counter start=0 name="modCounter" print=false assign="modCounter"}
139 {foreach from=$availableModuleList key='key' item='value'}
140
141
142 <li  id='modSlot{$modCounter}'><span class='slotB'>{$value.label}</span></li>
143 <script>
144 tabLabelToValue['{$value.label}'] = '{$value.value}';
145 subtabModules['modSlot{$modCounter}'] = '{$value.label}'</script>
146 {counter name="modCounter"}
147 {/foreach}
148 </ul>
149 </td>
150 <td valign='top' nowrap>
151 <table class='tableContainer' id='groupTable'><tr>
152 {counter start=0 name="tabCounter" print=false assign="tabCounter"}
153
154 {foreach from=$tabs item='tab' key='tabName'}
155 {if $tabCounter > 0 && $tabCounter % 6 == 0}
156 </tr><tr>
157 {/if}
158 <td valign='top' class='tdContainer'>
159 <div id='slot{$tabCounter}' class='noBullet'><h2 id='handle{$tabCounter}' ><span id='tabname_{$tabCounter}' class='slotB'>{$tab.labelValue}</span><br><span id='tabother_{$tabCounter}'><span onclick='studiotabs.editTabGroupLabel({$tabCounter}, false)'>{$editImage}</span>&nbsp;
160 {if $tab.label != $otherLabel }
161         <span onclick='studiotabs.deleteTabGroup({$tabCounter})'>{$deleteImage}</span>
162 {/if}
163 </span></h2><input type='hidden' name='tablabelid_{$tabCounter}' id='tablabelid_{$tabCounter}'  value='{$tab.label}'><input type='text' name='tablabel_{$tabCounter}' id='tablabel_{$tabCounter}' style='display:none' value='{$tab.labelValue}' onblur='studiotabs.editTabGroupLabel({$tabCounter}, true)'>
164 <ul id='ul{$tabCounter}' class='listContainer'>
165 {counter start=0 name="subtabCounter" print=false assign="subtabCounter"}
166 {foreach from=$tab.modules key='list' item='name'}
167
168 <li id='subslot{$tabCounter}_{$subtabCounter}' class='listStyle' name='{$list}'><span class='slotB' >{$availableModuleList[$list].label}</span></li>
169 <script>subtabModules['subslot{$tabCounter}_{$subtabCounter}'] = '{$availableModuleList[$list].label}'</script>
170 {counter name="subtabCounter"}
171 {/foreach}
172 <li class='noBullet' id='noselectbottom{$tabCounter}'>&nbsp;</li>
173 <script>subtabCount[{$tabCounter}] = {$subtabCounter};</script>
174 </ul>
175 </div>
176 <div id='slot{$tabCounter}b'>
177 <input type='hidden' name='slot_{$tabCounter}' id='slot_{$tabCounter}' value ='{$tabCounter}'>
178 <input type='hidden' name='delete_{$tabCounter}' id='delete_{$tabCounter}' value ='0'>
179 </div>
180 {counter name="tabCounter"}
181 </td>
182 {/foreach}
183
184 </tr>
185 <tr><td><input type='button' class='button' onclick='addTabGroup()' value='{$MOD.LBL_ADD_GROUP}'></td></tr>
186 </table>
187
188 </td>
189 </table>
190
191
192
193 <span class='error'>{$error}</span>
194
195
196
197 {literal}
198
199
200                 <script>
201                 function tabLanguageChange(sel){
202                         var partURL = window.location.href;
203                         if(partURL.search(/&lang=\w*&/i) != -1){
204                                 partURL = partURL.replace(/&lang=\w*&/i, '&lang='+ sel.value+'&');
205                         }else if(partURL.search(/&lang=\w*/i) != -1){
206                                 partURL = partURL.replace(/&lang=\w*/i, '&lang='+ sel.value);
207                         }else{
208                                 partURL = window.location.href + '&lang='+ sel.value;
209                         }
210                         window.location.href = partURL;
211                 }
212
213                 function addTabGroup(){
214                         var table = document.getElementById('groupTable');
215                         var rowIndex = table.rows.length - 1;
216                         var rowExists = false;
217                         for(var i = 0; i < rowIndex;i++){
218                                 if(table.rows[i].cells.length < 6){
219                                         rowIndex = i;
220                                         rowExists = true;
221                                 }
222                         }
223
224                         if(!rowExists)table.insertRow(rowIndex);
225                         cell = table.rows[rowIndex].insertCell(table.rows[rowIndex].cells.length);
226                         cell.className='tdContainer';
227                         cell.vAlign='top';
228                         var slotDiv = document.createElement('div');
229                         slotDiv.id = 'slot'+ slotCount;
230                         var header = document.createElement('h2');
231                         header.id = 'handle' + slotCount;
232                         headerSpan = document.createElement('span');
233                         headerSpan.innerHTML = '{/literal}{$TGMOD.LBL_NEW_GROUP}{literal}';
234                         headerSpan.id = 'tabname_' + slotCount;
235                         header.appendChild(headerSpan);
236                         header.appendChild(document.createElement('br'));
237                         headerSpan2 = document.createElement('span');
238                         headerSpan2.id = 'tabother_' + slotCount;
239                         subspan1 = document.createElement('span');
240                         subspan1.slotCount=slotCount;
241                         subspan1.innerHTML = '{/literal}{$editImage}{literal}&nbsp;';
242                         subspan1.onclick= function(){
243                                 studiotabs.editTabGroupLabel(this.slotCount, false);
244                         };
245                         subspan2 = document.createElement('span');
246                         subspan2.slotCount=slotCount;
247                         subspan2.innerHTML = '{/literal}{$deleteImage}{literal}&nbsp;';
248                         subspan2.onclick= function(){
249                                 studiotabs.deleteTabGroup(this.slotCount);
250                         };
251                         headerSpan2.appendChild(subspan1);
252                         headerSpan2.appendChild(subspan2);
253
254                         var editLabel = document.createElement('input');
255                         editLabel.style.display = 'none';
256                         editLabel.type = 'text';
257                         editLabel.value = '{/literal}{$TGMOD.LBL_NEW_GROUP}{literal}';
258                         editLabel.id = 'tablabel_' + slotCount;
259                         editLabel.name = 'tablabel_' + slotCount;
260                         editLabel.slotCount = slotCount;
261                         editLabel.onblur = function(){
262                                 studiotabs.editTabGroupLabel(this.slotCount, true);
263                         }
264
265                         var list = document.createElement('ul');
266                         list.id = 'ul' + slotCount;
267                         list.className = 'listContainer';
268                         header.appendChild(headerSpan2);
269                         var li = document.createElement('li');
270                         li.id = 'noselectbottom' + slotCount;
271                         li.className = 'noBullet';
272                         li.innerHTML = '{/literal}{$TGMOD.LBL_DROP_HERE}{literal}';
273                         list.appendChild(li);
274
275                         slotDiv.appendChild(header);
276                         slotDiv.appendChild(editLabel);
277                         slotDiv.appendChild(list);
278                         var slotB = document.createElement('div');
279                         slotB.id = 'slot' + slotCount + 'b';
280                         var slot = document.createElement('input');
281                         slot.type = 'hidden';
282                         slot.id =  'slot_' + slotCount;
283                         slot.name =  'slot_' + slotCount;
284                         slot.value = slotCount;
285                         var deleteSlot = document.createElement('input');
286                         deleteSlot.type = 'hidden';
287                         deleteSlot.id =  'delete_' + slotCount;
288                         deleteSlot.name =  'delete_' + slotCount;
289                         deleteSlot.value = 0;
290                         slotB.appendChild(slot);
291                         slotB.appendChild(deleteSlot);
292                         cell.appendChild(slotDiv);
293                         cell.appendChild(slotB);
294
295                         yahooSlots["slot" + slotCount] = new ygDDSlot("slot" + slotCount, "mainTabs");
296                         yahooSlots["slot" + slotCount].setHandleElId("handle" + slotCount);
297                         yahooSlots["noselectbottom"+ slotCount] = new ygDDListStudio("noselectbottom"+ slotCount , "subTabs", -1);
298                         subtabCount[slotCount] = 0;
299                         slotCount++;
300                         ygDDListStudio.prototype.updateTabs();
301                 }
302
303                 var slotCount = {/literal}{$tabCounter}{literal};
304                 var modCount = {/literal}{$modCounter}{literal};
305                 var subSlots = [];
306                 var yahooSlots = [];
307
308                 function dragDropInit(){
309
310                         YAHOO.util.DDM.mode = YAHOO.util.DDM.POINT;
311
312                         for(mj = 0; mj <= slotCount; mj++){
313                                 yahooSlots["slot" + mj] = new ygDDSlot("slot" + mj, "mainTabs");
314                                 yahooSlots["slot" + mj].setHandleElId("handle" + mj);
315
316                                 yahooSlots["noselectbottom"+ mj] = new ygDDListStudio("noselectbottom"+ mj , "subTabs", -1);
317                                 for(msi = 0; msi <= subtabCount[mj]; msi++){
318                                         yahooSlots["subslot"+ mj + '_' + msi] = new ygDDListStudio("subslot"+ mj + '_' + msi, "subTabs", 0);
319
320                                 }
321
322                         }
323                         for(msi = 0; msi <= modCount ; msi++){
324                                         yahooSlots["modSlot"+ msi] = new ygDDListStudio("modSlot" + msi, "subTabs", 1);
325
326                         }
327                         var trash1  = new ygDDListStudio("trashcan" , "subTabs", 'trash');
328                         ygDDListStudio.prototype.updateTabs();
329
330                 }
331
332                 YAHOO.util.DDM.mode = YAHOO.util.DDM.INTERSECT;
333                 YAHOO.util.Event.addListener(window, "load", dragDropInit);
334
335 </script>
336 {/literal}
337         <input type='hidden' name='action' value='SaveTabs'>
338         <input type='hidden' name='module' value='Studio'>
339 </form>
340
341