/**
  * This function is called whenever a "save" for a new floor plan is
  * initiated.
  */
 public function saveObject()
 {
     if (!$this->permission->checkPrivilege(PRIVC::ADD_FLOORPLANS)) {
         ilUtil::sendFailure($this->lng->txt("rep_robj_xrs_no_permission_for_action"));
         $this->ctrl->redirectByClass('ilinfoscreengui', 'showSummary', 'showSummary');
         return false;
     }
     $form = $this->initForm();
     if ($form->checkInput()) {
         $fplan = new ilRoomSharingFloorPlans($this->pool_id, new ilRoomsharingDatabase($this->pool_id));
         $title_new = $form->getInput("title");
         $desc_new = $form->getInput("description");
         $file_new = $form->getInput("upload_file");
         try {
             $fplan->addFloorPlan($title_new, $desc_new, $file_new);
             ilUtil::sendSuccess($this->lng->txt("rep_robj_xrs_floor_plans_added"), true);
             $this->renderObject();
         } catch (ilRoomSharingFloorplanException $exc) {
             ilUtil::sendFailure($this->lng->txt($exc->getMessage()), true);
             $this->resetView($form);
         }
     } else {
         $this->resetView($form);
     }
 }
 /**
  * @covers ilRoomSharingFloorPlans::addFloorPlan
  * @expectedException ilRoomSharingFloorplanException
  * @expectedExceptionMessage rep_robj_xrs_floor_plans_upload_error
  */
 public function testAddFloorPlanEmptyFile()
 {
     $this->prepareAddFloorPlan();
     $newfile = array("format" => "image/bmp", "filename" => "NewFloorplan", "size" => 0);
     self::$floorPlans->addFloorPlan("Videossas", "Newest plan", $newfile);
 }