mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 08:12:17 +09:00
issue 848 when copy document, extra vars, multi lang shoud be copied too
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10308 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
2d755a9620
commit
51c9c66f12
2 changed files with 47 additions and 4 deletions
|
|
@ -183,6 +183,23 @@
|
|||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$extraVarsList = $oDocumentModel->getDocumentExtraVarsFromDB($document_srl_list);
|
||||
$extraVarsListByDocumentSrl = array();
|
||||
if(is_array($extraVarsList->data))
|
||||
{
|
||||
foreach($extraVarsList->data AS $key=>$value)
|
||||
{
|
||||
if(!isset($extraVarsListByDocumentSrl[$value->document_srl]))
|
||||
{
|
||||
$extraVarsListByDocumentSrl[$value->document_srl] = array();
|
||||
}
|
||||
|
||||
//$extraVarsListByDocumentSrl[$value->document_srl]['var_idx'] = $value->var_idx;
|
||||
//$extraVarsListByDocumentSrl[$value->document_srl]['value'] = $value->value;
|
||||
array_push($extraVarsListByDocumentSrl[$value->document_srl], $value);
|
||||
}
|
||||
}
|
||||
|
||||
for($i=count($document_srl_list)-1;$i>=0;$i--) {
|
||||
$document_srl = $document_srl_list[$i];
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
|
|
@ -192,12 +209,13 @@
|
|||
$obj = $oDocument->getObjectVars();
|
||||
if($module_srl == $obj->module_srl)
|
||||
{
|
||||
$extraVars = $oDocument->getExtraVars();
|
||||
//$extraVars = $oDocument->getExtraVars();
|
||||
$extraVars = $extraVarsListByDocumentSrl[$document_srl];
|
||||
if(is_array($extraVars))
|
||||
{
|
||||
foreach($extraVars as $extraItem)
|
||||
{
|
||||
$obj->{'extra_vars'.$extraItem->idx} = $extraItem->value;
|
||||
if($extraItem->var_idx >= 0) $obj->{'extra_vars'.$extraItem->var_idx} = $extraItem->value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -235,6 +253,19 @@
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// copy multi language contents
|
||||
if(is_array($extraVars))
|
||||
{
|
||||
foreach($extraVars AS $key=>$value)
|
||||
{
|
||||
if($value->var_idx < 0)
|
||||
{
|
||||
$oDocumentController->insertDocumentExtraVar($value->module_srl, $obj->document_srl, $value->var_idx, $value->value, $value->eid, $value->lang_code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Move the comments
|
||||
if($oDocument->getCommentCount()) {
|
||||
$oCommentModel = &getModel('comment');
|
||||
|
|
|
|||
|
|
@ -19,6 +19,18 @@
|
|||
return $_SESSION['own_document'][$document_srl];
|
||||
}
|
||||
|
||||
function getDocumentExtraVarsFromDB($documentSrls)
|
||||
{
|
||||
if(!is_array($documentSrls) || count($documentSrls) == 0)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
$args->document_srl = $documentSrls;
|
||||
$output = executeQueryArray('document.getDocumentExtraVars', $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief extra variables for each article will not be processed bulk select and apply the macro city
|
||||
**/
|
||||
|
|
@ -36,8 +48,8 @@
|
|||
// If the document number, return detected
|
||||
if(!count($document_srls)) return;
|
||||
// Expand variables mijijeongdoen article about a current visitor to the extension of the language code, the search variable
|
||||
$obj->document_srl = implode(',',$document_srls);
|
||||
$output = executeQueryArray('document.getDocumentExtraVars', $obj);
|
||||
//$obj->document_srl = implode(',',$document_srls);
|
||||
$output = $this->getDocumentExtraVarsFromDB($document_srls);
|
||||
if($output->toBool() && $output->data) {
|
||||
foreach($output->data as $key => $val) {
|
||||
if(!isset($val->value)) continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue