Merge branch '2013.10' into 2014.09
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 3 Nov 2014 12:42:57 +0000 (13:42 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 3 Nov 2014 12:42:57 +0000 (13:42 +0100)
Conflicts:
tests/tine20/HumanResources/JsonTests.php

Change-Id: Icdff961efda42d56457f32463f73a409f943e280

1  2 
tests/tine20/HumanResources/JsonTests.php
tine20/HumanResources/Model/Employee.php
tine20/Tinebase/Convert/Json.php

@@@ -140,20 -152,22 +140,21 @@@ class HumanResources_JsonTests extends 
          
          $employee = $this->_json->saveEmployee($employee);
          
 +        $this->assertEquals(5, $employee['vacation'][0]['days_count']);
+         $this->assertEquals(17, count($employee['vacation'][0]));
          $this->assertEquals(3, count($employee['costcenters']));
          
 -        // 0009666: setting contract end_date fails
 -        // https://forge.tine20.org/mantisbt/view.php?id=9666
 -        
 -        $date = new Tinebase_DateTime($employee['contracts'][1]['end_date']);
 -        $date->addYear(1);
 -        
 -        $employee['contracts'][1]['end_date'] = $date;
 +        // @see: 0010050: Delete last dependent record fails
          
 +        // if the property is set to null, no dependent record handling will be done
 +        $employee['costcenters'] = NULL;
          $employee = $this->_json->saveEmployee($employee);
 +        $this->assertEquals(3, count($employee['costcenters']));
          
 -        $employee['contracts'][1]['end_date'] = $date->addMonth(1);
 -        
 +        // if the property is set to an empty array, all dependent records will be removed
 +        $employee['costcenters'] = array();
          $employee = $this->_json->saveEmployee($employee);
 +        $this->assertEquals(0, count($employee['costcenters']));
      }
      
      /**
Simple merge