Exemplo n.º 1
0
 /**
  * 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'));
 }
Exemplo n.º 2
0
 /**
  * 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'));
     }
 }
Exemplo n.º 3
0
 /**
  * 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'));
 }
Exemplo n.º 4
0
 /**
  * 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'));
     }
 }
Exemplo n.º 5
0
 /**
  * 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}&section={$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;
     }
 }
Exemplo n.º 7
0
 /**
  * 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'));
     }
 }
Exemplo n.º 8
0
 /**
  * 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'));
     }
 }
Exemplo n.º 9
0
 /**
  * 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'));
     }
 }
Exemplo n.º 10
0
 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();
 }
Exemplo n.º 11
0
 /**
  * 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'));
 }
Exemplo n.º 12
0
 /**
  * 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'));
 }
Exemplo n.º 13
0
 /**
  * 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'));
     }
 }
Exemplo n.º 14
0
 /**
  * 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'));
     }
 }
Exemplo n.º 16
0
 /**
  * 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'));
     }
 }
Exemplo n.º 17
0
 /**
  * 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'));
     }
 }
Exemplo n.º 18
0
 /**
  * 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();
 }
Exemplo n.º 19
0
 /**
  * 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'));
     }
 }
Exemplo n.º 20
0
 /**
  * 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);
     }
 }
Exemplo n.º 21
0
 /**
  * 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'));
     }
 }
Exemplo n.º 23
0
 /**
  * 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;
     }
 }
Exemplo n.º 24
0
 /**
  * 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'));
 }
Exemplo n.º 25
0
 /**
  * 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'));
     }
 }
Exemplo n.º 26
0
 /**
  * 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));
     }
 }
Exemplo n.º 27
0
 /**
  * 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'));
     }
 }
Exemplo n.º 28
0
 /**
  * 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'));
     }
 }
Exemplo n.º 29
0
 /**
  * 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;
     }
 }
Exemplo n.º 30
0
 /**
  * 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'));
     }
 }