diff --git a/module/common/model.php b/module/common/model.php index bb2557a531..86162c6714 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1366,17 +1366,6 @@ class commonModel extends model global $app; if(strpos($misc, 'data-app') === false) $misc .= ' data-app="' . $app->tab . '"'; - /* Judge the $method of $module clickable or not, default is clickable. */ - if(is_object($object)) - { - if($app->getModuleName() != $module) $app->control->loadModel($module); - $modelClass = class_exists("ext{$module}Model") ? "ext{$module}Model" : $module . "Model"; - if(class_exists($modelClass) and is_callable(array($modelClass, 'isClickable'))) - { - if(!call_user_func_array(array($modelClass, 'isClickable'), array($object, $method))) $misc .= 'disabled="disabled"'; - } - } - if(!commonModel::hasPriv($module, $method, $object)) return false; echo html::a(helper::createLink($module, $method, $vars, '', $onlyBody), $label, $target, $misc, $newline); return true; diff --git a/module/productplan/control.php b/module/productplan/control.php index 2e2907e80a..6b05726cbb 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -295,6 +295,7 @@ class productplan extends control $this->view->plans = $this->productplan->getList($productID, $branch, $browseType, $pager, $sort); $this->view->pager = $pager; $this->view->projects = $this->product->getProjectPairsByProduct($productID, $branch); + $this->view->statusList = $this->lang->productplan->featureBar['browse']; $this->display(); } diff --git a/module/productplan/css/browse.css b/module/productplan/css/browse.css index bf38350fed..d9750bbb47 100644 --- a/module/productplan/css/browse.css +++ b/module/productplan/css/browse.css @@ -26,6 +26,7 @@ td.c-branch {overflow: hidden; text-align: left !important; text-overflow: ellip .c-title.has-child > .plan-name.has-suffix > a, .c-title.has-child > .plan-name.has-prefix > a {overflow:hidden; max-width: calc(100% - 70px);} .plan-name.has-suffix > a, .plan-name.has-prefix > a {overflow:hidden; max-width: calc(100% - 46px);} +#productplanList .plan-name > .label.label-danger {margin-left:3px; } .switchButton {background: #fff !important;} .panel-actions {position: relative; padding: 0 0; padding-top: 1px;} diff --git a/module/productplan/css/view.css b/module/productplan/css/view.css index 7f0293b5aa..251e14709d 100644 --- a/module/productplan/css/view.css +++ b/module/productplan/css/view.css @@ -25,5 +25,5 @@ ol, ul {padding-left: 20px;} .body-modal #mainMenu>.btn-toolbar {width: auto;} .body-modal #mainContent {min-height: 240px;} -#mainMenu .btn-link[disabled] {color: #9e54ae; background: transparent; border-color:transparent;} +#mainMenu .btn-link.disabled {color: #9e54ae; background: transparent; border-color:transparent;} #mainMenu .icon-checked, #mainMenu .icon-off, #mainMenu .icon-play, #mainMenu .icon-magic {margin-right: 3px;} diff --git a/module/productplan/view/browsebylist.html.php b/module/productplan/view/browsebylist.html.php index c9289f94d2..7c0a83fa02 100644 --- a/module/productplan/view/browsebylist.html.php +++ b/module/productplan/view/browsebylist.html.php @@ -56,6 +56,9 @@ idAB);?> productplan->title);?> + + productplan->status);?> + session->currentProductType != 'normal'):?> productplan->branch);?> @@ -117,6 +120,9 @@ if(!empty($suffix)) echo $suffix . ''; ?> + + status)?> + session->currentProductType != 'normal'):?> parent != '-1') echo $branchOption[$plan->branch];?> @@ -144,9 +150,9 @@ $attr = "data-toggle='modal' data-id='{$plan->id}' data-width='550px'"; $isOnlyBody = true; } - common::printLink('productplan', 'start', "planID=$plan->id", '', '', "class='btn {$class}'{$attr} title='{$lang->productplan->start}'", '', $isOnlyBody, $plan); - common::printLink('productplan', 'finish', "planID=$plan->id", '', '', "class='btn' target='hiddenwin' title='{$lang->productplan->finish}'", '', false, $plan); - common::printLink('productplan', 'close', "planID=$plan->id", '', '', "class='btn' target='hiddenwin' title='{$lang->productplan->close}'", '', false, $plan); + common::printIcon('productplan', 'start', "planID=$plan->id", $plan, 'list', 'play', '', $class, $isOnlyBody, $attr, $lang->productplan->start); + common::printIcon('productplan', 'finish', "planID=$plan->id", $plan, 'list', 'checked', '', $class, false, $attr, $lang->productplan->finish); + common::printIcon('productplan', 'close', "planID=$plan->id", $plan, 'list', 'off', '', $class, false, $attr, $lang->productplan->close); } $attr = $plan->expired ? "disabled='disabled'" : ''; diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index cf098fbf82..d891801f4b 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -53,10 +53,14 @@ $attr = "data-toggle='modal' data-id='{$plan->id}' data-width='550px'"; $isOnlyBody = true; } + $class = $plan->status == 'wait' ? $class : 'disabled'; common::printLink('productplan', 'start', "planID=$plan->id", "{$lang->productplan->startAB}", '', "class='btn btn-link {$class}'{$attr} title='{$lang->productplan->start}'", '', $isOnlyBody, $plan); - common::printLink('productplan', 'finish', "planID=$plan->id", "{$lang->productplan->finishAB}", '', "class='btn btn-link' target='hiddenwin' title='{$lang->productplan->finish}'", '', false, $plan); - common::printLink('productplan', 'close', "planID=$plan->id", "{$lang->productplan->closeAB}", '', "class='btn btn-link' target='hiddenwin' title='{$lang->productplan->close}'", '', false, $plan); - common::printLink('productplan', 'activate', "planID=$plan->id", "{$lang->productplan->activateAB}", '', "class='btn btn-link' target='hiddenwin' title='{$lang->productplan->activate}'", '', false, $plan); + $class = $plan->status == 'doing' ? '' : 'disabled'; + common::printLink('productplan', 'finish', "planID=$plan->id", "{$lang->productplan->finishAB}", '', "class='btn btn-link {$class}' target='hiddenwin' title='{$lang->productplan->finish}'", '', false, $plan); + $class = $plan->status == 'done' ? '' : 'disabled'; + common::printLink('productplan', 'close', "planID=$plan->id", "{$lang->productplan->closeAB}", '', "class='btn btn-link {$class}' target='hiddenwin' title='{$lang->productplan->close}'", '', false, $plan); + $class = $plan->status == 'closed' ? '' : 'disabled'; + common::printLink('productplan', 'activate', "planID=$plan->id", "{$lang->productplan->activateAB}", '', "class='btn btn-link {$class}' target='hiddenwin' title='{$lang->productplan->activate}'", '', false, $plan); } if(common::hasPriv('productplan', 'create', $plan) and $plan->parent <= '0') echo html::a($this->createLink('productplan', 'create', "product={$plan->product}&branch={$plan->branch}&parent={$plan->id}"), " " . $this->lang->productplan->children , '', "class='btn btn-link' title='{$this->lang->productplan->children}'");