]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Studio/wizards/RenameModules.tpl
Release 6.4.0
[Github/sugarcrm.git] / modules / Studio / wizards / RenameModules.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 *}
42
43
44 {literal}
45 <style type='text/css'>
46     .slot
47     {
48         border-width:1px;border-color:#999999;border-style:solid;padding:0px 1px 0px 1px;margin:2px;cursor:move;
49     }
50
51     .slotB
52     {
53         border-width:0;cursor:move;
54     }
55     div.moduleTitle
56     {
57         margin-bottom: 5px;
58     }
59 </style>
60 {/literal}
61
62 <table width="100%" border="0" cellspacing="0" cellpadding="0">
63         <tr>
64                 <td>
65            {$title}
66 <table cellspacing="2">
67     <tr>
68         <td colspan="3">{$MOD.LBL_RENAME_MOD_SAVE_HELP}</td>
69     </tr>
70     <tr><td>&nbsp;</td></tr>
71     <tr>
72         <td colspan="3">
73             <input type="button" class="button primary" value="{$MOD.LBL_BTN_SAVE}" id="renameSaveBttn" onclick='validateForm();'name="{$MOD.LBL_BTN_SAVE}" />
74             <input type="button" class="button" value="{$MOD.LBL_BTN_CANCEL}"  id="renameCancelBttn" name="{$MOD.LBL_BTN_CANCEL}" onclick="document.editdropdown.action.value='index'; document.editdropdown.module.value='Administration';document.editdropdown.submit()" />
75         </td>
76     </tr>
77 </table>
78 <div style="height:10px">&nbsp;</div>
79 <table width="100%" border="0" cellspacing="0" cellpadding="0" class='edit view' >
80 <tr>
81     <td>
82         <span class='error'>{$error}</span>
83         <table>
84             <tr>
85                 <td colspan='2'>
86                     <form method='post' action='index.php' name='dropdownsform'>
87                         <input type='hidden' name='action' value='wizard'>
88                         <input type='hidden' name='wizard' value='RenameModules'>
89                         <input type='hidden' name='option' value='EditDropdown'>
90                         <input type='hidden' name='module' value='Studio'>
91                         <input type='hidden' name='dropdown_name' value='{$dropdown_name}'>
92                         {$MOD.LBL_TABGROUP_LANGUAGE} &nbsp;
93                         {html_options name='dropdown_lang' options=$dropdown_languages selected=$dropdown_lang onchange="document.dropdownsform.submit();"}
94                         {sugar_help text=$MOD.LBL_LANGUAGE_TOOLTIP}
95                     </form>
96                 </td>
97             </tr>
98         </table>
99     </td>
100 </tr>
101 <tr>
102     <td>
103 <form method='post' action='index.php' name='editdropdown'>
104 <input type='hidden' name='action' value='wizard'>
105 <input type='hidden' name='wizard' value='RenameModules'>
106 <input type='hidden' name='option' value='SaveDropDown'>
107 <input type='hidden' name='module' value='Studio'>
108 <input type='hidden' name='dropdown_lang' value='{$dropdown_lang}'>
109 <input type='hidden' name='dropdown_name' value='moduleList'>
110
111 <table name='tabDropdown' id='tabDropdown'>
112
113 {counter start=0 name="rowCounter" print=false assign="rowCounter"}
114 {foreach from=$dropdown item="value" key="key"}
115 <tr>
116     <td>
117         <span id='slot{$rowCounter}b' >
118             <span onclick='prepChangeDropDownValue({$rowCounter}, document.getElementById("slot{$rowCounter}_value"));'>{$editImage}</span>
119             &nbsp;
120             <span id ='slot{$rowCounter}_value' onclick='prepChangeDropDownValue({$rowCounter}, this);'>{$value.lang}</span>
121             <span id='slot{$rowCounter}_textspan' style='display:none;'>{$value.user_lang}
122                 <table style="margin-left:15px;">
123                     <tr>
124                         <td align="right">{$MOD.LBL_SINGULAR}</td>
125                         <td align="left"><input id='slot{$rowCounter}_stext' value='{$value.singular}' onchange='setSingularDropDownValue({$rowCounter});' type='text'></td>
126                     </tr>
127                     <tr>
128                         <td align="right">{$MOD.LBL_PLURAL}</td>
129                         <td align="left"><input id='slot{$rowCounter}_text' value='{$value.lang}' type='text'  onchange='setDropDownValue({$rowCounter}, this.value, true)' ></td>
130                     </tr>
131                 </table>
132                 <input name='slot_{$rowCounter}' id='slot_{$rowCounter}' value='{$rowCounter}' type = 'hidden'>
133                 <input type='hidden' name='key_{$rowCounter}' id='key_{$rowCounter}' value='{$key|default:"BLANK"}'>
134                 <input type='hidden' id='delete_{$rowCounter}' name='delete_{$rowCounter}' value='0'>
135                 <input type='hidden' id='slot{$rowCounter}_key' name='slot{$rowCounter}_key' value='{$key}'>
136                 <input name='value_{$rowCounter}' id='value_{$rowCounter}' value='{$value.lang}' type = 'hidden'>
137                 <input name='svalue_{$rowCounter}' id='svalue_{$rowCounter}' value='{$value.singular}' type = 'hidden'>
138             </span>
139         </span>
140     </td>
141 </tr>
142 {counter name="rowCounter"}
143 {/foreach}
144
145 </table>
146 </table>
147
148 {sugar_getscript file="cache/include/javascript/sugar_grp_overlib.js"}
149 {sugar_getscript file="include/javascript/yui/dragdrop.js"}
150 {literal}
151 <script>
152
153     var lastField = '';
154     var lastRowCount = -1;
155     var inputsWithErrors = [];
156     function prepChangeDropDownValue(rowCount, field)
157     {
158         var tempLastField = lastField;
159         if(lastRowCount != -1)
160         {
161             //Check for validation errors first
162             if(checkForErrors(lastRowCount))
163                 return true;
164
165             setDropDownValue(lastRowCount, lastField.innerHTML, true);
166         }
167         if(tempLastField == field)
168             return;
169         lastField = field;
170         lastRowCount = rowCount;
171
172         field.style.display="none";
173
174         var textspan =  document.getElementById('slot' + rowCount + '_textspan');
175         var text = document.getElementById("slot" + rowCount + "_text");
176         text.value=field.innerHTML;
177         textspan.style.display='inline'
178         text.focus();
179     }
180
181     function checkForErrors(rowCount)
182     {
183         var foundErrors = false;
184         var el1 = document.getElementById("slot" + rowCount + "_text");
185         var el2 = document.getElementById("slot" + rowCount + "_stext");
186
187         if( YAHOO.lang.trim(el1.value) == "")
188         {
189             add_error_style('editdropdown', el1, SUGAR.language.get('app_strings', 'ERR_MISSING_REQUIRED_FIELDS'),true);
190             foundErrors = true;
191         }
192         if( YAHOO.lang.trim(el2.value) == "")
193         {
194             add_error_style('editdropdown', el2, SUGAR.language.get('app_strings', 'ERR_MISSING_REQUIRED_FIELDS'),true);
195             foundErrors = true;
196         }
197
198         return foundErrors;
199     }
200
201     function setSingularDropDownValue(rowCount)
202     {
203         document.getElementById('svalue_'+ rowCount).value = document.getElementById('slot' + rowCount + '_stext').value;
204     }
205
206     function setDropDownValue(rowCount, val, collapse)
207     {
208         //Check for validation errors first
209         if(checkForErrors(rowCount))
210             return true;
211
212         document.getElementById('value_' + rowCount).value = val;
213         var text =  document.getElementById('slot' + rowCount + '_text');
214         var textspan =  document.getElementById('slot' + rowCount + '_textspan');
215         var span = document.getElementById('slot' + rowCount + '_value');
216         if(collapse)
217         {
218             span.innerHTML  = val;
219             textspan.style.display = 'none';
220             span.style.display = 'inline';
221         }
222         lastField = '';
223         lastRowCount = -1;
224         setSingularDropDownValue(rowCount);
225     }
226
227     var slotCount = {/literal}{$rowCounter}{literal};
228     var yahooSlots = [];
229
230     function validateForm()
231     {
232         for(i=0;i<slotCount;i++)
233         {
234             if( checkForErrors(i) )
235             {
236                 //Highlight dropdown value if we find an error.
237                 prepChangeDropDownValue(i,  document.getElementById("slot"+i+"_value"));
238                 return;
239             }
240         }
241
242         if(check_form("editdropdown"))
243         {
244             document.editdropdown.submit();
245         }
246
247     }
248 </script>
249 {/literal}
250
251
252 <div id='logDiv' style='display:none'>
253 </div>
254
255 <input type='hidden' name='use_push' value='1'>
256 </form>
257 </td></tr>
258 </table>