issue 26 Document status change with config.

old version coding with hard coding


git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8448 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2011-06-03 08:51:55 +00:00
parent 0ba04bb1f7
commit e3376c3c3a
8 changed files with 45 additions and 20 deletions

View file

@ -122,7 +122,8 @@
}
function isSecret() {
return $this->get('status') == 'SECRET' ? true : false;
$oDocumentModel = &getModel('document');
return $this->get('status') == $oDocumentModel->getConfigStatus('secret') ? true : false;
}
function isNotice() {
@ -633,7 +634,7 @@
function getStatus()
{
if(!$this->get('status')) return 'PUBLIC';
if(!$this->get('status')) return $this->getDefaultStatus();
return $this->get('status');
}
@ -756,8 +757,12 @@
$status = $this->get('status');
if(empty($status)) return false;
if($status == 'PUBLIC' || $status == 'PUBLISH') return true;
else if($status == 'PRIVATE' || $status == 'SECRET')
$oDocumentModel = &getModel('document');
$configStatusList = $oDocumentModel->getStatusList();
if($status == $configStatusList['public'] || $status == $configStatusList['publish'])
return true;
else if($status == $configStatusList['private'] || $status == $configStatusList['secret'])
{
if($this->get('member_srl') == $logged_info->member_srl)
return true;