Merge branch 'master' of https://github.com/easysoft/zentaopms
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@ if(!class_exists('config')){class config{}}
|
||||
if(!function_exists('getWebRoot')){function getWebRoot(){}}
|
||||
|
||||
/* 基本设置。Basic settings. */
|
||||
$config->version = '9.6.1'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it.
|
||||
$config->version = '9.6.2'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it.
|
||||
$config->charset = 'UTF-8'; // ZenTaoPHP的编码。 The encoding of ZenTaoPHP.
|
||||
$config->cookieLife = time() + 2592000; // Cookie的生存时间。The cookie life time.
|
||||
$config->timezone = 'Asia/Shanghai'; // 时区设置。 The time zone setting, for more see http://www.php.net/manual/en/timezones.php.
|
||||
|
||||
+4
-2
@@ -915,7 +915,8 @@ INSERT INTO `zt_group` (`id`, `name`, `role`, `desc`) VALUES
|
||||
(8, 'QD', 'qd', 'for quality director.'),
|
||||
(9, 'TOP', 'top', 'for top manager.'),
|
||||
(10, 'OTHERS', '', 'for others.'),
|
||||
(11, 'guest', 'guest', 'For guest');
|
||||
(11, 'guest', 'guest', 'For guest'),
|
||||
(12, 'limited', 'limited', 'For limited user');
|
||||
|
||||
INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(1, 'action', 'editComment'),
|
||||
@@ -3289,4 +3290,5 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(11, 'user', 'testCase'),
|
||||
(11, 'user', 'testTask'),
|
||||
(11, 'user', 'todo'),
|
||||
(11, 'user', 'view');
|
||||
(11, 'user', 'view'),
|
||||
(12, 'my', 'limited');
|
||||
|
||||
@@ -21,19 +21,7 @@ function setNoChecked()
|
||||
{
|
||||
var noCheckValue = '';
|
||||
$(':checkbox').each(function(){
|
||||
if(!$(this).attr('checked') && $(this).next('span').attr('id') != undefined) noCheckValue = noCheckValue + ',' + $(this).next('span').attr('id');
|
||||
if(!$(this).prop('checked') && $(this).next('span').attr('id') != undefined) noCheckValue = noCheckValue + ',' + $(this).next('span').attr('id');
|
||||
})
|
||||
$('#noChecked').val(noCheckValue);
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
$("[name^='allchecker']").change(function()
|
||||
{
|
||||
var click = $(this).attr('onclick');
|
||||
if(click.indexOf('""') >= 0 || click.indexOf('"my"') >= 0)
|
||||
{
|
||||
$('#my-limited').closest('.group-item').find('input').prop("checked", false);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -84,7 +84,6 @@ $lang->resource->my->changePassword = 'changePassword';
|
||||
$lang->resource->my->unbind = 'unbind';
|
||||
$lang->resource->my->manageContacts = 'manageContacts';
|
||||
$lang->resource->my->deleteContacts = 'deleteContacts';
|
||||
$lang->resource->my->limited = 'limited';
|
||||
$lang->resource->my->score = 'score';
|
||||
|
||||
$lang->my->methodOrder[0] = 'index';
|
||||
@@ -103,7 +102,6 @@ $lang->my->methodOrder[60] = 'unbind';
|
||||
$lang->my->methodOrder[65] = 'manageContacts';
|
||||
$lang->my->methodOrder[75] = 'deleteContacts';
|
||||
$lang->my->methodOrder[80] = 'score';
|
||||
$lang->my->methodOrder[85] = 'limited';
|
||||
|
||||
/* Todo. */
|
||||
$lang->resource->todo = new stdclass();
|
||||
|
||||
@@ -407,4 +407,24 @@ class groupModel extends model
|
||||
}
|
||||
return $modules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Judge an action is clickable or not.
|
||||
*
|
||||
* @param object $group
|
||||
* @param string $action
|
||||
* @static
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public static function isClickable($group, $action)
|
||||
{
|
||||
$action = strtolower($action);
|
||||
|
||||
if($action == 'manageview' and $group->role == 'limited') return false;
|
||||
if($action == 'edit' and $group->role == 'limited') return false;
|
||||
if($action == 'copy' and $group->role == 'limited') return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,17 +42,21 @@
|
||||
<td class='text-left' title='<?php echo $users;?>'><?php echo $users;?></td>
|
||||
<td class='text-center'>
|
||||
<?php $lang->group->managepriv = $lang->group->managePrivByGroup;?>
|
||||
<?php common::printIcon('group', 'manageView', "groupID=$group->id", '', 'list', 'eye-open');?>
|
||||
<?php common::printIcon('group', 'managepriv', "type=byGroup¶m=$group->id", '', 'list', 'lock');?>
|
||||
<?php common::printIcon('group', 'manageView', "groupID=$group->id", $group, 'list', 'eye-open');?>
|
||||
<?php common::printIcon('group', 'managepriv', "type=byGroup¶m=$group->id", $group, 'list', 'lock');?>
|
||||
<?php $lang->group->managemember = $lang->group->manageMember;?>
|
||||
<?php common::printIcon('group', 'managemember', "groupID=$group->id", '', 'list', 'group', '', 'iframe', 'yes');?>
|
||||
<?php common::printIcon('group', 'edit', "groupID=$group->id", '', 'list', '', '', 'iframe', 'yes', "data-width='550'");?>
|
||||
<?php common::printIcon('group', 'copy', "groupID=$group->id", '', 'list', '', '', 'iframe', 'yes', "data-width='550'");?>
|
||||
<?php common::printIcon('group', 'managemember', "groupID=$group->id", $group, 'list', 'group', '', 'iframe', 'yes');?>
|
||||
<?php common::printIcon('group', 'edit', "groupID=$group->id", $group, 'list', '', '', 'iframe', 'yes', "data-width='550'");?>
|
||||
<?php common::printIcon('group', 'copy', "groupID=$group->id", $group, 'list', '', '', 'iframe', 'yes', "data-width='550'");?>
|
||||
<?php
|
||||
if(common::hasPriv('group', 'delete'))
|
||||
if(common::hasPriv('group', 'delete') and $group->role != 'limited')
|
||||
{
|
||||
$deleteURL = $this->createLink('group', 'delete', "groupID=$group->id&confirm=yes");
|
||||
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"groupList\",confirmDelete)", '<i class="icon-remove"></i>', '', "title='{$lang->group->delete}' class='btn-icon'");
|
||||
echo html::a("javascript:ajaxDelete(\"$deleteURL\", \"groupList\", confirmDelete)", '<i class="icon-remove"></i>', '', "title='{$lang->group->delete}' class='btn-icon'");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<button class='btn-icon disabled'><i class='icon-remove disabled' title='{$lang->group->delete}'></i></button>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
@@ -11,6 +11,36 @@
|
||||
*/
|
||||
?>
|
||||
<form class='form-condensed' method='post' target='hiddenwin'>
|
||||
<?php if($group->role == 'limited'):?>
|
||||
<div id='featurebar'>
|
||||
<div class='heading'><i class='icon-lock'> <?php echo $group->name;?></i></div>
|
||||
</div>
|
||||
<table class='table table-hover table-striped table-bordered table-form'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $lang->group->module;?></th>
|
||||
<th><?php echo $lang->group->method;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr class='<?php echo cycle('even, bg-gray');?>'>
|
||||
<th class='text-right w-150px'><?php echo $lang->my->common;?></th>
|
||||
<td id='my' class='pv-10px'>
|
||||
<input type='checkbox' name='actions[my][]' value='limited' <?php if(isset($groupPrivs['my']['limited'])) echo "checked";?> />
|
||||
<span class='priv' id="my-limited"><?php echo $lang->my->limited;?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='text-right'></th>
|
||||
<td>
|
||||
<?php
|
||||
echo html::submitButton($lang->save, "onclick='setNoChecked()'");
|
||||
echo html::linkButton($lang->goback, $this->createLink('group', 'browse'));
|
||||
echo html::hidden('noChecked'); // Save the value of no checked.
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php else:?>
|
||||
<div id='featurebar'>
|
||||
<div class='heading'><i class='icon-lock'> <?php echo $group->name;?></i></div>
|
||||
<ul class='nav'>
|
||||
@@ -80,12 +110,12 @@
|
||||
<?php
|
||||
echo html::submitButton($lang->save, "onclick='setNoChecked()'");
|
||||
echo html::linkButton($lang->goback, $this->createLink('group', 'browse'));
|
||||
echo html::hidden('foo'); // Just a hidden var, to make sure $_POST is not empty.
|
||||
echo html::hidden('noChecked'); // Save the value of no checked.
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
</form>
|
||||
<script type='text/javascript'>
|
||||
var groupID = <?php echo $groupID?>;
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<div class='panel-body'>
|
||||
<?php echo $lineTree;?>
|
||||
<div class='text-right'>
|
||||
<?php common::printLink('tree', 'browse', "rootID=&view=line", $lang->tree->manageLine);?>
|
||||
<?php common::printLink('tree', 'browse', "rootID=$productID&view=line", $lang->tree->manageLine);?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -99,7 +99,7 @@ class testtaskModel extends model
|
||||
*/
|
||||
public function getProductTasks($productID, $branch = 0, $orderBy = 'id_desc', $pager = null, $scopeAndStatus = array(), $beginTime = 0, $endTime = 0)
|
||||
{
|
||||
if($scopeAndStatus[0] == 'all') $products = $this->loadModel('product')->getPairs();
|
||||
$products = $scopeAndStatus[0] == 'all' ? $this->loadModel('product')->getPairs() : array();
|
||||
if($this->config->global->flow == 'onlyTest')
|
||||
{
|
||||
return $this->dao->select("t1.*, t2.name AS productName,t4.name AS buildName, t4.branch AS branch")
|
||||
|
||||
@@ -178,7 +178,7 @@ class treeModel extends model
|
||||
*/
|
||||
public function getLinePairs()
|
||||
{
|
||||
return $this->dao->select('id, name')->from(TABLE_MODULE)->where('type')->eq('line')->fetchPairs();
|
||||
return $this->dao->select('id, name')->from(TABLE_MODULE)->where('type')->eq('line')->andWhere('deleted')->eq(0)->fetchPairs();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -127,3 +127,4 @@ $lang->upgrade->fromVersions['9_4'] = '9.4';
|
||||
$lang->upgrade->fromVersions['9_5'] = '9.5';
|
||||
$lang->upgrade->fromVersions['9_5_1'] = '9.5.1';
|
||||
$lang->upgrade->fromVersions['9_6'] = '9.6';
|
||||
$lang->upgrade->fromVersions['9_6_1'] = '9.6.1';
|
||||
|
||||
@@ -127,3 +127,4 @@ $lang->upgrade->fromVersions['9_4'] = '9.4';
|
||||
$lang->upgrade->fromVersions['9_5'] = '9.5';
|
||||
$lang->upgrade->fromVersions['9_5_1'] = '9.5.1';
|
||||
$lang->upgrade->fromVersions['9_6'] = '9.6';
|
||||
$lang->upgrade->fromVersions['9_6_1'] = '9.6.1';
|
||||
|
||||
@@ -127,3 +127,4 @@ $lang->upgrade->fromVersions['9_4'] = '9.4';
|
||||
$lang->upgrade->fromVersions['9_5'] = '9.5';
|
||||
$lang->upgrade->fromVersions['9_5_1'] = '9.5.1';
|
||||
$lang->upgrade->fromVersions['9_6'] = '9.6';
|
||||
$lang->upgrade->fromVersions['9_6_1'] = '9.6.1';
|
||||
|
||||
@@ -193,6 +193,8 @@ class upgradeModel extends model
|
||||
case '9_6':
|
||||
$this->execSQL($this->getUpgradeFile('9.6'));
|
||||
$this->fixDatatableColsConfig();
|
||||
case '9_6_1':
|
||||
$this->addLimitedGroup();
|
||||
}
|
||||
|
||||
$this->deletePatch();
|
||||
@@ -1854,4 +1856,49 @@ class upgradeModel extends model
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add limited group.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function addLimitedGroup()
|
||||
{
|
||||
$limitedGroup = $this->dao->select('*')->from(TABLE_GROUP)->where('`role`')->eq('limited')->fetch();
|
||||
if(empty($limitedGroup))
|
||||
{
|
||||
$group = new stdclass();
|
||||
$group->name = 'limited';
|
||||
$group->role = 'limited';
|
||||
$group->desc = 'For limited user';
|
||||
$this->dao->insert(TABLE_GROUP)->data($group)->exec();
|
||||
|
||||
$groupID = $this->dao->lastInsertID();
|
||||
}
|
||||
else
|
||||
{
|
||||
$groupID = $limitedGroup->id;
|
||||
}
|
||||
|
||||
$limitedGroups = $this->dao->select('`group`')->from(TABLE_GROUPPRIV)
|
||||
->where('module')->eq('my')
|
||||
->andWhere('method')->eq('limited')
|
||||
->fetchPairs('group', 'group');
|
||||
$this->dao->delete()->from(TABLE_GROUPPRIV)->where('module')->eq('my')->andWhere('method')->eq('limited')->exec();
|
||||
|
||||
$limitedUsers = $this->dao->select('account')->from(TABLE_USERGROUP)->where('`group`')->in($limitedGroups)->fetchPairs('account', 'account');
|
||||
foreach($limitedUsers as $limitedUser)
|
||||
{
|
||||
$this->dao->replace(TABLE_USERGROUP)->set('account')->eq($limitedUser)->set('`group`')->eq($groupID)->exec();
|
||||
}
|
||||
|
||||
$groupPriv = new stdclass();
|
||||
$groupPriv->group = $groupID;
|
||||
$groupPriv->module = 'my';
|
||||
$groupPriv->method = 'limited';
|
||||
$this->dao->replace(TABLE_GROUPPRIV)->data($groupPriv)->exec();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,6 +172,8 @@ class webhookModel extends model
|
||||
$webhook = fixer::input('post')
|
||||
->add('editedBy', $this->app->user->account)
|
||||
->add('editedDate', helper::now())
|
||||
->setDefault('products', '')
|
||||
->setDefault('projects', '')
|
||||
->join('products', ',')
|
||||
->join('projects', ',')
|
||||
->skipSpecial('url')
|
||||
|
||||
Reference in New Issue
Block a user