From f2d86d3b41dbe3813399e71ad202afbade8ce552 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 20 Jun 2013 08:23:08 +0000 Subject: [PATCH] * code for view todo. --- module/action/model.php | 2 + module/common/model.php | 4 +- module/common/view/m.action.html.php | 123 ++++++++++++++++++++++++ module/my/control.php | 2 +- module/my/view/m.todo.html.php | 16 ++- module/todo/view/m.batchcreate.html.php | 2 +- module/todo/view/m.view.html.php | 44 +++++++++ 7 files changed, 189 insertions(+), 4 deletions(-) create mode 100644 module/common/view/m.action.html.php create mode 100755 module/todo/view/m.view.html.php diff --git a/module/action/model.php b/module/action/model.php index 989444f930..ff3351c766 100644 --- a/module/action/model.php +++ b/module/action/model.php @@ -308,6 +308,8 @@ class actionModel extends model $desc = $action->extra ? $this->lang->action->desc->extra : $this->lang->action->desc->common; } + if($this->app->getViewType() == 'mhtml') $action->date = date('y-m-d H:i', strtotime($action->date)); + /* Cycle actions, replace vars. */ foreach($action as $key => $value) { diff --git a/module/common/model.php b/module/common/model.php index 79676450a9..928c6655b4 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -269,6 +269,7 @@ class commonModel extends model } unset($this->lang->menuOrder); + unset($this->lang->menugroup); $this->lang->menu = new stdclass(); $this->lang->menu = $menu; } @@ -288,8 +289,9 @@ class commonModel extends model /* Set the main main menu. */ $mainMenu = $moduleName; - if($moduleName == 'my') $mainMenu = $methodName; + if($moduleName == 'my' and $app->getViewType()) $mainMenu = $methodName; if(isset($lang->menugroup->$moduleName)) $mainMenu = $lang->menugroup->$moduleName; + if($moduleName == 'todo' and $app->getViewType()) $mainMenu = $moduleName; /* Sort menu according to menuOrder. */ if(isset($lang->menuOrder)) diff --git a/module/common/view/m.action.html.php b/module/common/view/m.action.html.php new file mode 100644 index 0000000000..330bf3d46e --- /dev/null +++ b/module/common/view/m.action.html.php @@ -0,0 +1,123 @@ + +getExtViewFile(__FILE__)){include $extView; return helper::cd();}?> + + +
+
+ + history?> + + +
    + + +
  1. + actor])) $action->actor = $users[$action->actor]; + if($action->action == 'assigned' and isset($users[$action->extra]) ) $action->extra = $users[$action->extra]; + if(strpos($action->actor, ':') !== false) $action->actor = substr($action->actor, strpos($action->actor, ':') + 1); + ?> + + action->printAction($action);?> + + comment) or !empty($action->history)):?> + comment)) echo "
    ";?> + comment) echo strip_tags($action->comment) == $action->comment ? nl2br($action->comment) : $action->comment; ?> + comment)) echo "
    ";?> + +
  2. + +
+ +
+
diff --git a/module/my/control.php b/module/my/control.php index 6c1e902a50..a8a29e7ad5 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -69,7 +69,7 @@ class my extends control * @access public * @return void */ - public function todo($type = 'today', $account = '', $status = 'all', $orderBy = "date,status,begin", $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function todo($type = 'today', $account = '', $status = 'all', $orderBy = "date_desc,status,begin", $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Save session. */ $uri = $this->app->getURI(true); diff --git a/module/my/view/m.todo.html.php b/module/my/view/m.todo.html.php index 9181e32aa2..438a78e325 100755 --- a/module/my/view/m.todo.html.php +++ b/module/my/view/m.todo.html.php @@ -22,7 +22,21 @@

show('right', 'short')?>

diff --git a/module/todo/view/m.batchcreate.html.php b/module/todo/view/m.batchcreate.html.php index 418b644ea1..a36da19cfd 100755 --- a/module/todo/view/m.batchcreate.html.php +++ b/module/todo/view/m.batchcreate.html.php @@ -23,6 +23,6 @@ echo html::hidden("begins[$i]", '2400'); echo html::hidden("ends[$i]", '2400'); ?> -

+

diff --git a/module/todo/view/m.view.html.php b/module/todo/view/m.view.html.php new file mode 100755 index 0000000000..34d05da41a --- /dev/null +++ b/module/todo/view/m.view.html.php @@ -0,0 +1,44 @@ + + * @package todo + * @version $Id: view.html.php 4642 2013-04-11 05:38:37Z chencongzhi520@gmail.com $ + * @link http://www.zentao.net + */ +?> + + +private or ($todo->private and $todo->account == $app->user->account)):?> +

id $todo->name"?>

+
desc;?> + + +todo->thisIsPrivate;?> + +
+
+
    + session->todoList) + { + $browseLink = $this->session->todoList; + } + else + { + $browseLink = $this->createLink('my', 'todo'); + } + if(common::hasPriv('todo', 'finish') and $todo->status != 'done') echo '
  • ' . html::a($this->createLink('todo', 'finish', "id=$todo->id"), $lang->todo->finish, 'hiddenwin') . '
  • '; + if($todo->account == $app->user->account and common::hasPriv('todo', 'delete')) + { + echo '
  • ' . html::a($this->createLink('todo', 'delete', "todoID=$todo->id"), $lang->delete, 'hiddenwin') . '
  • '; + } + echo '
  • ' . html::a($browseLink, $lang->goback) . '
  • '; +?> +
+
+
+