* Finish task#8102.
This commit is contained in:
+2
-2
@@ -37,7 +37,7 @@ INSERT INTO `zt_group` (`name`, `role`, `desc`) VALUES ('项目管理员', 'PRJa
|
||||
|
||||
ALTER TABLE `zt_usergroup` ADD `PRJ` text NOT NULL;
|
||||
|
||||
ALTER TABLE `zt_userview` ADD `PRJ` mediumtext COLLATE 'utf8_general_ci' NOT NULL AFTER `account`;
|
||||
ALTER TABLE `zt_userview` ADD `programs` mediumtext NOT NULL AFTER `account`, ADD `stages` mediumtext NOT NULL AFTER `projects`, ADD `sprints` mediumtext NOT NULL AFTER `stages`;
|
||||
|
||||
ALTER TABLE `zt_user` ADD `type` char(30) NOT NULL default 'inside' AFTER `account`;
|
||||
|
||||
@@ -299,4 +299,4 @@ INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type
|
||||
|
||||
ALTER TABLE `zt_story` ADD `URChanged` enum('0','1') NOT NULL DEFAULT '0' AFTER `version`;
|
||||
|
||||
ALTER TABLE `zt_team` MODIFY COLUMN `type` enum('project','task','stage','sprint') NOT NULL DEFAULT 'project' AFTER `root`;
|
||||
ALTER TABLE `zt_team` MODIFY `type` enum('project','task','stage','sprint') NOT NULL DEFAULT 'project' AFTER `root`;
|
||||
|
||||
+3
-1
@@ -1255,9 +1255,11 @@ CREATE TABLE IF NOT EXISTS `zt_usertpl` (
|
||||
-- DROP TABLE IF EXISTS `zt_userview`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_userview` (
|
||||
`account` char(30) NOT NULL,
|
||||
`PRJ` mediumtext NOT NULL,
|
||||
`programs` mediumtext NOT NULL,
|
||||
`products` mediumtext NOT NULL,
|
||||
`projects` mediumtext NOT NULL,
|
||||
`stages` mediumtext NOT NULL,
|
||||
`sprints` mediumtext NOT NULL,
|
||||
UNIQUE KEY `account` (`account`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_entry`;
|
||||
|
||||
@@ -254,8 +254,10 @@ class programModel extends model
|
||||
{
|
||||
/* Child program begin cannot less than parent. */
|
||||
if($program->begin < $parentProgram->begin) dao::$errors['begin'] = sprintf($this->lang->program->beginLetterParent, $parentProgram->begin);
|
||||
|
||||
/* When parent set end then child program end cannot greater than parent. */
|
||||
if($parentProgram->end != '0000-00-00' and $program->end > $parentProgram->end) dao::$errors['end'] = sprintf($this->lang->program->endGreaterParent, $parentProgram->end);
|
||||
|
||||
/* When parent set end then child program cannot set longTime. */
|
||||
if(empty($program->end) and $this->post->longTime and $parentProgram->end != '0000-00-00') dao::$errors['end'] = sprintf($this->lang->program->endGreaterParent, $parentProgram->end);
|
||||
|
||||
@@ -289,9 +291,10 @@ class programModel extends model
|
||||
->where('t1.account')->eq($this->app->user->account)
|
||||
->andWhere('t2.role')->eq('PRJadmin')
|
||||
->fetch();
|
||||
|
||||
if(!empty($groupPriv))
|
||||
{
|
||||
$newProgram = $groupPriv->program . ",$programID";
|
||||
$newProgram = $groupPriv->PRJ . ",$programID";
|
||||
$this->dao->update(TABLE_USERGROUP)->set('PRJ')->eq($newProgram)->where('account')->eq($groupPriv->account)->andWhere('`group`')->eq($groupPriv->group)->exec();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -99,10 +99,6 @@
|
||||
<?php echo html::textarea('desc', '', "rows='6' class='form-control kindeditor' hidefocus='true'");?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->program->auth;?></th>
|
||||
<td colspan='3'><?php echo html::radio('auth', $lang->program->PGMAuthList, 'extend', '', 'block');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->acl;?></th>
|
||||
<td colspan='3'><?php echo nl2br(html::radio('acl', $lang->program->PGMAclList, 'open', "onclick='setWhite(this.value);'", 'block'));?></td>
|
||||
|
||||
@@ -68,10 +68,6 @@
|
||||
<?php echo html::textarea('desc', $program->desc, "rows='6' class='form-control kindeditor' hidefocus='true'");?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->program->auth;?></th>
|
||||
<td colspan='3'><?php echo html::radio('auth', $lang->program->PGMAuthList, $program->auth, '', 'block');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->acl;?></th>
|
||||
<td colspan='3'><?php echo nl2br(html::radio('acl', $lang->program->PGMAclList, $program->acl, "onclick='setWhite(this.value);'", 'block'));?></td>
|
||||
|
||||
@@ -1440,8 +1440,9 @@ class userModel extends model
|
||||
/**
|
||||
* Grant user view.
|
||||
*
|
||||
* @param string $account
|
||||
* @param array $acls
|
||||
* @param string $account
|
||||
* @param array $acls
|
||||
* @param string $programs
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
@@ -1461,7 +1462,7 @@ class userModel extends model
|
||||
->fetchAll('id');
|
||||
|
||||
$openedPrograms = join(',', array_keys($openedPrograms));
|
||||
$userView->programs = rtrim($userView->PRJ, ',') . ',' . $openedPrograms;
|
||||
$userView->programs = rtrim($userView->programs, ',') . ',' . $openedPrograms;
|
||||
if(isset($_SESSION['user']->admin)) $isAdmin = $this->session->user->admin;
|
||||
if(!isset($isAdmin)) $isAdmin = strpos($this->app->company->admins, ",{$account},") !== false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user