mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 18:21:39 +09:00
Fix point for attached files when updating document
This commit is contained in:
parent
dafbfadc93
commit
87648f49d4
2 changed files with 16 additions and 0 deletions
|
|
@ -33,6 +33,7 @@ class point extends ModuleObject
|
||||||
array('document.updateDocument', 'before', 'controller', 'triggerUpdateDocument'),
|
array('document.updateDocument', 'before', 'controller', 'triggerUpdateDocument'),
|
||||||
array('document.deleteDocument', 'after', 'controller', 'triggerDeleteDocument'),
|
array('document.deleteDocument', 'after', 'controller', 'triggerDeleteDocument'),
|
||||||
array('comment.insertComment', 'after', 'controller', 'triggerInsertComment'),
|
array('comment.insertComment', 'after', 'controller', 'triggerInsertComment'),
|
||||||
|
array('comment.updateComment', 'after', 'controller', 'triggerUpdateComment'),
|
||||||
array('comment.deleteComment', 'after', 'controller', 'triggerDeleteComment'),
|
array('comment.deleteComment', 'after', 'controller', 'triggerDeleteComment'),
|
||||||
array('file.deleteFile', 'after', 'controller', 'triggerDeleteFile'),
|
array('file.deleteFile', 'after', 'controller', 'triggerDeleteFile'),
|
||||||
array('file.downloadFile', 'before', 'controller', 'triggerBeforeDownloadFile'),
|
array('file.downloadFile', 'before', 'controller', 'triggerBeforeDownloadFile'),
|
||||||
|
|
|
||||||
|
|
@ -146,6 +146,13 @@ class pointController extends point
|
||||||
// Only give points if the document is being updated from TEMP to another status such as PUBLIC.
|
// Only give points if the document is being updated from TEMP to another status such as PUBLIC.
|
||||||
if ($obj->status === $oDocumentModel->getConfigStatus('temp') || $oDocument->get('status') !== $oDocumentModel->getConfigStatus('temp'))
|
if ($obj->status === $oDocumentModel->getConfigStatus('temp') || $oDocument->get('status') !== $oDocumentModel->getConfigStatus('temp'))
|
||||||
{
|
{
|
||||||
|
if ($obj->uploaded_count > $oDocument->get('uploaded_count'))
|
||||||
|
{
|
||||||
|
$cur_point = getModel('point')->getPoint($member_srl, true);
|
||||||
|
$attached_files_point = $this->_getModulePointConfig($module_srl, 'upload_file');
|
||||||
|
$cur_point += $attached_files_point * ($obj->uploaded_count - $oDocument->get('uploaded_count'));
|
||||||
|
$this->setPoint($member_srl, $cur_point);
|
||||||
|
}
|
||||||
return new Object();
|
return new Object();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -258,6 +265,14 @@ class pointController extends point
|
||||||
return new Object();
|
return new Object();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief A trigger which gives points for uploaded file changes to a comment
|
||||||
|
*/
|
||||||
|
public function triggerUpdateComment($obj)
|
||||||
|
{
|
||||||
|
return new Object();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief A trigger which gives points for deleting a comment
|
* @brief A trigger which gives points for deleting a comment
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue