This commit is contained in:
holan20180123
2020-07-16 13:07:58 +08:00
18 changed files with 68 additions and 32 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ class control extends baseControl
if(!isset($this->config->bizVersion)) return false;
/* Code for task #9224. Set requiredFields for workflow. */
if($this->dbh or defined('IN_USE') or (defined('RUN_MODE') and RUN_MODE == 'api'))
if($this->dbh and (defined('IN_USE') or (defined('RUN_MODE') and RUN_MODE == 'api')))
{
$this->checkRequireFlowField();
@@ -319,7 +319,7 @@ class control extends baseControl
foreach($fieldRules as $ruleID)
{
if(!isset($rules[$ruleID])) continue;
if(!is_string($_POST[$field->field])) continue;
if(!empty($_POST[$field->field]) and !is_string($_POST[$field->field])) continue;
$rule = $rules[$ruleID];
if($rule->type == 'system' and $rule->rule == 'notempty')
+1
View File
@@ -354,6 +354,7 @@ class router extends baseRouter
/* Check if the requested module is defined in workflow. */
$flow = $this->dbh->query("SELECT * FROM " . TABLE_WORKFLOW . " WHERE `module` = '$this->moduleName'")->fetch();
if(!$flow) return parent::setControlFile($exitIfNone);
if($flow->status != 'normal') die("<html><head><meta charset='utf-8'></head><body>{$this->lang->flowNotRelease}</body></html>");
/**
* 工作流中配置的标签应该请求browse方法,而某些内置流程本身包含browse方法。在这里处理请求的时候会无法区分是内置的browse方法还是工作
+5 -1
View File
@@ -989,7 +989,11 @@ class baseFixer
$fields = $this->processFields($fieldName);
foreach($fields as $fieldName)
{
if(empty($this->stripedFields) or !isset($this->stripedFields[$fieldName])) $this->data->$fieldName = $this->specialArray($this->data->$fieldName);
if(empty($this->stripedFields) or !isset($this->stripedFields[$fieldName]))
{
$this->data->$fieldName = $this->specialArray($this->data->$fieldName);
$this->stripedFields[$fieldName] = $fieldName;
}
}
return $this;
}
+1 -1
View File
@@ -481,7 +481,7 @@ class SMTP {
$max_line_length = 998; // used below; set here for ease in change
while(list(,$line) = each($lines)) {
foreach($lines as $line) {
$lines_out = null;
if($line == "" && $in_headers) {
$in_headers = false;
+1
View File
@@ -808,6 +808,7 @@ class block extends control
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')
->where('t1.product')->in($productIdList)
->andWhere('t2.deleted')->eq(0)
->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->projects)->fi()
->fetchGroup('product');
foreach($projects as $product => $productProjects)
{
-4
View File
@@ -2664,10 +2664,6 @@ class bugModel extends model
{
echo html::a(helper::createLink('build', 'view', "buildID=$buildID"), $build, '', "title='$bug->openedBuild'");
}
else
{
echo $build;
}
}
break;
case 'assignedTo':
+2 -2
View File
@@ -1,7 +1,7 @@
.versions .dropdown-menu{max-height:260px; overflow-y:auto;}
.table-data > tbody > tr > th.w-80px {width:80px;}
.detail-content .file-image{position: relative; padding: 0 10px;}
.detail-content .file-image > span.right-icon{position: absolute; right: 0px; top: 0;}
.detail-content .file-image{position: relative; padding: 0 10px; margin-right: 10px;}
.detail-content .file-image > span.right-icon{position: absolute; right: -10px; top: 0;}
#urlIframe{border:0px;}
#urlCard{border:1px solid #ccc; width:100%; min-height:100px; padding:8px; border-radius: 4px; margin:103px 0;
+2
View File
@@ -36,7 +36,9 @@ class myModel extends model
}
elseif($role == 'po')
{
unset($this->lang->my->menuOrder[29]);
$this->lang->my->menuOrder[15] = 'story';
$this->lang->my->menuOrder[16] = 'requirement';
$this->lang->my->menuOrder[30] = 'task';
$this->lang->my->dividerMenu = str_replace(',task,', ',story,', $this->lang->my->dividerMenu);
}
+3 -2
View File
@@ -17,13 +17,14 @@ class qaModel extends model
* @param array $products
* @param int $productID
* @param int $branch
* @param string $extra
* @access public
* @return void
*/
public function setMenu($products, $productID, $branch = 0)
public function setMenu($products, $productID, $branch = 0, $extra = '')
{
$this->loadModel('product')->setMenu($products, $productID, $branch);
$selectHtml = $this->product->select($products, $productID, 'qa', 'index', '', $branch);
$selectHtml = $this->product->select($products, $productID, 'qa', 'index', $extra, $branch);
$productIndex = '';
$isMobile = $this->app->viewType == 'mhtml';
+1
View File
@@ -1603,6 +1603,7 @@ class taskModel extends model
->get();
$this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('id')->eq((int)$taskID)->exec();
if($oldTask->fromBug) $this->dao->update(TABLE_BUG)->set('toTask')->eq(0)->where('id')->eq($oldTask->fromBug)->exec();
if($oldTask->parent > 0) $this->updateParentStatus($taskID);
if($oldTask->parent == '-1')
{
+2 -2
View File
@@ -41,7 +41,7 @@
<span class='input-group-addon'> ~ </span>
<?php echo html::input('end', $end, "class='form-control form-date'")?>
<?php
echo html::hidden('product', $productIdList) . ($config->global->flow != 'onlyTest' ? html::hidden('project', $project->id) : '') . html::hidden('tasks', $tasks);
echo html::hidden('product', $productIdList) . ($config->global->flow != 'onlyTest' ? html::hidden('project', isset($project->id) ? $project->id : 0) : '') . html::hidden('tasks', $tasks);
echo html::hidden('objectID', $objectID) . html::hidden('objectType', $objectType);
?>
</div>
@@ -67,7 +67,7 @@
<?php if($config->global->flow != 'onlyTest'):?>
<tr>
<th><?php echo $lang->testreport->goal?></th>
<td colspan='2'><?php echo $project->desc?></td>
<td colspan='2'><?php echo isset($project->desc) ? $project->desc : '';?></td>
<td></td>
</tr>
<?php endif;?>
+7 -1
View File
@@ -721,7 +721,13 @@ class testtaskModel extends model
*/
public function getDataOfTestTaskPerRunner($taskID)
{
$datas = $this->dao->select('lastRunner AS name, COUNT(*) AS value')->from(TABLE_TESTRUN)->where('task')->eq($taskID)->groupBy('name')->orderBy('value DESC')->fetchAll('name');
$datas = $this->dao->select("t1.lastRunner AS name, COUNT('t1.*') AS value")->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
->where('t1.task')->eq($taskID)
->andWhere('t2.deleted')->eq(0)
->groupBy('name')
->orderBy('value DESC')
->fetchAll('name');
if(!$datas) return array();
$users = $this->loadModel('user')->getPairs('noclosed|noletter');
foreach($datas as $result => $data) $data->name = $result ? zget($users, $result, $result) : $this->lang->testtask->unexecuted;
+1 -2
View File
@@ -16,8 +16,7 @@
<div id='formSettingBtn' class='pull-right btn-toolbar'>
<?php $customLink = $this->createLink('custom', 'ajaxSaveCustomFields', 'module=todo&section=custom&key=batchCreateFields')?>
<?php include '../../common/view/customfield.html.php';?>
<div class="divider"></div>
<button id="closeModal" type="button" class="btn btn-link" data-dismiss="modal"><i class="icon icon-close"></i></button>
<div class="divider" style="margin-right: 30px;"></div>
</div>
<form id='todoBatchAddForm' method='post' target='hiddenwin' action='<?php echo $this->createLink('todo', 'batchCreate');?>'>
<div id="mainContent">
+14
View File
@@ -135,6 +135,20 @@ class webhook extends control
*/
public function log($id, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Save session. */
$uri = $this->app->getURI(true);
$this->session->set('productList', $uri);
$this->session->set('productPlanList', $uri);
$this->session->set('releaseList', $uri);
$this->session->set('storyList', $uri);
$this->session->set('projectList', $uri);
$this->session->set('taskList', $uri);
$this->session->set('buildList', $uri);
$this->session->set('bugList', $uri);
$this->session->set('caseList', $uri);
$this->session->set('testtaskList', $uri);
$this->session->set('todoList', $uri);
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
+12 -4
View File
@@ -66,6 +66,7 @@ class webhookModel extends model
$this->loadModel('action');
$actions = $this->dao->select('*')->from(TABLE_ACTION)->where('id')->in($actions)->fetchAll('id');
$users = $this->loadModel('user')->getPairs('noletter');
foreach($logs as $log)
{
@@ -80,17 +81,21 @@ class webhookModel extends model
$object = $this->dao->select('*')->from($this->config->objectTables[$action->objectType])->where('id')->eq($action->objectID)->fetch();
$field = zget($this->config->action->objectNameFields, $action->objectType, $action->objectType);
if(!is_object($object))
if(!is_object($object))
{
$object = new stdclass;
$object->$field = '';
}
$text = '';
if(isset($data->markdown) and is_object($data->markdown))
if(isset($data->markdown->text))
{
$text = substr($data->markdown->text, 0, strpos($data->markdown->text, '(http'));
}
elseif(isset($data->markdown->content))
{
$text = substr($data->markdown->content, 0, strpos($data->markdown->content, '(http'));
}
else
{
$text = substr($data->text, 0, strpos($data->text, '(http')) ? substr($data->text, 0, strpos($data->text, '(http')) : zget($users, $data->user, $this->app->user->realname) . $this->lang->action->label->{$action->action} . $this->lang->action->objectTypes[$action->objectType] . "[#{$action->objectID}::{$object->$field}]";
@@ -98,6 +103,9 @@ class webhookModel extends model
$log->action = $text;
$log->actionURL = $this->getViewLink($action->objectType, $action->objectID);
$log->module = $action->objectType;
$log->moduleID = $action->objectID;
$log->dialog = $action->objectType == 'todo' ? 1 : 0;
}
return $logs;
}
@@ -321,9 +329,9 @@ class webhookModel extends model
$this->saveData($id, $actionID, $postData, $actor);
continue;
}
$result = $this->fetchHook($webhook, $postData, $actionID);
$this->saveLog($webhook, $actionID, $postData, $result);
if(!empty($result)) $this->saveLog($webhook, $actionID, $postData, $result);
}
return !dao::isError();
}
+2 -1
View File
@@ -34,7 +34,8 @@
<td class='text' title='<?php echo $webhook->url;?>'><?php echo $webhook->url;?></td>
<td class='c-actions text-right'>
<?php
if($webhook->type == 'dinguser' or $webhook->type == 'wechatuser') common::printIcon('webhook', 'chooseDept', "webhookID=$id", '', 'list', 'link');
if($webhook->type == 'dinguser') common::printIcon('webhook', 'chooseDept', "webhookID=$id", '', 'list', 'link');
if($webhook->type == 'wechatuser') common::printIcon('webhook', 'bind', "webhookID=$id", '', 'list', 'link');
common::printIcon('webhook', 'log', "webhookID=$id", '', 'list', 'file-text');
common::printIcon('webhook', 'edit', "webhookID=$id", '', 'list');
if(common::hasPriv('webhook', 'delete'))
+5 -3
View File
@@ -43,9 +43,11 @@
<tr>
<td class='text-center'><?php echo $id;?></td>
<td><?php echo $log->date;?></td>
<td class='text' title='<?php echo $log->url;?>'><?php echo $log->url;?></td>
<td class='text' title='<?php echo $log->action;?>'><?php echo html::a($log->actionURL, $log->action);?></td>
<td class='text-center'><?php echo $log->contentType;?></td>
<td title='<?php echo $log->url;?>'><?php echo $log->url;?></td>
<?php $iframe = $log->dialog == 1 ? 'data-toggle="modal" data-type="iframe"' : '';?>
<?php if($log->dialog == 1) $log->actionURL = $this->createLink($log->module, 'view', "id=$log->moduleID", '' , true)?>
<td title='<?php echo $log->action;?>'><?php echo html::a($log->actionURL, $log->action, '', $iframe);?></td>
<td title='<?php echo $log->contentType;?>'><?php echo $log->contentType;?></td>
<td title='<?php echo $log->result;?>'><?php echo $log->result;?></td>
</tr>
<?php endforeach;?>
+7 -7
View File
File diff suppressed because one or more lines are too long