mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 04:52:14 +09:00
temp document로 수정할 수 있는 문제 수정
status에 아무거나 입력할 수 없도록 개선
This commit is contained in:
parent
2ca34318e6
commit
aaaf385ce0
1 changed files with 47 additions and 8 deletions
|
|
@ -353,8 +353,9 @@ class documentController extends document
|
||||||
}
|
}
|
||||||
|
|
||||||
// begin transaction
|
// begin transaction
|
||||||
$oDB = &DB::getInstance();
|
$oDB = DB::getInstance();
|
||||||
$oDB->begin();
|
$oDB->begin();
|
||||||
|
|
||||||
// List variables
|
// List variables
|
||||||
if($obj->comment_status) $obj->commentStatus = $obj->comment_status;
|
if($obj->comment_status) $obj->commentStatus = $obj->comment_status;
|
||||||
if(!$obj->commentStatus) $obj->commentStatus = 'DENY';
|
if(!$obj->commentStatus) $obj->commentStatus = 'DENY';
|
||||||
|
|
@ -373,6 +374,19 @@ class documentController extends document
|
||||||
if(!$obj->email_address) $obj->email_address = '';
|
if(!$obj->email_address) $obj->email_address = '';
|
||||||
if(!$isRestore) $obj->ipaddress = $_SERVER['REMOTE_ADDR'];
|
if(!$isRestore) $obj->ipaddress = $_SERVER['REMOTE_ADDR'];
|
||||||
|
|
||||||
|
// Default Status
|
||||||
|
if($obj->status)
|
||||||
|
{
|
||||||
|
if(!in_array($obj->status, $this->getStatusList()))
|
||||||
|
{
|
||||||
|
$obj->status = $this->getDefaultStatus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->_checkDocumentStatusForOldVersion($obj);
|
||||||
|
}
|
||||||
|
|
||||||
// can modify regdate only manager
|
// can modify regdate only manager
|
||||||
$grant = Context::get('grant');
|
$grant = Context::get('grant');
|
||||||
if(!$grant->manager)
|
if(!$grant->manager)
|
||||||
|
|
@ -474,8 +488,8 @@ class documentController extends document
|
||||||
$obj->content = utf8_mbencode($obj->content);
|
$obj->content = utf8_mbencode($obj->content);
|
||||||
|
|
||||||
$obj->lang_code = Context::getLangType();
|
$obj->lang_code = Context::getLangType();
|
||||||
|
|
||||||
// Insert data into the DB
|
// Insert data into the DB
|
||||||
if(!$obj->status) $this->_checkDocumentStatusForOldVersion($obj);
|
|
||||||
$output = executeQuery('document.insertDocument', $obj);
|
$output = executeQuery('document.insertDocument', $obj);
|
||||||
if(!$output->toBool())
|
if(!$output->toBool())
|
||||||
{
|
{
|
||||||
|
|
@ -559,8 +573,24 @@ class documentController extends document
|
||||||
|
|
||||||
if(!$source_obj->document_srl || !$obj->document_srl) return new Object(-1,'msg_invalied_request');
|
if(!$source_obj->document_srl || !$obj->document_srl) return new Object(-1,'msg_invalied_request');
|
||||||
|
|
||||||
if(!$obj->status && $obj->is_secret == 'Y') $obj->status = 'SECRET';
|
// Default Status
|
||||||
if(!$obj->status) $obj->status = 'PUBLIC';
|
if($obj->status)
|
||||||
|
{
|
||||||
|
if(!in_array($obj->status, $this->getStatusList()))
|
||||||
|
{
|
||||||
|
$obj->status = $this->getDefaultStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do not update to temp document (point problem)
|
||||||
|
if($obj->status == $this->getConfigStatus('temp'))
|
||||||
|
{
|
||||||
|
$obj->status = $source_obj->get('status');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->_checkDocumentStatusForOldVersion($obj);
|
||||||
|
}
|
||||||
|
|
||||||
// Call a trigger (before)
|
// Call a trigger (before)
|
||||||
$output = ModuleHandler::triggerCall('document.updateDocument', 'before', $obj);
|
$output = ModuleHandler::triggerCall('document.updateDocument', 'before', $obj);
|
||||||
|
|
@ -2817,8 +2847,17 @@ class documentController extends document
|
||||||
*/
|
*/
|
||||||
function _checkDocumentStatusForOldVersion(&$obj)
|
function _checkDocumentStatusForOldVersion(&$obj)
|
||||||
{
|
{
|
||||||
if(!$obj->status && $obj->is_secret == 'Y') $obj->status = $this->getConfigStatus('secret');
|
if(!$obj->status)
|
||||||
if(!$obj->status && $obj->is_secret != 'Y') $obj->status = $this->getConfigStatus('public');
|
{
|
||||||
|
if($obj->is_secret == 'Y')
|
||||||
|
{
|
||||||
|
$obj->status = $this->getConfigStatus('secret');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$obj->status = $this->getConfigStatus('public');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateUploaedCount($documentSrlList)
|
public function updateUploaedCount($documentSrlList)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue