Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
@@ -229,7 +229,7 @@ class buildModel extends model
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param string $params noempty|notrunk, can be a set of them
|
||||
* @param int $buildIDList
|
||||
* @param string $buildIDList
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
|
||||
@@ -293,7 +293,8 @@ class doc extends control
|
||||
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $docID));
|
||||
$objectID = zget($lib, $lib->type, '');
|
||||
$params = "type={$lib->type}&objectID=$objectID&libID={$lib->id}&docID=" . $docResult['id'];
|
||||
$libType = ($lib->type == 'execution' and $this->app->openApp != 'execution') ? 'project' : $lib->type;
|
||||
$params = "type={$libType}&objectID=$objectID&libID={$lib->id}&docID=" . $docResult['id'];
|
||||
$link = $this->createLink('doc', 'objectLibs', $params);
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link));
|
||||
}
|
||||
@@ -1009,6 +1010,8 @@ class doc extends control
|
||||
{
|
||||
list($libs, $libID, $object, $objectID) = $this->doc->setMenuByType($type, $objectID, $libID);
|
||||
|
||||
$libID = empty($libID) ? 0 : $libID;
|
||||
|
||||
$moduleTree = $type == 'book' ? $this->doc->getBookStructure($libID) : $this->doc->getTreeMenu($type, $objectID, $libID);
|
||||
|
||||
$title = ($type == 'book' or $type == 'custom') ? $this->lang->doc->tableContents : $object->name . $this->lang->colon . $this->lang->doc->tableContents;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
$('.ajaxCollect').click(function()
|
||||
{
|
||||
window.location.reload();
|
||||
})
|
||||
+17
-20
@@ -1070,7 +1070,7 @@ class docModel extends model
|
||||
}
|
||||
else
|
||||
{
|
||||
$objectLibs = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere($type)->eq($objectID)->andWhere('type')->eq($type)->orderBy('`order`, id')->fetchAll('id');
|
||||
$objectLibs = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere($type)->eq($objectID)->orderBy('`order`, id')->fetchAll('id');
|
||||
}
|
||||
|
||||
if($type == 'product')
|
||||
@@ -1315,18 +1315,24 @@ class docModel extends model
|
||||
->orWhere("(objectType = 'bug' and objectID in ($bugIdList))")
|
||||
->orWhere("(objectType = 'testreport' and objectID in ($testReportIdList))")
|
||||
->orWhere("(objectType = 'testcase' and objectID in ($caseIdList))")
|
||||
->beginIF($type == 'product')->orWhere("(objectType in ('story','requirement') and objectID in ($storyIdList))")->fi()
|
||||
->beginIF($type == 'product')->orWhere("(objectType = 'release' and objectID in ($releaseIdList))")->fi()
|
||||
->beginIF($type == 'project')->orWhere("(objectType = 'execution' and objectID in ('$executionIdList'))")->fi()
|
||||
->beginIF($type == 'project' or $type == 'execution')->orWhere("(objectType = 'task' and objectID in ($taskIdList))")->fi()
|
||||
->beginIF($type == 'project' or $type == 'execution')->orWhere("(objectType = 'build' and objectID in ($buildIdList))")->fi()
|
||||
|
||||
->beginIF($type == 'product')
|
||||
->orWhere("(objectType in ('story','requirement') and objectID in ($storyIdList))")
|
||||
->orWhere("(objectType = 'release' and objectID in ($releaseIdList))")
|
||||
->fi()
|
||||
|
||||
->beginIF($type == 'project')
|
||||
->orWhere("(objectType = 'execution' and objectID in ('$executionIdList'))")
|
||||
->orWhere("(objectType = 'issue' and objectID in ($issueIdList))")
|
||||
->orWhere("(objectType = 'meeting' and objectID in ($meetingIdList))")
|
||||
->orWhere("(objectType = 'design' and objectID in ($designIdList))")
|
||||
->fi()
|
||||
|
||||
->beginIF($type == 'project' or $type == 'execution')
|
||||
->orWhere("(objectType = 'task' and objectID in ($taskIdList))")
|
||||
->orWhere("(objectType = 'build' and objectID in ($buildIdList))")
|
||||
->fi()
|
||||
|
||||
->markRight(1)
|
||||
->beginIF($searchTitle)->andWhere('title')->like("%{$searchTitle}%")->fi()
|
||||
->orderBy($orderBy)
|
||||
@@ -1335,14 +1341,6 @@ class docModel extends model
|
||||
|
||||
foreach($files as $fileID => $file)
|
||||
{
|
||||
if($type == 'product' && $file->objectType == 'bug') $file->project = $bugPairs[$file->objectID];
|
||||
if($type == 'product' && $file->objectType == 'release') $file->project = $releasePairs[$file->objectID];
|
||||
if($type == 'product' && $file->objectType == 'testreport') $file->project = $testReportPairs[$file->objectID];
|
||||
if($type == 'product' && $file->objectType == 'testcase') $file->project = $casePairs[$file->objectID];
|
||||
|
||||
if($type == 'execution' && $file->objectType == 'task') $file->project = $taskPairs[$file->objectID];
|
||||
if($type == 'execution' && $file->objectType == 'build') $file->project = $buildPairs[$file->objectID];
|
||||
|
||||
$pathName = $this->file->getRealPathName($file->pathname);
|
||||
$file->realPath = $this->file->savePath . $pathName;
|
||||
$file->webPath = $this->file->webPath . $pathName;
|
||||
@@ -1782,11 +1780,12 @@ class docModel extends model
|
||||
foreach($docs as $doc)
|
||||
{
|
||||
$objectID = 0;
|
||||
if($doc->type == 'product') $objectID = $doc->product;
|
||||
if($doc->type == 'project') $objectID = $doc->project;
|
||||
if($doc->type == 'execution') $objectID = $doc->execution;
|
||||
if($doc->type == 'product') $objectID = $doc->product;
|
||||
if($doc->type == 'project' or $doc->type == 'execution') $objectID = $doc->project;
|
||||
|
||||
$html .= '<li>' . html::a(inlink('objectLibs', "type={$doc->type}&objectID=$objectID&libID={$doc->lib}&docID={$doc->id}"), "<i class='icon icon-file-text'></i> " . $doc->title, '', "data-app='{$this->app->openApp}' title='{$doc->title}'") . '</li>';
|
||||
$docType = ($doc->type == 'execution') ? 'project' : $doc->type;
|
||||
|
||||
$html .= '<li>' . html::a(inlink('objectLibs', "type={$docType}&objectID=$objectID&libID={$doc->lib}&docID={$doc->id}"), "<i class='icon icon-file-text'></i> " . $doc->title, '', "data-app='doc' title='{$doc->title}'") . '</li>';
|
||||
}
|
||||
|
||||
$collectionCount = $this->dao->select('count(id) as count')->from(TABLE_DOC)
|
||||
@@ -2301,8 +2300,6 @@ EOT;
|
||||
if(empty($object)) die(js::locate(helper::createLink($type, 'create')));
|
||||
}
|
||||
|
||||
if(!$libID) $libID = key($libs);
|
||||
|
||||
$openApp = strpos('doc,product,project,execution', $this->app->openApp) !== false ? $this->app->openApp : 'doc';
|
||||
if($openApp != 'doc') $this->loadModel($openApp)->setMenu($objectID);
|
||||
|
||||
|
||||
@@ -697,6 +697,7 @@ class upgradeModel extends model
|
||||
$this->saveLogs('Execute 15_3');
|
||||
$this->execSQL($this->getUpgradeFile('15.3'));
|
||||
$this->processStoryFileType();
|
||||
$this->processProductDoc();
|
||||
$this->appendExec('15_3');
|
||||
}
|
||||
|
||||
@@ -4511,7 +4512,6 @@ class upgradeModel extends model
|
||||
$this->dao->update(TABLE_TESTREPORT)->set('project')->eq($projectID)->where('product')->in($productIdList)->exec();
|
||||
$this->dao->update(TABLE_TESTSUITE)->set('project')->eq($projectID)->where('product')->in($productIdList)->exec();
|
||||
$this->dao->update(TABLE_BUILD)->set('project')->eq($projectID)->where('product')->in($productIdList)->exec();
|
||||
$this->dao->update(TABLE_DOC)->set('project')->eq($projectID)->where("lib IN(SELECT id from " . TABLE_DOCLIB . " WHERE type = 'product' and product " . helper::dbIN($productIdList) . ')')->exec();
|
||||
|
||||
/* Project linked objects. */
|
||||
$this->dao->update(TABLE_TASK)->set('project')->eq($projectID)->where('execution')->in($sprintIdList)->exec();
|
||||
@@ -5160,7 +5160,7 @@ class upgradeModel extends model
|
||||
* Process story file type to requirement.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return bool
|
||||
*/
|
||||
public function processStoryFileType()
|
||||
{
|
||||
@@ -5173,4 +5173,20 @@ class upgradeModel extends model
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Leave the project field of the product document blank.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function processProductDoc()
|
||||
{
|
||||
$this->dao->update(TABLE_DOC)->set('project')->eq(0)
|
||||
->where('product')->ne(0)
|
||||
->andWhere('project')->ne(0)
|
||||
->exec();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1061,8 +1061,8 @@ class userModel extends model
|
||||
->beginIF($status == 'done')->andWhere('status')->in('done,closed')->fi()
|
||||
->beginIF($status == 'undone')->andWhere('status')->notin('done,closed')->fi()
|
||||
->beginIF($status == 'openedbyme')->andWhere('openedBy')->eq($account)->fi()
|
||||
->beginIF($type == 'execution' and !$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->sprints)->fi()
|
||||
->beginIF($type == 'project' and !$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->projects)->fi()
|
||||
->beginIF($type == 'execution' and !$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi()
|
||||
->beginIF($type == 'project' and !$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->projects)->fi()
|
||||
->andWhere('t1.account')->eq($account)
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->orderBy("t2.$orderBy")
|
||||
|
||||
Reference in New Issue
Block a user