mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
#495 게시물 관리 '휴지통' 으로 이동 추가
This commit is contained in:
parent
8d46449502
commit
8e48231fea
3 changed files with 81 additions and 0 deletions
|
|
@ -14,6 +14,7 @@
|
||||||
<permission action="procDocumentMoveCategory" target="member" />
|
<permission action="procDocumentMoveCategory" target="member" />
|
||||||
<permission action="procDocumentDeleteCategory" target="member" />
|
<permission action="procDocumentDeleteCategory" target="member" />
|
||||||
<permission action="procDocumentMakeXmlFile" target="member" />
|
<permission action="procDocumentMakeXmlFile" target="member" />
|
||||||
|
<permission action="procDocumentAdminMoveToTrash" target="member" />
|
||||||
</permissions>
|
</permissions>
|
||||||
<actions>
|
<actions>
|
||||||
<action name="dispDocumentPrint" type="view" />
|
<action name="dispDocumentPrint" type="view" />
|
||||||
|
|
@ -58,6 +59,7 @@
|
||||||
<action name="procDocumentAdminInsertConfig" type="controller" />
|
<action name="procDocumentAdminInsertConfig" type="controller" />
|
||||||
<action name="procDocumentAdminDeleteAllThumbnail" type="controller" />
|
<action name="procDocumentAdminDeleteAllThumbnail" type="controller" />
|
||||||
<action name="procDocumentAdminCancelDeclare" type="controller" />
|
<action name="procDocumentAdminCancelDeclare" type="controller" />
|
||||||
|
<action name="procDocumentAdminMoveToTrash" type="controller" />
|
||||||
|
|
||||||
</actions>
|
</actions>
|
||||||
<menus>
|
<menus>
|
||||||
|
|
|
||||||
|
|
@ -712,6 +712,81 @@ class documentAdminController extends document
|
||||||
return $this->setRedirectUrl($returnUrl, $output);
|
return $this->setRedirectUrl($returnUrl, $output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @fn procDocumentAdminMoveToTrash
|
||||||
|
* @brief move a document to trash.
|
||||||
|
* @see documentModel::getDocumentMenu
|
||||||
|
*/
|
||||||
|
function procDocumentAdminMoveToTrash()
|
||||||
|
{
|
||||||
|
$document_srl = Context::get('document_srl');
|
||||||
|
|
||||||
|
$oDocumentModel = getModel('document');
|
||||||
|
$oDocumentController = getController('document');
|
||||||
|
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
|
||||||
|
if(!$oDocument->isGranted()) return $this->stop('msg_not_permitted');
|
||||||
|
|
||||||
|
$oModuleModel = getModel('module');
|
||||||
|
$module_info = $oModuleModel->getModuleInfoByDocumentSrl($document_srl);
|
||||||
|
|
||||||
|
$args = new stdClass();
|
||||||
|
$args->description = $message_content;
|
||||||
|
$args->document_srl = $document_srl;
|
||||||
|
|
||||||
|
$oDocumentController->moveDocumentToTrash($args);
|
||||||
|
|
||||||
|
$returnUrl = Context::get('success_return_url');
|
||||||
|
if(!$returnUrl)
|
||||||
|
{
|
||||||
|
$arrUrl = parse_url(Context::get('cur_url'));
|
||||||
|
$query = "";
|
||||||
|
|
||||||
|
if($arrUrl['query'])
|
||||||
|
{
|
||||||
|
parse_str($arrUrl['query'], $arrQuery);
|
||||||
|
|
||||||
|
// set query
|
||||||
|
if(isset($arrQuery['document_srl']))
|
||||||
|
unset($arrQuery['document_srl']);
|
||||||
|
|
||||||
|
$searchArgs = new stdClass;
|
||||||
|
foreach($arrQuery as $key=>$val)
|
||||||
|
{
|
||||||
|
$searchArgs->{$key} = $val;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!isset($searchArgs->sort_index))
|
||||||
|
$searchArgs->sort_index = $module_info->order_target;
|
||||||
|
|
||||||
|
foreach($module_info as $key=>$val)
|
||||||
|
{
|
||||||
|
if(!isset($searchArgs->{$key}))
|
||||||
|
$searchArgs->{$key} = $val;
|
||||||
|
}
|
||||||
|
|
||||||
|
$oDocumentModel = getModel('document');
|
||||||
|
$output = $oDocumentModel->getDocumentList($searchArgs, $module_info->except_notice, TRUE, array('document_srl'));
|
||||||
|
|
||||||
|
$cur_page = 1;
|
||||||
|
if(isset($arrQuery['page'])) {
|
||||||
|
$cur_page = (int)$arrQuery['page'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if($cur_page>1 && count($output->data) == 0)
|
||||||
|
$arrQuery['page'] = $cur_page - 1;
|
||||||
|
|
||||||
|
$query = "?";
|
||||||
|
foreach($arrQuery as $key=>$val)
|
||||||
|
$query .= sprintf("%s=%s&", $key, $val);
|
||||||
|
$query = substr($query, 0, -1);
|
||||||
|
}
|
||||||
|
$returnUrl = $arrUrl['path'] . $query;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->add('redirect_url', $returnUrl);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Restor document from trash
|
* Restor document from trash
|
||||||
* @return void|object
|
* @return void|object
|
||||||
|
|
|
||||||
|
|
@ -528,6 +528,10 @@ class documentModel extends document
|
||||||
|
|
||||||
if($oDocument->isExists())
|
if($oDocument->isExists())
|
||||||
{
|
{
|
||||||
|
$str_confirm = Context::getLang('cmd_document_do') . Context::getLang('confirm_delete');
|
||||||
|
$url = sprintf("if(!confirm('%s')) return; var params = new Array(); params['document_srl']='%s'; params['mid']=current_mid;params['cur_url']=current_url; exec_xml('document', 'procDocumentAdminMoveToTrash', params)", $str_confirm, $document_srl);
|
||||||
|
$oDocumentController->addDocumentPopupMenu($url,'cmd_trash','','javascript');
|
||||||
|
|
||||||
// Find a post equivalent to ip address
|
// Find a post equivalent to ip address
|
||||||
$url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','ipaddress','search_keyword',$oDocument->getIpAddress());
|
$url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','ipaddress','search_keyword',$oDocument->getIpAddress());
|
||||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_search_by_ipaddress',$icon_path,'TraceByIpaddress');
|
$oDocumentController->addDocumentPopupMenu($url,'cmd_search_by_ipaddress',$icon_path,'TraceByIpaddress');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue