issue 70 document module update bug fix in admin UI/UX

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9103 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2011-09-08 00:47:44 +00:00
parent 78db12a858
commit 008b3e451e
2 changed files with 11 additions and 12 deletions

View file

@ -250,10 +250,12 @@
$oDB->addColumn('documents', 'status', 'varchar', 20, 'PUBLIC');
$args->is_secret = 'Y';
$output = executeQuery('document.updateDocumentStatus', $args);
if($output->toBool())
$oDB->dropColumn('documents', 'is_secret');
}
// 2011. 09. 08 drop column document is_secret
if($oDB->isColumnExists('documents', 'status') && $oDB->isColumnExists('documents', 'is_secret'))
$oDB->dropColumn('documents', 'is_secret');
//2011. 06. 07 merge column, allow_comment and lock_comment
if($oDB->isColumnExists('documents', 'allow_comment') || $oDB->isColumnExists('documents', 'lock_comment'))
{
@ -262,33 +264,29 @@
$moduleSrlList = $oModuleModel->getModuleSrlList(null, $columnList);
$args->commentStatus = 'DENY';
$isSuccessUpdated = true;
// allow_comment='Y', lock_comment='Y'
$args->allowComment = 'Y';
$args->lockComment = 'Y';
$output = executeQuery('document.updateDocumentCommentStatus', $args);
if(!$output->toBool()) $isSuccessUpdated = false;
// allow_comment='N', lock_comment='Y'
$args->allowComment = 'N';
$args->lockComment = 'Y';
$output = executeQuery('document.updateDocumentCommentStatus', $args);
if(!$output->toBool()) $isSuccessUpdated = false;
// allow_comment='N', lock_comment='N'
$args->allowComment = 'N';
$args->lockComment = 'N';
$output = executeQuery('document.updateDocumentCommentStatus', $args);
if(!$output->toBool()) $isSuccessUpdated = false;
if($isSuccessUpdated)
{
$oDB->dropColumn('documents', 'allow_comment');
$oDB->dropColumn('documents', 'lock_comment');
}
}
if($oDB->isColumnExists('documents', 'allow_comment') && $oDB->isColumnExists('documents', 'comment_status'))
$oDB->dropColumn('documents', 'allow_comment');
if($oDB->isColumnExists('documents', 'lock_comment') && $oDB->isColumnExists('documents', 'comment_status'))
$oDB->dropColumn('documents', 'lock_comment');
return new Object(0,'success_updated');
}

View file

@ -31,6 +31,7 @@
* @brief Upate the module
**/
function procInstallAdminUpdate() {
set_time_limit(0);
$module_name = Context::get('module_name');
if(!$module_name) return new object(-1, 'invalid_request');