コード例 #1
0
ファイル: control.php プロジェクト: leowh/colla
 /**
  * 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'));
 }
コード例 #2
0
ファイル: control.php プロジェクト: huokedu/zentao
 /**
  * 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'));
     }
 }
コード例 #3
0
ファイル: control.php プロジェクト: XMGmen/zentao
 /**
  * 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'));
 }
コード例 #4
0
ファイル: control.php プロジェクト: ppmon/ppm
 /**
  * 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'));
     }
 }
コード例 #5
0
ファイル: control.php プロジェクト: XMGmen/zentao
 /**
  * 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'));
 }
コード例 #6
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);
         echo js::locate($this->app->session->storyList, 'parent');
         exit;
     }
 }
コード例 #7
0
ファイル: control.php プロジェクト: laiello/zentaoms
 /**
  * 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'));
     }
 }
コード例 #8
0
ファイル: control.php プロジェクト: XMGmen/zentao
 /**
  * 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'));
     }
 }
コード例 #9
0
ファイル: control.php プロジェクト: fanscky/HTPMS
 /**
  * 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'));
     }
 }
コード例 #10
0
ファイル: control.php プロジェクト: XMGmen/zentao
 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();
 }
コード例 #11
0
ファイル: control.php プロジェクト: XMGmen/zentao
 /**
  * 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'));
 }
コード例 #12
0
ファイル: control.php プロジェクト: caiwenhao/zentao
 /**
  * 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'));
 }
コード例 #13
0
ファイル: control.php プロジェクト: iamazhi/zentaopms
 /**
  * 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'));
     }
 }
コード例 #14
0
ファイル: control.php プロジェクト: XMGmen/zentao
 /**
  * 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'));
     }
 }
コード例 #15
0
 /**
  * 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'));
     }
 }
コード例 #16
0
ファイル: control.php プロジェクト: huokedu/zentao
 /**
  * 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'));
     }
 }
コード例 #17
0
ファイル: control.php プロジェクト: laiello/zentaoms
 /**
  * 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'));
     }
 }
コード例 #18
0
ファイル: control.php プロジェクト: laiello/zentaoms
 /**
  * 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();
 }
コード例 #19
0
ファイル: control.php プロジェクト: jsyinwenjun/zentao
 /**
  * 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'));
     }
 }
コード例 #20
0
ファイル: control.php プロジェクト: fanscky/HTPMS
 /**
  * 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);
     }
 }
コード例 #21
0
ファイル: control.php プロジェクト: huokedu/zentao
 /**
  * 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'));
     }
 }
コード例 #22
0
 /**
  * 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'));
     }
 }
コード例 #23
0
ファイル: control.php プロジェクト: heeeello/zentaopms
 /**
  * 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;
     }
 }
コード例 #24
0
ファイル: control.php プロジェクト: fanscky/HTPMS
 /**
  * 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'));
 }
コード例 #25
0
ファイル: control.php プロジェクト: nanata1115/zentaopms
 /**
  * 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'));
     }
 }
コード例 #26
0
ファイル: control.php プロジェクト: huokedu/zentao
 /**
  * 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));
     }
 }
コード例 #27
0
ファイル: control.php プロジェクト: iamazhi/zentaopms
 /**
  * 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'));
     }
 }
コード例 #28
0
ファイル: control.php プロジェクト: huokedu/zentao
 /**
  * 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'));
     }
 }
コード例 #29
0
ファイル: control.php プロジェクト: XMGmen/zentao
 /**
  * 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;
     }
 }
コード例 #30
0
ファイル: control.php プロジェクト: fanscky/HTPMS
 /**
  * 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'));
     }
 }