diff --git a/module/doc/js/view.js b/module/doc/js/view.js index 34edfddc4f..5e9c9cc82e 100644 --- a/module/doc/js/view.js +++ b/module/doc/js/view.js @@ -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) diff --git a/module/doc/view/view.html.php b/module/doc/view/view.html.php index 0d1be15e9d..01ce02b66d 100644 --- a/module/doc/view/view.html.php +++ b/module/doc/view/view.html.php @@ -118,7 +118,7 @@ js::set('docID', $doc->id); id}");?>" alt="title?>"> - ", '', "class='btn-icon' title=\"{$lang->doc->deleteFile}\" onclick='deleteFile($file->id)'");?> + ", '', "class='btn-icon' title=\"{$lang->doc->deleteFile}\" onclick='deleteFile($file->id)'");?> files[$file->id]);?> @@ -213,5 +213,6 @@ js::set('docID', $doc->id);
+ diff --git a/module/repo/model.php b/module/repo/model.php index cf76035b18..58d2ef7dd6 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -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()) {