/** * Turnon cron. * * @access public * @return void */ public function turnon($confirm = 'no') { $turnon = empty($this->config->global->cron) ? 1 : 0; if (!$turnon and $confirm == 'no') { die(js::confirm($this->lang->cron->confirmTurnon, inlink('turnon', "confirm=yes")) . js::reload('parent')); } $this->loadModel('setting')->setItem('system.sys.common.global.cron', $turnon); die(js::reload('parent')); }
/** * Delete a department. * * @param int $deptID * @param string $confirm yes|no * @access public * @return void */ public function delete($deptID, $confirm = 'no') { if ($confirm == 'no') { echo js::confirm($this->lang->dept->confirmDelete, $this->createLink('dept', 'delete', "deptID={$deptID}&confirm=yes")); exit; } else { $this->dept->delete($deptID); die(js::reload('parent')); } }
/** * Finish a todo. * * @param int $todoID * @access public * @return void */ public function finish($todoID) { $todo = $this->todo->getById($todoID); if ($todo->status != 'done') { $this->todo->finish($todoID); } if ($todo->type == 'bug' or $todo->type == 'task') { $confirmNote = 'confirm' . ucfirst($todo->type); $confirmURL = $this->createLink($todo->type, 'view', "id={$todo->idvalue}"); $cancelURL = $this->server->HTTP_REFERER; die(js::confirm(sprintf($this->lang->todo->{$confirmNote}, $todo->idvalue), $confirmURL, $cancelURL, 'parent', 'parent')); } if (isonlybody()) { die(js::reload('parent.parent')); } die(js::reload('parent')); }
/** * Delete a release. * * @param int $releaseID * @param string $confirm yes|no * @access public * @return void */ public function delete($releaseID, $confirm = 'no') { if ($confirm == 'no') { die(js::confirm($this->lang->release->confirmDelete, $this->createLink('release', 'delete', "releaseID={$releaseID}&confirm=yes"))); } else { $this->release->delete(TABLE_RELEASE, $releaseID); /* if ajax request, send result. */ if ($this->server->ajax) { if (dao::isError()) { $response['result'] = 'fail'; $response['message'] = dao::getError(); } else { $response['result'] = 'success'; $response['message'] = ''; } $this->send($response); } die(js::locate($this->session->releaseList, 'parent')); } }
/** * Restore the default lang. Delete the related items. * * @param string $module * @param string $field * @param string $confirm * @access public * @return void */ public function restore($module, $field, $confirm = 'no') { if ($confirm == 'no') { die(js::confirm($this->lang->custom->confirmRestore, inlink('restore', "module={$module}&field={$field}&confirm=yes"))); } $this->custom->deleteItems("module={$module}§ion={$field}"); die(js::reload('parent')); }
/** * Unlink a story. * * @param int $projectID * @param int $storyID * @param string $confirm yes|no * @access public * @return void */ public function unlinkStory($projectID, $storyID, $confirm = 'no') { if ($confirm == 'no') { echo js::confirm($this->lang->project->confirmUnlinkStory, $this->createLink('project', 'unlinkstory', "projectID={$projectID}&storyID={$storyID}&confirm=yes")); exit; } else { $this->project->unlinkStory($projectID, $storyID); echo js::locate($this->app->session->storyList, 'parent'); exit; } }
/** * Delete a group. * * @param int $groupID * @param string $confirm yes|no * @access public * @return void */ public function delete($groupID, $confirm = 'no') { if ($confirm == 'no') { die(js::confirm($this->lang->group->confirmDelete, $this->createLink('group', 'delete', "groupID={$groupID}&confirm=yes"))); } else { $this->group->delete($groupID); die(js::locate($this->createLink('group', 'browse'), 'parent')); } }
/** * Delete a file. * * @param int $fileID * @param string $confirm yes|no * @access public * @return void */ public function delete($fileID, $confirm = 'no') { if ($confirm == 'no') { die(js::confirm($this->lang->file->confirmDelete, inlink('delete', "fileID={$fileID}&confirm=yes"))); } else { $file = $this->file->getById($fileID); $this->dao->delete()->from(TABLE_FILE)->where('id')->eq($fileID)->exec(); $this->loadModel('action')->create($file->objectType, $file->objectID, 'deletedFile', '', $extra = $file->title); @unlink($file->realPath); die(js::reload('parent')); } }
/** * Delete a department. * * @param int $deptID * @param string $confirm yes|no * @access public * @return void */ public function delete($deptID, $confirm = 'no') { /* Check this dept when delete. */ $sons = $this->dept->getSons($deptID); $users = $this->dept->getUsers($deptID); if ($sons) { die(js::alert($this->lang->dept->error->hasSons)); } if ($users) { die(js::alert($this->lang->dept->error->hasUsers)); } if ($confirm == 'no') { die(js::confirm($this->lang->dept->confirmDelete, $this->createLink('dept', 'delete', "deptID={$deptID}&confirm=yes"))); } else { $this->dept->delete($deptID); die(js::reload('parent')); } }
public function reviewdelete($sprintID = 0, $confirm = 'no') { if ($confirm == 'no') { die(js::confirm("确定删除这个回顾会吗", inlink('reviewdelete', "sprintID={$sprintID}&confirm=yes"), inlink('review', "sprintID={$sprintID}"))); } else { $this->sprint->deleteReview($sprintID); die(js::locate($this->createLink('sprint', 'review', "projectID={$sprintID}"), 'parent')); } $this->display(); }
/** * Delete cron. * * @param int $cronID * @param string $confirm * @access public * @return void */ public function delete($cronID, $confirm = 'no') { if ($confirm == 'no') { die(js::confirm($this->lang->cron->confirmDelete, inlink('delete', "cronID={$cronID}&confirm=yes"))); } $this->dao->delete()->from(TABLE_CRON)->where('id')->eq($cronID)->exec(); die(js::reload('parent')); }
/** * Batch delete mail queue. * * @param string $confirm * @access public * @return void */ public function batchDelete($confirm = 'no') { if ($confirm == 'no') { if (empty($_POST)) { die(js::reload('parent')); } $idList = join('|', $this->post->mailIDList); die(js::confirm($this->lang->mail->confirmDelete, inlink('batchDelete', "confirm=yes") . ($this->config->requestType == 'GET' ? '&' : '?') . "idList={$idList}")); } $idList = array(); if (isset($_GET['idList'])) { $idList = explode('|', $_GET['idList']); } if ($idList) { $this->dao->delete()->from(TABLE_MAILQUEUE)->where('id')->in($idList)->exec(); } die(js::reload('parent')); }
/** * Hide all deleted objects. * * @param string $confirm * @access public * @return void */ public function hideAll($confirm = 'no') { if ($confirm == 'no') { die(js::confirm($this->lang->action->confirmHideAll, inlink('hideAll', "confirm=yes"))); } else { $this->action->hideAll(); die(js::reload('parent')); } }
/** * Delete a module. * * @param int $rootID * @param int $moduleID * @param string $confirm yes|no * @access public * @return void */ public function delete($rootID, $moduleID, $confirm = 'no') { if ($confirm == 'no') { die(js::confirm($this->lang->tree->confirmDelete, $this->createLink('tree', 'delete', "rootID={$rootID}&moduleID={$moduleID}&confirm=yes"))); } else { $result = $this->tree->delete($moduleID); if (!$result) { die; } die(js::reload('parent')); } }
/** * Delete a user. * * @param int $userID * @param string $confirm yes|no * @access public * @return void */ public function delete($userID, $confirm = 'no') { if ($confirm == 'no') { die(js::confirm($this->lang->user->confirmDelete, $this->createLink('user', 'delete', "userID={$userID}&confirm=yes"))); } else { $this->user->delete(TABLE_USER, $userID); die(js::locate($this->createLink('company', 'browse'), 'parent')); } }
/** * Delete a test task. * * @param int $taskID * @param string $confirm yes|no * @access public * @return void */ public function delete($taskID, $confirm = 'no') { if ($confirm == 'no') { die(js::confirm($this->lang->testtask->confirmDelete, inlink('delete', "taskID={$taskID}&confirm=yes"))); } else { $task = $this->testtask->getByID($taskID); $this->testtask->delete(TABLE_TESTTASK, $taskID); die(js::locate(inlink('browse', "product={$task->product}"), 'parent')); } }
/** * Delete a build. * * @param int $buildID * @param string $confirm yes|noe * @access public * @return void */ public function delete($buildID, $confirm = 'no') { if ($confirm == 'no') { die(js::confirm($this->lang->build->confirmDelete, $this->createLink('build', 'delete', "buildID={$buildID}&confirm=yes"))); } else { $build = $this->build->getById($buildID); $this->build->delete(TABLE_BUILD, $buildID); die(js::locate($this->createLink('project', 'build', "projectID={$build->project}"), 'parent')); } }
/** * Confirm clear data. * * @param string $confirm ''|no|yes * @access public * @return void */ public function clearData($confirm = '') { if ($confirm == 'no') { die(js::confirm($this->lang->admin->confirmClearData, inlink('clearData', "confirm=yes"))); } elseif ($confirm == 'yes') { $result = $this->admin->clearData(); if (!$result) { die(js::alert($this->lang->admin->clearDataFailed)); } js::alert($this->lang->admin->clearDataSuccessfully); die(js::locate(inLink('index'), 'parent')); } $this->display(); }
/** * Delete a bug. * * @param int $bugID * @param string $confirm yes|no * @access public * @return void */ public function delete($bugID, $confirm = 'no') { $bug = $this->bug->getById($bugID); if ($confirm == 'no') { die(js::confirm($this->lang->bug->confirmDelete, inlink('delete', "bugID={$bugID}&confirm=yes"))); } else { $this->bug->delete(TABLE_BUG, $bugID); if ($bug->toTask != 0) { echo js::alert($this->lang->bug->remindTask . $bug->toTask); } die(js::locate($this->session->bugList, 'parent')); } }
/** * Remove a case from test task. * * @param int $rowID * @access public * @return void */ public function unlinkCase($rowID, $confirm = 'no') { if ($confirm == 'no') { die(js::confirm($this->lang->testtask->confirmUnlinkCase, $this->createLink('testtask', 'unlinkCase', "rowID={$rowID}&confirm=yes"))); } else { $response['result'] = 'success'; $response['message'] = ''; $this->dao->delete()->from(TABLE_TESTRUN)->where('id')->eq((int) $rowID)->exec(); if (dao::isError()) { $response['result'] = 'fail'; $response['message'] = dao::getError(); } $this->send($response); } }
/** * Delete a task. * * @param int $projectID * @param int $taskID * @param string $confirm yes|no * @access public * @return void */ public function delete($projectID, $taskID, $confirm = 'no') { $task = $this->task->getById($taskID); if ($confirm == 'no') { die(js::confirm($this->lang->task->confirmDelete, inlink('delete', "projectID={$projectID}&taskID={$taskID}&confirm=yes"))); } else { $story = $this->dao->select('story')->from(TABLE_TASK)->where('id')->eq($taskID)->fetch('story'); $this->task->delete(TABLE_TASK, $taskID); if ($task->fromBug != 0) { $this->dao->update(TABLE_BUG)->set('toTask')->eq(0)->where('id')->eq($task->fromBug)->exec(); } if ($story) { $this->loadModel('story')->setStage($story); } die(js::locate($this->session->taskList, 'parent')); } }
/** * Delete a story. * * @param int $sqlID * @param string $confirm yes|no * @access public * @return void */ public function delete($sqlID, $confirm = 'no') { if ($confirm == 'no') { echo js::confirm($this->lang->sqlreview->confirmDelete, $this->createLink('sqlreview', 'delete', "sql={$sqlID}&confirm=yes"), ''); exit; } else { $this->sqlreview->delete(TABLE_SQLREVIEW, $sqlID); die(js::locate($this->session->storyList, 'parent')); } }
/** * Delete a contact list. * * @param int $listID * @param string $confirm * @access public * @return void */ public function deleteContacts($listID, $confirm = 'no') { if ($confirm == 'no') { echo js::confirm($this->lang->user->contacts->confirmDelete, inlink('deleteContacts', "listID={$listID}&confirm=yes")); exit; } else { $this->user->deleteContactList($listID); echo js::locate(inlink('manageContacts'), 'parent'); exit; } }
/** * Delete * * @param string $fileName * @param string $confirm * @access public * @return void */ public function delete($fileName, $confirm = 'no') { if ($confirm == 'no') { die(js::confirm($this->lang->backup->confirmDelete, inlink('delete', "fileName={$fileName}&confirm=yes"))); } /* Delete database file. */ if (file_exists($this->backupPath . $fileName . '.sql.php') and !unlink($this->backupPath . $fileName . '.sql.php')) { die(js::alert(sprintf($this->lang->backup->error->noDelete, $this->backupPath . $fileName . '.sql.php'))); } /* Delete attatchments file. */ if (file_exists($this->backupPath . $fileName . '.file.zip.php') and !unlink($this->backupPath . $fileName . '.file.zip.php')) { die(js::alert(sprintf($this->lang->backup->error->noDelete, $this->backupPath . $fileName . '.file.zip.php'))); } die(js::reload('parent')); }
/** * Delete a product. * * @param int $productID * @param string $confirm yes|no * @access public * @return void */ public function delete($productID, $confirm = 'no') { if ($confirm == 'no') { die(js::confirm($this->lang->product->confirmDelete, $this->createLink('product', 'delete', "productID={$productID}&confirm=yes"))); } else { $this->product->delete(TABLE_PRODUCT, $productID); $this->session->set('product', ''); // 清除session。 die(js::locate($this->createLink('product', 'browse'), 'parent')); } }
/** * Confirm clear data. * * @param string $confirm ''|no|yes * @access public * @return void */ public function clearData($confirm = '') { if ($confirm == '') { $this->display(); } if ($confirm == 'no') { die(js::confirm($this->lang->admin->confirmClearData, inlink('clearData', "confirm=yes"))); } elseif ($confirm == 'yes') { $result = $this->admin->clearData(); if ($result) { die(js::alert($this->lang->admin->clearDataSucceed)); } die(js::alert($this->lang->admin->clearDataFailed)); } }
/** * Delete a story. * * @param int $storyID * @param string $confirm yes|no * @access public * @return void */ public function delete($storyID, $confirm = 'no') { if ($confirm == 'no') { echo js::confirm($this->lang->story->confirmDelete, $this->createLink('story', 'delete', "story={$storyID}&confirm=yes"), ''); exit; } else { $this->story->delete(TABLE_STORY, $storyID); die(js::locate($this->session->storyList, 'parent')); } }
/** * Delete a test case * * @param int $caseID * @param string $confirm yes|noe * @access public * @return void */ public function delete($caseID, $confirm = 'no') { if ($confirm == 'no') { die(js::confirm($this->lang->testcase->confirmDelete, inlink('delete', "caseID={$caseID}&confirm=yes"))); } else { $this->testcase->delete(TABLE_CASE, $caseID); die(js::locate($this->session->caseList, 'parent')); } }
/** * Unlink a story. * * @param int $projectID * @param int $storyID * @param string $confirm yes|no * @access public * @return void */ public function unlinkStory($projectID, $storyID, $confirm = 'no') { if ($confirm == 'no') { echo js::confirm($this->lang->project->confirmUnlinkStory, $this->createLink('project', 'unlinkstory', "projectID={$projectID}&storyID={$storyID}&confirm=yes")); exit; } else { $this->project->unlinkStory($projectID, $storyID); /* if ajax request, send result. */ if ($this->server->ajax) { if (dao::isError()) { $response['result'] = 'fail'; $response['message'] = dao::getError(); } else { $response['result'] = 'success'; $response['message'] = ''; } $this->send($response); } echo js::locate($this->app->session->storyList, 'parent'); exit; } }
/** * Delete a build. * * @param int $buildID * @param string $confirm yes|noe * @access public * @return void */ public function delete($buildID, $confirm = 'no') { if ($confirm == 'no') { die(js::confirm($this->lang->build->confirmDelete, $this->createLink('build', 'delete', "buildID={$buildID}&confirm=yes"))); } else { $build = $this->build->getById($buildID); $this->build->delete(TABLE_BUILD, $buildID); /* if ajax request, send result. */ if ($this->server->ajax) { if (dao::isError()) { $response['result'] = 'fail'; $response['message'] = dao::getError(); } else { $response['result'] = 'success'; $response['message'] = ''; } $this->send($response); } die(js::locate($this->createLink('project', 'build', "projectID={$build->project}"), 'parent')); } }