* adjust the user module's UI.
This commit is contained in:
+10
-5
@@ -41,7 +41,11 @@ class user extends control
|
||||
/* 用户的todo列表。*/
|
||||
public function todo($account, $type = 'today', $status = 'all')
|
||||
{
|
||||
$this->session->set('todoList', $this->app->getURI(true));
|
||||
/* 登记session。*/
|
||||
$uri = $this->app->getURI(true);
|
||||
$this->session->set('todoList', $uri);
|
||||
$this->session->set('bugList', $uri);
|
||||
$this->session->set('taskList', $uri);
|
||||
|
||||
/* 加载todo model。*/
|
||||
$this->loadModel('todo');
|
||||
@@ -122,6 +126,7 @@ class user extends control
|
||||
$this->assign('tabID', 'bug');
|
||||
$this->assign('bugs', $this->user->getBugs($account));
|
||||
$this->assign('user', $this->dao->findByAccount($account)->from(TABLE_USER)->fetch());
|
||||
$this->assign('users', $this->user->getPairs('noletter'));
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -242,7 +247,7 @@ class user extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->user->delete($userID);
|
||||
$this->user->delete(TABLE_USER, $userID);
|
||||
die(js::locate($this->createLink('company', 'browse'), 'parent'));
|
||||
}
|
||||
}
|
||||
@@ -312,16 +317,16 @@ class user extends control
|
||||
strpos($_POST['referer'], $this->app->company->pms) !== false
|
||||
)
|
||||
{
|
||||
$this->locate($_POST['referer']);
|
||||
die(js::locate($_POST['referer'], 'parent'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->locate($this->createLink($this->config->default->module));
|
||||
die(js::locate($this->createLink($this->config->default->module), 'parent'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->locate($this->createLink('user', 'login'));
|
||||
die(js::error($this->lang->user->loginFailed));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -52,8 +52,8 @@ $lang->user->story = '用户需求';
|
||||
$lang->user->team = '用户团队';
|
||||
$lang->user->editProfile = '修改信息';
|
||||
|
||||
$lang->user->welcom = "欢迎使用%s公司项目管理系统";
|
||||
$lang->user->errorDeny = "抱歉,您无权访问『<b>%s</b>』模块的『<b>%s</b>』功能。请联系管理员获取权限。点击后退返回上页。";
|
||||
$lang->user->errorDeny = "抱歉,您无权访问『<b>%s</b>』模块的『<b>%s</b>』功能。请联系管理员获取权限。点击后退返回上页。";
|
||||
$lang->user->loginFailed = "登录失败,请检查您的用户名或密码是否填写正确。";
|
||||
|
||||
$lang->user->gendarList->m = '男';
|
||||
$lang->user->gendarList->f = '女';
|
||||
|
||||
+7
-15
@@ -41,7 +41,7 @@ class userModel extends model
|
||||
/* 获得某一个公司的用户列表。*/
|
||||
public function getList()
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_USER)->orderBy('account')->fetchAll();
|
||||
return $this->dao->select('*')->from(TABLE_USER)->where('deleted')->eq(0)->orderBy('account')->fetchAll();
|
||||
}
|
||||
|
||||
/* 获得account=>realname的列表。params: noletter|noempty|noclosed。*/
|
||||
@@ -137,18 +137,6 @@ class userModel extends model
|
||||
return !dao::isError();
|
||||
}
|
||||
|
||||
/* 删除一个用户。*/
|
||||
public function delete($userID)
|
||||
{
|
||||
return $this->dao->update(TABLE_USER)->set('status')->eq('delete')->where('id')->eq($userID)->limit(1)->exec();
|
||||
}
|
||||
|
||||
/* 激活一个用户。*/
|
||||
public function activate($userID)
|
||||
{
|
||||
return $this->dao->update(TABLE_USER)->set('status')->eq('active')->where('id')->eq($userID)->limit(1)->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证用户的身份。
|
||||
*
|
||||
@@ -163,7 +151,11 @@ class userModel extends model
|
||||
$password = filter_var($password, FILTER_SANITIZE_STRING);
|
||||
if(!$account or !$password) return false;
|
||||
|
||||
$user = $this->dao->select('*')->from(TABLE_USER)->where('account')->eq($account)->andWhere('password')->eq(md5($password))->fetch();
|
||||
$user = $this->dao->select('*')->from(TABLE_USER)
|
||||
->where('account')->eq($account)
|
||||
->andWhere('password')->eq(md5($password))
|
||||
->andWhere('deleted')->eq(0)
|
||||
->fetch();
|
||||
if($user)
|
||||
{
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
@@ -237,6 +229,6 @@ class userModel extends model
|
||||
/* 获得用户的Bug列表。*/
|
||||
public function getBugs($account)
|
||||
{
|
||||
return $this->dao->findByAssignedTo($account)->from(TABLE_BUG)->fetchAll();
|
||||
return $this->dao->findByAssignedTo($account)->from(TABLE_BUG)->andWhere('deleted')->eq(0)->fetchAll();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,25 +28,27 @@
|
||||
<table class='table-1 tablesorter'>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<th><?php echo $lang->bug->id;?></th>
|
||||
<th><?php echo $lang->bug->severity;?></th>
|
||||
<th class='w-id'><?php echo $lang->idAB;?></th>
|
||||
<th class='w-severity'><?php echo $lang->bug->severityAB;?></th>
|
||||
<th class='w-pri'><?php echo $lang->priAB;?></th>
|
||||
<th class='w-type'><?php echo $lang->typeAB;?></th>
|
||||
<th><?php echo $lang->bug->title;?></th>
|
||||
<th><?php echo $lang->bug->openedBy;?></th>
|
||||
<th><?php echo $lang->bug->assignedTo;?></th>
|
||||
<th><?php echo $lang->bug->resolvedBy;?></th>
|
||||
<th><?php echo $lang->bug->resolution;?></th>
|
||||
<th class='w-user'><?php echo $lang->openedByAB;?></th>
|
||||
<th class='w-user'><?php echo $lang->bug->resolvedBy;?></th>
|
||||
<th class='w-resolution'><?php echo $lang->bug->resolutionAB;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($bugs as $bug):?>
|
||||
<tr class='a-center'>
|
||||
<td><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id"), $bug->id, '_blank');?></td>
|
||||
<td><?php echo $bug->severity?></td>
|
||||
<td width='50%' class='a-left'><?php echo $bug->title;?></td>
|
||||
<td><?php echo $bug->openedBy;?></td>
|
||||
<td><?php echo $bug->assignedTo;?></td>
|
||||
<td><?php echo $bug->resolvedBy;?></td>
|
||||
<td><?php echo $bug->resolution;?></td>
|
||||
<td><?php echo $lang->bug->severityList[$bug->severity]?></td>
|
||||
<td><?php echo $lang->bug->priList[$bug->pri]?></td>
|
||||
<td><?php echo $lang->bug->typeList[$bug->type]?></td>
|
||||
<td class='a-left nobr'><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id"), $bug->title);?></td>
|
||||
<td><?php echo $users[$bug->openedBy];?></td>
|
||||
<td><?php echo $users[$bug->resolvedBy];?></td>
|
||||
<td><?php echo $lang->bug->resolutionList[$bug->resolution];?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The index view file of user module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright 2009-2010 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package user
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/view/header.html.php';?>
|
||||
<div id='doc3'>
|
||||
</div>
|
||||
<?php include '../../common/view/view/footer.html.php';?>
|
||||
@@ -44,7 +44,7 @@ $themeRoot = $webRoot . "theme/";
|
||||
<style>#debugbar, .helplink {display:none}</style>
|
||||
<body onload="document.getElementById('account').focus();">
|
||||
<div class='yui-d0'>
|
||||
<form method='post' style='margin-top:100px'>
|
||||
<form method='post' style='margin-top:100px' target='hiddenwin'>
|
||||
<table align='center' class='table-4'>
|
||||
<caption><?php printf($lang->welcome, $app->company->name);?></caption>
|
||||
<tr>
|
||||
@@ -73,5 +73,8 @@ $themeRoot = $webRoot . "theme/";
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class='yui-d0' id='hiddenbar'>
|
||||
<iframe frameborder='0' name='hiddenwin' id='hiddenwin' class='hidden'></iframe>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -27,25 +27,28 @@
|
||||
<div class='yui-d0'>
|
||||
<table class='table-1 tablesorter a-center'>
|
||||
<thead>
|
||||
<tr class='rowhead'>
|
||||
<tr class='colhead'>
|
||||
<th class='w-id'><?php echo $lang->idAB;?></th>
|
||||
<th class='w-80px'><?php echo $lang->project->code;?></th>
|
||||
<th><?php echo $lang->project->name;?></th>
|
||||
<th><?php echo $lang->project->code;?></th>
|
||||
<th><?php echo $lang->project->begin;?></th>
|
||||
<th><?php echo $lang->project->end;?></th>
|
||||
<th><?php echo $lang->project->status;?></th>
|
||||
<th><?php echo $lang->team->role;?></th>
|
||||
<th><?php echo $lang->team->joinDate;?></th>
|
||||
<th><?php echo $lang->team->workingHour;?></th>
|
||||
<th class='w-date'><?php echo $lang->project->begin;?></th>
|
||||
<th class='w-date'><?php echo $lang->project->end;?></th>
|
||||
<th class='w-status'><?php echo $lang->statusAB;?></th>
|
||||
<th class='w-user'><?php echo $lang->team->role;?></th>
|
||||
<th class='w-date'><?php echo $lang->team->joinDate;?></th>
|
||||
<th class='w-date'><?php echo $lang->team->workingHour;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($projects as $project):?>
|
||||
<?php $projectLink = $this->createLink('project', 'browse', "projectID=$project->id");?>
|
||||
<tr>
|
||||
<td><?php echo html::a($this->createLink('project', 'browse', "projectID=$project->id"), $project->name);?></td>
|
||||
<td><?php echo html::a($projectLink, $project->id);?></td>
|
||||
<td><?php echo $project->code;?></td>
|
||||
<td><?php echo html::a($projectLink, $project->name);?></td>
|
||||
<td><?php echo $project->begin;?></td>
|
||||
<td><?php echo $project->end;?></td>
|
||||
<td><?php echo $project->status;?></td>
|
||||
<td><?php echo $lang->project->statusList[$project->status];?></td>
|
||||
<td><?php echo $project->role;?></td>
|
||||
<td><?php echo $project->joinDate;?></td>
|
||||
<td><?php echo $project->workingHour;?></td>
|
||||
|
||||
@@ -28,32 +28,29 @@
|
||||
<table class='table-1 tablesorter' id='tasktable'>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<th><?php echo $lang->task->id;?></th>
|
||||
<th><?php echo $lang->task->pri;?></th>
|
||||
<th><?php echo $lang->task->name;?></th>
|
||||
<th class='w-id'><?php echo $lang->idAB;?></th>
|
||||
<th class='w-pri'><?php echo $lang->priAB;?></th>
|
||||
<th><?php echo $lang->task->project;?></th>
|
||||
<th><?php echo $lang->task->estimate;?></th>
|
||||
<th><?php echo $lang->task->consumed;?></th>
|
||||
<th><?php echo $lang->task->left;?></th>
|
||||
<th><?php echo $lang->task->deadline;?></th>
|
||||
<th><?php echo $lang->task->status;?></th>
|
||||
<th><?php echo $lang->actions;?></th>
|
||||
<th><?php echo $lang->task->name;?></th>
|
||||
<th class='w-hour'><?php echo $lang->task->estimateAB;?></th>
|
||||
<th class='w-hour'><?php echo $lang->task->consumedAB;?></th>
|
||||
<th class='w-hour'><?php echo $lang->task->leftAB;?></th>
|
||||
<th class='w-date'><?php echo $lang->task->deadlineAB;?></th>
|
||||
<th class='w-status'><?php echo $lang->statusAB;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($tasks as $task):?>
|
||||
<tr class='a-center'>
|
||||
<td><?php echo html::a($this->createLink('task', 'view', "taskID=$task->id"), sprintf('%03d', $task->id));?></td>
|
||||
<td><?php echo $task->pri;?></td>
|
||||
<td class='a-left nobr'><?php echo html::a($this->createLink('task', 'view', "taskID=$task->id"), $task->name);?></td>
|
||||
<td><?php echo $lang->task->priList[$task->pri];?></td>
|
||||
<td class='nobr'><?php echo html::a($this->createLink('project', 'browse', "projectid=$task->projectID"), $task->projectName);?></th>
|
||||
<td class='a-left nobr'><?php echo html::a($this->createLink('task', 'view', "taskID=$task->id"), $task->name);?></td>
|
||||
<td><?php echo $task->estimate;?></td>
|
||||
<td><?php echo $task->consumed;?></td>
|
||||
<td><?php echo $task->left;?></td>
|
||||
<td class=<?php if(isset($task->delay)) echo 'delayed';?>><?php if(substr($task->deadline, 0, 4) > 0) echo $task->deadline;?></td>
|
||||
<td class='<?php echo $task->status;?>'><?php echo $lang->task->statusList[$task->status];?></td>
|
||||
<td><?php echo html::a($this->createLink('task', 'edit', "taskID=$task->id"), $lang->task->edit, '_blank');?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -37,11 +37,11 @@ function changeDate(date)
|
||||
<div id='featurebar'>
|
||||
<div class='f-left'>
|
||||
<?php
|
||||
echo '<span id="today">' . html::a($this->createLink('user', 'todo', "account=$account&date=today"), $lang->todo->todayTodos) . '</span>';
|
||||
echo '<span id="thisweek">' . html::a($this->createLink('user', 'todo', "account=$account&date=thisweek"), $lang->todo->thisWeekTodos) . '</span>';
|
||||
echo '<span id="lastweek">' . html::a($this->createLink('user', 'todo', "account=$account&date=lastweek"), $lang->todo->lastWeekTodos) . '</span>';
|
||||
echo '<span id="all">' . html::a($this->createLink('user', 'todo', "account=$account&date=all"), $lang->todo->allDaysTodos) . '</span>';
|
||||
echo '<span id="before">' . html::a($this->createLink('user', 'todo', "account=$account&date=before&account=$account&status=wait,doing"), $lang->todo->allUndone) . '</span>';
|
||||
echo '<span id="today">' . html::a(inlink('todo', "account=$account&date=today"), $lang->todo->todayTodos) . '</span>';
|
||||
echo '<span id="thisweek">' . html::a(inlink('todo', "account=$account&date=thisweek"), $lang->todo->thisWeekTodos) . '</span>';
|
||||
echo '<span id="lastweek">' . html::a(inlink('todo', "account=$account&date=lastweek"), $lang->todo->lastWeekTodos) . '</span>';
|
||||
echo '<span id="all">' . html::a(inlink('todo', "account=$account&date=all"), $lang->todo->allDaysTodos) . '</span>';
|
||||
echo '<span id="before">' . html::a(inlink('todo', "account=$account&date=before&status=undone"), $lang->todo->allUndone) . '</span>';
|
||||
echo "<span id='$date'>" . html::select('date', $dates, $date, 'onchange=changeDate(this.value)') . '</span>';
|
||||
?>
|
||||
<script>$('#<?php echo $type;?>').addClass('active')</script>
|
||||
@@ -50,14 +50,14 @@ function changeDate(date)
|
||||
<table class='table-1 tablesorter'>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<th><?php echo $lang->todo->id;?></th>
|
||||
<th><?php echo $lang->todo->date;?></th>
|
||||
<th><?php echo $lang->todo->type;?></th>
|
||||
<th><?php echo $lang->todo->pri;?></th>
|
||||
<th class='w-id'><?php echo $lang->idAB;?></th>
|
||||
<th class='w-date'><?php echo $lang->todo->date;?></th>
|
||||
<th class='w-type'><?php echo $lang->todo->type;?></th>
|
||||
<th class='w-pri'><?php echo $lang->priAB;?></th>
|
||||
<th><?php echo $lang->todo->name;?></th>
|
||||
<th><?php echo $lang->todo->begin;?></th>
|
||||
<th><?php echo $lang->todo->end;?></th>
|
||||
<th><?php echo $lang->todo->status;?></th>
|
||||
<th class='w-hour'><?php echo $lang->todo->beginAB;?></th>
|
||||
<th class='w-hour'><?php echo $lang->todo->endAB;?></th>
|
||||
<th class='w-status'><?php echo $lang->todo->status;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user