function changeDateAssign($termin_id, $resource_id='', $begin='', $end='', $check_only=FALSE, $check_locks = TRUE)
    {
        //load data from termin and assign object
        $query = "SELECT date, content, end_time, assign_id,
                         resources_assign.begin AS assign_begin,
                         resources_assign.end AS assign_end,
                         resources_assign.resource_id AS assign_resource_id
                  FROM termine
                  LEFT JOIN resources_assign ON (assign_user_id = termin_id)
                  WHERE termin_id = ?
                  ORDER BY date, content";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($termin_id));

        if ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
            if (!$begin) {
                $assign_id = $row['assign_id'];
                $begin     = $row['date'];
                $end       = $row['end_time'];
            } else if (!$end) {
                $end = $begin;
            }

            if (!$resource_id) {
                $resource_id = $row['assign_resource_id'];
            }

            $assign_begin       = $row['assign_begin'];
            $assign_end         = $row['assign_end'];
            $assign_resource_id = $row['assign_resource_id'];
        } else {
            return FALSE;
        }

        //check the saved assign-object-times against the planned times - if the same, no update is needed.
        if (($assign_begin == $begin) && ($assign_end == $end) && (($assign_resource_id == $resource_id))) {
            return TRUE;
        }
        if ((!$assign_id) && (!$check_only)) {
            $result = $this->insertDateAssign($termin_id, $resource_id);
        } else {
            $changeAssign = AssignObject::Factory($assign_id);
            if ($resource_id)
                $changeAssign->setResourceId($resource_id);
            else
                $resource_id = $changeAssign->getResourceId();

            $changeAssign->setBegin($begin);
            $changeAssign->setEnd($end);
            $changeAssign->setRepeatEnd($end);
            $changeAssign->setRepeatQuantity(0);
            $changeAssign->setRepeatInterval(0);
            $changeAssign->setRepeatMonthOfYear(0);
            $changeAssign->setRepeatDayOfMonth(0);
            $changeAssign->setRepeatWeekOfMonth(0);
            $changeAssign->setRepeatDayOfWeek(0);
            if (!$changeAssign->getId())
                $changeAssign->createId();

            //check if there are overlaps (resource isn't free!)
            if (!$this->dont_check)
                $overlaps = $changeAssign->checkOverlap($check_locks);

            if ($overlaps) {
                $result[$changeAssign->getId()]=array("overlap_assigns"=>$overlaps, "resource_id"=>$resource_id, "termin_id"=>$termin_id);
                $this->killDateAssign($termin_id);
            }

            if ((!$check_only) && (!$overlaps)) {
                $changeAssign->store();
                $result[$changeAssign->getId()]=array("overlap_assigns"=>FALSE, "resource_id"=>$resource_id, "termin_id"=>$termin_id);
                //Raumanfrage als bearbeitet markieren, wenn vorhanden
                if(get_config('RESOURCES_ALLOW_ROOM_REQUESTS')){
                    $request = new RoomRequest(getDateRoomRequest($termin_id));
                    if (!$request->isNew()){
                        $request->checkOpen(true);
                    }
                }
            }
        }
        return $result;
    }