Ejemplo n.º 1
0
 public function upload($productID, $planID, $sprintID)
 {
     if (!empty($_FILES)) {
         $msg = $this->importbugs->uploadExcel('', $productID, $planID, $sprintID);
         echo "<script>alert('{$msg}')</script>";
         // if(isonlybody()) die(js::closeModal('parent'));
         die(js::closeModal('parent'));
     }
     $this->display();
 }
Ejemplo n.º 2
0
 public function editImage($userId)
 {
     if (!empty($_FILES)) {
         $this->loadModel('myImage')->uploadImg();
         if (isonlybody()) {
             die(js::closeModal('parent'));
         }
     }
     $file = $this->loadModel('myImage')->getFile($userId);
     $this->view->file = $file;
     $this->display();
 }
Ejemplo n.º 3
0
 public function edit($projectID)
 {
     // echo "edit";
     if (!empty($_POST)) {
         $changes = $this->project->update($projectID);
         $this->project->updateProducts($projectID);
         if (dao::isError()) {
             die(js::error(dao::getError()));
         }
         if ($changes) {
             $actionID = $this->loadModel('action')->create('project', $projectID, 'edited');
             $this->action->logHistory($actionID, $changes);
         }
         if (isonlybody()) {
             die(js::closeModal('parent.parent'));
         }
         die(js::locate(inlink('view', "projectID={$projectID}"), 'parent'));
     }
     /* Judge a private todo or not, If private, die. */
     /* Set menu. */
     $this->project->setMenu($this->projects, $projectID);
     $projects = array('' => '') + $this->projects;
     $project = $this->project->getById($projectID);
     $managers = $this->project->getDefaultManagers($projectID);
     if ($project->private and $this->app->user->account != $project->account) {
         die('private');
     }
     /* Remove current project from the projects. */
     unset($projects[$projectID]);
     $title = $this->lang->project->edit . $this->lang->colon . $project->name;
     $position[] = html::a($browseProjectLink, $project->name);
     $position[] = $this->lang->project->edit;
     $allProducts = $this->loadModel('product')->getPairs('noclosed|nocode');
     $linkedProducts = $this->project->getProducts($project->id);
     $allProducts += $linkedProducts;
     $linkedProducts = join(',', array_keys($linkedProducts));
     $this->view->title = $title;
     $this->view->position = $position;
     $this->view->projects = $projects;
     $this->view->project = $project;
     $this->view->poUsers = $this->loadModel('user')->getPairs('noclosed,nodeleted,pofirst', $project->PO);
     $this->view->pmUsers = $this->user->getPairs('noclosed,nodeleted,pmfirst', $project->PM);
     $this->view->qdUsers = $this->user->getPairs('noclosed,nodeleted,qdfirst', $project->QD);
     $this->view->rdUsers = $this->user->getPairs('noclosed,nodeleted,devfirst', $project->RD);
     $this->view->groups = $this->loadModel('group')->getPairs();
     $this->view->allProducts = $allProducts;
     $this->view->linkedProducts = $linkedProducts;
     $this->display();
 }
Ejemplo n.º 4
0
 /**
  * Edit a todo.
  * 
  * @param  int    $todoID 
  * @access public
  * @return void
  */
 public function edit($todoID)
 {
     if (!empty($_POST)) {
         $changes = $this->todo->update($todoID);
         if (dao::isError()) {
             die(js::error(dao::getError()));
         }
         if ($changes) {
             $actionID = $this->loadModel('action')->create('todo', $todoID, 'edited');
             $this->action->logHistory($actionID, $changes);
         }
         if (isonlybody()) {
             die(js::closeModal('parent.parent'));
         }
         die(js::locate(inlink('view', "todoID={$todoID}"), 'parent'));
     }
     /* Judge a private todo or not, If private, die. */
     $todo = $this->todo->getById($todoID);
     if ($todo->private and $this->app->user->account != $todo->account) {
         die('private');
     }
     $todo->date = strftime("%Y-%m-%d", strtotime($todo->date));
     $this->view->title = $this->lang->todo->common . $this->lang->colon . $this->lang->todo->edit;
     $this->view->position[] = $this->lang->todo->common;
     $this->view->position[] = $this->lang->todo->edit;
     $this->view->times = date::buildTimeList($this->config->todo->times->begin, $this->config->todo->times->end, $this->config->todo->times->delta);
     $this->view->todo = $todo;
     $this->display();
 }
Ejemplo n.º 5
0
 /**
  * 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::closeModal('parent.parent', 'this'));
         }
         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 = $this->lang->story->close . "STORY" . $this->lang->colon . $story->title;
     $this->view->position[] = html::a($this->createLink('product', 'browse', "product={$product->id}"), $product->name);
     $this->view->position[] = $this->lang->story->common;
     $this->view->position[] = $this->lang->story->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();
 }
Ejemplo n.º 6
0
 /**
  * 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::closeModal('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, $bug->branch);
     $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();
 }
Ejemplo n.º 7
0
 /**
  * Copy a group.
  * 
  * @param  int    $groupID 
  * @access public
  * @return void
  */
 public function copy($groupID)
 {
     if (!empty($_POST)) {
         $this->group->copy($groupID);
         if (dao::isError()) {
             die(js::error(dao::getError()));
         }
         if (isonlybody()) {
             die(js::closeModal('parent.parent', 'this'));
         }
         die(js::locate($this->createLink('group', 'browse'), 'parent'));
     }
     $this->view->title = $this->lang->group->copy;
     $this->view->position[] = $this->lang->group->copy;
     $this->view->group = $this->group->getById($groupID);
     $this->display();
 }
Ejemplo n.º 8
0
 /**
  * Run case.
  * 
  * @param  int    $runID 
  * @param  String $extras   others params, forexample, caseID=10, version=3
  * @access public
  * @return void
  */
 public function runCase($runID, $caseID = 0, $version = 0)
 {
     if ($caseID) {
         $run = new stdclass();
         $run->case = $this->loadModel('testcase')->getById($caseID, $version);
     } else {
         $run = $this->testtask->getRunById($runID);
     }
     $caseID = $caseID ? $caseID : $run->case->id;
     $preAndNext = $this->loadModel('common')->getPreAndNextObject('testcase', $caseID);
     if (!empty($_POST)) {
         $this->testtask->createResult($runID);
         if (dao::isError()) {
             die(js::error(dao::getError()));
         }
         /* set cookie for ajax load caselist when close colorbox. */
         setcookie('selfClose', 1);
         if ($preAndNext->next) {
             $nextRunID = $runID ? $preAndNext->next->id : 0;
             $nextCaseID = $runID ? $preAndNext->next->case : $preAndNext->next->id;
             $nextVersion = $preAndNext->next->version;
             die(js::locate(inlink('runCase', "runID={$nextRunID}&caseID={$nextCaseID}&version={$nextVersion}")));
         } else {
             die(js::closeModal('parent'));
         }
     }
     $preCase = '';
     $nextCase = '';
     if ($preAndNext->pre) {
         $preCase['runID'] = $runID ? $preAndNext->pre->id : 0;
         $preCase['caseID'] = $runID ? $preAndNext->pre->case : $preAndNext->pre->id;
         $preCase['version'] = $preAndNext->pre->version;
     }
     if ($preAndNext->next) {
         $nextCase['runID'] = $runID ? $preAndNext->next->id : 0;
         $nextCase['caseID'] = $runID ? $preAndNext->next->case : $preAndNext->next->id;
         $nextCase['version'] = $preAndNext->next->version;
     }
     $this->view->run = $run;
     $this->view->preCase = $preCase;
     $this->view->nextCase = $nextCase;
     $this->view->results = $this->testtask->getResults($runID, $caseID);
     $this->view->users = $this->loadModel('user')->getPairs('noclosed, noletter');
     $this->view->caseID = $caseID;
     $this->view->version = $version;
     die($this->display());
 }
Ejemplo n.º 9
0
 /**
  * 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::closeModal('parent.parent', 'this'));
         }
         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->view->users = $this->loadModel('user')->getPairs('noletter');
     $this->display();
 }
Ejemplo n.º 10
0
 /**
  * Manage members of a group.
  * 
  * @param  int    $groupID 
  * @access public
  * @return void
  */
 public function manageMember($groupID)
 {
     if (!empty($_POST)) {
         $this->group->updateUser($groupID);
         if (isonlybody()) {
             die(js::closeModal('parent.parent', 'this'));
         }
         die(js::locate($this->createLink('group', 'browse'), 'parent'));
     }
     $group = $this->group->getById($groupID);
     $groupUsers = $this->group->getUserPairs($groupID);
     $allUsers = $this->user->getPairs('nodeleted|noclosed|noempty|noletter');
     $otherUsers = array_diff_assoc($allUsers, $groupUsers);
     $title = $this->lang->company->common . $this->lang->colon . $group->name . $this->lang->colon . $this->lang->group->manageMember;
     $position[] = $group->name;
     $position[] = $this->lang->group->manageMember;
     $this->view->title = $title;
     $this->view->position = $position;
     $this->view->group = $group;
     $this->view->groupUsers = $groupUsers;
     $this->view->otherUsers = $otherUsers;
     $this->display();
 }
Ejemplo n.º 11
0
 public function edit($sprintRecordID = 0, $onlybody = 'no')
 {
     if (!empty($_POST)) {
         $this->mySprintBoard->edit();
         $sprintID = $this->loadModel('mySprintBoard')->getSprintIDBySprintRecordID($sprintRecordID);
         if (isonlybody()) {
             die(js::closeModal('parent.parent'));
         }
         die(js::locate(inlink('index', "sprintID={$sprintID}"), 'parent'));
     }
     $this->methodName = 'edit';
     //这是我新增的,是为了显示编辑器的头
     $sprintRecord = $this->mySprintBoard->getSprintRecordBySprintRecordID($sprintRecordID);
     $sprintName = $this->mySprintBoard->getSprintNameBySprintRecordID($sprintRecordID);
     $sprintID = $this->loadModel('mySprintBoard')->getSprintIDBySprintRecordID($sprintRecordID);
     //$sprintRecordID=$this->loadModel('mySprintBoard')->getSprintIDBySprintRecordID($sprintRecordID);
     $this->view->sprintName = $sprintName;
     $this->view->sprintRecord = $sprintRecord;
     $this->view->sprintID = $sprintID;
     $this->view->sprintRecordID = $sprintRecordID;
     //$this->view->sprintRecordID=$sprintRecord;
     $this->display();
 }
Ejemplo n.º 12
0
 public function weatheredit($sprintID = 0)
 {
     if (!empty($_POST)) {
         $this->my->create();
         die(js::closeModal('parent.parent'));
     }
     $this->view->sprintID = $sprintID;
     $this->display();
 }