"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tine20/Tinebase/js/widgets/grid/ForeignRecordFilter.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.

ForeignRecordFilter.js  (tine20-2020.08.3):ForeignRecordFilter.js  (tine20-2020.08.4)
skipping to change at line 131 skipping to change at line 131
var operators = []; var operators = [];
// linkType relations automatic list // linkType relations automatic list
if (this.ownRecordClass.hasField('relations')) { if (this.ownRecordClass.hasField('relations')) {
var operators = []; var operators = [];
Ext.each(Tine.widgets.relation.Manager.get(this.app, this.ownRecordC lass, this.ignoreRelatedModels), function(relation) { Ext.each(Tine.widgets.relation.Manager.get(this.app, this.ownRecordC lass, this.ignoreRelatedModels), function(relation) {
if (Tine.Tinebase.common.hasRight('run', relation.relatedApp)) { if (Tine.Tinebase.common.hasRight('run', relation.relatedApp)) {
// TODO: leave label as it is? // TODO: leave label as it is?
var label = relation.text.replace(/ \(.+\)/,''); var label = relation.text.replace(/ \(.+\)/,'');
operators.push({operator: {linkType: 'relation', foreignReco rdClass: Tine.Tinebase.common.resolveModel(relation.relatedModel, relation.relat edApp)}, label: label}); operators.push({operator: {linkType: 'relation', foreignReco rdClass: Tine.Tinebase.data.RecordMgr.get(relation.relatedApp, relation.relatedM odel)}, label: label});
} }
}, this); }, this);
} }
// get operators from registry // get operators from registry
Ext.each(Tine.widgets.grid.ForeignRecordFilter.OperatorRegistry.get(this .ownRecordClass), function(def) { Ext.each(Tine.widgets.grid.ForeignRecordFilter.OperatorRegistry.get(this .ownRecordClass), function(def) {
// translate label // translate label
var foreignRecordClass = Tine.Tinebase.data.RecordMgr.get(def.foreig nRecordClass), var foreignRecordClass = Tine.Tinebase.data.RecordMgr.get(def.foreig nRecordClass),
appName = foreignRecordClass.getMeta('appName'), appName = foreignRecordClass.getMeta('appName'),
app = Tine.Tinebase.appMgr.get(appName), app = Tine.Tinebase.appMgr.get(appName),
label = app ? app.i18n._hidden(def.label) : def.label; label = app ? app.i18n._hidden(def.label) : def.label;
skipping to change at line 223 skipping to change at line 223
*/ */
onDefineRelatedRecord: function(filter) { onDefineRelatedRecord: function(filter) {
Tine.log.debug('Tine.widgets.grid.ForeignRecordFilter::onDefineRelatedRe cord() - filter:'); Tine.log.debug('Tine.widgets.grid.ForeignRecordFilter::onDefineRelatedRe cord() - filter:');
Tine.log.debug(filter); Tine.log.debug(filter);
if (! filter.toolbar) { if (! filter.toolbar) {
this.createRelatedRecordToolbar(filter); this.createRelatedRecordToolbar(filter);
} }
this.ftb.setActiveSheet(filter.toolbar); this.ftb.setActiveSheet(filter.toolbar);
filter.formFields.value.setText((this.editDefinitionText)); filter.formFields.value.setText(window.i18n._(this.editDefinitionText));
}, },
/** /**
* get related record value data * get related record value data
* *
* NOTE: generic filters have their foreign record definition in the values * NOTE: generic filters have their foreign record definition in the values
*/ */
getRelatedRecordValue: function(filter) { getRelatedRecordValue: function(filter) {
var _ = window.lodash, var _ = window.lodash,
me = this, me = this,
skipping to change at line 330 skipping to change at line 330
// set all content on childToolbar // set all content on childToolbar
if (Ext.isObject(filter.foreignRecordDefinition) && value && Ext.isA rray(value.filters) && value.filters.length) { if (Ext.isObject(filter.foreignRecordDefinition) && value && Ext.isA rray(value.filters) && value.filters.length) {
if (! filter.toolbar) { if (! filter.toolbar) {
this.createRelatedRecordToolbar(filter); this.createRelatedRecordToolbar(filter);
} }
filter.toolbar.setValue(value.filters); filter.toolbar.setValue(value.filters);
// change button text // change button text
if (filter.formFields.value && Ext.isFunction(filter.formFields. value.setText)) { if (filter.formFields.value && Ext.isFunction(filter.formFields. value.setText)) {
filter.formFields.value.setText(i18n._(this.editDefinitionTe xt)); filter.formFields.value.setText(window.i18n._(this.editDefin itionText));
} }
} }
} else { } else {
if (! Ext.isArray(value)) return; if (! Ext.isArray(value)) return;
// explicit chose right operator /equals / in /definedBy: left sided values create (multiple) subfilters in filterToolbar // explicit chose right operator /equals / in /definedBy: left sided values create (multiple) subfilters in filterToolbar
var foreignRecordDefinition = filter.foreignRecordDefinition, var foreignRecordDefinition = filter.foreignRecordDefinition,
foreignRecordClass = foreignRecordDefinition.foreignRecordClass, foreignRecordClass = foreignRecordDefinition.foreignRecordClass,
foreignRecordIdProperty = me.foreignRefIdField || foreignRecordC lass.getMeta('idProperty'), foreignRecordIdProperty = me.foreignRefIdField || foreignRecordC lass.getMeta('idProperty'),
skipping to change at line 619 skipping to change at line 619
value = Tine.widgets.grid.FilterModel.prototype.valueRendere r.call(me, filter, el); value = Tine.widgets.grid.FilterModel.prototype.valueRendere r.call(me, filter, el);
_.assign(me, backup); _.assign(me, backup);
value.origSetValue = value.setValue.createDelegate(value); value.origSetValue = value.setValue.createDelegate(value);
} else { } else {
this.setRelatedRecordValue(filter); this.setRelatedRecordValue(filter);
if (!filter.formFields.value) { if (!filter.formFields.value) {
value = new Ext.Button({ value = new Ext.Button({
text: i18n._(this.startDefinitionText), text: i18n._(this.startDefinitionText),
width: el.getWidth() -10,
filter: filter, filter: filter,
renderTo: el, renderTo: el,
handler: this.onDefineRelatedRecord.createDelegate(t his, [filter]), handler: this.onDefineRelatedRecord.createDelegate(t his, [filter]),
scope: this scope: this
}); });
// show button // show button
el.addClass('x-btn-over'); el.addClass('x-btn-over');
// change text if setRelatedRecordValue had child filter s // change text if setRelatedRecordValue had child filter s
if (filter.toolbar) { if (filter.toolbar) {
value.setText((this.editDefinitionText)); value.setText(window.i18n._(this.editDefinitionText) );
} }
} else { } else {
value = filter.formFields.value; value = filter.formFields.value;
} }
} }
break; break;
} }
value.setValue = this.setRelatedRecordValue.createDelegate(this, [filter ], 0); value.setValue = this.setRelatedRecordValue.createDelegate(this, [filter ], 0);
 End of changes. 5 change blocks. 
4 lines changed or deleted 5 lines changed or added

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