mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 00:02:21 +09:00
issue 2662 counter, document
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12241 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e665650392
commit
77a1c3e89f
12 changed files with 4563 additions and 4059 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -1,103 +1,111 @@
|
|||
<?php
|
||||
/**
|
||||
* documentAdminModel class
|
||||
* Document the module's admin model class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/document
|
||||
* @version 0.1
|
||||
*/
|
||||
class documentAdminModel extends document
|
||||
{
|
||||
/**
|
||||
* documentAdminModel class
|
||||
* Document the module's admin model class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/document
|
||||
* @version 0.1
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
class documentAdminModel extends document {
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
function init() {
|
||||
}
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a document list from the trash
|
||||
* @param object $obj
|
||||
* @return object
|
||||
*/
|
||||
function getDocumentTrashList($obj) {
|
||||
// check a list and its order
|
||||
if (!in_array($obj->sort_index, array('list_order','delete_date','title'))) $obj->sort_index = 'list_order';
|
||||
if (!in_array($obj->order_type, array('desc','asc'))) $obj->order_type = 'asc';
|
||||
// get a module_srl if mid is returned instead of modul_srl
|
||||
if ($obj->mid) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid);
|
||||
unset($obj->mid);
|
||||
}
|
||||
// check if the module_srl is an array
|
||||
if (is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl);
|
||||
else $args->module_srl = $obj->module_srl;
|
||||
// Variable check
|
||||
$args->sort_index = $obj->sort_index;
|
||||
$args->order_type = $obj->order_type;
|
||||
$args->page = $obj->page?$obj->page:1;
|
||||
$args->list_count = $obj->list_count?$obj->list_count:20;
|
||||
$args->page_count = $obj->page_count?$obj->page_count:10;
|
||||
$args->member_srl = $obj->member_srl;
|
||||
// Specify query_id
|
||||
$query_id = 'document.getTrashList';
|
||||
// Execute a query
|
||||
$output = executeQueryArray($query_id, $args);
|
||||
// Return if no result or an error occurs
|
||||
if (!$output->toBool() || !count($output->data)) return $output;
|
||||
/**
|
||||
* Get a document list from the trash
|
||||
* @param object $obj
|
||||
* @return object
|
||||
*/
|
||||
function getDocumentTrashList($obj)
|
||||
{
|
||||
// check a list and its order
|
||||
if(!in_array($obj->sort_index, array('list_order','delete_date','title'))) $obj->sort_index = 'list_order';
|
||||
if(!in_array($obj->order_type, array('desc','asc'))) $obj->order_type = 'asc';
|
||||
// get a module_srl if mid is returned instead of modul_srl
|
||||
if($obj->mid)
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid);
|
||||
unset($obj->mid);
|
||||
}
|
||||
// check if the module_srl is an array
|
||||
if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl);
|
||||
else $args->module_srl = $obj->module_srl;
|
||||
// Variable check
|
||||
$args->sort_index = $obj->sort_index;
|
||||
$args->order_type = $obj->order_type;
|
||||
$args->page = $obj->page?$obj->page:1;
|
||||
$args->list_count = $obj->list_count?$obj->list_count:20;
|
||||
$args->page_count = $obj->page_count?$obj->page_count:10;
|
||||
$args->member_srl = $obj->member_srl;
|
||||
// Specify query_id
|
||||
$query_id = 'document.getTrashList';
|
||||
// Execute a query
|
||||
$output = executeQueryArray($query_id, $args);
|
||||
// Return if no result or an error occurs
|
||||
if(!$output->toBool() || !count($output->data)) return $output;
|
||||
|
||||
$idx = 0;
|
||||
$data = $output->data;
|
||||
unset($output->data);
|
||||
$idx = 0;
|
||||
$data = $output->data;
|
||||
unset($output->data);
|
||||
|
||||
$keys = array_keys($data);
|
||||
$virtual_number = $keys[0];
|
||||
$keys = array_keys($data);
|
||||
$virtual_number = $keys[0];
|
||||
|
||||
foreach($data as $key => $attribute) {
|
||||
$oDocument = null;
|
||||
$oDocument = new documentItem();
|
||||
$oDocument->setAttribute($attribute, false);
|
||||
if ($is_admin) $oDocument->setGrant();
|
||||
foreach($data as $key => $attribute)
|
||||
{
|
||||
$oDocument = null;
|
||||
$oDocument = new documentItem();
|
||||
$oDocument->setAttribute($attribute, false);
|
||||
if($is_admin) $oDocument->setGrant();
|
||||
|
||||
$output->data[$virtual_number] = $oDocument;
|
||||
$virtual_number--;
|
||||
}
|
||||
$output->data[$virtual_number] = $oDocument;
|
||||
$virtual_number--;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the doc which has trash_srl from the trash can
|
||||
* @param int $trash_srl
|
||||
* @return object
|
||||
*/
|
||||
function getDocumentTrash($trash_srl) {
|
||||
$args->trash_srl = $trash_srl;
|
||||
$output = executeQuery('document.getTrash', $args);
|
||||
/**
|
||||
* Get the doc which has trash_srl from the trash can
|
||||
* @param int $trash_srl
|
||||
* @return object
|
||||
*/
|
||||
function getDocumentTrash($trash_srl)
|
||||
{
|
||||
$args->trash_srl = $trash_srl;
|
||||
$output = executeQuery('document.getTrash', $args);
|
||||
|
||||
$node = $output->data;
|
||||
if (!$node) return;
|
||||
$node = $output->data;
|
||||
if(!$node) return;
|
||||
|
||||
return $node;
|
||||
}
|
||||
return $node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return document count with date
|
||||
* @param string $date
|
||||
* @parpam array $moduleSrlList
|
||||
* @param array $statusList
|
||||
* @return int
|
||||
*/
|
||||
function getDocumentCountByDate($date = '', $moduleSrlList = array(), $statusList = array()) {
|
||||
if($date) $args->regDate = date('Ymd', strtotime($date));
|
||||
if(count($moduleSrlList)>0) $args->moduleSrlList = $moduleSrlList;
|
||||
if(count($statusList)>0) $args->statusList = $statusList;
|
||||
/**
|
||||
* Return document count with date
|
||||
* @param string $date
|
||||
* @parpam array $moduleSrlList
|
||||
* @param array $statusList
|
||||
* @return int
|
||||
*/
|
||||
function getDocumentCountByDate($date = '', $moduleSrlList = array(), $statusList = array())
|
||||
{
|
||||
if($date) $args->regDate = date('Ymd', strtotime($date));
|
||||
if(count($moduleSrlList)>0) $args->moduleSrlList = $moduleSrlList;
|
||||
if(count($statusList)>0) $args->statusList = $statusList;
|
||||
|
||||
$output = executeQuery('document.getDocumentCountByDate', $args);
|
||||
if(!$output->toBool()) return 0;
|
||||
$output = executeQuery('document.getDocumentCountByDate', $args);
|
||||
if(!$output->toBool()) return 0;
|
||||
|
||||
return $output->data->count;
|
||||
}
|
||||
}
|
||||
?>
|
||||
return $output->data->count;
|
||||
}
|
||||
}
|
||||
/* End of file document.admin.model.php */
|
||||
/* Location: ./modules/document/document.admin.model.php */
|
||||
|
|
|
|||
|
|
@ -1,188 +1,199 @@
|
|||
<?php
|
||||
/**
|
||||
* documentAdminView class
|
||||
* Document admin view of the module class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/document
|
||||
* @version 0.1
|
||||
*/
|
||||
class documentAdminView extends document
|
||||
{
|
||||
/**
|
||||
* documentAdminView class
|
||||
* Document admin view of the module class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/document
|
||||
* @version 0.1
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
class documentAdminView extends document {
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
function init() {
|
||||
// check current location in admin menu
|
||||
$oModuleModel = &getModel('module');
|
||||
$info = $oModuleModel->getModuleActionXml('document');
|
||||
foreach($info->menu AS $key => $menu)
|
||||
function init()
|
||||
{
|
||||
// check current location in admin menu
|
||||
$oModuleModel = &getModel('module');
|
||||
$info = $oModuleModel->getModuleActionXml('document');
|
||||
foreach($info->menu AS $key => $menu)
|
||||
{
|
||||
if(in_array($this->act, $menu->acts))
|
||||
{
|
||||
if(in_array($this->act, $menu->acts))
|
||||
{
|
||||
Context::set('currentMenu', $key);
|
||||
break;
|
||||
}
|
||||
Context::set('currentMenu', $key);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a list(administrative)
|
||||
* @return void
|
||||
*/
|
||||
function dispDocumentAdminList() {
|
||||
// option to get a list
|
||||
$args->page = Context::get('page'); // /< Page
|
||||
$args->list_count = 30; // /< the number of posts to display on a single page
|
||||
$args->page_count = 5; // /< the number of pages that appear in the page navigation
|
||||
/**
|
||||
* Display a list(administrative)
|
||||
* @return void
|
||||
*/
|
||||
function dispDocumentAdminList()
|
||||
{
|
||||
// option to get a list
|
||||
$args->page = Context::get('page'); // /< Page
|
||||
$args->list_count = 30; // /< the number of posts to display on a single page
|
||||
$args->page_count = 5; // /< the number of pages that appear in the page navigation
|
||||
|
||||
$args->search_target = Context::get('search_target'); // /< search (title, contents ...)
|
||||
$args->search_keyword = Context::get('search_keyword'); // /< keyword to search
|
||||
$args->search_target = Context::get('search_target'); // /< search (title, contents ...)
|
||||
$args->search_keyword = Context::get('search_keyword'); // /< keyword to search
|
||||
|
||||
$args->sort_index = 'list_order'; // /< sorting value
|
||||
$args->sort_index = 'list_order'; // /< sorting value
|
||||
|
||||
$args->module_srl = Context::get('module_srl');
|
||||
$args->module_srl = Context::get('module_srl');
|
||||
|
||||
// get a list
|
||||
$oDocumentModel = &getModel('document');
|
||||
$columnList = array('document_srl', 'title', 'member_srl', 'nick_name', 'readed_count', 'voted_count', 'blamed_count', 'regdate', 'ipaddress', 'status');
|
||||
$output = $oDocumentModel->getDocumentList($args, false, true, $columnList);
|
||||
// get a list
|
||||
$oDocumentModel = &getModel('document');
|
||||
$columnList = array('document_srl', 'title', 'member_srl', 'nick_name', 'readed_count', 'voted_count', 'blamed_count', 'regdate', 'ipaddress', 'status');
|
||||
$output = $oDocumentModel->getDocumentList($args, false, true, $columnList);
|
||||
|
||||
// get Status name list
|
||||
$statusNameList = $oDocumentModel->getStatusNameList();
|
||||
// get Status name list
|
||||
$statusNameList = $oDocumentModel->getStatusNameList();
|
||||
|
||||
// Set values of document_model::getDocumentList() objects for a template
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('document_list', $output->data);
|
||||
Context::set('status_name_list', $statusNameList);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
// Set values of document_model::getDocumentList() objects for a template
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('document_list', $output->data);
|
||||
Context::set('status_name_list', $statusNameList);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
// set a search option used in the template
|
||||
$count_search_option = count($this->search_option);
|
||||
for($i=0;$i<$count_search_option;$i++) {
|
||||
$search_option[$this->search_option[$i]] = Context::getLang($this->search_option[$i]);
|
||||
}
|
||||
Context::set('search_option', $search_option);
|
||||
// set a search option used in the template
|
||||
$count_search_option = count($this->search_option);
|
||||
for($i=0;$i<$count_search_option;$i++)
|
||||
{
|
||||
$search_option[$this->search_option[$i]] = Context::getLang($this->search_option[$i]);
|
||||
}
|
||||
Context::set('search_option', $search_option);
|
||||
|
||||
// Specify a template
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('document_list');
|
||||
}
|
||||
// Specify a template
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('document_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a document module
|
||||
* @return void
|
||||
*/
|
||||
function dispDocumentAdminConfig() {
|
||||
$oDocumentModel = &getModel('document');
|
||||
$config = $oDocumentModel->getDocumentConfig();
|
||||
Context::set('config',$config);
|
||||
/**
|
||||
* Set a document module
|
||||
* @return void
|
||||
*/
|
||||
function dispDocumentAdminConfig()
|
||||
{
|
||||
$oDocumentModel = &getModel('document');
|
||||
$config = $oDocumentModel->getDocumentConfig();
|
||||
Context::set('config',$config);
|
||||
|
||||
// Set the template file
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('document_config');
|
||||
}
|
||||
// Set the template file
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('document_config');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a report list on the admin page
|
||||
* @return void
|
||||
*/
|
||||
function dispDocumentAdminDeclared() {
|
||||
// option for a list
|
||||
$args->page = Context::get('page'); // /< Page
|
||||
$args->list_count = 30; // /< the number of posts to display on a single page
|
||||
$args->page_count = 10; // /< the number of pages that appear in the page navigation
|
||||
/**
|
||||
* Display a report list on the admin page
|
||||
* @return void
|
||||
*/
|
||||
function dispDocumentAdminDeclared()
|
||||
{
|
||||
// option for a list
|
||||
$args->page = Context::get('page'); // /< Page
|
||||
$args->list_count = 30; // /< the number of posts to display on a single page
|
||||
$args->page_count = 10; // /< the number of pages that appear in the page navigation
|
||||
|
||||
$args->sort_index = 'document_declared.declared_count'; // /< sorting values
|
||||
$args->order_type = 'desc'; // /< sorting values by order
|
||||
$args->sort_index = 'document_declared.declared_count'; // /< sorting values
|
||||
$args->order_type = 'desc'; // /< sorting values by order
|
||||
|
||||
// get Status name list
|
||||
$oDocumentModel = &getModel('document');
|
||||
$statusNameList = $oDocumentModel->getStatusNameList();
|
||||
// get Status name list
|
||||
$oDocumentModel = &getModel('document');
|
||||
$statusNameList = $oDocumentModel->getStatusNameList();
|
||||
|
||||
// get a list
|
||||
$declared_output = executeQuery('document.getDeclaredList', $args);
|
||||
if($declared_output->data && count($declared_output->data)) {
|
||||
$document_list = array();
|
||||
// get a list
|
||||
$declared_output = executeQuery('document.getDeclaredList', $args);
|
||||
if($declared_output->data && count($declared_output->data))
|
||||
{
|
||||
$document_list = array();
|
||||
|
||||
foreach($declared_output->data as $key => $document) {
|
||||
$document_list[$key] = new documentItem();
|
||||
$document_list[$key]->setAttribute($document);
|
||||
}
|
||||
$declared_output->data = $document_list;
|
||||
foreach($declared_output->data as $key => $document)
|
||||
{
|
||||
$document_list[$key] = new documentItem();
|
||||
$document_list[$key]->setAttribute($document);
|
||||
}
|
||||
$declared_output->data = $document_list;
|
||||
}
|
||||
|
||||
// Set values of document_model::getDocumentList() objects for a template
|
||||
Context::set('total_count', $declared_output->total_count);
|
||||
Context::set('total_page', $declared_output->total_page);
|
||||
Context::set('page', $declared_output->page);
|
||||
Context::set('document_list', $declared_output->data);
|
||||
Context::set('page_navigation', $declared_output->page_navigation);
|
||||
Context::set('status_name_list', $statusNameList);
|
||||
// Set the template
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('declared_list');
|
||||
}
|
||||
// Set values of document_model::getDocumentList() objects for a template
|
||||
Context::set('total_count', $declared_output->total_count);
|
||||
Context::set('total_page', $declared_output->total_page);
|
||||
Context::set('page', $declared_output->page);
|
||||
Context::set('document_list', $declared_output->data);
|
||||
Context::set('page_navigation', $declared_output->page_navigation);
|
||||
Context::set('status_name_list', $statusNameList);
|
||||
// Set the template
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('declared_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a alias list on the admin page
|
||||
* @return void
|
||||
*/
|
||||
function dispDocumentAdminAlias() {
|
||||
$args->document_srl = Context::get('document_srl');
|
||||
if(!$args->document_srl) return $this->dispDocumentAdminList();
|
||||
/**
|
||||
* Display a alias list on the admin page
|
||||
* @return void
|
||||
*/
|
||||
function dispDocumentAdminAlias()
|
||||
{
|
||||
$args->document_srl = Context::get('document_srl');
|
||||
if(!$args->document_srl) return $this->dispDocumentAdminList();
|
||||
|
||||
$oModel = &getModel('document');
|
||||
$oDocument = $oModel->getDocument($args->document_srl);
|
||||
if(!$oDocument->isExists()) return $this->dispDocumentAdminList();
|
||||
Context::set('oDocument', $oDocument);
|
||||
$oModel = &getModel('document');
|
||||
$oDocument = $oModel->getDocument($args->document_srl);
|
||||
if(!$oDocument->isExists()) return $this->dispDocumentAdminList();
|
||||
Context::set('oDocument', $oDocument);
|
||||
|
||||
$output = executeQueryArray('document.getAliases', $args);
|
||||
if(!$output->data)
|
||||
{
|
||||
$aliases = array();
|
||||
}
|
||||
else
|
||||
{
|
||||
$aliases = $output->data;
|
||||
}
|
||||
$output = executeQueryArray('document.getAliases', $args);
|
||||
if(!$output->data)
|
||||
{
|
||||
$aliases = array();
|
||||
}
|
||||
else
|
||||
{
|
||||
$aliases = $output->data;
|
||||
}
|
||||
|
||||
Context::set('aliases', $aliases);
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('document_alias');
|
||||
}
|
||||
Context::set('aliases', $aliases);
|
||||
|
||||
/**
|
||||
* Display a trash list on the admin page
|
||||
* @return void
|
||||
*/
|
||||
function dispDocumentAdminTrashList() {
|
||||
// options for a list
|
||||
$args->page = Context::get('page'); // /< Page
|
||||
$args->list_count = 30; // /< the number of posts to display on a single page
|
||||
$args->page_count = 10; // /< the number of pages that appear in the page navigation
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('document_alias');
|
||||
}
|
||||
|
||||
$args->sort_index = 'list_order'; // /< sorting values
|
||||
$args->order_type = 'desc'; // /< sorting values by order
|
||||
/**
|
||||
* Display a trash list on the admin page
|
||||
* @return void
|
||||
*/
|
||||
function dispDocumentAdminTrashList()
|
||||
{
|
||||
// options for a list
|
||||
$args->page = Context::get('page'); // /< Page
|
||||
$args->list_count = 30; // /< the number of posts to display on a single page
|
||||
$args->page_count = 10; // /< the number of pages that appear in the page navigation
|
||||
|
||||
$args->module_srl = Context::get('module_srl');
|
||||
$args->sort_index = 'list_order'; // /< sorting values
|
||||
$args->order_type = 'desc'; // /< sorting values by order
|
||||
|
||||
// get a list
|
||||
$oDocumentAdminModel = &getAdminModel('document');
|
||||
$output = $oDocumentAdminModel->getDocumentTrashList($args);
|
||||
$args->module_srl = Context::get('module_srl');
|
||||
|
||||
// Set values of document_admin_model::getDocumentTrashList() objects for a template
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('document_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
// set the template
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('document_trash_list');
|
||||
}
|
||||
}
|
||||
?>
|
||||
// get a list
|
||||
$oDocumentAdminModel = &getAdminModel('document');
|
||||
$output = $oDocumentAdminModel->getDocumentTrashList($args);
|
||||
|
||||
// Set values of document_admin_model::getDocumentTrashList() objects for a template
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('document_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
// set the template
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('document_trash_list');
|
||||
}
|
||||
}
|
||||
/* End of file document.admin.view.php */
|
||||
/* Location: ./modules/document/document.admin.view.php */
|
||||
|
|
|
|||
|
|
@ -130,30 +130,36 @@ class document extends ModuleObject
|
|||
* Execute update
|
||||
* @return Object
|
||||
*/
|
||||
function moduleUpdate() {
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleController = &getController('module');
|
||||
|
||||
// 2007. 7. 25: Add a column(notify_message) for notification
|
||||
if(!$oDB->isColumnExists("documents","notify_message")) {
|
||||
if(!$oDB->isColumnExists("documents","notify_message"))
|
||||
{
|
||||
$oDB->addColumn('documents',"notify_message","char",1);
|
||||
}
|
||||
|
||||
// 2007. 8. 23: create a clustered index in the document table
|
||||
if(!$oDB->isIndexExists("documents","idx_module_list_order")) {
|
||||
if(!$oDB->isIndexExists("documents","idx_module_list_order"))
|
||||
{
|
||||
$oDB->addIndex("documents","idx_module_list_order", array("module_srl","list_order"));
|
||||
}
|
||||
|
||||
if(!$oDB->isIndexExists("documents","idx_module_update_order")) {
|
||||
if(!$oDB->isIndexExists("documents","idx_module_update_order"))
|
||||
{
|
||||
$oDB->addIndex("documents","idx_module_update_order", array("module_srl","update_order"));
|
||||
}
|
||||
|
||||
if(!$oDB->isIndexExists("documents","idx_module_readed_count")) {
|
||||
if(!$oDB->isIndexExists("documents","idx_module_readed_count"))
|
||||
{
|
||||
$oDB->addIndex("documents","idx_module_readed_count", array("module_srl","readed_count"));
|
||||
}
|
||||
|
||||
if(!$oDB->isIndexExists("documents","idx_module_voted_count")) {
|
||||
if(!$oDB->isIndexExists("documents","idx_module_voted_count"))
|
||||
{
|
||||
$oDB->addIndex("documents","idx_module_voted_count", array("module_srl","voted_count"));
|
||||
}
|
||||
// 2007. 10. 17 Add a trigger to delete all posts together when the module is deleted
|
||||
|
|
@ -172,12 +178,14 @@ class document extends ModuleObject
|
|||
// 2008. 02. 18 create a composite index on the columns(module_srl + document_srl) (checked by Manian))
|
||||
if(!$oDB->isIndexExists("documents","idx_module_document_srl")) $oDB->addIndex("documents","idx_module_document_srl", array("module_srl","document_srl"));
|
||||
// 2008. 04. 23 Add a column(blamed count)
|
||||
if(!$oDB->isColumnExists("documents", "blamed_count")) {
|
||||
if(!$oDB->isColumnExists("documents", "blamed_count"))
|
||||
{
|
||||
$oDB->addColumn('documents', 'blamed_count', 'number', 11, 0, true);
|
||||
$oDB->addIndex('documents', 'idx_blamed_count', array('blamed_count'));
|
||||
}
|
||||
|
||||
if(!$oDB->isIndexExists("documents","idx_module_blamed_count")) {
|
||||
if(!$oDB->isIndexExists("documents","idx_module_blamed_count"))
|
||||
{
|
||||
$oDB->addIndex('documents', 'idx_module_blamed_count', array('module_srl', 'blamed_count'));
|
||||
}
|
||||
|
||||
|
|
@ -194,24 +202,28 @@ class document extends ModuleObject
|
|||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before'))
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before');
|
||||
// 2009. 03. 09 Add a column(lang_code) to the documnets table
|
||||
if(!$oDB->isColumnExists("documents","lang_code")) {
|
||||
if(!$oDB->isColumnExists("documents","lang_code"))
|
||||
{
|
||||
$db_info = Context::getDBInfo();
|
||||
$oDB->addColumn('documents',"lang_code","varchar",10, $db_info->lang_code);
|
||||
$obj->lang_code = $db_info->lang_type;
|
||||
executeQuery('document.updateDocumentsLangCode', $obj);
|
||||
}
|
||||
// 2009. 03. 11 Check the index in the document_extra_vars table
|
||||
if(!$oDB->isIndexExists("document_extra_vars", "unique_extra_vars")) {
|
||||
if(!$oDB->isIndexExists("document_extra_vars", "unique_extra_vars"))
|
||||
{
|
||||
$oDB->addIndex("document_extra_vars", "unique_extra_vars", array("module_srl","document_srl","var_idx","lang_code"), true);
|
||||
}
|
||||
|
||||
if($oDB->isIndexExists("document_extra_vars", "unique_module_vars")) {
|
||||
if($oDB->isIndexExists("document_extra_vars", "unique_module_vars"))
|
||||
{
|
||||
$oDB->dropIndex("document_extra_vars", "unique_module_vars", true);
|
||||
}
|
||||
|
||||
// 2009. 03. 19: Add a column(eid)
|
||||
// 2009. 04. 12: Fixed the issue(#17922959) that changes another column values when adding eid column
|
||||
if(!$oDB->isColumnExists("document_extra_keys","eid")) {
|
||||
if(!$oDB->isColumnExists("document_extra_keys","eid"))
|
||||
{
|
||||
$oDB->addColumn("document_extra_keys","eid","varchar",40);
|
||||
|
||||
$output = executeQuery('document.getGroupsExtraKeys', $obj);
|
||||
|
|
@ -225,12 +237,15 @@ class document extends ModuleObject
|
|||
}
|
||||
}
|
||||
|
||||
if(!$oDB->isColumnExists("document_extra_vars","eid")) {
|
||||
if(!$oDB->isColumnExists("document_extra_vars","eid"))
|
||||
{
|
||||
$oDB->addColumn("document_extra_vars","eid","varchar",40);
|
||||
$obj->var_idx = '-1,-2';
|
||||
$output = executeQuery('document.getGroupsExtraVars', $obj);
|
||||
if($output->toBool() && $output->data && count($output->data)) {
|
||||
foreach($output->data as $extra_vars) {
|
||||
if($output->toBool() && $output->data && count($output->data))
|
||||
{
|
||||
foreach($output->data as $extra_vars)
|
||||
{
|
||||
$args->module_srl = $extra_vars->module_srl;
|
||||
$args->var_idx = $extra_vars->idx;
|
||||
$args->new_eid = "extra_vars".$extra_vars->idx;
|
||||
|
|
@ -240,7 +255,8 @@ class document extends ModuleObject
|
|||
}
|
||||
|
||||
// 2011. 03. 30 Cubrid index Check the index in the document_extra_vars table
|
||||
if(!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order")) {
|
||||
if(!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order"))
|
||||
{
|
||||
$oDB->addIndex("document_extra_vars", "idx_document_list_order", array("document_srl","module_srl","var_idx"), false);
|
||||
}
|
||||
|
||||
|
|
@ -312,7 +328,8 @@ class document extends ModuleObject
|
|||
* Re-generate the cache file
|
||||
* @return void
|
||||
*/
|
||||
function recompileCache() {
|
||||
function recompileCache()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -343,4 +360,5 @@ class document extends ModuleObject
|
|||
else $this->getDefaultStatus();
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file document.class.php */
|
||||
/* Location: ./modules/document/document.class.php */
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,163 +1,173 @@
|
|||
<?php
|
||||
/**
|
||||
* documentView class
|
||||
* View class of the module document
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/document
|
||||
* @version 0.1
|
||||
*/
|
||||
class documentView extends document
|
||||
{
|
||||
/**
|
||||
* documentView class
|
||||
* View class of the module document
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/document
|
||||
* @version 0.1
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
class documentView extends document {
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
function init() {
|
||||
}
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Document printing
|
||||
* I make it out to find the geulman;;
|
||||
* @return void|Object
|
||||
*/
|
||||
function dispDocumentPrint() {
|
||||
// Bring a list of variables needed to implement
|
||||
$document_srl = Context::get('document_srl');
|
||||
/**
|
||||
* Document printing
|
||||
* I make it out to find the geulman;;
|
||||
* @return void|Object
|
||||
*/
|
||||
function dispDocumentPrint()
|
||||
{
|
||||
// Bring a list of variables needed to implement
|
||||
$document_srl = Context::get('document_srl');
|
||||
|
||||
// module_info not use in UI
|
||||
//$oModuleModel = &getModel('module');
|
||||
//$module_info = $oModuleModel->getModuleInfoByDocumentSrl($document_srl);
|
||||
// module_info not use in UI
|
||||
//$oModuleModel = &getModel('module');
|
||||
//$module_info = $oModuleModel->getModuleInfoByDocumentSrl($document_srl);
|
||||
|
||||
// Create the document object. If the document module of basic data structures, write it all works .. -_-;
|
||||
$oDocumentModel = &getModel('document');
|
||||
// Creates an object for displaying the selected document
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, $this->grant->manager);
|
||||
if(!$oDocument->isExists()) return new Object(-1,'msg_invalid_request');
|
||||
// Check permissions
|
||||
if(!$oDocument->isAccessible()) return new Object(-1,'msg_not_permitted');
|
||||
// Information setting module
|
||||
//Context::set('module_info', $module_info); //module_info not use in UI
|
||||
// Browser title settings
|
||||
Context::setBrowserTitle($oDocument->getTitleText());
|
||||
Context::set('oDocument', $oDocument);
|
||||
// Create the document object. If the document module of basic data structures, write it all works .. -_-;
|
||||
$oDocumentModel = &getModel('document');
|
||||
// Creates an object for displaying the selected document
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, $this->grant->manager);
|
||||
if(!$oDocument->isExists()) return new Object(-1,'msg_invalid_request');
|
||||
// Check permissions
|
||||
if(!$oDocument->isAccessible()) return new Object(-1,'msg_not_permitted');
|
||||
// Information setting module
|
||||
//Context::set('module_info', $module_info); //module_info not use in UI
|
||||
// Browser title settings
|
||||
Context::setBrowserTitle($oDocument->getTitleText());
|
||||
Context::set('oDocument', $oDocument);
|
||||
|
||||
Context::set('layout','none');
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('print_page');
|
||||
}
|
||||
Context::set('layout','none');
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('print_page');
|
||||
}
|
||||
|
||||
/**
|
||||
* Preview
|
||||
* @return void
|
||||
*/
|
||||
function dispDocumentPreview() {
|
||||
Context::set('layout','none');
|
||||
/**
|
||||
* Preview
|
||||
* @return void
|
||||
*/
|
||||
function dispDocumentPreview()
|
||||
{
|
||||
Context::set('layout','none');
|
||||
|
||||
$content = Context::get('content');
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('preview_page');
|
||||
}
|
||||
$content = Context::get('content');
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('preview_page');
|
||||
}
|
||||
|
||||
/**
|
||||
* Selected by the administrator for the document management
|
||||
* @return void|Object
|
||||
*/
|
||||
function dispDocumentManageDocument() {
|
||||
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
|
||||
// Taken from a list of selected sessions
|
||||
$flag_list = $_SESSION['document_management'];
|
||||
if(count($flag_list)) {
|
||||
foreach($flag_list as $key => $val) {
|
||||
if(!is_bool($val)) continue;
|
||||
$document_srl_list[] = $key;
|
||||
}
|
||||
}
|
||||
|
||||
if(count($document_srl_list)) {
|
||||
$oDocumentModel = &getModel('document');
|
||||
$document_list = $oDocumentModel->getDocuments($document_srl_list, $this->grant->is_admin);
|
||||
Context::set('document_list', $document_list);
|
||||
}
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
// The combination of module categories list and the list of modules
|
||||
if(count($module_list)>1) Context::set('module_list', $module_categories);
|
||||
|
||||
$module_srl=Context::get('module_srl');
|
||||
Context::set('module_srl',$module_srl);
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
Context::set('mid',$module_info->mid);
|
||||
Context::set('browser_title',$module_info->browser_title);
|
||||
|
||||
|
||||
// Select Pop-up layout
|
||||
$this->setLayoutPath('./common/tpl');
|
||||
$this->setLayoutFile('popup_layout');
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('checked_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger method.
|
||||
* Additional information realte to document setting
|
||||
* @param string $obj
|
||||
* @return Object
|
||||
*/
|
||||
function triggerDispDocumentAdditionSetup(&$obj) {
|
||||
$current_module_srl = Context::get('module_srl');
|
||||
$current_module_srls = Context::get('module_srls');
|
||||
|
||||
if(!$current_module_srl && !$current_module_srls) {
|
||||
// Get information of the current module
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl) return new Object();
|
||||
}
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
if($current_module_srl)
|
||||
{
|
||||
$document_config = $oModuleModel->getModulePartConfig('document', $current_module_srl);
|
||||
}
|
||||
if(!isset($document_config->use_history)) $document_config->use_history = 'N';
|
||||
Context::set('document_config', $document_config);
|
||||
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'document_module_config');
|
||||
$obj .= $tpl;
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* Document temp saved list
|
||||
* @return void
|
||||
*/
|
||||
function dispTempSavedList()
|
||||
/**
|
||||
* Selected by the administrator for the document management
|
||||
* @return void|Object
|
||||
*/
|
||||
function dispDocumentManageDocument()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
|
||||
// Taken from a list of selected sessions
|
||||
$flag_list = $_SESSION['document_management'];
|
||||
if(count($flag_list))
|
||||
{
|
||||
$this->setLayoutFile('popup_layout');
|
||||
|
||||
$oMemberModel = &getModel('member');
|
||||
// A message appears if the user is not logged-in
|
||||
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
|
||||
// Get the saved document (module_srl is set to member_srl instead)
|
||||
$logged_info = Context::get('logged_info');
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
$args->statusList = array($this->getConfigStatus('temp'));
|
||||
$args->page = (int)Context::get('page');
|
||||
$args->list_count = 10;
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
$output = $oDocumentModel->getDocumentList($args, true);
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('document_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('saved_list_popup');
|
||||
foreach($flag_list as $key => $val)
|
||||
{
|
||||
if(!is_bool($val)) continue;
|
||||
$document_srl_list[] = $key;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
if(count($document_srl_list))
|
||||
{
|
||||
$oDocumentModel = &getModel('document');
|
||||
$document_list = $oDocumentModel->getDocuments($document_srl_list, $this->grant->is_admin);
|
||||
Context::set('document_list', $document_list);
|
||||
}
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
// The combination of module categories list and the list of modules
|
||||
if(count($module_list)>1) Context::set('module_list', $module_categories);
|
||||
|
||||
$module_srl=Context::get('module_srl');
|
||||
Context::set('module_srl',$module_srl);
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
Context::set('mid',$module_info->mid);
|
||||
Context::set('browser_title',$module_info->browser_title);
|
||||
|
||||
// Select Pop-up layout
|
||||
$this->setLayoutPath('./common/tpl');
|
||||
$this->setLayoutFile('popup_layout');
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('checked_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger method.
|
||||
* Additional information realte to document setting
|
||||
* @param string $obj
|
||||
* @return Object
|
||||
*/
|
||||
function triggerDispDocumentAdditionSetup(&$obj)
|
||||
{
|
||||
$current_module_srl = Context::get('module_srl');
|
||||
$current_module_srls = Context::get('module_srls');
|
||||
|
||||
if(!$current_module_srl && !$current_module_srls)
|
||||
{
|
||||
// Get information of the current module
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl) return new Object();
|
||||
}
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
if($current_module_srl)
|
||||
{
|
||||
$document_config = $oModuleModel->getModulePartConfig('document', $current_module_srl);
|
||||
}
|
||||
if(!isset($document_config->use_history)) $document_config->use_history = 'N';
|
||||
Context::set('document_config', $document_config);
|
||||
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'document_module_config');
|
||||
$obj .= $tpl;
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* Document temp saved list
|
||||
* @return void
|
||||
*/
|
||||
function dispTempSavedList()
|
||||
{
|
||||
$this->setLayoutFile('popup_layout');
|
||||
|
||||
$oMemberModel = &getModel('member');
|
||||
// A message appears if the user is not logged-in
|
||||
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
|
||||
// Get the saved document (module_srl is set to member_srl instead)
|
||||
$logged_info = Context::get('logged_info');
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
$args->statusList = array($this->getConfigStatus('temp'));
|
||||
$args->page = (int)Context::get('page');
|
||||
$args->list_count = 10;
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
$output = $oDocumentModel->getDocumentList($args, true);
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('document_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('saved_list_popup');
|
||||
}
|
||||
}
|
||||
/* End of file document.view.php */
|
||||
/* Location: ./modules/document/document.view.php */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue