* finish task #7074.

This commit is contained in:
wangyidong
2020-04-27 14:22:20 +08:00
parent c92500975c
commit 442d70773a
3 changed files with 12 additions and 1 deletions
+8
View File
@@ -40,6 +40,14 @@ $(function()
}
setTimeout($.resetToolbarPosition, 50);
});
if(!canDeleteFile)
{
$('.detail-content .files-list li').each(function()
{
$(this).find('a[onclick^=deleteFile]').remove();
});
}
})
function deleteFile(fileID)
+2 -1
View File
@@ -118,7 +118,7 @@ js::set('docID', $doc->id);
<img onload="setImageSize(this, 0)" src="<?php echo $this->createLink('file', 'read', "fileID={$file->id}");?>" alt="<?php echo $file->title?>">
</a>
<span class='right-icon'>
<?php if(common::hasPriv('file', 'delete')) echo html::a('###', "<i class='icon icon-trash'></i>", '', "class='btn-icon' title=\"{$lang->doc->deleteFile}\" onclick='deleteFile($file->id)'");?>
<?php if(common::hasPriv('doc', 'deleteFile')) echo html::a('###', "<i class='icon icon-trash'></i>", '', "class='btn-icon' title=\"{$lang->doc->deleteFile}\" onclick='deleteFile($file->id)'");?>
</span>
</div>
<?php unset($doc->files[$file->id]);?>
@@ -213,5 +213,6 @@ js::set('docID', $doc->id);
<div id="mainActions" class='main-actions'>
<?php common::printPreAndNext($preAndNext);?>
</div>
<?php js::set('canDeleteFile', common::hasPriv('doc', 'deleteFile'));?>
<?php include '../../common/view/syntaxhighlighter.html.php';?>
<?php include '../../common/view/footer.html.php';?>
+2
View File
@@ -629,6 +629,8 @@ class repoModel extends model
->orderBy('time')
->limit(1)
->fetch();
if(empty($lastBranchLog)) return false;
$stmt = $this->dao->select('*')->from(TABLE_REPOHISTORY)->where('repo')->eq($repoID)->andWhere('time')->lt($lastBranchLog->time)->query();
while($log = $stmt->fetch())
{