From c7a985ada27937155854dc325effe7d484bac3c0 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 18 Jun 2024 18:03:14 +0800 Subject: [PATCH] * [bug#51324,doing,0.1h] add delete file confirm. --- module/doc/control.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/module/doc/control.php b/module/doc/control.php index 7c32f25218..b70cdcd7d8 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -1018,4 +1018,24 @@ class doc extends control return $this->send(array('result' => 'success')); } } + + /** + * 删除文档附件。 + * Delete file for doc. + * + * @param int $docID + * @param int $fileID + * @param string $confirm + * @access public + * @return void + */ + public function deleteFile(int $docID, int $fileID, string $confirm = 'no') + { + $this->loadModel('file'); + if($confirm == 'no') + { + $formUrl = inlink('deleteFile', "docID={$docID}&fileID={$fileID}&confirm=yes"); + return $this->send(array('result' => 'fail', 'callback' => "zui.Modal.confirm('{$this->lang->file->confirmDelete}').then((res) => {if(res) $.ajaxSubmit({url: '$formUrl'});});")); + } + } }