diff --git a/framework/base/control.class.php b/framework/base/control.class.php index b8f74d3b5e..ac94b47fc7 100644 --- a/framework/base/control.class.php +++ b/framework/base/control.class.php @@ -893,7 +893,14 @@ class baseControl $data = (array) $data; if(helper::isAjaxRequest() or $this->viewType == 'json') { - print(json_encode($data)); + /* Process for zh-cn in json. */ + foreach($data as $key => $value) + { + if(!is_string($value)) continue; + $data[$key] = urlencode($value); + } + + print(urldecode(json_encode($data))); $response = helper::removeUTF8Bom(ob_get_clean()); if(defined('RUN_MODE') and RUN_MODE == 'api') return print($response); diff --git a/lib/scm/gitlab.class.php b/lib/scm/gitlab.class.php index 6d3350bd66..82bf44ea1a 100644 --- a/lib/scm/gitlab.class.php +++ b/lib/scm/gitlab.class.php @@ -518,6 +518,7 @@ class gitlab $api = "commits"; if(empty($count)) $count = 100; + $params = array(); $params['ref_name'] = $branch; $params['per_page'] = $count; @@ -616,6 +617,7 @@ class gitlab $params->per_page = 100; $allResults = array(); + $files = array(); while(true) { $results = $this->fetch($api, $params); diff --git a/module/action/model.php b/module/action/model.php index 769f2cd639..670ba4be6e 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -941,7 +941,8 @@ class actionModel extends model $objectIds = array_unique($objectIds); $table = $objectType == 'makeup' ? '`zt_overtime`' : $this->config->objectTables[$objectType]; - $field = $this->config->action->objectNameFields[$objectType]; + $field = zget($this->config->action->objectNameFields, $objectType, ''); + if(empty($field)) continue; if($table != TABLE_TODO) { $objectName = array(); diff --git a/module/block/lang/de.php b/module/block/lang/de.php index d90a40eba6..7992ff1b06 100644 --- a/module/block/lang/de.php +++ b/module/block/lang/de.php @@ -365,7 +365,7 @@ $lang->block->modules['project']->availableBlocks = new stdclass(); $lang->block->modules['project']->availableBlocks->project = 'Project List'; $lang->block->modules['project']->availableBlocks->recentproject = 'Recent Project'; $lang->block->modules['project']->availableBlocks->statistic = 'Project Statistic'; -$lang->block->modules['project']->availableBlocks->projectteam = 'Project Human Input'; +if($config->systemMode == 'new') $lang->block->modules['project']->availableBlocks->projectteam = 'Project Human Input'; $lang->block->modules['scrum']['index'] = new stdclass(); $lang->block->modules['scrum']['index']->availableBlocks = new stdclass(); diff --git a/module/block/lang/en.php b/module/block/lang/en.php index eca3778de5..d3dc6dd148 100644 --- a/module/block/lang/en.php +++ b/module/block/lang/en.php @@ -375,7 +375,7 @@ $lang->block->modules['project']->availableBlocks = new stdclass(); $lang->block->modules['project']->availableBlocks->project = 'Project List'; $lang->block->modules['project']->availableBlocks->recentproject = 'Recent Project'; $lang->block->modules['project']->availableBlocks->statistic = 'Project Statistic'; -if($config->systemMode == 'new') $lang->block->modules['project']->availableBlocks->projectteam = 'Project Human Input'; +if($config->systemMode == 'new') $lang->block->modules['project']->availableBlocks->projectteam = 'Project Human Input'; $lang->block->modules['scrum']['index'] = new stdclass(); $lang->block->modules['scrum']['index']->availableBlocks = new stdclass(); diff --git a/module/block/lang/fr.php b/module/block/lang/fr.php index cdb2b5462e..e8d6a3ef0b 100644 --- a/module/block/lang/fr.php +++ b/module/block/lang/fr.php @@ -365,7 +365,7 @@ $lang->block->modules['project']->availableBlocks = new stdclass(); $lang->block->modules['project']->availableBlocks->project = 'Project List'; $lang->block->modules['project']->availableBlocks->recentproject = 'Recent Projects'; $lang->block->modules['project']->availableBlocks->statistic = 'Project Statistic'; -$lang->block->modules['project']->availableBlocks->projectteam = 'Project Human Input'; +if($config->systemMode == 'new') $lang->block->modules['project']->availableBlocks->projectteam = 'Project Human Input'; $lang->block->modules['scrum']['index'] = new stdclass(); $lang->block->modules['scrum']['index']->availableBlocks = new stdclass(); diff --git a/module/block/lang/vi.php b/module/block/lang/vi.php index 92c5da513a..a2a8ffedcf 100644 --- a/module/block/lang/vi.php +++ b/module/block/lang/vi.php @@ -365,7 +365,7 @@ $lang->block->modules['project']->availableBlocks = new stdclass(); $lang->block->modules['project']->availableBlocks->project = 'Project List'; $lang->block->modules['project']->availableBlocks->recentproject = 'Recent Projects'; $lang->block->modules['project']->availableBlocks->statistic = 'Project Statistic'; -$lang->block->modules['project']->availableBlocks->projectteam = 'ProjectHuman Input'; +if($config->systemMode == 'new') $lang->block->modules['project']->availableBlocks->projectteam = 'ProjectHuman Input'; $lang->block->modules['scrum']['index'] = new stdclass(); $lang->block->modules['scrum']['index']->availableBlocks = new stdclass(); diff --git a/module/bug/config.php b/module/bug/config.php index 434a2e1f85..82b51996f6 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -4,9 +4,9 @@ $config->bug->batchCreate = 10; $config->bug->longlife = 7; $config->bug->removeFields = 'objectTypeList,productList,executionList,gitlabID,gitlabProjectID'; -$config->bug->create = new stdclass(); -$config->bug->edit = new stdclass(); -$config->bug->resolve = new stdclass(); +$config->bug->create = new stdclass(); +$config->bug->edit = new stdclass(); +$config->bug->resolve = new stdclass(); $config->bug->create->requiredFields = 'title,openedBuild'; $config->bug->edit->requiredFields = $config->bug->create->requiredFields; $config->bug->resolve->requiredFields = 'resolution'; diff --git a/module/bug/control.php b/module/bug/control.php index 21078719ee..f710a27be6 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -519,7 +519,16 @@ class bug extends control /* Get products and projects. */ $products = $this->config->CRProduct ? $this->products : $this->product->getPairs('noclosed', 0, 'program_asc'); $projects = array(0 => ''); - if($projectID) + if($executionID) + { + $products = array(); + $linkedProducts = $this->loadModel('execution')->getProducts($executionID); + foreach($linkedProducts as $product) $products[$product->id] = $product->name; + + $project = $this->loadModel('project')->getByID($projectID); + $projects = array($projectID => $project->name); + } + elseif($projectID) { $products = array(); $productList = $this->config->CRProduct ? $this->product->getOrderedProducts('all', 40, $projectID) : $this->product->getOrderedProducts('normal', 40, $projectID); @@ -899,7 +908,7 @@ class bug extends control $this->view->product = $product; $this->view->productName = $this->products[$productID]; $this->view->plans = $this->loadModel('productplan')->getPairs($productID, $bug->branch); - $this->view->projects = array(0 => '') + $this->product->getProjectPairsByProduct($productID, $bug->branch); + $this->view->projects = array(0 => '') + $this->product->getProjectPairsByProduct($productID, $bug->branch, $bug->project); $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $bug->branch); $this->view->currentModuleID = $currentModuleID; $this->view->executions = array(0 => '') + $this->product->getExecutionPairsByProduct($bug->product, $bug->branch ? "0,{$bug->branch}" : 0, 'id_desc', $projectID); @@ -1563,7 +1572,7 @@ class bug extends control $this->loadModel('gitlab'); $relation = $this->gitlab->getRelationByObject('bug', $bugID); if(!empty($relation)) $this->gitlab->deleteIssue('bug', $bugID, $relation->issueID); - + $this->bug->delete(TABLE_BUG, $bugID); if($bug->toTask != 0) { diff --git a/module/bug/js/create.js b/module/bug/js/create.js index 831178a860..65c4663659 100644 --- a/module/bug/js/create.js +++ b/module/bug/js/create.js @@ -178,13 +178,11 @@ $(document).ready(function() projects = ''; $.each(gitlabProjects[host], function(id, obj){projects = projects + ',' + obj.gitlabProject}); url = createLink('repo', 'ajaxgetgitlabprojects', "host=" + host + "&projects=" + projects); - + $.get(url, function(response) { $('#gitlabProject').html('').append(response); - $('#gitlabProject').chosen().trigger("chosen:updated");; + $('#gitlabProject').chosen().trigger("chosen:updated"); }); - }); - }); diff --git a/module/bug/model.php b/module/bug/model.php index d1af2087d0..f4d28e43b9 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -88,7 +88,7 @@ class bugModel extends model if(!dao::isError()) { $bugID = $this->dao->lastInsertID(); - + $this->loadModel('gitlab')->apiCreateIssue($this->post->gitlab, $this->post->gitlabProject, 'bug', $bugID, $bug); $this->file->updateObjectID($this->post->uid, $bugID, 'bug'); @@ -278,9 +278,9 @@ class bugModel extends model /** * Create bug from gitlab issue. - * - * @param object $bug - * @param int $executionID + * + * @param object $bug + * @param int $executionID * @access public * @return int|bool */ @@ -675,7 +675,7 @@ class bugModel extends model if(!empty($bug->resolvedBy)) $this->loadModel('score')->create('bug', 'resolve', $bugID); $this->file->updateObjectID($this->post->uid, $bugID, 'bug'); - if(!empty($bug)) + if(!empty($bug)) { $this->loadModel('gitlab'); $relation = $this->gitlab->getRelationByObject('bug', $bugID); @@ -862,7 +862,7 @@ class bugModel extends model $this->loadModel('gitlab'); foreach($activateBugs as $bugID => $bug) { - if(!empty($bug)) + if(!empty($bug)) { $relation = $this->gitlab->getRelationByObject('bug', $bugID); if($relation) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', (Object)$bug, $bugID); @@ -904,7 +904,7 @@ class bugModel extends model $this->loadModel('gitlab'); $relation = $this->gitlab->getRelationByObject('bug', $bugID); - $bug = $this->getById($bugID); // get full bug object to update issue. + $bug = $this->getById($bugID); // Get full bug object to update issue. $bug->assignee_id = $this->gitlab->getGitlabUserID($relation->gitlabID, $bug->assignedTo); if($bug->assignee_id != '') { @@ -967,7 +967,7 @@ class bugModel extends model $bug->lastEditedDate = $now; $bug->confirmed = 1; - if(!empty($bug)) + if(!empty($bug)) { $relation = $this->gitlab->getRelationByObject('bug', $bugID); if($relation) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug, $bugID); @@ -1259,7 +1259,7 @@ class bugModel extends model } } - if(!empty($bug)) + if(!empty($bug)) { $this->loadModel('gitlab'); $relation = $this->gitlab->getRelationByObject('bug', $bugID); diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 951d25b4fb..86a295d081 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -313,13 +313,13 @@ js::set('gitlabProjects', $gitlabProjects); - - - task->sync2Gitlab;?> - - - - + + + task->sync2Gitlab;?> + + + + bug->status;?> diff --git a/module/caselib/model.php b/module/caselib/model.php index f83d8a51c2..b0ebca73a3 100644 --- a/module/caselib/model.php +++ b/module/caselib/model.php @@ -218,7 +218,6 @@ class caselibModel extends model { $cases = $this->dao->select('*')->from(TABLE_CASE) ->where('lib')->eq((int)$libID) - ->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->caselib == 'project')->andWhere('project')->eq($this->session->project)->fi() ->andWhere('product')->eq(0) ->beginIF($moduleIdList)->andWhere('module')->in($moduleIdList)->fi() ->beginIF($browseType == 'wait')->andWhere('status')->eq($browseType)->fi() diff --git a/module/common/lang/common.php b/module/common/lang/common.php index 20e9eebdcf..c165aa44c8 100644 --- a/module/common/lang/common.php +++ b/module/common/lang/common.php @@ -151,4 +151,4 @@ $lang->icons['unlock'] = 'unlock-alt'; $lang->icons['confirmStoryChange'] = 'search'; $lang->icons['score'] = 'tint'; -$lang->noMenuModule = array('report', 'my', 'todo', 'effort', 'program', 'product', 'execution', 'task', 'build', 'productplan', 'project', 'projectrelease', 'projectstory', 'story', 'branch', 'release', 'attend', 'leave', 'makeup', 'overtime', 'lieu', 'custom', 'admin', 'mail', 'extension', 'dev', 'backup', 'action', 'cron', 'pssp', 'sms', 'message', 'webhook', 'search', 'score', 'stage', 'entry', 'jenkins','gitlab'); +$lang->noMenuModule = array('report', 'my', 'todo', 'effort', 'program', 'product', 'execution', 'task', 'build', 'productplan', 'project', 'projectrelease', 'projectstory', 'story', 'branch', 'release', 'attend', 'leave', 'makeup', 'overtime', 'lieu', 'custom', 'admin', 'mail', 'extension', 'dev', 'backup', 'action', 'cron', 'pssp', 'sms', 'message', 'webhook', 'search', 'score', 'stage', 'entry', 'jenkins', 'gitlab'); diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 7116fe6a6c..0cdb0ed0fb 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -210,6 +210,7 @@ $lang->my->work = 'Work'; $lang->project->list = 'Project List'; $lang->execution->executionKanban = "{$lang->execution->common} Kanban"; +$lang->execution->all = "{$lang->execution->common} List"; $lang->doc->recent = 'Recent'; $lang->doc->my = 'My'; diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index 1f8156bc4a..3a72faf8bd 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -226,6 +226,7 @@ $lang->scrum->menu->settings['subMenu']->group = array('link' => "{$lang-> /* Execution menu. */ $lang->execution->homeMenu = new stdclass(); if($config->systemMode == 'new') $lang->execution->homeMenu->executionkanban = array('link' => "{$lang->execution->executionKanban}|execution|executionkanban|"); +if($config->systemMode == 'classic') $lang->execution->homeMenu->all = array('link' => "{$lang->execution->all}|execution|all|"); $lang->execution->menu = new stdclass(); $lang->execution->menu->task = array('link' => "{$lang->task->common}|execution|task|executionID=%s", 'subModule' => 'task,tree', 'alias' => 'importtask,importbug'); diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index c6d539fc1f..c79b211608 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -210,6 +210,7 @@ $lang->my->work = '待处理'; $lang->project->list = '项目列表'; $lang->execution->executionKanban = "{$lang->execution->common}看板"; +$lang->execution->all = "{$lang->execution->common}列表"; $lang->doc->recent = '最近文档'; $lang->doc->my = '我的文档'; diff --git a/module/common/model.php b/module/common/model.php index c3adb1b9ba..525876f09e 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1739,7 +1739,8 @@ EOD; { /* Check program priv. */ $viewProjects = trim($this->app->user->view->projects, ','); - if($this->session->project and $viewProjects and strpos(",{$viewProjects},", ",{$this->session->project},") === false and !$this->app->user->admin) $this->loadModel('project')->accessDenied(); + $accessDenied = ($this->session->project and $viewProjects and strpos(",{$viewProjects},", ",{$this->session->project},") === false); + if($accessDenied and !$this->app->user->admin) $this->loadModel('project')->accessDenied(); $this->resetProgramPriv($module, $method); if(!commonModel::hasPriv($module, $method)) $this->deny($module, $method, false); } @@ -2424,6 +2425,29 @@ EOD; return $menu; } + + /** + * Process markdown. + * + * @param string $markdown + * @static + * @access public + * @return string + */ + static public function processMarkdown($markdown) + { + if(empty($markdown)) return false; + + $markdown = str_replace('&', '&', $markdown); + + global $app; + $hyperdown = $app->loadClass('hyperdown'); + $content = $hyperdown->makeHtml($markdown); + + $content = htmlspecialchars_decode($content); + $content = fixer::stripDataTags($content); + return $content; + } } class common extends commonModel diff --git a/module/custom/control.php b/module/custom/control.php index f4f1f2cbef..c8ba0d2873 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -545,7 +545,7 @@ class custom extends control { $mode = fixer::input('post')->get('mode'); $this->loadModel('setting')->setItem('system.common.global.mode', $mode); - $this->loadModel('setting')->setItem('system.common.global.changedMode', 'yes'); + $this->setting->setItem('system.common.global.changedMode', 'yes'); $sprintConcept = isset($this->config->custom->sprintConcept) ? $this->config->custom->sprintConcept : '0'; if($mode == 'new') @@ -553,7 +553,7 @@ class custom extends control if($sprintConcept == 2) $this->setting->setItem('system.custom.sprintConcept', 1); die(js::locate($this->createLink('upgrade', 'mergeTips'), 'parent')); } - if($mode == 'classic') + else { if($sprintConcept == 1) $this->setting->setItem('system.custom.sprintConcept', 2); die(js::reload('top')); @@ -565,7 +565,6 @@ class custom extends control if(isset($this->config->global->upgradeStep) and $this->config->global->upgradeStep == 'mergeProgram') die(js::locate($this->createLink('upgrade', 'mergeProgram'), 'parent')); unset($_SESSION['upgrading']); - // $this->locate(inlink('index')); } $this->app->loadLang('upgrade'); diff --git a/module/custom/js/mode.js b/module/custom/js/mode.js index cd8b86f050..b24c0ac56f 100644 --- a/module/custom/js/mode.js +++ b/module/custom/js/mode.js @@ -3,7 +3,7 @@ $(function() $('[name=mode]').change(function() { var mode = $(this).val(); - if(mode == 'classic') $('#modeTips').html(newTips); - if(mode == 'new') $('#modeTips').html(classicTips); + if(mode == 'new') $('#modeTips').html(newTips); + if(mode == 'classic') $('#modeTips').html(classicTips); }) }) diff --git a/module/custom/lang/de.php b/module/custom/lang/de.php index 80e5343011..2a0dbef906 100644 --- a/module/custom/lang/de.php +++ b/module/custom/lang/de.php @@ -216,7 +216,7 @@ $lang->custom->workingList['full'] = 'Full Management of Dev'; $lang->custom->menuTip = 'Click to show/hide navigation bar. Drag to swtich display order.'; $lang->custom->saveFail = 'Failed to save!'; $lang->custom->page = ' Page'; -$lang->custom->changeClassicTip = 'The module of Program will be hidden, if you switch to Version 12.5.3 and below.'; +$lang->custom->changeClassicTip = 'The Program module will be hidden, if you switch to the classic mode.'; $lang->custom->scoreStatus[1] = 'On'; $lang->custom->scoreStatus[0] = 'Off'; @@ -231,8 +231,9 @@ $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Plan'; $lang->custom->moduleName['execution'] = $lang->custom->execution; -$lang->custom->conceptQuestions['overview'] = "1. Which combination of management fits your company?"; -$lang->custom->conceptQuestions['URAndSR'] = "2. Do you want to use the concept of {$lang->URCommon} and {$lang->SRCommon} in ZenTao?"; +$lang->custom->conceptQuestions['overview'] = "1. Which combination of management fits your company?"; +$lang->custom->conceptQuestions['URAndSR'] = "2. Do you want to use the concept of {$lang->URCommon} and {$lang->SRCommon} in ZenTao?"; +$lang->custom->conceptQuestions['storypoint'] = "3. Which of the following units is your company using for scale estimation?"; $lang->custom->conceptOptions = new stdclass; $lang->custom->conceptOptions->story = array(); diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index 7c65bcb6f3..ade50a8647 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -216,7 +216,7 @@ $lang->custom->workingList['full'] = 'Application Lifecycle Management'; $lang->custom->menuTip = 'Click to show/hide the menu. Drag to switch display order.'; $lang->custom->saveFail = 'Failed to save!'; $lang->custom->page = ' Page'; -$lang->custom->changeClassicTip = 'The module of Program will be hidden, if you switch to Version 12.5.3 and below.'; +$lang->custom->changeClassicTip = 'The Program module will be hidden, if you switch to the classic mode.'; $lang->custom->scoreStatus[1] = 'On'; $lang->custom->scoreStatus[0] = 'Off'; diff --git a/module/custom/lang/fr.php b/module/custom/lang/fr.php index 3cde5e7903..bf14392a75 100644 --- a/module/custom/lang/fr.php +++ b/module/custom/lang/fr.php @@ -216,7 +216,7 @@ $lang->custom->workingList['full'] = 'Application Lifecycle Management'; $lang->custom->menuTip = "Cliquez pour montrer/cacher le menu. Déplacez pour changer l'ordre d'affichage."; $lang->custom->saveFail = 'Echec de la sauvegarde !'; $lang->custom->page = ' Page'; -$lang->custom->changeClassicTip = 'The module of Program will be hidden, if you switch to Version 12.5.3 and below.'; +$lang->custom->changeClassicTip = 'The Program module will be hidden, if you switch to the classic mode.'; $lang->custom->scoreStatus[1] = 'On'; $lang->custom->scoreStatus[0] = 'Off'; @@ -231,8 +231,9 @@ $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Plan'; $lang->custom->moduleName['execution'] = $lang->custom->execution; -$lang->custom->conceptQuestions['overview'] = "1. Quelle combinaison de gestion convient le mieux à votre entreprise ?"; -$lang->custom->conceptQuestions['URAndSR'] = "2. Do you want to use the concept of {$lang->URCommon} and {$lang->SRCommon} in ZenTao?"; +$lang->custom->conceptQuestions['overview'] = "1. Quelle combinaison de gestion convient le mieux à votre entreprise ?"; +$lang->custom->conceptQuestions['URAndSR'] = "2. Do you want to use the concept of {$lang->URCommon} and {$lang->SRCommon} in ZenTao?"; +$lang->custom->conceptQuestions['storypoint'] = "3. Which of the following units is your company using for scale estimation?"; $lang->custom->conceptOptions = new stdclass; $lang->custom->conceptOptions->story = array(); diff --git a/module/custom/lang/vi.php b/module/custom/lang/vi.php index f867992f13..3db2bbe941 100644 --- a/module/custom/lang/vi.php +++ b/module/custom/lang/vi.php @@ -216,7 +216,7 @@ $lang->custom->workingList['full'] = 'Quản lý vòng đời ứng dụng' $lang->custom->menuTip = 'Click để hiện/ẩn menu. Kéo thả để chuyển vị trí hiển thị.'; $lang->custom->saveFail = 'Lưu thất bại!'; $lang->custom->page = ''; -$lang->custom->changeClassicTip = 'The module of Program will be hidden, if you switch to Version 12.5.3 and below.'; +$lang->custom->changeClassicTip = 'The Program module will be hidden, if you switch to the classic mode.'; $lang->custom->scoreStatus[1] = 'On'; $lang->custom->scoreStatus[0] = 'Off'; @@ -231,8 +231,9 @@ $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Kế hoạch'; $lang->custom->moduleName['execution'] = $lang->custom->execution; -$lang->custom->conceptQuestions['overview'] = "1. Sự kết hợp quản lý nào phù hợp với công ty của bạn?"; -$lang->custom->conceptQuestions['URAndSR'] = "2. Do you want to use the concept of {$lang->URCommon} and {$lang->SRCommon} in ZenTao?"; +$lang->custom->conceptQuestions['overview'] = "1. Sự kết hợp quản lý nào phù hợp với công ty của bạn?"; +$lang->custom->conceptQuestions['URAndSR'] = "2. Do you want to use the concept of {$lang->URCommon} and {$lang->SRCommon} in ZenTao?"; +$lang->custom->conceptQuestions['storypoint'] = "3. Which of the following units is your company using for scale estimation?"; $lang->custom->conceptOptions = new stdclass; $lang->custom->conceptOptions->story = array(); diff --git a/module/custom/view/browsestoryconcept.html.php b/module/custom/view/browsestoryconcept.html.php index 55c6fa18c3..da578ac789 100644 --- a/module/custom/view/browsestoryconcept.html.php +++ b/module/custom/view/browsestoryconcept.html.php @@ -66,7 +66,7 @@ var $SRBox = $('.table-form .SRBox'); $SRBox.each(function(i) { var $this = $(this); - var name = $this.html(); + var name = $this.html(); $SRBox.each(function(j) { if(j <= i) return; diff --git a/module/custom/view/header.html.php b/module/custom/view/header.html.php index 70f9f5cd1a..7236d5db5b 100644 --- a/module/custom/view/header.html.php +++ b/module/custom/view/header.html.php @@ -15,9 +15,8 @@ if($sysObject == 'required') continue; common::printLink('custom', $sysObject, "", "{$lang->custom->$sysObject}", '', "class='btn btn-link' id='{$sysObject}Tab'"); } - - common::printLink('custom', 'mode', "", "{$lang->custom->mode}", '', "class='btn btn-link' id='modeTab'"); + common::printLink('custom', 'mode', "", "{$lang->custom->mode}", '', "class='btn btn-link' id='modeTab'"); ?> diff --git a/module/custom/view/mode.html.php b/module/custom/view/mode.html.php index d78ff4990d..bb1077a87d 100644 --- a/module/custom/view/mode.html.php +++ b/module/custom/view/mode.html.php @@ -29,12 +29,12 @@

-

custom->changeClassicTip : $lang->upgrade->selectedModeTips['new'];?>

+

custom->changeClassicTip : $lang->upgrade->selectedModeTips['new'];?>

- custom->switch, $changedMode == 'yes' ? 'disabled' : '');?> + custom->switch);?> diff --git a/module/doc/control.php b/module/doc/control.php index 1917b44a91..550a0bb9c6 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -487,8 +487,8 @@ class doc extends control if($doc->contentType == 'markdown') { - $doc->content = $this->doc->processMarkdown($doc->content); - $doc->digest = $this->doc->processMarkdown($$doc->digest); + $doc->content = commonModel::processMarkdown($doc->content); + $doc->digest = commonModel::processMarkdown($doc->digest); } /* Check priv when lib is product or project. */ @@ -916,8 +916,8 @@ class doc extends control if($doc->contentType == 'markdown') { - $doc->content = $this->doc->processMarkdown($doc->content); - $doc->digest = $this->doc->processMarkdown($doc->digest); + $doc->content = commonModel::processMarkdown($doc->content); + $doc->digest = commonModel::processMarkdown($doc->digest); } } diff --git a/module/doc/model.php b/module/doc/model.php index 942516d49f..1df41ba395 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1947,25 +1947,4 @@ class docModel extends model if(!isset($treeMenu[$module->parent])) $treeMenu[$module->parent] = ''; $treeMenu[$module->parent] .= 'id] ? ' class="closed"' : '') . '>' . $li . ''; } - - /** - * Process markdown. - * - * @param string $markdown - * @access public - * @return string - */ - public function processMarkdown($markdown) - { - if(empty($markdown)) return false; - - $markdown = str_replace('&', '&', $markdown); - - $hyperdown = $this->app->loadClass('hyperdown'); - $content = $hyperdown->makeHtml($markdown); - - $content = htmlspecialchars_decode($content); - $content = fixer::stripDataTags($content); - return $content; - } } diff --git a/module/execution/control.php b/module/execution/control.php index 5b5eca29ff..50facb576a 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2210,7 +2210,7 @@ class execution extends control $position[] = html::a($browseExecutionLink, $execution->name); $position[] = $this->lang->execution->manageProducts; - $allProducts = $this->product->getProductPairsByProject($execution->project); + $allProducts = $this->config->systemMode == 'classic' ? $this->product->getPairs('noclosed') : $this->product->getProductPairsByProject($execution->project); $linkedProducts = $this->execution->getProducts($execution->id); $linkedBranches = array(); diff --git a/module/execution/model.php b/module/execution/model.php index 879450b729..95bedc8efb 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -340,6 +340,12 @@ class executionModel extends model $sprint = $this->loadModel('file')->processImgURL($sprint, $this->config->execution->editor->create['id'], $this->post->uid); + /* Redefines the language entries for the fields in the project table. */ + foreach(explode(',', $this->config->execution->create->requiredFields) as $field) + { + if(isset($this->lang->execution->$field)) $this->lang->project->$field = $this->lang->execution->$field; + } + /* Replace required language. */ if($this->app->openApp == 'project') { @@ -484,7 +490,7 @@ class executionModel extends model } /* Redefines the language entries for the fields in the project table. */ - foreach(explode(',', $this->config->execution->create->requiredFields) as $field) + foreach(explode(',', $this->config->execution->edit->requiredFields) as $field) { if(isset($this->lang->execution->$field)) $this->lang->project->$field = $this->lang->execution->$field; } @@ -1740,12 +1746,12 @@ class executionModel extends model { $this->loadModel('user'); $products = isset($_POST['products']) ? $_POST['products'] : $products; - $oldProdcuts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('project')->eq((int)$executionID)->fetchGroup('product', 'branch'); + $oldProducts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('project')->eq((int)$executionID)->fetchGroup('product', 'branch'); $this->dao->delete()->from(TABLE_PROJECTPRODUCT)->where('project')->eq((int)$executionID)->exec(); $members = array_keys($this->getTeamMembers($executionID)); if(empty($products)) { - $this->user->updateUserView(array_keys($oldProdcuts), 'product', $members); + $this->user->updateUserView(array_keys($oldProducts), 'product', $members); return true; } @@ -1760,10 +1766,10 @@ class executionModel extends model $oldPlan = 0; $branch = isset($branches[$i]) ? $branches[$i] : 0; - if(isset($oldProdcuts[$productID][$branch])) + if(isset($oldProducts[$productID][$branch])) { - $oldProdcuts= $oldProdcuts[$productID][$branch]; - $oldPlan = $oldProdcuts>plan; + $oldProduct = $oldProducts[$productID][$branch]; + $oldPlan = $oldProduct->plan; } $data = new stdclass(); @@ -1775,7 +1781,7 @@ class executionModel extends model $existedProducts[$productID] = true; } - $oldProductKeys = array_keys($oldProdcuts); + $oldProductKeys = array_keys($oldProducts); $needUpdate = array_merge(array_diff($oldProductKeys, $products), array_diff($products, $oldProductKeys)); if($needUpdate) $this->user->updateUserView($needUpdate, 'product', $members); } diff --git a/module/execution/view/ajaxgetdropmenu.html.php b/module/execution/view/ajaxgetdropmenu.html.php index 2be1f053ac..4bdd443b9b 100644 --- a/module/execution/view/ajaxgetdropmenu.html.php +++ b/module/execution/view/ajaxgetdropmenu.html.php @@ -3,9 +3,10 @@ $programProducts)
@@ -146,10 +147,10 @@ $(function() $('.nav-tabs li span').hide(); $('.nav-tabs li.active').find('span').show(); - $('.nav-tabs>li').click(function() + $('.nav-tabs>li a').click(function() { - $(this).find('span').show(); - $(this).siblings('li').find('span').hide(); + $(this).siblings().show(); + $(this).parent().siblings('li').find('span').hide(); if($(this).attr('class') != 'active') $('#dropMenu').removeClass('show-right-col'); $("#dropMenu .search-box").width('auto'); }) diff --git a/module/product/view/all.html.php b/module/product/view/all.html.php index 79bab6c722..811ed917a8 100644 --- a/module/product/view/all.html.php +++ b/module/product/view/all.html.php @@ -69,6 +69,7 @@ + $program):?> $line):?> - + + config->systemMode == 'new' and $programID) { diff --git a/module/product/view/batchedit.html.php b/module/product/view/batchedit.html.php index 3c4716187e..4428de2ff6 100755 --- a/module/product/view/batchedit.html.php +++ b/module/product/view/batchedit.html.php @@ -52,7 +52,9 @@ $full = ''; } ?> + config->systemMode == 'new'):?> '>product->program;?> + product->name;?> '>product->line;?> '>product->PO;?> @@ -73,9 +75,16 @@ ?> + config->systemMode == 'new'):?> + program])):?> + ' style='overflow:visible'>program, "class='form-control' disabled");?> + ' style='overflow:visible'>program, "class='form-control picker-select' onchange='loadProductLines(this.value, $productID)'");?> + + name, "class='form-control'");?> - ' style='overflow:visible' id="line_">program]) ? $lines[$products[$productID]->program] : '', $products[$productID]->line, "class='form-control picker-select'");?> + program]) ? $lines[$products[$productID]->program] : '';?> + ' style='overflow:visible' id="line_">config->systemMode == 'new' ? $productLines : $lines, $products[$productID]->line, "class='form-control picker-select'");?> ' style='overflow:visible'>PO, "class='form-control picker-select'");?> ' style='overflow:visible'>QD, "class='form-control picker-select'");?> ' style='overflow:visible'>RD, "class='form-control picker-select'");?> diff --git a/module/product/view/edit.html.php b/module/product/view/edit.html.php index fefef34b09..a619913fb7 100644 --- a/module/product/view/edit.html.php +++ b/module/product/view/edit.html.php @@ -35,7 +35,9 @@ config->systemMode == 'new'):?> product->program;?> - program, "class='form-control chosen'");?> + app->user->view->programs},", ",{$product->program},") === false ? 'disabled' : '';?> + program);?> + program, "class='form-control chosen' $attr");?> diff --git a/module/program/model.php b/module/program/model.php index c13ed2f8f4..e09a1da422 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -101,6 +101,22 @@ class programModel extends model return $program; } + /** + * Get program pairs by id list. + * + * @param string|array $programIDList + * @access public + * @return void + */ + public function getPairsByList($programIDList = '') + { + return $this->dao->select('id, name')->from(TABLE_PROGRAM) + ->where('id')->in($programIDList) + ->andWhere('`type`')->eq('program') + ->andWhere('deleted')->eq(0) + ->fetchPairs(); + } + /** * Get program list. * @@ -728,7 +744,7 @@ class programModel extends model /** * Get parent PM by programIdList. - * + * * @param array $programIdList * @access public * @return void @@ -739,24 +755,24 @@ class programModel extends model $parents = array(); foreach($objects as $object) - { + { if($object->parent == 0) continue; foreach(explode(',', $object->path) as $objectID) - { + { if(empty($objectID) || $objectID == $object->id) continue; $parents[$objectID][] = $object->id; - } - } + } + } /* Get all parent PM.*/ $parentPM = $this->dao->select('id, PM')->from(TABLE_PROGRAM)->where('id')->in(array_keys($parents))->andWhere('deleted')->eq('0')->fetchAll(); $parentPMGroup = array(); foreach($parentPM as $PM) - { + { $subPrograms = zget($parents, $PM->id, array()); foreach($subPrograms as $subProgramID) $parentPMGroup[$subProgramID][$PM->PM] = $PM->PM; - } + } return $parentPMGroup; } diff --git a/module/project/control.php b/module/project/control.php index 9aa49fa019..604e4994a2 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -416,7 +416,6 @@ class project extends control ->where('t1.project')->eq($projectID) ->andWhere('t2.plan')->in(array_keys($oldPlans)) ->fetchAll('story'); - $diffResult = array_diff($oldPlans, $_POST['plans']); $changes = $this->project->update($projectID); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); @@ -428,6 +427,7 @@ class project extends control } /* Link the plan stories. */ + $diffResult = array_diff($oldPlans, $_POST['plans']); if(!empty($_POST['plans']) and !empty($diffResult)) { $this->loadModel('productplan')->linkProject($projectID, $_POST['plans'], $oldPlanStories); @@ -471,6 +471,7 @@ class project extends control $this->view->users = $this->user->getPairs('noclosed|nodeleted'); $this->view->project = $project; $this->view->programList = $this->program->getParentPairs(); + $this->view->program = $this->program->getByID($project->parent); $this->view->projectID = $projectID; $this->view->allProducts = array('0' => '') + $allProducts; $this->view->productPlans = $productPlans; @@ -519,14 +520,23 @@ class project extends control $projectIdList = $this->post->projectIdList ? $this->post->projectIdList : die(js::locate($this->session->projectList, 'parent')); $projects = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->in($projectIdList)->fetchAll('id'); - foreach($projects as $project) $appendPMUsers[$project->PM] = $project->PM; + /* Get program list. */ + $programs = $this->loadModel('program')->getParentPairs(); + $unauthorizedIDList = array(); + foreach($projects as $project) + { + if(!isset($programs[$project->parent]) and !in_array($project->parent, $unauthorizedIDList)) $unauthorizedIDList[] = $project->parent; + $appendPMUsers[$project->PM] = $project->PM; + } + $unauthorizedPrograms = $this->program->getPairsByList($unauthorizedIDList); $this->view->title = $this->lang->project->batchEdit; $this->view->position[] = $this->lang->project->batchEdit; - $this->view->projects = $projects; - $this->view->programList = $this->loadModel('program')->getParentPairs(); - $this->view->PMUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst', $appendPMUsers); + $this->view->projects = $projects; + $this->view->programs = $programs; + $this->view->unauthorizedPrograms = $unauthorizedPrograms; + $this->view->PMUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst', $appendPMUsers); $this->display(); } diff --git a/module/project/model.php b/module/project/model.php index 3c2f0fcbe3..c6cb2abaa5 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -976,8 +976,8 @@ class projectModel extends model $projectName = $data->names[$projectID]; $projects[$projectID] = new stdClass(); + if(isset($data->parents[$projectID])) $projects[$projectID]->parent = $data->parents[$projectID]; $projects[$projectID]->name = $projectName; - $projects[$projectID]->parent = $data->parents[$projectID]; $projects[$projectID]->PM = $data->PMs[$projectID]; $projects[$projectID]->begin = $data->begins[$projectID]; $projects[$projectID]->end = isset($data->ends[$projectID]) ? $data->ends[$projectID] : LONG_TIME; diff --git a/module/project/view/ajaxgetdropmenu.html.php b/module/project/view/ajaxgetdropmenu.html.php index 8650937e86..a240e49ab3 100644 --- a/module/project/view/ajaxgetdropmenu.html.php +++ b/module/project/view/ajaxgetdropmenu.html.php @@ -3,10 +3,11 @@