"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tine20/Tinebase/js/ApplicationStarter.js" between
tine20-2020.08.3.tar.gz and tine20-2020.08.4.tar.gz

About: Tine 2.0 is a platform independent business software system which combines groupware and customer relationship management (CRM). Commercial support is available. Source code.

ApplicationStarter.js  (tine20-2020.08.3):ApplicationStarter.js  (tine20-2020.08.4)
skipping to change at line 205 skipping to change at line 205
metadata.css = 'tine-gird-cell-number'; metadata.css = 'tine-gird-cell-number';
} }
}); });
} }
break; break;
case 'user': case 'user':
gridRenderer = Tine.Tinebase.common.usernameRenderer; gridRenderer = Tine.Tinebase.common.usernameRenderer;
break; break;
case 'keyfield': case 'keyfield':
gridRenderer = Tine.Tinebase.widgets.keyfield.Renderer.get(a ppName, config.name); gridRenderer = Tine.Tinebase.widgets.keyfield.Renderer.get(_ .get(config, 'owningApp', appName), config.name);
break; break;
case 'datetime_separated_date': case 'datetime_separated_date':
case 'date': case 'date':
gridRenderer = Tine.Tinebase.common.dateRenderer; gridRenderer = Tine.Tinebase.common.dateRenderer;
break; break;
case 'datetime': case 'datetime':
gridRenderer = Tine.Tinebase.common.dateTimeRenderer; gridRenderer = Tine.Tinebase.common.dateTimeRenderer;
break; break;
case 'time': case 'time':
gridRenderer = Tine.Tinebase.common.timeRenderer; gridRenderer = Tine.Tinebase.common.timeRenderer;
skipping to change at line 354 skipping to change at line 354
getFilter: function(fieldKey, filterconfig, modelConfig) { getFilter: function(fieldKey, filterconfig, modelConfig) {
// take field label if no filterlabel is defined // take field label if no filterlabel is defined
// TODO Refactor: tag and tags see ticket 0008944 // TODO Refactor: tag and tags see ticket 0008944
// TODO Remove this ugly hack! // TODO Remove this ugly hack!
if (fieldKey == 'tag') { if (fieldKey == 'tag') {
fieldKey = 'tags'; fieldKey = 'tags';
} }
var fieldconfig = modelConfig.fields[fieldKey]; var fieldconfig = modelConfig.fields[fieldKey];
if (fieldconfig && fieldconfig.type === 'virtual') { if (fieldconfig && fieldconfig.type === 'virtual') {
fieldconfig = fieldconfig.config; fieldconfig = fieldconfig.config || {};
} }
var appName = modelConfig.appName; var appName = modelConfig.appName;
var modelName = modelConfig.modelName; var modelName = modelConfig.modelName;
var app = Tine.Tinebase.appMgr.get(appName); var app = Tine.Tinebase.appMgr.get(appName);
if (! app) { if (! app) {
Tine.log.error('Application ' + appName + ' not found!'); Tine.log.error('Application ' + appName + ' not found!');
return null; return null;
} }
skipping to change at line 501 skipping to change at line 501
if (modelConfig.createModule) { if (modelConfig.createModule) {
contentTypes.push(modelConfig); contentTypes.push(modelConfig);
} }
// iterate record fields // iterate record fields
Ext.each(modelConfig.fieldKeys, function(key) { Ext.each(modelConfig.fieldKeys, function(key) {
var fieldDefinition = modelConfig.fields[key]; var fieldDefinition = modelConfig.fields[key];
if (fieldDefinition.type === 'virtual') { if (fieldDefinition.type === 'virtual') {
fieldDefinition = fieldDefinition.config; fieldDefinition = fieldDefinition.config || {};
} }
// add field to model array // add field to model array
modelArray.push(this.getField(fieldDefinition, key)); modelArray.push(this.getField(fieldDefinition, key));
if (fieldDefinition.label) { if (fieldDefinition.label) {
// register grid renderer // register grid renderer
if (initial) { if (initial) {
var renderer = null; var renderer = null;
try { try {
skipping to change at line 549 skipping to change at line 549
Tine[appName].Model[modelArrayName] = modelArray; Tine[appName].Model[modelArrayName] = modelArray;
// create model // create model
if (! Tine[appName].Model.hasOwnProperty(modelName)) { if (! Tine[appName].Model.hasOwnProperty(modelName)) {
Tine[appName].Model[modelName] = Tine.Tinebase.data.Reco rd.create(Tine[appName].Model[modelArrayName], Tine[appName].Model[modelName] = Tine.Tinebase.data.Reco rd.create(Tine[appName].Model[modelArrayName],
Ext.copyTo({modelConfiguration: modelConfig}, modelC onfig, Ext.copyTo({modelConfiguration: modelConfig}, modelC onfig,
'idProperty,defaultFilter,appName,modelName,recor dName,recordsName,titleProperty,' + 'idProperty,defaultFilter,appName,modelName,recor dName,recordsName,titleProperty,' +
'containerProperty,containerName,containersName, group,copyOmitFields,copyNoAppendTitle') 'containerProperty,containerName,containersName, group,copyOmitFields,copyNoAppendTitle')
); );
// called from legacy code - but all filters should come
from registy (see below)
Tine[appName].Model[modelName].getFilterModel = function
() { return [];};
// NOTE: no constructor, super magic here // NOTE: no constructor, super magic here
if (Tine[appName].Model.hasOwnProperty(modelName + 'Mixi n')) { if (Tine[appName].Model.hasOwnProperty(modelName + 'Mixi n')) {
Ext.override(Tine[appName].Model[modelName], Tine[ap pName].Model[modelName + 'Mixin']); Ext.override(Tine[appName].Model[modelName], Tine[ap pName].Model[modelName + 'Mixin']);
Ext.apply(Tine[appName].Model[modelName], _.get(Tine [appName].Model[modelName + 'Mixin'], 'statics', {})); Ext.apply(Tine[appName].Model[modelName], _.get(Tine [appName].Model[modelName + 'Mixin'], 'statics', {}));
} }
// called from legacy code - but all filters should come
from registy (see below)
Tine[appName].Model[modelName].getFilterModel = function
() { return [];};
} }
// register filters // register filters
Ext.iterate(modelConfig.filterModel, function(key, filter) { Ext.iterate(modelConfig.filterModel, function(key, filter) {
var f = this.getFilter(key, filter, modelConfig); var f = this.getFilter(key, filter, modelConfig);
if (f) { if (f) {
Tine.widgets.grid.FilterRegistry.register(appName, m odelName, f); Tine.widgets.grid.FilterRegistry.register(appName, m odelName, f);
} }
}, this); }, this);
// create recordProxy // create recordProxy
var recordProxyName = modelName.toLowerCase() + 'Backend'; var recordProxyName = modelName.toLowerCase() + 'Backend';
if (! Tine[appName].hasOwnProperty(recordProxyName)) { if (! Tine[appName].hasOwnProperty(recordProxyName)) {
Tine[appName][recordProxyName] = new Tine.Tinebase.data. RecordProxy({ Tine[appName][recordProxyName] = new Tine.Tinebase.data. RecordProxy({
appName: appName, appName: appName,
modelName: modelName, modelName: modelName,
recordClass: Tine[appName].Model[modelName] recordClass: Tine[appName].Model[modelName]
}); });
if (Tine[appName].hasOwnProperty([recordProxyName] + 'Mi
xin')) {
Ext.apply(Tine[appName][recordProxyName], Tine[appNa
me][recordProxyName + 'Mixin']);
Ext.apply(Tine[appName][recordProxyName], _.get(Tine
[appName][recordProxyName + 'Mixin'], 'statics', {}));
}
} }
if (recordProxyName === 'nodeBackend') return;
// if default data is empty, it will be resolved to an array // if default data is empty, it will be resolved to an array
if (Ext.isArray(modelConfig.defaultData)) { if (Ext.isArray(modelConfig.defaultData)) {
modelConfig.defaultData = {}; modelConfig.defaultData = {};
} }
// overwrite function // overwrite function
Tine[appName].Model[modelName].getDefaultData = function() { Tine[appName].Model[modelName].getDefaultData = function() {
if (! dd) { if (! dd) {
var dd = Ext.decode(Ext.encode(modelConfig.defaultDa ta)); var dd = Ext.decode(Ext.encode(modelConfig.defaultDa ta));
} }
 End of changes. 7 change blocks. 
8 lines changed or deleted 19 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)