3 /*********************************************************************************
4 * SugarCRM is a customer relationship management program developed by
5 * SugarCRM, Inc. Copyright (C) 2004-2011 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='local' value='{$local}'>
52 <input type='hidden' name='view_module' value='{$view_module}'>
54 <input type='hidden' name='PORTAL' value='1'>
56 <input type='hidden' name='view_package' value='{$view_package}'>
57 <input type='hidden' name='to_pdf' value='1'>
58 <link rel="stylesheet" type="text/css" href="modules/ModuleBuilder/tpls/ListEditor.css"/>
60 <table id="editor-content" class="list-editor">
61 <tr><td colspan=3>{$buttons}</td></tr>
62 {if isset($subpanel) && isset($subpanel_label)}
65 <span class='mbLBL'>{sugar_translate label='LBL_SUBPANEL_TITLE'}</span>
66 <input id ="subpanel_title" type="text" name="subpanel_title" value="{$subpanel_title}">
67 <input id ="subpanel_title_key" type="hidden" name="subpanel_title_key" value="{$subpanel_label}">
73 {counter start=0 name="groupCounter" print=false assign="groupCounter"}
74 {foreach from=$groups key='label' item='list'}
75 {counter name="groupCounter"}
77 {math assign="groupWidth" equation="100/$groupCounter-3"}
79 {counter start=0 name="slotCounter" print=false assign="slotCounter"}
80 {counter start=0 name="modCounter" print=false assign="modCounter"}
82 {foreach from=$groups key='label' item='list'}
84 <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;">
86 <ul id='ul{$slotCounter}' style="overflow-y: auto; overflow-x: hidden;">
88 {foreach from=$list key='key' item='value'}
90 <li name="width={$value.width}%" id='subslot{$modCounter}' class='draggable' >
93 <td id='subslot{$modCounter}label' style="font-weight: bold;">
95 {if !empty($value.label)}{$current_mod_strings[$value.label]}{elseif !empty($value.vname)}{$current_mod_strings[$value.vname]}{else}{$key}{/if}
97 {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 <img src="{sugar_getimagepath file='edit_inline.gif'}" style="cursor: pointer;"
103 onclick="var value_label = document.getElementById('subslot{$modCounter}label').innerHTML.replace(/^\s+|\s+$/g,'');
104 {if !($view|substr:-6 == "search") }
105 var value_width = document.getElementById('subslot{$modCounter}width').innerHTML;
107 ModuleBuilder.getContent('module=ModuleBuilder&action=editProperty&view_module={$view_module}'+
108 '{if isset($subpanel)}&subpanel={$subpanel}{/if}'+
109 '{if $MB}&MB={$MB}&view_package={$view_package}{/if}'+
110 '&id_label=subslot{$modCounter}label'+
111 '&name_label=label_'+
112 '{if isset($value.label)}{$value.label}'+
113 '{elseif !empty($value.vname)}{$value.vname}'+
115 '&title_label={$MOD.LBL_LABEL_TITLE}&value_label=' + value_label
116 {if ($view|substr:-6 != "search") }
117 + '&id_width=subslot{$modCounter}width&name_width={$MOD.LBL_WIDTH}&value_width=' + value_width
123 <tr class='fieldValue'>
124 {if empty($hideKeys)}<td>[{$key}]</td>{/if}
125 <td align="right" colspan="2">
126 {if $view|substr:-6 == "search" }
127 <span style="display:none" id='subslot{$modCounter}width'>{$value.width}</span> <span style="display:none">%</span>
129 <span id='subslot{$modCounter}width'>{$value.width}</span> <span>%</span>
137 studiotabs.tabLabelToValue['{$value.label}|{$key}'] = '{$key}';
138 if(typeof(studiotabs.subtabModules['subslot{$modCounter}']) == 'undefined')studiotabs.subtabModules['subslot{$modCounter}'] = '{$value.label}|{$key}';
141 {counter name="modCounter"}
144 <li id='topslot{$slotCounter}' class='noBullet'> </li>
149 {counter name="slotCounter"}
157 function dragDropInit(){
158 studiotabs.fields = {};
159 studiotabs.slotCount = {/literal}{$slotCounter};
160 studiotabs.modCount = {$modCounter};
162 for(msi = 0; msi < studiotabs.slotCount ; msi++){
163 studiotabs.fields["topslot"+ msi] = new Studio2.ListDD("topslot" + msi, "subTabs", true);
165 for(msi = 0; msi < studiotabs.modCount ; msi++){
166 studiotabs.fields["subslot"+ msi] = new Studio2.ListDD("subslot" + msi, "subTabs", false);
169 studiotabs.fields["subslot"+ (msi - 1) ].updateTabs();
172 resizeDDLists = function() {
173 var Dom = YAHOO.util.Dom;
174 var body = document.getElementById('mbtabs');
175 for(var msi = 0; msi < studiotabs.slotCount ; msi++){
176 var targetHeight = body.offsetHeight - (Dom.getY("ul" + msi) - Dom.getY(body)) - 20;
181 if (targetHeight > 0 )
182 Dom.setStyle("ul" + msi, "height", targetHeight + "px");
186 function countListFields() {
188 var divs = document.getElementById( 'ul0' ).getElementsByTagName( 'li' ) ;
189 for ( var j=0;j<divs.length;j++) {
190 if (divs[j].className == 'draggable') count++;
197 setTimeout(resizeDDLists, 100);
198 ModuleBuilder.helpRegister('edittabs');
199 ModuleBuilder.helpRegisterByID('content', 'div');
201 ModuleBuilder.helpSetup('{$helpName}', '{$helpDefault}');
203 ModuleBuilder.helpUnregisterByID('savebtn');
204 ModuleBuilder.MBpackage = '{$view_package}';
209 <div id='logDiv' style='display:none'>
212 {$additionalFormData}