コード例 #1
0
ファイル: control.php プロジェクト: laiello/zentaoms
 /**
  * Close a bug.
  * 
  * @param  int    $bugID 
  * @access public
  * @return void
  */
 public function close($bugID)
 {
     if (!empty($_POST)) {
         $this->bug->close($bugID);
         if (dao::isError()) {
             die(js::error(dao::getError()));
         }
         $actionID = $this->action->create('bug', $bugID, 'Closed', $this->post->comment);
         $this->sendmail($bugID, $actionID);
         if (isonlybody()) {
             die(js::closeColorbox('parent.parent'));
         }
         die(js::locate($this->createLink('bug', 'view', "bugID={$bugID}"), 'parent'));
     }
     $bug = $this->bug->getById($bugID);
     $productID = $bug->product;
     $this->bug->setMenu($this->products, $productID);
     $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->close;
     $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID={$productID}"), $this->products[$productID]);
     $this->view->position[] = $this->lang->bug->close;
     $this->view->bug = $bug;
     $this->view->users = $this->user->getPairs('noletter');
     $this->view->actions = $this->action->getList('bug', $bugID);
     $this->display();
 }
コード例 #2
0
ファイル: control.php プロジェクト: laiello/zentaoms
 /**
  * Close a story.
  * 
  * @param  int    $storyID 
  * @access public
  * @return void
  */
 public function close($storyID)
 {
     if (!empty($_POST)) {
         $changes = $this->story->close($storyID);
         if (dao::isError()) {
             die(js::error(dao::getError()));
         }
         $actionID = $this->action->create('story', $storyID, 'Closed', $this->post->comment, ucfirst($this->post->closedReason));
         $this->action->logHistory($actionID, $changes);
         $this->sendMail($storyID, $actionID);
         if (isonlybody()) {
             die(js::closeColorbox('parent.parent'));
         }
         die(js::locate(inlink('view', "storyID={$storyID}"), 'parent'));
     }
     /* Get story and product. */
     $story = $this->story->getById($storyID);
     $product = $this->dao->findById($story->product)->from(TABLE_PRODUCT)->fields('name, id')->fetch();
     /* Set menu. */
     $this->product->setMenu($this->product->getPairs(), $product->id);
     /* Set the closed reason options. */
     if ($story->status == 'draft') {
         unset($this->lang->story->reasonList['cancel']);
     }
     $this->view->title = $product->name . $this->lang->colon . $this->lang->close . $this->lang->colon . $story->title;
     $this->view->position[] = html::a($this->createLink('product', 'browse', "product={$product->id}"), $product->name);
     $this->view->position[] = $this->lang->close;
     $this->view->product = $product;
     $this->view->story = $story;
     $this->view->actions = $this->action->getList('story', $storyID);
     $this->view->users = $this->loadModel('user')->getPairs();
     $this->display();
 }
コード例 #3
0
ファイル: control.php プロジェクト: laiello/zentaoms
 /**
  * Activate a task.
  * 
  * @param  int    $taskID 
  * @access public
  * @return void
  */
 public function activate($taskID)
 {
     $this->commonAction($taskID);
     if (!empty($_POST)) {
         $this->loadModel('action');
         $changes = $this->task->activate($taskID);
         if (dao::isError()) {
             die(js::error(dao::getError()));
         }
         if ($this->post->comment != '' or !empty($changes)) {
             $actionID = $this->action->create('task', $taskID, 'Activated', $this->post->comment);
             $this->action->logHistory($actionID, $changes);
             $this->sendmail($taskID, $actionID);
         }
         if (isonlybody()) {
             die(js::closeColorbox('parent.parent'));
         }
         die(js::locate($this->createLink('task', 'view', "taskID={$taskID}"), 'parent'));
     }
     if (!isset($this->view->members[$this->view->task->finishedBy])) {
         $this->view->members[$this->view->task->finishedBy] = $this->view->task->finishedBy;
     }
     $this->view->title = $this->view->project->name . $this->lang->colon . $this->lang->task->activate;
     $this->view->position[] = $this->lang->task->activate;
     $this->display();
 }