diff --git a/config/zentaopms.php b/config/zentaopms.php index fda56ae16c..77f092763d 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 = ''; 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..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'] = '收件人沒有設置郵箱,請到組織視圖中檢查下相應用戶的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/bug/control.php b/module/bug/control.php index 1fea4f9807..cc4f3927ad 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->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; diff --git a/module/bug/model.php b/module/bug/model.php index 3a21f6f23c..920bf987bf 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,resultFiles') ->get(); /* Check repeat bug. */ @@ -98,6 +98,23 @@ class bugModel extends model { $bugID = $this->dao->lastInsertID(); + if(isset($_POST['resultFiles'])) + { + $resultFiles = $_POST['resultFiles']; + if(isset($_POST['deleteFiles'])) + { + foreach($_POST['deleteFiles'] as $deletedCaseFileID) $resultFiles = trim(str_replace(",$deletedCaseFileID,", ',', ",$resultFiles,"), ','); + } + $files = $this->dao->select('*')->from(TABLE_FILE)->where('id')->in($resultFiles)->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); @@ -3728,13 +3745,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') - { - $productID = current($bugs)->product; - $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; } diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 99019f724a..8c6abba4ed 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -335,7 +335,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' => $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'); + ?> + diff --git a/module/execution/control.php b/module/execution/control.php index 544207a2b5..3fae2ef99a 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1676,8 +1676,15 @@ 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"))); + } } } 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/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'); 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 ''; 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'); diff --git a/module/my/control.php b/module/my/control.php index 09fbf922f7..d54f1e5e75 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(); diff --git a/module/product/model.php b/module/product/model.php index 56971b2adb..5d327a9705 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -1303,14 +1303,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/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 d01f599e3b..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;?>
  • @@ -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?> @@ -533,7 +533,7 @@ -
    +
    '>
    productplan->basicInfo;?>
    diff --git a/module/program/model.php b/module/program/model.php index d8ebcb9a45..a604c600a4 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() diff --git a/module/programplan/view/gantt.html.php b/module/programplan/view/gantt.html.php index 93526300db..117b8a131b 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;?>
    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'")?> 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; + } }); }) diff --git a/module/story/control.php b/module/story/control.php index 632789009f..fa206cde03 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -1143,6 +1143,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])) @@ -1160,6 +1161,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; @@ -1173,7 +1186,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; 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");?> diff --git a/module/testcase/config.php b/module/testcase/config.php index 26acbca266..283c36ac00 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']['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; @@ -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']['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 74a751fc47..2f5bb81309 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 eff259962d..5615527217 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 bf74a1402e..d124bc8831 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 963563ae4b..9ef4dd658f 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 */ @@ -1107,7 +1112,21 @@ 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']['story']); + unset($this->config->testcase->search['params']['story']); + } if($task->productType == 'normal') { unset($this->config->testcase->search['fields']['branch']); diff --git a/module/testtask/model.php b/module/testtask/model.php index a1324c153a..8042ca6da4 100755 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -399,18 +399,20 @@ 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($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') + ->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() + ->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(); } 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);?>