Merge branch '2013.10' into 2014.11
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 11 Feb 2016 09:33:09 +0000 (10:33 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 11 Feb 2016 09:33:09 +0000 (10:33 +0100)
tine20/Calendar/Frontend/Json.php
tine20/Calendar/js/Model.js
tine20/Filemanager/js/NodeGridPanel.js

index 8413a67..1844288 100644 (file)
@@ -111,6 +111,7 @@ class Calendar_Frontend_Json extends Tinebase_Frontend_Json_Abstract
         try {
             $defaultCalendarArray = Tinebase_Container::getInstance()->getContainerById($defaultCalendarId)->toArray();
             $defaultCalendarArray['account_grants'] = Tinebase_Container::getInstance()->getGrantsOfAccount(Tinebase_Core::getUser(), $defaultCalendarId)->toArray();
+            $defaultCalendarArray['ownerContact'] = Addressbook_Controller_Contact::getInstance()->getContactByUserId($defaultCalendarArray['owner_id'])->toArray();
         } catch (Exception $e) {
             // remove default cal pref
             Tinebase_Core::getPreference('Calendar')->deleteUserPref(Calendar_Preference::DEFAULTCALENDAR);
index d539319..4809e6c 100644 (file)
@@ -185,7 +185,7 @@ Tine.Calendar.Model.Event.getDefaultData = function() {
         transp: 'OPAQUE',
         editGrant: true,
         organizer: organizer,
-        attendee: Tine.Calendar.Model.Event.getDefaultAttendee(organizer) /*[
+        attendee: Tine.Calendar.Model.Event.getDefaultAttendee(organizer, container) /*[
             Ext.apply(Tine.Calendar.Model.Attender.getDefaultData(), {
                 user_type: 'user',
                 user_id: Tine.Tinebase.registry.get('userContact'),
@@ -201,7 +201,7 @@ Tine.Calendar.Model.Event.getDefaultData = function() {
     return data;
 };
 
-Tine.Calendar.Model.Event.getDefaultAttendee = function(organizer) {
+Tine.Calendar.Model.Event.getDefaultAttendee = function(organizer, container) {
     var app = Tine.Tinebase.appMgr.get('Calendar'),
         mainScreen = app.getMainScreen(),
         centerPanel = mainScreen.getCenterPanel(),
@@ -252,24 +252,38 @@ Tine.Calendar.Model.Event.getDefaultAttendee = function(organizer) {
             
         case 'calendarOwner':
             var addedOwnerIds = [];
-            Ext.each(filteredContainers, function(container){
-                if (container.ownerContact) {
+            
+            Ext.each(filteredContainers, function(filteredContainer){
+                if (filteredContainer.ownerContact && filteredContainer.type && filteredContainer.type == 'personal') {
                     var attendeeData = Ext.apply(Tine.Calendar.Model.Attender.getDefaultData(), {
                         user_type: 'user',
-                        user_id: container.ownerContact
+                        user_id: filteredContainer.ownerContact
                     });
                     
                     if (attendeeData.user_id.id == organizer.id){
                         attendeeData.status = 'ACCEPTED';
                     }
-
-                    if (addedOwnerIds.indexOf(container.ownerContact.id) < 0) {
+                    
+                    if (addedOwnerIds.indexOf(filteredContainer.ownerContact.id) < 0) {
                         defaultAttendee.push(attendeeData);
-                        addedOwnerIds.push(container.ownerContact.id);
+                        addedOwnerIds.push(filteredContainer.ownerContact.id);
                     }
                 }
             }, this);
             
+            if (container.ownerContact && addedOwnerIds.indexOf(container.ownerContact.id) < 0) {
+                var attendeeData = Ext.apply(Tine.Calendar.Model.Attender.getDefaultData(), {
+                    user_type: 'user',
+                    user_id: container.ownerContact
+                });
+                
+                if (container.ownerContact.id == organizer.id){
+                    attendeeData.status = 'ACCEPTED';
+                }
+                
+                defaultAttendee.push(attendeeData);
+                addedOwnerIds.push(container.ownerContact.id);
+            }
             break;
     }
     
index f00cf7f..06444a8 100644 (file)
@@ -421,7 +421,7 @@ Tine.Filemanager.NodeGridPanel = Ext.extend(Tine.widgets.grid.GridPanel, {
             Ext.MessageBox.show({
                 title: selections[0].data.type == 'folder' ? this.app.i18n._('Folder has been published successfully') : this.app.i18n._('File has been published successfully'), 
                 msg: String.format(this.app.i18n._("Url: {0}") + '<br />' + this.app.i18n._("Valid Until: {1}"), record.get('url'), record.get('expiry_time')), 
-                width:900,
+                minWidth: 900,
                 buttons: Ext.Msg.OK,
                 icon: Ext.MessageBox.INFO,
                 scope: this