diff --git a/module/doc/control.php b/module/doc/control.php index 97081581b1..51ceee0946 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -321,12 +321,12 @@ class doc extends control $changes = $this->doc->update($docID); if(dao::isError()) die(js::error(dao::getError())); $files = $this->loadModel('file')->saveUpload('doc', $docID); - if(!empty($changes) or !empty($files)) + if($this->post->comment != '' or !empty($changes) or !empty($files)) { $action = !empty($changes) ? 'Edited' : 'Commented'; $fileAction = ''; if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n" ; - $actionID = $this->action->create('doc', $docID, $action, $fileAction); + $actionID = $this->action->create('doc', $docID, $action, $fileAction . $this->post->comment); $this->action->logHistory($actionID, $changes); } die(js::locate($this->createLink('doc', 'view', "docID=$docID"), 'parent')); diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index e72011f88f..9056f5f9a8 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -18,6 +18,7 @@ $lang->doc->lib = 'Library'; $lang->doc->module = 'Module'; $lang->doc->title = 'Title'; $lang->doc->digest = 'Digest'; +$lang->doc->comment = 'Comment'; $lang->doc->type = 'Type'; $lang->doc->content = 'Content'; $lang->doc->keywords = 'Keywords'; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index d8cee9cd42..367b214535 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -18,6 +18,7 @@ $lang->doc->lib = '所属文档库'; $lang->doc->module = '所属分类'; $lang->doc->title = '文档标题'; $lang->doc->digest = '文档摘要'; +$lang->doc->comment = '文档备注'; $lang->doc->type = '文档类型'; $lang->doc->content = '文档正文'; $lang->doc->keywords = '关键字'; diff --git a/module/doc/model.php b/module/doc/model.php index 6f6d7468c6..27c74ce84d 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -204,7 +204,7 @@ class docModel extends model ->setDefault('module', 0) ->specialChars('title, digest, keywords') ->encodeURL('url') - ->remove('files, labels') + ->remove('comment,files, labels') ->add('editedBy', $this->app->user->account) ->add('editedDate', $now) ->get(); diff --git a/module/doc/view/edit.html.php b/module/doc/view/edit.html.php index 385d3d1052..2cbfa80302 100644 --- a/module/doc/view/edit.html.php +++ b/module/doc/view/edit.html.php @@ -45,10 +45,14 @@ $(document).ready(function()