Merge branch '2013.10'
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 29 Aug 2014 16:51:11 +0000 (18:51 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 29 Aug 2014 16:51:11 +0000 (18:51 +0200)
Conflicts:
tests/tine20/Calendar/TestCase.php
tine20/Calendar/css/daysviewpanel.css
tine20/Calendar/css/print.css
tine20/HumanResources/Frontend/Json.php
tine20/Tinebase/js/ux/Printer/print.css

Change-Id: Ib999a6a9c4f0a338a01b1785634da30b168f6756

14 files changed:
1  2 
tests/tine20/Calendar/Controller/ResourceTest.php
tests/tine20/Calendar/TestCase.php
tests/tine20/HumanResources/ControllerTests.php
tests/tine20/HumanResources/JsonTests.php
tine20/Calendar/css/daysviewpanel.css
tine20/Calendar/css/print.css
tine20/HumanResources/Frontend/Json.php
tine20/Setup/Update/Abstract.php
tine20/Tinebase/Container.php
tine20/Tinebase/Core.php
tine20/Tinebase/ImportExportDefinition.php
tine20/Tinebase/Setup/Initialize.php
tine20/Tinebase/js/ux/Printer/print.css
tine20/Tinebase/js/widgets/grid/GridPanel.js

@@@ -103,138 -117,6 +103,132 @@@ abstract class Calendar_TestCase extend
              Tinebase_Core::set(Tinebase_Core::USER, $this->_testUser);
          }
          
-             $this->_testCalendar = Tinebase_Container::getInstance()->addContainer(new Tinebase_Model_Container(array(
-                     'name'           => 'PHPUnit test calendar',
-                     'type'           => Tinebase_Model_Container::TYPE_PERSONAL,
-                     'owner_id'       => Tinebase_Core::getUser(),
-                     'backend'        => $this->_backend->getType(),
-                     'application_id' => Tinebase_Application::getInstance()->getApplicationByName('Calendar')->getId()
-             ), true));
 +        // do NOT unset _testUser,the tear down of Calendar_Frontend_WebDAV_EventTest still requires _testUser
 +        $this->_testUserContact = NULL;
 +        $this->_testCalendar = NULL;
 +        $this->_testCalendars = NULL;
 +        $this->_personas = NULL;
 +        $this->_personasContacts = array();
 +        $this->_personasDefaultCals = array();
 +    }
 +    
 +    /**
 +     * returns test persons contacts
 +     * 
 +     * @param string $loginName
 +     * @return Addressbook_Model_Contact
 +     */
 +    protected function _getPersonasContacts($loginName)
 +    {
 +        if (!isset($this->_personasContacts[$loginName])) {
 +            $user = $this->_getPersona($loginName);
 +            $this->_personasContacts[$loginName] = Addressbook_Controller_Contact::getInstance()->getContactByUserId($user->getId());
 +        }
 +        return $this->_personasContacts[$loginName];
 +    }
 +    
 +    /**
 +     * returns test persons default calendar
 +     * 
 +     * @param string $loginName
 +     * @return Tinebase_Model_Container
 +     */
 +    protected function _getPersonasDefaultCals($loginName)
 +    {
 +        if (!isset($this->_personasDefaultCals[$loginName])) {
 +            $user = $this->_getPersona($loginName);
 +            $defaultCalendarId = Tinebase_Core::getPreference('Calendar')->getValueForUser(Calendar_Preference::DEFAULTCALENDAR, $user->getId());
 +            $this->_personasDefaultCals[$loginName] = Tinebase_Container::getInstance()->getContainerById($defaultCalendarId);
 +        }
 +        return $this->_personasDefaultCals[$loginName];
 +    }
 +    
 +    /**
 +     * returns all test persons default calendar
 +     * 
 +     * @return array
 +     */
 +    protected function _getAllPersonasDefaultCals()
 +    {
 +        foreach ($this->_getPersonas() as $loginName => $user)
 +        {
 +            $this->_getPersonasDefaultCals($loginName);
 +        }
 +        return $this->_personasDefaultCals;
 +    }
 +    
 +    /** return a test person
 +     * @return 
 +     */
 +    protected function _getPersona($loginName)
 +    {
 +        if ($this->_personas === NULL) {
 +            $this->_getPersonas();
 +        }
 +        return $this->_personas[$loginName];
 +    }
 +    
 +    /**
 +     * returns an array of test persons
 +     * 
 +     * @return array
 +     */
 +    protected function _getPersonas()
 +    {
 +        if ($this->_personas === NULL) {
 +            $this->_personas = Zend_Registry::get('personas');
 +        }
 +        return $this->_personas;
 +    }
 +    
 +    /**
 +     * returns a test user
 +     * 
 +     * @return Tinebase_Model_FullUser
 +     */
 +    protected function _getTestUser()
 +    {
 +        return $this->_testUser;
 +    }
 +    
 +    /**
 +     * returns the test users contact
 +     * 
 +     * @return
 +     */
 +    protected function _getTestUserContact()
 +    {
 +        if ($this->_testUserContact === NULL) {
 +            $this->_testUserContact = Addressbook_Controller_Contact::getInstance()->getContactByUserId($this->_getTestUser()->getId());
 +        }
 +        return $this->_testUserContact;
 +    }
 +    /**
 +     * returns a test calendar set
 +     * 
 +     * @return Tinebase_Record_RecordSet\r
 +     */
 +    protected function _getTestCalendars()
 +    {
 +        if ($this->_testCalendars === NULL) {
 +            $this->_getTestCalendar();
 +        }
 +        return $this->_testCalendars;
 +    }
 +    /**
 +     * returns a test calendar
 +     * 
 +     * @return Tinebase_Model_Container
 +     */
 +    protected function _getTestCalendar()
 +    {
 +        if ($this->_testCalendar === NULL) {
++            $this->_testCalendar = $this->_getTestContainer('Calendar');
 +            
 +            $this->_testCalendars = new Tinebase_Record_RecordSet('Tinebase_Model_Container');
 +            $this->_testCalendars->addRecord($this->_testCalendar);
 +        }
 +        return $this->_testCalendar;
      }
      
      /**
Simple merge
@@@ -32,9 -32,15 +32,15 @@@ table td 
      display: none;
  }
  
+ div.page
+ {
+     page-break-after: always;
+     page-break-inside: avoid;
+ }
  .cal-print-title {
 -      text-align: center;
 -      font-size: 20px;
 +    text-align: center;
 +    font-size: 20px;
  }
  
  .cal-print-daysview-day td {
  
  .cal-print-monthview .cal-print-daysview-day-untilseperator,
  .cal-print-monthview .cal-print-daysview-day-endtime {
- }
++<<<<<<< HEAD
 +    display: none;
++}
++=======
+       display: none;
+ }
++>>>>>>> 2013.10
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -27,5 -27,11 +27,11 @@@ table td 
  }
  
  #csscheck {
-     display: none;
+   display: none;
+ }
+ div.page
+ {
+   page-break-after: always;
+   page-break-inside: avoid;
 -}
 +}