/********************************************************************************* * SugarCRM Community Edition is a customer relationship management program developed by * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License version 3 as published by the * Free Software Foundation with the addition of the following permission added * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License along with * this program; if not, see http://www.gnu.org/licenses or write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA. * * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by * SugarCRM" logo. If the display of the logo is not reasonably feasible for * technical reasons, the Appropriate Legal Notices must display the words * "Powered by SugarCRM". ********************************************************************************/ var yahooSlots=new Array();function addNewRowToView(id){var curRow=document.getElementById(id);var parent=curRow.parentNode;var newRow=document.createElement('tr');var newRow=parent.insertRow(parent.rows.length);var re=/studiorow[0-9]+/g;var cell=newRow.insertCell(0);cell.innerHTML=curRow.cells[0].innerHTML.replace(re,'studiorow'+slotCount);cell.className=curRow.cells[0].className;for(var j=1;j]*)/g,'$1 disabled readonly $2');html=html.replace(/(]*)/g,'$1 disabled readonly $2');html=html.replace(/(onclick=')([^']*)/g,'$1');div2.innerHTML+=html;cell.appendChild(div);cell2.appendChild(div2);field_count_MSI++;if(top){yahooSlots[id]=new ygDDSlot(id,"studio");}else{dyn_field_count++;} return name;} function removeFieldFromTable(field,table) {var table=document.getElementById(table);var rows=table.rows;for(i=0;i-1){var error=o.responseText.substr(errorIndex+7,o.responseText.length);ajaxStatus.showStatus(error);window.setTimeout('ajaxStatus.hideStatus();',2000);return;} var typeIndex=o.responseText.indexOf('[TYPE]');var labelIndex=o.responseText.indexOf('[LABEL]');var dataIndex=o.responseText.indexOf('[DATA]');var errorIndex=o.responseText.indexOf('[ERROR]');var name=o.responseText.substr(6,typeIndex-6);var type=o.responseText.substr(typeIndex+6,labelIndex-(typeIndex+6));var label=o.responseText.substr(labelIndex+7,dataIndex-(labelIndex+7));var data=o.responseText.substr(dataIndex+6,o.responseText.length);addNewField('dyn_field_'+field_count_MSI,name,label,data,type,1,'studio_fields',true)};function submitCustomFieldForm(isPopup){if(typeof(document.popup_form.presave)!='undefined'){document.popup_form.presave();} if(!check_form('popup_form'))return;if(isPopup){var callback={success:popupSave,failure:popupSave,argument:''} YAHOO.util.Connect.setForm('popup_form');var cObj=YAHOO.util.Connect.asyncRequest('POST','index.php',callback);studiopopup.destroy();}else{document.popup_form.submit();}} function deleteCustomFieldForm(isPopup){if(confirm("WARNING\nDeleting a custom field will delete all data related to that custom field. \nYou will still need to remove the field from any layouts you have added it to.")){document.popup_form.option.value='DeleteCustomField';document.popup_form.submit();}} function dropdownChanged(value){if(typeof(app_list_strings[value])=='undefined')return;var select=document.getElementById('default_value').options;select.length=0;var count=0;for(var keyin app_list_strings[value]){select[count]=new Option(app_list_strings[value][key],key);count++;}} function customFieldChanged(){} var populateCustomField=function(response){var div=document.getElementById('customfieldbody');if(response.status=0){div.innerHTML='Server Connection Failed';}else{validate['popup_form']=new Array();inputsWithErrors=new Array();div.innerHTML=response.responseText;studiopopup.evalScript(response.responseText);if(studiojs.popupAvailable){var region=YAHOO.util.Dom.getRegion('custom_field_table');studiojs.popup.cfg.setProperty('width',region.right-region.left+30+'px');studiojs.popup.cfg.setProperty('height',region.bottom-region.top+30+'px');studiojs.popup.render(document.body);studiojs.popup.center();studiojs.popup.show();}}};var populateCustomFieldCallback={success:populateCustomField,failure:populateCustomField,argument:1};var COBJ=false;function changeTypeData(type){document.getElementById('customfieldbody').innerHTML='

Loading...

';COBJ=YAHOO.util.Connect.asyncRequest('GET','index.php?module=Studio&popup=true&action=index&&ajax=editcustomfield&to_pdf=true&type='+type,populateCustomFieldCallback,null);} function typeChanged(obj) {changeTypeData(obj.options[obj.selectedIndex].value);} function handle_duplicate(){document.popup_form.action.value='EditView';document.popup_form.duplicate.value='true';document.popup_form.submit();} function forceRange(field,min,max){field.value=parseInt(field.value);if(field.value=='NaN')field.value=max;if(field.value>max)field.value=max;if(field.value