From 591f918a98cbf5d1f5ffca1c425331355f8be9e1 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Mon, 30 Apr 2012 06:32:12 +0000 Subject: [PATCH] * only set image size when view a todo. --- module/todo/control.php | 4 ++-- module/todo/model.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/module/todo/control.php b/module/todo/control.php index b2ef3fd67f..cdaa01f004 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -15,7 +15,7 @@ class todo extends control * Construct function, load model of task, bug, my. * * @access public - * @return voidzentaoms\www + * @return void */ public function __construct() { @@ -133,7 +133,7 @@ class todo extends control */ public function view($todoID, $from = 'company') { - $todo = $this->todo->getById($todoID); + $todo = $this->todo->getById($todoID, true); if(!$todo) die(js::error($this->lang->notFound) . js::locate('back')); /* Save the session. */ diff --git a/module/todo/model.php b/module/todo/model.php index 6fb0ad8cb6..0c874d9010 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -143,14 +143,15 @@ class todoModel extends model * Get info of a todo. * * @param int $todoID + * @param bool $setImgSize * @access public * @return object|bool */ - public function getById($todoID) + public function getById($todoID, $setImgSize = false) { $todo = $this->dao->findById((int)$todoID)->from(TABLE_TODO)->fetch(); if(!$todo) return false; - $todo->desc = $this->loadModel('file')->setImgSize($todo->desc); + if($setImgSize) $todo->desc = $this->loadModel('file')->setImgSize($todo->desc); if($todo->type == 'task') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TASK)->fetch('name'); if($todo->type == 'bug') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_BUG)->fetch('title'); $todo->date = str_replace('-', '', $todo->date);