]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/ModuleBuilder/tpls/listView.tpl
Release 6.2.0
[Github/sugarcrm.git] / modules / ModuleBuilder / tpls / listView.tpl
1 {*
2
3 /*********************************************************************************
4  * SugarCRM Community Edition is a customer relationship management program developed by
5  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
6  * 
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.
13  * 
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
17  * details.
18  * 
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
22  * 02110-1301 USA.
23  * 
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.
26  * 
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.
30  * 
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  ********************************************************************************/
37
38
39
40 *}
41 <form name='edittabs' id='edittabs' method='POST' action='index.php'>
42 {literal}
43 <script>
44 studiotabs.reset();
45 </script>
46 {/literal}
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}'>
53 {if $fromPortal}
54     <input type='hidden' name='PORTAL' value='1'>
55 {/if}
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"/>
59
60 <table id="editor-content" class="list-editor">
61 <tr><td colspan=3>{$buttons}</td></tr>
62 {if isset($subpanel) && isset($subpanel_label)}
63 <tr>
64     <td colspan=3>
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}">
68     </td>
69 </tr>
70 {/if}
71 <tr>
72
73 {counter start=0 name="groupCounter" print=false assign="groupCounter"}
74 {foreach from=$groups key='label' item='list'}
75     {counter name="groupCounter"}
76 {/foreach}
77 {math assign="groupWidth" equation="100/$groupCounter-3"}
78
79 {counter start=0 name="slotCounter" print=false assign="slotCounter"}
80 {counter start=0 name="modCounter" print=false assign="modCounter"}
81
82 {foreach from=$groups key='label' item='list'}
83
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;">
85 <h3 >{$label}</h3>
86 <ul id='ul{$slotCounter}' style="overflow-y: auto; overflow-x: hidden;">
87
88 {foreach from=$list key='key' item='value'}
89
90 <li name="width={$value.width}%" id='subslot{$modCounter}' class='draggable' >
91     <table width='100%'>
92         <tr>
93             <td id='subslot{$modCounter}label' style="font-weight: bold;">
94             {if $MB}
95             {if !empty($value.label)}{$current_mod_strings[$value.label]}{elseif !empty($value.vname)}{$current_mod_strings[$value.vname]}{else}{$key}{/if}
96             {else}
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}
98             {/if}
99             </td>
100             <td></td>
101             <td align="right" class="editIcon">
102                 {* BEGIN SUGARCRM flav=pro ONLY *}
103                 {if isset($field_defs.$key.calculated) && $field_defs.$key.calculated}
104                     <img src="{sugar_getimagepath file='SugarLogic/icon_calculated.png'}" />
105                 {/if}
106                 {if isset($field_defs.$key.dependency) && $field_defs.$key.dependency}
107                     <img src="{sugar_getimagepath file='SugarLogic/icon_dependent.png'}" />
108                 {/if}
109                 {* END SUGARCRM flav=pro ONLY *}
110                 <img src="{sugar_getimagepath file='edit_inline.gif'}" style="cursor: pointer;"
111                                 onclick="var value_label = document.getElementById('subslot{$modCounter}label').innerHTML.replace(/^\s+|\s+$/g,''); 
112                                     {if !($view|substr:-6 == "search") }
113                                         var value_width = document.getElementById('subslot{$modCounter}width').innerHTML;
114                                         {/if}
115                                         ModuleBuilder.getContent('module=ModuleBuilder&action=editProperty&view_module={$view_module|escape:'url'}'+
116                                                         '{if isset($subpanel)}&subpanel={$subpanel|escape:'url'}{/if}'+
117                                                         '{if $MB}&MB={$MB|escape:'url'}&view_package={$view_package|escape:'url'}{/if}'+
118                                                         '&id_label=subslot{$modCounter}label'+
119                                                         '&name_label=label_'+
120                                                           '{if isset($value.label)}{$value.label|escape:'url'}'+
121                                                           '{elseif !empty($value.vname)}{$value.vname|escape:'url'}'+
122                                                           '{else}{$key|escape:'url'}{/if}'+
123                                                         '&title_label={$MOD.LBL_LABEL_TITLE}&value_label=' + encodeURIComponent(value_label)
124                                                         {if ($view|substr:-6 != "search") }
125                                                         + '&id_width=subslot{$modCounter}width&name_width={$MOD.LBL_WIDTH|escape:'url'}&value_width=' + encodeURIComponent(value_width)
126                                                         {/if}
127                                         );"
128                                 >
129             </td>
130             </tr>
131             <tr class='fieldValue'>
132                 {if empty($hideKeys)}<td>[{$key}]</td>{/if}
133                 <td align="right" colspan="2" class="percentage">
134                                         {if $view|substr:-6 == "search" }
135                                         <span style="display:none" id='subslot{$modCounter}width'>{$value.width}</span> <span style="display:none">%</span>
136                                         {else}
137                                         <span id='subslot{$modCounter}width'>{$value.width}</span> <span>%</span>
138                                         {/if}
139                                 </td>
140         </tr>
141     </table>
142 </li>
143
144 <script>
145 studiotabs.tabLabelToValue['{$value.label}|{$key}'] = '{$key}';
146 if(typeof(studiotabs.subtabModules['subslot{$modCounter}']) == 'undefined')studiotabs.subtabModules['subslot{$modCounter}'] = '{$value.label}|{$key}';
147 </script>
148
149 {counter name="modCounter"}
150 {/foreach}
151
152 <li id='topslot{$slotCounter}' class='noBullet'>&nbsp;</li>
153
154 </ul>
155 </td>
156
157 {counter name="slotCounter"}
158 {/foreach}
159 </td>
160 </tr></table>
161
162 <script>
163
164 {literal}
165 function dragDropInit(){
166     studiotabs.fields = {};
167     studiotabs.slotCount = {/literal}{$slotCounter};
168     studiotabs.modCount = {$modCounter};
169     {literal}
170     for(msi = 0; msi < studiotabs.slotCount ; msi++){
171         studiotabs.fields["topslot"+ msi] = new Studio2.ListDD("topslot" + msi, "subTabs", true);
172     }
173     for(msi = 0; msi < studiotabs.modCount ; msi++){
174             studiotabs.fields["subslot"+ msi] = new Studio2.ListDD("subslot" + msi, "subTabs", false);
175     }
176
177     studiotabs.fields["subslot"+ (msi - 1) ].updateTabs();
178 };
179
180 resizeDDLists = function() {
181         var Dom = YAHOO.util.Dom;
182     var body = document.getElementById('mbtabs');
183     for(var msi = 0; msi < studiotabs.slotCount ; msi++){
184         var targetHeight =  body.offsetHeight - (Dom.getY("ul" + msi) - Dom.getY(body)) - 20;
185         if (SUGAR.isIE) {
186             targetHeight -= 10;
187         }
188
189         if (targetHeight > 0 )
190                 Dom.setStyle("ul" + msi, "height", targetHeight + "px");
191     }
192 };
193
194 function countListFields() {
195         var count = 0;
196         var divs = document.getElementById( 'ul0' ).getElementsByTagName( 'li' ) ;              
197         for ( var j=0;j<divs.length;j++) {
198                 if (divs[j].className == 'draggable') count++;
199         }
200         return count;
201 };
202
203 {/literal}
204 dragDropInit();
205 setTimeout(resizeDDLists, 100);
206 ModuleBuilder.helpRegister('edittabs');
207 ModuleBuilder.helpRegisterByID('content', 'div');
208
209 ModuleBuilder.helpSetup('{$helpName}', '{$helpDefault}');
210 if('{$from_mb}')
211     ModuleBuilder.helpUnregisterByID('savebtn');
212 ModuleBuilder.MBpackage = '{$view_package}';
213 </script>
214
215
216
217 <div id='logDiv' style='display:none'>
218 </div>
219
220 {$additionalFormData}
221
222 </form>
223
224