From fdc4d29d3c834d142e51d4b0c283f4e3134f5d0e Mon Sep 17 00:00:00 2001 From: yfl <554665488@qq.com> Date: Fri, 26 Apr 2019 09:40:57 +0800 Subject: [PATCH 01/32] * Finish Task #5405 --- module/release/control.php | 11 ++++++++--- module/testcase/control.php | 6 +++--- module/testcase/view/view.html.php | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/module/release/control.php b/module/release/control.php index ed06532073..31e28b6898 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -136,10 +136,15 @@ class release extends control $release = $this->release->getById((int)$releaseID, true); if(!$release) die(js::error($this->lang->notFound) . js::locate('back')); + + $stories = array(); + if($link == 'false') + { + $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($release->stories)->andWhere('deleted')->eq(0) + ->beginIF($type == 'story')->orderBy($orderBy)->fi() + ->fetchAll('id'); + } - $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($release->stories)->andWhere('deleted')->eq(0) - ->beginIF($type == 'story')->orderBy($orderBy)->fi() - ->fetchAll('id'); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story'); $stages = $this->dao->select('*')->from(TABLE_STORYSTAGE)->where('story')->in($release->stories)->andWhere('branch')->eq($release->branch)->fetchPairs('story', 'stage'); foreach($stages as $storyID => $stage)$stories[$storyID]->stage = $stage; diff --git a/module/testcase/control.php b/module/testcase/control.php index 97fe369735..4ca20b8a80 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -807,16 +807,16 @@ class testcase extends control * @access public * @return void */ - public function delete($caseID, $confirm = 'no') + public function delete($caseID, $runID ,$confirm = 'no') { if($confirm == 'no') { - die(js::confirm($this->lang->testcase->confirmDelete, inlink('delete', "caseID=$caseID&confirm=yes"))); + die(js::confirm($this->lang->testcase->confirmDelete, inlink('delete', "caseID=$caseID&runID=$runID&confirm=yes"))); } else { $this->testcase->delete(TABLE_CASE, $caseID); - + $this->dao->delete()->from(TABLE_TESTRUN)->where('id')->eq($runID)->exec(); /* if ajax request, send result. */ if($this->server->ajax) { diff --git a/module/testcase/view/view.html.php b/module/testcase/view/view.html.php index 9067b0ff5c..d06eb311b2 100644 --- a/module/testcase/view/view.html.php +++ b/module/testcase/view/view.html.php @@ -117,7 +117,7 @@ common::printIcon('testcase', 'edit',"caseID=$case->id", $case); if(!$isLibCase) common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'button', 'copy'); if($isLibCase and common::hasPriv('testsuite', 'createCase')) echo html::a($this->createLink('testsuite', 'createCase', "libID=$case->lib&moduleID=$case->module¶m=$case->id", $case), "", '', "class='btn' title='{$lang->testcase->copy}'"); - common::printIcon('testcase', 'delete', "caseID=$case->id", $case, 'button', 'trash', 'hiddenwin'); + common::printIcon('testcase', 'delete', "caseID=$case->id&runID=$runID", $case, 'button', 'trash', 'hiddenwin'); ?> From e825abcc977401fb8b8a5bf3a01c1f7cd2b2426f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 26 Apr 2019 13:59:45 +0800 Subject: [PATCH 02/32] * finish task #5410. --- module/branch/model.php | 3 ++- module/bug/js/common.js | 13 ++++++++----- module/bug/view/create.html.php | 2 +- module/common/lang/en.php | 4 ++-- module/install/lang/en.php | 4 ++-- module/story/config.php | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/module/branch/model.php b/module/branch/model.php index c4528fb9b8..1b7e612e50 100644 --- a/module/branch/model.php +++ b/module/branch/model.php @@ -46,7 +46,8 @@ class branchModel extends model $product = $this->loadModel('product')->getById($productID); if(!$product or $product->type == 'normal') return array(); - $branches = array('0' => $this->lang->branch->all . $this->lang->product->branchName[$product->type]) + $branches; + $space = $this->app->getClientLang() == 'en' ? ' ' : ''; + $branches = array('0' => $this->lang->branch->all . $space . $this->lang->product->branchName[$product->type]) + $branches; } return $branches; } diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 89d2ec866c..2933bb843f 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -468,17 +468,20 @@ function notice() if($('#openedBuild').find('option').length <= 1) { var html = ''; - if($('#project').val() == '') + if($('#project').length == 0 || $('#project').val() == '') { - branch = $('#branch').val(); + var branch = $('#branch').val(); if(typeof(branch) == 'undefined') branch = 0; - html += '' + createRelease + ' '; + var link = createLink('release', 'create', 'productID=' + $('#product').val() + '&branch=' + branch); + if(typeof(flow) != 'undefined' && flow == 'onlyTest') link = createLink('build', 'create','projectID=' + $('#product').val()); + html += '' + createBuild + ' '; html += '' + refresh + ''; } else { - html += '' + createBuild + ' '; - html += '' + refresh + ''; + projectID = $('#project').val(); + html += '' + createBuild + ' '; + html += '' + refresh + ''; } var $bba = $('#buildBoxActions'); if($bba.length) diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 4039170c43..0f1c77a5f9 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -19,7 +19,7 @@ js::set('page', 'create'); js::set('createRelease', $lang->release->create); js::set('createBuild', $lang->build->create); js::set('refresh', $lang->refresh); -js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate); +js::set('flow', $config->global->flow); ?>
diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 073c6ceb58..d6f4cdeccb 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -21,7 +21,7 @@ $lang->percent = '%'; $lang->dash = '-'; $lang->zentaoPMS = 'ZenTao'; -$lang->welcome = "%s"; +$lang->welcome = "%s ALM"; $lang->logout = 'Logout'; $lang->login = 'Login'; $lang->help = 'Help'; @@ -518,7 +518,7 @@ $lang->proVersion = "install->welcome = 'Thanks for choosing ZenTao!'; $lang->install->license = 'ZenTao is under Z PUBLIC LICENSE(ZPL) 1.2'; $lang->install->desc = <<Z Public License. It integrates with Product Management, Project Management, QA Management, Document Management, Todos Management, Company Management etc. ZenTao is the best choice for software project management. +ZenTao ALM is an Open Source software released under Z Public License. It integrates with Product Management, Project Management, QA Management, Document Management, Todos Management, Company Management etc. ZenTao is the best choice for software project management. -ZenTao is built on PHP + MySQL and based on ZenTaoPHP framework, an independent framework developed by our team. Third party developers/organizations can develop plug-ins or customize for their requirements. +ZenTao ALM is built on PHP + MySQL and based on ZenTaoPHP framework, an independent framework developed by our team. Third party developers/organizations can develop plug-ins or customize for their requirements. EOT; $lang->install->links = <<Nature Easy Soft Co., LTD. diff --git a/module/story/config.php b/module/story/config.php index d77f07bf8a..376aed98be 100644 --- a/module/story/config.php +++ b/module/story/config.php @@ -102,7 +102,7 @@ $config->story->datatable->fieldList['estimate']['required'] = 'no'; $config->story->datatable->fieldList['stage']['title'] = 'stageAB'; $config->story->datatable->fieldList['stage']['fixed'] = 'no'; -$config->story->datatable->fieldList['stage']['width'] = '80'; +$config->story->datatable->fieldList['stage']['width'] = '95'; $config->story->datatable->fieldList['stage']['required'] = 'no'; $config->story->datatable->fieldList['openedBy']['title'] = 'openedByAB'; From dff082a3e717c95f3f2c801d266e600c99c66d84 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 26 Apr 2019 14:17:48 +0800 Subject: [PATCH 03/32] * code for task #5392. --- Makefile | 52 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 78d326d062..f8f940e89c 100644 --- a/Makefile +++ b/Makefile @@ -109,18 +109,6 @@ pms: make package zip -rq -9 ZenTaoPMS.$(VERSION).zip zentaopms rm -fr zentaopms zentaoxx zentaoxx.*.zip -en: - make common - cd zentaopms/; grep -rl 'zentao.net'|xargs sed -i 's/zentao.net/zentao.pm/g'; - cd zentaopms/; grep -rl 'http://www.zentao.pm'|xargs sed -i 's/http:\/\/www.zentao.pm/https:\/\/www.zentao.pm/g'; - cd zentaopms/config/; echo >> config.php; echo '$$config->isINT = true;' >> config.php - make package - zip -r -9 ZenTaoPMS.$(VERSION).int.zip zentaopms - rm -fr zentaopms - echo $(VERSION).int > VERSION - make deb - make rpm - echo $(VERSION) > VERSION deb: mkdir buildroot cp -r build/debian/DEBIAN buildroot @@ -148,6 +136,46 @@ rpm: rpmbuild -ba ~/rpmbuild/SPECS/zentaopms.spec cp ~/rpmbuild/RPMS/noarch/zentaopms-${VERSION}-1.noarch.rpm ./ rm -rf ~/rpmbuild +en: + make common + cd zentaopms/; grep -rl 'zentao.net'|xargs sed -i 's/zentao.net/zentao.pm/g'; + cd zentaopms/; grep -rl 'http://www.zentao.pm'|xargs sed -i 's/http:\/\/www.zentao.pm/https:\/\/www.zentao.pm/g'; + cd zentaopms/config/; echo >> config.php; echo '$$config->isINT = true;' >> config.php + make package + mv zentaopms zentaoalm + zip -r -9 ZenTaoALM.$(VERSION).int.zip zentaoalm + rm -fr zentaoalm + echo $(VERSION).int > VERSION + make endeb + make enrpm + echo $(VERSION) > VERSION +endeb: + mkdir buildroot + cp -r build/debian/DEBIAN buildroot + sed -i '/^Version/cVersion: ${VERSION}' buildroot/DEBIAN/control + mkdir buildroot/opt + mkdir buildroot/etc/apache2/sites-enabled/ -p + cp build/debian/zentaopms.conf buildroot/etc/apache2/sites-enabled/ + cp ZenTaoALM.${VERSION}.zip buildroot/opt + cd buildroot/opt; unzip ZenTaoALM.${VERSION}.zip; mv zentaoalm zentao; rm ZenTaoALM.${VERSION}.zip + sed -i 's/index.php/\/zentao\/index.php/' buildroot/opt/zentao/www/.htaccess + sudo dpkg -b buildroot/ ZenTaoALM_${VERSION}_1_all.deb + rm -rf buildroot +enrpm: + mkdir ~/rpmbuild/SPECS -p + cp build/rpm/zentaopms.spec ~/rpmbuild/SPECS + sed -i '/^Version/cVersion:${VERSION}' ~/rpmbuild/SPECS/zentaopms.spec + mkdir ~/rpmbuild/SOURCES + cp ZenTaoALM.${VERSION}.zip ~/rpmbuild/SOURCES + mkdir ~/rpmbuild/SOURCES/etc/httpd/conf.d/ -p + cp build/debian/zentaopms.conf ~/rpmbuild/SOURCES/etc/httpd/conf.d/zentaoalm.conf + mkdir ~/rpmbuild/SOURCES/opt/ -p + cd ~/rpmbuild/SOURCES; unzip ZenTaoALM.${VERSION}.zip; mv zentaoalm opt/zentao; + sed -i 's/index.php/\/zentao\/index.php/' ~/rpmbuild/SOURCES/opt/zentao/www/.htaccess + cd ~/rpmbuild/SOURCES; tar -czvf zentaoalm-${VERSION}.tar.gz etc opt; rm -rf ZenTaoALM.${VERSION}.zip etc opt; + rpmbuild -ba ~/rpmbuild/SPECS/zentaopms.spec + cp ~/rpmbuild/RPMS/noarch/zentaoalm-${VERSION}-1.noarch.rpm ./ + rm -rf ~/rpmbuild patchphpdoc: sudo cp misc/doc/phpdoc/*.tpl /usr/share/php/data/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/phphtmllib/templates/ phpdoc: From c5920e112a7b92fed9c33d64a53ba2b9ea47b713 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 26 Apr 2019 14:58:30 +0800 Subject: [PATCH 04/32] * finish task #5404. --- xuanxuan/module/admin/ext/view/xuanxuan.html.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xuanxuan/module/admin/ext/view/xuanxuan.html.php b/xuanxuan/module/admin/ext/view/xuanxuan.html.php index 9ec1686f30..01c76703d9 100644 --- a/xuanxuan/module/admin/ext/view/xuanxuan.html.php +++ b/xuanxuan/module/admin/ext/view/xuanxuan.html.php @@ -36,6 +36,11 @@ chat->key;?> xuanxuan, 'key', '');?> + + chat->debug;?> + chat->debugStatus, zget($config->xuanxuan, 'debug', 0)) : zget($lang->chat->debugStatus, zget($config->xuanxuan, 'debug', 0));?> + + chat->xxdServer;?> From bd90f185d85efac5ecdd43a36ed3d239bdef1c1a Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 26 Apr 2019 14:59:07 +0800 Subject: [PATCH 05/32] * fix bug for doc crumb title. --- module/doc/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/doc/model.php b/module/doc/model.php index 0edddcd766..91fb377946 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1588,6 +1588,7 @@ class docModel extends model $parantMoudles = $this->dao->select('id, name')->from(TABLE_MODULE) ->where('id')->in($path) ->andWhere('deleted')->eq(0) + ->orderBy('`grade`') ->fetchAll('id'); foreach($parantMoudles as $parentID => $moduleName) From b47d53fee63114b4f67cd2f7b600ecbdb8ba4266 Mon Sep 17 00:00:00 2001 From: yfl <554665488@qq.com> Date: Fri, 26 Apr 2019 15:00:16 +0800 Subject: [PATCH 06/32] * Finish Task #5379,#5398 --- module/bug/model.php | 8 +++++++- module/release/control.php | 1 + module/story/model.php | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 53075b9a37..689848ab28 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1670,7 +1670,13 @@ class bugModel extends model { $datas = $this->dao->select('openedBuild as name, count(openedBuild) as value')->from(TABLE_BUG)->where($this->reportCondition())->groupBy('openedBuild')->orderBy('value DESC')->fetchAll('name'); if(!$datas) return array(); - $builds = $this->loadModel('build')->getProductBuildPairs($this->session->product, $branch = 0, $params = ''); + $products = $this->session->product; + preg_match('/`product` IN \((?P.+)\)/', $this->reportCondition(), $matchs); + if(!empty($matchs) and isset($matchs['productIds'])) + { + $products = strtr($matchs['productIds'], array('\'' => '')); + } + $builds = $this->loadModel('build')->getProductBuildPairs($products, $branch = 0, $params = ''); /* Deal with the situation that a bug maybe associate more than one openedBuild. */ foreach($datas as $buildIDList => $data) { diff --git a/module/release/control.php b/module/release/control.php index 31e28b6898..cc1435deb0 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -138,6 +138,7 @@ class release extends control if(!$release) die(js::error($this->lang->notFound) . js::locate('back')); $stories = array(); + /*task 5379*/ if($link == 'false') { $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($release->stories)->andWhere('deleted')->eq(0) diff --git a/module/story/model.php b/module/story/model.php index e7094c4395..dbb4865eb3 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -585,7 +585,7 @@ class storyModel extends model foreach($storyIDList as $storyID) { if($data->pris[$storyID] == 'ditto') $data->pris[$storyID] = isset($prev['pri']) ? $prev['pri'] : 0; - if($data->branches[$storyID] == 'ditto') $data->branches[$storyID] = isset($prev['branch']) ? $prev['branch'] : 0; + if(isset($data->branches) and $data->branches[$storyID] == 'ditto') $data->branches[$storyID] = isset($prev['branch']) ? $prev['branch'] : 0; if($data->modules[$storyID] == 'ditto') $data->modules[$storyID] = isset($prev['module']) ? $prev['module'] : 0; if($data->plans[$storyID] == 'ditto') $data->plans[$storyID] = isset($prev['plan']) ? $prev['plan'] : 0; if($data->sources[$storyID] == 'ditto') $data->sources[$storyID] = isset($prev['source']) ? $prev['source'] : ''; @@ -1063,6 +1063,7 @@ class storyModel extends model $this->dao->update(TABLE_STORY)->data($story)->autoCheck()->where('id')->eq((int)$storyID)->exec(); $this->dao->update(TABLE_STORYSTAGE)->set('stage')->eq($stage)->where('story')->eq((int)$storyID)->exec(); + $this->setStage($storyID); if(!dao::isError()) $allChanges[$storyID] = common::createChanges($oldStory, $story); } if($ignoreStories) echo js::alert(sprintf($this->lang->story->ignoreChangeStage, $ignoreStories)); From 43ffe4b49f74e36ce7055ae878b474c5624c0e00 Mon Sep 17 00:00:00 2001 From: yfl <554665488@qq.com> Date: Fri, 26 Apr 2019 15:25:22 +0800 Subject: [PATCH 07/32] * Finish task #5401 --- module/product/view/view.html.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/product/view/view.html.php b/module/product/view/view.html.php index 38cdc8fff0..dfc72bd80c 100644 --- a/module/product/view/view.html.php +++ b/module/product/view/view.html.php @@ -15,6 +15,8 @@
+ +
@@ -50,7 +52,8 @@
-
+ +
product->latestDynamic;?>
From 602a7af067ba64e3dd78c78965373f7735365e29 Mon Sep 17 00:00:00 2001 From: yfl <554665488@qq.com> Date: Fri, 26 Apr 2019 15:52:03 +0800 Subject: [PATCH 08/32] * Finish task #5399 --- module/bug/control.php | 2 +- module/task/control.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 27bc43a2d7..f1365cc19b 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -193,7 +193,7 @@ class bug extends control $chartFunc = 'getDataOf' . $chart; $chartData = $this->bug->$chartFunc(); $chartOption = $this->lang->bug->report->$chart; - if(!empty($chartType)) $chartOption->type = $chartType; + if(!empty($chartType) and $chartType != 'default') $chartOption->type = $chartType; $this->bug->mergeChartOption($chart); $this->view->charts[$chart] = $chartOption; diff --git a/module/task/control.php b/module/task/control.php index 6642aa6be8..c33865056a 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -1212,9 +1212,8 @@ class task extends control $chartFunc = 'getDataOf' . $chart; $chartData = $this->task->$chartFunc(); $chartOption = $this->lang->task->report->$chart; - if(!empty($chartType)) $chartOption->type = $chartType; + if(!empty($chartType) and $chartType != 'default') $chartOption->type = $chartType; $this->task->mergeChartOption($chart); - $this->view->charts[$chart] = $chartOption; $this->view->datas[$chart] = $this->report->computePercent($chartData); } From ab3da55671d8dfeeecfb8472a6e1c7d8bd1c19a1 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 26 Apr 2019 17:43:55 +0800 Subject: [PATCH 09/32] * fix bug. --- module/user/view/ajaxprinttemplates.html.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/module/user/view/ajaxprinttemplates.html.php b/module/user/view/ajaxprinttemplates.html.php index 2fd8854805..dd0480de52 100644 --- a/module/user/view/ajaxprinttemplates.html.php +++ b/module/user/view/ajaxprinttemplates.html.php @@ -52,11 +52,16 @@ foreach($templates as $key => $template)
@@ -97,10 +102,10 @@ $(function() { $('#saveTplModal').on('hide.zui.modal', function(){$(this).find('#title').val('');}); $('#saveTplBtn').click(function(){$('#saveTplModal').modal('show');}); - $('#saveTplModal #submit').click(function() + $('#saveTplModal #templateSubmit').click(function() { var $inputGroup = $('#saveTplModal div.input-group'); - var $publicBox = $inputGroup.find('input[id^="public"]'); + var $publicBox = $inputGroup.find('input#public'); var title = $inputGroup.find('#title').val(); var content = editor[''].html(); var isPublic = ($publicBox.size() > 0 && $publicBox.prop('checked')) ? $publicBox.val() : 0; From 240c2412822d238e3761e424231e87a8b32fb629 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 26 Apr 2019 17:58:15 +0800 Subject: [PATCH 10/32] * move sendDownHeader method to model. --- module/file/control.php | 24 +----------------------- module/file/model.php | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 23 deletions(-) diff --git a/module/file/control.php b/module/file/control.php index ed426ae67d..3cd4b85890 100644 --- a/module/file/control.php +++ b/module/file/control.php @@ -287,29 +287,7 @@ class file extends control */ public function sendDownHeader($fileName, $fileType, $content) { - /* Clean the ob content to make sure no space or utf-8 bom output. */ - $obLevel = ob_get_level(); - for($i = 0; $i < $obLevel; $i++) ob_end_clean(); - - /* Set the downloading cookie, thus the export form page can use it to judge whether to close the window or not. */ - setcookie('downloading', 1); - - /* Append the extension name auto. */ - $extension = '.' . $fileType; - if(strpos($fileName, $extension) === false) $fileName .= $extension; - - /* urlencode the filename for ie. */ - if(strpos($this->server->http_user_agent, 'MSIE') !== false or strpos($this->server->http_user_agent, 'Trident') !== false or strpos($this->server->http_user_agent, 'Edge') !== false) $fileName = urlencode($fileName); - - /* Judge the content type. */ - $mimes = $this->config->file->mimes; - $contentType = isset($mimes[$fileType]) ? $mimes[$fileType] : $mimes['default']; - - header("Content-type: $contentType"); - header("Content-Disposition: attachment; filename=\"$fileName\""); - header("Pragma: no-cache"); - header("Expires: 0"); - die($content); + $this->file->sendDownHeader($fileName, $fileType, $content); } /** diff --git a/module/file/model.php b/module/file/model.php index 3baa7a8089..09efd6110d 100644 --- a/module/file/model.php +++ b/module/file/model.php @@ -821,4 +821,40 @@ class fileModel extends model unset($_SESSION['album'][$uid]); } } + + /** + * Send the download header to the client. + * + * @param string $fileName + * @param string $fileType + * @param string $content + * @access public + * @return void + */ + public function sendDownHeader($fileName, $fileType, $content) + { + /* Clean the ob content to make sure no space or utf-8 bom output. */ + $obLevel = ob_get_level(); + for($i = 0; $i < $obLevel; $i++) ob_end_clean(); + + /* Set the downloading cookie, thus the export form page can use it to judge whether to close the window or not. */ + setcookie('downloading', 1); + + /* Append the extension name auto. */ + $extension = '.' . $fileType; + if(strpos($fileName, $extension) === false) $fileName .= $extension; + + /* urlencode the filename for ie. */ + if(strpos($this->server->http_user_agent, 'MSIE') !== false or strpos($this->server->http_user_agent, 'Trident') !== false or strpos($this->server->http_user_agent, 'Edge') !== false) $fileName = urlencode($fileName); + + /* Judge the content type. */ + $mimes = $this->config->file->mimes; + $contentType = isset($mimes[$fileType]) ? $mimes[$fileType] : $mimes['default']; + + header("Content-type: $contentType"); + header("Content-Disposition: attachment; filename=\"$fileName\""); + header("Pragma: no-cache"); + header("Expires: 0"); + die($content); + } } From a7e7e81b3234a799932e4fe225811ee9c6c8eb4c Mon Sep 17 00:00:00 2001 From: wangyidong Date: Sun, 28 Apr 2019 09:47:05 +0800 Subject: [PATCH 11/32] * adjust for merge xuanxuan. --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f8f940e89c..899dcb2204 100644 --- a/Makefile +++ b/Makefile @@ -79,10 +79,11 @@ zentaoxx: sed -i "s/'site', //g" zentaoxx/module/chat/config.php sed -i "s/'reload'/inlink('browse')/g" zentaoxx/module/client/control.php sed -i 's/tree/dept/' zentaoxx/module/chat/model.php - sed -i 's/im_/zt_im_/' zentaoxx/db/*.sql - sed -i 's/xxb_user/zt_user/' zentaoxx/db/*.sql - sed -i 's/xxb_file/zt_file/' zentaoxx/db/*.sql + sed -i 's/im_/zt_im_/g' zentaoxx/db/*.sql + sed -i 's/xxb_user/zt_user/g' zentaoxx/db/*.sql + sed -i 's/xxb_file/zt_file/g' zentaoxx/db/*.sql sed -i '/xxb_entry/d' zentaoxx/db/*.sql + sed -i 's/xxb_/zt_/g' zentaoxx/db/*.sql mkdir zentaoxx/tools; cp tools/cn2tw.php zentaoxx/tools; cd zentaoxx/tools; php cn2tw.php rm -rf zentaoxx/tools zip -rqm -9 zentaoxx.$(VERSION).zip zentaoxx/* From 526e5298b48c857b24ea468d118f2ecd371c7b6c Mon Sep 17 00:00:00 2001 From: yfl <554665488@qq.com> Date: Sun, 28 Apr 2019 17:44:49 +0800 Subject: [PATCH 12/32] * Finish task #5380 --- module/action/model.php | 8 +++-- module/custom/control.php | 25 +++++++++++++ module/custom/lang/en.php | 4 ++- module/custom/lang/zh-cn.php | 4 ++- module/custom/view/setdynamic.html.php | 40 +++++++++++++++++++++ module/story/js/x.create.js | 2 +- module/task/view/batchcreate.html.php | 4 +-- module/task/view/view.html.php | 3 +- xuanxuan/module/entry/ext/control/visit.php | 12 ++++++- 9 files changed, 92 insertions(+), 10 deletions(-) create mode 100644 module/custom/view/setdynamic.html.php diff --git a/module/action/model.php b/module/action/model.php index 353c5adae1..d084732e27 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -36,7 +36,7 @@ class actionModel extends model $actor = $actor ? $actor : $this->app->user->account; $actionType = strtolower($actionType); if($actor == 'guest' and $actionType == 'logout') return false; - + $action = new stdclass(); $objectType = str_replace('`', '', $objectType); @@ -623,7 +623,11 @@ class actionModel extends model if(!$actions) return array(); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'action'); - return $this->transformActions($actions); + + $actions = $this->transformActions($actions); + $actioned = $this->loadModel('setting')->getItem("owner=system&module=common§ion=global&key=setdynamic"); + foreach($actions as $index => $action) if(strpos($actioned, $action->action) === false) unset($actions[$index]); + return $actions; } /** diff --git a/module/custom/control.php b/module/custom/control.php index 87c4c623b8..473052fa3c 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -323,6 +323,31 @@ class custom extends control $this->display(); } + /** + *Set dynamic recode what action + * + * @access public + * @return void + */ + public function setDynamic() + { + if($_POST) + { + $actions = $this->post->actions; + $actions = implode(',', array_filter($actions)); + $this->loadModel('setting')->setItem('system.common.global.setdynamic', $actions); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload')); + + } + $this->app->loadLang('action'); + $this->view->title = $this->lang->custom->setDynamic; + $this->view->position[] = $this->lang->custom->common; + $this->view->position[] = $this->view->title; + $this->view->actions = $this->lang->action->search->label; + $this->view->actioned = $this->loadModel('setting')->getItem("owner=system&module=common§ion=global&key=setdynamic"); + $this->display(); + } + /** * Timezone. * diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index da3e8158fe..aca8fabd16 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -18,6 +18,8 @@ $lang->custom->required = 'Required'; $lang->custom->score = 'Point'; $lang->custom->timezone = 'Timezone'; $lang->custom->scoreReset = 'Reset Point'; +$lang->custom->setDynamic = 'Set Dynamic'; +ng->custom->setAction = 'Set Action'; $lang->custom->object['story'] = 'Story'; $lang->custom->object['task'] = 'Task'; @@ -77,7 +79,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', 'setDynamic'); $lang->custom->block->fields['closed'] = 'Closed Block'; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index f840afed4e..1e9a6a804a 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -18,6 +18,8 @@ $lang->custom->required = '必填项'; $lang->custom->score = '积分'; $lang->custom->timezone = '时区'; $lang->custom->scoreReset = '重置积分'; +$lang->custom->setDynamic = '动态设置'; +$lang->custom->setAction = '设置动作'; $lang->custom->object['story'] = '需求'; $lang->custom->object['task'] = '任务'; @@ -77,7 +79,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', 'setDynamic'); $lang->custom->block->fields['closed'] = '关闭的区块'; diff --git a/module/custom/view/setdynamic.html.php b/module/custom/view/setdynamic.html.php new file mode 100644 index 0000000000..3a215d9782 --- /dev/null +++ b/module/custom/view/setdynamic.html.php @@ -0,0 +1,40 @@ + + * @package custom + * @version $Id$ + * @link http://www.zentao.net + */ +?> + +
+
+
+
+ custom->setDynamic?> +
+
+ + + + + + + + + +
custom->setAction;?>
+ +
+
+
+ + diff --git a/module/story/js/x.create.js b/module/story/js/x.create.js index 08d2d8b0f5..2c309298ce 100644 --- a/module/story/js/x.create.js +++ b/module/story/js/x.create.js @@ -1,6 +1,6 @@ $(function() { - $('#sourceNote').parent().find('span').remove(); + $('#sourceNote').prev('span').remove(); $('#sourceNote').remove(); $('table tbody tr th').addClass('w-70px'); }); diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index 45d037b8fc..2151d50848 100644 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -14,9 +14,9 @@
-

+

- + lang->colon;?> task->batchCreateChildren;?> task->batchCreate;?> diff --git a/module/task/view/view.html.php b/module/task/view/view.html.php index 004a19bede..e04758d3a9 100644 --- a/module/task/view/view.html.php +++ b/module/task/view/view.html.php @@ -163,11 +163,10 @@ common::printIcon('task', 'cancel', "taskID=$task->id", $task, 'button', '', '', 'iframe showinonlybody', true); if(!isonlybody()) echo "
"; - if(empty($task->team) or empty($task->children)) common::printIcon('task', 'batchCreate', "project=$task->project&storyID=$task->story&moduleID=$task->module&taskID=$task->id", $task, 'button', 'plus', '', '', '', "title='{$lang->task->children}'", ' '); + if(empty($task->team) or empty($task->children)) common::printIcon('task', 'batchCreate', "project=$task->project&storyID=$task->story&moduleID=$task->module&taskID=$task->id", $task, 'button', 'treemap-alt', '', '', '', "title='{$lang->task->children}'", ' '); common::printIcon('task', 'edit', "taskID=$task->id", $task, 'button', '', '', 'showinonlybody'); common::printIcon('task', 'create', "projctID={$task->project}&storyID=0&moduleID=0&taskID=$task->id", $task, 'button', 'copy'); common::printIcon('task', 'delete', "projectID=$task->project&taskID=$task->id", $task, 'button', 'trash', 'hiddenwin'); - if($task->parent <= 0) 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); if($task->parent > 0) echo html::a(helper::createLink('task', 'view', "taskID=$task->parent"), "", '', "class='btn btn-link' title='{$lang->task->parent}'"); ?> diff --git a/xuanxuan/module/entry/ext/control/visit.php b/xuanxuan/module/entry/ext/control/visit.php index b54a73a58b..f2ead7a386 100644 --- a/xuanxuan/module/entry/ext/control/visit.php +++ b/xuanxuan/module/entry/ext/control/visit.php @@ -47,7 +47,17 @@ class entry extends control $this->user->cleanLocked($user->account); - $user->admin = strpos($this->app->company->admins, ",{$user->account},") !== false; + $user->lastTime = $user->last; + $user->last = date(DT_DATETIME1, $user->last); + $user->admin = strpos($this->app->company->admins, ",{$user->account},") !== false; + $user->modifyPassword = ($user->visits == 0 and !empty($this->config->safe->modifyPasswordFirstLogin)); + if($user->modifyPassword) $user->modifyPasswordReason = 'modifyPasswordFirstLogin'; + if(!$user->modifyPassword and !empty($this->config->safe->changeWeak)) + { + $user->modifyPassword = $this->loadModel('admin')->checkWeak($user); + if($user->modifyPassword) $user->modifyPasswordReason = 'weak'; + } + $user->rights = $this->user->authorize($user->account); $user->groups = $this->user->getGroups($user->account); $user->view = $this->user->grantUserView($user->account, $user->rights['acls']); From 052ef61fe64bcf3fdff7e5e16f44d0f17c06a873 Mon Sep 17 00:00:00 2001 From: yfl <554665488@qq.com> Date: Mon, 29 Apr 2019 08:39:53 +0800 Subject: [PATCH 13/32] * Fix task #5380 --- module/custom/view/setdynamic.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/custom/view/setdynamic.html.php b/module/custom/view/setdynamic.html.php index 3a215d9782..7f001825cf 100644 --- a/module/custom/view/setdynamic.html.php +++ b/module/custom/view/setdynamic.html.php @@ -34,7 +34,7 @@ From b61f20d071f15d4ab3b02e80271e9b63caa96e0a Mon Sep 17 00:00:00 2001 From: yfl <554665488@qq.com> Date: Mon, 29 Apr 2019 08:43:54 +0800 Subject: [PATCH 14/32] * Modify batchCreate task link --- module/task/view/view.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/view/view.html.php b/module/task/view/view.html.php index e04758d3a9..dd6638d532 100644 --- a/module/task/view/view.html.php +++ b/module/task/view/view.html.php @@ -163,7 +163,7 @@ common::printIcon('task', 'cancel', "taskID=$task->id", $task, 'button', '', '', 'iframe showinonlybody', true); if(!isonlybody()) echo "
"; - if(empty($task->team) or empty($task->children)) common::printIcon('task', 'batchCreate', "project=$task->project&storyID=$task->story&moduleID=$task->module&taskID=$task->id", $task, 'button', 'treemap-alt', '', '', '', "title='{$lang->task->children}'", ' '); + if(empty($task->team) or empty($task->children)) common::printIcon('task', 'batchCreate', "project=$task->project&storyID=$task->story&moduleID=$task->module&taskID=$task->id", $task, 'button', 'treemap-alt', '', '', '', "title='{$lang->task->children}' target='__blank'", ' '); common::printIcon('task', 'edit', "taskID=$task->id", $task, 'button', '', '', 'showinonlybody'); common::printIcon('task', 'create', "projctID={$task->project}&storyID=0&moduleID=0&taskID=$task->id", $task, 'button', 'copy'); common::printIcon('task', 'delete', "projectID=$task->project&taskID=$task->id", $task, 'button', 'trash', 'hiddenwin'); From 8c78ea161298a65cc48885936be31b44eecce341 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 29 Apr 2019 08:52:08 +0800 Subject: [PATCH 15/32] * adjust for task #5387. --- module/user/view/ajaxprinttemplates.html.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/user/view/ajaxprinttemplates.html.php b/module/user/view/ajaxprinttemplates.html.php index dd0480de52..81281c07e8 100644 --- a/module/user/view/ajaxprinttemplates.html.php +++ b/module/user/view/ajaxprinttemplates.html.php @@ -14,8 +14,9 @@ foreach($templates as $key => $template) -