From 73c86d3ae110a7967a8c0247b855aaf836bea3f2 Mon Sep 17 00:00:00 2001 From: chaideqing Date: Wed, 12 Jan 2022 17:22:53 +0800 Subject: [PATCH 1/5] * fix bug incomplete right click in zentao client when zentao is black, bug #18042 --- .../im/ext/model/class/xuanxuan.class.php | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/xuanxuan/module/im/ext/model/class/xuanxuan.class.php b/xuanxuan/module/im/ext/model/class/xuanxuan.class.php index 954adcbcac..94fb1cede5 100644 --- a/xuanxuan/module/im/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/module/im/ext/model/class/xuanxuan.class.php @@ -30,11 +30,31 @@ class xuanxuanIm extends imModel $libID = isset($libIdList[0]) ? $libIdList[0] : 1; $actions = new stdclass(); - if(common::hasPriv('bug', 'create') and !empty($products)) $actions->createBug = array('title' => $this->lang->im->createBug, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('bug', 'create', "product=$productID", 'xhtml')), 'height' => "600px", 'width' => "1200px"); - if(common::hasPriv('story', 'create') and !empty($products)) $actions->createStory = array('title' => $this->lang->im->createStory, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('story', 'create', "product=$productID", 'xhtml')), 'height' => "600px", 'width' => "1200px"); - if(common::hasPriv('task', 'create') and !empty($executions))$actions->createTask = array('title' => $this->lang->im->createTask, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('task', 'create', "execution=$executionID", 'xhtml')), 'height' => "600px", 'width' => "1200px"); - if(common::hasPriv('doc', 'create') and !empty($libIdList)) $actions->createDoc = array('title' => $this->lang->im->createDoc, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('doc', 'create', "objectType=&objectID=0&libID=0", 'xhtml')), 'height' => "600px", 'width' => "1200px"); - if(common::hasPriv('todo', 'create')) $actions->createTodo = array('title' => $this->lang->im->createTodo, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('todo', 'create', '', 'xhtml')), 'height' => "600px", 'width' => "1200px"); + if(common::hasPriv('bug', 'create')) + { + if(empty($products)) + { + $actions->createBug = array('title' => $this->lang->im->createBug, 'url' => $baseURL . helper::createLink('product', 'showerrornone', '', 'xhtml'), 'height' => "600px", 'width' => "800px"); + } + else + { + $actions->createBug = array('title' => $this->lang->im->createBug, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('bug', 'create', "product=$productID", 'xhtml')), 'height' => "600px", 'width' => "800px"); + } + } + if(common::hasPriv('story', 'create')) + { + if(empty($products)) + { + $actions->createStory = array('title' => $this->lang->im->createStory, 'url' => $baseURL . helper::createLink('product', 'showerrornone', '', 'xhtml'), 'height' => "600px", 'width' => "800px"); + } + else + { + $actions->createStory = array('title' => $this->lang->im->createStory, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('story', 'create', "product=$productID", 'xhtml')), 'height' => "600px", 'width' => "800px"); + } + } + if(common::hasPriv('task', 'create')) $actions->createTask = array('title' => $this->lang->im->createTask, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('task', 'create', "execution=$executionID", 'xhtml')), 'height' => "600px", 'width' => "800px"); + if(common::hasPriv('doc', 'create')) $actions->createDoc = array('title' => $this->lang->im->createDoc, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('doc', 'create', "objectType=&objectID=0&libID=0", 'xhtml')), 'height' => "600px", 'width' => "800px"); + if(common::hasPriv('todo', 'create')) $actions->createTodo = array('title' => $this->lang->im->createTodo, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('todo', 'create', '', 'xhtml')), 'height' => "600px", 'width' => "800px"); $urls = array(); foreach($this->config->im->cards as $moduleName => $methods) From 0f062c84ee362a50f54d2333261feeb9a150d7c8 Mon Sep 17 00:00:00 2001 From: chaideqing Date: Thu, 13 Jan 2022 15:04:13 +0800 Subject: [PATCH 2/5] * Fix the right-click bug when ZenTao client has no product --- .../im/ext/model/class/xuanxuan.class.php | 35 ++++--------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/xuanxuan/module/im/ext/model/class/xuanxuan.class.php b/xuanxuan/module/im/ext/model/class/xuanxuan.class.php index 94fb1cede5..b566830a00 100644 --- a/xuanxuan/module/im/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/module/im/ext/model/class/xuanxuan.class.php @@ -25,37 +25,16 @@ class xuanxuanIm extends imModel $products = empty($products) ? array() : array_keys($products); $executions = empty($executions) ? array() : array_keys($executions); $libIdList = array_keys($this->loadModel('doc')->getLibs('all')); - $productID = isset($products[0]) ? $products[0] : 1; - $executionID = isset($executions[0]) ? $executions[0] : 1; + $productID = isset($products[0]) ? $products[0] : -1; + $executionID = isset($executions[0]) ? $executions[0] : -1; $libID = isset($libIdList[0]) ? $libIdList[0] : 1; $actions = new stdclass(); - if(common::hasPriv('bug', 'create')) - { - if(empty($products)) - { - $actions->createBug = array('title' => $this->lang->im->createBug, 'url' => $baseURL . helper::createLink('product', 'showerrornone', '', 'xhtml'), 'height' => "600px", 'width' => "800px"); - } - else - { - $actions->createBug = array('title' => $this->lang->im->createBug, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('bug', 'create', "product=$productID", 'xhtml')), 'height' => "600px", 'width' => "800px"); - } - } - if(common::hasPriv('story', 'create')) - { - if(empty($products)) - { - $actions->createStory = array('title' => $this->lang->im->createStory, 'url' => $baseURL . helper::createLink('product', 'showerrornone', '', 'xhtml'), 'height' => "600px", 'width' => "800px"); - } - else - { - $actions->createStory = array('title' => $this->lang->im->createStory, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('story', 'create', "product=$productID", 'xhtml')), 'height' => "600px", 'width' => "800px"); - } - } - if(common::hasPriv('task', 'create')) $actions->createTask = array('title' => $this->lang->im->createTask, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('task', 'create', "execution=$executionID", 'xhtml')), 'height' => "600px", 'width' => "800px"); - if(common::hasPriv('doc', 'create')) $actions->createDoc = array('title' => $this->lang->im->createDoc, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('doc', 'create', "objectType=&objectID=0&libID=0", 'xhtml')), 'height' => "600px", 'width' => "800px"); - if(common::hasPriv('todo', 'create')) $actions->createTodo = array('title' => $this->lang->im->createTodo, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('todo', 'create', '', 'xhtml')), 'height' => "600px", 'width' => "800px"); - + if(common::hasPriv('bug', 'create')) $actions->createBug = array('title' => $this->lang->im->createBug, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('bug', 'create', "product=$productID", 'xhtml')), 'height' => "600px", 'width' => "800px"); + if(common::hasPriv('story', 'create')) $actions->createStory = array('title' => $this->lang->im->createStory, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('story', 'create', "product=$productID", 'xhtml')), 'height' => "600px", 'width' => "800px"); + if(common::hasPriv('task', 'create')) $actions->createTask = array('title' => $this->lang->im->createTask, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('task', 'create', "execution=$executionID", 'xhtml')), 'height' => "600px", 'width' => "800px"); + if(common::hasPriv('doc', 'create')) $actions->createDoc = array('title' => $this->lang->im->createDoc, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('doc', 'create', "objectType=&objectID=0&libID=0", 'xhtml')), 'height' => "600px", 'width' => "800px"); + if(common::hasPriv('todo', 'create')) $actions->createTodo = array('title' => $this->lang->im->createTodo, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('todo', 'create', '', 'xhtml')), 'height' => "600px", 'width' => "800px"); $urls = array(); foreach($this->config->im->cards as $moduleName => $methods) { From 02bace4f99af3c71cf95ade86d4600477fc81f16 Mon Sep 17 00:00:00 2001 From: chaideqing Date: Mon, 17 Jan 2022 11:26:33 +0800 Subject: [PATCH 3/5] * fix bug #18039,task #47399, keep close button is 32px in bug/story/task assignTo page --- module/bug/css/x.view.css | 1 + module/story/css/x.view.css | 1 + module/task/css/x.view.css | 1 + 3 files changed, 3 insertions(+) diff --git a/module/bug/css/x.view.css b/module/bug/css/x.view.css index b18ef5ed1b..9b840e4311 100644 --- a/module/bug/css/x.view.css +++ b/module/bug/css/x.view.css @@ -11,3 +11,4 @@ html, body, #main, .container { height: 100%;} .linkButton {float: right; padding-right: 10px; cursor: pointer;} .linkButton i {font-size: 17px !important;} .linkButton span {line-height: 34px; display: block;} +.modal-header .close {font-size: 32px !important}; diff --git a/module/story/css/x.view.css b/module/story/css/x.view.css index dccc99b6bf..1012999457 100644 --- a/module/story/css/x.view.css +++ b/module/story/css/x.view.css @@ -15,3 +15,4 @@ html, body, #main, .container { height: 100%;} .linkButton i {font-size: 17px !important;} .linkButton span {line-height: 34px; display: block;} .btn-toolbar {width: calc(100% - 30px);} +.modal-header .close {font-size: 32px !important}; diff --git a/module/task/css/x.view.css b/module/task/css/x.view.css index 5a96385b1f..2c3c499cb8 100644 --- a/module/task/css/x.view.css +++ b/module/task/css/x.view.css @@ -15,3 +15,4 @@ html, body, #main, .container { height: 100%;} .linkButton i {font-size: 17px !important;} .linkButton span {line-height: 34px; display: block;} .btn-toolbar {width: calc(100% - 30px);} +.modal-header .close {font-size: 32px !important}; From 250d944b73c413129d33596b2210bd86e61ce955 Mon Sep 17 00:00:00 2001 From: chaideqing Date: Mon, 17 Jan 2022 14:40:39 +0800 Subject: [PATCH 4/5] * fix bug #18039,task #47399, show html page when in client create bug/story/task/doc/todo --- module/bug/control.php | 2 +- module/bug/css/x.view.css | 1 - module/doc/control.php | 2 +- module/story/control.php | 2 +- module/story/css/x.view.css | 1 - module/task/control.php | 2 +- module/task/css/x.view.css | 1 - module/todo/control.php | 2 +- 8 files changed, 5 insertions(+), 8 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 42b968c58e..204e729d0d 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -428,7 +428,7 @@ class bug extends control setcookie('bugModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false); $location = $this->createLink('bug', 'browse', "productID={$this->post->product}&branch=$branch&browseType=byModule¶m={$this->post->module}&orderBy=id_desc"); } - if($this->app->getViewType() == 'xhtml') $location = $this->createLink('bug', 'view', "bugID=$bugID"); + if($this->app->getViewType() == 'xhtml') $location = $this->createLink('bug', 'view', "bugID=$bugID", 'html'); $response['locate'] = $location; return $this->send($response); } diff --git a/module/bug/css/x.view.css b/module/bug/css/x.view.css index 9b840e4311..b18ef5ed1b 100644 --- a/module/bug/css/x.view.css +++ b/module/bug/css/x.view.css @@ -11,4 +11,3 @@ html, body, #main, .container { height: 100%;} .linkButton {float: right; padding-right: 10px; cursor: pointer;} .linkButton i {font-size: 17px !important;} .linkButton span {line-height: 34px; display: block;} -.modal-header .close {font-size: 32px !important}; diff --git a/module/doc/control.php b/module/doc/control.php index 3d78e6b352..f194a62cbd 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -309,7 +309,7 @@ class doc extends control if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $docID)); $objectID = zget($lib, $lib->type, ''); $params = "type={$lib->type}&objectID=$objectID&libID={$lib->id}&docID=" . $docResult['id']; - $link = isonlybody() ? 'parent' : $this->createLink('doc', 'objectLibs', $params); + $link = isonlybody() ? 'parent' : $this->createLink('doc', 'objectLibs', $params, 'html'); return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link)); } diff --git a/module/story/control.php b/module/story/control.php index e01502b98a..10ed315954 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -181,7 +181,7 @@ class story extends control $param = $execution->type == 'project' ? "projectID=$objectID&productID=$productID" : "executionID=$objectID&orderBy=id_desc&browseType=unclosed"; $response['locate'] = $this->createLink($moduleName, 'story', $param); } - if($this->app->getViewType() == 'xhtml') $response['locate'] = $this->createLink('story', 'view', "storyID=$storyID"); + if($this->app->getViewType() == 'xhtml') $response['locate'] = $this->createLink('story', 'view', "storyID=$storyID", 'html'); return $this->send($response); } diff --git a/module/story/css/x.view.css b/module/story/css/x.view.css index 1012999457..dccc99b6bf 100644 --- a/module/story/css/x.view.css +++ b/module/story/css/x.view.css @@ -15,4 +15,3 @@ html, body, #main, .container { height: 100%;} .linkButton i {font-size: 17px !important;} .linkButton span {line-height: 34px; display: block;} .btn-toolbar {width: calc(100% - 30px);} -.modal-header .close {font-size: 32px !important}; diff --git a/module/task/control.php b/module/task/control.php index 69400b914e..5398ec2a83 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -146,7 +146,7 @@ class task extends control /* Locate the browser. */ if($this->app->getViewType() == 'xhtml') { - $taskLink = $this->createLink('task', 'view', "taskID=$taskID"); + $taskLink = $this->createLink('task', 'view', "taskID=$taskID", 'html'); $response['locate'] = $taskLink; return $this->send($response); } diff --git a/module/task/css/x.view.css b/module/task/css/x.view.css index 2c3c499cb8..5a96385b1f 100644 --- a/module/task/css/x.view.css +++ b/module/task/css/x.view.css @@ -15,4 +15,3 @@ html, body, #main, .container { height: 100%;} .linkButton i {font-size: 17px !important;} .linkButton span {line-height: 34px; display: block;} .btn-toolbar {width: calc(100% - 30px);} -.modal-header .close {font-size: 32px !important}; diff --git a/module/todo/control.php b/module/todo/control.php index d8dcb8f1c3..4cfe437bfd 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -69,7 +69,7 @@ class todo extends control } if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $todoID)); - if($this->viewType == 'xhtml') die(js::locate($this->createLink('todo', 'view', "todoID=$todoID"), 'parent')); + if($this->viewType == 'xhtml') die(js::locate($this->createLink('todo', 'view', "todoID=$todoID", 'html'), 'parent')); if(isonlybody()) die(js::closeModal('parent.parent')); die(js::locate($this->createLink('my', 'todo', "type=all&userID=&status=all&orderBy=id_desc"), 'parent')); } From 49745fa2587665ebae6792925155ff068df22522 Mon Sep 17 00:00:00 2001 From: chaideqing Date: Tue, 18 Jan 2022 10:27:36 +0800 Subject: [PATCH 5/5] * refactor window size and productID executionID -1 to 0, at task #47399 --- .../module/im/ext/model/class/xuanxuan.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xuanxuan/module/im/ext/model/class/xuanxuan.class.php b/xuanxuan/module/im/ext/model/class/xuanxuan.class.php index b566830a00..73d50b9ca1 100644 --- a/xuanxuan/module/im/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/module/im/ext/model/class/xuanxuan.class.php @@ -25,16 +25,16 @@ class xuanxuanIm extends imModel $products = empty($products) ? array() : array_keys($products); $executions = empty($executions) ? array() : array_keys($executions); $libIdList = array_keys($this->loadModel('doc')->getLibs('all')); - $productID = isset($products[0]) ? $products[0] : -1; - $executionID = isset($executions[0]) ? $executions[0] : -1; + $productID = isset($products[0]) ? $products[0] : 0; + $executionID = isset($executions[0]) ? $executions[0] : 0; $libID = isset($libIdList[0]) ? $libIdList[0] : 1; $actions = new stdclass(); - if(common::hasPriv('bug', 'create')) $actions->createBug = array('title' => $this->lang->im->createBug, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('bug', 'create', "product=$productID", 'xhtml')), 'height' => "600px", 'width' => "800px"); - if(common::hasPriv('story', 'create')) $actions->createStory = array('title' => $this->lang->im->createStory, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('story', 'create', "product=$productID", 'xhtml')), 'height' => "600px", 'width' => "800px"); - if(common::hasPriv('task', 'create')) $actions->createTask = array('title' => $this->lang->im->createTask, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('task', 'create', "execution=$executionID", 'xhtml')), 'height' => "600px", 'width' => "800px"); - if(common::hasPriv('doc', 'create')) $actions->createDoc = array('title' => $this->lang->im->createDoc, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('doc', 'create', "objectType=&objectID=0&libID=0", 'xhtml')), 'height' => "600px", 'width' => "800px"); - if(common::hasPriv('todo', 'create')) $actions->createTodo = array('title' => $this->lang->im->createTodo, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('todo', 'create', '', 'xhtml')), 'height' => "600px", 'width' => "800px"); + if(common::hasPriv('bug', 'create')) $actions->createBug = array('title' => $this->lang->im->createBug, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('bug', 'create', "product=$productID", 'xhtml')), 'height' => "600px", 'width' => "1200px"); + if(common::hasPriv('story', 'create')) $actions->createStory = array('title' => $this->lang->im->createStory, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('story', 'create', "product=$productID", 'xhtml')), 'height' => "600px", 'width' => "1200px"); + if(common::hasPriv('task', 'create')) $actions->createTask = array('title' => $this->lang->im->createTask, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('task', 'create', "execution=$executionID", 'xhtml')), 'height' => "600px", 'width' => "1200px"); + if(common::hasPriv('doc', 'create')) $actions->createDoc = array('title' => $this->lang->im->createDoc, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('doc', 'create', "objectType=&objectID=0&libID=0", 'xhtml')), 'height' => "600px", 'width' => "1200px"); + if(common::hasPriv('todo', 'create')) $actions->createTodo = array('title' => $this->lang->im->createTodo, 'url' => $baseURL . str_replace('/x.php', '/index.php', helper::createLink('todo', 'create', '', 'xhtml')), 'height' => "600px", 'width' => "1200px"); $urls = array(); foreach($this->config->im->cards as $moduleName => $methods) {