diff --git a/api/v1/entries/tasks.php b/api/v1/entries/tasks.php
index 63ed468957..c29d861022 100644
--- a/api/v1/entries/tasks.php
+++ b/api/v1/entries/tasks.php
@@ -20,7 +20,32 @@ class tasksEntry extends entry
*/
public function get($executionID = 0)
{
- if(!$executionID)
+ /* Get tasks by search, search arguments available: pri, assignedTo, status, id, name. Pager arguments will be utilized as well. */
+ if($this->param('search', 0) == 1) // TODO: document this api.
+ {
+ $this->loadModel('task');
+ $searchParams = array();
+ foreach(array('pri' => 'priList', 'assignedTo' => 'assignedToList', 'status' => 'statusList', 'id' => 'idList', 'name' => 'taskName') as $field => $condName)
+ {
+ if($this->param($field, false))
+ {
+ $searchParams[$condName] = $this->param($field);
+ continue;
+ }
+ if($this->param($condName, false)) $searchParams[$condName] = $this->param($condName);
+ }
+
+ $this->app->loadClass('pager', $static = true);
+ $pager = pager::init($this->param('total', 0), $this->param('limit', 20), $this->param('page', 1));
+ $tasks = $this->task->getListByConds((object)$searchParams, $this->param('order', 'id_desc'), $pager);
+
+ $data = new stdclass();
+ $data->status = 'success';
+ $data->data = new stdclass();
+ $data->data->tasks = array_values($tasks);
+ $data->data->pager = (object)$pager;
+ }
+ elseif(!$executionID)
{
/* Get my tasks defaultly. */
$control = $this->loadController('my', 'task');
diff --git a/framework/api/entry.class.php b/framework/api/entry.class.php
index 33018ca827..0b3f15714b 100644
--- a/framework/api/entry.class.php
+++ b/framework/api/entry.class.php
@@ -98,7 +98,7 @@ class baseEntry
* Get request params.
*
* @param string $key
- * @param string $defaultValue
+ * @param mixed $defaultValue
* @access public
* @return mixed
*/
@@ -112,13 +112,18 @@ class baseEntry
* 设置请求参数
* Set request param.
*
- * @param string $key
- * @param mixed $value
+ * @param string|array $key if is array, set params by its key-value pairs.
+ * @param mixed $value
* @access public
- * @return mixed
+ * @return void
*/
- public function setParam($key, $value)
+ public function setParam($key, $value = null)
{
+ if(is_array($key))
+ {
+ foreach($key as $k => $v) $_GET[$k] = $v;
+ return;
+ }
$_GET[$key] = $value;
}
diff --git a/lib/pager/pager.class.php b/lib/pager/pager.class.php
index 0d0b016fa9..a3cfd2f4ba 100644
--- a/lib/pager/pager.class.php
+++ b/lib/pager/pager.class.php
@@ -130,7 +130,11 @@ class pager extends basePager
}
}
- echo "
";
+ global $app, $lang;
+ $appendApp = '';
+ $moduleName = $this->moduleName;
+ if(isset($lang->navGroup->{$moduleName}) and $lang->navGroup->{$moduleName} != $app->tab) $appendApp = "#app={$app->tab}";
+ echo "";
}
}
else
diff --git a/module/block/control.php b/module/block/control.php
index d3483b2d07..55475bd481 100755
--- a/module/block/control.php
+++ b/module/block/control.php
@@ -1951,6 +1951,11 @@ class block extends control
$hasViewPriv['review'] = true;
$count['review'] = count($reviews);
$this->view->reviews = $reviews;
+ if($this->config->edition == 'max')
+ {
+ $this->app->loadLang('approval');
+ $this->view->flows = $this->dao->select('module,name')->from(TABLE_WORKFLOW)->where('buildin')->eq(0)->fetchPairs('module', 'name');
+ }
}
$this->view->selfCall = $this->selfCall;
diff --git a/module/block/view/reviewblock.html.php b/module/block/view/reviewblock.html.php
index b379ef8713..cd32e23dfc 100644
--- a/module/block/view/reviewblock.html.php
+++ b/module/block/view/reviewblock.html.php
@@ -29,13 +29,21 @@
type;
- if($type == 'project') $type = 'review';
+ if($type == 'projectreview') $type = 'review';
- $typeName = $lang->$type->common;
+ $typeName = '';
+ if(isset($lang->{$review->type}->common)) $typeName = $lang->{$review->type}->common;
if($type == 'story') $typeName = $lang->my->auditMenu->audit->story;
+ if($review->type == 'projectreview') $typeName = $lang->project->common;
+ if(isset($flows[$review->type])) $typeName = $flows[$review->type];
- $statusList = $lang->$type->statusList;
+ $statusList = array();
+ if(isset($lang->$type->statusList)) $statusList = $lang->$type->statusList;
if($type == 'attend') $statusList = $lang->attend->reviewStatusList;
+ if(!in_array($type, array('story', 'testcase', 'feedback', 'review')) and strpos(",{$config->my->oaObjectType},", ",$type,") === false)
+ {
+ $statusList = $lang->approval->nodeList;
+ }
?>
| story->parent : $lang->story->requirement;?> |
- |
+
+
+
+ story->loadAllStories, "class='btn btn-default' onclick='loadURS(true)' data-toggle='tooltip'");?>
+
+ |
>
diff --git a/module/task/model.php b/module/task/model.php
index 300515edb7..beca5c1bb5 100755
--- a/module/task/model.php
+++ b/module/task/model.php
@@ -4357,6 +4357,40 @@ class taskModel extends model
}
}
+ /**
+ * Get task list by conditions.
+ *
+ * @param object $conds
+ * @param string $orderBy
+ * @param object $pager
+ * @access public
+ * @return array
+ */
+ public function getListByConds($conds, $orderBy = 'id_desc', $pager = null)
+ {
+ foreach(array('priList' => array(), 'assignedToList' => array(), 'statusList' => array(), 'idList' => array(), 'taskName' => '') as $condKey => $defaultValue)
+ {
+ if(!isset($conds->$condKey))
+ {
+ $conds->$condKey = $defaultValue;
+ continue;
+ }
+ if(strripos($condKey, 'list') === strlen($condKey) - 4 && !is_array($conds->$condKey)) $conds->$condKey = array_filter(explode(',', $conds->$condKey));
+ }
+
+ return $this->dao->select('*')->from(TABLE_TASK)
+ ->where('deleted')->eq(0)
+ ->beginIF(!empty($conds->priList))->andWhere('pri')->in($conds->priList)->fi()
+ ->beginIF(!empty($conds->assignedToList))->andWhere('assignedTo')->in($conds->assignedToList)->fi()
+ ->beginIF(!empty($conds->statusList))->andWhere('status')->in($conds->statusList)->fi()
+ ->beginIF(!empty($conds->idList))->andWhere('id')->in($conds->idList)->fi()
+ ->beginIF(!empty($conds->taskName))->andWhere('name')->like("%{$conds->taskName}%")
+ ->beginIF(!$this->app->user->admin)->andWhere('execution')->in($this->app->user->view->sprints)->fi()
+ ->orderBy($orderBy)
+ ->page($pager)
+ ->fetchAll('id');
+ }
+
/**
* Get teamTask members.
*
diff --git a/module/testcase/model.php b/module/testcase/model.php
index e0c3290b1c..95242794bb 100644
--- a/module/testcase/model.php
+++ b/module/testcase/model.php
@@ -1564,9 +1564,9 @@ class testcaseModel extends model
{
$caseID = $this->dao->lastInsertID();
$parentStepID = 0;
- if($this->post->desc)
+ if($data->desc)
{
- foreach($this->post->desc[$key] as $id => $desc)
+ foreach($data->desc[$key] as $id => $desc)
{
$desc = trim($desc);
if(empty($desc)) continue;
@@ -1576,7 +1576,7 @@ class testcaseModel extends model
$stepData->case = $caseID;
$stepData->version = 1;
$stepData->desc = htmlSpecialString($desc);
- $stepData->expect = htmlSpecialString($this->post->expect[$key][$id]);
+ $stepData->expect = htmlSpecialString($data->expect[$key][$id]);
$this->dao->insert(TABLE_CASESTEP)->data($stepData)->autoCheck()->exec();
if($stepData->type == 'group') $parentStepID = $this->dao->lastInsertID();
if($stepData->type == 'step') $parentStepID = 0;
diff --git a/module/testtask/control.php b/module/testtask/control.php
index c3d4a34b99..58129d9a6d 100644
--- a/module/testtask/control.php
+++ b/module/testtask/control.php
@@ -250,7 +250,7 @@ class testtask extends control
/* Create testtask from testtask of test.*/
$productID = $productID ? $productID : key($this->products);
$executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, '', 'id_desc', $projectID, 'stagefilter');
- $builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk,withexecution', $projectID, 'project');
+ $builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk,withexecution', $projectID, 'project', '', false);
$execution = $this->loadModel('execution')->getByID($executionID);
if(!empty($execution) and $execution->type == 'kanban') $this->lang->testtask->execution = str_replace($this->lang->execution->common, $this->lang->kanban->common, $this->lang->testtask->execution);
@@ -816,11 +816,11 @@ class testtask extends control
$executions[$executionID] = $project->name . "({$this->lang->project->disableExecution})";
}
}
- $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk,withexecution', $executionID, 'execution');
+ $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk,withexecution', $executionID, 'execution', $task->build, false);
}
else
{
- $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk,withexecution', $task->project, 'project');
+ $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk,withexecution', $task->project, 'project', $task->build, false);
}
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->edit;
diff --git a/module/testtask/model.php b/module/testtask/model.php
index 4f837c3ba7..8841c5f707 100755
--- a/module/testtask/model.php
+++ b/module/testtask/model.php
@@ -91,7 +91,7 @@ class testtaskModel extends model
->beginIF($scopeAndStatus[0] == 'all')->andWhere('t1.product')->in($products)->fi()
->beginIF(strtolower($scopeAndStatus[1]) == 'totalstatus')->andWhere('t1.status')->in('blocked,doing,wait,done')->fi()
->beginIF(!in_array(strtolower($scopeAndStatus[1]), array('totalstatus', 'review'), true))->andWhere('t1.status')->eq($scopeAndStatus[1])->fi()
- ->beginIF($branch !== 'all')->andWhere('t4.branch')->eq($branch)->fi()
+ ->beginIF($branch !== 'all')->andWhere("CONCAT(',', t4.branch, ',')")->like("%,$branch,%")->fi()
->beginIF($beginTime)->andWhere('t1.begin')->ge($beginTime)->fi()
->beginIF($endTime)->andWhere('t1.end')->le($endTime)->fi()
->beginIF($branch == BRANCH_MAIN)
diff --git a/module/transfer/config.php b/module/transfer/config.php
index c53f3b1d84..a97d8f24f9 100644
--- a/module/transfer/config.php
+++ b/module/transfer/config.php
@@ -12,8 +12,8 @@ $config->transfer->fieldList['sort'] = '';
$config->transfer->fieldList['dataSource'] = array('module' => '', 'method' => '', 'params' => '', 'pairs' => '', 'lang' => '');
$config->transfer->initFunction = 'title,control,required,';
-$config->transfer->dateFeilds = 'estStarted,realStarted,deadline,openedDate,assignedDate,finishedDate,canceledDate,closedDate,lastEditedDate,';
-$config->transfer->datetimeFeilds = '';
+$config->transfer->dateFields = 'estStarted,realStarted,deadline,openedDate,assignedDate,finishedDate,canceledDate,closedDate,lastEditedDate,';
+$config->transfer->datetimeFields = '';
$config->transfer->listFields = '';
$config->transfer->sysLangFields = ',pri,status,type,mode,severity,os,browser,resolution,confirmed,source,reviewResult,stage,change,category';
$config->transfer->sysDataFields = 'execution,product,user';
diff --git a/module/transfer/model.php b/module/transfer/model.php
index 0721b4d5af..f9374a6bb8 100644
--- a/module/transfer/model.php
+++ b/module/transfer/model.php
@@ -506,10 +506,32 @@ class transferModel extends model
{
$modelData = $this->getDatasByFile($tmpFile);
}
+
+ $modelData = $this->processDate($modelData);
if(isset($fields['id'])) unset($fields['id']);
return $modelData;
}
+ /**
+ * Process datas, convert date to YYYY-mm-dd, convert datetime to YYYY-mm-dd HH:ii:ss.
+ *
+ * @param array $datas
+ * @access public
+ * @return array
+ */
+ public function processDate($datas)
+ {
+ foreach($datas as $index => $data)
+ {
+ foreach($data as $field => $value)
+ {
+ if(strpos($this->modelConfig->dateFields, $field) !== false or strpos($this->modelConfig->datetimeFields, $field) !== false) $data->$field = $this->loadModel('common')->formatDate($value);
+ }
+ $datas[$index] = $data;
+ }
+ return $datas;
+ }
+
/**
* Get rows from excel.
*
@@ -830,7 +852,7 @@ class transferModel extends model
$storyDatas = end($stories);
$lastBranch = $storyDatas->branch;
$lastType = $storyDatas->type;
- $stories = $this->story->mergePlanTitle($productID , $stories, $lastBranch, $lastType);
+ $stories = $this->loadModel('story')->mergePlanTitle($productID , $stories, $lastBranch, $lastType);
return $stories;
}
@@ -940,7 +962,7 @@ class transferModel extends model
foreach($data as $field => $cellValue)
{
if(empty($cellValue)) continue;
- if(strpos($this->transferConfig->dateFeilds, $field) !== false and helper::isZeroDate($cellValue)) $datas[$key]->$field = '';
+ if(strpos($this->transferConfig->dateFields, $field) !== false and helper::isZeroDate($cellValue)) $datas[$key]->$field = '';
if(is_array($cellValue)) continue;
if(!empty($fieldList[$field]['from']) and in_array($fieldList[$field]['control'], array('select', 'multiple')))
@@ -1325,8 +1347,8 @@ class transferModel extends model
if(!isset($modelConfig->export)) $modelConfig->export = new stdClass();
if(!isset($modelConfig->import)) $modelConfig->export = new stdClass();
- $modelConfig->dateFeilds = isset($modelConfig->dateFeilds) ? $modelConfig->dateFeilds : $transferConfig->dateFeilds;
- $modelConfig->datetimeFeilds = isset($modelConfig->datetimeFeilds) ? $modelConfig->datetimeFeilds : $transferConfig->datetimeFeilds;
+ $modelConfig->dateFields = isset($modelConfig->dateFields) ? $modelConfig->dateFields : $transferConfig->dateFields;
+ $modelConfig->datetimeFields = isset($modelConfig->datetimeFields) ? $modelConfig->datetimeFields : $transferConfig->datetimeFields;
$modelConfig->sysLangFields = isset($modelConfig->sysLangFields) ? $modelConfig->sysLangFields : $transferConfig->sysLangFields;
$modelConfig->sysDataFields = isset($modelConfig->sysDataFields) ? $modelConfig->sysDataFields : $transferConfig->sysDataFields;
$modelConfig->listFields = isset($modelConfig->listFields) ? $modelConfig->listFields : $transferConfig->listFields;
diff --git a/module/tree/control.php b/module/tree/control.php
index 90280d30ea..dc5c7d5285 100644
--- a/module/tree/control.php
+++ b/module/tree/control.php
@@ -390,7 +390,7 @@ class tree extends control
}
else
{
- $this->view->optionMenu = $this->tree->getOptionMenu($module->root, $module->type, 0, $module->branch);
+ $this->view->optionMenu = $this->tree->getOptionMenu($module->root, $module->type, 0, $module->branch, 'noMainBranch');
}
if($type == 'doc') $this->view->libs = $this->loadModel('doc')->getLibs('all', $extra = 'withObject', '', 0, 'book');
@@ -534,8 +534,17 @@ class tree extends control
}
else
{
- $optionMenu = $this->tree->getOptionMenu($rootID, $viewType, $rootModuleID, $branch);
+ $optionMenu = $this->tree->getOptionMenu($rootID, $viewType, $rootModuleID, $branch, $extra);
}
+
+ if(strpos($extra, 'excludeModuleID') !== false)
+ {
+ list($excludeModule, $noMainBranch) = explode(',', $extra);
+ parse_str($excludeModule, $output);
+ $excludeModuleID = $output['excludeModuleID'];
+ if(isset($optionMenu[$excludeModuleID])) unset($optionMenu[$excludeModuleID]);
+ }
+
if($returnType == 'html')
{
//Code for task #5081.
diff --git a/module/tree/model.php b/module/tree/model.php
index aa5141514a..8b4da78ff1 100644
--- a/module/tree/model.php
+++ b/module/tree/model.php
@@ -109,11 +109,14 @@ class treeModel extends model
->andWhere('type')->in($type)
->beginIF($grade)->andWhere('grade')->le($grade)->fi()
->beginIF($startModulePath)->andWhere('path')->like($startModulePath)->fi()
- ->beginIF($branch !== 'all' and $branch !== '' and $branch !== false)
+ ->beginIF($branch !== 'all' and $branch !== '' and $branch !== false and strpos($param, 'noMainBranch') === false)
->andWhere('(branch')->eq(0)
->orWhere('branch')->eq($branch)
->markRight(1)
->fi()
+ ->beginIF($branch !== 'all' and $branch !== '' and $branch !== false and strpos($param, 'noMainBranch') !== false)
+ ->andWhere('branch')->eq($branch)
+ ->fi()
->beginIF(strpos($param, 'nodeleted') !== false)->andWhere('deleted')->eq(0)->fi()
->orderBy('grade desc, `order`')
->get();
@@ -175,7 +178,7 @@ class treeModel extends model
$treeMenu = array();
foreach($branches as $branchID => $branch)
- {
+ {
$stmt = $this->dbh->query($this->buildMenuQuery($rootID, $type, $startModule, $branchID, $param));
$modules = array();
while($module = $stmt->fetch())
diff --git a/module/tree/view/edit.html.php b/module/tree/view/edit.html.php
index 861740098a..09e8713b54 100644
--- a/module/tree/view/edit.html.php
+++ b/module/tree/view/edit.html.php
@@ -189,7 +189,7 @@ function loadModules(branch)
if(typeof(branchID) == 'undefined') branchID = 0;
if(typeof(moduleID) == 'undefined') moduleID = 0;
- link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branchID + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=¤tModuleID=' + moduleID);
+ link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branchID + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=excludeModuleID=' + id;?> + ',noMainBranch¤tModuleID=' + moduleID);
$(moduleBox).load(link, function()
{
$(this).children('select').attr('id', 'parent').attr('name', 'parent');
diff --git a/module/user/control.php b/module/user/control.php
index 081176c229..8d3c27350b 100755
--- a/module/user/control.php
+++ b/module/user/control.php
@@ -1090,8 +1090,7 @@ class user extends control
}
/* Remove the real path for security reason. */
- $pathPos = strrpos($this->app->getBasePath(), DIRECTORY_SEPARATOR, -2);
- $resetFileName = substr($resetFileName, $pathPos + 1);
+ $resetFileName = str_replace($this->app->getBasePath(), '', $resetFileName);
$this->view->title = $this->lang->user->resetPassword;
$this->view->status = 'reset';
diff --git a/module/webhook/model.php b/module/webhook/model.php
index ce5c32ad80..74a292e885 100644
--- a/module/webhook/model.php
+++ b/module/webhook/model.php
@@ -422,6 +422,7 @@ class webhookModel extends model
$viewLink = $this->getViewLink($objectType == 'kanbancard' ? 'kanban' : $objectType, $objectType == 'kanbancard' ? $object->kanban : $objectID);
$objectTypeName = ($objectType == 'story' and $object->type == 'requirement') ? $this->lang->action->objectTypes['requirement'] : $this->lang->action->objectTypes[$objectType];
$title = $this->app->user->realname . $this->lang->action->label->$actionType . $objectTypeName;
+ $host = (defined('RUN_MODE') and RUN_MODE == 'api') ? '' : $host;
$text = $title . ' ' . "[#{$objectID}::{$object->$field}](" . $host . $viewLink . ")";
$mobile = '';
diff --git a/xuanxuan/extension/xuan/im/ext/bot/zentao.bot.php b/xuanxuan/extension/xuan/im/ext/bot/zentao.bot.php
index 940530236b..ff55942fa0 100644
--- a/xuanxuan/extension/xuan/im/ext/bot/zentao.bot.php
+++ b/xuanxuan/extension/xuan/im/ext/bot/zentao.bot.php
@@ -344,27 +344,42 @@ class zentaoBot extends xuanBot
* @param object $user
* @param object $pager
* @access public
- * @return object|string
+ * @return array
*/
public function viewTask($args = array(), $user = null, $pager = null)
{
+ $keys = array();
+ foreach(array('pri', 'id', 'status', 'assignTo', 'taskName') as $key) $keys[$key] = true;
+
if(empty($args))
{
- $conds = new stdClass();
- $conds->assignedToList = is_object($user) ? $user->account : false;
- $conds->statusList = 'wait,doing,done,pause,cancel';
- return $this->im->task->getListByConds($conds, 'status_asc', 0, $pager);
+ $keys['assignTo'] = is_object($user) ? $user->account : false;
+ $keys['status'] = 'wait,doing,done,pause,cancel';
}
- $keys = array();
- $keys['pri'] = true;
- $keys['id'] = true;
- $keys['status'] = true;
- $keys['assignTo'] = true;
- $keys['taskName'] = true;
-
$conds = $this->parseArguments($args, $keys);
- return $this->im->task->getListByConds($conds, 'status_asc', 0, $pager);
+ $conds->search = 1;
+ $conds->order = 'status_asc';
+ $conds->limit = 10;
+
+ if(is_object($pager))
+ {
+ $conds->page = $pager->pageID;
+ $conds->limit = $pager->recPerPage;
+ }
+
+ $result = $this->loadEntry('tasks', 'get', array(), (array)$conds);
+
+ if(isset($result->tasks))
+ {
+ $pager->setRecTotal($result->total);
+ $pager->setRecPerPage($result->limit);
+ $pager->setPageID($result->page);
+ $pager->setPageTotal();
+ return $result->tasks;
+ }
+
+ return array();
}
/**
@@ -449,7 +464,7 @@ class zentaoBot extends xuanBot
if(empty($params))
{
- $originCommand = rawurlencode($this->lang->finishTask . ' ' . implode(' ', $originArgs));
+ $originCommand = rawurlencode($this->lang->finishCommand . ' ' . implode(' ', $originArgs));
$json = (object)array
(
@@ -578,30 +593,28 @@ class zentaoBot extends xuanBot
public function renderTask($tasks, $originArgs, $pager)
{
$lang = $this->im->lang;
- if(!$tasks || $pager->recTotal === 0) return $lang->task->noTask;
- $sysURL = common::getSysURL();
+ $taskCount = $pager->recTotal ? $pager->recTotal : count($tasks);
- if($pager->recTotal == 1)
+ if($taskCount === 0) return $lang->task->noTask;
+
+ if($taskCount == 1)
{
$task = current($tasks);
$link = str_replace('x.php', 'index.php', helper::createLink('task', 'view', "taskID=$task->id", 'html'));
$messages = new stdclass();
$messages->type = 'url';
- $messages->url = $sysURL . $link;
- return array(sprintf($this->lang->tasksFound, $pager->recTotal), $messages);
+ $messages->url = common::getSysURL() . $link;
+ return array(sprintf($this->lang->tasksFound, $taskCount), $messages);
}
$messages = array();
- if($pager->pageID == 1)
- {
- $messages[] = sprintf($this->lang->tasksFound, $pager->recTotal);
- }
+ if($pager->pageID == 1) $messages[] = sprintf($this->lang->tasksFound, $taskCount);
$taskTable = $this->renderTaskTable($tasks);
- $originCommand = $this->lang->viewTask . ' ' . implode(' ', $originArgs);
+ $originCommand = $this->lang->viewCommand . ' ' . implode(' ', $originArgs);
$paging = "$pager->pageID / $pager->pageTotal";
if($pager->pageID != 1)
{
@@ -633,7 +646,6 @@ class zentaoBot extends xuanBot
public function renderTaskTable($tasks)
{
$lang = $this->im->lang;
- $sysURL = common::getSysURL();
$headMap = array('id'=>'ID', 'pri' => $lang->task->pri, 'name' => $lang->task->name, 'assignedTo' => $lang->task->assignedTo, 'status' => $lang->task->status, 'estimate' => $lang->task->estimateAB, 'consumed' => $lang->task->consumedAB, 'left' => $lang->task->leftAB, 'actions' => $lang->actions);
$thead = '';
@@ -645,7 +657,7 @@ class zentaoBot extends xuanBot
{
$tr = '';
$link = str_replace('x.php', 'index.php', helper::createLink('task', 'view', "taskID=$task->id", 'html'));
- $href = urlencode($sysURL . $link);
+ $href = urlencode(common::getSysURL() . $link);
$isParent = $task->parent == -1;
$isChild = $task->parent > 0;
$isMulti = !empty($task->mode);
@@ -675,13 +687,13 @@ class zentaoBot extends xuanBot
}
else
{
- $tr .= " | {$this->users[$task->$key]} | ";
+ $tr .= "{$task->assignedTo->realname} | ";
}
break;
case 'actions':
- $startUrl = 'xxc://sendContentToServerBySendbox/' . "{$this->lang->startTask} #$task->id";
- $finishUrl = 'xxc://sendContentToServerBySendbox/' . "{$this->lang->finishTask} #$task->id";
- $closeUrl = 'xxc://sendContentToServerBySendbox/' . "{$this->lang->closeTask} #$task->id";
+ $startUrl = 'xxc://sendContentToServerBySendbox/' . "{$this->lang->startCommand} #$task->id";
+ $finishUrl = 'xxc://sendContentToServerBySendbox/' . "{$this->lang->finishCommand} #$task->id";
+ $closeUrl = 'xxc://sendContentToServerBySendbox/' . "{$this->lang->closeCommand} #$task->id";
$canStart = in_array($task->status, array('wait', 'pause'));
$canFinish = in_array($task->status, array('wait', 'pause', 'doing'));
@@ -770,7 +782,7 @@ class zentaoBot extends xuanBot
if(count($args) == 0)
{
- $originCommand = rawurlencode($this->lang->startTask . ' ' . implode(' ', $originArgs));
+ $originCommand = rawurlencode($this->lang->startCommand . ' ' . implode(' ', $originArgs));
$realStarted = $this->formatDate($task, 'realStarted');
@@ -948,11 +960,12 @@ class zentaoBot extends xuanBot
* @param string $entry
* @param string $action
* @param array $params
+ * @param array $query
* @param string $version
* @access public
* @return object
*/
- public function loadEntry($entry, $action, $params = array(), $version = 'v1')
+ public function loadEntry($entry, $action, $params = array(), $query = array(), $version = 'v1')
{
try
{
@@ -979,6 +992,10 @@ class zentaoBot extends xuanBot
{
$entry->requestBody = (object)$params;
}
+ elseif($action == 'get' && !empty($query))
+ {
+ $entry->setParam($query);
+ }
$content = call_user_func_array(array($entry, $action), $params);
return json_decode($content);
diff --git a/xuanxuan/extension/xuan/im/ext/lang/de/xuanxuan.php b/xuanxuan/extension/xuan/im/ext/lang/de/xuanxuan.php
index c2285839a0..b93b31219f 100644
--- a/xuanxuan/extension/xuan/im/ext/lang/de/xuanxuan.php
+++ b/xuanxuan/extension/xuan/im/ext/lang/de/xuanxuan.php
@@ -73,10 +73,10 @@ $lang->im->bot->zentaoBot->prevPage = 'Prev Page';
$lang->im->bot->zentaoBot->nextPage = 'Next Page';
$lang->im->bot->zentaoBot->effortRecorded = 'Effort recorded for task #%d.';
-$lang->im->bot->zentaoBot->finishTask = 'finish';
-$lang->im->bot->zentaoBot->closeTask = 'close';
-$lang->im->bot->zentaoBot->startTask = 'start';
-$lang->im->bot->zentaoBot->viewTask = 'view';
+$lang->im->bot->zentaoBot->finishCommand = 'finish';
+$lang->im->bot->zentaoBot->closeCommand = 'close';
+$lang->im->bot->zentaoBot->startCommand = 'start';
+$lang->im->bot->zentaoBot->viewCommand = 'view';
$lang->im->bot->zentaoBot->errors = new stdclass();
$lang->im->bot->zentaoBot->errors->emptyResult = 'No task found.';
diff --git a/xuanxuan/extension/xuan/im/ext/lang/en/xuanxuan.php b/xuanxuan/extension/xuan/im/ext/lang/en/xuanxuan.php
index c2285839a0..b93b31219f 100644
--- a/xuanxuan/extension/xuan/im/ext/lang/en/xuanxuan.php
+++ b/xuanxuan/extension/xuan/im/ext/lang/en/xuanxuan.php
@@ -73,10 +73,10 @@ $lang->im->bot->zentaoBot->prevPage = 'Prev Page';
$lang->im->bot->zentaoBot->nextPage = 'Next Page';
$lang->im->bot->zentaoBot->effortRecorded = 'Effort recorded for task #%d.';
-$lang->im->bot->zentaoBot->finishTask = 'finish';
-$lang->im->bot->zentaoBot->closeTask = 'close';
-$lang->im->bot->zentaoBot->startTask = 'start';
-$lang->im->bot->zentaoBot->viewTask = 'view';
+$lang->im->bot->zentaoBot->finishCommand = 'finish';
+$lang->im->bot->zentaoBot->closeCommand = 'close';
+$lang->im->bot->zentaoBot->startCommand = 'start';
+$lang->im->bot->zentaoBot->viewCommand = 'view';
$lang->im->bot->zentaoBot->errors = new stdclass();
$lang->im->bot->zentaoBot->errors->emptyResult = 'No task found.';
diff --git a/xuanxuan/extension/xuan/im/ext/lang/fr/xuanxuan.php b/xuanxuan/extension/xuan/im/ext/lang/fr/xuanxuan.php
index c2285839a0..b93b31219f 100644
--- a/xuanxuan/extension/xuan/im/ext/lang/fr/xuanxuan.php
+++ b/xuanxuan/extension/xuan/im/ext/lang/fr/xuanxuan.php
@@ -73,10 +73,10 @@ $lang->im->bot->zentaoBot->prevPage = 'Prev Page';
$lang->im->bot->zentaoBot->nextPage = 'Next Page';
$lang->im->bot->zentaoBot->effortRecorded = 'Effort recorded for task #%d.';
-$lang->im->bot->zentaoBot->finishTask = 'finish';
-$lang->im->bot->zentaoBot->closeTask = 'close';
-$lang->im->bot->zentaoBot->startTask = 'start';
-$lang->im->bot->zentaoBot->viewTask = 'view';
+$lang->im->bot->zentaoBot->finishCommand = 'finish';
+$lang->im->bot->zentaoBot->closeCommand = 'close';
+$lang->im->bot->zentaoBot->startCommand = 'start';
+$lang->im->bot->zentaoBot->viewCommand = 'view';
$lang->im->bot->zentaoBot->errors = new stdclass();
$lang->im->bot->zentaoBot->errors->emptyResult = 'No task found.';
diff --git a/xuanxuan/extension/xuan/im/ext/lang/zh-cn/xuanxuan.php b/xuanxuan/extension/xuan/im/ext/lang/zh-cn/xuanxuan.php
index f7ff79a914..b827753ce5 100644
--- a/xuanxuan/extension/xuan/im/ext/lang/zh-cn/xuanxuan.php
+++ b/xuanxuan/extension/xuan/im/ext/lang/zh-cn/xuanxuan.php
@@ -81,10 +81,10 @@ $lang->im->bot->zentaoBot->prevPage = '上一页';
$lang->im->bot->zentaoBot->nextPage = '下一页';
$lang->im->bot->zentaoBot->effortRecorded = '任务 #%d 已完成工时信息填写';
-$lang->im->bot->zentaoBot->finishTask = '完成任务';
-$lang->im->bot->zentaoBot->closeTask = '关闭任务';
-$lang->im->bot->zentaoBot->startTask = '开始任务';
-$lang->im->bot->zentaoBot->viewTask = '查看任务';
+$lang->im->bot->zentaoBot->finishCommand = '完成';
+$lang->im->bot->zentaoBot->closeCommand = '关闭';
+$lang->im->bot->zentaoBot->startCommand = '开始';
+$lang->im->bot->zentaoBot->viewCommand = '查看';
$lang->im->bot->zentaoBot->errors = new stdclass();
$lang->im->bot->zentaoBot->errors->emptyResult = '未查询到相关匹配信息';
diff --git a/xuanxuan/extension/xuan/task/ext/model/xuanxuan.php b/xuanxuan/extension/xuan/task/ext/model/xuanxuan.php
deleted file mode 100644
index 9d2302186e..0000000000
--- a/xuanxuan/extension/xuan/task/ext/model/xuanxuan.php
+++ /dev/null
@@ -1,30 +0,0 @@
- array(), 'assignedToList' => array(), 'statusList' => array(), 'idList' => array(), 'taskName' => '') as $condKey => $defaultValue)
- {
- if(!isset($conds->$condKey)) $conds->$condKey = $defaultValue;
- }
-
- return $this->dao->select('*')->from(TABLE_TASK)
- ->where('deleted')->eq(0)
- ->beginIF(!empty($conds->priList))->andWhere('pri')->in($conds->priList)->fi()
- ->beginIF(!empty($conds->assignedToList))->andWhere('assignedTo')->in($conds->assignedToList)->fi()
- ->beginIF(!empty($conds->statusList))->andWhere('status')->in($conds->statusList)->fi()
- ->beginIF(!empty($conds->idList))->andWhere('id')->in($conds->idList)->fi()
- ->beginIF(!empty($conds->taskName))->andWhere('name')->like("%{$conds->taskName}%")
- ->orderBy($orderBy)
- ->beginIF($limit > 0)->limit($limit)->fi()
- ->page($pager)
- ->fetchAll('id');
-}