Merge branch 'tine20.com/2012.10' into 2013.03
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 17 Apr 2013 17:17:35 +0000 (19:17 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 17 Apr 2013 17:17:35 +0000 (19:17 +0200)
Conflicts:
tine20/Calendar/Controller/Event.php

1  2 
tests/tine20/Calendar/Controller/RecurTest.php
tests/tine20/Calendar/JsonTests.php
tine20/Calendar/Backend/Sql.php
tine20/Calendar/Controller/Event.php
tine20/Calendar/Controller/EventNotifications.php

Simple merge
Simple merge
@@@ -1716,9 -1544,8 +1714,11 @@@ class Calendar_Controller_Event extend
          
          $userAccountId = $_attender->getUserAccountId();
          
-         if (    $_attender->user_type == Calendar_Model_Attender::USERTYPE_GROUP
-              || ( $userAccountId && $userAccountId != Tinebase_Core::getUser()->getId()) ) {
-             
+         // reset status if not a contact or my account
 -        if (! $preserveStatus && ($_attender->user_type != Calendar_Model_Attender::USERTYPE_USER || $userAccountId && $userAccountId != Tinebase_Core::getUser()->getId())) {
++        if (! $preserveStatus 
++            && ($_attender->user_type != Calendar_Model_Attender::USERTYPE_GROUP 
++                || $userAccountId && $userAccountId != Tinebase_Core::getUser()->getId()
++            )) {
              $_attender->status = Calendar_Model_Attender::STATUS_NEEDSACTION;
          }
          
          if ($_attender->user_type === Calendar_Model_Attender::USERTYPE_RESOURCE) {
              $resource = Calendar_Controller_Resource::getInstance()->get($_attender->user_id);
              $_attender->displaycontainer_id = $resource->container_id;
 +            
 +            // check if user is allowed to set status
 +            if (! Tinebase_Core::getUser()->hasGrant($_attender->displaycontainer_id, Tinebase_Model_Grants::GRANT_EDIT)) {
 +                $_attender->status = Calendar_Model_Attender::STATUS_NEEDSACTION;
 +            }
          }
+         
+         if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . " New attender: " . print_r($_attender->toArray(), TRUE));
+         
          $this->_backend->createAttendee($_attender);
      }