Merge branch 'pu/2013.03/modelconfig-hr'
authorPhilipp Schüle <p.schuele@metaways.de>
Tue, 13 Aug 2013 15:51:10 +0000 (17:51 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 13 Aug 2013 15:51:10 +0000 (17:51 +0200)
Conflicts:
tine20/Tinebase/js/ApplicationStarter.js
tine20/Tinebase/js/widgets/form/RecordPickerComboBox.js

tine20/Calendar/css/Calendar.css
tine20/Calendar/js/EventUI.js
tine20/Felamimail/js/RecipientPickerDialog.js
tine20/Tinebase/ModelConfiguration.php
tine20/Tinebase/js/ApplicationStarter.js
tine20/Tinebase/js/widgets/dialog/AttachmentsGridPanel.js
tine20/Tinebase/js/widgets/form/RecordPickerComboBox.js
tine20/Tinebase/js/widgets/grid/FileUploadGrid.js
tine20/Tinebase/js/widgets/grid/GridPanel.js
tine20/images/calendar-status-icons.gif

index 0b37907..6e0026c 100644 (file)
@@ -233,6 +233,8 @@ span.tw-containerselect-trigger2 img.tw-containerselect-trigger2-bg {
 .DECLINED-black     { background-position: -50px -10px; }
 .TENTATIVE-white    { background-position: -60px   0px; }
 .TENTATIVE-black    { background-position: -60px -10px; }
+.attachment-white   { background-position: -80px   0px; }
+.attachment-black   { background-position: -80px -10px; }
 
 .cal-status-TENTATIVE,
 .cal-status-TENTATIVE .x-grid3-cell-inner {
index b69ec47..3c78cb2 100644 (file)
@@ -257,6 +257,13 @@ Tine.Calendar.DaysViewEventUI = Ext.extend(Tine.Calendar.EventUI, {
             });
         }
         
+        if (! Ext.isEmpty(this.event.get('attachments'))) {
+            this.statusIcons.push({
+                status: 'attachment',
+                text: this.app.i18n._('has attachments')
+            });
+        }
+        
         var myAttenderRecord = this.event.getMyAttenderRecord(),
             myAttenderStatusRecord = myAttenderRecord ? Tine.Tinebase.widgets.keyfield.StoreMgr.get('Calendar', 'attendeeStatus').getById(myAttenderRecord.get('status')) : null;
             
index 5a3829c..1c300c9 100644 (file)
@@ -40,6 +40,7 @@ Ext.namespace('Tine.Felamimail');
     loadRecord: false,
     evalGrants: false,
     mode: 'local',
+    hideAttachmentsPanel: true,
     
     bodyStyle:'padding:0px',
     
index 22908c5..2bf9c2c 100644 (file)
@@ -697,8 +697,8 @@ class Tinebase_ModelConfiguration {
             }
 
             if ($fieldDef['type'] == 'virtual') {
-                $fieldDef['type'] = $fieldDef['config']['type'];
-                unset($fieldDef['config']['type']);
+                $fieldDef = $fieldDef['config'];
+                $fieldDef['sortable'] = FALSE;
                 $this->_virtualFields[] = $fieldDef;
                 continue;
             }
index eb50148..3ff9bea 100644 (file)
@@ -84,6 +84,7 @@ Tine.Tinebase.ApplicationStarter = {
                     fieldDefinition.config.modelName = fieldDefinition.config.modelName.replace(/_/, '');
                     field.type = fieldDefinition.config.appName + '.' + fieldDefinition.config.modelName;
                     break;
+                
             }
             // allow overwriting date pattern in model
             if (fieldDefinition.hasOwnProperty('dateFormat')) {
@@ -165,10 +166,19 @@ Tine.Tinebase.ApplicationStarter = {
                 case 'boolean':
                     gridRenderer = Tine.Tinebase.common.booleanRenderer;
                     break;
+                case 'relation':
+                    var cc = config.config;
+                    gridRenderer = new Tine.widgets.relation.GridRenderer({
+                        appName: appName,
+                        type: cc.type,
+                        foreignApp: cc.appName,
+                        foreignModel: cc.modelName
+                        });
+                    break;
                 default:
                     gridRenderer = Ext.util.Format.htmlEncode;
-                 }
-           }
+            }
+        }
         return gridRenderer;
     },
 
@@ -335,10 +345,15 @@ Tine.Tinebase.ApplicationStarter = {
                             // register grid renderer
                             if (initial) {
                                 var renderer = this.getGridRenderer(modelConfig.fields[key], key, appName, modelName);
-                                if (renderer) {
+                                
+                                if (Ext.isFunction(renderer)) {
                                     if (! Tine.widgets.grid.RendererManager.has(appName, modelName, key)) {
                                         Tine.widgets.grid.RendererManager.register(appName, modelName, key, renderer);
                                     }
+                                } else if (Ext.isObject(renderer)) {
+                                    if (! Tine.widgets.grid.RendererManager.has(appName, modelName, key)) {
+                                        Tine.widgets.grid.RendererManager.register(appName, modelName, key, renderer.render, null, renderer);
+                                    }
                                 }
                             }
                         }
index 77c670b..834d7f6 100644 (file)
@@ -61,6 +61,7 @@ Tine.widgets.dialog.AttachmentsGridPanel = Ext.extend(Tine.widgets.grid.FileUplo
         this.record = this.editDialog.record;
         this.app = this.editDialog.app;
         this.title = this.i18nTitle = _('Attachments');
+        this.i18nFileString = _('Attachment');
         
         Tine.widgets.dialog.MultipleEditDialogPlugin.prototype.registerSkipItem(this);
         
index 8b6808b..da6de7f 100644 (file)
@@ -97,6 +97,12 @@ Tine.Tinebase.widgets.form.RecordPickerComboBox = Ext.extend(Ext.ux.form.Clearab
     minChars: 3,
     forceSelection: true,
     
+    /**
+     * additional filters to use for each query
+     * @type {Array}
+     */
+    additionalFilters: null,
+    
     initComponent: function () {
         this.app = Tine.Tinebase.appMgr.get(this.recordClass.getMeta('appName'));
         this.displayField = this.recordClass.getMeta('titleProperty');
index 69ad9ce..7139ecc 100644 (file)
@@ -58,6 +58,8 @@ Tine.widgets.grid.FileUploadGrid = Ext.extend(Ext.grid.GridPanel, {
     autoExpandColumn: 'name',
     showProgress: true,
     
+    i18nFileString: null,
+    
     /**
      * init
      * @private
@@ -79,7 +81,7 @@ Tine.widgets.grid.FileUploadGrid = Ext.extend(Ext.grid.GridPanel, {
         this.initColumnModel();
         this.initSelectionModel();
         
-    
+        this.i18nFileString = _('File');
         this.plugins = [ new Ext.ux.grid.GridViewMenuPlugin({}) ];
         this.enableHdMenu = false;
       
@@ -175,7 +177,7 @@ Tine.widgets.grid.FileUploadGrid = Ext.extend(Ext.grid.GridPanel, {
         this.action_add = new Ext.Action(this.getAddAction());
 
         this.action_remove = new Ext.Action({
-            text: _('Remove file'),
+            text: String.format(_('Remove {0}'), this.i18nFileString),
             iconCls: 'action_remove',
             scope: this,
             disabled: true,
@@ -237,7 +239,7 @@ Tine.widgets.grid.FileUploadGrid = Ext.extend(Ext.grid.GridPanel, {
      */
     getAddAction: function () {
         return {
-            text: _('Add file'),
+            text: String.format(_('Add {0}'), this.i18nFileString),
             iconCls: 'action_add',
             scope: this,
             plugins: [{
index 32e3b31..a892a0e 100644 (file)
@@ -409,7 +409,7 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
                 if (fieldConfig.label) {
                     var config = {
                         id: key,
-                        dataIndex: key,
+                        dataIndex: (fieldConfig.type == 'relation') ? 'relations' : key,
                         header: this.app.i18n._(fieldConfig.label),
                         hidden: fieldConfig.hasOwnProperty('shy') ? fieldConfig.shy : false,    // defaults to false
                         sortable: (fieldConfig.hasOwnProperty('sortable') && fieldConfig.sortable == false) ? false : true // defaults to true
index 8c76788..fd59439 100644 (file)
Binary files a/tine20/images/calendar-status-icons.gif and b/tine20/images/calendar-status-icons.gif differ