private function wrapperTestMoveUploadToInfinity($uploadId, $order = 'DESC') { $this->testDb->getDbManager()->insertTableRow('upload_clearing', array('upload_fk' => 1, 'group_fk' => $this->groupId, UploadBrowseProxy::PRIO_COLUMN => 1)); $this->testDb->getDbManager()->insertTableRow('upload_clearing', array('upload_fk' => 2, 'group_fk' => $this->groupId, UploadBrowseProxy::PRIO_COLUMN => 2)); $uploadBrowseProxy = new UploadBrowseProxy($this->groupId, UserDao::USER, $this->testDb->getDbManager()); $uploadBrowseProxy->moveUploadToInfinity($uploadId, 'DESC' == $order); $updatedRow = $this->testDb->getDbManager()->getSingleRow('SELECT upload_fk FROM upload_clearing WHERE group_fk=$1 ORDER BY ' . UploadBrowseProxy::PRIO_COLUMN . " {$order} LIMIT 1", array($this->groupId)); assertThat($updatedRow['upload_fk'], equalTo($uploadId)); }
/** * @brief Display the loaded menu and plugins. */ protected function handle(Request $request) { $groupId = Auth::getGroupId(); $gup = $this->dbManager->getSingleRow('SELECT group_perm FROM group_user_member WHERE user_fk=$1 AND group_fk=$2', array(Auth::getUserId(), $groupId), __METHOD__ . '.user_perm'); if (!$gup) { throw new \Exception('You are assigned to wrong group.'); } $this->userPerm = $gup['group_perm']; $uploadId = intval($request->get('uploadId')); if ($uploadId && !$this->uploadDao->isAccessible($uploadId, $groupId)) { throw new \Exception('You cannot access to this upload'); } $columnName = $request->get('columnName'); $statusId = intval($request->get('statusId')); $value = intval($request->get('value')); $moveUpload = intval($request->get("move")); $beyondUpload = intval($request->get("beyond")); $commentText = $request->get('commentText'); $direction = $request->get('direction'); if (!empty($columnName) && !empty($uploadId) && !empty($value)) { $uploadBrowseProxy = new UploadBrowseProxy($groupId, $this->userPerm, $this->dbManager); $uploadBrowseProxy->updateTable($columnName, $uploadId, $value); } else { if (!empty($moveUpload) && !empty($beyondUpload)) { $uploadBrowseProxy = new UploadBrowseProxy($groupId, $this->userPerm, $this->dbManager); $uploadBrowseProxy->moveUploadBeyond($moveUpload, $beyondUpload); } else { if (!empty($uploadId) && !empty($direction)) { $uploadBrowseProxy = new UploadBrowseProxy($groupId, $this->userPerm, $this->dbManager); $uploadBrowseProxy->moveUploadToInfinity($uploadId, $direction == 'top'); } else { if (!empty($uploadId) && !empty($commentText) && !empty($statusId)) { $uploadBrowseProxy = new UploadBrowseProxy($groupId, $this->userPerm, $this->dbManager); $uploadBrowseProxy->setStatusAndComment($uploadId, $statusId, $commentText); } else { return $this->respondFolderGetTableData($request); } } } } return new Response(''); }