3 /*********************************************************************************
4 * SugarCRM Community Edition 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 ********************************************************************************/
45 <style type='text/css'>
48 border-width:1px;border-color:#999999;border-style:solid;padding:0px 1px 0px 1px;margin:2px;cursor:move;
53 border-width:0;cursor:move;
62 <table width="100%" border="0" cellspacing="0" cellpadding="0">
66 <table cellspacing="2">
68 <td colspan="3">{$MOD.LBL_RENAME_MOD_SAVE_HELP}</td>
70 <tr><td> </td></tr>
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()" />
78 <div style="height:10px"> </div>
79 <table width="100%" border="0" cellspacing="0" cellpadding="0" class='edit view' >
82 <span class='error'>{$error}</span>
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}
93 {html_options name='dropdown_lang' options=$dropdown_languages selected=$dropdown_lang onchange="document.dropdownsform.submit();"}
94 {sugar_help text=$MOD.LBL_LANGUAGE_TOOLTIP}
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'>
111 <table name='tabDropdown' id='tabDropdown'>
113 {counter start=0 name="rowCounter" print=false assign="rowCounter"}
114 {foreach from=$dropdown item="value" key="key"}
117 <span id='slot{$rowCounter}b' >
118 <span onclick='prepChangeDropDownValue({$rowCounter}, document.getElementById("slot{$rowCounter}_value"));'>{$editImage}</span>
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;">
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>
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>
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'>
142 {counter name="rowCounter"}
148 {sugar_getscript file="cache/include/javascript/sugar_grp_overlib.js"}
149 {sugar_getscript file="include/javascript/yui/dragdrop.js"}
154 var lastRowCount = -1;
155 var inputsWithErrors = [];
156 function prepChangeDropDownValue(rowCount, field)
158 var tempLastField = lastField;
159 if(lastRowCount != -1)
161 //Check for validation errors first
162 if(checkForErrors(lastRowCount))
165 setDropDownValue(lastRowCount, lastField.innerHTML, true);
167 if(tempLastField == field)
170 lastRowCount = rowCount;
172 field.style.display="none";
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'
181 function checkForErrors(rowCount)
183 var foundErrors = false;
184 var el1 = document.getElementById("slot" + rowCount + "_text");
185 var el2 = document.getElementById("slot" + rowCount + "_stext");
187 if( YAHOO.lang.trim(el1.value) == "")
189 add_error_style('editdropdown', el1, SUGAR.language.get('app_strings', 'ERR_MISSING_REQUIRED_FIELDS'),true);
192 if( YAHOO.lang.trim(el2.value) == "")
194 add_error_style('editdropdown', el2, SUGAR.language.get('app_strings', 'ERR_MISSING_REQUIRED_FIELDS'),true);
201 function setSingularDropDownValue(rowCount)
203 document.getElementById('svalue_'+ rowCount).value = document.getElementById('slot' + rowCount + '_stext').value;
206 function setDropDownValue(rowCount, val, collapse)
208 //Check for validation errors first
209 if(checkForErrors(rowCount))
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');
218 span.innerHTML = val;
219 textspan.style.display = 'none';
220 span.style.display = 'inline';
224 setSingularDropDownValue(rowCount);
227 var slotCount = {/literal}{$rowCounter}{literal};
230 function validateForm()
232 for(i=0;i<slotCount;i++)
234 if( checkForErrors(i) )
236 //Highlight dropdown value if we find an error.
237 prepChangeDropDownValue(i, document.getElementById("slot"+i+"_value"));
242 if(check_form("editdropdown"))
244 document.editdropdown.submit();
252 <div id='logDiv' style='display:none'>
255 <input type='hidden' name='use_push' value='1'>