diff --git a/module/common/control.php b/module/common/control.php
index 42f497a51f..ca4417d5c6 100644
--- a/module/common/control.php
+++ b/module/common/control.php
@@ -366,12 +366,15 @@ EOT;
/* ±ȽÏÁ½¸öÊý×éԪËصIJ»ͬ£¬²úÉúÐļǼ¡£*/
public static function createChanges($old, $new)
{
+ global $config;
$changes = array();
foreach($new as $key => $value)
{
if(strtolower($key) == 'lastediteddate') continue;
if(strtolower($key) == 'lasteditedby') continue;
- if($new->$key != $old->$key)
+
+ if(isset($config->db->stripSlash) and $config->db->stripSlash) $value = stripslashes($value);
+ if($value != $old->$key)
{
$diff = '';
if(substr_count($value, "\n") > 1 or substr_count($old->$key, "\n") > 1) $diff = self::diff($old->$key, $value);
diff --git a/module/group/lang/zh-cn.php b/module/group/lang/zh-cn.php
index a2a6679e73..2a1c56e3a7 100644
--- a/module/group/lang/zh-cn.php
+++ b/module/group/lang/zh-cn.php
@@ -55,6 +55,7 @@ $lang->resource->my->editProfile = 'editProfile';
$lang->resource->todo->create = 'create';
$lang->resource->todo->edit = 'edit';
+$lang->resource->todo->view = 'view';
$lang->resource->todo->delete = 'delete';
$lang->resource->todo->mark = 'mark';
$lang->resource->todo->import2Today = 'import2Today';
diff --git a/module/my/view/todo.html.php b/module/my/view/todo.html.php
index b0a6f8fdd3..8abe825cbf 100644
--- a/module/my/view/todo.html.php
+++ b/module/my/view/todo.html.php
@@ -40,7 +40,7 @@ function changeDate(date)
echo '' . html::a($this->createLink('my', 'todo', "date=thisweek"), $lang->todo->thisWeekTodos) . '';
echo '' . html::a($this->createLink('my', 'todo', "date=lastweek"), $lang->todo->lastWeekTodos) . '';
echo '' . html::a($this->createLink('my', 'todo', "date=all"), $lang->todo->allDaysTodos) . '';
- echo '' . html::a($this->createLink('my', 'todo', "date=before&account={$app->user->account}&status=wait,doing"), $lang->todo->allUndone) . '';
+ echo '' . html::a($this->createLink('my', 'todo', "date=before&account={$app->user->account}&status=undone"), $lang->todo->allUndone) . '';
echo "" . html::select('date', $dates, $date, 'onchange=changeDate(this.value)') . '';
?>
@@ -86,7 +86,7 @@ function changeDate(date)
begin;?> |
end;?> |
- todo->statusList->{$todo->status};?> |
+ todo->statusList[$todo->status];?> |
createLink('todo', 'mark', "id=$todo->id&status=$todo->status"), $lang->todo->{'mark'.ucfirst($todo->status)}, 'hiddenwin');
diff --git a/module/todo/control.php b/module/todo/control.php
index 3f872f2c79..90e239e006 100644
--- a/module/todo/control.php
+++ b/module/todo/control.php
@@ -81,6 +81,22 @@ class todo extends control
$this->display();
}
+ /* 查看todo。*/
+ public function view($todoID)
+ {
+ $todo = $this->todo->findById($todoID);
+ $this->lang->todo->menu = $this->lang->user->menu;
+ $this->loadModel('user')->setMenu($this->user->getPairs(), $todo->account);
+ $this->lang->set('menugroup.todo', 'company');
+
+ $this->view->header->title = $this->lang->todo->view;
+ $this->view->position[] = $this->lang->todo->view;
+ $this->view->todo = $todo;
+ $this->view->times = $this->todo->buildTimeList();
+
+ $this->display();
+ }
+
/* 删除一个todo。*/
public function delete($todoID, $confirm = 'no')
{
diff --git a/module/todo/lang/zh-cn.php b/module/todo/lang/zh-cn.php
index 09b748c47d..7a08b4d6ae 100644
--- a/module/todo/lang/zh-cn.php
+++ b/module/todo/lang/zh-cn.php
@@ -25,6 +25,7 @@ $lang->todo->common = 'TODO';
$lang->todo->index = "todo一览";
$lang->todo->create = "新增TODO";
$lang->todo->edit = "更新";
+$lang->todo->view = "TODO详情";
$lang->todo->markDone = "未完成";
$lang->todo->markWait = "已完成";
$lang->todo->markDoing = "已完成";
@@ -32,6 +33,7 @@ $lang->todo->mark = "更改状态";
$lang->todo->delete = "删除";
$lang->todo->browse = "浏览TODO";
$lang->todo->import2Today = "导入到今天";
+$lang->todo->changeStatus = "更改";
$lang->todo->id = '编号';
$lang->todo->date = '日期';
@@ -49,9 +51,12 @@ $lang->todo->week = '星期';
$lang->todo->today = '今天';
$lang->todo->weekDateList = '一,二,三,四,五,六,天';
-$lang->todo->statusList->wait = '未开始';
-$lang->todo->statusList->doing = '进行中';
-$lang->todo->statusList->done = '已完成';
+$lang->todo->statusList[''] = '';
+$lang->todo->statusList['wait'] = '未开始';
+$lang->todo->statusList['doing'] = '进行中';
+$lang->todo->statusList['done'] = '已完成';
+//$lang->todo->statusList['cancel'] = '已取消';
+//$lang->todo->statusList['postpone'] = '已延期';
$lang->todo->priList[3] = '一般';
$lang->todo->priList[1] = '最高';
diff --git a/module/todo/model.php b/module/todo/model.php
index 3d72fc2a17..49d0c5a46d 100644
--- a/module/todo/model.php
+++ b/module/todo/model.php
@@ -116,13 +116,13 @@ class todoModel extends model
}
if($account == '') $account = $this->app->user->account;
- if($status == 'all') $status = 'wait,doing,done';
$stmt = $this->dao->select('*')->from(TABLE_TODO)
->where('account')->eq($account)
->andWhere("date >= '$begin'")
->andWhere("date <= '$end'")
- ->andWhere('status')->in($status)
+ ->onCaseOf($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->endCase()
+ ->onCaseOf($status == 'undone')->andWhere('status')->ne('done')->endCase()
->orderBy('date, status, begin')
->query();
while($todo = $stmt->fetch())
diff --git a/module/user/view/todo.html.php b/module/user/view/todo.html.php
index daa585cd88..5cbcee4403 100644
--- a/module/user/view/todo.html.php
+++ b/module/user/view/todo.html.php
@@ -68,10 +68,10 @@ function changeDate(date)
| date;?> |
todo->typeList->{$todo->type};?> |
pri;?> |
- name;?> |
+ id", $todo->name)) echo $todo->name;?> |
begin;?> |
end;?> |
- todo->statusList->{$todo->status};?> |
+ todo->statusList[$todo->status];?> |