diff --git a/module/bug/model.php b/module/bug/model.php index 9cb4a4083c..57fee78580 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2500,6 +2500,9 @@ class bugModel extends model */ public function printCell($col, $bug, $users, $builds, $branches, $modulePairs, $projects = array(), $plans = array(), $stories = array(), $tasks = array(), $mode = 'datatable') { + /* Check the product is closed. */ + $isClosedProject = common::checkParentObjectClosed('bug', $bug); + $canBatchEdit = common::hasPriv('bug', 'batchEdit'); $canBatchConfirm = common::hasPriv('bug', 'batchConfirm'); $canBatchClose = common::hasPriv('bug', 'batchClose'); @@ -2569,7 +2572,8 @@ class bugModel extends model case 'id': if($canBatchAction) { - echo html::checkbox('bugIDList', array($bug->id => '')) . html::a(helper::createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id)); + $disabled = $isClosedProject ? 'disabled' : ''; + echo html::checkbox('bugIDList', array($bug->id => ''), '', $disabled) . html::a(helper::createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id)); } else { @@ -2720,12 +2724,15 @@ class bugModel extends model echo substr($bug->lastEditedDate, 5, 11); break; case 'actions': - $params = "bugID=$bug->id"; - common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); - common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true); - common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); - common::printIcon('bug', 'edit', $params, $bug, 'list'); - common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=$params", $bug, 'list', 'copy'); + if(!$isClosedProject) + { + $params = "bugID=$bug->id"; + common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); + common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true); + common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); + common::printIcon('bug', 'edit', $params, $bug, 'list'); + common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=$params", $bug, 'list', 'copy'); + } break; } echo ''; diff --git a/module/common/model.php b/module/common/model.php index 34223b1825..4bf899e77e 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -952,6 +952,7 @@ EOD; } if(strpos(',edit,copy,report,export,delete,', ",$method,") !== false) $module = 'common'; $class = "icon-$module-$method"; + if(!$clickable) $class .= ' disabled'; if($icon) $class .= ' icon-' . $icon; @@ -1488,6 +1489,9 @@ EOD; { global $app, $lang; + /* Check the parent object is closed. */ + if(commonModel::checkParentObjectClosed($module, $object)) return false; + /* Check is the super admin or not. */ if(!empty($app->user->admin) || strpos($app->company->admins, ",{$app->user->account},") !== false) return true; /* If not super admin, check the rights. */ @@ -1837,6 +1841,50 @@ EOD; return strpos('|zh-cn|zh-tw|', '|' . $app->getClientLang() . '|') === false; } + /** + * Check the parent object is closed. + * + * @param string $module + * @param object $object + * @static + * @access public + * @return bool + */ + public static function checkParentObjectClosed($module, $object = null) + { + global $app, $config; + + /* Check the product is closed. */ + if(!empty($object->product) and !empty($config->global->closedProductStatus)) + { + $product = $app->control->loadModel('product')->getByID($object->product); + if($product->status == 'closed') return true; + + /* Get the projects associated with the story. */ + if($module == 'story' and empty($object->project)) + { + $projects = $app->dbh->query('SELECT project FROM ' . TABLE_PROJECTSTORY . " WHERE `story` = '$object->id'")->fetchAll(); + $projectIDList = array(); + foreach($projects as $project) $projectIDList[] = $project->project; + + $object->project = implode(',', $projectIDList); + } + } + + /* Check the project is closed. */ + if(!empty($object->project) and !empty($config->global->closedProjectStatus)) + { + $projectIDList = explode(',', $object->project); + $projects = $app->control->loadModel('project')->getByIDList($projectIDList); + foreach($projects as $project) + { + if($project->status == 'closed') return true; + } + } + + return false; + } + /** * Response. * diff --git a/module/custom/control.php b/module/custom/control.php index 92aa676834..903b0edf79 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -347,6 +347,46 @@ class custom extends control $this->display(); } + /** + * Set whether the project is on read-only. + * + * @access public + * @return void + */ + public function project() + { + if($_POST) + { + $this->loadModel('setting')->setItem('system.common.global.closedProjectStatus', $this->post->project); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload')); + } + + $this->view->title = $this->lang->custom->project; + $this->view->position[] = $this->lang->custom->common; + $this->view->position[] = $this->view->title; + $this->display(); + } + + /** + * Set whether the product is on read-only. + * + * @access public + * @return void + */ + public function product() + { + if($_POST) + { + $this->loadModel('setting')->setItem('system.common.global.closedProductStatus', $this->post->product); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload')); + } + + $this->view->title = $this->lang->custom->product; + $this->view->position[] = $this->lang->custom->common; + $this->view->position[] = $this->view->title; + $this->display(); + } + /** * Ajax save custom fields. * diff --git a/module/custom/lang/de.php b/module/custom/lang/de.php index 42190ef5b9..6cf9a0d17f 100644 --- a/module/custom/lang/de.php +++ b/module/custom/lang/de.php @@ -1,24 +1,30 @@ custom->common = 'Custom'; -$lang->custom->index = 'Home'; -$lang->custom->set = 'Customize'; -$lang->custom->restore = 'Reset to Default'; -$lang->custom->key = 'Key'; -$lang->custom->value = 'Value'; -$lang->custom->flow = 'Concept'; -$lang->custom->working = 'WorkStyle'; -$lang->custom->select = 'Select Concept'; -$lang->custom->branch = 'Multi Branch'; -$lang->custom->owner = 'Owner'; -$lang->custom->module = 'Module'; -$lang->custom->section = 'Section'; -$lang->custom->lang = 'Language'; -$lang->custom->setPublic = 'Set Public'; -$lang->custom->required = 'Required'; -$lang->custom->score = 'Score'; -$lang->custom->timezone = 'Timezone'; -$lang->custom->scoreReset = 'Reset Score'; -$lang->custom->scoreTitle = 'Point Feature'; +$lang->custom->common = 'Custom'; +$lang->custom->index = 'Home'; +$lang->custom->set = 'Customize'; +$lang->custom->restore = 'Reset to Default'; +$lang->custom->key = 'Key'; +$lang->custom->value = 'Value'; +$lang->custom->flow = 'Concept'; +$lang->custom->working = 'WorkStyle'; +$lang->custom->select = 'Select Concept'; +$lang->custom->branch = 'Multi Branch'; +$lang->custom->owner = 'Owner'; +$lang->custom->module = 'Module'; +$lang->custom->section = 'Section'; +$lang->custom->lang = 'Language'; +$lang->custom->setPublic = 'Set Public'; +$lang->custom->required = 'Required'; +$lang->custom->score = 'Score'; +$lang->custom->timezone = 'Timezone'; +$lang->custom->scoreReset = 'Reset Score'; +$lang->custom->scoreTitle = 'Point Feature'; +$lang->custom->projectTitle = $lang->projectCommon . ' Feature'; +$lang->custom->productTitle = $lang->productCommon . ' Feature'; +$lang->custom->project = $lang->projectCommon; +$lang->custom->product = $lang->productCommon; +$lang->custom->closedProject = 'Closed ' . $lang->projectCommon; +$lang->custom->closedProduct = 'Closed ' . $lang->productCommon; $lang->custom->object['story'] = 'Story'; $lang->custom->object['task'] = 'Task'; @@ -78,7 +84,7 @@ $lang->custom->user->fields['statusList'] = 'Status'; $lang->custom->user->fields['contactField'] = 'Available Contact'; $lang->custom->user->fields['deleted'] = 'Show deleted user'; -$lang->custom->system = array('flow', 'working', 'required', 'score'); +$lang->custom->system = array('flow', 'working', 'required', 'score', 'product', 'project'); $lang->custom->block->fields['closed'] = 'Closed Block'; @@ -100,6 +106,8 @@ $lang->custom->notice->noClosedBlock = 'You have no blocks that are closed p $lang->custom->notice->required = 'The selected field is required.'; $lang->custom->notice->conceptResult = 'According to your preference, %s-%s is set for you. Use %s + %s。'; $lang->custom->notice->conceptPath = 'Go to Admin -> Custom -> Concept to set it.'; +$lang->custom->notice->readOnlyOfProject = 'If Change Forbidden, any change on tasks, builds, efforts and stories of the closed project is also forbidden.'; +$lang->custom->notice->readOnlyOfProduct = 'If Change Forbidden, any change on stories, bugs, cases, efforts, releases and plans of the closed product is also forbidden.'; $lang->custom->notice->indexPage['product'] = "ZenTao 8.2+ has Product Homepage. Do you want to go to Product Homepage?"; $lang->custom->notice->indexPage['project'] = "ZenTao 8.2+ has Project Homepage. Do you want to go to Project Homepage?"; @@ -145,6 +153,12 @@ $lang->custom->page = ' Page'; $lang->custom->scoreStatus[1] = 'On'; $lang->custom->scoreStatus[0] = 'Off'; +$lang->custom->closedProjectStatus[1] = 'Change Forbidden'; +$lang->custom->closedProjectStatus[0] = 'Change Allowed'; + +$lang->custom->closedProductStatus[1] = 'Change Forbidden'; +$lang->custom->closedProductStatus[0] = 'Change Allowed'; + $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Plan'; $lang->custom->moduleName['project'] = $lang->projectCommon; diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index 1696ac25ed..d46abe9390 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -1,24 +1,30 @@ custom->common = 'Custom'; -$lang->custom->index = 'Home'; -$lang->custom->set = 'Customize'; -$lang->custom->restore = 'Reset'; -$lang->custom->key = 'Key'; -$lang->custom->value = 'Value'; -$lang->custom->flow = 'Concept'; -$lang->custom->working = 'Mode'; -$lang->custom->select = 'Select Concept'; -$lang->custom->branch = 'Multi-Branch'; -$lang->custom->owner = 'Owner'; -$lang->custom->module = 'Module'; -$lang->custom->section = 'Section'; -$lang->custom->lang = 'Language'; -$lang->custom->setPublic = 'Set Public'; -$lang->custom->required = 'Required Field'; -$lang->custom->score = 'Point'; -$lang->custom->timezone = 'Timezone'; -$lang->custom->scoreReset = 'Reset Points'; -$lang->custom->scoreTitle = 'Point Feature'; +$lang->custom->common = 'Custom'; +$lang->custom->index = 'Home'; +$lang->custom->set = 'Customize'; +$lang->custom->restore = 'Reset'; +$lang->custom->key = 'Key'; +$lang->custom->value = 'Value'; +$lang->custom->flow = 'Concept'; +$lang->custom->working = 'Mode'; +$lang->custom->select = 'Select Concept'; +$lang->custom->branch = 'Multi-Branch'; +$lang->custom->owner = 'Owner'; +$lang->custom->module = 'Module'; +$lang->custom->section = 'Section'; +$lang->custom->lang = 'Language'; +$lang->custom->setPublic = 'Set Public'; +$lang->custom->required = 'Required Field'; +$lang->custom->score = 'Point'; +$lang->custom->timezone = 'Timezone'; +$lang->custom->scoreReset = 'Reset Points'; +$lang->custom->scoreTitle = 'Point Feature'; +$lang->custom->projectTitle = $lang->projectCommon . ' Feature'; +$lang->custom->productTitle = $lang->productCommon . ' Feature'; +$lang->custom->project = $lang->projectCommon; +$lang->custom->product = $lang->productCommon; +$lang->custom->closedProject = 'Closed ' . $lang->projectCommon; +$lang->custom->closedProduct = 'Closed ' . $lang->productCommon; $lang->custom->object['story'] = 'Story'; $lang->custom->object['task'] = 'Task'; @@ -78,7 +84,7 @@ $lang->custom->user->fields['statusList'] = 'Status'; $lang->custom->user->fields['contactField'] = 'Available Contact'; $lang->custom->user->fields['deleted'] = 'Deleted User'; -$lang->custom->system = array('flow', 'working', 'required', 'score'); +$lang->custom->system = array('flow', 'working', 'required', 'score', 'product', 'project'); $lang->custom->block->fields['closed'] = 'Closed Block'; @@ -100,6 +106,8 @@ $lang->custom->notice->noClosedBlock = 'You have no blocks that are closed p $lang->custom->notice->required = 'The selected field is required.'; $lang->custom->notice->conceptResult = 'According to your preference, %s-%s is set for you. Use %s + %s.'; $lang->custom->notice->conceptPath = 'Go to Admin -> Custom -> Concept to set it.'; +$lang->custom->notice->readOnlyOfProject = 'If Change Forbidden, any change on tasks, builds, efforts and stories of the closed project is also forbidden.'; +$lang->custom->notice->readOnlyOfProduct = 'If Change Forbidden, any change on stories, bugs, cases, efforts, releases and plans of the closed product is also forbidden.'; $lang->custom->notice->indexPage['product'] = "ZenTao 8.2+ has Product Home. Do you want to go to Product Home?"; $lang->custom->notice->indexPage['project'] = "ZenTao 8.2+ has Project Home. Do you want to go to Project Home?"; @@ -145,6 +153,12 @@ $lang->custom->page = ' Page'; $lang->custom->scoreStatus[1] = 'On'; $lang->custom->scoreStatus[0] = 'Off'; +$lang->custom->closedProjectStatus[1] = 'Change Forbidden'; +$lang->custom->closedProjectStatus[0] = 'Change Allowed'; + +$lang->custom->closedProductStatus[1] = 'Change Forbidden'; +$lang->custom->closedProductStatus[0] = 'Change Allowed'; + $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Plan'; $lang->custom->moduleName['project'] = $lang->projectCommon; diff --git a/module/custom/lang/fr.php b/module/custom/lang/fr.php index 20969e4190..1a3dc44bd5 100644 --- a/module/custom/lang/fr.php +++ b/module/custom/lang/fr.php @@ -1,24 +1,30 @@ custom->common = 'Personnalisation'; -$lang->custom->index = 'Accueil'; -$lang->custom->set = 'Personnaliser'; -$lang->custom->restore = 'Réinitialiser'; -$lang->custom->key = 'Clé'; -$lang->custom->value = 'Valeur'; -$lang->custom->flow = 'Concept'; -$lang->custom->working = 'Mode'; -$lang->custom->select = 'Choix du Concept'; -$lang->custom->branch = 'Multi-Branches'; -$lang->custom->owner = 'Propriétaire'; -$lang->custom->module = 'Module'; -$lang->custom->section = 'Section'; -$lang->custom->lang = 'Langue'; -$lang->custom->setPublic = 'Set Public'; -$lang->custom->required = 'Champ Obligatoire'; -$lang->custom->score = 'Point'; -$lang->custom->timezone = 'Timezone'; -$lang->custom->scoreReset = 'Réinit Points'; -$lang->custom->scoreTitle = 'Fonctionnalité des Points'; +$lang->custom->common = 'Personnalisation'; +$lang->custom->index = 'Accueil'; +$lang->custom->set = 'Personnaliser'; +$lang->custom->restore = 'Réinitialiser'; +$lang->custom->key = 'Clé'; +$lang->custom->value = 'Valeur'; +$lang->custom->flow = 'Concept'; +$lang->custom->working = 'Mode'; +$lang->custom->select = 'Choix du Concept'; +$lang->custom->branch = 'Multi-Branches'; +$lang->custom->owner = 'Propriétaire'; +$lang->custom->module = 'Module'; +$lang->custom->section = 'Section'; +$lang->custom->lang = 'Langue'; +$lang->custom->setPublic = 'Set Public'; +$lang->custom->required = 'Champ Obligatoire'; +$lang->custom->score = 'Point'; +$lang->custom->timezone = 'Timezone'; +$lang->custom->scoreReset = 'Réinit Points'; +$lang->custom->scoreTitle = 'Fonctionnalité des Points'; +$lang->custom->projectTitle = 'Fonctionnalité des ' . $lang->projectCommon; +$lang->custom->productTitle = 'Fonctionnalité des ' . $lang->productCommon; +$lang->custom->project = $lang->projectCommon; +$lang->custom->product = $lang->productCommon; +$lang->custom->closedProject = 'Closed ' . $lang->projectCommon; +$lang->custom->closedProduct = 'Closed ' . $lang->productCommon; $lang->custom->object['story'] = 'Story'; $lang->custom->object['task'] = 'Tâche'; @@ -78,7 +84,7 @@ $lang->custom->user->fields['statusList'] = 'Statut'; $lang->custom->user->fields['contactField'] = 'Contact'; $lang->custom->user->fields['deleted'] = 'Parti'; -$lang->custom->system = array('flow', 'working', 'required', 'score'); +$lang->custom->system = array('flow', 'working', 'required', 'score', 'product', 'project'); $lang->custom->block->fields['closed'] = 'Bloc Fermé'; @@ -100,6 +106,8 @@ $lang->custom->notice->noClosedBlock = "Vous n'avez aucun bloc fermé défin $lang->custom->notice->required = 'Le champ sélectionné est obligatoire.'; $lang->custom->notice->conceptResult = 'Selon votre préférence, %s-%s peut être fixé pour vous. Utilisez %s + %s。'; $lang->custom->notice->conceptPath = 'Allez à Admin -> Custom -> Concept pour le paramétrer.'; +$lang->custom->notice->readOnlyOfProject = 'If Change Forbidden, any change on tasks, builds, efforts and stories of the closed project is also forbidden.'; +$lang->custom->notice->readOnlyOfProduct = 'If Change Forbidden, any change on stories, bugs, cases, efforts, releases and plans of the closed product is also forbidden.'; $lang->custom->notice->indexPage['product'] = "ZenTao 8.2+ possède une page d'accueil. Voulez-vous consulter la page d'accueil du produit ?"; $lang->custom->notice->indexPage['project'] = "ZenTao 8.2+ possède une page d'accueil. Voulez-vous consulter la page d'accueil du produit ?"; @@ -145,6 +153,12 @@ $lang->custom->page = ' Page'; $lang->custom->scoreStatus[1] = 'On'; $lang->custom->scoreStatus[0] = 'Off'; +$lang->custom->closedProjectStatus[1] = 'Change Forbidden'; +$lang->custom->closedProjectStatus[0] = 'Change Allowed'; + +$lang->custom->closedProductStatus[1] = 'Change Forbidden'; +$lang->custom->closedProductStatus[0] = 'Change Allowed'; + $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Plan'; $lang->custom->moduleName['project'] = $lang->projectCommon; diff --git a/module/custom/lang/vi.php b/module/custom/lang/vi.php index 07b2a984c1..701bf485e0 100644 --- a/module/custom/lang/vi.php +++ b/module/custom/lang/vi.php @@ -1,24 +1,30 @@ custom->common = 'Tùy biến'; -$lang->custom->index = 'Trang chủ'; -$lang->custom->set = 'Tùy biến'; -$lang->custom->restore = 'Thiết lập lại'; -$lang->custom->key = 'Khóa'; -$lang->custom->value = 'Giá trị'; -$lang->custom->flow = 'Mô hình'; -$lang->custom->working = 'Chế độ'; -$lang->custom->select = 'Chọn mô hình'; -$lang->custom->branch = 'Multi-Branch'; -$lang->custom->owner = 'Sở hữu'; -$lang->custom->module = 'Module'; -$lang->custom->section = 'Section'; -$lang->custom->lang = 'Ngôn ngữ'; -$lang->custom->setPublic = 'Thiết lập Public'; -$lang->custom->required = 'Trường bắt buộc'; -$lang->custom->score = 'Điểm'; -$lang->custom->timezone = 'Timezone'; -$lang->custom->scoreReset = 'Thiết lập lại điểm'; -$lang->custom->scoreTitle = 'Tính năng điểm'; +$lang->custom->common = 'Tùy biến'; +$lang->custom->index = 'Trang chủ'; +$lang->custom->set = 'Tùy biến'; +$lang->custom->restore = 'Thiết lập lại'; +$lang->custom->key = 'Khóa'; +$lang->custom->value = 'Giá trị'; +$lang->custom->flow = 'Mô hình'; +$lang->custom->working = 'Chế độ'; +$lang->custom->select = 'Chọn mô hình'; +$lang->custom->branch = 'Multi-Branch'; +$lang->custom->owner = 'Sở hữu'; +$lang->custom->module = 'Module'; +$lang->custom->section = 'Section'; +$lang->custom->lang = 'Ngôn ngữ'; +$lang->custom->setPublic = 'Thiết lập Public'; +$lang->custom->required = 'Trường bắt buộc'; +$lang->custom->score = 'Điểm'; +$lang->custom->timezone = 'Timezone'; +$lang->custom->scoreReset = 'Thiết lập lại điểm'; +$lang->custom->scoreTitle = 'Tính năng điểm'; +$lang->custom->projectTitle = $lang->projectCommon . ' Feature'; +$lang->custom->productTitle = $lang->productCommon . ' Feature'; +$lang->custom->project = $lang->projectCommon; +$lang->custom->product = $lang->productCommon; +$lang->custom->closedProject = 'Closed ' . $lang->projectCommon; +$lang->custom->closedProduct = 'Closed ' . $lang->productCommon; $lang->custom->object['story'] = 'Câu chuyện'; $lang->custom->object['task'] = 'Nhiệm vụ'; @@ -78,7 +84,7 @@ $lang->custom->user->fields['statusList'] = 'Tình trạng'; $lang->custom->user->fields['contactField'] = 'Liên hệ có sẵn'; $lang->custom->user->fields['deleted'] = 'Người dùng đã xóa'; -$lang->custom->system = array('flow', 'working', 'required', 'score'); +$lang->custom->system = array('flow', 'working', 'required', 'score', 'product', 'project'); $lang->custom->block->fields['closed'] = 'Đã đóng Block'; @@ -100,6 +106,8 @@ $lang->custom->notice->noClosedBlock = 'Bạn không có blocks mà đã đ $lang->custom->notice->required = 'Trường được chọn là bắt buộc.'; $lang->custom->notice->conceptResult = 'According to your preference, %s-%s is set for you. Sử dụng %s + %s.'; $lang->custom->notice->conceptPath = 'Vào Quản trị -> Tùy biến -> Mô hình để thiết lập nó.'; +$lang->custom->notice->readOnlyOfProject = 'If Change Forbidden, any change on tasks, builds, efforts and stories of the closed project is also forbidden.'; +$lang->custom->notice->readOnlyOfProduct = 'If Change Forbidden, any change on stories, bugs, cases, efforts, releases and plans of the closed product is also forbidden.'; $lang->custom->notice->indexPage['product'] = "ZenTao 8.2+ đã có trang Sản phẩm. Bạn có muốn tới trang Sản phẩm?"; $lang->custom->notice->indexPage['project'] = "ZenTao 8.2+ has Project Home. Bạn có muốn go to Project Home?"; @@ -145,6 +153,12 @@ $lang->custom->page = ''; $lang->custom->scoreStatus[1] = 'On'; $lang->custom->scoreStatus[0] = 'Off'; +$lang->custom->closedProjectStatus[1] = 'Change Forbidden'; +$lang->custom->closedProjectStatus[0] = 'Change Allowed'; + +$lang->custom->closedProductStatus[1] = 'Change Forbidden'; +$lang->custom->closedProductStatus[0] = 'Change Allowed'; + $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Kế hoạch'; $lang->custom->moduleName['project'] = $lang->projectCommon; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index 5dea113bf1..86bbbe20d4 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -1,24 +1,30 @@ custom->common = '自定义'; -$lang->custom->index = '首页'; -$lang->custom->set = '自定义配置'; -$lang->custom->restore = '恢复默认'; -$lang->custom->key = '键'; -$lang->custom->value = '值'; -$lang->custom->flow = '流程'; -$lang->custom->working = '工作方式'; -$lang->custom->select = '请选择流程:'; -$lang->custom->branch = '多分支'; -$lang->custom->owner = '所有者'; -$lang->custom->module = '模块'; -$lang->custom->section = '附加部分'; -$lang->custom->lang = '所属语言'; -$lang->custom->setPublic = '设为公共'; -$lang->custom->required = '必填项'; -$lang->custom->score = '积分'; -$lang->custom->timezone = '时区'; -$lang->custom->scoreReset = '重置积分'; -$lang->custom->scoreTitle = '积分功能'; +$lang->custom->common = '自定义'; +$lang->custom->index = '首页'; +$lang->custom->set = '自定义配置'; +$lang->custom->restore = '恢复默认'; +$lang->custom->key = '键'; +$lang->custom->value = '值'; +$lang->custom->flow = '流程'; +$lang->custom->working = '工作方式'; +$lang->custom->select = '请选择流程:'; +$lang->custom->branch = '多分支'; +$lang->custom->owner = '所有者'; +$lang->custom->module = '模块'; +$lang->custom->section = '附加部分'; +$lang->custom->lang = '所属语言'; +$lang->custom->setPublic = '设为公共'; +$lang->custom->required = '必填项'; +$lang->custom->score = '积分'; +$lang->custom->timezone = '时区'; +$lang->custom->scoreReset = '重置积分'; +$lang->custom->scoreTitle = '积分功能'; +$lang->custom->projectTitle = $lang->projectCommon . '功能'; +$lang->custom->productTitle = $lang->productCommon . '功能'; +$lang->custom->project = $lang->projectCommon; +$lang->custom->product = $lang->productCommon; +$lang->custom->closedProject = '已关闭' . $lang->projectCommon; +$lang->custom->closedProduct = '已关闭' . $lang->productCommon; $lang->custom->object['story'] = $lang->storyCommon; $lang->custom->object['task'] = '任务'; @@ -78,7 +84,7 @@ $lang->custom->user->fields['statusList'] = '状态'; $lang->custom->user->fields['contactField'] = '可用联系方式'; $lang->custom->user->fields['deleted'] = '列出已删除用户'; -$lang->custom->system = array('flow', 'working', 'required', 'score'); +$lang->custom->system = array('flow', 'working', 'required', 'score', 'product', 'project'); $lang->custom->block->fields['closed'] = '关闭的区块'; @@ -100,6 +106,8 @@ $lang->custom->notice->noClosedBlock = '没有永久关闭的区 $lang->custom->notice->required = '页面提交时,选中的字段必填'; $lang->custom->notice->conceptResult = '我们已经根据您的选择为您设置了 %s-%s 模式,使用%s + %s。'; $lang->custom->notice->conceptPath = '您可以在:后台 -> 自定义 -> 流程页面修改。'; +$lang->custom->notice->readOnlyOfProject = '禁止修改后,已关闭' . $lang->projectCommon . '下的任务、版本、日志以及关联需求都禁止修改。'; +$lang->custom->notice->readOnlyOfProduct = '禁止修改后,已关闭' . $lang->productCommon . '下的' . $lang->storyCommon . '、Bug、用例、日志、发布、计划都禁止修改。'; $lang->custom->notice->indexPage['product'] = "从8.2版本起增加了产品主页视图,是否默认进入产品主页?"; $lang->custom->notice->indexPage['project'] = "从8.2版本起增加了项目主页视图,是否默认进入项目主页?"; @@ -145,6 +153,12 @@ $lang->custom->page = '页面'; $lang->custom->scoreStatus[1] = '开启'; $lang->custom->scoreStatus[0] = '关闭'; +$lang->custom->closedProjectStatus[1] = '禁止修改'; +$lang->custom->closedProjectStatus[0] = '允许修改'; + +$lang->custom->closedProductStatus[1] = '禁止修改'; +$lang->custom->closedProductStatus[0] = '允许修改'; + $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = '计划'; $lang->custom->moduleName['project'] = $lang->projectCommon; diff --git a/module/custom/lang/zh-tw.php b/module/custom/lang/zh-tw.php index c279e1c9f0..f08b4a3b39 100644 --- a/module/custom/lang/zh-tw.php +++ b/module/custom/lang/zh-tw.php @@ -1,24 +1,30 @@ custom->common = '自定義'; -$lang->custom->index = '首頁'; -$lang->custom->set = '自定義配置'; -$lang->custom->restore = '恢復預設'; -$lang->custom->key = '鍵'; -$lang->custom->value = '值'; -$lang->custom->flow = '流程'; -$lang->custom->working = '工作方式'; -$lang->custom->select = '請選擇流程:'; -$lang->custom->branch = '多分支'; -$lang->custom->owner = '所有者'; -$lang->custom->module = '模組'; -$lang->custom->section = '附加部分'; -$lang->custom->lang = '所屬語言'; -$lang->custom->setPublic = '設為公共'; -$lang->custom->required = '必填項'; -$lang->custom->score = '積分'; -$lang->custom->timezone = '時區'; -$lang->custom->scoreReset = '重置積分'; -$lang->custom->scoreTitle = '積分功能'; +$lang->custom->common = '自定義'; +$lang->custom->index = '首頁'; +$lang->custom->set = '自定義配置'; +$lang->custom->restore = '恢復預設'; +$lang->custom->key = '鍵'; +$lang->custom->value = '值'; +$lang->custom->flow = '流程'; +$lang->custom->working = '工作方式'; +$lang->custom->select = '請選擇流程:'; +$lang->custom->branch = '多分支'; +$lang->custom->owner = '所有者'; +$lang->custom->module = '模組'; +$lang->custom->section = '附加部分'; +$lang->custom->lang = '所屬語言'; +$lang->custom->setPublic = '設為公共'; +$lang->custom->required = '必填項'; +$lang->custom->score = '積分'; +$lang->custom->timezone = '時區'; +$lang->custom->scoreReset = '重置積分'; +$lang->custom->scoreTitle = '積分功能'; +$lang->custom->projectTitle = $lang->projectCommon . '功能'; +$lang->custom->productTitle = $lang->productCommon . '功能'; +$lang->custom->project = $lang->projectCommon; +$lang->custom->product = $lang->productCommon; +$lang->custom->closedProject = '已關閉' . $lang->projectCommon; +$lang->custom->closedProduct = '已關閉' . $lang->productCommon; $lang->custom->object['story'] = $lang->storyCommon; $lang->custom->object['task'] = '任務'; @@ -78,7 +84,7 @@ $lang->custom->user->fields['statusList'] = '狀態'; $lang->custom->user->fields['contactField'] = '可用聯繫方式'; $lang->custom->user->fields['deleted'] = '列出已刪除用戶'; -$lang->custom->system = array('flow', 'working', 'required', 'score'); +$lang->custom->system = array('flow', 'working', 'required', 'score', 'product', 'project'); $lang->custom->block->fields['closed'] = '關閉的區塊'; @@ -100,6 +106,8 @@ $lang->custom->notice->noClosedBlock = '沒有永久關閉的區 $lang->custom->notice->required = '頁面提交時,選中的欄位必填'; $lang->custom->notice->conceptResult = '我們已經根據您的選擇為您設置了 %s-%s 模式,使用%s + %s。'; $lang->custom->notice->conceptPath = '您可以在:後台 -> 自定義 -> 流程頁面修改。'; +$lang->custom->notice->readOnlyOfProject = '禁止修改後,已關閉' . $lang->projectCommon . '下的任務、版本、日誌以及關聯需求都禁止修改。'; +$lang->custom->notice->readOnlyOfProduct = '禁止修改後,已關閉' . $lang->productCommon . '下的' . $lang->storyCommon . '、Bug、用例、日誌、發布、計劃都禁止修改。'; $lang->custom->notice->indexPage['product'] = "從8.2版本起增加了產品主頁視圖,是否預設進入產品主頁?"; $lang->custom->notice->indexPage['project'] = "從8.2版本起增加了項目主頁視圖,是否預設進入項目主頁?"; @@ -145,6 +153,12 @@ $lang->custom->page = '頁面'; $lang->custom->scoreStatus[1] = '開啟'; $lang->custom->scoreStatus[0] = '關閉'; +$lang->custom->closedProjectStatus[1] = '禁止修改'; +$lang->custom->closedProjectStatus[0] = '允許修改'; + +$lang->custom->closedProductStatus[1] = '禁止修改'; +$lang->custom->closedProductStatus[0] = '允許修改'; + $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = '計劃'; $lang->custom->moduleName['project'] = $lang->projectCommon; diff --git a/module/my/view/bug.html.php b/module/my/view/bug.html.php index 6817643438..f6943b3b9a 100644 --- a/module/my/view/bug.html.php +++ b/module/my/view/bug.html.php @@ -73,11 +73,12 @@ ?> +
- + />
@@ -99,12 +100,15 @@ bug->resolutionList, $bug->resolution);?> id"; - common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); - common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true); - common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); - common::printIcon('bug', 'edit', $params, $bug, 'list'); - common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=$params", $bug, 'list', 'copy'); + if(!$isClosedProject) + { + $params = "bugID=$bug->id"; + common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); + common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true); + common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); + common::printIcon('bug', 'edit', $params, $bug, 'list'); + common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=$params", $bug, 'list', 'copy'); + } ?> diff --git a/module/my/view/story.html.php b/module/my/view/story.html.php index ad321eea56..37430d9aa8 100644 --- a/module/my/view/story.html.php +++ b/module/my/view/story.html.php @@ -62,12 +62,15 @@ - createLink('story', 'view', "id=$story->id");?> + createLink('story', 'view', "id=$story->id"); + $isClosedProject = common::checkParentObjectClosed('story', $story); + ?>
- + />
@@ -83,12 +86,15 @@ story->stageList, $story->stage);?> id}"; - common::printIcon('story', 'change', $vars, $story, 'list', 'fork'); - common::printIcon('story', 'review', $vars, $story, 'list', 'glasses'); - common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); - common::printIcon('story', 'edit', $vars, $story, 'list'); - if($config->global->flow != 'onlyStory') common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap'); + if(!$isClosedProject) + { + $vars = "story={$story->id}"; + common::printIcon('story', 'change', $vars, $story, 'list', 'fork'); + common::printIcon('story', 'review', $vars, $story, 'list', 'glasses'); + common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); + common::printIcon('story', 'edit', $vars, $story, 'list'); + if($config->global->flow != 'onlyStory') common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap'); + } ?> @@ -99,7 +105,7 @@
- + />
@@ -115,12 +121,15 @@ story->stageList, $child->stage);?> id}"; - common::printIcon('story', 'change', $vars, $child, 'list', 'fork'); - common::printIcon('story', 'review', $vars, $child, 'list', 'glasses'); - common::printIcon('story', 'close', $vars, $child, 'list', '', '', 'iframe', true); - common::printIcon('story', 'edit', $vars, $child, 'list'); - if($config->global->flow != 'onlyStory') common::printIcon('story', 'createCase', "productID=$child->product&branch=$child->branch&module=0&from=¶m=0&$vars", $child, 'list', 'sitemap'); + if(!$isClosedProject) + { + $vars = "story={$child->id}"; + common::printIcon('story', 'change', $vars, $child, 'list', 'fork'); + common::printIcon('story', 'review', $vars, $child, 'list', 'glasses'); + common::printIcon('story', 'close', $vars, $child, 'list', '', '', 'iframe', true); + common::printIcon('story', 'edit', $vars, $child, 'list'); + if($config->global->flow != 'onlyStory') common::printIcon('story', 'createCase', "productID=$child->product&branch=$child->branch&module=0&from=¶m=0&$vars", $child, 'list', 'sitemap'); + } ?> diff --git a/module/my/view/task.html.php b/module/my/view/task.html.php index 1148da721b..7bb8ce2cfc 100644 --- a/module/my/view/task.html.php +++ b/module/my/view/task.html.php @@ -61,11 +61,12 @@ +
- + />
@@ -92,21 +93,24 @@ needConfirm) + if(!$isClosedProject) { - $this->lang->task->confirmStoryChange = $this->lang->confirm; - common::printIcon('task', 'confirmStoryChange', "taskid=$task->id", '', 'list', '', 'hiddenwin', 'btn-wide'); - } - else - { - if($task->status != 'pause') common::printIcon('task', 'start', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); - if($task->status == 'pause') common::printIcon('task', 'restart', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); - common::printIcon('task', 'close', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); - common::printIcon('task', 'finish', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); + if($task->needConfirm) + { + $this->lang->task->confirmStoryChange = $this->lang->confirm; + common::printIcon('task', 'confirmStoryChange', "taskid=$task->id", '', 'list', '', 'hiddenwin', 'btn-wide'); + } + else + { + if($task->status != 'pause') common::printIcon('task', 'start', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); + if($task->status == 'pause') common::printIcon('task', 'restart', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); + common::printIcon('task', 'close', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); + common::printIcon('task', 'finish', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); - common::printIcon('task', 'recordEstimate', "taskID=$task->id", $task, 'list', 'time', '', 'iframe', true); - common::printIcon('task', 'edit', "taskID=$task->id", $task, 'list'); - common::printIcon('task', 'batchCreate', "project=$task->project&storyID=$task->story&moduleID=$task->module&taskID=$task->id&ifame=0", $task, 'list', 'treemap-alt', '', '', '', '', $this->lang->task->children); + common::printIcon('task', 'recordEstimate', "taskID=$task->id", $task, 'list', 'time', '', 'iframe', true); + common::printIcon('task', 'edit', "taskID=$task->id", $task, 'list'); + common::printIcon('task', 'batchCreate', "project=$task->project&storyID=$task->story&moduleID=$task->module&taskID=$task->id&ifame=0", $task, 'list', 'treemap-alt', '', '', '', '', $this->lang->task->children); + } } ?> diff --git a/module/my/view/testcase.html.php b/module/my/view/testcase.html.php index 6ced2667d8..06b41e941a 100644 --- a/module/my/view/testcase.html.php +++ b/module/my/view/testcase.html.php @@ -67,14 +67,15 @@ case : $case->id; - $runID = $type == 'assigntome' ? $case->id : 0; + $caseID = $type == 'assigntome' ? $case->case : $case->id; + $runID = $type == 'assigntome' ? $case->id : 0; + $isClosedProject = common::checkParentObjectClosed('testcase', $case); ?>
- + />
@@ -92,11 +93,14 @@ processStatus('testcase', $case);?> product&branch=$case->branch&extra=caseID=$caseID,version=$case->version,runID=$runID", $case, 'list', 'bug'); - common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$caseID", $case, 'list', 'copy'); - common::printIcon('testtask', 'runCase', "runID=$runID&caseID=$caseID&version=$case->version", '', 'list', 'play', '', 'iframe', '', "data-width='95%'"); - common::printIcon('testtask', 'results', "runID=$runID&caseID=$caseID", '', 'list', 'list-alt', '', 'iframe', '', "data-width='95%'"); - common::printIcon('testcase', 'edit', "caseID=$caseID", $case, 'list', 'edit'); + if(!$isClosedProject) + { + common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$caseID,version=$case->version,runID=$runID", $case, 'list', 'bug'); + common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$caseID", $case, 'list', 'copy'); + common::printIcon('testtask', 'runCase', "runID=$runID&caseID=$caseID&version=$case->version", '', 'list', 'play', '', 'iframe', '', "data-width='95%'"); + common::printIcon('testtask', 'results', "runID=$runID&caseID=$caseID", '', 'list', 'list-alt', '', 'iframe', '', "data-width='95%'"); + common::printIcon('testcase', 'edit', "caseID=$caseID", $case, 'list', 'edit'); + } ?> diff --git a/module/productplan/view/browse.html.php b/module/productplan/view/browse.html.php index f92962b9f2..8e4db5e8cc 100644 --- a/module/productplan/view/browse.html.php +++ b/module/productplan/view/browse.html.php @@ -73,6 +73,9 @@ loadModel('file');?> file->replaceImgURL($plan, 'desc'); if($plan->parent == '-1') { @@ -95,7 +98,7 @@ - id => '')) . html::a(helper::createLink('productplan', 'view', "planID=$plan->id"), sprintf('%03d', $plan->id));?> + id => ''), '', $disabled) . html::a(helper::createLink('productplan', 'view', "planID=$plan->id"), sprintf('%03d', $plan->id));?> id);?> @@ -122,11 +125,11 @@ " . $this->loadModel('flow')->getFieldValue($extendField, $plan) . "";?> id"), '', '', "class='btn' title='{$lang->project->create}'"); - if(common::hasPriv('productplan', 'linkStory')) echo html::a(inlink('view', "planID=$plan->id&type=story&orderBy=id_desc&link=true"), '', '', "class='btn' title='{$lang->productplan->linkStory}'"); - if(common::hasPriv('productplan', 'linkBug') and $config->global->flow != 'onlyStory') echo html::a(inlink('view', "planID=$plan->id&type=bug&orderBy=id_desc&link=true"), '', '', "class='btn' title='{$lang->productplan->linkBug}'"); + if(common::hasPriv('project', 'create', $plan)) echo html::a(helper::createLink('project', 'create', "productID=&projectID=©ProjectID=&planID=$plan->id"), '', '', "class='btn' title='{$lang->project->create}'"); + if(common::hasPriv('productplan', 'linkStory', $plan)) echo html::a(inlink('view', "planID=$plan->id&type=story&orderBy=id_desc&link=true"), '', '', "class='btn' title='{$lang->productplan->linkStory}'"); + if(common::hasPriv('productplan', 'linkBug', $plan) and $config->global->flow != 'onlyStory') echo html::a(inlink('view', "planID=$plan->id&type=bug&orderBy=id_desc&link=true"), '', '', "class='btn' title='{$lang->productplan->linkBug}'"); common::printIcon('productplan', 'edit', "planID=$plan->id", $plan, 'list'); - if(common::hasPriv('productplan', 'create')) + if(common::hasPriv('productplan', 'create', $plan)) { if($plan->parent > '0') echo " "; if($plan->parent <= '0') echo html::a($this->createLink('productplan', 'create', "product=$productID&branch=$branch&parent={$plan->id}"), "", '', "class='btn' title='{$this->lang->productplan->children}'"); diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php index de51003f99..0c1f2be39e 100644 --- a/module/project/view/bug.html.php +++ b/module/project/view/bug.html.php @@ -74,10 +74,14 @@ ?> + - id => '')) . html::a(helper::createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id));?> + id => ''), '', $disabled) . html::a(helper::createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id));?> id);?> @@ -97,12 +101,15 @@ bug->resolutionList, $bug->resolution);?> id"; - common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); - common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true); - common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); - common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=$params", $bug, 'list', 'copy'); - common::printIcon('bug', 'edit', $params, $bug, 'list'); + if(!$isClosedProject) + { + $params = "bugID=$bug->id"; + common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); + common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true); + common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); + common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=$params", $bug, 'list', 'copy'); + common::printIcon('bug', 'edit', $params, $bug, 'list'); + } ?> diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index b7323a9376..793b0b8c3a 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -64,7 +64,7 @@ builder);?> createLink('build', 'view', "buildID=$build->id&type=story&link=true"), "", '', "class='btn' title='{$lang->build->linkStory}'"); } diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 4cfb5b7686..7c6ed0ad31 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -145,13 +145,16 @@ $story):?> createLink('story', 'view', "storyID=$story->id&version=$story->version&from=project¶m=$project->id"); - $totalEstimate += $story->estimate; + $isClosedProject = common::checkParentObjectClosed('story', $story); + $disabled = $isClosedProject ? 'disabled' : ''; + + $storyLink = $this->createLink('story', 'view', "storyID=$story->id&version=$story->version&from=project¶m=$project->id"); + $totalEstimate += $story->estimate; ?> - id => '')) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id));?> + id => ''), '', $disabled) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id));?> id);?> @@ -192,30 +195,33 @@ id}&story={$story->id}&moduleID={$story->module}"; - - $lang->task->create = $lang->project->wbs; - if(commonModel::isTutorialMode()) + if(!$isClosedProject) { - $wizardParams = helper::safe64Encode($param); - echo html::a($this->createLink('tutorial', 'wizard', "module=task&method=create¶ms=$wizardParams"), "",'', "class='btn btn-task-create' title='{$lang->project->wbs}'"); - } - else - { - if($hasDBPriv) common::printIcon('task', 'create', $param, '', 'list', 'plus', '', 'btn-task-create'); - } + $hasDBPriv = common::hasDBPriv($project, 'project'); + $param = "projectID={$project->id}&story={$story->id}&moduleID={$story->module}"; - $lang->task->batchCreate = $lang->project->batchWBS; - if($hasDBPriv) common::printIcon('task', 'batchCreate', "projectID={$project->id}&story={$story->id}", '', 'list', 'pluses'); + $lang->task->create = $lang->project->wbs; + if(commonModel::isTutorialMode()) + { + $wizardParams = helper::safe64Encode($param); + echo html::a($this->createLink('tutorial', 'wizard', "module=task&method=create¶ms=$wizardParams"), "",'', "class='btn btn-task-create' title='{$lang->project->wbs}'"); + } + else + { + if($hasDBPriv) common::printIcon('task', 'create', $param, '', 'list', 'plus', '', 'btn-task-create'); + } - $lang->testcase->batchCreate = $lang->testcase->create; - if($productID && $hasDBPriv) common::printIcon('testcase', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', 'list', 'sitemap'); + $lang->task->batchCreate = $lang->project->batchWBS; + if($hasDBPriv) common::printIcon('task', 'batchCreate', "projectID={$project->id}&story={$story->id}", '', 'list', 'pluses'); - if(common::hasPriv('project', 'unlinkStory', $project)) - { - $unlinkURL = $this->createLink('project', 'unlinkStory', "projectID=$project->id&storyID=$story->id&confirm=yes"); - echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"storyList\", confirmUnlinkStory)", '', '', "class='btn' title='{$lang->project->unlinkStory}'"); + $lang->testcase->batchCreate = $lang->testcase->create; + if($productID && $hasDBPriv) common::printIcon('testcase', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', 'list', 'sitemap'); + + if(common::hasPriv('project', 'unlinkStory', $project)) + { + $unlinkURL = $this->createLink('project', 'unlinkStory', "projectID=$project->id&storyID=$story->id&confirm=yes"); + echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"storyList\", confirmUnlinkStory)", '', '', "class='btn' title='{$lang->project->unlinkStory}'"); + } } ?> diff --git a/module/project/view/testtask.html.php b/module/project/view/testtask.html.php index 1f634a817f..e377e56e56 100644 --- a/module/project/view/testtask.html.php +++ b/module/project/view/testtask.html.php @@ -71,6 +71,10 @@ $productTasks):?> + > @@ -80,7 +84,7 @@ - id => sprintf('%03d', $task->id)));?> + id => sprintf('%03d', $task->id)), '', $disabled);?> id);?> @@ -96,14 +100,17 @@ id", $task, 'list', 'sitemap'); - common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'list', 'link'); - common::printIcon('testreport', 'browse', "objectID=$task->product&objectType=product&extra=$task->id", $task, 'list','flag'); - common::printIcon('testtask', 'edit', "taskID=$task->id", $task, 'list'); - if(common::hasPriv('testtask', 'delete', $task)) + if(!$isClosedProject) { - $deleteURL = $this->createLink('testtask', 'delete', "taskID=$task->id&confirm=yes"); - echo html::a("javascript:ajaxDelete(\"$deleteURL\", \"taskList\", confirmDelete)", '', '', "class='btn' title='{$lang->testtask->delete}'"); + common::printIcon('testtask', 'cases', "taskID=$task->id", $task, 'list', 'sitemap'); + common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'list', 'link'); + common::printIcon('testreport', 'browse', "objectID=$task->product&objectType=product&extra=$task->id", $task, 'list','flag'); + common::printIcon('testtask', 'edit', "taskID=$task->id", $task, 'list'); + if(common::hasPriv('testtask', 'delete', $task)) + { + $deleteURL = $this->createLink('testtask', 'delete', "taskID=$task->id&confirm=yes"); + echo html::a("javascript:ajaxDelete(\"$deleteURL\", \"taskList\", confirmDelete)", '', '', "class='btn' title='{$lang->testtask->delete}'"); + } } ?> diff --git a/module/release/view/browse.html.php b/module/release/view/browse.html.php index aa3e090069..2e94f9fa9c 100644 --- a/module/release/view/browse.html.php +++ b/module/release/view/browse.html.php @@ -56,6 +56,7 @@ + id"), sprintf('%03d', $release->id));?> @@ -76,18 +77,21 @@ " . $this->loadModel('flow')->getFieldValue($extendField, $release) . "";?> id&type=story&link=true"), ' ', '', "class='btn' title='{$lang->release->linkStory}'"); - if(common::hasPriv('release', 'linkBug') and $config->global->flow != 'onlyStory') echo html::a(inlink('view', "releaseID=$release->id&type=bug&link=true"), ' ', '', "class='btn' title='{$lang->release->linkBug}'"); - if(common::hasPriv('release', 'changeStatus', $release)) + if(!$isClosedProject) { - $changedStatus = $release->status == 'normal' ? 'terminate' : 'normal'; - echo html::a(inlink('changeStatus', "releaseID=$release->id&status=$changedStatus"), ' ', 'hiddenwin', "class='btn' title='{$lang->release->changeStatusList[$changedStatus]}'"); - } - common::printIcon('release', 'edit', "release=$release->id", $release, 'list'); - if(common::hasPriv('release', 'delete', $release)) - { - $deleteURL = $this->createLink('release', 'delete', "releaseID=$release->id&confirm=yes"); - echo html::a("javascript:ajaxDelete(\"$deleteURL\", \"releaseList\", confirmDelete)", '', '', "class='btn' title='{$lang->release->delete}'"); + if(common::hasPriv('release', 'linkStory')) echo html::a(inlink('view', "releaseID=$release->id&type=story&link=true"), ' ', '', "class='btn' title='{$lang->release->linkStory}'"); + if(common::hasPriv('release', 'linkBug') and $config->global->flow != 'onlyStory') echo html::a(inlink('view', "releaseID=$release->id&type=bug&link=true"), ' ', '', "class='btn' title='{$lang->release->linkBug}'"); + if(common::hasPriv('release', 'changeStatus', $release)) + { + $changedStatus = $release->status == 'normal' ? 'terminate' : 'normal'; + echo html::a(inlink('changeStatus', "releaseID=$release->id&status=$changedStatus"), ' ', 'hiddenwin', "class='btn' title='{$lang->release->changeStatusList[$changedStatus]}'"); + } + common::printIcon('release', 'edit', "release=$release->id", $release, 'list'); + if(common::hasPriv('release', 'delete', $release)) + { + $deleteURL = $this->createLink('release', 'delete', "releaseID=$release->id&confirm=yes"); + echo html::a("javascript:ajaxDelete(\"$deleteURL\", \"releaseList\", confirmDelete)", '', '', "class='btn' title='{$lang->release->delete}'"); + } } ?> diff --git a/module/story/model.php b/module/story/model.php index e5c2da472a..1feaebfa6e 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2970,6 +2970,9 @@ class storyModel extends model */ public function printCell($col, $story, $users, $branches, $storyStages, $modulePairs = array(), $storyTasks = array(), $storyBugs = array(), $storyCases = array(), $mode = 'datatable', $storyType = 'story') { + /* Check the product is closed. */ + $isClosedProject = common::checkParentObjectClosed('story', $story); + $canBatchEdit = common::hasPriv('story', 'batchEdit'); $canBatchClose = common::hasPriv('story', 'batchClose'); $canBatchReview = common::hasPriv('story', 'batchReview'); @@ -3043,7 +3046,8 @@ class storyModel extends model case 'id': if($canBatchAction) { - echo html::checkbox('storyIdList', array($story->id => '')) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id)); + $disabled = $isClosedProject ? 'disabled' : ''; + echo html::checkbox('storyIdList', array($story->id => ''), '', $disabled) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id)); } else { @@ -3164,13 +3168,16 @@ class storyModel extends model echo $story->version; break; case 'actions': - $vars = "story={$story->id}"; - common::printIcon('story', 'change', $vars, $story, 'list', 'fork'); - common::printIcon('story', 'review', $vars, $story, 'list', 'glasses'); - common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); - common::printIcon('story', 'edit', $vars, $story, 'list'); - if($this->config->global->flow != 'onlyStory') common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap'); - common::printIcon('story', 'batchCreate', "productID=$story->product&branch=$story->branch&module=0&storyID=$story->id", $story, 'list', 'treemap-alt', '', '', '', '', $this->lang->story->subdivide); + if(!$isClosedProject) + { + $vars = "story={$story->id}"; + common::printIcon('story', 'change', $vars, $story, 'list', 'fork'); + common::printIcon('story', 'review', $vars, $story, 'list', 'glasses'); + common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); + common::printIcon('story', 'edit', $vars, $story, 'list'); + if($this->config->global->flow != 'onlyStory') common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap'); + common::printIcon('story', 'batchCreate', "productID=$story->product&branch=$story->branch&module=0&storyID=$story->id", $story, 'list', 'treemap-alt', '', '', '', '', $this->lang->story->subdivide); + } break; } echo ''; diff --git a/module/testcase/model.php b/module/testcase/model.php index 44fc6a65f9..b3dd183f47 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -1408,6 +1408,9 @@ class testcaseModel extends model */ public function printCell($col, $case, $users, $branches, $modulePairs = array(), $browseType = '', $mode = 'datatable') { + /* Check the product is closed. */ + $isClosedProject = common::checkParentObjectClosed('case', $case); + $canBatchRun = common::hasPriv('testtask', 'batchRun'); $canBatchEdit = common::hasPriv('testcase', 'batchEdit'); $canBatchDelete = common::hasPriv('testcase', 'batchDelete'); @@ -1447,7 +1450,8 @@ class testcaseModel extends model case 'id': if($canBatchAction) { - echo html::checkbox('caseIDList', array($case->id => '')) . html::a(helper::createLink('testcase', 'view', "caseID=$case->id"), sprintf('%03d', $case->id)); + $disabled = $isClosedProject ? 'disabled' : ''; + echo html::checkbox('caseIDList', array($case->id => ''), '', $disabled) . html::a(helper::createLink('testcase', 'view', "caseID=$case->id"), sprintf('%03d', $case->id)); } else { @@ -1543,18 +1547,21 @@ class testcaseModel extends model echo $case->stepNumber; break; case 'actions': - if($case->needconfirm or $browseType == 'needconfirm') + if(!$isClosedProject) { - common::printIcon('testcase', 'confirmstorychange', "caseID=$case->id", $case, 'list', 'confirm', 'hiddenwin', '', '', '', $this->lang->confirm); - break; - } + if($case->needconfirm or $browseType == 'needconfirm') + { + common::printIcon('testcase', 'confirmstorychange', "caseID=$case->id", $case, 'list', 'confirm', 'hiddenwin', '', '', '', $this->lang->confirm); + break; + } - common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", $case, 'list', '', '', 'iframe', true, "data-width='95%'"); - common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", $case, 'list', 'play', '', 'runCase iframe', false, "data-width='95%'"); - common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list'); - if($this->config->testcase->needReview or !empty($this->config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'glasses', '', 'iframe'); - common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=", $case, 'list', 'bug', '', 'iframe', '', "data-width='90%'"); - common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'list', 'copy'); + common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", $case, 'list', '', '', 'iframe', true, "data-width='95%'"); + common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", $case, 'list', 'play', '', 'runCase iframe', false, "data-width='95%'"); + common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list'); + if($this->config->testcase->needReview or !empty($this->config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'glasses', '', 'iframe'); + common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=", $case, 'list', 'bug', '', 'iframe', '', "data-width='90%'"); + common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'list', 'copy'); + } break; } diff --git a/module/testreport/view/browse.html.php b/module/testreport/view/browse.html.php index 6fbe9bad5a..0a7572dbcc 100644 --- a/module/testreport/view/browse.html.php +++ b/module/testreport/view/browse.html.php @@ -64,8 +64,11 @@ id", '', 'list'); - common::printIcon('testreport', 'delete', "id=$report->id", '', 'list', 'trash', 'hiddenwin'); + if(!common::checkParentObjectClosed('report', $report)) + { + common::printIcon('testreport', 'edit', "id=$report->id", '', 'list'); + common::printIcon('testreport', 'delete', "id=$report->id", '', 'list', 'trash', 'hiddenwin'); + } ?> diff --git a/module/testreport/view/view.html.php b/module/testreport/view/view.html.php index 13a3db1a46..974d939084 100644 --- a/module/testreport/view/view.html.php +++ b/module/testreport/view/view.html.php @@ -112,9 +112,12 @@ deleted):?>
objectID&objectType=$report->objectType"), "", '', "class='btn' title='{$lang->testreport->recreate}'"); - common::printIcon('testreport', 'edit', "reportID=$report->id", '', 'button'); - common::printIcon('testreport', 'delete', "reportID=$report->id", '', 'button', 'trash', 'hiddenwin'); + if(!common::checkParentObjectClosed('report', $report)) + { + if(common::hasPriv('testreport', 'create')) echo html::a(inLink('create', "objectID=$report->objectID&objectType=$report->objectType"), "", '', "class='btn' title='{$lang->testreport->recreate}'"); + common::printIcon('testreport', 'edit', "reportID=$report->id", '', 'button'); + common::printIcon('testreport', 'delete', "reportID=$report->id", '', 'button', 'trash', 'hiddenwin'); + } ?> diff --git a/module/testtask/model.php b/module/testtask/model.php index e7741b9c3e..a4794cd3f5 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1420,7 +1420,7 @@ class testtaskModel extends model if($action == 'block') return ($testtask->status == 'doing' || $testtask->status == 'wait'); if($action == 'activate') return ($testtask->status == 'blocked' || $testtask->status == 'done'); if($action == 'close') return $testtask->status != 'done'; - if($action == 'runcase' and $testtask->auto == 'unit') return false; + if($action == 'runcase' and isset($testtask->auto) and $testtask->auto == 'unit') return false; if($action == 'runcase') return isset($testtask->caseStatus) ? $testtask->caseStatus != 'wait' : $testtask->status != 'wait'; return true; }