diff --git a/config/filter.php b/config/filter.php index 42bd625242..59fe2874da 100644 --- a/config/filter.php +++ b/config/filter.php @@ -187,6 +187,7 @@ $filter->project->default->cookie['lastProject'] = 'int'; $filter->project->default->cookie['lastPRJ'] = 'int'; $filter->project->default->cookie['projectMode'] = 'code'; $filter->project->browse->cookie['involved'] = 'code'; +$filter->project->browse->cookie['projectType'] = 'code'; $filter->project->story->cookie['storyModuleParam'] = 'int'; $filter->project->story->cookie['storyPreProjectID'] = 'int'; $filter->project->story->cookie['storyProductParam'] = 'int'; diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 773bb0ad30..a4a9412257 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -112,7 +112,7 @@ $lang->loading = 'Loading...'; $lang->notFound = 'Not found!'; $lang->notPage = 'Sorry, the features you are visiting are in development!'; $lang->showAll = '[[Show All]]'; -$lang->selectedItems = 'Seleted {0} items'; +$lang->selectedItems = 'Selected {0} items'; $lang->future = 'Waiting'; $lang->year = 'Year'; diff --git a/module/common/model.php b/module/common/model.php index 525876f09e..37d7afb21d 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -544,7 +544,8 @@ class commonModel extends model if($config->systemMode == 'classic' and $openApp == 'execution') $icon = zget($lang->navIcons, 'project', ''); $link = helper::createLink($currentModule, $currentMethod); - $html = $link ? html::a($link, "$icon {$lang->$openApp->common}", '', "class='btn'") : "$icon {$lang->$openApp->common}"; + $className = $openApp == 'devops' ? 'btn num' : 'btn'; + $html = $link ? html::a($link, "$icon {$lang->$openApp->common}", '', "class='$className'") : "$icon {$lang->$openApp->common}"; echo "
" . $html . '
'; } diff --git a/module/compile/model.php b/module/compile/model.php index d18c4a10a7..5fe8999488 100644 --- a/module/compile/model.php +++ b/module/compile/model.php @@ -12,9 +12,9 @@ class compileModel extends model { /** - * Get by id - * - * @param int $buildID + * Get by id + * + * @param int $buildID * @access public * @return object */ @@ -25,10 +25,10 @@ class compileModel extends model /** * Get build list. - * - * @param int $jobID - * @param string $orderBy - * @param object $pager + * + * @param int $jobID + * @param string $orderBy + * @param object $pager * @access public * @return array */ @@ -48,7 +48,7 @@ class compileModel extends model /** * Get unexecuted list. - * + * * @access public * @return array */ @@ -59,7 +59,7 @@ class compileModel extends model /** * Get last result. - * + * * @param int $jobID * @access public * @return object @@ -71,7 +71,7 @@ class compileModel extends model /** * Get build url. - * + * * @param object $jenkins * @access public * @return object @@ -91,10 +91,10 @@ class compileModel extends model /** * Save build by job - * - * @param int $jobID - * @param string $data - * @param string $type + * + * @param int $jobID + * @param string $data + * @param string $type * @access public * @return void */ @@ -114,7 +114,7 @@ class compileModel extends model /** * Execute compile - * + * * @param object $compile * @access public * @return bool diff --git a/module/doc/config.php b/module/doc/config.php index 9300f4c4c0..0b18228a9d 100644 --- a/module/doc/config.php +++ b/module/doc/config.php @@ -28,6 +28,8 @@ $config->doc->editor->view = array('id' => 'comment,lastComment', 'tools' => ' $config->doc->markdown = new stdclass(); $config->doc->markdown->create = array('id' => 'contentMarkdown', 'tools' => 'withchange'); +$config->doc->defaultShowNumber = 10; + $config->doc->search['module'] = 'doc'; $config->doc->search['fields']['title'] = $lang->doc->title; $config->doc->search['fields']['id'] = $lang->doc->id; diff --git a/module/doc/control.php b/module/doc/control.php index c30d61dc8a..e0b78957f1 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -911,7 +911,8 @@ class doc extends control $actionURL = $this->createLink('doc', 'browse', "lib=0&browseType=bySearch&queryID=myQueryID"); $this->doc->buildSearchForm(0, array(), 0, $actionURL, 'objectLibs'); - $this->lang->TRActions = common::hasPriv('doc', 'create') ? $this->doc->buildCreateButton4Doc($type, $objectID, $libID) : ''; + $this->lang->TRActions = $this->doc->buildCollectButton4Doc(); + $this->lang->TRActions .= common::hasPriv('doc', 'create') ? $this->doc->buildCreateButton4Doc($type, $objectID, $libID) : ''; $moduleTree = $type == 'book' ? $this->doc->getBookStructure($libID) : $this->doc->getTreeMenu($type, $objectID, $libID, 0, $docID); @@ -923,7 +924,7 @@ class doc extends control if($doc->keywords) { - $doc->keywords = preg_replace("/(\n)|(\s)|(\t)|(\')|(')|(,)/", ',', $doc->keywords); + $doc->keywords = preg_replace("/(,)/", ',', $doc->keywords); $doc->keywords = explode(',', $doc->keywords); } diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php index 32b4c921f1..48e0412c9e 100644 --- a/module/doc/lang/de.php +++ b/module/doc/lang/de.php @@ -89,20 +89,21 @@ $lang->doc->cancelCollection = 'Favorit entfernen'; $lang->doc->deleteFile = 'Delete File'; $lang->doc->menuTitle = 'Menu'; -$lang->doc->libName = 'Name'; -$lang->doc->libType = 'Kategorie'; -$lang->doc->custom = 'Eigene Dok Bibliothek'; -$lang->doc->customAB = 'Eigene Bibliothek'; -$lang->doc->createlib = 'Bibliothek erstellen'; -$lang->doc->allLibs = 'Bibliothek'; -$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->executionCommon} Bibliothek Liste"; -$lang->doc->showFiles = 'Dok Bibliothek'; -$lang->doc->editlib = 'Bibliothek bearbeiten'; -$lang->doc->deleteLib = 'Bibliothek löschen'; -$lang->doc->fixedMenu = 'Im Menü fixieren'; -$lang->doc->removeMenu = 'Vom Menü entfernen'; -$lang->doc->search = 'Suche'; -$lang->doc->keywordsTips = 'Please use commas to separate multiple keywords.'; +$lang->doc->libName = 'Name'; +$lang->doc->libType = 'Kategorie'; +$lang->doc->custom = 'Eigene Dok Bibliothek'; +$lang->doc->customAB = 'Eigene Bibliothek'; +$lang->doc->createlib = 'Bibliothek erstellen'; +$lang->doc->allLibs = 'Bibliothek'; +$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->executionCommon} Bibliothek Liste"; +$lang->doc->showFiles = 'Dok Bibliothek'; +$lang->doc->editlib = 'Bibliothek bearbeiten'; +$lang->doc->deleteLib = 'Bibliothek löschen'; +$lang->doc->fixedMenu = 'Im Menü fixieren'; +$lang->doc->removeMenu = 'Vom Menü entfernen'; +$lang->doc->search = 'Suche'; +$lang->doc->allCollections = 'All Collections'; +$lang->doc->keywordsTips = 'Please use commas to separate multiple keywords.'; /* 查询条件列表 */ $lang->doc->allProduct = 'Alle' . $lang->productCommon; diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index c31465638e..48b7e2db6c 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -92,20 +92,21 @@ $lang->doc->menuTitle = 'Menu'; $lang->doc->collectAction = 'Add Favorite'; -$lang->doc->libName = 'Document Library'; -$lang->doc->libType = 'Category'; -$lang->doc->custom = 'Custom Document Library'; -$lang->doc->customAB = 'Custom Doc Lib'; -$lang->doc->createLib = 'Create Document Library'; -$lang->doc->allLibs = 'Library List'; -$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->executionCommon} Libraries"; -$lang->doc->showFiles = 'Attachments'; -$lang->doc->editLib = 'Edit Document Library'; -$lang->doc->deleteLib = 'Delete Document Library'; -$lang->doc->fixedMenu = 'Fix to Menu'; -$lang->doc->removeMenu = 'Remove from Menu'; -$lang->doc->search = 'Search'; -$lang->doc->keywordsTips = 'Please use commas to separate multiple keywords.'; +$lang->doc->libName = 'Document Library'; +$lang->doc->libType = 'Category'; +$lang->doc->custom = 'Custom Document Library'; +$lang->doc->customAB = 'Custom Doc Lib'; +$lang->doc->createLib = 'Create Document Library'; +$lang->doc->allLibs = 'Library List'; +$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->executionCommon} Libraries"; +$lang->doc->showFiles = 'Attachments'; +$lang->doc->editLib = 'Edit Document Library'; +$lang->doc->deleteLib = 'Delete Document Library'; +$lang->doc->fixedMenu = 'Fix to Menu'; +$lang->doc->removeMenu = 'Remove from Menu'; +$lang->doc->search = 'Search'; +$lang->doc->allCollections = 'All Collections'; +$lang->doc->keywordsTips = 'Please use commas to separate multiple keywords.'; global $config; /* Query condition list. */ diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php index 1a4658f5a2..f1a2151826 100644 --- a/module/doc/lang/fr.php +++ b/module/doc/lang/fr.php @@ -89,20 +89,21 @@ $lang->doc->cancelCollection = 'Retirer des Favoris'; $lang->doc->deleteFile = 'Supprimer Fichier'; $lang->doc->menuTitle = 'Menu'; -$lang->doc->libName = 'Bibliothèque de Documents'; -$lang->doc->libType = 'Catégorie'; -$lang->doc->custom = 'Personnaliser Bibliothèque de Documents'; -$lang->doc->customAB = 'Person. Bib Doc'; -$lang->doc->createlib = 'Créer une Bibliothèque'; -$lang->doc->allLibs = 'Liste des Bibliothèque'; -$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->executionCommon} Bibliothèque"; -$lang->doc->showFiles = 'Pièces Jointes'; -$lang->doc->editlib = 'Editer Bibliothèque'; -$lang->doc->deleteLib = 'Supprimer Bibliothèque'; -$lang->doc->fixedMenu = 'Coller au Menu'; -$lang->doc->removeMenu = 'Décoller du Menu'; -$lang->doc->search = 'Rechercher'; -$lang->doc->keywordsTips = 'Please use commas to separate multiple keywords.'; +$lang->doc->libName = 'Bibliothèque de Documents'; +$lang->doc->libType = 'Catégorie'; +$lang->doc->custom = 'Personnaliser Bibliothèque de Documents'; +$lang->doc->customAB = 'Person. Bib Doc'; +$lang->doc->createlib = 'Créer une Bibliothèque'; +$lang->doc->allLibs = 'Liste des Bibliothèque'; +$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->executionCommon} Bibliothèque"; +$lang->doc->showFiles = 'Pièces Jointes'; +$lang->doc->editlib = 'Editer Bibliothèque'; +$lang->doc->deleteLib = 'Supprimer Bibliothèque'; +$lang->doc->fixedMenu = 'Coller au Menu'; +$lang->doc->removeMenu = 'Décoller du Menu'; +$lang->doc->search = 'Rechercher'; +$lang->doc->allCollections = 'All Collections'; +$lang->doc->keywordsTips = 'Please use commas to separate multiple keywords.'; /* 查询条件列表 */ $lang->doc->allProduct = 'Tous les' . $lang->productCommon . 's'; diff --git a/module/doc/lang/vi.php b/module/doc/lang/vi.php index 739ecf4e48..54e8f30b41 100644 --- a/module/doc/lang/vi.php +++ b/module/doc/lang/vi.php @@ -89,20 +89,21 @@ $lang->doc->cancelCollection = 'Remove Favorite'; $lang->doc->deleteFile = 'Xóa File'; $lang->doc->menuTitle = 'Menu'; -$lang->doc->libName = 'Thư viện tài liệu'; -$lang->doc->libType = 'Danh mục'; -$lang->doc->custom = 'Tùy biến thư viện tài liệu'; -$lang->doc->customAB = 'Tùy biến Doc Lib'; -$lang->doc->createlib = 'Tạo thư viện tài liệu'; -$lang->doc->allLibs = 'Library danh sách'; -$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->executionCommon} Libraries"; -$lang->doc->showFiles = 'Attachments'; -$lang->doc->editlib = 'Sửa thư viện tài liệu'; -$lang->doc->deleteLib = 'Xóa thư viện tài liệu'; -$lang->doc->fixedMenu = 'Sửa to Menu'; -$lang->doc->removeMenu = 'Remove from Menu'; -$lang->doc->search = 'Tìm kiếm'; -$lang->doc->keywordsTips = 'Please use commas to separate multiple keywords.'; +$lang->doc->libName = 'Thư viện tài liệu'; +$lang->doc->libType = 'Danh mục'; +$lang->doc->custom = 'Tùy biến thư viện tài liệu'; +$lang->doc->customAB = 'Tùy biến Doc Lib'; +$lang->doc->createlib = 'Tạo thư viện tài liệu'; +$lang->doc->allLibs = 'Library danh sách'; +$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->executionCommon} Libraries"; +$lang->doc->showFiles = 'Attachments'; +$lang->doc->editlib = 'Sửa thư viện tài liệu'; +$lang->doc->deleteLib = 'Xóa thư viện tài liệu'; +$lang->doc->fixedMenu = 'Sửa to Menu'; +$lang->doc->removeMenu = 'Remove from Menu'; +$lang->doc->search = 'Tìm kiếm'; +$lang->doc->allCollections = 'All Collections'; +$lang->doc->keywordsTips = 'Please use commas to separate multiple keywords.'; /* Query condition list. */ $lang->doc->allProduct = 'All' . $lang->productCommon; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index a332ab805e..be111d38e5 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -105,6 +105,7 @@ $lang->doc->deleteLib = '删除文档库'; $lang->doc->fixedMenu = '固定到菜单栏'; $lang->doc->removeMenu = '从菜单栏移除'; $lang->doc->search = '搜索'; +$lang->doc->allCollections = '全部收藏文档'; $lang->doc->keywordsTips = '多个关键字请用逗号分隔。'; global $config; diff --git a/module/doc/model.php b/module/doc/model.php index 6bbbc17901..d2d6c8dbc5 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1676,6 +1676,47 @@ class docModel extends model return $html; } + public function buildCollectButton4Doc() + { + $allLibs = array_keys($this->getLibs('all')); + $docs = $this->dao->select('t1.id,t1.title,t1.lib,t2.type,t2.product,t2.project,t2.execution')->from(TABLE_DOC)->alias('t1') + ->leftJoin(TABLE_DOCLIB)->alias('t2')->on('t1.lib=t2.id') + ->where('t1.deleted')->eq(0) + ->andWhere('t1.lib')->in($allLibs) + ->beginIF($this->config->doc->notArticleType)->andWhere('t1.type')->notIN($this->config->doc->notArticleType)->fi() + ->andWhere('t1.collector')->like("%,{$this->app->user->account},%") + ->orderBy('t1.id_desc') + ->limit($this->config->doc->defaultShowNumber) + ->fetchAll(); + + $html = "'; + return $html; + } + /** * Set past menu. * @@ -1875,6 +1916,7 @@ class docModel extends model $selected = $key == $libID ? 'selected' : ''; $output .= html::a(inlink($methodName, "type=$type&objectID=$objectID&libID=$key"), $lib->name, '', "class='$selected' data-app='{$this->app->openApp}'"); } + if($type != 'custom') $output .= html::a(inlink('showFiles', "type=$type&objectID=$objectID"), $this->lang->doclib->files, '', "data-app='{$this->app->openApp}'"); $output .= ""; } diff --git a/module/gitlab/model.php b/module/gitlab/model.php index 8a5fa49bd4..6dff7d30df 100644 --- a/module/gitlab/model.php +++ b/module/gitlab/model.php @@ -382,6 +382,20 @@ class gitlabModel extends model return $allResults; } + /** + * Get single project by API. + * + * @param int $gitlabID + * @param int $projectID + * @access public + * @return object + */ + public function apiGetSingleProject($gitlabID, $projectID) + { + $url = sprintf($this->getApiRoot($gitlabID), "/projects/$projectID"); + return json_decode(commonModel::http($url)); + } + /** * Get hooks. * diff --git a/module/index/css/index.css b/module/index/css/index.css index 4cd2bbfb53..1751aafe4c 100644 --- a/module/index/css/index.css +++ b/module/index/css/index.css @@ -4,7 +4,7 @@ body {padding-left: 96px;} #menuNav {position: absolute; top: 5px; bottom: 80px; width: 100%;} .menu-hide #menuNav {bottom: 40px;} #menu .nav > li {float: none; padding: 2px 8px;} -#menu .nav > li > a {color: #fff; line-height: 20px; padding: 8px 6px; border-radius: 2px; white-space: nowrap;} +#menu .nav > li > a {color: #fff; line-height: 24px; padding: 6px; border-radius: 2px; white-space: nowrap; height: 36px;} #menu .nav > li > a > .icon {display: inline-block; font-size: 16px;} #menu .nav > li > a > .icon + .text {margin-left: 4px;} #menu .nav > li.active > a, #menu .nav > li > a:hover, #menu .nav > li > a:focus {background-color: #0c64eb;} diff --git a/module/index/js/index.js b/module/index/js/index.js index 8e24e87e13..1ac7f86718 100644 --- a/module/index/js/index.js +++ b/module/index/js/index.js @@ -34,7 +34,7 @@ item.icon = ($link.find('.icon').attr('class') || '').replace('icon ', ''); item.text = $link.text().trim(); - $link.html('' + item.text + ''); + $link.html('' + item.text + ''); appsMap[item.code] = item; $('
  • ').attr('data-app', item.code) diff --git a/module/job/model.php b/module/job/model.php index 77009adef5..b843f9947f 100644 --- a/module/job/model.php +++ b/module/job/model.php @@ -386,4 +386,22 @@ class jobModel extends model return $compile->status; } + + /** + * Get gitlab project name by jobID. + * + * @param int $jobID + * @access public + * @return string|false + */ + public function getGitlabProjectName($jobID) + { + $job = $this->getByID($jobID); + if(strtolower($job->engine) != 'gitlab') return false; + $gitlabID = $job->server; + $projectID = $job->pipeline; + $project = $this->loadModel('gitlab')->apiGetSingleProject($gitlabID, $projectID); + if(isset($project->name)) return $project->name; + return false; + } } diff --git a/module/job/view/browse.html.php b/module/job/view/browse.html.php index f105ba1d09..f4c3145e21 100644 --- a/module/job/view/browse.html.php +++ b/module/job/view/browse.html.php @@ -31,7 +31,7 @@ job->repo);?> job->frame);?> job->engine);?> - job->jenkins);?> + job->buildSpec);?> job->triggerType;?> job->lastStatus);?> job->lastExec);?> @@ -46,6 +46,7 @@ repoName; ?> job->frameList, $job->frame);?> engine;?> + engine) == 'gitlab') $job->pipeline = $this->job->getGitlabProjectName($job->id);?> pipeline) . '@' . $job->jenkinsName;?> job->getTriggerConfig($job);?> diff --git a/module/job/view/edit.html.php b/module/job/view/edit.html.php index 222b5260c5..781b7227db 100644 --- a/module/job/view/edit.html.php +++ b/module/job/view/edit.html.php @@ -95,6 +95,7 @@ + engine == 'jenkins'):?> job->server; ?> @@ -109,6 +110,7 @@ + job->customParam;?> diff --git a/module/product/css/all.css b/module/product/css/all.css index 13db8c8a15..266a78f19a 100644 --- a/module/product/css/all.css +++ b/module/product/css/all.css @@ -42,7 +42,7 @@ th.table-nest-title .sort-up {padding-left: 5px;} th.table-nest-title .sort-down {padding-left: 5px;} th .check-all {left: -16px;} -#productTableList .icon-product:before {content: '\e98f'; width: 22px; height: 22px; background: none; color: #16a8f8; top: 0; line-height: 22px; margin-right: 2px; font-size: 14px;} +#productTableList .icon-product:before {content: '\e98f'; width: 22px; height: 22px; background: none; color: rgb(166, 170, 184); top: 0; line-height: 22px; margin-right: 2px; font-size: 14px;} .table.has-sort-head thead>tr>th>a:after, .table.has-sort-head thead>tr>th>a:before {top: -3px;} .main-table thead>tr>th {padding: 0px 8px; line-height: 24px;} diff --git a/module/program/model.php b/module/program/model.php index 15930d5742..03fc536628 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -247,6 +247,7 @@ class programModel extends model { $TotalProgress = array(); $projectCount = array(); + $viewPrjCount = array(); $progressList = array(); $programPairs = $this->getPairs(); $projectStats = $this->getProjectStats(0, 'all', 0, 'id_desc', null, 0, 0, true); @@ -256,16 +257,29 @@ class programModel extends model { $TotalProgress[$programID] = 0; $projectCount[$programID] = 0; + $viewPrjCount[$programID] = 0; $progressList[$programID] = 0; foreach($projectStats as $project) { if(strpos($project->path, ',' . $programID . ',') === false) continue; + + /* The number of projects under this program that the user can view. */ + if(strpos(',' . $this->app->user->view->projects . ',', ',' . $project->id . ',') !== false) $viewPrjCount[$programID]++; + $TotalProgress[$programID] += $project->hours->progress; $projectCount[$programID]++; } if(empty($projectCount[$programID])) continue; + + /* Program progress can't see when this user don't have all projects priv. */ + if(!$this->app->user->admin and $viewPrjCount[$programID] != $projectCount[$programID]) + { + unset($progressList[$programID]); + continue; + } + $progressList[$programID] = round($TotalProgress[$programID] / $projectCount[$programID]); } @@ -931,7 +945,7 @@ class programModel extends model $project->hours = isset($hours[$project->id]) ? $hours[$project->id] : (object)$emptyHour; $project->teamCount = isset($teams[$project->id]) ? $teams[$project->id]->teams : 0; - $stats[] = $project; + $stats[$key] = $project; } return $stats; } diff --git a/module/program/view/browsebylist.html.php b/module/program/view/browsebylist.html.php index b310fae7e0..bea3df1a5d 100644 --- a/module/program/view/browsebylist.html.php +++ b/module/program/view/browsebylist.html.php @@ -75,9 +75,11 @@ begin;?> end == LONG_TIME ? $lang->program->longTime : $program->end;?> + id])):?>
    id];?>
    + type == 'program'):?> diff --git a/module/project/control.php b/module/project/control.php index a55a8b610d..afc592d2dc 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -216,6 +216,8 @@ class project extends control $this->loadModel('execution'); $this->session->set('projectList', $this->app->getURI(true), 'project'); + $projectType = $this->cookie->projectType ? $this->cookie->projectType : 'bylist'; + /* Load pager and get tasks. */ $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); @@ -232,10 +234,15 @@ class project extends control $this->view->programID = $programID; $this->view->program = $this->program->getByID($programID); $this->view->programTree = $this->project->getTreeMenu(0, array('projectmodel', 'createManageLink'), 0, 'list'); + $this->view->programs = array('0' => '') + $this->program->getParentPairs(); $this->view->users = $this->loadModel('user')->getPairs('noletter|pofirst|nodeleted'); $this->view->browseType = $browseType; + $this->view->projectType = $projectType; $this->view->param = $param; $this->view->orderBy = $orderBy; + $this->view->recTotal = $recTotal; + $this->view->recPerPage = $recPerPage; + $this->view->pageID = $pageID; $this->display(); } diff --git a/module/project/css/browse.css b/module/project/css/browse.css index 3c5a1c9361..d2a3a5f620 100644 --- a/module/project/css/browse.css +++ b/module/project/css/browse.css @@ -5,3 +5,6 @@ th.c-budget,{text-align:right;} td.c-actions {overflow: visible;} .c-actions .btn {overflow: visible;} +#programBox {float: left; margin-right: 10px;} +#switchButton {background: #fff !important;} +.panel-actions {position: relative; display: inline-block; vertical-align: middle; padding: 0 0;} diff --git a/module/project/js/browse.js b/module/project/js/browse.js index 6f812d1ef3..1bdb8ed328 100644 --- a/module/project/js/browse.js +++ b/module/project/js/browse.js @@ -6,6 +6,26 @@ $(function() $.cookie('involved', involved, {expires:config.cookieLife, path:config.webRoot}); window.location.reload(); }); + + $('[id="switchButton"]').click(function() + { + var projectType = $(this).attr('data-type'); + $.cookie('projectType', projectType, {expires:config.cookieLife, path:config.webRoot}); + window.location.reload(); + }); }); +/** + * Change program. + * + * @param int $programID + * @access public + * @return void + */ +function changeProgram(programID) +{ + link = createLink('project', 'browse', 'programID=' + programID + '&browseType=' + browseType + '¶m=' + param + '&orderBy=order_asc&recTotal=' + recTotal + '&recPerPage=' + recPerPage + '&pageID=' + pageID); + location.href = link; +} + $(".tree #program" + programID).parent('li').addClass('active'); diff --git a/module/project/lang/de.php b/module/project/lang/de.php index 5f1501217b..4a6f67d7a8 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -48,6 +48,8 @@ $lang->project->copyNoProject = 'There are no items available to copy.'; $lang->project->searchByName = 'Enter the project name to search'; $lang->project->linkedProducts = "Linked {$lang->productCommon}s"; $lang->project->unlinkedProducts = "Unlinked {$lang->productCommon}s"; +$lang->project->testreport = 'Testreport'; +$lang->project->selectProgram = 'Select Program'; /* Fields. */ $lang->project->common = 'Program'; @@ -74,6 +76,7 @@ $lang->project->realEnd = 'Actual End'; $lang->project->realBegan = 'Actual Began'; $lang->project->bygrid = 'Kanban'; $lang->project->bylist = 'List'; +$lang->project->bycard = 'Card'; $lang->project->mine = 'My'; $lang->project->myProject = 'Meine Zuständigkeit'; $lang->project->other = 'Andere'; diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 03385ee0f4..70d3c8d814 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -50,6 +50,8 @@ $lang->project->deleted = 'Deleted'; $lang->project->linkedProducts = "Linked {$lang->productCommon}s"; $lang->project->unlinkedProducts = "Unlinked {$lang->productCommon}s"; $lang->project->testreport = 'Test Report'; +$lang->project->testreport = 'Testreport'; +$lang->project->selectProgram = 'Select Program'; /* Fields. */ $lang->project->common = 'Project'; @@ -75,6 +77,7 @@ $lang->project->realEnd = 'Actual End'; $lang->project->realBegan = 'Actual Began'; $lang->project->bygrid = 'Kanban'; $lang->project->bylist = 'List'; +$lang->project->bycard = 'Card'; $lang->project->mine = 'My'; $lang->project->myProject = 'Mine'; $lang->project->other = 'Others'; diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php index 29b5792fb9..b6d7071b7f 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -48,6 +48,8 @@ $lang->project->copyNoProject = 'There are no items available to copy.'; $lang->project->searchByName = 'Enter the project name to retrieve'; $lang->project->linkedProducts = "Linked {$lang->productCommon}s"; $lang->project->unlinkedProducts = "Unlinked {$lang->productCommon}s"; +$lang->project->testreport = 'Testreport'; +$lang->project->selectProgram = 'Select Program'; /* Fields. */ $lang->project->common = 'Project'; @@ -74,6 +76,7 @@ $lang->project->realEnd = 'Actual End'; $lang->project->realBegan = 'Actual Began'; $lang->project->bygrid = 'Kanban'; $lang->project->bylist = 'List'; +$lang->project->bycard = 'Card'; $lang->project->mine = 'My'; $lang->project->myProject = 'Mine'; $lang->project->other = 'Others'; diff --git a/module/project/lang/vi.php b/module/project/lang/vi.php index c531f3bedb..ecfd5a1981 100644 --- a/module/project/lang/vi.php +++ b/module/project/lang/vi.php @@ -48,6 +48,8 @@ $lang->project->copyNoProject = 'There are no items available to copy.'; $lang->project->searchByName = 'Enter the project name to retrieve'; $lang->project->linkedProducts = "Linked {$lang->productCommon}s"; $lang->project->unlinkedProducts = "Unlinked {$lang->productCommon}s"; +$lang->project->testreport = 'Testreport'; +$lang->project->selectProgram = 'Select Program'; /* Fields. */ $lang->project->common = 'Project'; @@ -74,6 +76,7 @@ $lang->project->realEnd = 'Actual End'; $lang->project->realBegan = 'Actual Began'; $lang->project->bygrid = 'Kanban'; $lang->project->bylist = 'List'; +$lang->project->bycard = 'Card'; $lang->project->mine = 'My'; $lang->project->myProject = 'Mine'; $lang->project->other = 'Others'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 4fc6289d47..a11abd6f5a 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -50,6 +50,7 @@ $lang->project->deleted = '已删除'; $lang->project->linkedProducts = '已关联'; $lang->project->unlinkedProducts = '未关联'; $lang->project->testreport = '测试报告'; +$lang->project->selectProgram = '筛选项目集'; /* Fields. */ $lang->project->common = '项目'; @@ -75,6 +76,7 @@ $lang->project->realEnd = '实际完成日期'; $lang->project->realBegan = '实际开始日期'; $lang->project->bygrid = '看板'; $lang->project->bylist = '列表'; +$lang->project->bycard = '卡片'; $lang->project->mine = '我参与的'; $lang->project->myProject = '我负责'; $lang->project->other = '其他'; diff --git a/module/project/view/browse.html.php b/module/project/view/browse.html.php index 22a6f3e066..2dd5b6751f 100644 --- a/module/project/view/browse.html.php +++ b/module/project/view/browse.html.php @@ -15,115 +15,20 @@ js::set('orderBy', $orderBy); js::set('programID', $programID); js::set('browseType', $browseType); +js::set('param', $param); +js::set('orderBy', $orderBy); +js::set('recTotal', $recTotal); +js::set('recPerPage', $recPerPage); +js::set('pageID', $pageID); +?> + - - -
    - config->systemMode == 'new'):?> - - -
    - -
    -

    - project->empty;?> - config->maxVersion)):?> - ' . $lang->project->create, '', 'class="btn btn-info" data-toggle="modal" data-target="#guideDialog"');?> - config->systemMode == 'new'):?> - ' . $lang->project->create, '', 'class="btn btn-info"');?> - - ' . $lang->execution->create, '', 'class="btn btn-info"');?> - -

    -
    - -
    -
    - -
    - recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"; - $setting = $this->datatable->getSetting('project'); - ?> - - config->systemMode == 'new' ? common::hasPriv('project', 'batchEdit') : common::hasPriv('project', 'batchEdit');?> - - - id == 'status' and $browseType !== 'all') $value->show = false; - if($value->id == 'teamCount' and $browseType == 'all') $value->show = false; - if($value->show) $this->datatable->printHead($value, $orderBy, $vars, $canBatchEdit); - } - ?> - - - - - from = 'project';?> - - project->printCell($value, $project, $users, $programID);?> - - - -
    - -
    - -
    -
    diff --git a/module/project/view/browsebycard.html.php b/module/project/view/browsebycard.html.php new file mode 100644 index 0000000000..5f13d3636e --- /dev/null +++ b/module/project/view/browsebycard.html.php @@ -0,0 +1,95 @@ + + * @package project + * @version $Id: browsebycard.html.php 4769 2021-07-23 11:29:21Z $ + * @link https://www.zentao.net + */ +?> + +
    + $project):?> +
    +
    +
    + maxVersion) and $project->model === 'waterfall'):?> + + maxVersion)):?> + + + name);?> +
    +
    +
    + +
    + show('right', 'pagerjs');?> +
    +
    + diff --git a/module/project/view/browsebylist.html.php b/module/project/view/browsebylist.html.php new file mode 100644 index 0000000000..ca451913f1 --- /dev/null +++ b/module/project/view/browsebylist.html.php @@ -0,0 +1,126 @@ + + * @package project + * @version $Id: browsebylist.html.php 4769 2021-07-23 11:16:21Z $ + * @link https://www.zentao.net + */ +?> + + +
    + config->systemMode == 'new'):?> + + +
    + +
    +

    + project->empty;?> + config->maxVersion)):?> + ' . $lang->project->create, '', 'class="btn btn-info" data-toggle="modal" data-target="#guideDialog"');?> + config->systemMode == 'new'):?> + ' . $lang->project->create, '', 'class="btn btn-info"');?> + + ' . $lang->execution->create, '', 'class="btn btn-info"');?> + +

    +
    + +
    +
    + +
    + recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"; + $setting = $this->datatable->getSetting('project'); + ?> + + config->systemMode == 'new' ? common::hasPriv('project', 'batchEdit') : common::hasPriv('project', 'batchEdit');?> + + + id == 'status' and $browseType !== 'all') $value->show = false; + if($value->id == 'teamCount' and $browseType == 'all') $value->show = false; + if($value->show) $this->datatable->printHead($value, $orderBy, $vars, $canBatchEdit); + } + ?> + + + + + from = 'project';?> + + project->printCell($value, $project, $users, $programID);?> + + + +
    + +
    + +
    +
    diff --git a/www/js/zui/min.js b/www/js/zui/min.js index b8ad610805..5fde049660 100644 --- a/www/js/zui/min.js +++ b/www/js/zui/min.js @@ -1,5 +1,5 @@ /*! - * ZUI: ZUI for Zentao - v1.9.2 - 2021-07-23 + * ZUI: ZUI for Zentao - v1.9.2 - 2021-07-26 * http://openzui.com * GitHub: https://github.com/easysoft/zui.git * Copyright (c) 2021 cnezsoft.com; Licensed MIT @@ -76,4 +76,4 @@ function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"= */ function(t){function e(e){if("string"==typeof e.data){var i=e.handler,n=e.data.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!/textarea|select/i.test(e.target.nodeName)&&"text"!==e.target.type){var o="keypress"!==e.type&&t.hotkeys.specialKeys[e.which],a=String.fromCharCode(e.which).toLowerCase(),s="",r={};e.altKey&&"alt"!==o&&(s+="alt+"),e.ctrlKey&&"ctrl"!==o&&(s+="ctrl+"),e.metaKey&&!e.ctrlKey&&"meta"!==o&&(s+="meta+"),e.shiftKey&&"shift"!==o&&(s+="shift+"),o?r[s+o]=!0:(r[s+a]=!0,r[s+t.hotkeys.shiftNums[a]]=!0,"shift+"===s&&(r[t.hotkeys.shiftNums[a]]=!0));for(var l=0,h=n.length;l","/":"?","\\":"|"}},t.each(["keydown","keyup","keypress"],function(){t.event.special[this]={add:e}})}(jQuery),function(t){"use strict";function e(e,i){if(e===!1)return e;if(!e)return i;e===!0?e={add:!0,"delete":!0,edit:!0,sort:!0}:"string"==typeof e&&(e=e.split(","));var n;return Array.isArray(e)&&(n={},t.each(e,function(e,i){t.isPlainObject(i)?n[i.action]=i:n[i]=!0}),e=n),t.isPlainObject(e)&&(n={},t.each(e,function(e,i){i?n[e]=t.extend({type:e},s[e],t.isPlainObject(i)?i:null):n[e]=!1}),e=n),i?t.extend(!0,{},i,e):e}function i(e,i,n){return i=i||e.type,t(n||e.template).addClass("tree-action").attr(t.extend({"data-type":i,title:e.title||""},e.attr)).data("action",e)}var n="zui.tree",o=0,a=function(e,i){this.name=n,this.$=t(e),this.getOptions(i),this._init()},s={sort:{template:''},add:{template:''},edit:{template:''},"delete":{template:''}};a.DEFAULTS={animate:null,initialState:"normal",toggleTemplate:''},a.prototype.add=function(e,i,n,o,a){var s,r=t(e),l=this.options;if(r.is("li")?(s=r.children("ul"),s.length||(s=t("