/*+*******************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
******************************************************************************/
jQuery.noConflict();
function editexpressionscript($){
function errorDialog(message){
alert(message);
}
function handleError(fn){
return function(status, result){
if(status){
fn(result);
}else{
errorDialog('Failure:'+result);
}
};
}
var ep;//ep is defined in the document.ready block.
function errorDialog(message){
alert(message);
}
function jsonget(operation, params, callback){
var obj = {
module:'FieldFormulas',
action:'FieldFormulasAjax',
file:operation, ajax:'true'};
$.each(params,function(key, value){
obj[key] = value;
});
$.get('index.php', obj,
function(result){
var parsed = JSON.parse(result);
callback(parsed);
});
}
function getfieldlabel(fieldname) {
var fieldlabel = false;
if(typeof(meta_fieldnames) != 'undefined' && typeof(meta_fieldlabels) != 'undefined') {
fieldlabel = meta_fieldlabels[meta_fieldnames.indexOf(fieldname)];
}
if(!fieldlabel) fieldlabel = fieldname;
return fieldlabel;
}
function addFieldExpression(moduleName, fieldName, fieldLabel, expression){
editLink = format('', fieldName);
deleteLink = format('
', fieldName);
row = format('