/************************************* * SPDX-FileCopyrightText: 2009-2020 Vtenext S.r.l. * SPDX-License-Identifier: AGPL-3.0-only ************************************/ //crmv@18199 function createupdatefieldtaskscript($,fieldName,fieldValue){ var vtinst = new VtenextWebservices("webservice.php"); var fieldValidator; var desc = null; function id(v){ return v; } function map(fn, list){ var out = []; $.each(list, function(i, v){ out[out.length]=fn(v); }); return out; } function field(name){ return function(object){ if(typeof(object) != 'undefined') { return object[name]; } }; } function zip(){ var out = []; var lengths = map(field('length'), arguments); var min = reduceR(function(a,b){return a'+e.label+'';}, result['picklistValues']) ); value.replaceWith(''); } function forPicklist(opType){ var value = $("#fieldValue"); var options = implode('', map(function (e){return '';}, opType['picklistValues']) ); value.replaceWith(''); } function forInteger(opType){ var value = $("#fieldValue"); value.replaceWith(''); } var functions = { string:function(opType){ var value = $("#fieldValue"); value.replaceWith(''); }, 'boolean': function(opType){ var value = $("#fieldValue"); value.replaceWith( ''); }, integer: forInteger, picklist:forPicklist, multipicklist:forPicklist, picklistmultilanguage:forPicklist, // crmv@118315 owner: forOwner //crmv@18199 : add User field }; var ret = functions[fieldType]; if(ret==null){ ret = functions['string']; } return ret; } function fillOptions(el,options){ el.empty(); $.each(options, function(k, v){ el.append(''); }); } function resetFields(opType){ defaultValue(opType.name)(opType); } //Convert user type into reference for consistency in describe objects //This is done inplace function referencify(desc){ var fields = desc['fields']; for(var i=0; i