From 9bd8f21ac6f0d2367b3ffa97853b4f12a3714804 Mon Sep 17 00:00:00 2001 From: liuhong Date: Tue, 3 Jan 2023 02:22:37 +0000 Subject: [PATCH 01/28] * Fix bug #30537. --- lib/phpmailer/language/phpmailer.lang-de.php | 4 ++-- lib/phpmailer/language/phpmailer.lang-fr.php | 4 ++-- lib/phpmailer/language/phpmailer.lang-zh-cn.php | 2 +- lib/phpmailer/language/phpmailer.lang-zh-tw.php | 2 +- module/mail/view/browse.html.php | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/phpmailer/language/phpmailer.lang-de.php b/lib/phpmailer/language/phpmailer.lang-de.php index b2a76ce1b5..bbbc08e7dc 100644 --- a/lib/phpmailer/language/phpmailer.lang-de.php +++ b/lib/phpmailer/language/phpmailer.lang-de.php @@ -16,10 +16,10 @@ $PHPMAILER_LANG['from_failed'] = 'Die folgende Absenderadresse ist nich $PHPMAILER_LANG['instantiate'] = 'Mail Funktion konnte nicht initialisiert werden.'; $PHPMAILER_LANG['invalid_email'] = 'E-Mail wird nicht gesendet, die Adresse ist ungültig.'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.'; -$PHPMAILER_LANG['provide_address'] = 'Bitte geben Sie mindestens eine Empfänger E-Mailadresse an.'; +$PHPMAILER_LANG['provide_address'] = 'The recipient has not set up an email address, please go to the background-personnel-user edit to add an email address.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Fehler: Die folgenden Empfänger sind nicht korrekt: '; $PHPMAILER_LANG['signing'] = 'Fehler beim Signieren: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'Verbindung zu SMTP Server fehlgeschlagen.'; $PHPMAILER_LANG['smtp_error'] = 'Fehler vom SMTP Server: '; $PHPMAILER_LANG['variable_set'] = 'Kann Variable nicht setzen oder zurücksetzen: '; -?> \ No newline at end of file +?> diff --git a/lib/phpmailer/language/phpmailer.lang-fr.php b/lib/phpmailer/language/phpmailer.lang-fr.php index c99ac3caf9..e2497c60c4 100644 --- a/lib/phpmailer/language/phpmailer.lang-fr.php +++ b/lib/phpmailer/language/phpmailer.lang-fr.php @@ -16,10 +16,10 @@ $PHPMAILER_LANG['from_failed'] = 'L\'adresse d\'expéditeur suivante a $PHPMAILER_LANG['instantiate'] = 'Impossible d\'instancier la fonction mail.'; //$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.'; -$PHPMAILER_LANG['provide_address'] = 'Vous devez fournir au moins une adresse de destinataire.'; +$PHPMAILER_LANG['provide_address'] = 'The recipient has not set up an email address, please go to the background-personnel-user edit to add an email address.'; $PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP : Les destinataires suivants sont en erreur : '; //$PHPMAILER_LANG['signing'] = 'Signing Error: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -?> \ No newline at end of file +?> diff --git a/lib/phpmailer/language/phpmailer.lang-zh-cn.php b/lib/phpmailer/language/phpmailer.lang-zh-cn.php index 36db92c7af..fa587e0031 100644 --- a/lib/phpmailer/language/phpmailer.lang-zh-cn.php +++ b/lib/phpmailer/language/phpmailer.lang-zh-cn.php @@ -17,7 +17,7 @@ $PHPMAILER_LANG['from_failed'] = '发送地址错误:'; $PHPMAILER_LANG['instantiate'] = '未知函数调用。'; //$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。'; -$PHPMAILER_LANG['provide_address'] = '收件人没有设置邮箱,请到组织视图中检查下相应用户的email设置。'; +$PHPMAILER_LANG['provide_address'] = '收件人没有设置邮箱,请到后台-人员-用户编辑中添加上邮箱地址。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误,或检查SMTP服务设置,是否允许发送该邮件地址:'; //$PHPMAILER_LANG['signing'] = 'Signing Error: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; diff --git a/lib/phpmailer/language/phpmailer.lang-zh-tw.php b/lib/phpmailer/language/phpmailer.lang-zh-tw.php index 9dbfef7824..bd2e7fd38d 100644 --- a/lib/phpmailer/language/phpmailer.lang-zh-tw.php +++ b/lib/phpmailer/language/phpmailer.lang-zh-tw.php @@ -17,7 +17,7 @@ $PHPMAILER_LANG['from_failed'] = '發送地址錯誤:'; $PHPMAILER_LANG['instantiate'] = '未知函數調用。'; //$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = '發信客戶端不被支持。'; -$PHPMAILER_LANG['provide_address'] = '收件人沒有設置郵箱,請到組織視圖中檢查下相應用戶的email設置。'; +$PHPMAILER_LANG['provide_address'] = '收件人没有设置邮箱,请到后台-人员-用户编辑中添加上邮箱地址。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:收件人地址錯誤,或檢查SMTP服務設置,是否允許發送該郵件地址:'; //$PHPMAILER_LANG['signing'] = 'Signing Error: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; diff --git a/module/mail/view/browse.html.php b/module/mail/view/browse.html.php index c21bc04d06..0f7ce1b109 100644 --- a/module/mail/view/browse.html.php +++ b/module/mail/view/browse.html.php @@ -54,7 +54,7 @@ createdDate?> sendTime?> mail->statusList, $queue->status)?> - failReason?> + failReason?> id"), $lang->delete, 'hiddenwin'); From da18b4b7f0527844f5022417d4977a728fdf0a7f Mon Sep 17 00:00:00 2001 From: liuhong Date: Tue, 3 Jan 2023 02:33:48 +0000 Subject: [PATCH 02/28] * Adjust code for bug #30537. --- lib/phpmailer/language/phpmailer.lang-zh-tw.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/phpmailer/language/phpmailer.lang-zh-tw.php b/lib/phpmailer/language/phpmailer.lang-zh-tw.php index bd2e7fd38d..41af4ab3c6 100644 --- a/lib/phpmailer/language/phpmailer.lang-zh-tw.php +++ b/lib/phpmailer/language/phpmailer.lang-zh-tw.php @@ -17,7 +17,7 @@ $PHPMAILER_LANG['from_failed'] = '發送地址錯誤:'; $PHPMAILER_LANG['instantiate'] = '未知函數調用。'; //$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = '發信客戶端不被支持。'; -$PHPMAILER_LANG['provide_address'] = '收件人没有设置邮箱,请到后台-人员-用户编辑中添加上邮箱地址。'; +$PHPMAILER_LANG['provide_address'] = '收件人沒有設置郵箱,請到後台-人員-用戶編輯中添加上郵箱地址。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:收件人地址錯誤,或檢查SMTP服務設置,是否允許發送該郵件地址:'; //$PHPMAILER_LANG['signing'] = 'Signing Error: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; From 5a2b75d24fbb0acb3726d78656fdbe3a4a1e0693 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 3 Jan 2023 10:59:35 +0800 Subject: [PATCH 03/28] * Finish task#81780. --- module/product/model.php | 8 ++++++++ module/program/model.php | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/module/product/model.php b/module/product/model.php index f5191622e1..81a341464f 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -1300,14 +1300,22 @@ class productModel extends model { $projectList = $this->dao->select('t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') + ->leftJoin(TABLE_TEAM)->alias('t3')->on('t2.id=t3.root') + ->leftJoin(TABLE_STAKEHOLDER)->alias('t4')->on('t2.id=t4.objectID') ->where('t1.product')->eq($productID) ->andWhere('t2.type')->eq('project') + ->beginIF($this->cookie->involved or $involved)->andWhere('t3.type')->eq('project')->fi() ->beginIF($browseType == 'undone')->andWhere('t2.status')->in('wait,doing')->fi() ->beginIF(strpos(",all,undone,", ",$browseType,") === false)->andWhere('t2.status')->eq($browseType)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->projects)->fi() ->beginIF($this->cookie->involved or $involved) ->andWhere('t2.openedBy', true)->eq($this->app->user->account) ->orWhere('t2.PM')->eq($this->app->user->account) + ->orWhere('t3.account')->eq($this->app->user->account) + ->orWhere('(t4.user')->eq($this->app->user->account) + ->andWhere('t4.deleted')->eq(0) + ->markRight(1) + ->orWhere("CONCAT(',', t2.whitelist, ',')")->like("%,{$this->app->user->account},%") ->markRight(1) ->fi() ->beginIF($branch !== '' and $branch !== 'all')->andWhere('t1.branch')->in($branch)->fi() diff --git a/module/program/model.php b/module/program/model.php index bbb4068e16..0fd073c6ca 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -615,7 +615,9 @@ class programModel extends model ->andWhere('t1.openedBy', true)->eq($this->app->user->account) ->orWhere('t1.PM')->eq($this->app->user->account) ->orWhere('t2.account')->eq($this->app->user->account) - ->orWhere('t3.user')->eq($this->app->user->account) + ->orWhere('(t3.user')->eq($this->app->user->account) + ->andWhere('t3.deleted')->eq(0) + ->markRight(1) ->orWhere("CONCAT(',', t1.whitelist, ',')")->like("%,{$this->app->user->account},%") ->markRight(1) ->fi() From b922f85ecd29550c522150cd21e0f79f2a78c162 Mon Sep 17 00:00:00 2001 From: liuhong Date: Tue, 3 Jan 2023 04:50:20 +0000 Subject: [PATCH 04/28] * Finish task #81781. --- module/productplan/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index ab589b4eae..f7baffdeae 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -758,7 +758,7 @@ class productplan extends control $this->productplan->unlinkStory($storyID, $planID); $this->loadModel('action')->create('productplan', $planID, 'unlinkstory', '', $storyID); - return print(js::locate($this->createLink('productplan', 'view', "planID=$planID&type=story"), 'parent')); + return print(js::reload('parent')); } } From 62070301f403eebea2eb5e981cdeb47554c92533 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 3 Jan 2023 17:04:09 +0800 Subject: [PATCH 05/28] * Code for task#81779. --- module/bug/control.php | 1 + module/bug/model.php | 23 +++++++++++++++++++++-- module/bug/view/create.html.php | 11 ++++++++++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index eb6b86c45f..b49a67aedd 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -665,6 +665,7 @@ class bug extends control $this->view->storyID = $storyID; $this->view->buildID = $buildID; $this->view->caseID = $caseID; + $this->view->caseFiles = isset($caseFiles) ? $caseFiles : array(); $this->view->runID = $runID; $this->view->version = $version; $this->view->testtask = $testtask; diff --git a/module/bug/model.php b/module/bug/model.php index 64fb3747d1..748057d086 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -78,7 +78,7 @@ class bugModel extends model ->join('mailto', ',') ->join('os', ',') ->join('browser', ',') - ->remove('files,labels,uid,oldTaskID,contactListMenu,region,lane,ticket') + ->remove('files,labels,uid,oldTaskID,contactListMenu,region,lane,ticket,deleteFiles,caseFiles') ->get(); /* Check repeat bug. */ @@ -98,6 +98,23 @@ class bugModel extends model { $bugID = $this->dao->lastInsertID(); + if(isset($_POST['caseFiles'])) + { + $caseFiles = $_POST['caseFiles']; + if(isset($_POST['deleteFiles'])) + { + foreach($_POST['deleteFiles'] as $deletedCaseFileID) $caseFiles = trim(str_replace(",$deletedCaseFileID,", ',', ",$caseFiles,"), ','); + } + $files = $this->dao->select('*')->from(TABLE_FILE)->where('id')->in($caseFiles)->fetchAll('id'); + foreach($files as $file) + { + unset($file->id); + $file->objectType = 'bug'; + $file->objectID = $bugID; + $this->dao->insert(TABLE_FILE)->data($file)->exec(); + } + } + $this->file->updateObjectID($this->post->uid, $bugID, 'bug'); $this->file->saveUpload('bug', $bugID); empty($bug->case) ? $this->loadModel('score')->create('bug', 'create', $bugID) : $this->loadModel('score')->create('bug', 'createFormCase', $bug->case); @@ -2279,7 +2296,9 @@ class bugModel extends model if(!$executionID and $caseID > 0) $executionID = isset($run->case->execution) ? $run->case->execution : 0; // Fix feedback #1043. if(!$executionID and $this->app->tab == 'execution') $executionID = $this->session->execution; - return array('title' => $title, 'steps' => $bugSteps, 'storyID' => $run->case->story, 'moduleID' => $run->case->module, 'version' => $run->case->version, 'executionID' => $executionID); + $caseFiles = $caseID ? $this->loadModel('file')->getByObject('testcase', $caseID) : array(); + + return array('title' => $title, 'steps' => $bugSteps, 'storyID' => $run->case->story, 'moduleID' => $run->case->module, 'version' => $run->case->version, 'executionID' => $executionID, 'caseFiles' => $caseFiles); } /** diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 825a86fb40..732402cf5e 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -365,7 +365,16 @@ if($this->app->tab == 'project') js::set('objectID', $projectID); printExtendFields('', 'table');?> bug->files;?> - fetch('file', 'buildform', 'fileCount=1&percent=0.85');?> + + fetch('file', 'printFiles', array('files' => $caseFiles, 'fieldset' => 'false', 'object' => null, 'method' => 'edit')); + echo html::hidden('caseFiles', implode(',', array_keys($caseFiles))); + } + ?> + fetch('file', 'buildform', 'fileCount=1&percent=0.85');?> + From 2996d56fa0e4c7e903c42e9391a40df4dc8a9420 Mon Sep 17 00:00:00 2001 From: liuhong Date: Tue, 3 Jan 2023 09:14:04 +0000 Subject: [PATCH 06/28] * Finish task #81778. --- module/testcase/config.php | 2 ++ module/testtask/control.php | 6 ++++++ module/testtask/lang/de.php | 1 + module/testtask/lang/en.php | 1 + module/testtask/lang/fr.php | 1 + module/testtask/lang/zh-cn.php | 1 + module/testtask/model.php | 26 +++++++++++++++----------- module/testtask/view/linkcase.html.php | 2 ++ 8 files changed, 29 insertions(+), 11 deletions(-) diff --git a/module/testcase/config.php b/module/testcase/config.php index 26acbca266..c5cadcf6f0 100644 --- a/module/testcase/config.php +++ b/module/testcase/config.php @@ -37,6 +37,7 @@ $config->testcase->excludeCheckFileds = ',pri,type,stage,needReview,story,branch global $lang; $config->testcase->search['module'] = 'testcase'; $config->testcase->search['fields']['title'] = $lang->testcase->title; +$config->testcase->search['fields']['storyTitle'] = $lang->testcase->linkStory; $config->testcase->search['fields']['id'] = $lang->testcase->id; $config->testcase->search['fields']['keywords'] = $lang->testcase->keywords; $config->testcase->search['fields']['lastEditedBy'] = $lang->testcase->lastEditedByAB; @@ -58,6 +59,7 @@ $config->testcase->search['fields']['openedDate'] = $lang->testcase->openedD $config->testcase->search['fields']['lastEditedDate'] = $lang->testcase->lastEditedDateAB; $config->testcase->search['params']['title'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); +$config->testcase->search['params']['storyTitle'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); $config->testcase->search['params']['module'] = array('operator' => 'belong', 'control' => 'select', 'values' => 'modules'); $config->testcase->search['params']['keywords'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); $config->testcase->search['params']['lastEditedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); diff --git a/module/testtask/control.php b/module/testtask/control.php index d12e5cae63..8eb9073e49 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -1059,6 +1059,11 @@ class testtask extends control * Link cases to a test task. * * @param int $taskID + * @param string $type + * @param int $param + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID * @access public * @return void */ @@ -1108,6 +1113,7 @@ class testtask extends control $this->config->testcase->search['style'] = 'simple'; if($product->shadow) unset($this->config->testcase->search['fields']['product']); + if($type != 'bystory') unset($this->config->testcase->search['fields']['storyTitle']); if($task->productType == 'normal') { unset($this->config->testcase->search['fields']['branch']); diff --git a/module/testtask/lang/de.php b/module/testtask/lang/de.php index 481fabdaa5..fa6ab7c3ad 100644 --- a/module/testtask/lang/de.php +++ b/module/testtask/lang/de.php @@ -131,6 +131,7 @@ $lang->testtask->priList[2] = '2'; $lang->testtask->priList[3] = '3'; $lang->testtask->priList[4] = '4'; +$lang->testcase->linkStory = 'linkStory'; $lang->testtask->unlinkedCases = 'Unverknüpfte Fälle'; $lang->testtask->linkByBuild = 'Mit Build verknüpfen'; $lang->testtask->linkByStory = 'Mit Story verknüpfen'; diff --git a/module/testtask/lang/en.php b/module/testtask/lang/en.php index 28a1f09374..08f54f1403 100644 --- a/module/testtask/lang/en.php +++ b/module/testtask/lang/en.php @@ -131,6 +131,7 @@ $lang->testtask->priList[2] = '2'; $lang->testtask->priList[3] = '3'; $lang->testtask->priList[4] = '4'; +$lang->testcase->linkStory = 'linkStory'; $lang->testtask->unlinkedCases = 'Unlinked Case'; $lang->testtask->linkByBuild = 'Copy from build'; $lang->testtask->linkByStory = 'Link by Story'; diff --git a/module/testtask/lang/fr.php b/module/testtask/lang/fr.php index 40eaf40f0f..36b9f0f3f5 100644 --- a/module/testtask/lang/fr.php +++ b/module/testtask/lang/fr.php @@ -131,6 +131,7 @@ $lang->testtask->priList[2] = '2'; $lang->testtask->priList[3] = '3'; $lang->testtask->priList[4] = '4'; +$lang->testcase->linkStory = 'linkStory'; $lang->testtask->unlinkedCases = 'CasTests Non rattachés'; $lang->testtask->linkByBuild = 'Copier depuis build'; $lang->testtask->linkByStory = 'Lier par Story'; diff --git a/module/testtask/lang/zh-cn.php b/module/testtask/lang/zh-cn.php index 74c93f4342..33759d1927 100644 --- a/module/testtask/lang/zh-cn.php +++ b/module/testtask/lang/zh-cn.php @@ -131,6 +131,7 @@ $lang->testtask->priList[2] = '2'; $lang->testtask->priList[3] = '3'; $lang->testtask->priList[4] = '4'; +$lang->testcase->linkStory = '关联需求'; $lang->testtask->unlinkedCases = '未关联'; $lang->testtask->linkByBuild = '复制测试单'; $lang->testtask->linkByStory = "按{$lang->SRCommon}关联"; diff --git a/module/testtask/model.php b/module/testtask/model.php index 11c07e5f8e..ab98d62ac7 100755 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -346,6 +346,7 @@ class testtaskModel extends model { if($this->session->testcaseQuery == false) $this->session->set('testcaseQuery', ' 1 = 1'); $query = $this->session->testcaseQuery; + if(strpos($query, 'storyTitle') !== false and $type != 'bystory') $query = '1 = 1'; $allProduct = "`product` = 'all'"; if(strpos($query, '`product` =') === false && $type != 'bysuite') $query .= " AND `product` = $productID"; if(strpos($query, $allProduct) !== false) $query = str_replace($allProduct, '1', $query); @@ -399,18 +400,21 @@ class testtaskModel extends model { $stories = $this->dao->select('stories')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('stories'); $cases = array(); + $query = preg_replace('/`(\w+)`/', 't1.`$1`', $query); + if(strpos($query, '`storyTitle`') !== false) $query = str_replace('t1.`storyTitle`', 't2.`title`', $query); if($stories) { - $cases = $this->dao->select('*')->from(TABLE_CASE) + $cases = $this->dao->select('t1.*,t2.title as storyTitle')->from(TABLE_CASE)->alias('t1') + ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') ->where($query) ->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('project')->eq($this->session->project)->fi() - ->andWhere('product')->eq($productID) - ->andWhere('status')->ne('wait') - ->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi() - ->beginIF($task->branch !== '')->andWhere('branch')->in("0,$task->branch")->fi() - ->andWhere('story')->in(trim($stories, ',')) - ->andWhere('deleted')->eq(0) - ->orderBy('id desc') + ->andWhere('t1.product')->eq($productID) + ->andWhere('t1.status')->ne('wait') + ->beginIF($linkedCases)->andWhere('t1.id')->notIN($linkedCases)->fi() + ->beginIF($task->branch !== '')->andWhere('t1.branch')->in("0,$task->branch")->fi() + ->andWhere('t1.story')->in(trim($stories, ',')) + ->andWhere('t1.deleted')->eq(0) + ->orderBy('t1.id desc') ->page($pager) ->fetchAll(); } @@ -1500,7 +1504,7 @@ class testtaskModel extends model $failHtml = ': ' . $this->lang->testtask->fail . ''; $passHtml = ': ' . $this->lang->testtask->pass . ''; - + $log = preg_replace(array("/:\x20失败/", "/:\x20fail/", "/:\x20成功/", "/:\x20pass/"), array($failHtml, $failHtml, $passHtml, $passHtml), $log); $logHtml .= "
  • " . $log . "
  • "; @@ -1524,11 +1528,11 @@ class testtaskModel extends model } $caseResult = $passCount ? 'pass':'fail'; - $logHtml .= "
  • " + $logHtml .= "
  • " . sprintf($this->lang->testtask->stepSummary, $total, $passCount, $failCount) . "
  • "; } - + return $logHtml; } diff --git a/module/testtask/view/linkcase.html.php b/module/testtask/view/linkcase.html.php index e052cb5e1b..c79a193708 100644 --- a/module/testtask/view/linkcase.html.php +++ b/module/testtask/view/linkcase.html.php @@ -86,6 +86,7 @@ testtask->linkVersion;?> priAB;?> testcase->title;?> + testcase->linkStory;?> testcase->type;?> openedByAB;?> testtask->lastRunAccount;?> @@ -112,6 +113,7 @@ echo ')'; ?> + story and $case->storyTitle) echo html::a(helper ::createLink('story', 'view', "storyID=$case->story"), $case->storyTitle);?> testcase->typeList[$case->type];?> openedBy);?> lastRunner);?> From 204b52f0b56bbabb1817dd98db267bf1024eaec6 Mon Sep 17 00:00:00 2001 From: liuhong Date: Tue, 3 Jan 2023 09:17:55 +0000 Subject: [PATCH 07/28] * Adjust code for task. --- module/testtask/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/testtask/model.php b/module/testtask/model.php index ab98d62ac7..8f0961644e 100755 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -407,7 +407,7 @@ class testtaskModel extends model $cases = $this->dao->select('t1.*,t2.title as storyTitle')->from(TABLE_CASE)->alias('t1') ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') ->where($query) - ->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('project')->eq($this->session->project)->fi() + ->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('t1.project')->eq($this->session->project)->fi() ->andWhere('t1.product')->eq($productID) ->andWhere('t1.status')->ne('wait') ->beginIF($linkedCases)->andWhere('t1.id')->notIN($linkedCases)->fi() From bc620ef34d23ebb9c2105caa52240dfa15e1b60e Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 3 Jan 2023 17:36:33 +0800 Subject: [PATCH 08/28] * Code for task#81779. --- module/bug/view/create.html.php | 2 +- module/file/control.php | 4 +++- module/file/view/viewfiles.html.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 732402cf5e..3a3b919865 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -369,7 +369,7 @@ if($this->app->tab == 'project') js::set('objectID', $projectID); fetch('file', 'printFiles', array('files' => $caseFiles, 'fieldset' => 'false', 'object' => null, 'method' => 'edit')); + echo $this->fetch('file', 'printFiles', array('files' => $caseFiles, 'fieldset' => 'false', 'object' => null, 'method' => 'edit', 'showDelete' => true, 'showEdit' => false)); echo html::hidden('caseFiles', implode(',', array_keys($caseFiles))); } ?> diff --git a/module/file/control.php b/module/file/control.php index 7bf6ae7588..7f2a80b4f3 100755 --- a/module/file/control.php +++ b/module/file/control.php @@ -293,16 +293,18 @@ class file extends control * @param object $object * @param string $method * @param bool $showDelete + * @param bool $showEdit * @access public * @return void */ - public function printFiles($files, $fieldset, $object = null, $method = 'view', $showDelete = true) + public function printFiles($files, $fieldset, $object = null, $method = 'view', $showDelete = true, $showEdit = true) { $this->view->files = $files; $this->view->fieldset = $fieldset; $this->view->object = $object; $this->view->method = $method; $this->view->showDelete = $showDelete; + $this->view->showEdit = $showEdit; if(strpos('view,edit', $method) !== false and $this->app->clientDevice != 'mobile') return $this->display('file', 'viewfiles'); $this->display(); diff --git a/module/file/view/viewfiles.html.php b/module/file/view/viewfiles.html.php index 2668b72ede..4ebd743da8 100644 --- a/module/file/view/viewfiles.html.php +++ b/module/file/view/viewfiles.html.php @@ -220,7 +220,7 @@ function setFileName(fileID) common::printLink('file', 'download', "fileID=$file->id", "", '_blank', "class='fileAction btn btn-link text-primary' title='{$lang->file->downloadFile}'"); if(common::hasPriv($objectType, 'edit', $object)) { - if(common::hasPriv('file', 'edit')) echo html::a('###', "", '', "id='renameFile$file->id' class='fileAction btn btn-link edit text-primary' onclick='showRenameBox($file->id)' title='{$lang->file->edit}'"); + if($showEdit and common::hasPriv('file', 'edit')) echo html::a('###', "", '', "id='renameFile$file->id' class='fileAction btn btn-link edit text-primary' onclick='showRenameBox($file->id)' title='{$lang->file->edit}'"); if($showDelete and common::hasPriv('file', 'delete')) echo html::a('###', "", '', "class='fileAction btn btn-link text-primary' onclick='deleteFile($file->id, this)' title='$lang->delete'"); } echo ''; From 43db2ac8533d2c212f379a0a9d577a768f523490 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 4 Jan 2023 08:28:55 +0800 Subject: [PATCH 09/28] * Adjust code style. --- module/bug/view/create.html.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 3a3b919865..f90c76b33f 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -366,14 +366,14 @@ if($this->app->tab == 'project') js::set('objectID', $projectID); bug->files;?> - fetch('file', 'printFiles', array('files' => $caseFiles, 'fieldset' => 'false', 'object' => null, 'method' => 'edit', 'showDelete' => true, 'showEdit' => false)); - echo html::hidden('caseFiles', implode(',', array_keys($caseFiles))); - } - ?> - fetch('file', 'buildform', 'fileCount=1&percent=0.85');?> + fetch('file', 'printFiles', array('files' => $caseFiles, 'fieldset' => 'false', 'object' => null, 'method' => 'edit', 'showDelete' => true, 'showEdit' => false)); + echo html::hidden('caseFiles', implode(',', array_keys($caseFiles))); + } + echo $this->fetch('file', 'buildform', 'fileCount=1&percent=0.85'); + ?> From e91bc365a45898dba3e51edc13b8226738ffdb13 Mon Sep 17 00:00:00 2001 From: liuhong Date: Wed, 4 Jan 2023 01:06:36 +0000 Subject: [PATCH 10/28] * Adjust code for task #81778. --- module/testcase/config.php | 4 ++-- module/testcase/lang/de.php | 1 + module/testcase/lang/en.php | 1 + module/testcase/lang/fr.php | 1 + module/testcase/lang/zh-cn.php | 1 + module/testtask/control.php | 11 ++++++++++- module/testtask/lang/de.php | 1 - module/testtask/lang/en.php | 1 - module/testtask/lang/fr.php | 1 - module/testtask/lang/zh-cn.php | 1 - 10 files changed, 16 insertions(+), 7 deletions(-) diff --git a/module/testcase/config.php b/module/testcase/config.php index c5cadcf6f0..283c36ac00 100644 --- a/module/testcase/config.php +++ b/module/testcase/config.php @@ -37,7 +37,7 @@ $config->testcase->excludeCheckFileds = ',pri,type,stage,needReview,story,branch global $lang; $config->testcase->search['module'] = 'testcase'; $config->testcase->search['fields']['title'] = $lang->testcase->title; -$config->testcase->search['fields']['storyTitle'] = $lang->testcase->linkStory; +$config->testcase->search['fields']['story'] = $lang->testcase->linkStory; $config->testcase->search['fields']['id'] = $lang->testcase->id; $config->testcase->search['fields']['keywords'] = $lang->testcase->keywords; $config->testcase->search['fields']['lastEditedBy'] = $lang->testcase->lastEditedByAB; @@ -59,7 +59,7 @@ $config->testcase->search['fields']['openedDate'] = $lang->testcase->openedD $config->testcase->search['fields']['lastEditedDate'] = $lang->testcase->lastEditedDateAB; $config->testcase->search['params']['title'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); -$config->testcase->search['params']['storyTitle'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); +$config->testcase->search['params']['story'] = array('operator' => 'include', 'control' => 'select', 'values' => ''); $config->testcase->search['params']['module'] = array('operator' => 'belong', 'control' => 'select', 'values' => 'modules'); $config->testcase->search['params']['keywords'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); $config->testcase->search['params']['lastEditedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); diff --git a/module/testcase/lang/de.php b/module/testcase/lang/de.php index 1c865a72e3..ad64811882 100644 --- a/module/testcase/lang/de.php +++ b/module/testcase/lang/de.php @@ -13,6 +13,7 @@ $lang->testcase->id = 'ID'; $lang->testcase->product = $lang->productCommon; $lang->testcase->project = 'Project'; $lang->testcase->execution = 'Execution'; +$lang->testcase->linkStory = 'linkStory'; $lang->testcase->module = 'Module'; $lang->testcase->auto = 'Test Automation Cases'; $lang->testcase->frame = 'Test Automation Cramework'; diff --git a/module/testcase/lang/en.php b/module/testcase/lang/en.php index b50993b46c..72e5991595 100644 --- a/module/testcase/lang/en.php +++ b/module/testcase/lang/en.php @@ -13,6 +13,7 @@ $lang->testcase->id = 'ID'; $lang->testcase->product = $lang->productCommon; $lang->testcase->project = 'Project'; $lang->testcase->execution = 'Execution'; +$lang->testcase->linkStory = 'linkStory'; $lang->testcase->module = 'Module'; $lang->testcase->auto = 'Test Automation Cases'; $lang->testcase->frame = 'Test Automation Cramework'; diff --git a/module/testcase/lang/fr.php b/module/testcase/lang/fr.php index da07973081..670943aee9 100644 --- a/module/testcase/lang/fr.php +++ b/module/testcase/lang/fr.php @@ -13,6 +13,7 @@ $lang->testcase->id = 'ID'; $lang->testcase->product = $lang->productCommon; $lang->testcase->project = 'Project'; $lang->testcase->execution = 'Execution'; +$lang->testcase->linkStory = 'linkStory'; $lang->testcase->module = 'Module'; $lang->testcase->auto = 'Test Automation Cases'; $lang->testcase->frame = 'Test Automation Cramework'; diff --git a/module/testcase/lang/zh-cn.php b/module/testcase/lang/zh-cn.php index 835cedb468..956d9281f3 100644 --- a/module/testcase/lang/zh-cn.php +++ b/module/testcase/lang/zh-cn.php @@ -13,6 +13,7 @@ $lang->testcase->id = '用例编号'; $lang->testcase->product = "所属{$lang->productCommon}"; $lang->testcase->project = '所属项目'; $lang->testcase->execution = '所属执行'; +$lang->testcase->linkStory = '关联需求'; $lang->testcase->module = '所属模块'; $lang->testcase->auto = '自动化测试用例'; $lang->testcase->frame = '自动化测试框架'; diff --git a/module/testtask/control.php b/module/testtask/control.php index 8eb9073e49..7995699047 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -1112,8 +1112,17 @@ class testtask extends control $this->config->testcase->search['actionURL'] = inlink('linkcase', "taskID=$taskID&type=$type¶m=$param"); $this->config->testcase->search['style'] = 'simple'; + $build = $this->loadModel('build')->getByID($task->build); + $stories = array(); + if($build) + { + $stories = $this->dao->select('id,title')->from(TABLE_STORY)->where('id')->in($build->stories)->fetchPairs(); + $this->config->testcase->search['params']['story']['values'] = $stories; + $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story'); + } + if($product->shadow) unset($this->config->testcase->search['fields']['product']); - if($type != 'bystory') unset($this->config->testcase->search['fields']['storyTitle']); + if($type != 'bystory') unset($this->config->testcase->search['fields']['story']); if($task->productType == 'normal') { unset($this->config->testcase->search['fields']['branch']); diff --git a/module/testtask/lang/de.php b/module/testtask/lang/de.php index fa6ab7c3ad..481fabdaa5 100644 --- a/module/testtask/lang/de.php +++ b/module/testtask/lang/de.php @@ -131,7 +131,6 @@ $lang->testtask->priList[2] = '2'; $lang->testtask->priList[3] = '3'; $lang->testtask->priList[4] = '4'; -$lang->testcase->linkStory = 'linkStory'; $lang->testtask->unlinkedCases = 'Unverknüpfte Fälle'; $lang->testtask->linkByBuild = 'Mit Build verknüpfen'; $lang->testtask->linkByStory = 'Mit Story verknüpfen'; diff --git a/module/testtask/lang/en.php b/module/testtask/lang/en.php index 08f54f1403..28a1f09374 100644 --- a/module/testtask/lang/en.php +++ b/module/testtask/lang/en.php @@ -131,7 +131,6 @@ $lang->testtask->priList[2] = '2'; $lang->testtask->priList[3] = '3'; $lang->testtask->priList[4] = '4'; -$lang->testcase->linkStory = 'linkStory'; $lang->testtask->unlinkedCases = 'Unlinked Case'; $lang->testtask->linkByBuild = 'Copy from build'; $lang->testtask->linkByStory = 'Link by Story'; diff --git a/module/testtask/lang/fr.php b/module/testtask/lang/fr.php index 36b9f0f3f5..40eaf40f0f 100644 --- a/module/testtask/lang/fr.php +++ b/module/testtask/lang/fr.php @@ -131,7 +131,6 @@ $lang->testtask->priList[2] = '2'; $lang->testtask->priList[3] = '3'; $lang->testtask->priList[4] = '4'; -$lang->testcase->linkStory = 'linkStory'; $lang->testtask->unlinkedCases = 'CasTests Non rattachés'; $lang->testtask->linkByBuild = 'Copier depuis build'; $lang->testtask->linkByStory = 'Lier par Story'; diff --git a/module/testtask/lang/zh-cn.php b/module/testtask/lang/zh-cn.php index 33759d1927..74c93f4342 100644 --- a/module/testtask/lang/zh-cn.php +++ b/module/testtask/lang/zh-cn.php @@ -131,7 +131,6 @@ $lang->testtask->priList[2] = '2'; $lang->testtask->priList[3] = '3'; $lang->testtask->priList[4] = '4'; -$lang->testcase->linkStory = '关联需求'; $lang->testtask->unlinkedCases = '未关联'; $lang->testtask->linkByBuild = '复制测试单'; $lang->testtask->linkByStory = "按{$lang->SRCommon}关联"; From bf0ee11b8027913fb89665eac77b82247de09946 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 4 Jan 2023 09:11:27 +0800 Subject: [PATCH 11/28] * Code for task#81779. --- module/bug/control.php | 2 +- module/bug/model.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index b49a67aedd..fd319ddb3d 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -665,7 +665,7 @@ class bug extends control $this->view->storyID = $storyID; $this->view->buildID = $buildID; $this->view->caseID = $caseID; - $this->view->caseFiles = isset($caseFiles) ? $caseFiles : array(); + $this->view->caseFiles = $caseID ? $this->loadModel('file')->getByObject('testcase', $caseID) : array(); $this->view->runID = $runID; $this->view->version = $version; $this->view->testtask = $testtask; diff --git a/module/bug/model.php b/module/bug/model.php index 748057d086..d94e517439 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2296,9 +2296,7 @@ class bugModel extends model if(!$executionID and $caseID > 0) $executionID = isset($run->case->execution) ? $run->case->execution : 0; // Fix feedback #1043. if(!$executionID and $this->app->tab == 'execution') $executionID = $this->session->execution; - $caseFiles = $caseID ? $this->loadModel('file')->getByObject('testcase', $caseID) : array(); - - return array('title' => $title, 'steps' => $bugSteps, 'storyID' => $run->case->story, 'moduleID' => $run->case->module, 'version' => $run->case->version, 'executionID' => $executionID, 'caseFiles' => $caseFiles); + return array('title' => $title, 'steps' => $bugSteps, 'storyID' => $run->case->story, 'moduleID' => $run->case->module, 'version' => $run->case->version, 'executionID' => $executionID); } /** From 86c398672d4ba99ef4df1c6d10518b6853a72a92 Mon Sep 17 00:00:00 2001 From: liuhong Date: Wed, 4 Jan 2023 01:23:31 +0000 Subject: [PATCH 12/28] * Adjust code --- module/testtask/model.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/testtask/model.php b/module/testtask/model.php index 8f0961644e..c88a7bdf4f 100755 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -346,7 +346,7 @@ class testtaskModel extends model { if($this->session->testcaseQuery == false) $this->session->set('testcaseQuery', ' 1 = 1'); $query = $this->session->testcaseQuery; - if(strpos($query, 'storyTitle') !== false and $type != 'bystory') $query = '1 = 1'; + $allProduct = "`product` = 'all'"; if(strpos($query, '`product` =') === false && $type != 'bysuite') $query .= " AND `product` = $productID"; if(strpos($query, $allProduct) !== false) $query = str_replace($allProduct, '1', $query); @@ -401,7 +401,6 @@ class testtaskModel extends model $stories = $this->dao->select('stories')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('stories'); $cases = array(); $query = preg_replace('/`(\w+)`/', 't1.`$1`', $query); - if(strpos($query, '`storyTitle`') !== false) $query = str_replace('t1.`storyTitle`', 't2.`title`', $query); if($stories) { $cases = $this->dao->select('t1.*,t2.title as storyTitle')->from(TABLE_CASE)->alias('t1') From 13d6441857d71d31cca96df790262ca2840bd4e1 Mon Sep 17 00:00:00 2001 From: liuhong Date: Wed, 4 Jan 2023 01:25:07 +0000 Subject: [PATCH 13/28] * Adjust code --- module/testtask/model.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/testtask/model.php b/module/testtask/model.php index c88a7bdf4f..9042218934 100755 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -346,7 +346,6 @@ class testtaskModel extends model { if($this->session->testcaseQuery == false) $this->session->set('testcaseQuery', ' 1 = 1'); $query = $this->session->testcaseQuery; - $allProduct = "`product` = 'all'"; if(strpos($query, '`product` =') === false && $type != 'bysuite') $query .= " AND `product` = $productID"; if(strpos($query, $allProduct) !== false) $query = str_replace($allProduct, '1', $query); From e8edfb8df85535471a9567028538feb174690a53 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 4 Jan 2023 09:33:13 +0800 Subject: [PATCH 14/28] * Code for task#81779. --- module/bug/control.php | 2 +- module/bug/model.php | 10 +++++----- module/bug/view/create.html.php | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index fd319ddb3d..7ab5ace364 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -665,7 +665,7 @@ class bug extends control $this->view->storyID = $storyID; $this->view->buildID = $buildID; $this->view->caseID = $caseID; - $this->view->caseFiles = $caseID ? $this->loadModel('file')->getByObject('testcase', $caseID) : array(); + $this->view->resultFiles = $resultID ? $this->loadModel('file')->getByObject('stepResult', $resultID) : array(); $this->view->runID = $runID; $this->view->version = $version; $this->view->testtask = $testtask; diff --git a/module/bug/model.php b/module/bug/model.php index d94e517439..96b0019c62 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -78,7 +78,7 @@ class bugModel extends model ->join('mailto', ',') ->join('os', ',') ->join('browser', ',') - ->remove('files,labels,uid,oldTaskID,contactListMenu,region,lane,ticket,deleteFiles,caseFiles') + ->remove('files,labels,uid,oldTaskID,contactListMenu,region,lane,ticket,deleteFiles,resultFiles') ->get(); /* Check repeat bug. */ @@ -98,14 +98,14 @@ class bugModel extends model { $bugID = $this->dao->lastInsertID(); - if(isset($_POST['caseFiles'])) + if(isset($_POST['resultFiles'])) { - $caseFiles = $_POST['caseFiles']; + $resultFiles = $_POST['resultFiles']; if(isset($_POST['deleteFiles'])) { - foreach($_POST['deleteFiles'] as $deletedCaseFileID) $caseFiles = trim(str_replace(",$deletedCaseFileID,", ',', ",$caseFiles,"), ','); + foreach($_POST['deleteFiles'] as $deletedCaseFileID) $resultFiles = trim(str_replace(",$deletedCaseFileID,", ',', ",$resultFiles,"), ','); } - $files = $this->dao->select('*')->from(TABLE_FILE)->where('id')->in($caseFiles)->fetchAll('id'); + $files = $this->dao->select('*')->from(TABLE_FILE)->where('id')->in($resultFiles)->fetchAll('id'); foreach($files as $file) { unset($file->id); diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index f90c76b33f..82b35e3190 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -369,8 +369,8 @@ if($this->app->tab == 'project') js::set('objectID', $projectID); fetch('file', 'printFiles', array('files' => $caseFiles, 'fieldset' => 'false', 'object' => null, 'method' => 'edit', 'showDelete' => true, 'showEdit' => false)); - echo html::hidden('caseFiles', implode(',', array_keys($caseFiles))); + echo $this->fetch('file', 'printFiles', array('files' => $resultFiles, 'fieldset' => 'false', 'object' => null, 'method' => 'edit', 'showDelete' => true, 'showEdit' => false)); + echo html::hidden('resultFiles', implode(',', array_keys($resultFiles))); } echo $this->fetch('file', 'buildform', 'fileCount=1&percent=0.85'); ?> From 892b7d6b8a8e996c604d29795de33525c2bf8503 Mon Sep 17 00:00:00 2001 From: liuhong Date: Wed, 4 Jan 2023 03:31:00 +0000 Subject: [PATCH 15/28] * Fix bug #82220. --- module/execution/control.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/module/execution/control.php b/module/execution/control.php index bb833b35e9..ef5404be22 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1678,8 +1678,14 @@ class execution extends control } $importPlanStoryTips = $multiBranchProduct ? $this->lang->execution->importBranchPlanStory : $this->lang->execution->importPlanStory; + if(!$execution->hasProduct) + { + return print(js::locate(inlink('create', "projectID=$projectID&executionID=$executionID"))); + }else + { + return print(js::confirm($importPlanStoryTips, inlink('create', "projectID=$projectID&executionID=$executionID©ExecutionID=&planID=$planID&confirm=yes"), inlink('create', "projectID=$projectID&executionID=$executionID"))); - return print(js::confirm($importPlanStoryTips, inlink('create', "projectID=$projectID&executionID=$executionID©ExecutionID=&planID=$planID&confirm=yes"), inlink('create', "projectID=$projectID&executionID=$executionID"))); + } } } From 06700413b1a7ff2d40ea8098c06d06a7f7ab6199 Mon Sep 17 00:00:00 2001 From: liuhong Date: Wed, 4 Jan 2023 05:54:47 +0000 Subject: [PATCH 16/28] * Adjust code. --- module/execution/control.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/execution/control.php b/module/execution/control.php index ef5404be22..064bc06fe2 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1681,7 +1681,8 @@ class execution extends control if(!$execution->hasProduct) { return print(js::locate(inlink('create', "projectID=$projectID&executionID=$executionID"))); - }else + } + else { return print(js::confirm($importPlanStoryTips, inlink('create', "projectID=$projectID&executionID=$executionID©ExecutionID=&planID=$planID&confirm=yes"), inlink('create', "projectID=$projectID&executionID=$executionID"))); From c2fd82381d87660e696133dd89d8914b1464b42b Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 4 Jan 2023 16:28:28 +0800 Subject: [PATCH 17/28] * Fix bug of preview file. --- config/zentaopms.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/zentaopms.php b/config/zentaopms.php index 2d3fe90dfa..36d0182f2b 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -404,8 +404,9 @@ $config->objectTables['stage'] = TABLE_STAGE; $config->objectTables['apistruct'] = TABLE_APISTRUCT; $config->objectTables['repo'] = TABLE_REPO; $config->objectTables['dataview'] = TABLE_DATAVIEW; -$config->objectTables['zahost'] = TABLE_ZAHOST; -$config->objectTables['automation'] = TABLE_AUTOMATION; +$config->objectTables['zahost'] = TABLE_ZAHOST; +$config->objectTables['automation'] = TABLE_AUTOMATION; +$config->objectTables['stepResult'] = TABLE_TESTRUN; $config->newFeatures = array('introduction', 'tutorial', 'youngBlueTheme', 'visions'); $config->disabledFeatures = ''; From ee5aacbd35313fff184ad7672bee6ed58e2261ee Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 5 Jan 2023 10:05:45 +0800 Subject: [PATCH 18/28] * Fix bug#31467. --- module/bug/control.php | 2 +- module/file/model.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 7ab5ace364..e17eaabb5b 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -665,7 +665,7 @@ class bug extends control $this->view->storyID = $storyID; $this->view->buildID = $buildID; $this->view->caseID = $caseID; - $this->view->resultFiles = $resultID ? $this->loadModel('file')->getByObject('stepResult', $resultID) : array(); + $this->view->resultFiles = ($resultID and $stepIdList)? $this->loadModel('file')->getByObject('stepResult', $resultID, str_replace('_', ',', $stepIdList)) : array(); $this->view->runID = $runID; $this->view->version = $version; $this->view->testtask = $testtask; diff --git a/module/file/model.php b/module/file/model.php index 7bca92a246..c0adf7d535 100755 --- a/module/file/model.php +++ b/module/file/model.php @@ -46,7 +46,7 @@ class fileModel extends model ->where('objectType')->eq($objectType) ->andWhere('objectID')->in($objectID) ->andWhere('extra')->ne('editor') - ->beginIF($extra)->andWhere('extra')->eq($extra) + ->beginIF($extra)->andWhere('extra')->in($extra)->fi() ->andWhere('deleted')->eq('0') ->orderBy('id') ->fetchAll('id'); From 97d4792fbf704dec0e40eabc778754fcb5b37106 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 5 Jan 2023 10:13:34 +0800 Subject: [PATCH 19/28] * Fix bug of create bug. --- module/bug/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/bug/control.php b/module/bug/control.php index e17eaabb5b..1503324708 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -665,7 +665,7 @@ class bug extends control $this->view->storyID = $storyID; $this->view->buildID = $buildID; $this->view->caseID = $caseID; - $this->view->resultFiles = ($resultID and $stepIdList)? $this->loadModel('file')->getByObject('stepResult', $resultID, str_replace('_', ',', $stepIdList)) : array(); + $this->view->resultFiles = (!empty($resultID) and !empty($stepIdList)) ? $this->loadModel('file')->getByObject('stepResult', $resultID, str_replace('_', ',', $stepIdList)) : array(); $this->view->runID = $runID; $this->view->version = $version; $this->view->testtask = $testtask; From 5e26183cbbd545b173926447530e7868662c0c24 Mon Sep 17 00:00:00 2001 From: liuhong Date: Thu, 5 Jan 2023 07:43:34 +0000 Subject: [PATCH 20/28] * Fix bug for 30923 with get ProductID. --- module/bug/config.php | 2 +- module/bug/model.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/bug/config.php b/module/bug/config.php index 9bf3ff5a95..e4a2983a76 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -205,7 +205,7 @@ $config->bug->datatable->fieldList['branch']['fixed'] = 'left'; $config->bug->datatable->fieldList['branch']['width'] = '100'; $config->bug->datatable->fieldList['branch']['required'] = 'no'; $config->bug->datatable->fieldList['branch']['control'] = 'select'; -$config->bug->datatable->fieldList['branch']['dataSource'] = array('module' => 'bug', 'method' => 'getRelatedObjects', 'params' => 'branch&id,name'); +$config->bug->datatable->fieldList['branch']['dataSource'] = array('module' => 'bug', 'method' => 'getRelatedObjects', 'params' => 'branch&id,name&$productID'); $config->bug->datatable->fieldList['type']['title'] = 'type'; $config->bug->datatable->fieldList['type']['fixed'] = 'no'; diff --git a/module/bug/model.php b/module/bug/model.php index 96b0019c62..cc4e95a5bc 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -3711,10 +3711,11 @@ class bugModel extends model * * @param int $object * @param string $pairs + * @param int $productID * @access public * @return void */ - public function getRelatedObjects($object, $pairs = '') + public function getRelatedObjects($object, $pairs = '', $productID = 0) { /* Get bugs. */ $bugs = $this->loadModel('transfer')->getQueryDatas('bug'); @@ -3732,7 +3733,6 @@ class bugModel extends model if($table) $relatedObjects = $this->dao->select($pairs)->from($table)->where('id')->in($relatedObjectIdList)->fetchPairs(); if($object == 'branch' and $this->session->currentProductType != 'normal') { - $productID = current($bugs)->product; $relatedObjects = $this->dao->select($pairs)->from($table)->where('product')->eq($productID)->fetchPairs(); } From 212debf30fd42fb887fac084049f03c77e517012 Mon Sep 17 00:00:00 2001 From: liuhong Date: Fri, 6 Jan 2023 00:52:01 +0000 Subject: [PATCH 21/28] * Rollback version, the modification of the data source in the general version has been resolved to avoid conflicts --- module/bug/config.php | 2 +- module/bug/model.php | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/module/bug/config.php b/module/bug/config.php index e4a2983a76..060992e9ab 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -205,7 +205,7 @@ $config->bug->datatable->fieldList['branch']['fixed'] = 'left'; $config->bug->datatable->fieldList['branch']['width'] = '100'; $config->bug->datatable->fieldList['branch']['required'] = 'no'; $config->bug->datatable->fieldList['branch']['control'] = 'select'; -$config->bug->datatable->fieldList['branch']['dataSource'] = array('module' => 'bug', 'method' => 'getRelatedObjects', 'params' => 'branch&id,name&$productID'); +$config->bug->datatable->fieldList['branch']['dataSource'] = array('module' => 'branch', 'method' => 'getPairs', 'params' => '$productID'); $config->bug->datatable->fieldList['type']['title'] = 'type'; $config->bug->datatable->fieldList['type']['fixed'] = 'no'; diff --git a/module/bug/model.php b/module/bug/model.php index cc4e95a5bc..e61c3a604f 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -3711,11 +3711,10 @@ class bugModel extends model * * @param int $object * @param string $pairs - * @param int $productID * @access public * @return void */ - public function getRelatedObjects($object, $pairs = '', $productID = 0) + public function getRelatedObjects($object, $pairs = '') { /* Get bugs. */ $bugs = $this->loadModel('transfer')->getQueryDatas('bug'); @@ -3731,12 +3730,8 @@ class bugModel extends model /* Get related objects title or names. */ $table = $this->config->objectTables[$object]; if($table) $relatedObjects = $this->dao->select($pairs)->from($table)->where('id')->in($relatedObjectIdList)->fetchPairs(); - if($object == 'branch' and $this->session->currentProductType != 'normal') - { - $relatedObjects = $this->dao->select($pairs)->from($table)->where('product')->eq($productID)->fetchPairs(); - } - if(in_array($object, array('build','resolvedBuild','branch'))) $relatedObjects = array('trunk' => $this->lang->trunk) + $relatedObjects; + if(in_array($object, array('build','resolvedBuild'))) $relatedObjects = array('trunk' => $this->lang->trunk) + $relatedObjects; return array('' => '', 0 => '') + $relatedObjects; } From 1c7e9b7d14494f00cb42394c6d2d6a281bf2fa74 Mon Sep 17 00:00:00 2001 From: liuhong Date: Fri, 6 Jan 2023 01:35:10 +0000 Subject: [PATCH 22/28] * Fix bug #31521. --- module/productplan/view/view.html.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index d01f599e3b..41ee03b6b5 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -137,17 +137,17 @@ idAB);?> - productplan->updateOrder);?> + productplan->updateOrder);?> story->title);?> - story->module);?> + story->module);?> priAB);?> statusAB);?> openedByAB);?> assignedToAB);?> - story->estimateAB);?> + story->estimateAB);?> story->stageAB);?> - actions?> + actions?> From ad23d6afe1cd93d273714518d5236da0ac08dfc9 Mon Sep 17 00:00:00 2001 From: liuhong Date: Fri, 6 Jan 2023 03:24:26 +0000 Subject: [PATCH 23/28] * Fix task 82219. --- module/story/control.php | 19 ++++++++++++++++--- module/story/view/batchedit.html.php | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 34fffa959d..49711e9e11 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -1136,6 +1136,7 @@ class story extends control /* Append module when change product type. */ $moduleList = array(0 => '/'); $productStoryList = array(); + $storyPlans = array(); foreach($stories as $story) { if(isset($modules[$story->product][$story->branch])) @@ -1153,6 +1154,18 @@ class story extends control $branch = $storyProduct->type == 'branch' ? ($story->branch > 0 ? $story->branch : '0') : 'all'; if(!isset($productStoryList[$story->product][$story->branch])) $productStoryList[$story->product][$story->branch] = $this->story->getProductStoryPairs($story->product, $branch, 0, 'all', 'id_desc', 0, '', $story->type); } + + if(isset($plans[$story->product][$story->branch]) and zget($plans[$story->product][$story->branch], $story->plan)) + { + $storyPlans = $plans[$story->product][$story->branch]; + $planInfo = $this->dao->select('id,title,begin,end')->from(TABLE_PRODUCTPLAN)->where('id')->eq($story->plan)->fetchAll('id'); + + $storyPlans[$story->plan] = $planInfo[$story->plan]->title . ' [' . $planInfo[$story->plan]->begin . '~' . $planInfo[$story->plan]->end . ']'; + } + else + { + $storyPlans = $plans; + } } $this->view->title = $this->lang->story->batchEdit; @@ -1166,7 +1179,7 @@ class story extends control $this->view->branchProduct = $branchProduct; $this->view->storyIdList = $storyIdList; $this->view->branch = $branch; - $this->view->plans = array('' => '') + $plans; + $this->view->plans = array('' => '') + $storyPlans; $this->view->storyType = $storyType; $this->view->stories = $stories; $this->view->executionID = $executionID; @@ -3068,8 +3081,8 @@ class story extends control /** * Ajax get story pairs. - * - * @param int $storyID + * + * @param int $storyID * @access public * @return void */ diff --git a/module/story/view/batchedit.html.php b/module/story/view/batchedit.html.php index aa4c55ddd8..b0145dcd3b 100644 --- a/module/story/view/batchedit.html.php +++ b/module/story/view/batchedit.html.php @@ -85,7 +85,7 @@ foreach(explode(',', $showFields) as $field) '> parent < 0 ? "disabled='disabled'" : '';?> - product][$story->branch]) ? array('' => '') + $plans[$story->product][$story->branch] : '', $story->plan, "class='form-control picker-select' data-drop-width='auto' $planDisabled");?> + '') + $plans : '', $story->plan, "class='form-control picker-select' data-drop-width='auto' $planDisabled");?> From d71ca3ac54d425cfe528af36cd9d7deaa416df2a Mon Sep 17 00:00:00 2001 From: liuhong Date: Fri, 6 Jan 2023 04:10:54 +0000 Subject: [PATCH 24/28] * Fix bug #31538. --- module/testtask/control.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/testtask/control.php b/module/testtask/control.php index 7995699047..1503e1cf00 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -1122,7 +1122,11 @@ class testtask extends control } if($product->shadow) unset($this->config->testcase->search['fields']['product']); - if($type != 'bystory') unset($this->config->testcase->search['fields']['story']); + if($type != 'bystory') + { + unset($this->config->testcase->search['fields']['story']); + unset($this->config->testcase->search['params']['story']); + } if($task->productType == 'normal') { unset($this->config->testcase->search['fields']['branch']); From b56ec5f7f550c30e7050becc75e35cef692b54fd Mon Sep 17 00:00:00 2001 From: liuhong Date: Mon, 9 Jan 2023 01:44:17 +0000 Subject: [PATCH 25/28] * Finish story #41436. --- module/programplan/view/gantt.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/programplan/view/gantt.html.php b/module/programplan/view/gantt.html.php index e583097b6c..23448bef8a 100755 --- a/module/programplan/view/gantt.html.php +++ b/module/programplan/view/gantt.html.php @@ -107,8 +107,8 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;}
    - createLink('project', 'execution', "status=all&projectID=$projectID"),"  ", '', "class='btn btn-icon switchBtn' title='{$lang->project->bylist}'");?>  ", '', "class='btn btn-icon text-primary switchBtn' title='{$lang->programplan->gantt}'");?> + createLink('project', 'execution', "status=all&projectID=$projectID"),"  ", '', "class='btn btn-icon switchBtn' title='{$lang->project->bylist}'");?>
    programplan->full;?>
    From a2342f7ecacf7e966882af1dd6f7fb20bd604b40 Mon Sep 17 00:00:00 2001 From: liuhong Date: Mon, 9 Jan 2023 03:06:41 +0000 Subject: [PATCH 26/28] * Add project for auditplan #40669. --- module/my/control.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/my/control.php b/module/my/control.php index 75e03d3233..bb3a09b65c 100755 --- a/module/my/control.php +++ b/module/my/control.php @@ -1016,6 +1016,7 @@ EOF; $auditplans = $this->auditplan->getList(0, $browseType, $param, $orderBy, $pager); $this->view->executions = $this->loadModel('execution')->getPairs(); + $this->view->projects = $this->loadModel('project')->getPairs(); $this->view->processTypeList = $this->lang->process->classify; $this->view->processes = $this->pssp->getProcesses(); $this->view->activities = $this->pssp->getActivityPairs(); From 7bbeded71698987a81108de87b4cd352abf47773 Mon Sep 17 00:00:00 2001 From: liuhong Date: Mon, 9 Jan 2023 05:22:53 +0000 Subject: [PATCH 27/28] * Adjust code. --- module/project/view/execution.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/view/execution.html.php b/module/project/view/execution.html.php index 05e9c4cb9a..219f2c8bf3 100644 --- a/module/project/view/execution.html.php +++ b/module/project/view/execution.html.php @@ -45,8 +45,8 @@
    model == 'waterfall' and $this->config->edition == 'max'):?>
    -  ", '', "class='btn btn-icon text-primary switchBtn' title='{$lang->project->bylist}'");?> createLink('programplan', 'browse', "projectID=$projectID&productID=$productID&type=gantt"), "  ", '', "class='btn btn-icon switchBtn' title='{$lang->programplan->gantt}'");?> +  ", '', "class='btn btn-icon text-primary switchBtn' title='{$lang->project->bylist}'");?>
    " . $lang->export, '', "class='btn btn-link export'")?> From 62967bf48b8be51e473622e31485be5c7a0cb9c4 Mon Sep 17 00:00:00 2001 From: liuhong Date: Thu, 12 Jan 2023 01:47:48 +0000 Subject: [PATCH 28/28] * Fix bug #31524. --- module/productplan/js/view.js | 7 +++++++ module/productplan/view/view.html.php | 4 ++-- module/release/js/view.js | 27 ++++++++++++++++++++++++--- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/module/productplan/js/view.js b/module/productplan/js/view.js index 1658a7a071..8c55c57ffe 100644 --- a/module/productplan/js/view.js +++ b/module/productplan/js/view.js @@ -69,6 +69,13 @@ $(function() infoShowed = true; } + if(href !== '') + { + type = href == '#stories' ? 'story' : (href == '#bugs' ? 'bug' : 'planInfo'); + var viewLink = createLink('productplan', 'view', 'planID=' + planID + '&type=' + type + (typeof(param) == 'undefined' ? '' : param) + (typeof(orderBy) == 'undefined' ? '' : "&orderBy=" + orderBy)); + if(type == 'planInfo') viewLink = createLink('productplan', 'view', 'planID=' + planID + '&type=' + type); + self.location.href = viewLink; + } }); $('#storyList').on('sort.sortable', function(e, data) diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 41ee03b6b5..e7df627a15 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -66,7 +66,7 @@ -
  • +
  • '> icons['plan'], 'text-info') . ' ' . $lang->productplan->view;?>
  • @@ -533,7 +533,7 @@
    -
    +
    '>
    productplan->basicInfo;?>
    diff --git a/module/release/js/view.js b/module/release/js/view.js index 3fe9cdb5b1..e14f125052 100644 --- a/module/release/js/view.js +++ b/module/release/js/view.js @@ -10,9 +10,9 @@ function showLink(releaseID, type, param) /** * Load URL. - * - * @param string $url - * @param string$type + * + * @param string $url + * @param string$type * @access public * @return void */ @@ -68,5 +68,26 @@ $(function() infoShowed = true; } + if(href !== '') + { + switch(href) + { + case '#stories': + type = 'story'; + break; + case '#bugs': + type = 'bug'; + break; + case '#leftBugs': + type = 'leftBug'; + break; + case '#releaseInfo': + type = 'releaseInfo'; + break; + } + var viewLink = createLink('release', 'view', 'releaseID=' + releaseID + '&type=' + type + '&link=' + link + (typeof(param) == 'undefined' ? '' : param) + (typeof(orderBy) == 'undefined' ? '' : "&orderBy=" + orderBy)); + if(type == 'releaseInfo') viewLink = createLink('release', 'view', 'releaseID=' + releaseID + '&type=' + type); + self.location.href = viewLink; + } }); })