3 /*********************************************************************************
4 * SugarCRM Community Edition is a customer relationship management program developed by
5 * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
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.
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
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
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.
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.
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 ********************************************************************************/
41 <form name='edittabs' id='edittabs' method='POST' action='index.php'>
47 <input type='hidden' name='action' value={$action}>
48 <input type='hidden' name='view' value={$view}>
49 <input type='hidden' name='module' value='{$module}'>
50 <input type='hidden' name='subpanel' value='{$subpanel}'>
51 <input type='hidden' name='subpanelLabel' value='{$subpanelLabel}'>
52 <input type='hidden' name='local' value='{$local}'>
53 <input type='hidden' name='view_module' value='{$view_module}'>
55 <input type='hidden' name='PORTAL' value='1'>
57 <input type='hidden' name='view_package' value='{$view_package}'>
58 <input type='hidden' name='to_pdf' value='1'>
59 <link rel="stylesheet" type="text/css" href="modules/ModuleBuilder/tpls/ListEditor.css"/>
61 <table id="editor-content" class="list-editor">
62 <tr><td colspan=3>{$buttons}</td></tr>
63 {if isset($subpanel) && isset($subpanel_label)}
66 <span class='mbLBL'>{sugar_translate label='LBL_SUBPANEL_TITLE'}</span>
67 <input id ="subpanel_title" type="text" name="subpanel_title" value="{$subpanel_title}">
68 <input id ="subpanel_title_key" type="hidden" name="subpanel_title_key" value="{$subpanel_label}">
74 {counter start=0 name="groupCounter" print=false assign="groupCounter"}
75 {foreach from=$groups key='label' item='list'}
76 {counter name="groupCounter"}
78 {math assign="groupWidth" equation="100/$groupCounter-3"}
80 {counter start=0 name="slotCounter" print=false assign="slotCounter"}
81 {counter start=0 name="modCounter" print=false assign="modCounter"}
83 {foreach from=$groups key='label' item='list'}
85 <td id={$label} width="30%" VALIGN="top" style="float: left; border: 1px gray solid; padding:4px; margin-right:4px; margin-top: 8px; overflow-x: hidden;">
87 <ul id='ul{$slotCounter}' style="overflow-y: auto; overflow-x: hidden;">
89 {foreach from=$list key='key' item='value'}
91 <li name="width={$value.width}%" id='subslot{$modCounter}' class='draggable' >
94 <td id='subslot{$modCounter}label' style="font-weight: bold;">
96 {if !empty($value.label)}{$current_mod_strings[$value.label]}{elseif !empty($value.vname)}{$current_mod_strings[$value.vname]}{else}{$key}{/if}
98 {if !empty($value.label)}{sugar_translate label=$value.label module=$language}{elseif !empty($value.vname)}{sugar_translate label=$value.vname module=$language}{else}{$key}{/if}
102 <td align="right" class="editIcon">
103 {* BEGIN SUGARCRM flav=pro ONLY *}
104 {if isset($field_defs.$key.calculated) && $field_defs.$key.calculated}
105 {sugar_getimage name="SugarLogic/icon_calculated" alt=$mod_strings.LBL_CALCULATED ext=".png" other_attributes=''}
107 {if isset($field_defs.$key.dependency) && $field_defs.$key.dependency}
108 {sugar_getimage name="SugarLogic/icon_dependent" alt=$mod_strings.LBL_DEPENDANT ext=".png" other_attributes=''}
110 {* END SUGARCRM flav=pro ONLY *}
111 <img src="{sugar_getimagepath file='edit_inline.gif'}" style="cursor: pointer;"
112 onclick="var value_label = document.getElementById('subslot{$modCounter}label').innerHTML.replace(/^\s+|\s+$/g,'');
113 {if !($view|substr:-6 == "search") }
114 var value_width = document.getElementById('subslot{$modCounter}width').innerHTML;
116 ModuleBuilder.getContent('module=ModuleBuilder&action=editProperty&view_module={$view_module|escape:'url'}'+
117 '{if isset($subpanel)}&subpanel={$subpanel|escape:'url'}{/if}'+
118 '{if $MB}&MB={$MB|escape:'url'}&view_package={$view_package|escape:'url'}{/if}'+
119 '&id_label=subslot{$modCounter}label'+
120 '&name_label=label_'+
121 '{if isset($value.label)}{$value.label|escape:'url'}'+
122 '{elseif !empty($value.vname)}{$value.vname|escape:'url'}'+
123 '{else}{$key|escape:'url'}{/if}'+
124 '&title_label={$MOD.LBL_LABEL_TITLE}&value_label=' + encodeURIComponent(value_label)
125 {if ($view|substr:-6 != "search") }
126 + '&id_width=subslot{$modCounter}width&name_width={$MOD.LBL_WIDTH|escape:'url'}&value_width=' + encodeURIComponent(value_width)
132 <tr class='fieldValue'>
133 {if empty($hideKeys)}<td>[{$key}]</td>{/if}
134 <td align="right" colspan="2" class="percentage">
135 {if $view|substr:-6 == "search" }
136 <span style="display:none" id='subslot{$modCounter}width'>{$value.width}</span> <span style="display:none">%</span>
138 <span id='subslot{$modCounter}width'>{$value.width}</span> <span>%</span>
146 studiotabs.tabLabelToValue['{$value.label}|{$key}'] = '{$key}';
147 if(typeof(studiotabs.subtabModules['subslot{$modCounter}']) == 'undefined')studiotabs.subtabModules['subslot{$modCounter}'] = '{$value.label}|{$key}';
150 {counter name="modCounter"}
153 <li id='topslot{$slotCounter}' class='noBullet'> </li>
158 {counter name="slotCounter"}
166 function dragDropInit(){
167 studiotabs.fields = {};
168 studiotabs.slotCount = {/literal}{$slotCounter};
169 studiotabs.modCount = {$modCounter};
171 for(msi = 0; msi < studiotabs.slotCount ; msi++){
172 studiotabs.fields["topslot"+ msi] = new Studio2.ListDD("topslot" + msi, "subTabs", true);
174 for(msi = 0; msi < studiotabs.modCount ; msi++){
175 studiotabs.fields["subslot"+ msi] = new Studio2.ListDD("subslot" + msi, "subTabs", false);
178 studiotabs.fields["subslot"+ (msi - 1) ].updateTabs();
181 resizeDDLists = function() {
182 var Dom = YAHOO.util.Dom;
185 var body = document.getElementById('mbtabs');
186 for(var msi = 0; msi < studiotabs.slotCount ; msi++){
187 var targetHeight = body.offsetHeight - (Dom.getY("ul" + msi) - Dom.getY(body)) - 20;
192 if (targetHeight > 0 )
193 Dom.setStyle("ul" + msi, "height", targetHeight + "px");
195 Studio2.scrollZones = {}
196 for (var i = 0; Dom.get("ul" + i); i++){
197 Studio2.scrollZones["ul" + i] = Studio2.getScrollZones("ul" + i);
201 function countListFields() {
203 var divs = document.getElementById( 'ul0' ).getElementsByTagName( 'li' ) ;
204 for ( var j=0;j<divs.length;j++) {
205 if (divs[j].className == 'draggable') count++;
212 setTimeout(resizeDDLists, 100);
213 ModuleBuilder.helpRegister('edittabs');
214 ModuleBuilder.helpRegisterByID('content', 'div');
215 studiotabs.view = '{$view}';
216 ModuleBuilder.helpSetup('{$helpName}', '{$helpDefault}');
218 ModuleBuilder.helpUnregisterByID('savebtn');
219 ModuleBuilder.MBpackage = '{$view_package}';
224 <div id='logDiv' style='display:none'>
227 {$additionalFormData}