From 53c6a6bc5c59476363f18b56f6ab7f0370d8e3d6 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Aug 2019 09:50:27 +0800 Subject: [PATCH 1/7] * finish task #6179. --- module/install/lang/zh-cn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/install/lang/zh-cn.php b/module/install/lang/zh-cn.php index 893a92576c..f69b550504 100644 --- a/module/install/lang/zh-cn.php +++ b/module/install/lang/zh-cn.php @@ -82,7 +82,7 @@ $lang->install->iconvFail = '修改PHP配置文件,加载ICONV扩展。'; $lang->install->tmpRoot = '临时文件目录'; $lang->install->dataRoot = '上传文件目录'; $lang->install->session = 'Session存储目录'; -$lang->install->sessionFail = '修改PHP配置文件,设置session.save_path'; +$lang->install->sessionFail = '修改PHP配置文件,设置session.save_path。
如果使用宝塔面板,可以到宝塔Web面板中“软件商店”,打开PHP设置,到“Session配置”项,选择files,点击保存。老版本需要修改php配置文件。'; $lang->install->mkdirWin = '

需要创建目录%s。命令为:
mkdir %s

'; $lang->install->chmodWin = '需要修改目录 "%s" 的权限。'; $lang->install->mkdirLinux = '

需要创建目录%s。
命令为:
mkdir -p %s

'; From beefd94f9d9cbe8f42cf1697d4e6d10a361f896c Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Aug 2019 11:30:45 +0800 Subject: [PATCH 2/7] * fix for compute password strength when login. --- module/user/js/login.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/user/js/login.js b/module/user/js/login.js index c3eb257456..4a59b47655 100644 --- a/module/user/js/login.js +++ b/module/user/js/login.js @@ -26,7 +26,10 @@ $(document).ready(function() { var password = $('input:password').val().trim(); var passwordStrength = computePasswordStrength(password); - $('#submit').after(""); + + if($('#loginPanel #passwordStrength').length == 0) $(this).after(""); + $('#loginPanel #passwordStrength').val(passwordStrength); + var rand = $('input#verifyRand').val(); if(password.length != 32 && typeof(md5) == 'function') $('input:password').val(md5(md5(password) + rand)); }); From 2503a6bb1a3fe40951483df652ae0bc452463826 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Aug 2019 11:32:08 +0800 Subject: [PATCH 3/7] * finish task #6180. --- www/js/my.full.js | 33 +++++++++++++++++++++++++++------ www/theme/default/style.css | 14 ++++++++++++++ 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/www/js/my.full.js b/www/js/my.full.js index 3323ac1790..76914f2109 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -91,17 +91,38 @@ function setFormAction(actionLink, hiddenwin, obj) * @access public * @return void */ -function setImageSize(image, maxWidth) +function setImageSize(image, maxWidth, maxHeight) { + var $image = $(image); + if($image.parent().prop('tagName').toLowerCase() == 'a') return; + /* If not set maxWidth, set it auto. */ if(!maxWidth) { bodyWidth = $('body').width(); maxWidth = bodyWidth - 470; // The side bar's width is 336, and add some margins. } + if(!maxHeight) maxHeight = $(window).height(); - if($(image).width() > maxWidth) $(image).attr('width', maxWidth); - $(image).wrap(''); + setTimeout(function() + { + if($image.width() > maxWidth) $image.attr('width', maxWidth); + $image.wrap(''); + if($image.height() > maxHeight) $image.closest('a').append(""); + }, 50); +} + +/** + * Show more image when image is too height. + * + * @param obj $obj + * @access public + * @return void + */ +function showMoreImage(obj) +{ + $(obj).parents('a').css('max-height', 'none'); + $(obj).remove(); } /** @@ -734,10 +755,10 @@ function convertURL() $('.article-content, .article>.content').each(function() { - var aTags = []; + var aTags = []; var iframeTags = []; - var imgTags = []; - var content = $(this).html(); + var imgTags = []; + var content = $(this).html(); $(this).find('a').each(function(i) { aTags[i] = $(this).prop('outerHTML'); diff --git a/www/theme/default/style.css b/www/theme/default/style.css index f9ddf54bad..dbaa5e43ea 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -33,3 +33,17 @@ .modal-title{font-size: 14px;} .fixed-footer .text {color: #fff;} + +a.showMoreImage { +display: block; +height: 30px; +line-height: 30px; +background: #888; +position: absolute; +bottom: 0px; +width: 100%; +opacity: 0.7; +text-align: center; +color:red; +} +a.showMoreImage:hover{opacity: 1;} From 0d11f9d8811d84fb3f68dea483e8c96767ffcbff Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Aug 2019 13:10:07 +0800 Subject: [PATCH 4/7] * code for task #6180. --- lib/base/front/front.class.php | 1 + www/js/my.full.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/base/front/front.class.php b/lib/base/front/front.class.php index 6fbe58ac12..4281932177 100644 --- a/lib/base/front/front.class.php +++ b/lib/base/front/front.class.php @@ -1075,6 +1075,7 @@ EOT; $jsLang = new stdclass(); $jsLang->submitting = isset($lang->loading) ? $lang->loading : ''; $jsLang->save = $jsConfig->save; + $jsLang->expand = isset($lang->expand) ? $lang->expand : ''; $jsLang->timeout = isset($lang->timeout) ? $lang->timeout : ''; $js = self::start(false); diff --git a/www/js/my.full.js b/www/js/my.full.js index 76914f2109..16cd844307 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -108,7 +108,7 @@ function setImageSize(image, maxWidth, maxHeight) { if($image.width() > maxWidth) $image.attr('width', maxWidth); $image.wrap(''); - if($image.height() > maxHeight) $image.closest('a').append(""); + if($image.height() > maxHeight) $image.closest('a').append("" + lang.expand + " "); }, 50); } From f8647ef6ae4bb06c5fc2e9812f29af7209a302c4 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Aug 2019 13:19:19 +0800 Subject: [PATCH 5/7] * finish task #6181. --- www/theme/default/style.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/www/theme/default/style.css b/www/theme/default/style.css index dbaa5e43ea..8beaab96c0 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -24,6 +24,9 @@ #dropMenu.show-right-col .col-right>.list-group{width:250px;max-width:260px;} #dropMenu .col-footer{width:230px;} +.main-actions .btn-toolbar .divider {margin-right:8px !important; margin-left: 8px !important;} +.main-actions .btn-toolbar .btn + .btn {margin-left: 8px !important;} + /* Pager v-align. */ .pager>li>.pager-label { padding: 2px; line-height: 21px; } From 7bdb12995a12b2f6ea913616e9f985c2360e8304 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Aug 2019 14:15:13 +0800 Subject: [PATCH 6/7] * finish task #6185. --- module/user/control.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/module/user/control.php b/module/user/control.php index 6718ac3213..0ae554abab 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -372,14 +372,17 @@ class user extends control */ public function setReferer($referer = '') { - if(!empty($referer)) - { - $this->referer = helper::safe64Decode($referer); - } - else - { - $this->referer = $this->server->http_referer ? $this->server->http_referer: ''; - } + $this->referer = $this->server->http_referer ? $this->server->http_referer: ''; + if(!empty($referer)) $this->referer = helper::safe64Decode($referer); + + /* Build zentao link regular. */ + $webRoot = $this->config->webRoot; + $linkReg = $webRoot . 'index.php?' . $this->config->moduleVar . '=\w+&' . $this->config->methodVar . '=\w+'; + if($this->config->requestType == 'PATH_INFO') $linkReg = $webRoot . '\w+' . $this->config->requestFix . '\w+'; + $linkReg = str_replace(array('/', '.', '?', '-'), array('\/', '\.', '\?', '\-'), $linkReg); + + /* Check zentao link by regular. */ + $this->referer = preg_match('/^' . $linkReg . '/', $this->referer) ? $this->referer : $webRoot; } /** From 7964ce412ff8574be0c2faf989e68fdbc42f2794 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Aug 2019 15:27:39 +0800 Subject: [PATCH 7/7] * finish task #6190. --- module/project/model.php | 12 +++++++ module/task/model.php | 68 +++++++++------------------------------- 2 files changed, 27 insertions(+), 53 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index afc9f6bd45..36c187ef2d 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2002,6 +2002,13 @@ class projectModel extends model { foreach($taskTeam as $taskID => $team) $tasks[$taskID]->team = $team; } + + $parents = array(); + foreach($tasks as $task) + { + if($task->parent > 0) $parents[$task->parent] = $task->parent; + } + $parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id'); foreach($tasks as $task) { @@ -2012,6 +2019,11 @@ class projectModel extends model $tasks[$task->parent]->children[$task->id] = $task; unset($tasks[$task->id]); } + else + { + $parent = $parents[$task->parent]; + $task->parentName = $parent->name; + } } } return $this->loadModel('task')->processTasks($tasks); diff --git a/module/task/model.php b/module/task/model.php index 2609e58603..1c614379ef 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1655,41 +1655,9 @@ class taskModel extends model $parents = array(); foreach($tasks as $task) { - if($task->parent == -1) $parents[] = $task->id; - } - if(!empty($parents)) - { - /* Select children task. */ - $children = $this->dao->select('DISTINCT t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName') - ->from(TABLE_TASK)->alias('t1') - ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') - ->leftJoin(TABLE_USER)->alias('t3')->on('t1.assignedTo = t3.account') - ->leftJoin(TABLE_MODULE)->alias('t4')->on('t1.module = t4.id') - ->where('t1.parent')->in($parents) - ->andWhere('t1.deleted')->eq(0) - ->beginIF($productID)->andWhere("((t4.root=" . (int)$productID . " and t4.type='story') OR t2.product=" . (int)$productID . ")")->fi() - ->beginIF($type == 'undone')->andWhere("(t1.status = 'wait' or t1.status ='doing')")->fi() - ->beginIF($type == 'needconfirm')->andWhere('t2.version > t1.storyVersion')->andWhere("t2.status = 'active'")->fi() - ->beginIF($type == 'assignedtome')->andWhere('t1.assignedTo')->eq($this->app->user->account)->fi() - ->beginIF($type == 'finishedbyme') - ->andWhere('t1.finishedby', 1)->eq($this->app->user->account) - ->orWhere('t1.finishedList')->like("%,{$this->app->user->account},%") - ->markRight(1) - ->fi() - ->beginIF($type == 'delayed')->andWhere('t1.deadline')->gt('1970-1-1')->andWhere('t1.deadline')->lt(date(DT_DATE1))->andWhere('t1.status')->in('wait,doing')->fi() - ->beginIF(is_array($type) or strpos(',all,undone,needconfirm,assignedtome,delayed,finishedbyme,myinvolved,', ",$type,") === false)->andWhere('t1.status')->in($type)->fi() - ->beginIF($modules)->andWhere('t1.module')->in($modules)->fi() - ->orderBy("t1.$orderBy") - ->fetchAll('id'); - - if(!empty($children)) - { - foreach($children as $child) - { - $tasks[$child->parent]->children[$child->id] = $child; - } - } + if($task->parent > 0) $parents[$task->parent] = $task->parent; } + $parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id'); foreach($tasks as $task) { @@ -1700,6 +1668,11 @@ class taskModel extends model $tasks[$task->parent]->children[$task->id] = $task; unset($tasks[$task->id]); } + else + { + $parent = $parents[$task->parent]; + $task->parentName = $parent->name; + } } } @@ -1842,26 +1815,9 @@ class taskModel extends model $parents = array(); foreach($tasks as $task) { - if($task->parent == -1) $parents[] = $task->id; - } - if(!empty($parents)) - { - /* Select children task. */ - $children = $this->dao->select('id, parent, name, assignedTo, pri, status, estimate, consumed, closedReason, `left`') - ->from(TABLE_TASK) - ->where('story')->eq((int)$storyID) - ->andwhere('parent')->in($parents) - ->beginIF($projectID)->andWhere('project')->eq($projectID)->fi() - ->fetchAll('id'); - - if(!empty($children)) - { - foreach($children as $child) - { - $tasks[$child->parent]->children[$child->id] = $child; - } - } + if($task->parent > 0) $parents[$task->parent] = $task->parent; } + $parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id'); foreach($tasks as $task) { @@ -1872,6 +1828,11 @@ class taskModel extends model $tasks[$task->parent]->children[$task->id] = $task; unset($tasks[$task->id]); } + else + { + $parent = $parents[$task->parent]; + $task->parentName = $parent->name; + } } } @@ -2671,6 +2632,7 @@ class taskModel extends model echo ""; break; case 'name': + if($task->parent > 0 and isset($task->parentName)) $task->name = "{$task->parentName} / {$task->name}"; if(!empty($task->product) && isset($branchGroups[$task->product][$task->branch])) echo "" . $branchGroups[$task->product][$task->branch] . ' '; if(empty($task->children) and $task->module and isset($modulePairs[$task->module])) echo "" . $modulePairs[$task->module] . ' '; if($task->parent > 0) echo '' . $this->lang->task->childrenAB . ' ';