This commit is contained in:
hufangzhou
2021-08-10 15:53:18 +08:00
29 changed files with 125 additions and 22 deletions
+5
View File
@@ -742,6 +742,11 @@ class bug extends control
$this->repo->setMenu($repos);
$this->lang->navGroup->bug = 'devops';
}
if($this->app->openApp == 'product')
{
$this->loadModel('product')->setMenu($bug->product);
$this->lang->product->menu->plan['subModule'] .= ',bug';
}
}
/* Get product info. */
+10 -4
View File
@@ -32,7 +32,7 @@
<div class="btn-toolbar pull-right">
<?php if(common::canModify('product', $product)):?>
<?php $openApp = strpos('|execution|project|qa|', $this->app->openApp) !== false ? $this->app->openApp : 'qa';?>
<?php common::printLink('bug', 'create', "productID={$bug->product}&branch={$bug->branch}&extra=moduleID={$bug->module},projectID={$bug->project},executionID={$bug->execution}", "<i class='icon icon-plus'></i> " . $lang->bug->create, '', "class='btn btn-primary' data-app='$openApp'"); ?>
<?php if($this->app->openApp != 'product') common::printLink('bug', 'create', "productID={$bug->product}&branch={$bug->branch}&extra=moduleID={$bug->module},projectID={$bug->project},executionID={$bug->execution}", "<i class='icon icon-plus'></i> " . $lang->bug->create, '', "class='btn btn-primary' data-app='$openApp'"); ?>
<?php endif;?>
</div>
<?php endif;?>
@@ -86,14 +86,20 @@
common::printIcon('bug', 'close', $params, $bug, 'button', '', '', 'text-danger iframe showinonlybody', true);
common::printIcon('bug', 'activate', $params, $bug, 'button', '', '', 'text-success iframe showinonlybody', true);
common::printIcon('bug', 'toStory', "product=$bug->product&branch=$bug->branch&module=0&story=0&execution=0&bugID=$bug->id", $bug, 'button', $lang->icons['story'], '', '', '', "data-app='" . ($this->app->openApp == 'project' ? 'project' : 'product') . "'", $lang->bug->toStory);
common::printIcon('bug', 'createCase', $convertParams, $bug, 'button', 'sitemap');
if($this->app->openApp != 'product')
{
common::printIcon('bug', 'toStory', "product=$bug->product&branch=$bug->branch&module=0&story=0&execution=0&bugID=$bug->id", $bug, 'button', $lang->icons['story'], '', '', '', "data-app='" . ($this->app->openApp == 'project' ? 'project' : 'product') . "'", $lang->bug->toStory);
common::printIcon('bug', 'createCase', $convertParams, $bug, 'button', 'sitemap');
}
echo $this->buildOperateMenu($bug, 'view');
echo "<div class='divider'></div>";
common::printIcon('bug', 'edit', $params, $bug);
common::printIcon('bug', 'create', $copyParams, $bug, 'button', 'copy', '', '', false, "data-app='qa'");
if($this->app->openApp != 'product')
{
common::printIcon('bug', 'create', $copyParams, $bug, 'button', 'copy', '', '', false, "data-app='qa'");
}
common::printIcon('bug', 'delete', $params, $bug, 'button', 'trash', 'hiddenwin');
?>
<?php endif;?>
Binary file not shown.
+1 -1
View File
@@ -64,7 +64,7 @@
<?php $openApp = '';?>
<?php if($action->objectType == 'meeting') $openApp = $action->project ? "data-app='project'" : "data-app='my'";?>
<?php
if(isset($config->maxVersion) and strpos($config->action->assetType, $action->objectType) !== false and empty($action->objectName))
if((isset($config->maxVersion) and strpos($config->action->assetType, $action->objectType) !== false) or empty($action->objectName))
{
echo '#' . $action->objectID;
}
+6 -1
View File
@@ -70,7 +70,12 @@ class doc extends control
*/
public function browse($browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->session->set('docList', $this->app->getURI(true), 'doc');
/* Save session, load module. */
$uri = $this->app->getURI(true);
$this->session->set('docList', $uri, 'doc');
$this->session->set('productList', $uri, 'product');
$this->session->set('executionList', $uri, 'execution');
$this->session->set('projectList', $uri, 'project');
$this->loadModel('search');
/* Set browseType.*/
+4 -1
View File
@@ -1,4 +1,7 @@
$('.ajaxCollect').click(function()
{
window.location.reload();
if(browseType == 'collectedbyme')
{
window.location.reload();
}
})
+1
View File
@@ -16,6 +16,7 @@ $lang->doc->product = $lang->productCommon;
$lang->doc->execution = $lang->executionCommon;
$lang->doc->lib = 'Bibliothek';
$lang->doc->module = 'Modul';
$lang->doc->object = 'Object';
$lang->doc->title = 'Titel';
$lang->doc->digest = 'Zusammenfassung';
$lang->doc->comment = 'Bemerkung';
+1
View File
@@ -17,6 +17,7 @@ $lang->doc->project = 'Project';
$lang->doc->execution = $lang->executionCommon;
$lang->doc->lib = 'Library';
$lang->doc->module = 'Catalog';
$lang->doc->object = 'Object';
$lang->doc->title = 'Name';
$lang->doc->digest = 'Summary';
$lang->doc->comment = 'Comment';
+1
View File
@@ -16,6 +16,7 @@ $lang->doc->product = $lang->productCommon;
$lang->doc->execution = $lang->executionCommon;
$lang->doc->lib = 'Bibliothèque';
$lang->doc->module = 'Catégorie';
$lang->doc->object = 'Object';
$lang->doc->title = 'Nom';
$lang->doc->digest = 'Résumé';
$lang->doc->comment = 'Commentaire';
+1
View File
@@ -16,6 +16,7 @@ $lang->doc->product = $lang->productCommon;
$lang->doc->execution = $lang->executionCommon;
$lang->doc->lib = 'Thư viện';
$lang->doc->module = 'Danh mục';
$lang->doc->object = 'Object';
$lang->doc->title = 'Tên';
$lang->doc->digest = 'Tóm tắt';
$lang->doc->comment = 'Nhận xét';
+1
View File
@@ -17,6 +17,7 @@ $lang->doc->project = '所属项目';
$lang->doc->execution = '所属' . $lang->executionCommon;
$lang->doc->lib = '所属文档库';
$lang->doc->module = '所属目录';
$lang->doc->object = '所属对象';
$lang->doc->title = '文档标题';
$lang->doc->digest = '文档摘要';
$lang->doc->comment = '文档备注';
+29
View File
@@ -255,9 +255,38 @@ class docModel extends model
->fetchAll('id');
}
$projects = $this->dao->select('t1.id, t1.name')->from(TABLE_PROJECT)->alias('t1')
->leftJoin(TABLE_DOC)->alias('t2')->on('t1.id=t2.project')
->where('t2.id')->in(array_keys($docs))
->andWhere('t2.execution')->eq(0)
->fetchPairs();
$executions = $this->dao->select('t1.id, t1.name')->from(TABLE_EXECUTION)->alias('t1')
->leftJoin(TABLE_DOC)->alias('t2')->on('t1.id=t2.execution')
->where('t2.id')->in(array_keys($docs))
->fetchPairs();
$products = $this->dao->select('t1.id, t1.name')->from(TABLE_PRODUCT)->alias('t1')
->leftJoin(TABLE_DOC)->alias('t2')->on('t1.id=t2.product')
->where('t2.id')->in(array_keys($docs))
->fetchPairs();
$docContents = $this->dao->select('*')->from(TABLE_DOCCONTENT)->where('doc')->in(array_keys($docs))->orderBy('version,doc')->fetchAll('doc');
$objects = array('product' => 'products', 'execution' => 'executions', 'project' => 'projects');
foreach($docs as $index => $doc)
{
foreach($objects as $type => $object)
{
if(!empty($doc->{$type}))
{
$doc->objectID = $doc->{$type};
$doc->objectName = ${$object}[$doc->{$type}];
$doc->objectType = $type;
break;
}
}
$docs[$index]->fileSize = 0;
if(isset($files[$index]))
{
+9
View File
@@ -36,6 +36,7 @@
<thead>
<tr>
<th class="c-name"><?php echo $lang->doc->title;?></th>
<th class="w-200px c-name"><?php echo $lang->doc->object;?></th>
<th class="c-num"><?php echo $lang->doc->size;?></th>
<th class="c-user"><?php echo $lang->doc->addedBy;?></th>
<th class="c-datetime"><?php echo $lang->doc->addedDate;?></th>
@@ -49,6 +50,14 @@
<?php $collectTitle = strpos($doc->collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?>
<tr>
<td class="c-name"><?php echo html::a($this->createLink('doc', 'view', "docID=$doc->id&version=0", '', true), "<i class='icon icon-file-text text-muted'></i> &nbsp;" . $doc->title, '', "title={$doc->title} class='iframe' data-width='90%'");?></td>
<td class='c-name'>
<?php if(!empty($doc->objectType)):?>
<?php echo $lang->{$doc->objectType}->common . ' : ';?>
<a title='<?php echo $doc->objectName;?>' href='<?php echo $this->createLink($doc->objectType, 'view', "objectID=$doc->objectID");?>' data-app="<?php echo $doc->objectType;?>">
<?php echo $doc->objectName;?>
</a>
<?php endif;?>
</td>
<td class="c-num"><?php echo $doc->fileSize ? $doc->fileSize : '-';?></td>
<td class="c-user"><?php echo zget($users, $doc->addedBy);?></td>
<td class="c-datetime"><?php echo formatTime($doc->addedDate, 'y-m-d');?></td>
+1 -1
View File
@@ -87,7 +87,7 @@
<span class='label-action'><?php echo ' ' . $action->actionLabel;?></span>
<span class="text"><?php echo $action->objectLabel;?></span>
<span class="label label-id"><?php echo $action->objectID;?></span>
<?php echo html::a($action->objectLink, $action->objectName);?>
<?php if($action->objectName) echo html::a($action->objectLink, $action->objectName);?>
</span>
</div>
</li>
+6 -1
View File
@@ -480,9 +480,14 @@ class my extends control
public function doc($type = 'openedbyme', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Save session, load lang. */
if($this->app->viewType != 'json') $this->session->set('docList', $this->app->getURI(true), 'doc');
$uri = $this->app->getURI(true);
if($this->app->viewType != 'json') $this->session->set('docList', $uri, 'doc');
$this->loadModel('doc');
$this->session->set('productList', $uri, 'product');
$this->session->set('executionList', $uri, 'execution');
$this->session->set('projectList', $uri, 'project');
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
+9
View File
@@ -34,6 +34,7 @@
<thead>
<tr>
<th class="c-name"><?php echo $lang->doc->title;?></th>
<th class="w-200px c-name"><?php echo $lang->doc->object;?></th>
<th class="c-num"><?php echo $lang->doc->size;?></th>
<?php if($type != 'openedbyme'):?>
<th class="c-user"><?php echo $lang->doc->addedBy;?></th>
@@ -49,6 +50,14 @@
<?php $collectTitle = strpos($doc->collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?>
<tr>
<td class="c-name"><?php echo html::a($this->createLink('doc', 'view', "docID=$doc->id&version=0&from={$lang->navGroup->doc}", '', true), "<i class='icon icon-file-text text-muted'></i> &nbsp;" . $doc->title, '', "title={$doc->title} class='iframe' data-width='90%'");?></td>
<td class='c-name'>
<?php if(!empty($doc->objectType)):?>
<?php echo $lang->{$doc->objectType}->common . ' : ';?>
<a title='<?php echo $doc->objectName;?>' href='<?php echo $this->createLink($doc->objectType, 'view', "objectID=$doc->objectID");?>' data-app="<?php echo $doc->objectType;?>">
<?php echo $doc->objectName;?>
</a>
<?php endif;?>
</td>
<td class="c-num"><?php echo $doc->fileSize ? $doc->fileSize : '-';?></td>
<?php if($type != 'openedbyme'):?>
<td class="c-user"><?php echo zget($users, $doc->addedBy);?></td>
+1 -1
View File
@@ -60,7 +60,7 @@
<?php $openApp = '';?>
<?php if($action->objectType == 'meeting') $openApp = $action->project ? "data-app='project'" : "data-app='my'";?>
<?php
if(isset($config->maxVersion) and strpos($config->action->assetType, $action->objectType) !== false and empty($action->objectName))
if((isset($config->maxVersion) and strpos($config->action->assetType, $action->objectType) !== false) or empty($action->objectName))
{
echo '#' . $action->objectID;
}
+5 -2
View File
@@ -50,6 +50,7 @@
</th>
<th class='c-pri w-40px'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
<th class='c-name'> <?php common::printOrderLink('name', $orderBy, $vars, $lang->task->name);?></th>
<th class='c-project w-120px'> <?php common::printOrderLink('project', $orderBy, $vars, $lang->my->projects);?></th>
<th class='c-project w-120px'> <?php common::printOrderLink('execution', $orderBy, $vars, $lang->my->executions);?></th>
<?php if($type != 'openedBy'): ?>
<th class='c-user w-90px'> <?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
@@ -90,7 +91,8 @@
<?php echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', '', $task->project), $task->name, null, "style='color: $task->color' data-group='execution'");?>
<?php if(!empty($task->children)) echo '<a class="task-toggle" data-id="' . $task->id . '"><i class="icon icon-angle-double-right"></i></a>';?>
</td>
<td class='c-project' title="<?php echo $task->executionName;?>"><?php echo html::a($this->createLink('execution', 'task', "executionID=$task->execution", '', '', $task->project), $task->executionName, '', "data-group='execution'");?></td>
<td class='c-project' title="<?php echo zget($projects, $task->project);?>"><?php echo html::a($this->createLink('project', 'view', "projectID=$task->project"), zget($projects, $task->project));?></td>
<td class='c-project' title="<?php echo $task->executionName;?>"><?php echo html::a($this->createLink('execution', 'task', "executionID=$task->execution"), $task->executionName, '', "data-group='execution'");?></td>
<?php if($type != 'openedBy'): ?>
<td class='c-user'><?php echo zget($users, $task->openedBy);?></td>
<?php endif;?>
@@ -154,7 +156,8 @@
<?php if($child->parent > 0) echo '<span class="label label-badge label-light">' . $this->lang->task->childrenAB . '</span> ';?>
<?php echo html::a($this->createLink('task', 'view', "taskID=$child->id", '', '', $child->project), $child->name, null, "style='color: $child->color' data-group='project'");?>
</td>
<td class='c-project' title="<?php echo $child->projectName;?>"><?php echo html::a($this->createLink('execution', 'task', "executionID=$child->project", '', '', $child->project), $child->executionName, '', "data-group='execution'");?></td>
<td class='c-project' title="<?php echo zget($projects, $child->project);?>"><?php echo html::a($this->createLink('project', 'view', "projectID=$child->project"), zget($projects, $child->project));?></td>
<td class='c-project' title="<?php echo $child->projectName;?>"><?php echo html::a($this->createLink('execution', 'task', "executionID=$child->project"), $child->executionName, '', "data-group='execution'");?></td>
<?php if($type != 'openedBy'): ?>
<td class='c-user'><?php echo zget($users, $child->openedBy);?></td>
<?php endif;?>
+1 -1
View File
@@ -86,7 +86,7 @@
<span class='label-action'><?php echo ' ' . $action->actionLabel;?></span>
<span class="text"><?php echo $action->objectLabel;?></span>
<span class="label label-id"><?php echo $action->objectID;?></span>
<?php echo html::a($action->objectLink, $action->objectName);?>
<?php if($action->objectName) echo html::a($action->objectLink, $action->objectName);?>
</span>
</div>
</li>
Binary file not shown.
+1 -1
View File
@@ -392,7 +392,7 @@
<?php endif;?>
</td>
<td><span class='label-pri label-pri-<?php echo $bug->pri;?>' title='<?php echo zget($lang->bug->priList, $bug->pri, $bug->pri);?>'><?php echo zget($lang->bug->priList, $bug->pri, $bug->pri);?></span></td>
<td class='text-left nobr' title='<?php echo $bug->title?>'><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id"), $bug->title);?></td>
<td class='text-left nobr' title='<?php echo $bug->title?>'><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id"), $bug->title, '', 'data-app="product"');?></td>
<td><?php echo zget($users, $bug->openedBy);?></td>
<td><?php echo zget($users, $bug->assignedTo);?></td>
<td>
+1 -1
View File
@@ -773,7 +773,7 @@ class programModel extends model
$treeMenu = array();
foreach($modules as $module)
{
if(strpos($this->app->user->view->programs, $module->id) === false) continue;
if(strpos($this->app->user->view->programs, $module->id) === false and (!$this->app->user->admin)) continue;
$moduleName = '/';
$parentModules = explode(',', $module->path);
+1 -1
View File
@@ -87,7 +87,7 @@
<span class='label-action'><?php echo ' ' . $action->actionLabel;?></span>
<span class="text"><?php echo $action->objectLabel;?></span>
<span class="label label-id"><?php echo $action->objectID;?></span>
<?php echo html::a($action->objectLink, $action->objectName);?>
<?php if($action->objectName) echo html::a($action->objectLink, $action->objectName);?>
</span>
</div>
</li>
+9 -1
View File
@@ -4701,10 +4701,18 @@ class upgradeModel extends model
$today = helper::today();
foreach($projectTeams as $projectID => $projectMember)
{
unset($projectMember['']);
$project = zget($projects, $projectID, '');
$users = implode(',', $projectMember);
$this->dao->update(TABLE_DOCLIB)
->set('users')->eq($users)
->where('project')->eq($projectID)
->andWhere('main')->eq(1)
->exec();
foreach($projectMember as $account)
{
if(empty($account)) continue;
if(!isset($users[$account])) continue;
$user = $users[$account];
+1 -1
View File
@@ -55,7 +55,7 @@
<span class='label-action'><?php echo ' ' . $action->actionLabel;?></span>
<span class="text-muted"><?php echo $action->objectLabel;?></span>
<span class="label label-id"><?php echo $action->objectID;?></span>
<?php echo html::a($action->objectLink, $action->objectName);?>
<?php if($action->objectName) echo html::a($action->objectLink, $action->objectName);?>
</span>
</div>
</li>