diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 5e10c520b1..7b5f85b40c 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -215,16 +215,7 @@ $lang->company->menu->addGroup = array('link' => '&nb $lang->company->menu->addUser = array('link' => ' Add User|user|create|dept=%s&from=company', 'subModule' => 'user', 'float' => 'right'); $lang->dept->menu = $lang->company->menu; $lang->group->menu = $lang->company->menu; - -/* User menu. */ -$lang->user->menu->account = '%s' . $lang->arrow; -$lang->user->menu->todo = array('link' => 'Todo|user|todo|account=%s', 'subModule' => 'todo'); -$lang->user->menu->task = 'Task|user|task|account=%s'; -$lang->user->menu->bug = 'Bug|user|bug|account=%s'; -$lang->user->menu->dynamic = 'Dynamic|user|dynamic|type=today&account=%s'; -$lang->user->menu->projectList = 'Project|user|project|account=%s'; -$lang->user->menu->profile = array('link' => 'Profile|user|profile|account=%s', 'alias' => 'edit'); -$lang->user->menu->browse = array('link' => ' Manage user|company|browse|', 'float' => 'right'); +$lang->user->menu = $lang->company->menu; /* Admin menu. */ $lang->admin->menu->index = array('link' => 'Index|admin|index'); diff --git a/module/common/lang/menuOrder.php b/module/common/lang/menuOrder.php index 98a42a78b4..944b01c859 100644 --- a/module/common/lang/menuOrder.php +++ b/module/common/lang/menuOrder.php @@ -101,16 +101,7 @@ $lang->company->menuOrder[30] = 'addGroup'; $lang->company->menuOrder[35] = 'addUser'; $lang->dept->menuOrder = $lang->company->menuOrder; $lang->group->menuOrder = $lang->company->menuOrder; - -/* user menu order. */ -$lang->user->menuOrder[0] = 'account'; -$lang->user->menuOrder[5] = 'todo'; -$lang->user->menuOrder[10] = 'task'; -$lang->user->menuOrder[15] = 'bug'; -$lang->user->menuOrder[20] = 'dynamic'; -$lang->user->menuOrder[25] = 'projectList'; -$lang->user->menuOrder[30] = 'profile'; -$lang->user->menuOrder[35] = 'browse'; +$lang->user->menuOrder = $lang->company->menuOrder; /* admin menu order. */ $lang->admin->menuOrder[5] = 'index'; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 968e6ed483..b393af9758 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -215,16 +215,7 @@ $lang->company->menu->addGroup = array('link' => '&nb $lang->company->menu->addUser = array('link' => ' 添加用户|user|create|dept=%s', 'subModule' => 'user', 'float' => 'right'); $lang->dept->menu = $lang->company->menu; $lang->group->menu = $lang->company->menu; - -/* 用户信息菜单设置。*/ -$lang->user->menu->account = '%s' . $lang->arrow; -$lang->user->menu->todo = array('link' => 'TODO列表|user|todo|account=%s', 'subModule' => 'todo'); -$lang->user->menu->task = '任务列表|user|task|account=%s'; -$lang->user->menu->bug = 'Bug列表|user|bug|account=%s'; -$lang->user->menu->dynamic = '用户动态|user|dynamic|type=today&account=%s'; -$lang->user->menu->projectList = '项目列表|user|project|account=%s'; -$lang->user->menu->profile = array('link' => '用户信息|user|profile|account=%s', 'alias' => 'edit'); -$lang->user->menu->browse = array('link' => ' 用户管理|company|browse|', 'float' => 'right'); +$lang->user->menu = $lang->company->menu; /* 后台管理菜单设置。*/ $lang->admin->menu->index = array('link' => '首页|admin|index'); @@ -241,7 +232,6 @@ $lang->extension->menu = $lang->admin->menu; $lang->editor->menu = $lang->admin->menu; $lang->mail->menu = $lang->admin->menu; -/*菜单设置:分组设置。*/ $lang->menugroup->release = 'product'; $lang->menugroup->story = 'product'; $lang->menugroup->productplan = 'product'; diff --git a/module/common/view/datepicker.html.php b/module/common/view/datepicker.html.php index 64fb7a2191..2b818a1f74 100644 --- a/module/common/view/datepicker.html.php +++ b/module/common/view/datepicker.html.php @@ -13,7 +13,7 @@ $.dpText = { TEXT_NEXT_YEAR : '明年', TEXT_NEXT_MONTH : '下个月', TEXT_CLOSE : '关闭', - TEXT_CHOOSE_DATE : '    ' + TEXT_CHOOSE_DATE : '     ' } Date.dayNames = ['日', '一', '二', '三', '四', '五', '六']; Date.abbrDayNames = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']; diff --git a/module/user/control.php b/module/user/control.php index dbcb54e14c..33f37659a8 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -24,6 +24,7 @@ class user extends control parent::__construct(); $this->loadModel('company')->setMenu(); $this->loadModel('dept'); + $this->loadModel('todo'); } /** @@ -35,7 +36,7 @@ class user extends control */ public function view($account) { - $this->locate($this->createLink('user', 'profile', "account=$account")); + $this->locate($this->createLink('user', 'todo', "account=$account")); } /** @@ -65,10 +66,11 @@ class user extends control /* set menus. */ $this->lang->set('menugroup.user', 'company'); $this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $account); /* Get user, totos. */ $user = $this->dao->findByAccount($account)->from(TABLE_USER)->fetch(); - $todos = $this->loadModel('todo')->getList($type, $account, $status, 0, $pager); + $todos = $this->todo->getList($type, $account, $status, 0, $pager); $date = (int)$type == 0 ? $this->todo->today() : $type; $header['title'] = $this->lang->company->orgView . $this->lang->colon . $this->lang->user->todo; @@ -77,7 +79,6 @@ class user extends control $this->view->header = $header; $this->view->position = $position; $this->view->tabID = 'todo'; - $this->view->dates = $this->todo->buildDateList(); $this->view->date = $date; $this->view->todos = $todos; $this->view->user = $user; @@ -110,6 +111,7 @@ class user extends control /* Set the menu. */ $this->lang->set('menugroup.user', 'company'); $this->user->setMenu($this->user->getPairs('noempty|noclosed'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $account); /* Assign. */ $header['title'] = $this->lang->user->common . $this->lang->colon . $this->lang->user->task; @@ -118,6 +120,7 @@ class user extends control $this->view->position = $position; $this->view->tabID = 'task'; $this->view->tasks = $this->loadModel('task')->getUserTasks($account, 'assignedto', 0, $pager); + $this->view->account = $account; $this->view->user = $this->dao->findByAccount($account)->from(TABLE_USER)->fetch(); $this->view->pager = $pager; @@ -146,6 +149,7 @@ class user extends control /* Set menu. */ $this->lang->set('menugroup.user', 'company'); $this->user->setMenu($this->user->getPairs('noempty|noclosed'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $account); /* Load the lang of bug module. */ $this->app->loadLang('bug'); @@ -157,6 +161,7 @@ class user extends control $this->view->position = $position; $this->view->tabID = 'bug'; $this->view->bugs = $this->user->getBugs($account, $pager); + $this->view->account = $account; $this->view->user = $this->dao->findByAccount($account)->from(TABLE_USER)->fetch(); $this->view->users = $this->user->getPairs('noletter'); $this->view->pager = $pager; @@ -177,6 +182,7 @@ class user extends control $this->loadModel('project'); $this->lang->set('menugroup.user', 'company'); $this->user->setMenu($this->user->getPairs('noempty|noclosed'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $account); $header['title'] = $this->lang->user->common . $this->lang->colon . $this->lang->user->project; $position[] = $this->lang->user->project; @@ -184,6 +190,7 @@ class user extends control $this->view->position = $position; $this->view->tabID = 'project'; $this->view->projects = $this->user->getProjects($account); + $this->view->account = $account; $this->view->user = $this->dao->findByAccount($account)->from(TABLE_USER)->fetch(); $this->display(); @@ -202,6 +209,7 @@ class user extends control /* Set menu. */ $this->user->setMenu($this->user->getPairs('noempty|noclosed'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $account); $user = $this->user->getById($account); $deptPath = $this->dept->getParents($user->dept); @@ -209,6 +217,7 @@ class user extends control $header['title'] = "USER #$user->id $user->account/" . $this->lang->user->profile; $this->view->header = $header; $this->view->position = $position; + $this->view->account = $account; $this->view->user = $user; $this->view->deptPath = $deptPath; @@ -488,6 +497,7 @@ class user extends control /* set menus. */ $this->lang->set('menugroup.user', 'company'); $this->user->setMenu($this->user->getPairs('noempty|noclosed'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $account); /* Save session. */ $uri = $this->app->getURI(true); @@ -515,6 +525,7 @@ class user extends control $this->view->period = $period; $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noletter'); $this->view->account = $account; + $this->view->user = $this->dao->findByAccount($account)->from(TABLE_USER)->fetch(); $this->view->actions = $this->loadModel('action')->getDynamic($account, $period, $orderBy, $pager); $this->display(); } diff --git a/module/user/css/common.css b/module/user/css/common.css new file mode 100644 index 0000000000..c3966a803e --- /dev/null +++ b/module/user/css/common.css @@ -0,0 +1,2 @@ +.cont-lt1 .side {width: 120px;} +.cont-lt1 .side .box-title{padding: 3px;} diff --git a/module/user/js/common.js b/module/user/js/common.js new file mode 100644 index 0000000000..879bed4354 --- /dev/null +++ b/module/user/js/common.js @@ -0,0 +1,25 @@ +/** + * Switch account + * + * @param string $account + * @param string $method + * @access public + * @return void + */ +function switchAccount(account, method) +{ + if(method == 'dynamic') + { + link = createLink('user', method, 'period=' + period + '&account=' + account); + } + else if(method == 'todo') + { + link = createLink('user', method, 'account=' + account + '&type=' + type); + } + else + { + link = createLink('user', method, 'account=' + account); + } + location.href=link; +} + diff --git a/module/user/js/todo.js b/module/user/js/todo.js index 371d1d6c68..12e9e0d29d 100644 --- a/module/user/js/todo.js +++ b/module/user/js/todo.js @@ -1,5 +1,4 @@ function changeDate(date) { - link = createLink('user', 'todo', 'account=' + account + '&date=' + date); - location.href=link; + location.href = createLink('user', 'todo', 'account=' + account + '&type=' + date.replace(/\-/g, '')); } diff --git a/module/user/model.php b/module/user/model.php index 2e8590717f..f81ab07cdb 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -32,6 +32,19 @@ class userModel extends model } } + /** + * Set users list. + * + * @param array $users + * @param string $account + * @access public + * @return html + */ + public function setUserList($users, $account) + { + return html::select('account', $users, $account, "onchange=\"switchAccount(this.value, '{$this->app->getMethodName()}')\""); + } + /** * Get users list of current company. * diff --git a/module/user/view/bug.html.php b/module/user/view/bug.html.php index 6df0d63cc2..ddb99947d9 100644 --- a/module/user/view/bug.html.php +++ b/module/user/view/bug.html.php @@ -12,6 +12,7 @@ ?> + diff --git a/module/user/view/dynamic.html.php b/module/user/view/dynamic.html.php index 30a4c16d48..fa1d25245e 100644 --- a/module/user/view/dynamic.html.php +++ b/module/user/view/dynamic.html.php @@ -12,47 +12,53 @@ ?> -
- ' . html::a(inlink('dynamic', "type=today&account=$account"), $lang->action->dynamic->today) . ''; - echo '' . html::a(inlink('dynamic', "type=yesterday&account=$account"), $lang->action->dynamic->yesterday) . ''; - echo '' . html::a(inlink('dynamic', "type=twodaysago&account=$account"), $lang->action->dynamic->twoDaysAgo) . ''; - echo '' . html::a(inlink('dynamic', "type=thisweek&account=$account"), $lang->action->dynamic->thisWeek) . ''; - echo '' . html::a(inlink('dynamic', "type=lastweek&account=$account"), $lang->action->dynamic->lastWeek) . ''; - echo '' . html::a(inlink('dynamic', "type=thismonth&account=$account"), $lang->action->dynamic->thisMonth) . ''; - echo '' . html::a(inlink('dynamic', "type=lastmonth&account=$account"), $lang->action->dynamic->lastMonth) . ''; - echo '' . html::a(inlink('dynamic', "type=all&account=$account"), $lang->action->dynamic->all) . ''; - ?> -
- -
- - - - - - - - + +
action->date;?> action->actor;?>action->action;?> action->objectType;?> idAB;?>action->objectName;?>
+ + + + - - - - objectType == 'case' ? 'testcase' : $action->objectType;?> - - - - - - - - - - -
+
user->dynamic;?>
+
+ action->dynamic->today) . '
'; + echo html::a(inLink('dynamic', "period=yesterday&account=$account"), $lang->action->dynamic->yesterday) . '
'; + echo html::a(inLink('dynamic', "period=twodaysago&account=$account"), $lang->action->dynamic->twoDaysAgo) . '
'; + echo html::a(inLink('dynamic', "period=thisweek&account=$account"), $lang->action->dynamic->thisWeek) . '
'; + echo html::a(inLink('dynamic', "period=lastweek&account=$account"), $lang->action->dynamic->lastWeek) . '
'; + echo html::a(inLink('dynamic', "period=thismonth&account=$account"), $lang->action->dynamic->thisMonth) . '
'; + echo html::a(inLink('dynamic', "period=lastmonth&account=$account"), $lang->action->dynamic->lastMonth) . '
'; + echo html::a(inLink('dynamic', "period=all&account=$account"), $lang->action->dynamic->all) . '
'; + ?> +
+
+ + + + + + + + + + + + + + objectType == 'case' ? 'testcase' : $action->objectType;?> + + + + + + + + + + + +
action->date;?> action->actor;?>action->action;?> action->objectType;?> idAB;?>action->objectName;?>
date;?>actor];?>actionLabel;?>action->objectTypes[$action->objectType];?>objectID;?>objectLink, $action->objectName);?>
show();?>
+
date;?>actor];?>actionLabel;?>action->objectTypes[$action->objectType];?>objectID;?>objectLink, $action->objectName);?>
show();?>
- diff --git a/module/user/view/featurebar.html.php b/module/user/view/featurebar.html.php new file mode 100755 index 0000000000..0e40319fc2 --- /dev/null +++ b/module/user/view/featurebar.html.php @@ -0,0 +1,25 @@ + +
+
+ arrow; + echo ""; common::printLink('user', 'todo',"account=$account", $lang->user->todo); echo ''; + echo ""; common::printLink('user', 'task',"account=$account", $lang->user->task); echo ''; + echo "" ; common::printLink('user', 'bug', "account=$account", $lang->user->bug); echo ''; + echo ""; common::printLink('user', 'dynamic', "type=today&account=$account", $lang->user->dynamic); echo '' ; + echo ""; common::printLink('user', 'project', "account=$account", $lang->user->project); echo ''; + echo ""; common::printLink('user', 'profile', "account=$account", $lang->user->profile); echo ''; + + $activedSpan = $this->app->getMethodName() . 'Tab'; + echo ""; + ?> +
+
+ diff --git a/module/user/view/profile.html.php b/module/user/view/profile.html.php index ec3c8b1628..b9d57fbfaf 100644 --- a/module/user/view/profile.html.php +++ b/module/user/view/profile.html.php @@ -12,6 +12,7 @@ ?> + diff --git a/module/user/view/project.html.php b/module/user/view/project.html.php index e05ec7cf72..63d165f45d 100644 --- a/module/user/view/project.html.php +++ b/module/user/view/project.html.php @@ -12,6 +12,7 @@ ?> +
user->profile;?>
diff --git a/module/user/view/task.html.php b/module/user/view/task.html.php index 959b7db353..6507f759c6 100644 --- a/module/user/view/task.html.php +++ b/module/user/view/task.html.php @@ -12,6 +12,7 @@ ?> +
diff --git a/module/user/view/todo.html.php b/module/user/view/todo.html.php index ace47ba9bc..c8a1286d2a 100644 --- a/module/user/view/todo.html.php +++ b/module/user/view/todo.html.php @@ -12,51 +12,58 @@ ?> + -' id='todoform'> -
-
- ' . html::a(inlink('todo', "account=$account&date=today"), $lang->todo->todayTodos) . ''; - echo '' . html::a(inlink('todo', "account=$account&date=thisweek"), $lang->todo->thisWeekTodos) . ''; - echo '' . html::a(inlink('todo', "account=$account&date=lastweek"), $lang->todo->lastWeekTodos) . ''; - echo '' . html::a(inlink('todo', "account=$account&date=future"), $lang->todo->futureTodos) . ''; - echo '' . html::a(inlink('todo', "account=$account&date=all"), $lang->todo->allDaysTodos) . ''; - echo '' . html::a(inlink('todo', "account=$account&date=before&status=undone"), $lang->todo->allUndone) . ''; - echo "" . html::select('date', $dates, $date, 'onchange=changeDate(this.value)') . ''; - ?> - -
-
-
- - - - - - - - - - - - +
idAB;?>todo->date;?>todo->type;?>priAB;?>todo->name;?>todo->beginAB;?>todo->endAB;?>todo->status;?>
+ + + + + + + + + + + + + + + + + + +
+
+
+ todo->todayTodos) . '
'; + echo html::a(inLink('todo', "account=$account&type=thisweek"), $lang->todo->thisWeekTodos) . '
'; + echo html::a(inLink('todo', "account=$account&type=lastweek"), $lang->todo->lastWeekTodos) . '
'; + echo html::a(inLink('todo', "account=$account&type=future"), $lang->todo->futureTodos) . '
'; + echo html::a(inLink('todo', "account=$account&type=all"), $lang->todo->allDaysTodos) . '
'; + echo html::a(inLink('todo', "account=$account&type=before"), $lang->todo->allUndone) . '
'; + ?> +
+
+ ' id='todoform'> + + + + + + + + + + + + + - - - - - - - - - - - - - - - -
idAB;?>todo->date;?>todo->type;?>priAB;?>todo->name;?>todo->beginAB;?>todo->endAB;?>todo->status;?>
id;?>date == '2030-01-01' ? $lang->todo->dayInFuture : $todo->date;?>todo->typeList->{$todo->type};?>pri;?>id", $todo->name)) echo $todo->name;?>begin;?>end;?>todo->statusList[$todo->status];?>
show();?>
- +
id;?>date == '2030-01-01' ? $lang->todo->dayInFuture : $todo->date;?>todo->typeList->{$todo->type};?>pri;?>id", $todo->name)) echo $todo->name;?>begin;?>end;?>todo->statusList[$todo->status];?>
show();?>
+ + + + diff --git a/module/user/view/view.html.php b/module/user/view/view.html.php index ead760ab85..a2dba1c8ff 100644 --- a/module/user/view/view.html.php +++ b/module/user/view/view.html.php @@ -12,6 +12,7 @@ ?> +
diff --git a/www/js/my.full.js b/www/js/my.full.js index 757772bd6b..9fb08c3e25 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -286,27 +286,6 @@ function saveProject() if($('#projectID')) $.cookie('lastProject', $('#projectID').val(), {expires:config.cookieLife, path:config.webRoot}); } -/** - * Switch account - * - * @param string $account - * @param string $method - * @access public - * @return void - */ -function switchAccount(account, method) -{ - if(method == 'dynamic') - { - link = createLink('user', method, 'period=' + period + '&account=' + account); - } - else - { - link = createLink('user', method, 'account=' + account); - } - location.href=link; -} - /** * Set the ping url. *