mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-18 18:02:15 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@122 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
2927df6079
commit
242b24d369
6 changed files with 84 additions and 62 deletions
|
|
@ -25,8 +25,21 @@
|
|||
* @brief 문서 입력
|
||||
**/
|
||||
function insertDocument($obj) {
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 기본 변수들 정리
|
||||
if($obj->is_secret!='Y') $obj->is_secret = 'N';
|
||||
if($obj->allow_comment!='Y') $obj->allow_comment = 'N';
|
||||
if($obj->lock_comment!='Y') $obj->lock_comment = 'N';
|
||||
if($obj->allow_trackback!='Y') $obj->allow_trackback = 'N';
|
||||
|
||||
// file의 Model객체 생성
|
||||
$oFileModel = getModel('file');
|
||||
|
||||
// 첨부 파일의 갯수를 구함
|
||||
$obj->uploaded_count = $oFileModel->getFilesCount($obj->document_srl);
|
||||
|
||||
// 카테고리가 있나 검사하여 없는 카테고리면 0으로 세팅
|
||||
if($obj->category_srl) {
|
||||
$category_list = $this->getCategoryList($obj->module_srl);
|
||||
|
|
@ -64,6 +77,18 @@
|
|||
* @brief 문서 수정
|
||||
**/
|
||||
function updateDocument($source_obj, $obj) {
|
||||
// 기본 변수들 정리
|
||||
if($obj->is_secret!='Y') $obj->is_secret = 'N';
|
||||
if($obj->allow_comment!='Y') $obj->allow_comment = 'N';
|
||||
if($obj->lock_comment!='Y') $obj->lock_comment = 'N';
|
||||
if($obj->allow_trackback!='Y') $obj->allow_trackback = 'N';
|
||||
|
||||
// file의 Model객체 생성
|
||||
$oFileModel = getModel('file');
|
||||
|
||||
// 첨부 파일의 갯수를 구함
|
||||
$obj->uploaded_count = $oFileModel->getFilesCount($obj->document_srl);
|
||||
|
||||
// 카테고리가 변경되었으면 검사후 없는 카테고리면 0으로 세팅
|
||||
if($source_obj->category_srl!=$obj->category_srl) {
|
||||
$category_list = $this->getCategoryList($obj->module_srl);
|
||||
|
|
@ -112,7 +137,7 @@
|
|||
|
||||
// 기존 문서가 있는지 확인
|
||||
$document = $oDocumentModel->getDocument($document_srl);
|
||||
if($document->document_srl != $document_srl) return false;
|
||||
if($document->document_srl != $document_srl) return new Object(-1, 'msg_invalid_document');
|
||||
|
||||
// 권한이 있는지 확인
|
||||
if(!$document->is_granted) return new Object(-1, 'msg_not_permitted');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue