Merge branch 'master' of github.com:easysoft/zentaopms
This commit is contained in:
@@ -3,3 +3,6 @@ form{margin-bottom:100px; padding-left:65px}
|
||||
table{width:90% !important}
|
||||
|
||||
#whiteListBox div.input-group {margin-bottom: 2px;}
|
||||
|
||||
#product_chosen{width: 50%!important}
|
||||
#project_chosen{width: 50%!important}
|
||||
|
||||
@@ -16,7 +16,7 @@ function toggleAcl(acl, type)
|
||||
}
|
||||
if(type == 'lib')
|
||||
{
|
||||
var libType = $('input[name="type"]').val();
|
||||
var libType = $('input[name="type"]:checked').val();
|
||||
var notice = typeof(noticeAcl[libType][acl]) != 'undefined' ? noticeAcl[libType][acl] : '';
|
||||
$('#noticeAcl').html(notice);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ $(function()
|
||||
changeByLibType(libType);
|
||||
})
|
||||
changeByLibType($('input[name="type"]').val());
|
||||
toggleAcl($('[name=acl]').val(), 'lib');
|
||||
toggleAcl($('form [name=acl]:checked').val(), 'lib');
|
||||
});
|
||||
|
||||
function changeByLibType(libType)
|
||||
@@ -15,19 +15,34 @@ function changeByLibType(libType)
|
||||
{
|
||||
$('table tr.product').removeClass('hidden');
|
||||
$('table tr.project').addClass('hidden');
|
||||
changeDoclibAcl(libType);
|
||||
}
|
||||
else if(libType == 'project')
|
||||
{
|
||||
$('table tr.product').addClass('hidden');
|
||||
$('table tr.project').removeClass('hidden');
|
||||
changeDoclibAcl(libType);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('table tr.product').addClass('hidden');
|
||||
$('table tr.project').addClass('hidden');
|
||||
changeDoclibAcl(libType);
|
||||
}
|
||||
|
||||
var acl = $('[name=acl]').val();
|
||||
var acl = $('form [name=acl]').val();
|
||||
var notice = typeof(noticeAcl[libType][acl]) != 'undefined' ? noticeAcl[libType][acl] : '';
|
||||
$('#noticeAcl').html(notice);
|
||||
}
|
||||
|
||||
function changeDoclibAcl(libType)
|
||||
{
|
||||
if(libType == 'product' || libType == 'project')
|
||||
{
|
||||
$('form input[name="acl"]').closest('td').find('span:first').html($('#aclBoxA td').html());
|
||||
}
|
||||
else
|
||||
{
|
||||
$('form input[name="acl"]').closest('td').find('span:first').html($('#aclBoxB td').html());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$(function()
|
||||
{
|
||||
toggleAcl($('input[name="acl"]').val(), 'lib');
|
||||
toggleAcl($('form input[name="acl"]:checked').val(), 'lib');
|
||||
})
|
||||
|
||||
@@ -169,17 +169,15 @@ $lang->doc->noEditedDoc = '您还没有编辑任何文档。';
|
||||
$lang->doc->noOpenedDoc = '您还没有创建任何文档。';
|
||||
$lang->doc->noCollectedDoc = '您还没有收藏任何文档。';
|
||||
|
||||
$lang->doc->noticeAcl['lib']['product']['open'] = '除了没有关联产品权限的用户,都可以访问。';
|
||||
$lang->doc->noticeAcl['lib']['product']['custom'] = '白名单和有关联产品权限的用户可以访问。';
|
||||
$lang->doc->noticeAcl['lib']['product']['private'] = '创建人和有关联产品权限的用户可以访问。';
|
||||
$lang->doc->noticeAcl['lib']['project']['open'] = '除了没有关联项目权限的用户,都可以访问。';
|
||||
$lang->doc->noticeAcl['lib']['project']['custom'] = '白名单和有关联项目权限的用户可以访问。';
|
||||
$lang->doc->noticeAcl['lib']['project']['private'] = '创建人和有关联项目权限的用户可以访问。';
|
||||
$lang->doc->noticeAcl['lib']['product']['default'] = '有所选产品访问权限的用户可以访问。';
|
||||
$lang->doc->noticeAcl['lib']['product']['custom'] = '有所选产品访问权限或白名单里的用户可以访问。';
|
||||
$lang->doc->noticeAcl['lib']['project']['default'] = '有所选项目访问权限的用户可以访问。';
|
||||
$lang->doc->noticeAcl['lib']['project']['custom'] = '有所选项目访问权限或白名单里的用户可以访问。';
|
||||
$lang->doc->noticeAcl['lib']['custom']['open'] = '所有人都可以访问。';
|
||||
$lang->doc->noticeAcl['lib']['custom']['custom'] = '白名单的用户可以访问。';
|
||||
$lang->doc->noticeAcl['lib']['custom']['private'] = '只有创建人可以访问。';
|
||||
|
||||
$lang->doc->noticeAcl['doc']['open'] = '除了没有所属文档库权限的用户,都可以访问。';
|
||||
$lang->doc->noticeAcl['doc']['open'] = '有文档所属文档库访问权限的,都可以访问。';
|
||||
$lang->doc->noticeAcl['doc']['custom'] = '白名单的用户可以访问。';
|
||||
$lang->doc->noticeAcl['doc']['private'] = '只有自己可以访问。';
|
||||
|
||||
@@ -197,6 +195,14 @@ $lang->doclib->select = '选择文档库';
|
||||
$lang->doclib->project = $lang->projectCommon . '库';
|
||||
$lang->doclib->product = $lang->productCommon . '库';
|
||||
|
||||
$lang->doclib->aclListA['default'] = '默认';
|
||||
$lang->doclib->aclListA['custom'] = '自定义';
|
||||
|
||||
$lang->doclib->aclListB['open'] = '公开';
|
||||
$lang->doclib->aclListB['custom'] = '自定义';
|
||||
$lang->doclib->aclListB['private'] = '私有';
|
||||
|
||||
|
||||
$lang->doclib->create['product'] = '创建' . $lang->productCommon . '文档库';
|
||||
$lang->doclib->create['project'] = '创建' . $lang->projectCommon . '文档库';
|
||||
$lang->doclib->create['custom'] = '创建自定义文档库';
|
||||
|
||||
+11
-8
@@ -847,12 +847,6 @@ class docModel extends model
|
||||
{
|
||||
if($this->app->user->admin) return true;
|
||||
|
||||
$acls = $this->app->user->rights['acls'];
|
||||
if(!empty($object->product) and !empty($acls['products']) and !in_array($object->product, $acls['products'])) return false;
|
||||
if(!empty($object->project) and !empty($acls['projects']) and !in_array($object->project, $acls['projects'])) return false;
|
||||
|
||||
if($object->acl == 'open') return true;
|
||||
|
||||
$account = ',' . $this->app->user->account . ',';
|
||||
if(isset($object->addedBy) and $object->addedBy == $this->app->user->account) return true;
|
||||
if(isset($object->users) and strpos(",{$object->users},", $account) !== false) return true;
|
||||
@@ -872,8 +866,17 @@ class docModel extends model
|
||||
if(isset($extraDocLibs[$object->id])) return true;
|
||||
}
|
||||
|
||||
if(!empty($object->project)) return $this->loadModel('project')->checkPriv($object->project);
|
||||
if(!empty($object->product)) return $this->loadModel('product')->checkPriv($object->product);
|
||||
if(!empty($object->product) or !empty($object->project))
|
||||
{
|
||||
$acls = $this->app->user->rights['acls'];
|
||||
if(!empty($object->product) and !empty($acls['products']) and !in_array($object->product, $acls['products'])) return false;
|
||||
if(!empty($object->project) and !empty($acls['projects']) and !in_array($object->project, $acls['projects'])) return false;
|
||||
if(!empty($object->project)) return $this->loadModel('project')->checkPriv($object->project);
|
||||
if(!empty($object->product)) return $this->loadModel('product')->checkPriv($object->product);
|
||||
}
|
||||
|
||||
if($object->acl == 'open') return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,33 +23,31 @@
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->doc->libType?></th>
|
||||
<td colspan='2'><?php echo html::radio('type', $libTypeList, $type ? $type : 'product')?></td>
|
||||
<td><?php echo html::radio('type', $libTypeList, $type ? $type : 'product')?></td>
|
||||
</tr>
|
||||
<tr class='product'>
|
||||
<th><?php echo $lang->doc->product?></th>
|
||||
<td><?php echo html::select('product', $products, $type == 'product' ? $objectID : '', "class='form-control chosen' data-drop_direction='down'")?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class='project hidden'>
|
||||
<th><?php echo $lang->doc->project?></th>
|
||||
<td><?php echo html::select('project', $projects, $type == 'project' ? $objectID : '', "class='form-control chosen' data-drop_direction='down'")?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doclib->name?></th>
|
||||
<td><?php echo html::input('name', '', "class='form-control'")?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doclib->control;?></th>
|
||||
<td colspan='2'>
|
||||
<?php echo html::radio('acl', $lang->doc->aclList, 'open', "onchange='toggleAcl(this.value, \"lib\")'")?>
|
||||
</td>
|
||||
<td>
|
||||
<span><?php echo html::radio('acl', $lang->doc->aclList, 'open', "onchange='toggleAcl(this.value, \"lib\")'")?></span>
|
||||
<span class='text-warning' id='noticeAcl'><?php echo $lang->doc->noticeAcl['lib']['product']['default'];?></span>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr id='whiteListBox' class='hidden'>
|
||||
<th><?php echo $lang->doc->whiteList;?></th>
|
||||
<td colspan='2'>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon groups-addon'><?php echo $lang->doclib->group?></span>
|
||||
<?php echo html::select('groups[]', $groups, '', "class='form-control chosen' multiple")?>
|
||||
@@ -61,11 +59,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td colspan='2'><span class='text-warning' id='noticeAcl'><?php echo $lang->doc->noticeAcl['lib']['product']['open'];?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='text-center form-actions' colspan='3'><?php echo html::submitButton();?></td>
|
||||
<td class='text-center form-actions' colspan='2'><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
@@ -73,5 +67,21 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='hidden'>
|
||||
<table>
|
||||
<tr id='aclBoxA'>
|
||||
<th><?php echo $lang->doclib->control;?></th>
|
||||
<td>
|
||||
<?php echo html::radio('acl', $lang->doclib->aclListA, 'default', "onchange='toggleAcl(this.value, \"lib\")'")?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id='aclBoxB'>
|
||||
<th><?php echo $lang->doclib->control;?></th>
|
||||
<td>
|
||||
<?php echo html::radio('acl', $lang->doclib->aclListB, 'open', "onchange='toggleAcl(this.value, \"lib\")'")?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php js::set('noticeAcl', $lang->doc->noticeAcl['lib']);?>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
|
||||
@@ -45,10 +45,17 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doclib->control;?></th>
|
||||
<?php if($lib->type == 'product' or $lib->type == 'project'):?>
|
||||
<td>
|
||||
<?php echo html::radio('acl', $lang->doc->aclList, $lib->acl, "onchange='toggleAcl(this.value, \"lib\")'")?>
|
||||
<?php echo html::radio('acl', $lang->doclib->aclListA, $lib->acl, "onchange='toggleAcl(this.value, \"lib\")'")?>
|
||||
<span class='text-warning' id='noticeAcl'><?php echo $lang->doc->noticeAcl['lib'][$lib->type][$lib->acl];?></span>
|
||||
</td>
|
||||
<?php else:?>
|
||||
<td>
|
||||
<?php echo html::radio('acl', $lang->doclib->aclListB, $lib->acl, "onchange='toggleAcl(this.value, \"lib\")'")?>
|
||||
<span class='text-warning' id='noticeAcl'><?php echo $lang->doc->noticeAcl['lib'][$lib->type][$lib->acl];?></span>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
<tr id='whiteListBox' class='hidden'>
|
||||
<th><?php echo $lang->doc->whiteList?></th>
|
||||
|
||||
@@ -162,4 +162,12 @@ $(function()
|
||||
{
|
||||
$('[data-toggle=tooltip]').tooltip();
|
||||
initSteps();
|
||||
|
||||
$('#pri').on('change', function()
|
||||
{
|
||||
var $select = $(this);
|
||||
var $selector = $select.closest('.pri-selector');
|
||||
var value = $select.val();
|
||||
$selector.find('.pri-text').html('<span class="label-pri label-pri-' + value + '" title="' + value + '">' + value + '</span>');
|
||||
});
|
||||
})
|
||||
|
||||
@@ -363,6 +363,10 @@ class upgradeModel extends model
|
||||
$this->dao->update(TABLE_CONFIG)->set('value')->eq('off')->where('`key`')->eq('isHttps')->andWhere('`section`')->eq('xuanxuan')->andWhere('`value`')->eq('0')->exec();
|
||||
$this->dao->update(TABLE_CONFIG)->set('value')->eq('on')->where('`key`')->eq('isHttps')->andWhere('`section`')->eq('xuanxuan')->andWhere('`value`')->eq('1')->exec();
|
||||
}
|
||||
case '11_2':
|
||||
$this->saveLogs('Execute 11_2');
|
||||
$this->execSQL($this->getUpgradeFile('11.2'));
|
||||
$this->processDocLibAcl();
|
||||
}
|
||||
|
||||
$this->deletePatch();
|
||||
@@ -486,11 +490,13 @@ class upgradeModel extends model
|
||||
$confirmContent .= file_get_contents($this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.2.0.sql');
|
||||
case '11_0':
|
||||
case '11_1':
|
||||
$confirmContent .= file_get_contents($this->getUpgradeFile('11.1'));
|
||||
if(!isset($this->config->isINT) or !($this->config->isINT))
|
||||
{
|
||||
$xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.3.0.sql';
|
||||
$confirmContent .= file_get_contents($xuanxuanSql);
|
||||
}
|
||||
case '11_2': $confirmContent .= file_get_contents($this->getUpgradeFile('11.2'));
|
||||
}
|
||||
return str_replace('zt_', $this->config->db->prefix, $confirmContent);
|
||||
}
|
||||
@@ -2966,6 +2972,18 @@ class upgradeModel extends model
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process doc lib acl.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function processDocLibAcl()
|
||||
{
|
||||
$this->dao->update(TABLE_DOCLIB)->set('acl')->eq('default')->where('type')->in('product,project')->andWhere('acl')->in('open,private')->exec();
|
||||
return !dao::isError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Logs.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user