* Code fot task#44028.
This commit is contained in:
@@ -46,5 +46,5 @@ $config->action->majorList['project'] = array('opened', 'edited');
|
||||
$config->action->majorList['execution'] = array('opened', 'edited');
|
||||
|
||||
$config->action->needGetProjectType = 'build,task,bug,case,testcase,caselib,testtask,testsuite,testreport,doc,issue,release,risk,design,opportunity,trainplan,gapanalysis,researchplan,researchreport,';
|
||||
$config->action->needGetRelateField = ',story,productplan,release,task,build,bug,case,testtask,testreport,doc,doclib,issue,risk,opportunity,trainplan,gapanalysis,team,whitelist,researchplan,researchreport,meeting,';
|
||||
$config->action->needGetRelateField = ',story,productplan,release,task,build,bug,case,testtask,testreport,doc,doclib,issue,risk,opportunity,trainplan,gapanalysis,team,whitelist,researchplan,researchreport,meeting,branch,';
|
||||
$config->action->noLinkModules = ',doclib,module,webhook,gitlab,pipeline,jenkins,';
|
||||
|
||||
@@ -506,6 +506,7 @@ $lang->action->label->issue = 'Issue|issue|view|issueID=%s';
|
||||
$lang->action->label->design = 'Design|design|view|designID=%s';
|
||||
$lang->action->label->stakeholder = 'Stakeholder|stakeholder|view|userID=%s';
|
||||
$lang->action->label->api = 'Interface|api|index|libID=%s&moduleID=%s&apiID=%s';
|
||||
$lang->action->label->branch = 'Branch|branch|manage|prouctID=%s';
|
||||
|
||||
/* Object type. */
|
||||
$lang->action->search = new stdclass();
|
||||
|
||||
@@ -506,6 +506,7 @@ $lang->action->label->issue = '问题|issue|view|issueID=%s';
|
||||
$lang->action->label->design = '设计|design|view|designID=%s';
|
||||
$lang->action->label->stakeholder = '干系人|stakeholder|view|userID=%s';
|
||||
$lang->action->label->api = '接口|api|index|libID=%s&moduleID=%s&apiID=%s';
|
||||
$lang->action->label->branch = '分支|branch|manage|productID=%s';
|
||||
|
||||
/* Object type. */
|
||||
$lang->action->search = new stdclass();
|
||||
|
||||
@@ -506,6 +506,7 @@ $lang->action->label->issue = '問題|issue|view|issueID=%s';
|
||||
$lang->action->label->design = '設計|design|view|designID=%s';
|
||||
$lang->action->label->stakeholder = '干係人|stakeholder|view|userID=%s';
|
||||
$lang->action->label->api = '介面|api|index|libID=%s&moduleID=%s&apiID=%s';
|
||||
$lang->action->label->branch = '分支|branch|manage|productID=%s';
|
||||
|
||||
/* Object type. */
|
||||
$lang->action->search = new stdclass();
|
||||
|
||||
@@ -188,7 +188,7 @@ class actionModel extends model
|
||||
|
||||
/* Set fields to fetch. */
|
||||
$fields = '*';
|
||||
if(strpos('story, productplan, case', $objectType) !== false) $fields = 'product';
|
||||
if(strpos('story, productplan, case, branch', $objectType) !== false) $fields = 'product';
|
||||
if(strpos('build, bug, testtask, doc', $objectType) !== false) $fields = 'product, project, execution';
|
||||
if(strpos('case, repo', $objectType) !== false) $fields = 'execution';
|
||||
if($objectType == 'release') $fields = 'product, build';
|
||||
@@ -1177,6 +1177,11 @@ class actionModel extends model
|
||||
$api = $this->dao->select('id,lib,module')->from(TABLE_API)->where('id')->eq($action->objectID)->fetch();
|
||||
$params = sprintf($vars, $api->lib, $api->module, $api->id);
|
||||
}
|
||||
elseif($action->objectType == 'branch')
|
||||
{
|
||||
$productID = $this->dao->select('product')->from(TABLE_BRANCH)->where('id')->eq($action->objectID)->fetch('product');
|
||||
$params = sprintf($vars, $productID);
|
||||
}
|
||||
else
|
||||
{
|
||||
$params = sprintf($vars, $action->objectID);
|
||||
|
||||
@@ -53,7 +53,11 @@ class branch extends control
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$this->branch->create($productID);
|
||||
$branchID = $this->branch->create($productID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
$this->loadModel('action')->create('branch', $branchID, 'Opened');
|
||||
die(js::reload('parent.parent'));
|
||||
}
|
||||
|
||||
$this->display();
|
||||
|
||||
+13
-6
@@ -128,18 +128,25 @@ class branchModel extends model
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return void
|
||||
* @return int|bool
|
||||
*/
|
||||
public function create($productID)
|
||||
{
|
||||
$branch = fixer::input('post')
|
||||
->setDefault('product', $productID)
|
||||
->setDefault('createdDate', helper::today())
|
||||
->setDefault('status', 'active')
|
||||
->add('product', $productID)
|
||||
->add('createdDate', helper::today())
|
||||
->add('status', 'active')
|
||||
->get();
|
||||
|
||||
$this->dao->insert(TABLE_BRANCH)->data($branch)->exec();
|
||||
if(dao::isError()) return false;
|
||||
$lastOrder = (int)$this->dao->select('`order`')->from(TABLE_BRANCH)->where('product')->eq($productID)->orderBy('order_desc')->limit(1)->fetch('order');
|
||||
$branch->order = empty($lastOrder) ? 1 : $lastOrder + 1;
|
||||
|
||||
$this->dao->insert(TABLE_BRANCH)->data($branch)
|
||||
->batchCheck($this->config->branch->create->requiredFields, 'notempty')
|
||||
->exec();
|
||||
|
||||
if(!dao::isError()) return $this->dao->lastInsertID();
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,9 +26,7 @@
|
||||
<td><?php echo html::input('desc', '', "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' class='text-center'>
|
||||
<?php echo html::submitButton();?>
|
||||
</td>
|
||||
<td colspan='2' class='text-center form-actions'><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
@@ -421,12 +421,14 @@ $lang->product->methodOrder[105] = 'unbindWhitelist';
|
||||
/* Branch. */
|
||||
$lang->resource->branch = new stdclass();
|
||||
$lang->resource->branch->manage = 'manage';
|
||||
$lang->resource->branch->create = 'create';
|
||||
$lang->resource->branch->sort = 'sort';
|
||||
$lang->resource->branch->delete = 'delete';
|
||||
|
||||
$lang->branch->methodOrder[0] = 'manage';
|
||||
$lang->branch->methodOrder[5] = 'sort';
|
||||
$lang->branch->methodOrder[10] = 'delete';
|
||||
$lang->branch->methodOrder[5] = 'create';
|
||||
$lang->branch->methodOrder[10] = 'sort';
|
||||
$lang->branch->methodOrder[15] = 'delete';
|
||||
|
||||
/* Story. */
|
||||
$lang->resource->story = new stdclass();
|
||||
|
||||
Reference in New Issue
Block a user