#242 문서 사용자 정의 필드 설정이 갱신 안 되는 문제 수정.

This commit is contained in:
bnu 2014-01-09 00:29:58 +09:00
parent 35a385d70f
commit 9300b5fa35
3 changed files with 32 additions and 8 deletions

View file

@ -541,12 +541,12 @@ class documentAdminController extends document
$desc = Context::get('desc') ? Context::get('desc') : '';
$search = Context::get('search');
$eid = Context::get('eid');
$obj = new stdClass();
if(!$module_srl || !$name || !$eid) return new Object(-1,'msg_invalid_request');
// set the max value if idx is not specified
if(!$var_idx)
{
$obj = new stdClass();
$obj->module_srl = $module_srl;
$output = executeQuery('document.getDocumentMaxExtraKeyIdx', $obj);
$var_idx = $output->data->var_idx+1;
@ -660,6 +660,14 @@ class documentAdminController extends document
$output = executeQuery('document.updateDocumentExtraVarIdx', $args);
if(!$output->toBool()) return $output;
}
$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
if($oCacheHandler->isSupport())
{
$object_key = 'module_document_extra_keys:'.$module_srl;
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
$oCacheHandler->delete($cache_key);
}
}
/**

View file

@ -844,10 +844,24 @@ class documentController extends document
$obj->eid = $eid;
$output = executeQuery('document.getDocumentExtraKeys', $obj);
if(!$output->data) return executeQuery('document.insertDocumentExtraKey', $obj);
$output = executeQuery('document.updateDocumentExtraKey', $obj);
// Update the extra var(eid)
$output = executeQuery('document.updateDocumentExtraVar', $obj);
if(!$output->data)
{
$output = executeQuery('document.insertDocumentExtraKey', $obj);
}
else
{
$output = executeQuery('document.updateDocumentExtraKey', $obj);
// Update the extra var(eid)
$output = executeQuery('document.updateDocumentExtraVar', $obj);
}
$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
if($oCacheHandler->isSupport())
{
$object_key = 'module_document_extra_keys:'.$module_srl;
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
$oCacheHandler->delete($cache_key);
}
return $output;
}
@ -904,10 +918,12 @@ class documentController extends document
$oDB->commit();
$oCacheHandler = CacheHandler::getInstance('object', null, true);
$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
if($oCacheHandler->isSupport())
{
$oCacheHandler->invalidateGroupKey('site_and_module');
$object_key = 'module_document_extra_keys:'.$module_srl;
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
$oCacheHandler->delete($cache_key);
}
return new Object();

View file

@ -366,7 +366,7 @@ class documentModel extends document
$oCacheHandler = CacheHandler::getInstance('object', null, true);
if($oCacheHandler->isSupport())
{
$object_key = 'module_extra_keys:' . $module_srl;
$object_key = 'module_document_extra_keys:' . $module_srl;
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
$keys = $oCacheHandler->get($cache_key);
}