* Refactor create child plan.

This commit is contained in:
tianshujie
2023-07-05 15:53:29 +08:00
parent 20d99a241d
commit 4e27496f89
3 changed files with 9 additions and 5 deletions
+2
View File
@@ -125,6 +125,8 @@ $config->productplan->dtable->fieldList['actions']['actionsMap']['bug']['hint']
$config->productplan->dtable->fieldList['actions']['actionsMap']['edit']['icon'] = 'edit';
$config->productplan->dtable->fieldList['actions']['actionsMap']['split']['icon'] = 'split';
$config->productplan->dtable->fieldList['actions']['actionsMap']['split']['hint'] = $lang->productplan->createChildren;
$config->productplan->dtable->fieldList['actions']['actionsMap']['split']['text'] = $lang->productplan->createChildren;
$config->productplan->dtable->fieldList['actions']['actionsMap']['trash']['icon'] = 'trash';
$config->productplan->dtable->fieldList['actions']['actionsMap']['trash']['url'] = 'javascript:deleteProductPlan("{planID}")';
+5 -4
View File
@@ -1439,7 +1439,7 @@ class productplanModel extends model
$actions[] = $this->buildActionBtn($this->app->rawModule, 'edit', $params, $plan, $type);
}
$actions[] = $this->buildActionBtn($this->app->rawModule, 'create', "product={$plan->product}&branch={$plan->branch}&parent={$plan->id}", $plan, $type, 'split', '', '', '', '', $this->lang->productplan->children);
if($canCreateChild) $actions[] = $this->buildActionBtn($this->app->rawModule, 'create', "product={$plan->product}&branch={$plan->branch}&parent={$plan->id}", $plan, $type, 'split', '', '', '', '', $this->lang->productplan->children);
if($type == 'browse')
{
@@ -1510,10 +1510,11 @@ class productplanModel extends model
$isClick = true;
if(method_exists($this, 'isClickable')) $isClick = $this->isClickable($data, $method, $module);
$link = helper::createLink($module, $method, $params, '', $onlyBody);
if(isset($this->config->productplan->dtable->fieldList['actions']['actionsMap'][$method]['url']))
$link = helper::createLink($module, $method, $params, '', $onlyBody);
$actionName = $icon == 'split' ? 'split' : $method;
if(isset($this->config->productplan->dtable->fieldList['actions']['actionsMap'][$actionName]['url']))
{
$link = $this->config->productplan->dtable->fieldList['actions']['actionsMap'][$method]['url'];
$link = $this->config->productplan->dtable->fieldList['actions']['actionsMap'][$actionName]['url'];
}
global $lang;
+2 -1
View File
@@ -110,6 +110,7 @@ function rearrangeActionBtns($actions)
$actionMap = array();
foreach($actions as $action)
{
$action['text'] = '';
$actionMap[$action['name']] = $action;
}
@@ -173,7 +174,7 @@ function rearrangeActionBtns($actions)
$result[] = $actionMap['edit'];
$result[] = array('type' => 'dropdown', 'icon' => 'icon-ellipsis-v', 'caret' => false, 'items' => array
(
$actionMap['edit'],
$actionMap['split'],
$actionMap['trash'],
));