Merge branch 'sprint/170_xieqiyu_44028' into 'sprint/170'
Finish task#44028. See merge request easycorp/zentaopms!327
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&browseType=all';
|
||||
|
||||
/* 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&browseType=all';
|
||||
|
||||
/* 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&browseType=all';
|
||||
|
||||
/* 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);
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
$config->branch = new stdclass();
|
||||
$config->branch->create = new stdclass();
|
||||
$config->branch->edit = new stdclass();
|
||||
|
||||
$config->branch->create->requiredFields = 'name';
|
||||
$config->branch->edit->requiredFields = 'name,status';
|
||||
@@ -42,6 +42,99 @@ class branch extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a branch.
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create($productID)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a branch.
|
||||
*
|
||||
* @param int $branchID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function edit($branchID)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$changes = $this->branch->update($branchID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
if($changes) $this->loadModel('action')->create('branch', $branchID, 'Edited');
|
||||
die(js::reload('parent.parent'));
|
||||
}
|
||||
|
||||
$this->view->branch = $this->branch->getById($branchID, 0, true);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Close a branch.
|
||||
*
|
||||
* @param int $branchID
|
||||
* @param string $confirm
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function close($branchID, $confirm = 'no')
|
||||
{
|
||||
$this->app->loadLang('product');
|
||||
$productType = $this->branch->getProductType($branchID);
|
||||
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm(str_replace('@branch@', $this->lang->product->branchName[$productType], $this->lang->branch->confirmClose), inlink('close', "branchID=$branchID&confirm=yes")));
|
||||
}
|
||||
|
||||
$this->branch->close($branchID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
$this->loadModel('action')->create('branch', $branchID, 'Closed');
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate a branch.
|
||||
*
|
||||
* @param int $branchID
|
||||
* @param string $confirm
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function activate($branchID, $confirm = 'no')
|
||||
{
|
||||
$this->app->loadLang('product');
|
||||
$productType = $this->branch->getProductType($branchID);
|
||||
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm(str_replace('@branch@', $this->lang->product->branchName[$productType], $this->lang->branch->confirmActivate), inlink('activate', "branchID=$branchID&confirm=yes")));
|
||||
}
|
||||
|
||||
$this->branch->activate($branchID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
$this->loadModel('action')->create('branch', $branchID, 'Activated');
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort branch.
|
||||
*
|
||||
|
||||
@@ -9,8 +9,14 @@ $lang->branch->manageTitle = '%s Management';
|
||||
$lang->branch->all = 'Alle ';
|
||||
$lang->branch->main = 'Main';
|
||||
|
||||
$lang->branch->create = 'Create Branch';
|
||||
$lang->branch->merge = 'Merge';
|
||||
$lang->branch->edit = 'Edit';
|
||||
$lang->branch->editAction = 'Edit Branch';
|
||||
$lang->branch->activate = 'Activate';
|
||||
$lang->branch->activateAction = 'Activate Branch';
|
||||
$lang->branch->close = 'Close';
|
||||
$lang->branch->closeAction = 'Close Branch';
|
||||
$lang->branch->create = 'Create Branch';
|
||||
$lang->branch->merge = 'Merge';
|
||||
|
||||
$lang->branch->id = 'ID';
|
||||
$lang->branch->product = 'Produkt';
|
||||
@@ -22,9 +28,11 @@ $lang->branch->desc = 'Desc';
|
||||
$lang->branch->order = 'Sortierung';
|
||||
$lang->branch->deleted = 'Löscht';
|
||||
|
||||
$lang->branch->confirmDelete = 'Möchten Sie diesen @branch@ löschen?';
|
||||
$lang->branch->canNotDelete = 'Es sind Daten im @branch@ vorhanden. Löschen nicht möglich.';
|
||||
$lang->branch->nameNotEmpty = 'Name must not be empty!';
|
||||
$lang->branch->confirmDelete = 'Möchten Sie diesen @branch@ löschen?';
|
||||
$lang->branch->canNotDelete = 'Es sind Daten im @branch@ vorhanden. Löschen nicht möglich.';
|
||||
$lang->branch->nameNotEmpty = 'Name must not be empty!';
|
||||
$lang->branch->confirmClose = 'Do you want to close this @branch@?';
|
||||
$lang->branch->confirmActivate = 'Do you want to activate this @branch@?';
|
||||
|
||||
$lang->branch->noData = 'No branches.';
|
||||
$lang->branch->mainBranch = 'The default main branch of the product.';
|
||||
|
||||
@@ -9,11 +9,14 @@ $lang->branch->manageTitle = '%s Management';
|
||||
$lang->branch->all = 'All ';
|
||||
$lang->branch->main = 'Main';
|
||||
|
||||
$lang->branch->edit = 'Edit';
|
||||
$lang->branch->active = 'Active';
|
||||
$lang->branch->close = 'Close';
|
||||
$lang->branch->create = 'Create Branch';
|
||||
$lang->branch->merge = 'Merge';
|
||||
$lang->branch->edit = 'Edit';
|
||||
$lang->branch->editAction = 'Edit Branch';
|
||||
$lang->branch->activate = 'Activate';
|
||||
$lang->branch->activateAction = 'Activate Branch';
|
||||
$lang->branch->close = 'Close';
|
||||
$lang->branch->closeAction = 'Close Branch';
|
||||
$lang->branch->create = 'Create Branch';
|
||||
$lang->branch->merge = 'Merge';
|
||||
|
||||
$lang->branch->id = 'ID';
|
||||
$lang->branch->product = 'Product';
|
||||
@@ -26,9 +29,11 @@ $lang->branch->order = 'Order';
|
||||
$lang->branch->deleted = 'Delete';
|
||||
$lang->branch->closed = 'Closed';
|
||||
|
||||
$lang->branch->confirmDelete = 'Do you want to delete this @branch@?';
|
||||
$lang->branch->canNotDelete = 'There is data in @branch@. It cannot be deleted.';
|
||||
$lang->branch->nameNotEmpty = 'Name must not be empty!';
|
||||
$lang->branch->confirmDelete = 'Do you want to delete this @branch@?';
|
||||
$lang->branch->canNotDelete = 'There is data in @branch@. It cannot be deleted.';
|
||||
$lang->branch->nameNotEmpty = 'Name must not be empty!';
|
||||
$lang->branch->confirmClose = 'Do you want to close this @branch@?';
|
||||
$lang->branch->confirmActivate = 'Do you want to activate this @branch@?';
|
||||
|
||||
$lang->branch->noData = 'No branches.';
|
||||
$lang->branch->mainBranch = 'The default main branch of the product.';
|
||||
|
||||
@@ -9,8 +9,14 @@ $lang->branch->manageTitle = 'Gestion %s';
|
||||
$lang->branch->all = 'Tous';
|
||||
$lang->branch->main = 'Main';
|
||||
|
||||
$lang->branch->create = 'Create Branch';
|
||||
$lang->branch->merge = 'Merge';
|
||||
$lang->branch->edit = 'Edit';
|
||||
$lang->branch->editAction = 'Edit Branch';
|
||||
$lang->branch->activate = 'Activate';
|
||||
$lang->branch->activateAction = 'Activate Branch';
|
||||
$lang->branch->close = 'Close';
|
||||
$lang->branch->closeAction = 'Close Branch';
|
||||
$lang->branch->create = 'Create Branch';
|
||||
$lang->branch->merge = 'Merge';
|
||||
|
||||
$lang->branch->id = 'ID';
|
||||
$lang->branch->product = 'Product';
|
||||
@@ -22,9 +28,11 @@ $lang->branch->desc = 'Desc';
|
||||
$lang->branch->order = 'Ordre';
|
||||
$lang->branch->deleted = 'Delete';
|
||||
|
||||
$lang->branch->confirmDelete = "Voulez-vous vraiment supprimer l'établissement @branch@ ?";
|
||||
$lang->branch->canNotDelete = 'Attention ! Il y a des données dans @branch@. Suppression impossible !';
|
||||
$lang->branch->nameNotEmpty = 'Name must not be empty!';
|
||||
$lang->branch->confirmDelete = "Voulez-vous vraiment supprimer l'établissement @branch@ ?";
|
||||
$lang->branch->canNotDelete = 'Attention ! Il y a des données dans @branch@. Suppression impossible !';
|
||||
$lang->branch->nameNotEmpty = 'Name must not be empty!';
|
||||
$lang->branch->confirmClose = 'Do you want to close this @branch@?';
|
||||
$lang->branch->confirmActivate = 'Do you want to activate this @branch@?';
|
||||
|
||||
$lang->branch->noData = 'No branches.';
|
||||
$lang->branch->mainBranch = 'The default main branch of the product.';
|
||||
|
||||
@@ -9,8 +9,14 @@ $lang->branch->manageTitle = 'Quản lý %s';
|
||||
$lang->branch->all = 'Tất cả ';
|
||||
$lang->branch->main = 'Main';
|
||||
|
||||
$lang->branch->create = 'Create Branch';
|
||||
$lang->branch->merge = 'Merge';
|
||||
$lang->branch->edit = 'Edit';
|
||||
$lang->branch->editAction = 'Edit Branch';
|
||||
$lang->branch->activate = 'Activate';
|
||||
$lang->branch->activateAction = 'Activate Branch';
|
||||
$lang->branch->close = 'Close';
|
||||
$lang->branch->closeAction = 'Close Branch';
|
||||
$lang->branch->create = 'Create Branch';
|
||||
$lang->branch->merge = 'Merge';
|
||||
|
||||
$lang->branch->id = 'ID';
|
||||
$lang->branch->product = 'Sản phẩm';
|
||||
@@ -22,9 +28,11 @@ $lang->branch->desc = 'Desc';
|
||||
$lang->branch->order = 'Sắp xếp';
|
||||
$lang->branch->deleted = 'Xóa';
|
||||
|
||||
$lang->branch->confirmDelete = 'Bạn có muốn xóa @branch@ này?';
|
||||
$lang->branch->canNotDelete = 'Có dữ liệu trong @branch@. Nó không thể bị xóa.';
|
||||
$lang->branch->nameNotEmpty = 'Name must not be empty!';
|
||||
$lang->branch->confirmDelete = 'Bạn có muốn xóa @branch@ này?';
|
||||
$lang->branch->canNotDelete = 'Có dữ liệu trong @branch@. Nó không thể bị xóa.';
|
||||
$lang->branch->nameNotEmpty = 'Name must not be empty!';
|
||||
$lang->branch->confirmClose = 'Do you want to close this @branch@?';
|
||||
$lang->branch->confirmActivate = 'Do you want to activate this @branch@?';
|
||||
|
||||
$lang->branch->noData = 'No branches.';
|
||||
$lang->branch->mainBranch = 'The default main branch of the product.';
|
||||
|
||||
@@ -9,11 +9,14 @@ $lang->branch->manageTitle = '%s管理';
|
||||
$lang->branch->all = '所有';
|
||||
$lang->branch->main = '主干';
|
||||
|
||||
$lang->branch->edit = '编辑';
|
||||
$lang->branch->active = '激活';
|
||||
$lang->branch->close = '关闭';
|
||||
$lang->branch->create = '新增分支';
|
||||
$lang->branch->merge = '合并';
|
||||
$lang->branch->edit = '编辑';
|
||||
$lang->branch->editAction = '编辑分支';
|
||||
$lang->branch->activate = '激活';
|
||||
$lang->branch->activateAction = '激活分支';
|
||||
$lang->branch->close = '关闭';
|
||||
$lang->branch->closeAction = '关闭分支';
|
||||
$lang->branch->create = '新增分支';
|
||||
$lang->branch->merge = '合并';
|
||||
|
||||
$lang->branch->id = 'ID';
|
||||
$lang->branch->product = '所属产品';
|
||||
@@ -26,9 +29,11 @@ $lang->branch->order = '排序';
|
||||
$lang->branch->deleted = '已删除';
|
||||
$lang->branch->closed = '已关闭';
|
||||
|
||||
$lang->branch->confirmDelete = '是否删除该@branch@?';
|
||||
$lang->branch->canNotDelete = '该@branch@下已经有数据,不能删除!';
|
||||
$lang->branch->nameNotEmpty = '名称不能为空!';
|
||||
$lang->branch->confirmDelete = '是否删除该@branch@?';
|
||||
$lang->branch->canNotDelete = '该@branch@下已经有数据,不能删除!';
|
||||
$lang->branch->nameNotEmpty = '名称不能为空!';
|
||||
$lang->branch->confirmClose = '是否关闭该@branch@?';
|
||||
$lang->branch->confirmActivate = '是否激活该@branch@?';
|
||||
|
||||
$lang->branch->noData = '暂时没有分支。';
|
||||
$lang->branch->mainBranch = '产品默认主干分支。';
|
||||
|
||||
@@ -8,8 +8,14 @@ $lang->branch->add = '添加';
|
||||
$lang->branch->manageTitle = '%s管理';
|
||||
$lang->branch->all = '所有';
|
||||
|
||||
$lang->branch->create = '新增分支';
|
||||
$lang->branch->merge = '合併';
|
||||
$lang->branch->edit = '編輯';
|
||||
$lang->branch->editAction = '編輯分支';
|
||||
$lang->branch->activate = '啟動';
|
||||
$lang->branch->activateAction = '啟動分支';
|
||||
$lang->branch->close = '關閉';
|
||||
$lang->branch->closeAction = '關閉分支';
|
||||
$lang->branch->create = '新增分支';
|
||||
$lang->branch->merge = '合併';
|
||||
|
||||
$lang->branch->id = '編號';
|
||||
$lang->branch->product = '所屬產品';
|
||||
@@ -21,9 +27,11 @@ $lang->branch->desc = '分支描述';
|
||||
$lang->branch->order = '排序';
|
||||
$lang->branch->deleted = '已刪除';
|
||||
|
||||
$lang->branch->confirmDelete = '是否刪除該@branch@?';
|
||||
$lang->branch->canNotDelete = '該@branch@下已經有數據,不能刪除!';
|
||||
$lang->branch->nameNotEmpty = '名稱不能為空!';
|
||||
$lang->branch->confirmDelete = '是否刪除該@branch@?';
|
||||
$lang->branch->canNotDelete = '該@branch@下已經有數據,不能刪除!';
|
||||
$lang->branch->nameNotEmpty = '名稱不能為空!';
|
||||
$lang->branch->confirmClose = '是否關閉该@branch@?';
|
||||
$lang->branch->confirmActivate = '是否啟動该@branch@?';
|
||||
|
||||
$lang->branch->noData = '暫時沒有分支。';
|
||||
$lang->branch->mainBranch = '產品默認主幹分支。';
|
||||
|
||||
+90
-3
@@ -15,10 +15,12 @@ class branchModel extends model
|
||||
* Get name by id.
|
||||
*
|
||||
* @param int $branchID
|
||||
* @param int $productID
|
||||
* @param bool $queryAll
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getById($branchID, $productID = 0)
|
||||
public function getById($branchID, $productID = 0, $queryAll = false)
|
||||
{
|
||||
if(empty($branchID))
|
||||
{
|
||||
@@ -27,6 +29,9 @@ class branchModel extends model
|
||||
if(empty($product) or !isset($this->lang->product->branchName[$product->type])) return false;
|
||||
return $this->lang->branch->main;
|
||||
}
|
||||
|
||||
if($queryAll) return $this->dao->select('*')->from(TABLE_BRANCH)->where('id')->eq($branchID)->fetch();
|
||||
|
||||
return htmlspecialchars_decode($this->dao->select('*')->from(TABLE_BRANCH)->where('id')->eq($branchID)->fetch('name'));
|
||||
}
|
||||
|
||||
@@ -81,6 +86,7 @@ class branchModel extends model
|
||||
$branches = $this->dao->select('*')->from(TABLE_BRANCH)
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF($productID)->andWhere('product')->eq($productID)->fi()
|
||||
->beginIF(strpos($params, 'active') !== false)->andWhere('status')->eq('active')->fi()
|
||||
->orderBy('`order`')
|
||||
->fetchPairs('id', 'name');
|
||||
foreach($branches as $branchID => $branchName) $branches[$branchID] = htmlspecialchars_decode($branchName);
|
||||
@@ -128,11 +134,92 @@ class branchModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage branch
|
||||
* Create a branch.
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return bool
|
||||
* @return int|bool
|
||||
*/
|
||||
public function create($productID)
|
||||
{
|
||||
$branch = fixer::input('post')
|
||||
->add('product', $productID)
|
||||
->add('createdDate', helper::today())
|
||||
->add('status', 'active')
|
||||
->get();
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update branch.
|
||||
*
|
||||
* @param int $branchID
|
||||
* @access public
|
||||
* @return array|bool
|
||||
*/
|
||||
public function update($branchID)
|
||||
{
|
||||
$oldBranch = $this->getById($branchID, 0, true);
|
||||
|
||||
$newBranch = fixer::input('post')->get();
|
||||
$newBranch->closedDate = $newBranch->status == 'closed' ? helper::today() : '';
|
||||
|
||||
$this->dao->update(TABLE_BRANCH)->data($newBranch)
|
||||
->where('id')->eq($branchID)
|
||||
->batchCheck($this->config->branch->edit->requiredFields, 'notempty')
|
||||
->exec();
|
||||
|
||||
if(!dao::isError()) return common::createChanges($oldBranch, $newBranch);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Close a branch.
|
||||
*
|
||||
* @param int $branchID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function close($branchID)
|
||||
{
|
||||
$this->dao->update(TABLE_BRANCH)
|
||||
->set('status')->eq('closed')
|
||||
->set('closedDate')->eq(helper::today())
|
||||
->where('id')->eq($branchID)
|
||||
->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate a branch.
|
||||
*
|
||||
* @param int $branchID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function activate($branchID)
|
||||
{
|
||||
$this->dao->update(TABLE_BRANCH)
|
||||
->set('status')->eq('active')
|
||||
->set('closedDate')->eq('')
|
||||
->where('id')->eq($branchID)
|
||||
->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage branch.
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return bool|array
|
||||
*/
|
||||
public function manage($productID)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* The create view file of branch module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2021 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Qiyu Xie <xieqiyu@easycorp.ltd>
|
||||
* @package branch
|
||||
* @version $Id$
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->branch->create;?></h2>
|
||||
</div>
|
||||
<form class='main-form' method='post' target='hiddenwin'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->branch->name;?></th>
|
||||
<td><?php echo html::input('name', '', "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->branch->desc;?></th>
|
||||
<td><?php echo html::input('desc', '', "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' class='text-center form-actions'><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* The edit view file of branch module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2021 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Qiyu Xie <xieqiyu@easycorp.ltd>
|
||||
* @package branch
|
||||
* @version $Id$
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->branch->create;?></h2>
|
||||
</div>
|
||||
<form class='main-form' method='post' target='hiddenwin'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->branch->name;?></th>
|
||||
<td><?php echo html::input('name', $branch->name, "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->branch->status;?></th>
|
||||
<td><?php echo html::select('status', $lang->branch->statusList, $branch->status, "class='form-control chosen'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->branch->desc;?></th>
|
||||
<td><?php echo html::input('desc', $branch->desc, "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' class='text-center form-actions'><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -27,7 +27,7 @@
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php if($canCreate) common::printLink('branch', 'create', "productID=$productID", "<i class='icon icon-plus'></i> " . $lang->branch->create, '', "class='btn btn-primary'");?>
|
||||
<?php if($canCreate) common::printLink('branch', 'create', "productID=$productID", "<i class='icon icon-plus'></i> " . $lang->branch->create, '', "class='btn btn-primary iframe'", true, true);?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainContent">
|
||||
@@ -35,7 +35,7 @@
|
||||
<div class="table-empty-tip">
|
||||
<p>
|
||||
<span class="text-muted"><?php echo $lang->branch->noData;?></span>
|
||||
<?php if($canCreate) echo html::a($this->createLink('branch', 'create', "productID=$productID"), "<i class='icon icon-plus'></i> " . $lang->branch->create, '', "class='btn btn-info'");?>
|
||||
<?php if($canCreate) echo html::a($this->createLink('branch', 'create', "productID=$productID", '', true), "<i class='icon icon-plus'></i> " . $lang->branch->create, '', "class='btn btn-info iframe'");?>
|
||||
</p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
@@ -75,14 +75,14 @@
|
||||
<td class='c-actions'>
|
||||
<?php
|
||||
$disabled = $branch->id == BRANCH_MAIN ? 'disabled' : '';
|
||||
common::printIcon('branch', 'edit', "branchID=$branch->id", $branch, 'list', '', '', $disabled);
|
||||
common::printIcon('branch', 'edit', "branchID=$branch->id", $branch, 'list', '', '', "$disabled iframe", true);
|
||||
if($branch->status == 'active')
|
||||
{
|
||||
common::printIcon('branch', 'close', "branchID=$branch->id", $branch, 'list', 'off', '', $disabled);
|
||||
common::printIcon('branch', 'close', "branchID=$branch->id", $branch, 'list', 'off', 'hiddenwin', $disabled);
|
||||
}
|
||||
else
|
||||
{
|
||||
common::printIcon('branch', 'active', "branchID=$branch->id", $branch, 'list', 'active', '', $disabled);
|
||||
common::printIcon('branch', 'activate', "branchID=$branch->id", $branch, 'list', 'active', 'hiddenwin', $disabled);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
@@ -420,13 +420,21 @@ $lang->product->methodOrder[105] = 'unbindWhitelist';
|
||||
|
||||
/* Branch. */
|
||||
$lang->resource->branch = new stdclass();
|
||||
$lang->resource->branch->manage = 'manage';
|
||||
$lang->resource->branch->sort = 'sort';
|
||||
$lang->resource->branch->delete = 'delete';
|
||||
$lang->resource->branch->manage = 'manage';
|
||||
$lang->resource->branch->create = 'create';
|
||||
$lang->resource->branch->edit = 'editAction';
|
||||
$lang->resource->branch->close = 'closeAction';
|
||||
$lang->resource->branch->activate = 'activateAction';
|
||||
$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] = 'edit';
|
||||
$lang->branch->methodOrder[15] = 'close';
|
||||
$lang->branch->methodOrder[20] = 'activate';
|
||||
$lang->branch->methodOrder[25] = 'sort';
|
||||
$lang->branch->methodOrder[30] = 'delete';
|
||||
|
||||
/* Story. */
|
||||
$lang->resource->story = new stdclass();
|
||||
|
||||
@@ -313,7 +313,7 @@ class story extends control
|
||||
$this->view->color = $color;
|
||||
$this->view->pri = $pri;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->branches = $product->type != 'normal' ? $this->loadModel('branch')->getPairs($productID) : array();
|
||||
$this->view->branches = $product->type != 'normal' ? $this->loadModel('branch')->getPairs($productID, 'active') : array();
|
||||
$this->view->productID = $productID;
|
||||
$this->view->product = $product;
|
||||
$this->view->objectID = $objectID;
|
||||
|
||||
Reference in New Issue
Block a user