Merge branch 'tsj_fixbug' into 'master'

Tsj fixbug

See merge request easycorp/zentaopms!7465
This commit is contained in:
王怡栋
2023-04-19 05:33:42 +00:00
15 changed files with 55 additions and 32 deletions
+5
View File
@@ -253,6 +253,11 @@ INNER JOIN zt_project AS t2 ON t1.`project` = t2.`id`
SET t1.`addedDate` = t2.`openedDate`, t1.`addedBy` = t2.`openedBy`
WHERE t1.`type` = 'project' AND t1.`main` = '1';
UPDATE zt_doc AS t1
INNER JOIN zt_project AS t2 ON t1.`execution` = t2.`id`
SET t1.`project` = t2.`project`
WHERE t1.`execution` != '0' AND t1.`project` = '0';
/* Update the execution master library. */
UPDATE zt_doclib AS t1
INNER JOIN zt_project AS t2 ON t1.`execution` = t2.`id`
@@ -28,7 +28,7 @@
<?php if(empty($docList)):?>
<div class='table-empty-tip'><p><span class='text-muted'><?php echo $lang->doc->noDoc;?></p></span></div>
<?php else:?>
<div class="doc-list">
<div class="doc-list table-row">
<?php $rank = 1;?>
<?php foreach($docList as $doc):?>
<div class='doc-title'>
+1 -1
View File
@@ -27,7 +27,7 @@
<?php if(empty($docList)):?>
<div class='table-empty-tip'><p><span class='text-muted'><?php echo $lang->doc->noDoc;?></p></span></div>
<?php else:?>
<div class="doc-list">
<div class="doc-list table-row">
<?php $rank = 1;?>
<?php foreach($docList as $doc):?>
<div class='doc-title'>
+12 -10
View File
@@ -328,7 +328,7 @@ class doc extends control
* @access public
* @return void
*/
public function deleteLib($libID, $confirm = 'no', $type = 'lib', $from = 'tableContents')
public function deleteLib($libID, $confirm = 'no', $type = 'lib', $from = 'teamSpace')
{
if($libID == 'product' or $libID == 'execution') return;
if($confirm == 'no')
@@ -341,16 +341,18 @@ class doc extends control
if(!empty($lib->main)) return print(js::alert($this->lang->doc->errorMainSysLib));
$this->doc->delete(TABLE_DOCLIB, $libID);
if($this->app->tab == 'doc' and $from == 'tableContents') return print(js::reload('parent'));
if($this->app->tab == 'doc' and $from == 'teamSpace') return print(js::reload('parent'));
$objectType = $lib->type;
$objectID = strpos(',product,project,execution,', ",$objectType,") !== false ? $lib->{$objectType} : 0;
if(in_array($this->app->tab, array('project', 'doc')) and $objectType == 'execution')
$moduleName = 'doc';
$methodName = zget($this->config->doc->spaceMethod, $objectType);
if($this->app->tab == 'execution' and $objectType == 'execution')
{
$objectType = 'project';
$objectID = $lib->project;
$moduleName = 'execution';
$methodName = 'doc';
}
$browseLink = $this->createLink('doc', $from, "type=$objectType&objectID=$objectID");
$browseLink = $this->createLink($moduleName, $methodName, "objectID=$objectID");
return print(js::locate($browseLink, 'parent'));
}
@@ -1052,7 +1054,7 @@ class doc extends control
if(empty($viewType)) $viewType = !empty($_COOKIE['docFilesViewType']) ? $this->cookie->docFilesViewType : 'list';
setcookie('docFilesViewType', $viewType, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$objects = $this->doc->getOrderedObjects($type);
$objects = $this->doc->getOrderedObjects($type, 'nomerge', $objectID);
list($libs, $libID, $object, $objectID, $objectDropdown) = $this->doc->setMenuByType($type, $objectID, 0);
$table = $this->config->objectTables[$type];
@@ -1143,8 +1145,6 @@ class doc extends control
$objectID = zget($doc, $type, 0);
list($libs, $libID, $object, $objectID, $objectDropdown) = $this->doc->setMenuByType($type, $objectID, $doc->lib, $appendLib);
$moduleTree = $this->doc->getTreeMenu($type, $objectID, $libID, 0, $docID);
/* Get doc. */
if($docID)
{
@@ -1221,6 +1221,8 @@ class doc extends control
}
}
if($this->app->tab != 'execution' and !empty($doc->execution)) $object = $this->execution->getByID($doc->execution);
$this->view->title = $this->lang->doc->common . $this->lang->colon . $doc->title;
$this->view->docID = $docID;
$this->view->doc = $doc;
@@ -1471,7 +1473,7 @@ class doc extends control
*/
public function ajaxGetDropMenu($objectType, $objectID, $module, $method)
{
list($myObjects, $normalObjects, $closedObjects) = $this->doc->getOrderedObjects($objectType, 'nomerge');
list($myObjects, $normalObjects, $closedObjects) = $this->doc->getOrderedObjects($objectType, 'nomerge', $objectID);
$this->view->objectType = $objectType;
$this->view->objectID = $objectID;
+1 -1
View File
@@ -46,7 +46,7 @@ span.dotted-line+a {display: block;}
.is-sorting > li ul {display: none!important;}
li.drag-shadow ul {display: none!important;}
.table .c-name > .doc-title {display: inline-block; overflow: hidden; background: transparent; padding-right:0px;}
.table .c-name > .doc-title {display: inline-block; overflow: hidden; background: transparent; padding-right:0px; max-width: calc(100% - 40px);}
.table .c-name > span.doc-title {line-height: 0; vertical-align: inherit;}
.table .c-name[data-status=draft] > .doc-title {max-width: calc(100% - 80px);}
.table .c-name > .draft {background-color:rgba(129, 102, 238, 0.12); color:#8166EE;}
+1 -1
View File
@@ -79,7 +79,7 @@
#hostory::-moz-scrollbar {height: 0px; width: 0px; background: transparent;}
.main-col iframe {min-height: unset;}
#editorBox > .btn-group.noDropdown {top: 6px; overflow: hidden;}
#editorBox > .btn-group.noDropdown {top: 2px; overflow: hidden;}
#editorBox > .btn-group > button {margin: 2px 12px 0 4px; color: #838A9D;}
#editorBox > .btn-group > span.text {color: #838A9D; font-weight: 400; padding: 5px 12px; overflow: hidden; text-overflow: clip; white-space: nowrap; font-size: 13px;}
#editorMenu {max-height: 200px; overflow-y: auto; overflow-x: hidden; margin-left: 4px; max-width: 100%;}
+11 -5
View File
@@ -1678,15 +1678,17 @@ class docModel extends model
*
* @param string $objectType
* @param string $returnType nomerge|merge
* @param int $append
* @access public
* @return array
*/
public function getOrderedObjects($objectType = 'product', $returnType = 'merge')
public function getOrderedObjects($objectType = 'product', $returnType = 'merge', $append = 0)
{
$myObjects = $normalObjects = $closedObjects = array();
if($objectType == 'product')
{
$products = $this->loadModel('product')->getList();
if($append and !isset($products[$append])) $products[$append] = $this->product->getByID($append);
foreach($products as $id => $product)
{
if($product->status == 'normal' and $product->PO == $this->app->user->account)
@@ -1718,8 +1720,9 @@ class docModel extends model
->leftjoin(TABLE_DOCLIB)->alias('t2')->on('t2.project=t1.id')
->where("CONCAT(',', t2.users, ',')")->like("%,{$this->app->user->account},%")
->andWhere('t1.vision')->eq($this->config->vision)
->beginIF($this->config->vision == 'rnd')->andWhere('model')->ne('kanban')->fi()
->andWhere('t1.deleted')->eq(0)
->beginIF($this->config->vision == 'rnd')->andWhere('model')->ne('kanban')->fi()
->beginIF($append)->orWhere('t1.id')->eq($append)->fi()
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->projects)->fi()
->fetchPairs();
}
@@ -1730,6 +1733,7 @@ class docModel extends model
->andWhere('deleted')->eq(0)
->beginIF($this->config->vision == 'rnd')->andWhere('model')->ne('kanban')->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
->beginIF($append)->orWhere('id')->eq($append)->fi()
->orderBy('order_asc')
->fetchAll('id');
@@ -1766,6 +1770,7 @@ class docModel extends model
->andWhere('multiple')->eq('1')
->andWhere('vision')->eq($this->config->vision)
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi()
->beginIF($append)->orWhere('id')->eq($append)->fi()
->orderBy('order_asc')
->fetchAll('id');
@@ -2774,10 +2779,11 @@ class docModel extends model
if($this->app->tab == 'doc' and $type == 'execution') $type = 'project';
$objectDropdown = '';
$appendObject = $objectID;
if(in_array($type, array('project', 'product', 'execution')))
{
$table = $this->config->objectTables[$type];
$object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch();
$object = $this->dao->select('id,name,status,deleted')->from($table)->where('id')->eq($objectID)->fetch();
if(empty($object))
{
@@ -2786,7 +2792,7 @@ class docModel extends model
return print(js::locate(helper::createLink($type, $methodName, $param)));
}
$objects = $this->getOrderedObjects($type);
$objects = $this->getOrderedObjects($type, 'merge', $objectID);
$objectID = $this->loadModel($type)->saveState($objectID, $objects);
$libs = $this->getLibsByObject($type, $objectID, '', $appendLib);
if(($libID == 0 or !isset($libs[$libID])) and !empty($libs)) $libID = reset($libs)->id;
@@ -2799,7 +2805,7 @@ class docModel extends model
}
else
{
$objectDropdown = $this->select($type, $objectTitle, $objectID);
$objectDropdown = $this->select($type, $objectTitle, $appendObject);
}
}
else
+7 -7
View File
@@ -12,21 +12,21 @@
/* css for tree */
#fileTree .title {font-size: 16px; height: 20px; margin-top: 5px; margin-bottom: 5px;}
.tree li.has-list.open:before {content: unset;}
.tree li > a {max-width: 100%; padding: 2px;}
#fileTree .tree li.has-list.open:before {content: unset;}
#fileTree .tree li > a {max-width: 100%; padding: 2px;}
.file-tree a {height: 30px;}
.flex-between {display: flex; align-items: center; justify-content: space-between;}
.flex-center {display: flex; align-items: center; justify-content: center;}
.flex-start {display: flex; align-items: center;}
.tree li > .list-toggle {top: 4px;}
#fileTree .tree li > .list-toggle {top: 4px;}
.input-tree {width: 120px;}
.tree-icon {position: absolute; right: 0;}
.tree li.has-input {overflow: hidden;}
.tree li.has-input > input.input-bro {margin-left: 15px;}
#fileTree .tree li.has-input {overflow: hidden;}
#fileTree .tree li.has-input > input.input-bro {margin-left: 15px;}
.img-lib {flex: 0 0 14px; height: 14px; margin-right: 5px; margin-bottom: 2px;}
.file-icon {width: 14px; margin-bottom: 4px;}
.tree-icon {position: absolute; right: 0;}
.tree li > a {max-width: 100%; padding: 2px;}
#fileTree .tree li > a {max-width: 100%; padding: 2px;}
.file-tree a.show-icon > div,
.file-tree a.hover > div {padding-right: 15px;}
.tree-text {overflow: hidden; min-width: 50px;}
@@ -497,7 +497,7 @@ $(function()
if(['mine', 'view', 'collect', 'createdby', 'editedby'].indexOf(objectType) !== -1)
{
type = ['view', 'collect', 'createdby', 'editedby'].indexOf(type.toLowerCase()) !== -1 ? type.toLowerCase() : 'mine';
linkParams = 'type=' + type + '&' + linkParams;
linkParams = 'type=' + type + '&libID=' + libID + '&moduleID=' + moduleID;
}
if(type == 'apiDoc') linkParams = linkParams.replace('browseType=&', 'browseType=byrelease&').replace('param=0', 'param=<?php echo isset($release) ? $release : 0;?>');
}
+1 -1
View File
@@ -17,7 +17,7 @@ body {margin-bottom: 25px;}
#docListForm th.c-actions {width: 84px; padding-left: 15px;}
#docListForm .c-module, #docListForm .c-object {width: 120px; overflow: hidden; white-space: nowrap; text-overflow: clip;}
#docListForm .c-object {width: 180px;}
#docListForm .table .c-name > .doc-title {display: inline-block; overflow: hidden; background: transparent; padding-right:0px;}
#docListForm .table .c-name > .doc-title {display: inline-block; overflow: hidden; background: transparent; padding-right:0px; max-width: calc(100% - 40px);}
#docListForm .table .c-name > span.doc-title {line-height: 0; vertical-align: inherit;}
#docListForm .table .c-name[data-status=draft] > .doc-title {max-width: calc(100% - 80px);}
#docListForm .table .c-name > .draft {background-color:rgba(129, 102, 238, 0.12); color:#8166EE;}
+1 -1
View File
@@ -23,7 +23,7 @@
<?php foreach($lang->doc->featureBar['tableContents'] as $barType => $barName):?>
<?php $active = $barType == $browseType ? 'btn-active-text' : '';?>
<?php $linkParams = "objectID=$objectID&libID=$libID&moduleID=$moduleID&browseType=$barType";?>
<?php echo html::a($this->createLink('doc', $app->rawMethod, $linkParams), "<span class='text'>{$barName}</span>" . ($active ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>" : ''), '', "class='btn btn-link $active' id='{$barType}Tab'");?>
<?php echo html::a($this->createLink($app->rawModule, $app->rawMethod, $linkParams), "<span class='text'>{$barName}</span>" . ($active ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>" : ''), '', "class='btn btn-link $active' id='{$barType}Tab'");?>
<?php endforeach;?>
<?php endif;?>
<a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->doc->searchDoc;?></a>
+5 -1
View File
@@ -27,20 +27,24 @@
<?php $gobackLink = $this->session->docList ? $this->session->docList : inlink('teamSpace', "objectID=0&libID=$libID");?>
<?php echo html::a($gobackLink, "<i class='icon-back'></i> " . $lang->goback, '', "class='btn btn-link'");?>
</div>
<?php if(empty($object->deleted)):?>
<div class="btn-toolbar pull-right">
<?php
if($canExport) echo html::a($this->createLink('doc', $exportMethod, "libID=$libID&moduleID=0&docID=$docID"), "<i class='icon-export muted'> </i>" . $lang->export, 'hiddenwin', "class='btn btn-link' id='docExport'");
if(common::hasPriv('api', 'createLib')) echo html::a($this->createLink('api', 'createLib', "type=" . ($objectType ? $objectType : 'nolink') . "&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
if(common::hasPriv('doc', 'createLib')) echo html::a($this->createLink('doc', 'createLib', "type=" . ($objectType ? $objectType : 'nolink') . "&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
if(common::hasPriv('doc', 'create')) echo $this->doc->printCreateBtn($lib, $moduleID);
?>
</div>
<?php endif;?>
</div>
<div id='mainContent'class="fade flex">
<?php if($libID):?>
<?php if(empty($object->deleted)):?>
<div id='sideBar' class="panel side side-col col overflow-auto h-full-adjust">
<?php include 'lefttree.html.php';?>
</div>
<div class="sidebar-toggle flex-center"><i class="icon icon-angle-left"></i></div>
<?php endif;?>
<div class="main-col h-full-adjust" data-min-width="400">
<?php if($docID):?>
<?php include './content.html.php';?>
+2 -1
View File
@@ -5,7 +5,8 @@ body {margin-bottom: 25px;}
#docList th.c-user {width: 80px;}
#docList th.c-actions {width: 84px; padding-left: 15px;}
#docList .c-object {width: 180px; overflow: hidden; white-space: nowrap; text-overflow: clip;}
#docList.table .c-name > .doc-title {display: inline-block; max-width: calc(100% - 80px); overflow: hidden; background: transparent; padding-right:0px;}
#docList.table .c-name > .doc-title {display: inline-block; max-width: calc(100% - 40px); overflow: hidden; background: transparent; padding-right:0px;}
#docList.table .c-name[data-status=draft] > .doc-title {max-width: calc(100% - 80px);}
#docList.table .c-name > span.doc-title {line-height: 0; vertical-align: inherit;}
#docList.table .c-name > .draft {background-color:rgba(129, 102, 238, 0.12); color:#8166EE;}
#docList .btn {padding: 0 2px;}
+1 -1
View File
@@ -58,7 +58,7 @@
<?php $collectTitle = strpos($doc->collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?>
<tr>
<td class="c-id"><?php echo $doc->id;?></td>
<td class="c-name" title='<?php echo $doc->title;?>'>
<td class="c-name" title='<?php echo $doc->title;?>' data-status='<?php echo $doc->status;?>'>
<?php
$docType = $doc->type == 'text' ? 'wiki-file' : $doc->type;
$icon = html::image("static/svg/{$docType}.svg", "class='file-icon'");
+4
View File
@@ -133,6 +133,10 @@ class projectModel extends model
$this->session->set('project', key($projects), $this->app->tab);
$this->accessDenied();
}
else
{
$this->session->set('project', key($projects), $this->app->tab);
}
}
return $this->session->project;
+2 -1
View File
@@ -9081,7 +9081,8 @@ class upgradeModel extends model
$fieldName = $field->Field;
$fields[$fieldName] = $fieldName;
}
if(!isset($fields['collector'])) return true;
if(!isset($fields['collector']) or isset($fields['collects'])) return true;
$this->loadModel('doc');