* Code for task#81779.

This commit is contained in:
xieqiyu
2023-01-03 17:36:33 +08:00
parent 62070301f4
commit bc620ef34d
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -369,7 +369,7 @@ if($this->app->tab == 'project') js::set('objectID', $projectID);
<?php
if($caseID)
{
echo $this->fetch('file', 'printFiles', array('files' => $caseFiles, 'fieldset' => 'false', 'object' => null, 'method' => 'edit'));
echo $this->fetch('file', 'printFiles', array('files' => $caseFiles, 'fieldset' => 'false', 'object' => null, 'method' => 'edit', 'showDelete' => true, 'showEdit' => false));
echo html::hidden('caseFiles', implode(',', array_keys($caseFiles)));
}
?>
+3 -1
View File
@@ -293,16 +293,18 @@ class file extends control
* @param object $object
* @param string $method
* @param bool $showDelete
* @param bool $showEdit
* @access public
* @return void
*/
public function printFiles($files, $fieldset, $object = null, $method = 'view', $showDelete = true)
public function printFiles($files, $fieldset, $object = null, $method = 'view', $showDelete = true, $showEdit = true)
{
$this->view->files = $files;
$this->view->fieldset = $fieldset;
$this->view->object = $object;
$this->view->method = $method;
$this->view->showDelete = $showDelete;
$this->view->showEdit = $showEdit;
if(strpos('view,edit', $method) !== false and $this->app->clientDevice != 'mobile') return $this->display('file', 'viewfiles');
$this->display();
+1 -1
View File
@@ -220,7 +220,7 @@ function setFileName(fileID)
common::printLink('file', 'download', "fileID=$file->id", "<i class='icon icon-download'></i>", '_blank', "class='fileAction btn btn-link text-primary' title='{$lang->file->downloadFile}'");
if(common::hasPriv($objectType, 'edit', $object))
{
if(common::hasPriv('file', 'edit')) echo html::a('###', "<i class='icon icon-pencil-alt'></i>", '', "id='renameFile$file->id' class='fileAction btn btn-link edit text-primary' onclick='showRenameBox($file->id)' title='{$lang->file->edit}'");
if($showEdit and common::hasPriv('file', 'edit')) echo html::a('###', "<i class='icon icon-pencil-alt'></i>", '', "id='renameFile$file->id' class='fileAction btn btn-link edit text-primary' onclick='showRenameBox($file->id)' title='{$lang->file->edit}'");
if($showDelete and common::hasPriv('file', 'delete')) echo html::a('###', "<i class='icon icon-trash'></i>", '', "class='fileAction btn btn-link text-primary' onclick='deleteFile($file->id, this)' title='$lang->delete'");
}
echo '</span>';