mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-23 20:32:14 +09:00
When deleting a comment, add to display 'deleted' message.
This commit is contained in:
parent
fc8025759c
commit
228eb1f6c9
5 changed files with 95 additions and 5 deletions
|
|
@ -904,6 +904,48 @@ class commentController extends comment
|
|||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix comment the delete comment message
|
||||
* @param object $obj
|
||||
* @param bool $is_admin
|
||||
* @return object
|
||||
*/
|
||||
function updateCommentByDelete($obj, $is_admin = FALSE)
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
// begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
// If the case manager to delete comments, it indicated that the administrator deleted.
|
||||
if($is_admin === true && $obj->member_srl !== $logged_info->member_srl)
|
||||
{
|
||||
$obj->content = lang('msg_admin_delete_comment');
|
||||
$obj->status = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
$obj->content = lang('msg_delete_comment');
|
||||
}
|
||||
$output = executeQuery('comment.updateCommentByDelete', $obj);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// call a trigger by delete (after)
|
||||
ModuleHandler::triggerCall('comment.updateCommentByDelete', 'after', $obj);
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
$output->add('document_srl', $obj->document_srl);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete comment
|
||||
* @param int $comment_srl
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue