+ Add version for doc view.

This commit is contained in:
zhujinyong
2021-04-04 08:07:24 +08:00
parent 30ac187e82
commit f01dbe2537
5 changed files with 30 additions and 11 deletions
+4 -2
View File
@@ -904,10 +904,11 @@ class doc extends control
* @param int $objectID projectID|productID
* @param int $libID
* @param int $docID
* @param int $version
* @access public
* @return void
*/
public function objectLibs($type, $objectID = 0, $libID = 0, $docID = 0)
public function objectLibs($type, $objectID = 0, $libID = 0, $docID = 0, $version = 0)
{
$this->session->set('docList', $this->app->getURI(true), 'doc');
@@ -982,7 +983,7 @@ class doc extends control
/* Get doc. */
if($docID)
{
$doc = $this->doc->getById($docID, 0, true);
$doc = $this->doc->getById($docID, $version, true);
if(!$doc) die(js::error($this->lang->notFound) . js::locate('back'));
if($doc->contentType == 'markdown')
@@ -1002,6 +1003,7 @@ class doc extends control
$this->view->docID = $docID;
$this->view->doc = $docID ? $doc : '';
$this->view->type = $type;
$this->view->version = $version;
$this->view->object = $object;
$this->view->objectType = $type;
$this->view->libID = $libID;
+3 -1
View File
@@ -9,8 +9,10 @@
.side-col .action a {margin: 0 auto 3px; display: block; max-width: 200px;}
.side-col .tips {padding: 0 10px;}
.main-col .doc-title {display: flex; font-size: 16px; margin-bottom: 15px;}
.main-col .doc-title .title {margin-right: 10px; line-height: 32px;}
.main-col .doc-title .title {margin-right: 10px; line-height: 32px; font-size: 25px;}
.main-col .doc-title .info {flex: 1 1 0;}
.main-col .doc-title .version a {font-size: 13px; color: #8c8c8c;}
.main-col .doc-title .version .dropdown-menu a:hover {color: #ffffff;}
.main-col .doc-title .actions a {margin-right: 8px;}
.main-col .doc-title .actions i {font-size: 15px; color: #8c8c8c;}
#sidebar {width: 275px;}
+16 -1
View File
@@ -6,7 +6,22 @@
<div class="detail-title no-padding doc-title">
<div class="title"><?php echo $doc->title;?></div>
<div class="info">
<div class="version"></div>
<div class="version">
<div class='btn-group'>
<a href='javascript:;' class='btn btn-link btn-limit text-ellipsis' data-toggle='dropdown' style="max-width: 120px;">
#<?php echo $version ? $version : $doc->version;?>
<span class="caret"></span>
</a>
<ul class='dropdown-menu' style='max-height:240px; max-width: 300px; overflow-y:auto'>
<?php
for($version = $doc->version; $version > 0; $version--)
{
echo "<li>" . html::a($this->createLink('doc', 'objectLibs', "type=$objectType&objectID=$object->id&libID=$libID&docID=$doc->id&version=$version"), '#' . $version) . "</li>";
}
?>
</ul>
</div>
</div>
<div class="user"></div>
<div class="time"></div>
</div>
+6 -6
View File
@@ -36,8 +36,8 @@
</thead>
<tbody>
<?php foreach($latestEditedDocs as $doc):?>
<tr data-url="<?php echo $this->createLink('doc', 'view', "docID={$doc->id}");?>">
<td class="c-name" title="<?php echo $doc->title?>"><?php echo $doc->title;?></td>
<tr>
<td class="c-name"><?php echo html::a($this->createLink('doc', 'view', "docID={$doc->id}", '', true), $doc->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'")?></a></td>
<td class="c-num text-right"><?php echo $doc->fileSize ? $doc->fileSize : '-';?></td>
<td class="c-user"><?php echo zget($users, $doc->addedBy);?></td>
<td class="c-datetime"><?php echo helper::isZeroDate($doc->editedDate) ? formatTime($doc->addedDate, 'Y-m-d') : formatTime($doc->editedDate, 'Y-m-d');?></td>
@@ -142,8 +142,8 @@
</thead>
<tbody>
<?php foreach($myDocs as $doc):?>
<tr data-url="<?php echo $this->createLink('doc', 'view', "docID={$doc->id}");?>">
<td class="c-name" title="<?php echo $doc->title;?>"><?php echo $doc->title;?></td>
<tr>
<td class="c-name"><?php echo html::a($this->createLink('doc', 'view', "docID={$doc->id}", '', true), $doc->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'")?></a></td>
<td class="c-num text-right"><?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->editedDate) ? formatTime($doc->editedDate, 'Y-m-d') : formatTime($doc->addedDate, 'y-m-d');?></td>
@@ -173,8 +173,8 @@
</thead>
<tbody>
<?php foreach($collectedDocs as $doc):?>
<tr data-url="<?php echo $this->createLink('doc', 'view', "docID={$doc->id}");?>">
<td class="c-name" title="<?php echo $doc->title;?>"><?php echo $doc->title;?></td>
<tr>
<td class="c-name"><?php echo html::a($this->createLink('doc', 'view', "docID={$doc->id}", '', true), $doc->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'")?></a></td>
<td class="c-user"><?php echo zget($users, $doc->addedBy);?></td>
<td class="c-datetime"><?php echo formatTime($doc->editedDate) ? formatTime($doc->editedDate, 'Y-m-d') : formatTime($doc->addedDate, 'y-m-d');?></td>
</tr>
+1 -1
View File
@@ -14,7 +14,7 @@
<?php if($app->openApp == 'execution'):;?>
<style>.panel-body{min-height: 180px}</style>
<?php endif;?>
<div class="fade main-row <?php if($app->openApp == 'doc') echo 'split-row';?>" id="mainRow">
<div class="fade main-row split-row" id="mainRow">
<?php if($libID):?>
<?php include './side.html.php';?>
<div class="main-col" data-min-width="400">