Merge branch 'cyy_fixbug' into 'master'

* Add edited by me doc list.

See merge request easycorp/zentaopms!7421
This commit is contained in:
王怡栋
2023-04-14 07:49:35 +00:00
10 changed files with 38 additions and 8 deletions

View File

@@ -63,6 +63,7 @@ class doc extends control
if(empty($orderBy) and $type == 'mine') $orderBy = 'status,editedDate_desc';
if(empty($orderBy) and ($type == 'view' or $type == 'collect')) $orderBy = 'status,date_desc';
if(empty($orderBy) and ($type == 'createdby')) $orderBy = 'status,addedDate_desc';
if(empty($orderBy) and ($type == 'editedby')) $orderBy = 'status,editedDate_desc';
/* Save session, load module. */
$uri = $this->app->getURI(true);
@@ -81,13 +82,14 @@ class doc extends control
if($type == 'view') $objectTitle = $this->lang->doc->myView;
if($type == 'collect') $objectTitle = $this->lang->doc->myCollection;
if($type == 'createdby') $objectTitle = $this->lang->doc->myCreation;
if($type == 'editedby') $objectTitle = $this->lang->doc->myEdited;
if($objectTitle) $objectDropdown = "<div id='sidebarHeader'><div class='title' title='{$objectTitle}'>{$objectTitle}</div></div>";
}
/* Build the search form. */
$queryID = $browseType == 'bysearch' ? (int)$param : 0;
$params = "libID=$libID&moduleID=$moduleID&browseType=bySearch&param=myQueryID&orderBy=$orderBy";
if($this->app->rawMethod == 'myspace') $params = "type=$type&" . $params;
if($this->app->rawMethod == 'myspace') $params = "type=$type&$params";
$actionURL = $this->createLink('doc', $this->app->rawMethod, $params);
$this->doc->buildSearchForm($libID, $libs, $queryID, $actionURL, $type);
@@ -110,7 +112,7 @@ class doc extends control
$docs = $browseType == 'bysearch' ? $this->doc->getDocsBySearch('mine', 0, $libID, $queryID, $orderBy, $pager) : $this->doc->getDocs($libID, $moduleID, $browseType, $orderBy, $pager);
}
}
elseif($type == 'view' or $type == 'collect' or $type == 'createdby')
elseif($type == 'view' or $type == 'collect' or $type == 'createdby' or $type == 'editedby')
{
$docs = $this->doc->getMineList($type, $browseType, $orderBy, $pager, $queryID);
}

View File

@@ -21,7 +21,7 @@
.main-col iframe {min-height: 380px;}
.article-content {margin-top: 0px}
.article-content .info {margin-bottom: 15px; width:100%; overflow:hidden;}
.article-content .info .user-time{margin-right: 16px}
.article-content .info .user-time{margin-right: 4px}
.article-content .info .keywords .label {padding-right:8px; padding-left:8px; color:#18A6FD; border-color:rgba(24, 166, 253, 0.25); height:22px; line-height:14px; margin-right:4px;}
.article-content {width: 100%; display: inline-block;}

View File

@@ -141,6 +141,7 @@ $lang->doc->myDoc = 'Meine Dokumente';
$lang->doc->myView = 'Recently Viewed';
$lang->doc->myCollection = 'Meine Favoriten';
$lang->doc->myCreation = 'Created By';
$lang->doc->myEdited = 'Edited By';
$lang->doc->myLib = 'My Library';
$lang->doc->tableContents = 'Catalog';
$lang->doc->addCatalog = 'Add Catalog';

View File

@@ -141,6 +141,7 @@ $lang->doc->myDoc = 'My Documents';
$lang->doc->myView = 'Recently Viewed';
$lang->doc->myCollection = 'My Favorites';
$lang->doc->myCreation = 'Created By';
$lang->doc->myEdited = 'Edited By';
$lang->doc->myLib = 'My Library';
$lang->doc->tableContents = 'Directory';
$lang->doc->addCatalog = 'Add Catalog';

View File

@@ -141,6 +141,7 @@ $lang->doc->myDoc = 'Mes Documents';
$lang->doc->myView = 'Recently Viewed';
$lang->doc->myCollection = 'Mes Favoris';
$lang->doc->myCreation = 'Created By';
$lang->doc->myEdited = 'Edited By';
$lang->doc->myLib = 'My Library';
$lang->doc->tableContents = 'Catalog';
$lang->doc->addCatalog = 'Add Catalog';

View File

@@ -141,6 +141,7 @@ $lang->doc->myDoc = '我的文档';
$lang->doc->myView = '最近浏览';
$lang->doc->myCollection = '我的收藏';
$lang->doc->myCreation = '我创建的';
$lang->doc->myEdited = '我编辑的';
$lang->doc->myLib = '我的个人库';
$lang->doc->tableContents = '目录';
$lang->doc->addCatalog = '添加目录';

View File

@@ -657,13 +657,26 @@ class docModel extends model
->page($pager, 't1.id')
->fetchAll('id');
}
elseif($type == 'createdby')
elseif($type == 'createdby' || $type == 'editedby')
{
$docIDList = array_keys($docIDList);
if($type == 'editedby')
{
$editDocs = $this->dao->select('objectID')->from(TABLE_ACTION)
->where('objectType')->eq('doc')
->andWhere('action')->eq('edited')
->andWhere('actor')->eq($this->app->user->account)
->andWhere('vision')->eq($this->config->vision)
->fetchPairs();
$docIDList = array_intersect($docIDList, $editDocs);
}
$docs = $this->dao->select('t1.*,t2.name as libName,t2.type as objectType')->from(TABLE_DOC)->alias('t1')
->leftJoin(TABLE_DOCLIB)->alias('t2')->on("t1.lib=t2.id")
->where('t1.deleted')->eq(0)
->andWhere('t1.lib')->ne('')
->andWhere('t1.id')->in(array_keys($docIDList))
->andWhere('t1.id')->in($docIDList)
->andWhere('t1.vision')->eq($this->config->vision)
->andWhere('t1.addedBy')->eq($this->app->user->account)
->beginIF(!common::hasPriv('doc', 'productSpace'))->andWhere('t2.type')->ne('product')->fi()
@@ -3119,6 +3132,15 @@ class docModel extends model
$myCreation->hasAction = false;
$myCreation->active = $libType == 'createdby' ? 1 : 0;
$myCreation = new stdclass();
$myCreation->id = 0;
$myCreation->name = $this->lang->doc->myEdited;
$myCreation->type = 'editedBy';
$myCreation->objectType = 'doc';
$myCreation->objectID = 0;
$myCreation->hasAction = false;
$myCreation->active = $libType == 'editedby' ? 1 : 0;
$libTree = array();
$libTree[] = $myLib;
if(common::hasPriv('doc', 'myView')) $libTree[] = $myView;

View File

@@ -73,7 +73,8 @@
<div class="">
<div class="detail-content article-content table-col">
<div class='info'>
<span class='user-time text-muted'><i class='icon icon-account'></i> <?php echo zget($users, $doc->editedBy) . " {$lang->colon} " . substr($doc->editedDate, 0, 10) . (common::checkNotCN() ? ' ' : '') . $lang->doc->update;?></span>
<span class='user-time text-muted'><i class='icon icon-contacts'></i> <?php echo zget($users, $doc->addedBy) . " {$lang->colon} " . substr($doc->addedDate, 0, 10) . (common::checkNotCN() ? ' ' : '') . $lang->doc->createAB;?></span>
<span class='user-time text-muted'><i class='icon icon-eye'></i> <?php echo $doc->views;?></span>
<?php if($doc->keywords):?>
<span class='keywords'>
<?php foreach($doc->keywords as $keywords):?>

View File

@@ -463,9 +463,9 @@ $(function()
else
{
methodName = spaceMethod[objectType] ? spaceMethod[objectType] : 'teamSpace';
if(['mine', 'view', 'collect', 'createdby'].indexOf(objectType) !== -1)
if(['mine', 'view', 'collect', 'createdby', 'editedby'].indexOf(objectType) !== -1)
{
type = ['view', 'collect', 'createdby'].indexOf(type.toLowerCase()) !== -1 ? type.toLowerCase() : 'mine';
type = ['view', 'collect', 'createdby', 'editedby'].indexOf(type.toLowerCase()) !== -1 ? type.toLowerCase() : 'mine';
linkParams = 'type=' + type + '&' + linkParams;
}
}

View File

@@ -30,6 +30,7 @@
<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', 'create')) echo $this->doc->printCreateBtn($lib, $moduleID);
?>
</div>