[ Index ] |
|
Code source de vtiger CRM 5.0.2 |
1 /********************************************************************************* 2 ** The contents of this file are subject to the vtiger CRM Public License Version 1.0 3 * ("License"); You may not use this file except in compliance with the License 4 * The Original Code is: vtiger CRM Open Source 5 * The Initial Developer of the Original Code is vtiger. 6 * Portions created by vtiger are Copyright (C) vtiger. 7 * All Rights Reserved. 8 * 9 ********************************************************************************/ 10 function trimfValues(value) 11 { 12 var string_array; 13 string_array = value.split(":"); 14 return string_array[4]; 15 } 16 17 function updatefOptions(sel, opSelName) { 18 var selObj = document.getElementById(opSelName); 19 var fieldtype = null ; 20 21 var currOption = selObj.options[selObj.selectedIndex]; 22 var currField = sel.options[sel.selectedIndex]; 23 24 if(currField.value != null && currField.value.length != 0) 25 { 26 fieldtype = trimfValues(currField.value); 27 ops = typeofdata[fieldtype]; 28 var off = 0; 29 if(ops != null) 30 { 31 32 var nMaxVal = selObj.length; 33 for(nLoop = 0; nLoop < nMaxVal; nLoop++) 34 { 35 selObj.remove(0); 36 } 37 selObj.options[0] = new Option ('None', ''); 38 if (currField.value == '') { 39 selObj.options[0].selected = true; 40 } 41 off = 1; 42 for (var i = 0; i < ops.length; i++) 43 { 44 var label = fLabels[ops[i]]; 45 if (label == null) continue; 46 var option = new Option (fLabels[ops[i]], ops[i]); 47 selObj.options[i + off] = option; 48 if (currOption != null && currOption.value == option.value) 49 { 50 option.selected = true; 51 } 52 } 53 } 54 }else 55 { 56 var nMaxVal = selObj.length; 57 for(nLoop = 0; nLoop < nMaxVal; nLoop++) 58 { 59 selObj.remove(0); 60 } 61 selObj.options[0] = new Option ('None', ''); 62 if (currField.value == '') { 63 selObj.options[0].selected = true; 64 } 65 } 66 67 } 68 function verify_data() { 69 var isError = false; 70 var errorMessage = ""; 71 if (trim(document.CustomView.viewName.value) == "") { 72 isError = true; 73 errorMessage += "\nView Name"; 74 } 75 // Here we decide whether to submit the form. 76 if (isError == true) { 77 alert("Missing required fields:" + errorMessage); 78 return false; 79 } 80 //return true; 81 } 82 83 84 function CancelForm() 85 { 86 var cvmodule = document.templatecreate.cvmodule.value; 87 var viewid = document.templatecreate.cvid.value; 88 document.location.href = "index.php?module="+cvmodule+"&action=index&viewname="+viewid; 89 } 90 91 92 function check4null(form) 93 { 94 var isError = false; 95 var errorMessage = ""; 96 // Here we decide whether to submit the form. 97 if (trim(form.subject.value) =='') { 98 isError = true; 99 errorMessage += "\n subject"; 100 form.subject.focus(); 101 } 102 103 // Here we decide whether to submit the form. 104 if (isError == true) { 105 alert("Missing required fields: " + errorMessage); 106 return false; 107 } 108 return true; 109 } 110 111 112
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 10:22:19 2007 | par Balluche grâce à PHPXref 0.7 |