Merge branch 'master' of https://github.com/easysoft/zentaopms
This commit is contained in:
@@ -21,6 +21,7 @@ class build extends control
|
||||
*/
|
||||
public function create($executionID, $productID = 0)
|
||||
{
|
||||
/* Create execution if no execution. */
|
||||
if($executionID == 0)
|
||||
{
|
||||
die(js::locate($this->createLink('project', 'create'), 'parent'));
|
||||
@@ -34,7 +35,7 @@ class build extends control
|
||||
|
||||
$this->executeHooks($buildID);
|
||||
|
||||
if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.loadProjectBuilds($executionID)"));//Code for task #5126.
|
||||
if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.loadProjectBuilds($executionID)")); // Code for task #5126.
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('build', 'view', "buildID=$buildID")));
|
||||
}
|
||||
|
||||
@@ -42,6 +43,7 @@ class build extends control
|
||||
$this->loadModel('project');
|
||||
$this->loadModel('user');
|
||||
|
||||
/* Set session and get execution by id. */
|
||||
$this->session->set('buildCreate', $this->app->getURI(true));
|
||||
$execution = $this->loadModel('project')->getExecutionById($executionID);
|
||||
|
||||
@@ -162,6 +164,7 @@ class build extends control
|
||||
*/
|
||||
public function view($buildID, $type = 'story', $link = 'false', $param = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 100, $pageID = 1)
|
||||
{
|
||||
/* Set session and load modules. */
|
||||
if($type == 'story')$this->session->set('storyList', $this->app->getURI(true));
|
||||
if($type == 'bug') $this->session->set('bugList', $this->app->getURI(true));
|
||||
|
||||
@@ -172,7 +175,7 @@ class build extends control
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
if($this->app->getViewType() == 'mhtml') $recPerPage = 10;
|
||||
|
||||
/* Set menu. */
|
||||
/* Get build, product and bugs. */
|
||||
$build = $this->build->getByID((int)$buildID, true);
|
||||
if(!$build) die(js::error($this->lang->notFound) . js::locate('back'));
|
||||
|
||||
@@ -185,6 +188,7 @@ class build extends control
|
||||
->page($bugPager)
|
||||
->fetchAll();
|
||||
|
||||
/* Get stories and stages. */
|
||||
$storyPager = new pager($type == 'story' ? $recTotal : 0, $recPerPage, $type == 'story' ? $pageID : 1);
|
||||
$stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($build->stories)->andWhere('deleted')->eq(0)
|
||||
->beginIF($type == 'story')->orderBy($orderBy)->fi()
|
||||
@@ -193,6 +197,7 @@ class build extends control
|
||||
$stages = $this->dao->select('*')->from(TABLE_STORYSTAGE)->where('story')->in($build->stories)->andWhere('branch')->eq($build->branch)->fetchPairs('story', 'stage');
|
||||
foreach($stages as $storyID => $stage)$stories[$storyID]->stage = $stage;
|
||||
|
||||
/* Set menu. */
|
||||
$this->loadModel('project')->setMenu($this->project->getExecutionPairs($this->session->PRJ), $build->project, $buildID);
|
||||
$projects = $this->project->getExecutionPairs($this->session->PRJ, 'all', 'empty');
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class buildModel extends model
|
||||
* @param int $buildID
|
||||
* @param bool $setImgSize
|
||||
* @access public
|
||||
* @return object
|
||||
* @return object|bool
|
||||
*/
|
||||
public function getByID($buildID, $setImgSize = false)
|
||||
{
|
||||
@@ -495,9 +495,10 @@ class buildModel extends model
|
||||
*/
|
||||
public function unlinkStory($buildID, $storyID)
|
||||
{
|
||||
$build = $this->getByID($buildID);
|
||||
$build = $this->getByID($buildID);
|
||||
$build->stories = trim(str_replace(",$storyID,", ',', ",$build->stories,"), ',');
|
||||
if($build->stories) $build->stories = ',' . $build->stories;
|
||||
|
||||
$this->dao->update(TABLE_BUILD)->set('stories')->eq($build->stories)->where('id')->eq((int)$buildID)->exec();
|
||||
$this->loadModel('action')->create('story', $storyID, 'unlinkedfrombuild', '', $buildID, '', false);
|
||||
}
|
||||
@@ -558,9 +559,10 @@ class buildModel extends model
|
||||
*/
|
||||
public function unlinkBug($buildID, $bugID)
|
||||
{
|
||||
$build = $this->getByID($buildID);
|
||||
$build = $this->getByID($buildID);
|
||||
$build->bugs = trim(str_replace(",$bugID,", ',', ",$build->bugs,"), ',');
|
||||
if($build->bugs) $build->bugs = ',' . $build->bugs;
|
||||
|
||||
$this->dao->update(TABLE_BUILD)->set('bugs')->eq($build->bugs)->where('id')->eq((int)$buildID)->exec();
|
||||
$this->loadModel('action')->create('bug', $bugID, 'unlinkedfrombuild', '', $buildID, '', false);
|
||||
}
|
||||
|
||||
@@ -443,6 +443,7 @@ class issue extends control
|
||||
*/
|
||||
public function view($issueID)
|
||||
{
|
||||
/* Set actions and get issue by id. */
|
||||
$this->commonAction($issueID, 'issue');
|
||||
$issue = $this->issue->getByID($issueID);
|
||||
if(!$issue) die(js::error($this->lang->notFound) . js::locate('back'));
|
||||
|
||||
@@ -66,12 +66,13 @@ class issueModel extends model
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return object
|
||||
* @return object|bool
|
||||
*/
|
||||
public function getByID($issueID)
|
||||
{
|
||||
$issue = $this->dao->select('*')->from(TABLE_ISSUE)->where('id')->eq($issueID)->andWhere('deleted')->eq('0')->fetch();
|
||||
$issue = $this->dao->select('*')->from(TABLE_ISSUE)->where('id')->eq($issueID)->andWhere('deleted')->eq('0')->fetch();
|
||||
if(!$issue) return false;
|
||||
|
||||
$issue->files = $this->loadModel('file')->getByObject('issue', $issue->id);
|
||||
return $issue;
|
||||
}
|
||||
|
||||
@@ -485,7 +485,6 @@ class productplan extends control
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -503,7 +502,7 @@ class productplan extends control
|
||||
$this->loadModel('bug');
|
||||
$plan = $this->productplan->getByID($planID);
|
||||
$this->commonAction($plan->product, $plan->branch);
|
||||
$products = $this->product->getPairs('nocode');
|
||||
$products = $this->product->getPairs('nocode');
|
||||
$productID = $plan->product;
|
||||
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
|
||||
|
||||
|
||||
@@ -36,13 +36,13 @@ function addNewProduct(obj)
|
||||
{
|
||||
$('#productName').closest('tr').removeClass('hidden');
|
||||
$('#plans').closest('tr').addClass('hidden');
|
||||
$('#productsBox .chosen-container').attr('disabled',true);
|
||||
$(obj).closest('.input-group').find('select').attr('disabled', true).trigger("chosen:updated");
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#productName').closest('tr').addClass('hidden');
|
||||
$('#plans').closest('tr').removeClass('hidden');
|
||||
$('#productsBox .chosen-container').removeAttr('disabled',true);
|
||||
$(obj).closest('.input-group').find('select').removeAttr('disabled').trigger("chosen:updated");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ $lang->program->scrum = 'Scrum';
|
||||
$lang->program->waterfall = 'CMMI';
|
||||
$lang->program->waterfallTitle = 'CMMI';
|
||||
$lang->program->cannotCreateChild = 'It is not empty, so you cannot add a child. You can add a parent for it, and then create a child.';
|
||||
$lang->program->hasChildren = 'It has child projects or child programs. You cannot delete it.';
|
||||
$lang->program->hasChildren = 'It has child programs or projects. You cannot delete it.';
|
||||
$lang->program->confirmDelete = "Do you want to delete [%s]?";
|
||||
$lang->program->emptyPM = 'No manager';
|
||||
$lang->program->cannotChangeToCat = "It is not empty, so you cannot change it to a parent.";
|
||||
|
||||
@@ -143,7 +143,7 @@ $lang->program->scrum = 'Scrum';
|
||||
$lang->program->waterfall = 'CMMI';
|
||||
$lang->program->waterfallTitle = 'CMMI';
|
||||
$lang->program->cannotCreateChild = 'It is not empty, so you cannot add a child. You can add a parent for it, and then create a child.';
|
||||
$lang->program->hasChildren = 'It has child projects or child programs. You cannot delete it.';
|
||||
$lang->program->hasChildren = 'It has child programs or projects. You cannot delete it.';
|
||||
$lang->program->confirmDelete = "Do you want to delete [%s]?";
|
||||
$lang->program->emptyPM = 'No manager';
|
||||
$lang->program->cannotChangeToCat = "It is not empty, so you cannot change it to a parent.";
|
||||
|
||||
@@ -143,7 +143,7 @@ $lang->program->scrum = 'Scrum';
|
||||
$lang->program->waterfall = 'CMMI';
|
||||
$lang->program->waterfallTitle = 'CMMI';
|
||||
$lang->program->cannotCreateChild = 'It is not empty, so you cannot add a child. You can add a parent for it, and then create a child.';
|
||||
$lang->program->hasChildren = 'It has child projects or child programs. You cannot delete it.';
|
||||
$lang->program->hasChildren = 'It has child programs or projects. You cannot delete it.';
|
||||
$lang->program->confirmDelete = "Do you want to delete [%s]?";
|
||||
$lang->program->emptyPM = 'No manager';
|
||||
$lang->program->cannotChangeToCat = "It is not empty, so you cannot change it to a parent.";
|
||||
|
||||
@@ -143,7 +143,7 @@ $lang->program->scrum = 'Scrum';
|
||||
$lang->program->waterfall = 'CMMI';
|
||||
$lang->program->waterfallTitle = 'CMMI';
|
||||
$lang->program->cannotCreateChild = 'It is not empty, so you cannot add a child. You can add a parent for it, and then create a child.';
|
||||
$lang->program->hasChildren = 'It has child projects or child programs. You cannot delete it.';
|
||||
$lang->program->hasChildren = 'It has child programs or projects. You cannot delete it.';
|
||||
$lang->program->confirmDelete = "Do you want to delete [%s]?";
|
||||
$lang->program->emptyPM = 'No manager';
|
||||
$lang->program->cannotChangeToCat = "It is not empty, so you cannot change it to a parent.";
|
||||
|
||||
@@ -1222,9 +1222,12 @@ class programModel extends model
|
||||
|
||||
/* Judge products not empty. */
|
||||
$linkedProductsCount = 0;
|
||||
foreach($_POST['products'] as $product)
|
||||
if(isset($_POST['products']))
|
||||
{
|
||||
if(!empty($product)) $linkedProductsCount++;
|
||||
foreach($_POST['products'] as $product)
|
||||
{
|
||||
if(!empty($product)) $linkedProductsCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($linkedProductsCount) and !isset($_POST['newProduct']))
|
||||
@@ -1234,6 +1237,13 @@ class programModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
/* When select create new product, product name cannot be empty. */
|
||||
if(isset($_POST['newProduct']) and empty($_POST['productName']))
|
||||
{
|
||||
dao::$errors[] = sprintf($this->lang->error->notempty, $this->app->loadLang('product')->product->name);
|
||||
return false;
|
||||
}
|
||||
|
||||
$requiredFields = $this->config->program->PRJCreate->requiredFields;
|
||||
if($this->post->delta == 999) $requiredFields = trim(str_replace(',end,', ',', ",{$requiredFields},"), ',');
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ class projectModel extends model
|
||||
* @param int $buildID
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
* @return bool
|
||||
*/
|
||||
public function setMenu($projects, $projectID, $buildID = 0, $extra = '')
|
||||
{
|
||||
@@ -125,7 +125,7 @@ class projectModel extends model
|
||||
|
||||
/* Set project module page nav. */
|
||||
$label = $this->lang->project->index;
|
||||
if($methodName == 'all') $label = $this->lang->project->allProjects;
|
||||
if($methodName == 'all') $label = $this->lang->project->allProjects;
|
||||
if($methodName == 'create' and $moduleName == 'project') $label = $this->lang->project->create;
|
||||
|
||||
$projectIndex = '<div class="btn-group angle-btn' . ((strpos('index|all|create', $methodName) !== false and $moduleName == 'project') ? ' active' : '') . '"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . $label . ' <span class="caret"></span></button>';
|
||||
|
||||
Reference in New Issue
Block a user