diff --git a/api/v1/entries/my.php b/api/v1/entries/my.php deleted file mode 100644 index 0031985771..0000000000 --- a/api/v1/entries/my.php +++ /dev/null @@ -1,22 +0,0 @@ -loadModel('my')->getInfo(); - $info->products = $this->loadModel('my')->getProducts(); - $info->projects = $this->loadModel('my')->getProjects(); - $info->joinProjectCount = count($info->projects); - $info->dynamic = $this->loadModel('my')->getDynamic(); - - if(!$info) return $this->sendError(400, $info->message); - $this->send(200, $info); - } -} diff --git a/api/v1/entries/user.php b/api/v1/entries/user.php index ecc5faa910..b736b6d65a 100644 --- a/api/v1/entries/user.php +++ b/api/v1/entries/user.php @@ -10,6 +10,10 @@ class userEntry extends Entry { public function get($userID = 0) { + /* Get my info defaultly. */ + if(!$userID) return $this->getInfo(); + + /* Get user by id. */ $control = $this->loadController('user', 'profile'); $control->profile($userID); @@ -20,6 +24,25 @@ class userEntry extends Entry $this->send(200, $this->format($user, 'last:time,locked:time')); } + private function getInfo() + { + $info = $this->loadModel('my')->getInfo(); + + $products = $this->my->getProducts(); + $info->product = new stdclass(); + $info->product->total = count($products); + $info->product->products = $products; + + $projects = $this->my->getProjects(); + $info->project = new stdclass(); + $info->project->total = count($projects); + $info->project->projects = $projects; + + $info->actions = $this->my->getActions(); + + $this->send(200, $info); + } + public function put($userID) { $oldUser = $this->loadModel('user')->getByID($userID, 'id'); diff --git a/config/routes.php b/config/routes.php index a18c4c579f..bf01be4eaf 100644 --- a/config/routes.php +++ b/config/routes.php @@ -33,7 +33,7 @@ $routes['/tasks/:id/finish'] = 'taskFinish'; $routes['/users'] = 'users'; $routes['/users/:id'] = 'user'; -$routes['/my'] = 'my'; +$routes['/user'] = 'user'; $routes['/programs'] = 'programs'; $routes['/programs/:id'] = 'program'; diff --git a/db/standard/zentao15.0.rc3.sql b/db/standard/zentao15.0.rc3.sql index 68b0271093..d59660d05a 100644 --- a/db/standard/zentao15.0.rc3.sql +++ b/db/standard/zentao15.0.rc3.sql @@ -447,7 +447,7 @@ CREATE TABLE `zt_history` ( PRIMARY KEY (`id`), KEY `action` (`action`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -CREATE TABLE `zt_pipeline` ( +CREATE TABLE `zt_jenkins` ( `id` smallint(8) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL, `url` varchar(255) DEFAULT NULL, diff --git a/module/action/model.php b/module/action/model.php index ed32dcb900..471854534c 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1006,7 +1006,8 @@ class actionModel extends model if($object->type == 'project') $objectProject[$object->id] = $object->id; } } - elseif($objectType == 'stakeholder'){ + elseif($objectType == 'stakeholder') + { $objectName = $this->dao->select("t1.id, t2.realname")->from($table)->alias('t1') ->leftJoin(TABLE_USER)->alias('t2')->on("t1.{$field} = t2.account") ->where('t1.id')->in($objectIds) @@ -1055,7 +1056,8 @@ class actionModel extends model $objectType = strtolower($action->objectType); $action->originalDate = $action->date; $action->date = date(DT_MONTHTIME2, strtotime($action->date)); - $action->actionLabel = isset($this->lang->action->label->$actionType) ? $this->lang->action->label->$actionType : (isset($this->lang->$objectType->$actionType) ? $this->lang->$objectType->$actionType : $action->action); + $action->actionLabel = isset($this->lang->$objectType->$actionType) ? $this->lang->$objectType->$actionType : $action->action; + $action->actionLabel = isset($this->lang->action->label->$actionType) ? $this->lang->action->label->$actionType : $action->actionLabel; $action->objectLabel = $objectType; if(isset($this->lang->action->label->$objectType)) { diff --git a/module/common/model.php b/module/common/model.php index ad49aab73e..f53d13e12b 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -2177,7 +2177,7 @@ EOD; if($result) { if($timestamp <= $entry->calledTime) $this->response('CALLED_TIME'); - $this->loadModel('entry')->updateTime($entry->code, $timestamp); + $this->loadModel('entry')->updateCalledTime($entry->code, $timestamp); unset($_GET['time']); return $result; } diff --git a/module/common/view/footer.html.php b/module/common/view/footer.html.php index 60149a36b2..990046fd20 100755 --- a/module/common/view/footer.html.php +++ b/module/common/view/footer.html.php @@ -5,8 +5,7 @@ $.initSidebar(); getExtViewFile(__FILE__)){include $extView; return helper::cd();}?> - - +viewType != 'xhtml'):?>