Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into fixbug

This commit is contained in:
tanghucheng
2022-04-28 13:58:15 +08:00
74 changed files with 497 additions and 208 deletions
+3 -2
View File
@@ -32,8 +32,9 @@ class bugEntry extends entry
$bug = $data->data->bug;
/* Set product name */
$bug->productName = $data->data->product->name;
/* Set product name and status */
$bug->productName = $data->data->product->name;
$bug->productStatus = $data->data->product->status;
/* Set module title */
$moduleTitle = '';
+4
View File
@@ -33,6 +33,7 @@ class bugsEntry extends entry
$bugs = $data->data->bugs;
$pager = $data->data->pager;
$result = array();
$this->loadModel('product');
foreach($bugs as $bug)
{
$status = array('code' => $bug->status, 'name' => $this->lang->bug->statusList[$bug->status]);
@@ -42,6 +43,9 @@ class bugsEntry extends entry
$bug->status = $status['code'];
$bug->statusName = $status['name'];
$product = $this->product->getById($bug->product);
$bug->productStatus = $product->status;
$result[$bug->id] = $this->format($bug, 'activatedDate:time,openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,mailto:userList,resolvedBy:user,resolvedDate:time,closedBy:user,closedDate:time,lastEditedBy:user,lastEditedDate:time,deadline:date,deleted:bool');
}
+8 -7
View File
@@ -21,13 +21,14 @@ class configsEntry extends baseEntry
{
$configs = array();
$configs[] = array('key' => 'language', 'value' => $this->config->default->lang);
$configs[] = array('key' => 'version', 'value' => $this->config->version);
$configs[] = array('key' => 'charset', 'value' => $this->config->charset);
$configs[] = array('key' => 'timezone', 'value' => $this->config->timezone);
$configs[] = array('key' => 'systemMode', 'value' => $this->config->systemMode);
$configs[] = array('key' => 'hourUnit', 'value' => $this->config->hourUnit);
$configs[] = array('key' => 'CRProduct', 'value' => $this->config->CRProduct);
$configs[] = array('key' => 'language', 'value' => $this->config->default->lang);
$configs[] = array('key' => 'version', 'value' => $this->config->version);
$configs[] = array('key' => 'charset', 'value' => $this->config->charset);
$configs[] = array('key' => 'timezone', 'value' => $this->config->timezone);
$configs[] = array('key' => 'systemMode', 'value' => $this->config->systemMode);
$configs[] = array('key' => 'hourUnit', 'value' => $this->config->hourUnit);
$configs[] = array('key' => 'CRProduct', 'value' => $this->config->CRProduct);
$configs[] = array('key' => 'CRExecution', 'value' => $this->config->CRExecution);
$this->send(200, $configs);
}
+4
View File
@@ -32,8 +32,12 @@ class executionStoriesEntry extends entry
$stories = $data->data->stories;
$pager = $data->data->pager;
$result = array();
$this->loadModel('product');
foreach($stories as $story)
{
$product = $this->product->getById($story->product);
$story->productStatus = $product->status;
$result[] = $this->format($story, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList');
}
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'stories' => $result));
+3
View File
@@ -54,6 +54,9 @@ class productEntry extends Entry
case 'execution':
$product->execution = $this->loadModel('product')->getExecutionPairsByProduct($productID);
break;
case 'bugstatistic':
$product->bugStatistic = $this->loadModel('bug')->getStatistic($productID);
break;
case 'moduleoptionmenu':
$product->moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($productID, 'story', 0, '0');
break;
+1 -2
View File
@@ -63,9 +63,8 @@ class projectEntry extends entry
$project->teams = $teams;
break;
case "products":
$status = $this->param('status', 'all');
$project->products = array();
$productList = $this->loadModel('product')->getOrderedProducts($status, 40, $projectID);
$productList = $this->loadModel('product')->getProducts($projectID, $this->param('status', 'all'));
foreach($productList as $product) $project->products[] = $product;
break;
case "stat":
+4
View File
@@ -33,6 +33,7 @@ class projectBugsEntry extends entry
$bugs = $data->data->bugs;
$pager = $data->data->pager;
$result = array();
$this->loadModel('product');
foreach($bugs as $bug)
{
$status = array('code' => $bug->status, 'name' => $this->lang->bug->statusList[$bug->status]);
@@ -42,6 +43,9 @@ class projectBugsEntry extends entry
$bug->status = $status['code'];
$bug->statusName = $status['name'];
$product = $this->product->getById($bug->product);
$bug->productStatus = $product->status;
$result[$bug->id] = $this->format($bug, 'activatedDate:time,openedDate:time,assignedDate:time,resolvedDate:time,closedDate:time,lastEditedDate:time,deadline:date,deleted:bool');
}
+4
View File
@@ -32,8 +32,12 @@ class projectStoriesEntry extends entry
$stories = $data->data->stories;
$pager = $data->data->pager;
$result = array();
$this->loadModel('product');
foreach($stories as $story)
{
$product = $this->product->getById($story->product);
$story->productStatus = $product->status;
$result[] = $this->format($story, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList');
}
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'stories' => $result));
+14 -2
View File
@@ -24,7 +24,7 @@ class storiesEntry extends entry
if(!$productID) return $this->sendError(400, 'Need product id.');
$control = $this->loadController('product', 'browse');
$control->browse($productID, $this->param('branch', ''), $this->param('status', 'unclosed'), 0, $this->param('type', 'story'), $this->param('order', 'id_desc'), 0, $this->param('limit', 20), $this->param('page', 1));
$control->browse($productID, $this->param('branch', ''), $this->param('status', 'unclosed'), 0, $this->param('type', 'story'), $this->param('order', 'id_desc'), 0, $this->param('limit', 500), $this->param('page', 1));
$data = $this->getData();
if(!$data or !isset($data->status)) return $this->sendError(400, 'error');
@@ -33,9 +33,21 @@ class storiesEntry extends entry
$stories = $data->data->stories;
$pager = $data->data->pager;
$result = array();
$this->loadModel('product');
foreach($stories as $story)
{
if(isset($story->children)) $story->children = array_values((array)$story->children);
$product = $this->product->getById($story->product);
$story->productStatus = $product->status;
if(isset($story->children))
{
$story->children = array_values((array)$story->children);
foreach($story->children as $id => $children)
{
$childrenProduct = $this->product->getById($children->product);
$story->children[$id]->productStatus = $childrenProduct->status;
}
}
$result[] = $this->format($story, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList');
}
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'stories' => $result));
+3 -2
View File
@@ -36,8 +36,9 @@ class storyEntry extends Entry
if(isset($story->planTitle)) $story->planTitle = array_values((array)$story->planTitle);
if($story->parent > 0) $story->parentPri = $this->dao->select('pri')->from(TABLE_STORY)->where('id')->eq($story->parent)->fetch('pri');
/* Set product name */
$story->productName = $data->data->product->name;
/* Set product name and status*/
$story->productName = $data->data->product->name;
$story->productStatus = $data->data->product->status;
/* Set module title */
$moduleTitle = '';
+3
View File
@@ -87,6 +87,9 @@ class taskEntry extends Entry
$task->preAndNext['pre'] = $preAndNext->pre ? $preAndNext->pre->id : '';
$task->preAndNext['next'] = $preAndNext->next ? $preAndNext->next->id : '';
$execution = $this->loadModel('project')->getByID($task->execution, 'execution');
$task->executionStatus = $execution->status;
$this->send(200, $this->format($task, 'deadline:date,openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,realStarted:time,finishedBy:user,finishedDate:time,closedBy:user,closedDate:time,canceledBy:user,canceledDate:time,lastEditedBy:user,lastEditedDate:time,deleted:bool,mailto:userList'));
}
-2
View File
@@ -57,8 +57,6 @@ $routes['/stories/:id/child'] = 'storyChild';
$routes['/stories/:id/recall'] = 'storyRecall';
$routes['/stories/:id/review'] = 'storyReview';
$routes['/module/:id/stories'] = 'moduleStories';
$routes['/products/:id/bugs'] = 'bugs';
$routes['/projects/:id/bugs'] = 'projectBugs';
$routes['/executions/:id/bugs'] = 'executionBugs';
+2
View File
@@ -87,3 +87,5 @@ REPLACE INTO `zt_zoutput` (`id`, `activity`, `name`, `content`, `optional`, `sta
(99,64,'禅道缺陷记录项','','yes','','admin','2020-01-09 14:26:52','','0000-00-00 00:00:00',495,'0');
DELETE FROM `zt_config` WHERE `section` = 'customMenu';
UPDATE `zt_story` SET `plan` = '' WHERE `plan` = 0;
+2 -2
View File
@@ -139,11 +139,11 @@ $lang->doc->menuOrder[30] = 'custom';
$lang->doc->menu->project['subMenu'] = new stdclass();
$lang->doc->menu->custom['subMenu'] = new stdclass();
$xuanxuanMenu = $lang->admin->menu->xuanxuan;
if(isset($lang->admin->menu->xuanxuan)) $xuanxuanMenu = $lang->admin->menu->xuanxuan;
/* Admin menu. */
$lang->admin->menu = new stdclass();
$lang->admin->menu->index = array('link' => "$lang->indexPage|admin|index", 'alias' => 'register,certifytemail,certifyztmobile,ztcompany');
$lang->admin->menu->xuanxuan = $xuanxuanMenu;
if(isset($xuanxuanMenu)) $lang->admin->menu->xuanxuan = $xuanxuanMenu;
$lang->admin->menu->company = array('link' => "{$lang->personnel->common}|company|browse|", 'subModule' => ',user,dept,group,');
$lang->admin->menu->custom = array('link' => "{$lang->custom->common}|custom|index", 'exclude' => 'custom-browsestoryconcept,custom-timezone,custom-estimate');
$lang->admin->menu->extension = array('link' => "{$lang->extension->common}|extension|browse", 'subModule' => 'extension');
@@ -139,11 +139,11 @@ $lang->doc->menuOrder[30] = 'custom';
$lang->doc->menu->project['subMenu'] = new stdclass();
$lang->doc->menu->custom['subMenu'] = new stdclass();
$xuanxuanMenu = $lang->admin->menu->xuanxuan;
if(isset($lang->admin->menu->xuanxuan)) $xuanxuanMenu = $lang->admin->menu->xuanxuan;
/* Admin menu. */
$lang->admin->menu = new stdclass();
$lang->admin->menu->index = array('link' => "$lang->indexPage|admin|index", 'alias' => 'register,certifytemail,certifyztmobile,ztcompany');
$lang->admin->menu->xuanxuan = $xuanxuanMenu;
if(isset($xuanxuanMenu)) $lang->admin->menu->xuanxuan = $xuanxuanMenu;
$lang->admin->menu->company = array('link' => "{$lang->personnel->common}|company|browse|", 'subModule' => ',user,dept,group,');
$lang->admin->menu->custom = array('link' => "{$lang->custom->common}|custom|index", 'exclude' => 'custom-browsestoryconcept,custom-timezone,custom-estimate');
$lang->admin->menu->extension = array('link' => "{$lang->extension->common}|extension|browse", 'subModule' => 'extension');
-16
View File
@@ -483,15 +483,6 @@ class baseControl
{
if(empty($cssPath)) continue;
$extModulePath = dirname(dirname($cssPath));
if(realpath($extModulePath) != $realModulePath)
{
$extMethodCssFile = $extModulePath . DS . 'css' . DS . $devicePrefix . $methodName . '.css';
if(is_file($extMethodCssFile)) $css .= file_get_contents($extMethodCssFile);
$extMethodCssLangFile = $extModulePath . DS . 'css' . DS . $devicePrefix . "{$methodName}.{$clientLang}.css";
if(is_file($extMethodCssLangFile)) $css .= file_get_contents($extMethodCssLangFile);
}
$cssMethodExt = $cssPath . $methodName . DS;
$cssCommonExt = $cssPath . 'common' . DS;
@@ -587,13 +578,6 @@ class baseControl
{
if(empty($jsPath)) continue;
$extModulePath = dirname(dirname($jsPath));
if(realpath($extModulePath) != $realModulePath)
{
$extMethodJsFile = $extModulePath . DS . 'js' . DS . $this->devicePrefix . $methodName . '.js';
if(is_file($extMethodJsFile)) $js .= file_get_contents($extMethodJsFile);
}
$jsMethodExt = $jsPath . $methodName . DS;
$jsCommonExt = $jsPath . 'common' . DS;
+7 -1
View File
@@ -219,7 +219,13 @@ class router extends baseRouter
/* Get user preference. */
$account = isset($this->session->user->account) ? $this->session->user->account : '';
$userSetting = array();
if($this->dbh and !empty($this->config->db->name)) $userSetting = $this->dbh->query('SELECT `key`, value FROM' . TABLE_CONFIG . "WHERE `owner`='{$account}' AND `module`='common' and `key` in ('programLink', 'productLink', 'projectLink', 'executionLink', 'URSR')")->fetchAll();
if($this->dbh and !empty($this->config->db->name) and $account)
{
$sql = new sql();
$account = $sql->quote($account);
$userSetting = $this->dbh->query('SELECT `key`, value FROM' . TABLE_CONFIG . "WHERE `owner`= $account AND `module`='common' and `key` in ('programLink', 'productLink', 'projectLink', 'executionLink', 'URSR')")->fetchAll();
}
foreach($userSetting as $setting)
{
if($setting->key == 'URSR') $config->URSR = $setting->value;
-19
View File
@@ -1370,23 +1370,4 @@ class baseFixer
foreach($fields as $key => $fieldName) if(!isset($this->data->$fieldName)) unset($fields[$key]);
return $fields;
}
/**
* 过滤Emoji表情。
* Filter Emoji.
*
* @param string $fieldName
* @access public
* @return object
*/
public function filterEmoji($fieldName){
$fields = $this->processFields($fieldName);
foreach($fields as $fieldName)
{
$this->data->$fieldName = preg_replace_callback('/./u', function (array $match){
return strlen($match[0]) >= 4 ? '' : $match[0];
}, $this->data->$fieldName);
}
return $this;
}
}
+18
View File
@@ -75,6 +75,7 @@ class fixer extends baseFixer
}
if(isset($flowFields[$field]) and ($flowFields[$field]->control == 'textarea' or $flowFields[$field]->control == 'richtext')) $this->skipSpecial($field);
$this->specialChars($field);
$this->data->$field = $this->filterEmoji($value);
}
if(empty($fields)) return $this->data;
@@ -90,4 +91,21 @@ class fixer extends baseFixer
return $this->data;
}
/**
* 过滤Emoji表情。
* Filter Emoji.
*
* @param string $value
* @access public
* @return object
*/
public function filterEmoji($value){
$value = preg_replace_callback('/./u', function (array $match)
{
return strlen($match[0]) >= 4 ? '' : $match[0];
}, $value);
return $value;
}
}
+1 -1
View File
@@ -59,4 +59,4 @@ $config->action->majorList['execution'] = array('opened', 'edited');
$config->action->needGetProjectType = 'build,task,bug,case,testcase,caselib,testtask,testsuite,testreport,doc,issue,release,risk,design,opportunity,trainplan,gapanalysis,researchplan,researchreport,';
$config->action->needGetRelateField = ',story,productplan,release,task,build,bug,testcase,case,testtask,testreport,doc,doclib,issue,risk,opportunity,trainplan,gapanalysis,team,whitelist,researchplan,researchreport,meeting,kanbanlane,kanbancolumn,';
$config->action->noLinkModules = ',doclib,module,webhook,gitlab,sonarqube,pipeline,jenkins,kanban,kanbanspace,kanbancolumn,kanbanlane,kanbanregion,kanbancard,execution,project,traincategory,apistruct,program,';
$config->action->noLinkModules = ',doclib,module,webhook,gitlab,sonarqube,pipeline,jenkins,kanban,kanbanspace,kanbancolumn,kanbanlane,kanbanregion,kanbancard,execution,project,traincategory,apistruct,program,product,';
+2
View File
@@ -192,6 +192,7 @@ $lang->action->desc->run = '$date, by <strong>$actor</strong> e
$lang->action->desc->syncprogram = '$date, started by <strong>$actor</strong>(starting the project sets the program status as Ongoing).' . "\n";
$lang->action->desc->syncproject = '$date, starting the execution sets the project status as Ongoing.' . "\n";
$lang->action->desc->syncexecution = '$date, starting the task sets the execution status as Ongoing.' . "\n";
$lang->action->desc->syncexecutionbychild = '$date, starting the sub stage sets the execution status as Ongoing.' . "\n";
$lang->action->desc->importfromgitlab = '$date, Issue associate created from gitlab by <strong>$actor</strong>.' . "\n";
$lang->action->desc->archived = '$date, archived by <strong>$actor</strong>.' . "\n";
$lang->action->desc->restore = '$date, restore by <strong>$actor</strong>.' . "\n";
@@ -322,6 +323,7 @@ $lang->action->label->setdefaultbranch = 'Set default branch';
$lang->action->label->syncprogram = 'start';
$lang->action->label->syncproject = 'start';
$lang->action->label->syncexecution = 'start';
$lang->action->label->syncexecutionbychild = 'start';
$lang->action->label->startProgram = '(The start of the project sets the status of the program as Ongoing)';
$lang->action->label->createmr = 'Merge Request Linked';
$lang->action->label->deletemr = 'Merge Request Unlinked';
+2
View File
@@ -192,6 +192,7 @@ $lang->action->desc->run = '$date, 由 <strong>$actor</strong>
$lang->action->desc->syncprogram = '$date, 由 <strong>$actor</strong> 启动(因项目开始而启动项目集)。' . "\n";
$lang->action->desc->syncproject = '$date, 系统判断由于' . $lang->executionCommon .'开始,将项目状态置为进行中。' . "\n";
$lang->action->desc->syncexecution = '$date, 系统判断由于任务开始,将' . $lang->executionCommon . '状态置为进行中。' . "\n";
$lang->action->desc->syncexecutionbychild = '$date, 系统判断由于子阶段开始,将' . $lang->executionCommon . '状态置为进行中。' . "\n";
$lang->action->desc->importfromgitlab = '$date, 由 <strong>$actor</strong> 从Gitlab的Issue关联创建。' . "\n";
$lang->action->desc->archived = '$date, 由 <strong>$actor</strong> 归档。' . "\n";
$lang->action->desc->restore = '$date, 由 <strong>$actor</strong> 还原。' . "\n";
@@ -322,6 +323,7 @@ $lang->action->label->setdefaultbranch = '设置了默认分支';
$lang->action->label->syncprogram = '开始了';
$lang->action->label->syncproject = '开始了';
$lang->action->label->syncexecution = '开始了';
$lang->action->label->syncexecutionbychild = '开始了';
$lang->action->label->startProgram = '(因项目开始而启动项目集)';
$lang->action->label->createmr = '合并请求关联了';
$lang->action->label->deletemr = '合并请求取消了';
+27 -12
View File
@@ -78,7 +78,7 @@ class api extends control
$this->view->libID = $libID;
$this->view->apiID = $apiID;
$this->view->libs = $libs;
$this->view->moduleTree = $libID ? $this->doc->getApiModuleTree($libID, $apiID) : '';
$this->view->moduleTree = $libID ? $this->doc->getApiModuleTree($libID, $apiID, $release, $moduleID) : '';
$this->view->users = $this->user->getPairs('noclosed,noletter');
$this->display();
@@ -170,6 +170,8 @@ class api extends control
/**
* Api doc global struct page.
*
* @param int $libID
* @param int $releaseID
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
@@ -177,25 +179,34 @@ class api extends control
* @access public
* @return void
*/
public function struct($libID = 0, $orderBy = 'id', $recTotal = 0, $recPerPage = 15, $pageID = 1)
public function struct($libID = 0, $releaseID = 0, $orderBy = 'id', $recTotal = 0, $recPerPage = 15, $pageID = 1)
{
$libs = $this->doc->getApiLibs();
$this->app->loadClass('pager', $static = true);
$this->lang->modulePageNav = $this->generateLibsDropMenu($libs, $libID);
$this->lang->modulePageNav = $this->generateLibsDropMenu($libs, $libID, $releaseID);
$pager = new pager($recTotal, $recPerPage, $pageID);
/* Append id for secend sort. */
$sort = common::appendOrder($orderBy);
$structs = $this->api->getStructByQuery($libID, $pager, $sort);
if($releaseID)
{
$release = $this->api->getRelease($libID, 'byId', $releaseID);
$structs = $this->api->getStructListByRelease($release, '1 = 1 ', $sort);
}
else
{
$structs = $this->api->getStructByQuery($libID, $pager, $sort);
}
common::setMenuVars('doc', $libID);
$this->view->libID = $libID;
$this->view->structs = $structs;
$this->view->orderBy = $orderBy;
$this->view->title = $this->lang->api->struct;
$this->view->pager = $pager;
$this->view->libID = $libID;
$this->view->releaseID = $releaseID;
$this->view->structs = $structs;
$this->view->orderBy = $orderBy;
$this->view->title = $this->lang->api->struct;
$this->view->pager = $pager;
$this->display();
}
@@ -319,6 +330,7 @@ class api extends control
/* Record action for create api library. */
$this->action->create('docLib', $libID, 'Created');
if(!helper::isAjaxRequest()) return print(js::locate($this->createLink('api', 'index', "libID=$libID"), 'parent.parent'));
return $this->sendSuccess(array('locate' => $this->createLink('api', 'index', "libID=$libID")));
}
@@ -640,6 +652,8 @@ class api extends control
if(empty($libs)) return '';
if(!isset($libs[$libID])) return '';
$methodName = $this->app->rawMethod;
$libName = $libs[$libID]->name;
$output = <<<EOT
<div class='btn-group angle-btn'>
@@ -658,7 +672,7 @@ EOT;
foreach($libs as $key => $lib)
{
$selected = $key == $libID ? 'selected' : '';
$output .= html::a(inlink('index', "libID=$key"), $lib->name, '', "class='$selected' data-app='{$this->app->tab}'");
$output .= html::a(inlink($methodName, "libID=$key"), $lib->name, '', "class='$selected' data-app='{$this->app->tab}'");
}
$output .= "</div></div></div></div></div>";
@@ -681,12 +695,13 @@ EOT;
<div class='table-col'>
<div class='list-group'>
EOT;
$params = $methodName == 'index' ? "libID=$libID&moduleID=0&apiID=0&version=0" : "libID=$libID";
$selected = $version > 0 ? '' : 'selected';
$output .= html::a(inlink('index', "libID=$libID&moduleID=0&apiID=0&version=0&release=0"), $this->lang->api->defaultVersion, '', "class='$selected'");
$output .= html::a(inlink($methodName, $params . "&release=0"), $this->lang->api->defaultVersion, '', "class='$selected'");
foreach($versions as $key => $item)
{
$selected = $key == $version ? 'selected' : '';
$output .= html::a(inlink('index', "libID=$libID&moduleID=0&apiID=0&version=0&release=$key"), $item->version, '', "class='$selected' data-app='{$this->app->tab}'");
$output .= html::a(inlink($methodName, $params . "&release=$key"), $item->version, '', "class='$selected' data-app='{$this->app->tab}'");
}
$output .= "</div></div></div></div></div>";
}
+16 -2
View File
@@ -11,10 +11,11 @@
.main-col .doc-title {display: flex; font-size: 16px; margin-bottom: 15px;}
.main-col .doc-title .title {margin: 0; line-height: 30px; font-size: 25px;}
.main-col .doc-title .http-method {line-height: 27px; height: 27px; font-size: 13px; margin-right: 10px; padding: 0 10px;}
.main-col .doc-title .path {line-height: 30px; font-size: 20px; margin-right: 15px; word-wrap: break-word;}
.main-col .doc-title .path {line-height: 30px; font-size: 20px; margin-right: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
.main-col .doc-title .info {flex: 1 1 0;}
.main-col .doc-title .version a {font-size: 13px; color: #8c8c8c;}
.main-col .doc-title .version .dropdown-menu a:hover {color: #ffffff;}
.main-col .doc-title .actions {min-width: 120px; display: inline-block;}
.main-col .doc-title .actions a + a {margin-left: 8px;}
.main-col .doc-title .actions i {font-size: 15px; color: #8c8c8c;}
#content h2.title {margin: 0; font-size: 17px;}
@@ -94,10 +95,22 @@
color: #a41e22;
}
.detail .list-group-item a {
display: flex;
align-items: center;
}
.detail .list-group-item .path, .detail .list-group-item .desc {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.detail .list-group-item .path {
padding-left: 10px;
font-size: 14px;
color: black
color: black;
flex: 1;
}
.detail .list-group-item .desc {
width: auto;
@@ -105,6 +118,7 @@
line-height: 38px;
float: right;
padding-right: 10px;
max-width: 200px;
}
.detail .list-group-item {list-style: none; font-size: 14px; margin-bottom: 10px; line-height: 30px}
.detail .list-group-item span {line-height: 30px; width: 65px;}
+2
View File
@@ -2,3 +2,5 @@
.c-actions {width: 60px;}
tbody tr td {white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.m-api-releases {padding-bottom: 0px !important;}
-3
View File
@@ -199,9 +199,6 @@ $lang->api->structParamsOptons = array_merge($lang->api->paramsTypeOptions, ar
$lang->api->allParamsTypeOptions = array_merge($lang->api->paramsTypeOptions, $lang->api->paramsTypeCustomOptions);
$lang->api->requiredOptions = array(0 => 'No', 1 => 'Yes');
$lang->doclib = new stdclass();
$lang->doclib->name = 'API Library Name';
$lang->apistruct = new stdClass();
$lang->apistruct->name = 'Name';
-3
View File
@@ -199,9 +199,6 @@ $lang->api->structParamsOptons = array_merge($lang->api->paramsTypeOptions, ar
$lang->api->allParamsTypeOptions = array_merge($lang->api->paramsTypeOptions, $lang->api->paramsTypeCustomOptions);
$lang->api->requiredOptions = array(0 => '否', 1 => '是');
$lang->doclib = new stdclass();
$lang->doclib->name = '接口库名称';
$lang->apistruct = new stdClass();
$lang->apistruct->name = '结构名';
-3
View File
@@ -199,9 +199,6 @@ $lang->api->structParamsOptons = array_merge($lang->api->paramsTypeOptions, ar
$lang->api->allParamsTypeOptions = array_merge($lang->api->paramsTypeOptions, $lang->api->paramsTypeCustomOptions);
$lang->api->requiredOptions = array(0 => '否', 1 => '是');
$lang->doclib = new stdclass();
$lang->doclib->name = '介面庫名稱';
$lang->apistruct = new stdClass();
$lang->apistruct->name = '結構名';
+50 -19
View File
@@ -28,7 +28,9 @@ class apiModel extends model
const PARAMS_TYPE_CUSTOM = 'custom';
/**
* @param object $data
* Create release.
*
* @param object $data
* @access public
* @return int
*/
@@ -339,7 +341,7 @@ class apiModel extends model
}
if($version)
{
$fields = 'spec.*,api.id,api.product,api.lib,api.version,api.paramsExample,api.responseExample,doc.name as libName,module.name as moduleName,api.editedBy,api.editedDate';
$fields = 'spec.*,api.id,api.product,api.lib,api.version,doc.name as libName,module.name as moduleName,api.editedBy,api.editedDate';
}
else
{
@@ -370,7 +372,7 @@ class apiModel extends model
* @access public
* @return array
*/
public function getApiListByRelease($release, $where = '')
public function getApiListByRelease($release, $where = '1 = 1 ')
{
$strJoin = array();
foreach($release->snap['apis'] as $api)
@@ -483,6 +485,33 @@ class apiModel extends model
->fetchAll();
}
/**
* Get struct list by release.
*
* @param object $release
* @param string $where
* @param string $orderBy
* @access public
* @return array
*/
public function getStructListByRelease($release, $where = '1 = 1 ', $orderBy = 'id')
{
$strJoin = array();
foreach($release->snap['structs'] as $struct)
{
$strJoin[] = "(object.id = {$struct['id']} and spec.version = {$struct['version']} )";
}
if($strJoin) $where .= 'and (' . implode(' or ', $strJoin) . ')';
$list = $this->dao->select('object.lib,spec.name,spec.type,spec.desc,spec.attribute,spec.version,spec.addedBy,spec.addedDate,object.id,user.realname as addedName')->from(TABLE_APISTRUCT)->alias('object')
->leftJoin(TABLE_APISTRUCT_SPEC)->alias('spec')->on('object.name = spec.name')
->leftJoin(TABLE_USER)->alias('user')->on('user.account = spec.addedBy')
->where($where)
->orderBy($orderBy)
->fetchAll();
return $list;
}
/**
* @param int $libID
* @param string $pager
@@ -677,22 +706,24 @@ class apiModel extends model
private function getApiSpecByData($data)
{
return array(
'doc' => $data->id,
'module' => $data->module,
'title' => $data->title,
'path' => $data->path,
'protocol' => $data->protocol,
'method' => $data->method,
'requestType' => $data->requestType,
'responseType' => isset($data->responseType) ? $data->responseType : '',
'status' => $data->status,
'owner' => $data->owner,
'desc' => $data->desc,
'version' => $data->version,
'params' => $data->params,
'response' => $data->response,
'addedBy' => $this->app->user->account,
'addedDate' => helper::now(),
'doc' => $data->id,
'module' => $data->module,
'title' => $data->title,
'path' => $data->path,
'protocol' => $data->protocol,
'method' => $data->method,
'requestType' => $data->requestType,
'responseType' => isset($data->responseType) ? $data->responseType : '',
'status' => $data->status,
'owner' => $data->owner,
'desc' => $data->desc,
'version' => $data->version,
'params' => $data->params,
'paramsExample' => $data->paramsExample,
'responseExample' => $data->responseExample,
'response' => $data->response,
'addedBy' => $this->app->user->account,
'addedDate' => helper::now(),
);
}
+15 -14
View File
@@ -5,7 +5,7 @@
<div class="no-padding">
<div class="detail-title no-padding doc-title">
<div class="http-method label"><?php echo $api->method;?></div>
<div class="path"><?php echo $api->path;?></div>
<div class="path" title="<?php echo $api->path;?>"><?php echo $api->path;?></div>
<div class="info">
<div class="version">
<div class='btn-group'>
@@ -91,16 +91,17 @@
<?php
function parseTree($data, $typeList, $level = 0)
{
global $lang;
$str = '<tr>';
$field = '';
for($i = 0; $i < $level; $i++) $field .= '&nbsp;&nbsp;'. ($i == $level-1 ? '∟' : '&nbsp;') . '&nbsp;&nbsp;';
$field .= $data['field'];
$str .= '<td>' . $field . '</td>';
$str .= '<td>' . zget($typeList, $data['paramsType'], '') . '</td>';
$require = $data['required'] ? '是' : '否';
$str .= '<td>' . $require . '</td>';
$str .= '<td>' . $data['desc'] . '</td>';
$str .= '</tr>';
$field .= $data['field'];
$str .= '<td>' . $field . '</td>';
$str .= '<td>' . zget($typeList, $data['paramsType'], '') . '</td>';
$str .= '<td class="text-center">' . zget($lang->api->boolList, $data['required'], '') . '</td>';
$str .= '<td>' . $data['desc'] . '</td>';
$str .= '</tr>';
if(isset($data['children']) && count($data['children']) > 0)
{
$level++;
@@ -115,9 +116,9 @@
<thead>
<tr>
<th><?php echo $lang->api->req->name;?></th>
<th><?php echo $lang->api->req->type;?></th>
<th><?php echo $lang->api->req->required;?></th>
<th><?php echo $lang->api->req->desc;?></th>
<th class="w-50px"><?php echo $lang->api->req->type;?></th>
<th class="w-50px text-center"><?php echo $lang->api->req->required;?></th>
<th class="w-300px"><?php echo $lang->api->req->desc;?></th>
</tr>
</thead>
<tbody><?php foreach($api->params['params'] as $item) echo parseTree($item, $typeList);?></tbody>
@@ -133,9 +134,9 @@
<thead>
<tr>
<th><?php echo $lang->api->req->name;?></th>
<th><?php echo $lang->api->req->type;?></th>
<th><?php echo $lang->api->req->required;?></th>
<th><?php echo $lang->api->req->desc;?></th>
<th class="w-50px"><?php echo $lang->api->req->type;?></th>
<th class="w-50px text-center"><?php echo $lang->api->req->required;?></th>
<th class="w-300px"><?php echo $lang->api->req->desc;?></th>
</tr>
</thead>
<tbody>
-12
View File
@@ -65,17 +65,5 @@
</div>
</div>
</div>
<div class='hidden'>
<table>
<tr id='aclBoxA'>
<th><?php echo $lang->api->control;?></th>
<td><?php echo html::radio('acl', $lang->api->aclListA, 'default', "onchange='toggleAcl(this.value, \"lib\")'")?></td>
</tr>
<tr id='aclBoxB'>
<th><?php echo $lang->api->control;?></th>
<td><?php echo html::radio('acl', $lang->api->aclListB, 'open', "onchange='toggleAcl(this.value, \"lib\")'")?></td>
</tr>
</table>
</div>
<?php js::set('noticeAcl', $lang->api->noticeAcl);?>
<?php include '../../common/view/footer.lite.html.php';?>
+2 -2
View File
@@ -84,8 +84,8 @@
<div class="heading <?php echo $api->method;?>">
<a href="<?php echo helper::createLink('api', 'index', "libID={$api->lib}&moduleID=0&apiID={$api->id}&version=0&release=$release");?>">
<span class="label label-primary"><?php echo $api->method;?></span>
<span class="path"><?php echo $api->path;?></span>
<span class="desc"><?php echo $api->title;?></span>
<span class="path" title="<?php echo $api->path;?>"><?php echo $api->path;?></span>
<span class="desc" title="<?php echo $api->title;?>"><?php echo $api->title;?></span>
</a>
</div>
</li>
+1 -1
View File
@@ -30,7 +30,7 @@
<table class='table has-sort-head' id='userList'>
<thead>
<tr>
<?php $vars = "libID={$libID}&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
<?php $vars = "libID={$libID}&releaseID=$releaseID&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
<th class='c-id'><?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th class='c-type'><?php common::printOrderLink('type', $orderBy, $vars, $lang->api->structType);?></th>
<th class='c-name'><?php echo $lang->api->structName;?></th>
+1 -1
View File
@@ -39,7 +39,7 @@ if(!$selfCall) die(include('./todolist.html.php'));
<div class='panel-body'>
<div class="todoes-input">
<div class="todo-form-trigger"><input type="text" placeholder="<?php echo $lang->todo->lblClickCreate?>" autocomplete="off" class="form-control"></div>
<form class="form-horizontal todoes-form layer" method='post' target='hiddenwin' action='<?php echo $this->createLink('todo', 'create', 'date=today&userID=&from=block');?>'>
<form class="form-horizontal todoes-form layer not-watch" method='post' target='hiddenwin' action='<?php echo $this->createLink('todo', 'create', 'date=today&userID=&from=block');?>'>
<h3><?php echo $lang->todo->create;?></h3>
<?php $leftWidth = common::checkNotCN() ? 'col-sm-3' : 'col-sm-2';?>
<div class="form-group">
+43
View File
@@ -1408,6 +1408,49 @@ class bugModel extends model
}
}
/**
* Get statistic.
*
* @param int $productID
* @param string $endDate
* @param int $days
* @access public
* @return void
*/
public function getStatistic($productID = 0, $endDate = '', $days = 30)
{
$startDate = '';
if(empty($endDate)) $endDate = date('Y-m-d');
$dateArr = array();
for($day = $days - 1; $day >= 0; $day--)
{
$time = strtotime(-$day . ' day', strtotime($endDate));
$date = date('m/d', $time);
$dateArr[$date] = new stdClass();
$dateArr[$date]->num = 0;
$dateArr[$date]->date = $date;
if($day == $days -1) $startDate = date('Y-m-d', $time) . ' 00:00:00';
}
$dateFields = ['openedDate', 'resolvedDate', 'closedDate'];
$staticData = array();
foreach($dateFields as $field)
{
$bugCount = $this->dao->select("count(id) as num, date_format($field, '%m/%d') as date")->from(TABLE_BUG)
->where('product')->eq($productID)
->andWhere($field)->ne('0000-00-00 00:00:00')
->andWhere($field)->ne('')
->andWhere('deleted')->eq(0)
->andWhere($field)->between($startDate, $endDate . ' 23:50:59')
->groupBy('date')
->fetchAll('date');
$staticData[$field] = array_merge($dateArr, $bugCount);
}
return $staticData;
}
/**
* Build search form.
*
+30 -2
View File
@@ -65,7 +65,8 @@ class commonModel extends model
if($thisModule == 'execution')
{
$executionID = $objectID;
$execution = $this->dao->select('id, project')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch();
$execution = $this->dao->select('id, project, grade, parent')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch();
$this->syncExecutionByChild($execution);
$project = $this->syncProjectStatus($execution);
$this->syncProgramStatus($project);
}
@@ -102,7 +103,6 @@ class commonModel extends model
->andWhere('status')->eq('wait')
->orderBy('id_desc')
->fetchPairs();
$now = helper::now();
$this->dao->update(TABLE_PROGRAM)->set('status')->eq('doing')->set('realBegan')->eq($now)->where('id')->in($waitList)->exec();
foreach($waitList as $programID)
@@ -137,6 +137,34 @@ class commonModel extends model
return $project;
}
/**
* Set the status of the execution to which the sub execution is linked as Ongoing.
*
* @param object $execution
* @access public
* @return object $parentExecution
*/
public function syncExecutionByChild($execution)
{
if($execution->grade == 1) return false;
$parentExecutionID = $execution->parent;
$today = helper::today();
$parentExecution = $this->dao->select('*')->from(TABLE_EXECUTION)->where('id')->eq($parentExecutionID)->fetch();
if($parentExecution->status == 'wait')
{
$this->dao->update(TABLE_EXECUTION)
->set('status')->eq('doing')
->beginIf(helper::isZeroDate($parentExecution->realBegan))->set('realBegan')->eq($today)->fi()
->where('id')->eq($parentExecutionID)
->exec();
$this->loadModel('action')->create('execution', $parentExecutionID, 'syncexecutionbychild');
}
return $parentExecution;
}
/**
* Set the status of the execution to which the task is linked as Ongoing.
*
+2 -2
View File
@@ -46,7 +46,7 @@ $lang->custom->SRConcept = "SR Concept";
$lang->custom->reviewRule = 'Review Rules';
$lang->custom->switch = "Switch";
$lang->custom->oneUnit = "One {$lang->hourCommon}";
$lang->custom->convertRelationTitle = "Please set the conversion factor of {$lang->hourCommon} to %s first";
$lang->custom->convertRelationTitle = "Please firstly set the conversion factor from {$lang->hourCommon} to %s";
if($config->systemMode == 'new') $lang->custom->execution = 'Execution';
if($config->systemMode == 'classic' || !$config->systemMode) $lang->custom->execution = $lang->executionCommon;
@@ -71,7 +71,7 @@ $lang->custom->regionMustNumber = 'The interval must be a number!';
$lang->custom->tipNotEmpty = 'The prompt can not be empty!';
$lang->custom->currencyNotEmpty = 'You have to select one currency at least.';
$lang->custom->defaultNotEmpty = 'The default currency can not be empty';
$lang->custom->convertRelationTips = "After {$lang->hourCommon} is converted to %s, historical data will be uniformly converted to %s";
$lang->custom->convertRelationTips = "After converting {$lang->hourCommon} to %s, the historical data will be converted uniformly to %s.";
$lang->custom->saveTips = 'After clicking save, the current %s will be used as the default estimation unit';
$lang->custom->numberError = 'The interval must be greater than zero!';
+2 -2
View File
@@ -47,7 +47,7 @@ $lang->custom->SRConcept = "SR Concept";
$lang->custom->reviewRule = 'Review Rules';
$lang->custom->switch = "Switch";
$lang->custom->oneUnit = "One {$lang->hourCommon}";
$lang->custom->convertRelationTitle = "Please set the conversion factor of {$lang->hourCommon} to %s first";
$lang->custom->convertRelationTitle = "Please firstly set the conversion factor from {$lang->hourCommon} to %s";
$lang->custom->superReviewers = "Super Reviewer";
if($config->systemMode == 'new') $lang->custom->execution = 'Execution';
@@ -73,7 +73,7 @@ $lang->custom->regionMustNumber = 'The interval must be a number!';
$lang->custom->tipNotEmpty = 'The prompt can not be empty!';
$lang->custom->currencyNotEmpty = 'You have to select one currency at least.';
$lang->custom->defaultNotEmpty = 'The default currency can not be empty';
$lang->custom->convertRelationTips = "After {$lang->hourCommon} is converted to %s, historical data will be uniformly converted to %s";
$lang->custom->convertRelationTips = "After converting {$lang->hourCommon} to %s, the historical data will be converted uniformly to %s.";
$lang->custom->saveTips = 'After clicking save, the current %s will be used as the default estimation unit';
$lang->custom->numberError = 'The interval must be greater than zero!';
+2 -2
View File
@@ -46,7 +46,7 @@ $lang->custom->SRConcept = "SR Concept";
$lang->custom->reviewRule = 'Review Rules';
$lang->custom->switch = "Switch";
$lang->custom->oneUnit = "One {$lang->hourCommon}";
$lang->custom->convertRelationTitle = "Please set the conversion factor of {$lang->hourCommon} to %s first";
$lang->custom->convertRelationTitle = "Please firstly set the conversion factor from {$lang->hourCommon} to %s";
if($config->systemMode == 'new') $lang->custom->execution = 'Execution';
if($config->systemMode == 'classic' || !$config->systemMode) $lang->custom->execution = $lang->executionCommon;
@@ -71,7 +71,7 @@ $lang->custom->regionMustNumber = 'The interval must be a number!';
$lang->custom->tipNotEmpty = 'The prompt can not be empty!';
$lang->custom->currencyNotEmpty = 'You have to select one currency at least.';
$lang->custom->defaultNotEmpty = 'The default currency can not be empty';
$lang->custom->convertRelationTips = "After {$lang->hourCommon} is converted to %s, historical data will be uniformly converted to %s";
$lang->custom->convertRelationTips = "After converting {$lang->hourCommon} to %s, the historical data will be converted uniformly to %s.";
$lang->custom->saveTips = 'After clicking save, the current %s will be used as the default estimation unit';
$lang->custom->numberError = 'The interval must be greater than zero!';
+2 -2
View File
@@ -46,7 +46,7 @@ $lang->custom->SRConcept = "SR Concept";
$lang->custom->reviewRule = 'Review Rules';
$lang->custom->switch = "Switch";
$lang->custom->oneUnit = "One {$lang->hourCommon}";
$lang->custom->convertRelationTitle = "Please set the conversion factor of {$lang->hourCommon} to %s first";
$lang->custom->convertRelationTitle = "Please firstly set the conversion factor from {$lang->hourCommon} to %s";
if($config->systemMode == 'new') $lang->custom->execution = 'Execution';
if($config->systemMode == 'classic' || !$config->systemMode) $lang->custom->execution = $lang->executionCommon;
@@ -71,7 +71,7 @@ $lang->custom->regionMustNumber = 'The interval must be a number!';
$lang->custom->tipNotEmpty = 'The prompt can not be empty!';
$lang->custom->currencyNotEmpty = 'You have to select one currency at least.';
$lang->custom->defaultNotEmpty = 'The default currency can not bu empty';
$lang->custom->convertRelationTips = "After {$lang->hourCommon} is converted to %s, historical data will be uniformly converted to %s";
$lang->custom->convertRelationTips = "After converting {$lang->hourCommon} to %s, the historical data will be converted uniformly to %s.";
$lang->custom->saveTips = 'After clicking save, the current %s will be used as the default estimation unit';
$lang->custom->numberError = 'The interval must be greater than zero!';
+2
View File
@@ -171,6 +171,8 @@ class doc extends control
if(empty($projects)) unset($libTypeList['project']);
if(empty($executions)) unset($libTypeList['execution']);
$this->app->loadLang('api');
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->users = $this->user->getPairs('nocode|noclosed');
$this->view->products = $products;
+1 -1
View File
@@ -42,7 +42,7 @@ function toggleAcl(acl, type)
var notice = typeof(noticeAcl[libType][acl]) != 'undefined' ? noticeAcl[libType][acl] : '';
$('#noticeAcl').html(notice);
if(libType == 'custom' && acl == 'private') $('#whiteListBox').addClass('hidden');
if((libType == 'custom' || libType == 'api') && acl == 'private') $('#whiteListBox').addClass('hidden');
if(libType == 'project' && typeof(doclibID) != 'undefined')
{
+53
View File
@@ -29,6 +29,14 @@ function changeByLibType(libType)
$('table tr.execution').addClass('hidden');
$('#execution').attr('disabled', true);
$('.normalLib').removeClass('hidden');
$('.normalLib input').attr('disabled', false);
$('table tr.apilib').addClass('hidden');
$('.apilib input, #desc, #baseUrl').attr('disabled', true);
$('form').removeAttr('action');
changeDoclibAcl(libType);
}
else if(libType == 'project')
@@ -42,6 +50,14 @@ function changeByLibType(libType)
$('table tr.execution').addClass('hidden');
$('#execution').attr('disabled', true);
$('.normalLib').removeClass('hidden');
$('.normalLib input').attr('disabled', false);
$('table tr.apilib').addClass('hidden');
$('.apilib input, #desc, #baseUrl').attr('disabled', true);
$('form').removeAttr('action');
changeDoclibAcl(libType);
}
else if(libType == 'execution')
@@ -55,6 +71,35 @@ function changeByLibType(libType)
$('table tr.project').addClass('hidden');
$('#project').attr('disabled', true);
$('.normalLib').removeClass('hidden');
$('.normalLib input').attr('disabled', false);
$('table tr.apilib').addClass('hidden');
$('.apilib input, #desc, #baseUrl').attr('disabled', true);
$('form').removeAttr('action');
changeDoclibAcl(libType);
}
else if(libType == 'api')
{
$('table tr.product').addClass('hidden');
$('#product').attr('disabled', true);
$('table tr.project').addClass('hidden');
$('#project').attr('disabled', true);
$('table tr.execution').addClass('hidden');
$('#execution').attr('disabled', true);
$('.normalLib').addClass('hidden');
$('.normalLib input').attr('disabled', true);
$('table tr.apilib').removeClass('hidden');
$('.apilib input, #desc, #baseUrl').attr('disabled', false);
$('form').attr('action', createLink('api', 'createLib'));
changeDoclibAcl(libType);
}
else
@@ -68,6 +113,14 @@ function changeByLibType(libType)
$('table tr.execution').addClass('hidden');
$('#execution').attr('disabled', true);
$('.normalLib').removeClass('hidden');
$('.normalLib input').attr('disabled', false);
$('table tr.apilib').addClass('hidden');
$('.apilib input, #desc, #baseUrl').attr('disabled', true);
$('form').removeAttr('action');
changeDoclibAcl(libType);
}
+4
View File
@@ -158,6 +158,7 @@ $lang->doc->allExecutions = 'All' . $lang->executionCommon . 's';
$lang->doc->libTypeList['product'] = $lang->productCommon . ' Library';
if($config->systemMode == 'new') $lang->doc->libTypeList['project'] = 'Project Library';
$lang->doc->libTypeList['execution'] = $lang->execution->common . ' Library';
$lang->doc->libTypeList['api'] = 'API Library';
$lang->doc->libTypeList['custom'] = 'Custom Library';
$lang->doc->libGlobalList['api'] = 'Api Libray';
@@ -248,6 +249,9 @@ $lang->doc->noticeAcl['lib']['project']['private'] = 'Users who can access the
$lang->doc->noticeAcl['lib']['project']['custom'] = 'Users in the whiltelist can access it.';
$lang->doc->noticeAcl['lib']['execution']['default'] = "Users who can access the selected {$lang->executionCommon} can access it.";
$lang->doc->noticeAcl['lib']['execution']['custom'] = "Users who can access the selected {$lang->executionCommon} or users in the whiltelist can access it.";
$lang->doc->noticeAcl['lib']['api']['open'] = 'All users can access it.';
$lang->doc->noticeAcl['lib']['api']['custom'] = 'Users in the whitelist can access it.';
$lang->doc->noticeAcl['lib']['api']['private'] = 'Only the one who created it can access it.';
$lang->doc->noticeAcl['lib']['custom']['open'] = 'All users can access it.';
$lang->doc->noticeAcl['lib']['custom']['custom'] = 'Users in the whitelist can access it.';
$lang->doc->noticeAcl['lib']['custom']['private'] = 'Only the one who created it can access it.';
+5
View File
@@ -21,6 +21,7 @@ $lang->doclib->execution = $lang->executionCommon . '库';
$lang->doclib->product = $lang->productCommon . '库';
$lang->doclib->apiLibName = '接口库名称';
$lang->doclib->aclListA = array();
$lang->doclib->aclListA['default'] = '默认';
$lang->doclib->aclListA['custom'] = '自定义';
@@ -158,6 +159,7 @@ $lang->doc->allExecutions = '所有' . $lang->executionCommon;
$lang->doc->libTypeList['product'] = $lang->productCommon . '文档库';
if($config->systemMode == 'new') $lang->doc->libTypeList['project'] = '项目文档库';
$lang->doc->libTypeList['execution'] = $lang->execution->common . '文档库';
$lang->doc->libTypeList['api'] = '接口库';
$lang->doc->libTypeList['custom'] = '自定义文档库';
$lang->doc->libGlobalList['api'] = '接口文档库';
@@ -248,6 +250,9 @@ $lang->doc->noticeAcl['lib']['project']['private'] = "有所选项目访问权
$lang->doc->noticeAcl['lib']['project']['custom'] = "白名单的用户可以访问。";
$lang->doc->noticeAcl['lib']['execution']['default'] = "有所选{$lang->executionCommon}访问权限的用户可以访问。";
$lang->doc->noticeAcl['lib']['execution']['custom'] = "有所选{$lang->executionCommon}访问权限或白名单里的用户可以访问。";
$lang->doc->noticeAcl['lib']['api']['open'] = '所有人都可以访问。';
$lang->doc->noticeAcl['lib']['api']['custom'] = '白名单的用户可以访问。';
$lang->doc->noticeAcl['lib']['api']['private'] = '只有创建者自己可以访问。';
$lang->doc->noticeAcl['lib']['custom']['open'] = '所有人都可以访问。';
$lang->doc->noticeAcl['lib']['custom']['custom'] = '白名单的用户可以访问。';
$lang->doc->noticeAcl['lib']['custom']['private'] = '只有创建者自己可以访问。';
+32 -12
View File
@@ -89,6 +89,18 @@ class docModel extends model
$products = $this->loadModel('product')->getPairs();
$projects = $this->loadModel('project')->getPairsByProgram();
$executions = $this->loadModel('execution')->getPairs();
$waterfalls = array();
if(empty($objectID) and ($type == 'all' or $type == 'execution'))
{
$waterfalls = $this->dao->select('t1.id,t2.name')->from(TABLE_EXECUTION)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')
->where('t1.type')->eq('stage')
->andWhere('t2.type')->eq('project')
->andWhere('t2.model')->eq('waterfall')
->andWhere('t1.deleted')->eq('0')
->andWhere('t2.deleted')->eq('0')
->fetchPairs('id', 'name');
}
$libPairs = array();
while($lib = $stmt->fetch())
@@ -102,8 +114,12 @@ class docModel extends model
if(strpos($extra, 'withObject') !== false)
{
if($lib->product != 0) $lib->name = zget($products, $lib->product, '') . ' / ' . $lib->name;
if($lib->execution != 0) $lib->name = zget($executions, $lib->execution, '') . ' / ' . $lib->name;
if($lib->project != 0) $lib->name = zget($projects, $lib->project, '') . ' / ' . $lib->name;
if($lib->execution != 0)
{
$lib->name = zget($executions, $lib->execution, '') . ' / ' . $lib->name;
if(!empty($waterfalls[$lib->execution])) $lib->name = $waterfalls[$lib->execution] . ' / ' . $lib->name;
}
}
$libPairs[$lib->id] = $lib->name;
@@ -2251,9 +2267,14 @@ EOT;
/**
* Get api doc module tree
*
* @author thanatos thanatos915@163.com
* @param int $rootID
* @param pointer $docID
* @param int $release
* @param int $moduleID
* @access public
* @return string
*/
public function getApiModuleTree($rootID, &$docID = 0, $release = 0)
public function getApiModuleTree($rootID, &$docID = 0, $release = 0, $moduleID = 0)
{
$startModulePath = '';
$currentMethod = $this->app->getMethodName();
@@ -2262,7 +2283,7 @@ EOT;
if($release)
{
$rel = $this->api->getReleaseById($release);
$rel = $this->api->getRelease($rootID, 'byId', $release);
$docs = $this->api->getApiListByRelease($rel);
}
else
@@ -2283,9 +2304,9 @@ EOT;
$treeMenu = array();
if($release)
{
foreach($release->snap['modules'] as $module)
foreach($rel->snap['modules'] as $module)
{
$this->buildTree($treeMenu, 'api', 0, $rootID, $module, $moduleDocs, $docID);
$this->buildTree($treeMenu, 'api', 0, $rootID, $module, $moduleDocs, $docID, $moduleID);
}
}
else
@@ -2300,7 +2321,7 @@ EOT;
$stmt = $this->dbh->query($query);
while ($module = $stmt->fetch())
{
$this->buildTree($treeMenu, 'api', 0, $rootID, $module, $moduleDocs, $docID);
$this->buildTree($treeMenu, 'api', 0, $rootID, $module, $moduleDocs, $docID, $moduleID);
}
}
@@ -2429,10 +2450,11 @@ EOT;
* @param object $module
* @param array $moduleDocs
* @param pointer $docID
* @param int $moduleID
* @access private
* @return string
*/
private function buildTree(&$treeMenu, $type, $objectID, $libID, $module, $moduleDocs, &$docID)
private function buildTree(&$treeMenu, $type, $objectID, $libID, $module, $moduleDocs, &$docID, $moduleID = 0)
{
if(!isset($treeMenu[$module->id])) $treeMenu[$module->id] = '';
@@ -2467,7 +2489,7 @@ EOT;
if(common::hasPriv('doc', 'edit'))
{
$treeMenu[$module->id] .= "<div class='tree-actions'>";
$treeMenu[$module->id] .= html::a(helper::createLink('doc', 'edit', "docID=$docID&comment=false&objectType=$type&objectID=$objectID&libID=$libID"), "<i class='icon icon-edit'></i>", '', "title={$this->lang->doc->edit} data-app={$this->app->tab}");
$treeMenu[$module->id] .= html::a(helper::createLink('doc', 'edit', "docID={$doc->id}&comment=false&objectType=$type&objectID=$objectID&libID=$libID"), "<i class='icon icon-edit'></i>", '', "title={$this->lang->doc->edit} data-app={$this->app->tab}");
$treeMenu[$module->id] .= '</div>';
}
$treeMenu[$module->id] .= '</div>';
@@ -2520,9 +2542,7 @@ EOT;
if($type == static::DOC_TYPE_API)
{
$params = $_GET;
$moduleID = isset($params['moduleID']) ? $params['moduleID'] : 0;
if($moduleID && $moduleID == $module->id)
if($moduleID and $moduleID == $module->id)
{
array_push($class, 'active');
}
+16 -2
View File
@@ -19,7 +19,7 @@
<div class='main-header'>
<h2><?php echo $lang->doc->createLib;?></h2>
</div>
<form method='post' target='hiddenwin' >
<form method='post' target='hiddenwin'>
<table class='table table-form'>
<tr>
<th class='w-110px'><?php echo $lang->doc->libType?></th>
@@ -45,10 +45,18 @@
<th><?php echo $lang->doc->execution?></th>
<td><?php echo html::select('execution', $executions, $type == 'execution' ? $objectID : '', "class='form-control chosen' data-drop_direction='down'")?></td>
</tr>
<tr>
<tr class="normalLib">
<th><?php echo $lang->doclib->name?></th>
<td><?php echo html::input('name', '', "class='form-control'")?></td>
</tr>
<tr class='apilib hidden'>
<th><?php echo $lang->api->name?></th>
<td><?php echo html::input('name', '', "class='form-control'")?></td>
</tr>
<tr class="apilib hidden">
<th><?php echo $lang->api->baseUrl?></th>
<td><?php echo html::input('baseUrl', '', "class='form-control' placeholder='" . $lang->api->baseUrlDesc . "'");?></td>
</tr>
<tr>
<th><?php echo $lang->doclib->control;?></th>
<td>
@@ -69,6 +77,12 @@
</div>
</td>
</tr>
<tr class="apilib hidden">
<th><?php echo $lang->api->desc;?></th>
<td>
<?php echo html::textarea('desc', '', "rows='8' class='form-control kindeditor' hidefocus='true' tabindex=''");?>
</td>
</tr>
<tr>
<td class='text-center form-actions' colspan='2'><?php echo html::submitButton();?></td>
</tr>
+2 -2
View File
@@ -3587,7 +3587,7 @@ class execution extends control
if($execution->type == 'project')
{
$moduleName = 'projectstory';
$param = "projectID=$executionID";
$param = "projectID=$executionID&productID=$productID";
}
if($execution->type == 'kanban')
@@ -3596,7 +3596,7 @@ class execution extends control
$lang->executionCommon = $lang->execution->kanban;
include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php';
}
if($count != 0) echo js::alert(sprintf($this->lang->execution->haveDraft, $count)) . js::locate($this->createLink($moduleName, $execution->type == 'sprint' ? 'story' : 'kanban', $param));
if($count != 0) echo js::alert(sprintf($this->lang->execution->haveDraft, $count)) . js::locate($this->createLink($moduleName, in_array($execution->type, array('sprint','project')) ? 'story' : 'kanban', $param));
return print(js::locate(helper::createLink($moduleName, $fromMethod, $param)));
}
+2
View File
@@ -1,3 +1,5 @@
.pager {margin-top: 0;}
.tree li>a:hover {color: #fff; background-color: #0c64eb;}
.tree li>a.active {color: #fff; background-color: #0c64eb;}
.side-col {width: 210px;}
#sidebar .cell {width: 190px;}
+3 -3
View File
@@ -206,13 +206,13 @@ class install extends control
if(!empty($_POST))
{
$this->install->grantPriv();
if(dao::isError()) return print(js::error(dao::getError()));
if(dao::isError()) return print(js::error(dao::getError()) . js::locate('back'));
$this->install->updateLang();
if(dao::isError()) return print(js::error(dao::getError()));
if(dao::isError()) return print(js::error(dao::getError()) . js::locate('back'));
if($this->post->importDemoData) $this->install->importDemoData();
if(dao::isError()) echo js::alert($this->lang->install->errorImportDemoData);
if(dao::isError()) return print(js::alert($this->lang->install->errorImportDemoData) . js::locate('back'));
$this->loadModel('setting');
$this->setting->updateVersion($this->config->version);
+21
View File
@@ -0,0 +1,21 @@
$(function()
{
$('#submit').click(function()
{
if($('#company').val().length == 0)
{
alert(errorEmpty.company);
return false;
}
else if($('#account').val().length == 0)
{
alert(errorEmpty.account);
return false;
}
else if($('#password').val().length == 0)
{
alert(errorEmpty.password);
return false;
}
})
})
+2 -1
View File
@@ -10,6 +10,7 @@
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<?php js::set('errorEmpty', $lang->install->errorEmpty);?>
<style>.modal-body table tr th{text-align: right}</style>
<div class='container'>
<div class='modal-dialog'>
@@ -44,7 +45,7 @@
<strong><?php echo $lang->install->getPriv;?></strong>
</div>
<div class='modal-body'>
<form method='post' target='hiddenwin'>
<form method='post'>
<table class='table table-form mw-400px' style='margin: 0 auto'>
<tr>
<th class='c-company'><?php echo $lang->install->company;?></th>
+4 -2
View File
@@ -248,7 +248,8 @@ class jobModel extends model
$this->dao->insert(TABLE_JOB)->data($job)
->batchCheck($this->config->job->create->requiredFields, 'notempty')
->batchCheckIF($job->triggerType === 'schedule', "atDay,atTime", 'notempty')
->batchCheckIF($job->triggerType === 'schedule' and $job->atDay !== '0', "atDay", 'notempty')
->batchCheckIF($job->triggerType === 'schedule', "atTime", 'notempty')
->batchCheckIF($job->triggerType === 'commit', "comment", 'notempty')
->batchCheckIF(($this->post->repoType == 'Subversion' and $job->triggerType == 'tag'), "svnDir", 'notempty')
->batchCheckIF($job->frame === 'sonarqube', "sonarqubeServer,projectKey", 'notempty')
@@ -366,7 +367,8 @@ class jobModel extends model
$this->dao->update(TABLE_JOB)->data($job)
->batchCheck($this->config->job->edit->requiredFields, 'notempty')
->batchCheckIF($job->triggerType === 'schedule', "atDay,atTime", 'notempty')
->batchCheckIF($job->triggerType === 'schedule' and $job->atDay !== '0', "atDay", 'notempty')
->batchCheckIF($job->triggerType === 'schedule', "atTime", 'notempty')
->batchCheckIF($job->triggerType === 'commit', "comment", 'notempty')
->batchCheckIF(($this->post->repoType == 'Subversion' and $job->triggerType == 'tag'), "svnDir", 'notempty')
->batchCheckIF($job->frame === 'sonarqube', "sonarqubeServer,projectKey", 'notempty')
+9 -9
View File
@@ -51,16 +51,16 @@
<form class='main-table' id='ajaxForm' method='post'>
<table id='gitlabProjectList' class='table has-sort-head table-fixed'>
<thead>
<tr>
<tr class='text-left'>
<?php $vars = "mode=$mode&param=$param&objectID=$objectID&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<th class='w-60px text-left'><?php common::printOrderLink('id', $orderBy, $vars, $lang->mr->id);?></th>
<th class='w-200px text-left'><?php common::printOrderLink('title', $orderBy, $vars, $lang->mr->title);?></th>
<th class='w-200px text-left'><?php common::printOrderLink('sourceBranch', $orderBy, $vars, $lang->mr->sourceBranch);?></th>
<th class='w-200px text-left'><?php common::printOrderLink('targetBranch', $orderBy, $vars, $lang->mr->targetBranch);?></th>
<th class='w-120px text-left'><?php common::printOrderLink('mergeStatus', $orderBy, $vars, $lang->mr->mergeStatus);?></th>
<th class='w-120px text-left'><?php common::printOrderLink('approvalStatus', $orderBy, $vars, $lang->mr->approvalStatus);?></th>
<th class='w-120px text-left'><?php common::printOrderLink('createdBy', $orderBy, $vars, $lang->mr->author);?></th>
<th class='w-120px c-actions-3'><?php echo $lang->actions;?></th>
<th class='w-60px'><?php common::printOrderLink('id', $orderBy, $vars, $lang->mr->id);?></th>
<th class='c-name'><?php common::printOrderLink('title', $orderBy, $vars, $lang->mr->title);?></th>
<th class='w-200px'><?php common::printOrderLink('sourceBranch', $orderBy, $vars, $lang->mr->sourceBranch);?></th>
<th class='w-200px'><?php common::printOrderLink('targetBranch', $orderBy, $vars, $lang->mr->targetBranch);?></th>
<th class='w-120px'><?php common::printOrderLink('mergeStatus', $orderBy, $vars, $lang->mr->mergeStatus);?></th>
<th class='w-120px'><?php common::printOrderLink('approvalStatus', $orderBy, $vars, $lang->mr->approvalStatus);?></th>
<th class='w-120px'><?php common::printOrderLink('createdBy', $orderBy, $vars, $lang->mr->author);?></th>
<th class='c-actions-5'><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
+1 -1
View File
@@ -174,7 +174,7 @@ class my extends control
$reviewCount = $pager->recTotal;
/* Get the number of nc assigned to me. */
$ncList = $this->my->getNcList('assignedToMe', 'id_desc', $pager);
$ncList = $this->my->getNcList('assignedToMe', 'id_desc', $pager, 'active');
$ncCount = $pager->recTotal;
/* Get the number of meetings assigned to me. */
+1
View File
@@ -1,3 +1,4 @@
.project-type-label.label-outline {width: 50px; min-width: 50px;}
.project-type-label.label {overflow: unset !important; text-overflow: unset !important; white-space: unset !important;}
[lang^='en'] .project-name > .label-warning {width: 55px !important;}
#projectTableList > tr > td.c-name.text-left > div > a {color: #0c60e1;}
+6
View File
@@ -775,11 +775,15 @@ class programplanModel extends model
if($planChanged) $plan->version = $oldPlan->version + 1;
if(empty($plan->parent)) $plan->parent = $projectID;
/* Fix bug #22030. Reset field name for show dao error. */
$this->lang->project->name = $this->lang->programplan->name;
$this->dao->update(TABLE_PROJECT)->data($plan)
->autoCheck()
->batchCheck($this->config->programplan->edit->requiredFields, 'notempty')
->checkIF($plan->end != '0000-00-00', 'end', 'ge', $plan->begin)
->checkIF($plan->percent != false, 'percent', 'float')
->checkIF((!empty($plan->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != {$planID} and type in ('sprint','stage') and `project` = {$oldPlan->project}")
->where('id')->eq($planID)
->exec();
@@ -920,6 +924,8 @@ class programplanModel extends model
*/
public function isCreateTask($planID)
{
if(empty($planID)) return true;
$task = $this->dao->select('*')->from(TABLE_TASK)->where('execution')->eq($planID)->andWhere('deleted')->eq('0')->limit(1)->fetch();
return empty($task) ? true : false;
}
+1 -1
View File
@@ -415,7 +415,7 @@ class projectModel extends model
$workhour = new stdclass();
$workhour->totalHours = $this->dao->select('sum(t1.days * t1.hours) AS totalHours')->from(TABLE_TEAM)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.root=t2.id')
->where('t2.project')->in($projectID)
->where('t2.id')->in($projectID)
->andWhere('t2.deleted')->eq(0)
->andWhere('t1.type')->eq('project')
->fetch('totalHours');
+6 -4
View File
@@ -143,14 +143,15 @@
<div class="clearfix">
<?php if(!empty($project->teamMembers)):?>
<div class='project-members pull-left'>
<?php foreach($project->teamMembers as $member):?>
<?php foreach($project->teamMembers as $key => $member):?>
<?php
if($count > 2) continue;
if(!isset($users[$member]))
{
$project->teamCount --;
unset($project->teamMembers[$key]);
continue;
}
if($count > 2) continue;
$count ++;
?>
<a href='<?php echo helper::createLink('project', 'team', "projectID=$projectID");?>' title="<?php echo $users[$member];?>">
@@ -159,8 +160,9 @@
<?php endforeach;?>
<?php if($project->teamCount > 3):?>
<?php if($project->teamCount > 4) echo '<span>…</span>';?>
<a href='<?php echo helper::createLink('project', 'team', "projectID=$projectID");?>' title="<?php echo $users[$member];?>">
<?php echo html::middleAvatar(array('avatar' => $usersAvatar[end($project->teamMembers)], 'account' => $member, 'name' => $users[$member]), 'avatar-circle avatar-' . zget($userIdPairs, $member)); ?>
<?php $lastMember = end($project->teamMembers);?>
<a href='<?php echo helper::createLink('project', 'team', "projectID=$projectID");?>' title="<?php echo $users[$lastMember];?>">
<?php echo html::middleAvatar(array('avatar' => $usersAvatar[$lastMember], 'account' => $lastMember, 'name' => $users[$lastMember]), 'avatar-circle avatar-' . zget($userIdPairs, $lastMember)); ?>
</a>
<?php endif;?>
</div>
+2
View File
@@ -189,3 +189,5 @@ h3 {font-size: 16px;}
#submitLabel {text-align: left;}
.header-btn .btn > .text {text-overflow: unset !important;}
#repoPageSize {right: 90px;}
+1 -1
View File
@@ -57,7 +57,7 @@ class repoModel extends model
}
common::setMenuVars('devops', $repoID);
if(!session_id()) session_start();
session_start();
$this->session->set('repoID', $repoID);
session_write_close();
}
+13
View File
@@ -14,6 +14,7 @@
$pathInfo = '&root=' . $this->repo->encodePath(empty($path) ? '/' : $path);
if(isset($entry)) $pathInfo .= '&type=file';
?>
<?php js::set('paramsBase', "repoID=$repoID&path=" . $this->repo->encodePath($path) . "&objectID=$objectID&type=$logType");?>
<form id='logForm' class='main-table' data-ride='table' method='post'>
<table class='table table-fixed'>
<thead>
@@ -52,6 +53,7 @@ if(isset($entry)) $pathInfo .= '&type=file';
<?php if(common::hasPriv('repo', 'diff')) echo html::submitButton($lang->repo->diff, '', count($revisions) < 2 ? 'disabled btn btn-primary' : 'btn btn-primary')?>
<?php echo html::a($this->repo->createLink('log', "repoID=$repoID&objectID=$objectID&entry=" . $this->repo->encodePath($path) . "&revision=HEAD&type=$logType"), $lang->repo->allLog, '', "class='allLogs' data-app='{$this->app->tab}'");?>
<div class='pull-right'>
<ul id="repoPageSize" class="pager" data-ride="pager" data-elements="size_menu" data-rec-total="<?php echo $pager->recTotal;?>" data-rec-per-page="<?php echo $pager->recPerPage;?>" data-page="<?php echo $pager->pageID;?>"></ul>
<div class='btn-group'>
<?php
$prePage = $pager->pageID == 1 ? 1 : $pager->pageID - 1;
@@ -84,4 +86,15 @@ $("input:checkbox[name='revision[]']").click(function(){
$("input:checkbox[name='revision[]']").each(function(){$(this).attr("disabled", false)});
}
});
$(function()
{
var myPager = $('#repoPageSize').data('zui.pager');
if(!myPager) $('#repoPageSize').pager();
$('#repoPageSize').on('onPageChange', function(e, state, oldState) {
var link = createLink('repo', 'ajaxSideCommits', paramsBase + '&recTotal=' + state.recTotal + '&recPerPage=' + state.recPerPage + '&pageID=' + state.page);
$('#sidebar .side-body').load(link);
});
});
</script>
+2 -2
View File
@@ -57,8 +57,8 @@ class report extends control
{
$this->session->set('executionList', $this->app->getURI(true), 'execution');
$begin = $begin ? date('Y-m-d', strtotime($begin)) : '';
$end = $end ? date('Y-m-d', strtotime($end)) : '';
$begin = date('Y-m-d', ($begin ? strtotime($begin) : time() - (date('j') - 1) * 24 * 3600));
$end = date('Y-m-d', ($end ? strtotime($end) : time() + (date('t') - date('j')) * 24 * 3600));
$this->view->title = $this->lang->report->projectDeviation;
$this->view->position[] = $this->lang->report->projectDeviation;
+12 -1
View File
@@ -1732,7 +1732,16 @@ class storyModel extends model
if($oldStory->branch) $story->plan = $planID;
/* Append the plan id to plan field if product is multi and story is all branch. */
if($this->session->currentProductType != 'normal' and empty($story->branch) and $planID != 0) $story->plan = $oldStory->plan ? $oldStory->plan . ",$planID" : ",$planID";
if($this->session->currentProductType != 'normal' and empty($story->branch) and $planID != 0)
{
$branchPlanPairs = $this->dao->select('branch, id as plan')->from(TABLE_PRODUCTPLAN)
->where('product')->eq($oldStory->product)
->andWhere('id')->in($oldStory->plan)
->fetchPairs();
if(isset($branchPlanPairs[$plan->branch])) $branchPlanPairs[$plan->branch] = $planID;
$story->plan = $oldStory->plan ? ',' . implode(',', $branchPlanPairs) : ",$planID";
}
/* Change stage. */
if($planID)
@@ -2807,6 +2816,7 @@ class storyModel extends model
->where($storyQuery)
->andWhere('t1.project')->eq((int)$executionID)
->andWhere('t2.deleted')->eq(0)
->andWhere('t4.deleted')->eq(0)
->andWhere('t2.type')->eq($storyType)
->beginIF($excludeStories)->andWhere('t2.id')->notIN($excludeStories)->fi()
->orderBy($orderBy)
@@ -2862,6 +2872,7 @@ class storyModel extends model
->beginIF($this->session->storyBrowseType and strpos('changed|', $this->session->storyBrowseType) !== false)->andWhere('t2.status')->in(array_keys($unclosedStatus))->fi()
->beginIF($modules)->andWhere('t2.module')->in($modules)->fi()
->andWhere('t2.deleted')->eq(0)
->andWhere('t4.deleted')->eq(0)
->orderBy($orderBy)
->page($pager, 't2.id')
->fetchAll('id');
-12
View File
@@ -41,18 +41,6 @@
</th>
<?php endif;?>
<th><?php echo $lang->story->story;?></th>
<?php if($this->app->rawModule == 'projectstory'): ?>
<th <?php echo $style;?>>
<div class="dropdown">
<?php echo html::a('javascript:;', "<i class='icon icon-product'></i>". $projectProducts[$productID]->name . '<span class="caret"></span>', '', 'class="dropdown-toggle" data-toggle="dropdown"');?>
<ul class="dropdown-menu">
<?php foreach($projectProducts as $product): ?>
<li><?php echo html::a($this->createLink('projectstory', 'track', "projectID={$this->session->project}&productID=$product->id"), $product->name);?></li>
<?php endforeach;?>
</ul>
</div>
</th>
<?php endif;?>
<th><?php echo $lang->story->tasks;?></th>
<?php if($config->edition == 'max'):?>
<th><?php echo $lang->story->design;?></th>
+1 -1
View File
@@ -78,7 +78,7 @@ $config->task->datatable->fieldList['status']['width'] = '60';
$config->task->datatable->fieldList['status']['required'] = 'no';
$config->task->datatable->fieldList['estimate']['title'] = 'estimateAB';
$config->task->datatable->fieldList['estimate']['fixed'] = 'right';
$config->task->datatable->fieldList['estimate']['fixed'] = 'no';
$config->task->datatable->fieldList['estimate']['width'] = '60';
$config->task->datatable->fieldList['estimate']['required'] = 'no';
+1 -1
View File
@@ -44,7 +44,7 @@ class task extends control
$extra = str_replace(array(',', ' '), array('&', ''), $extra);
parse_str($extra, $output);
$executions = $this->execution->getPairs(0, 'all', !common::checkNotCN() ? 'noclosed' : '');
$executions = $this->execution->getPairs(0, 'all', 'noclosed');
$executionID = $this->execution->saveState($executionID, $executions);
$this->execution->setMenu($executionID);
-1
View File
@@ -41,4 +41,3 @@
.pri-selector > .btn {padding: 5px 8px !important; width: 100%;}
.pri-selector > .dropdown-menu {padding: 10px;}
.title-group .has-icon-right {min-width: 600px;}
+2 -2
View File
@@ -72,7 +72,7 @@ class testcaseModel extends model
$parentStepID = 0;
$this->loadModel('score')->create('testcase', 'create', $caseID);
$data = fixer::input('post')->filterEmoji('steps,expects')->get();
$data = fixer::input('post')->get();
foreach($data->steps as $stepID => $stepDesc)
{
if(empty($stepDesc)) continue;
@@ -759,7 +759,7 @@ class testcaseModel extends model
/* Ignore steps when post has no steps. */
if($this->post->steps)
{
$data = fixer::input('post')->filterEmoji('steps,expects')->get();
$data = fixer::input('post')->get();
foreach($data->steps as $stepID => $stepDesc)
{
+1 -1
View File
@@ -490,7 +490,7 @@ class todo extends control
if($todo->type == 'story') $app = 'product';
$cancelURL = $this->server->HTTP_REFERER;
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success', 'message' => sprintf($this->lang->todo->$confirmNote, $todo->idvalue), 'locate' => $confirmURL));
return print(js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, $okTarget, 'parent', $app));
return print(strpos($cancelURL, 'calendar') ? json_encode(array(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL)) : js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, $okTarget, 'parent', $app));
}
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success'));
if(isonlybody()) return print(js::reload('parent.parent'));
+1 -1
View File
@@ -2700,7 +2700,7 @@ class userModel extends model
$personalData['createdStories'] = $this->dao->select($count)->from(TABLE_STORY)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->andWhere('type')->eq('story')->fetch('count');
$personalData['createdBugs'] = $this->dao->select($count)->from(TABLE_BUG)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
$personalData['resolvedBugs'] = $this->dao->select($count)->from(TABLE_BUG)->where('resolvedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
$personalData['createdCases'] = $this->dao->select($count)->from(TABLE_CASE)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->andWhere('product')->ne(0)->fetch('count');
$personalData['createdCases'] = $this->dao->select($count)->from(TABLE_CASE)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
if($this->config->edition == 'max')
{
$personalData['createdRisks'] = $this->dao->select($count)->from(TABLE_RISK)->where('createdBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
+1 -1
View File
@@ -38,7 +38,7 @@ include '../../common/view/header.lite.html.php';
if($denyType == 'noview')
{
$menuName = $menu;
$menuName = isset($lang->$menu->common) ? $lang->$module->common : $menu;
if(isset($lang->menu->$menu))list($menuName) = explode('|', $lang->menu->$menu);
printf($lang->user->errorView, $menuName);
}
Regular → Executable
+2 -3
View File
@@ -427,6 +427,7 @@ class weeklyModel extends model
->from(TABLE_TASK)
->where('execution')->in($executionIdList)
->andWhere('consumed')->gt(0)
->andWhere("(estStarted < '$nextMonday' or estStarted='0000-00-00')")
->andWhere('status')->ne('cancel')
->fetchAll('id');
@@ -466,13 +467,12 @@ class weeklyModel extends model
$executions = $this->loadModel('execution')->getList($project, 'all', 'all', 0, 0, 0);
$executionIdList = array_keys($executions);
if($this->config->edition == 'max')
if($this->config->edition != 'open')
{
$AC = $this->dao->select('sum(consumed) as consumed')
->from(TABLE_EFFORT)
->where('objectType')->eq('task')
->andWhere('execution')->in($executionIdList)
->andWhere('date')->ge($monday)
->andWhere('date')->lt($nextMonday)
->fetch('consumed');
}
@@ -482,7 +482,6 @@ class weeklyModel extends model
$AC = $this->dao->select('sum(consumed) as consumed')
->from(TABLE_TASKESTIMATE)
->where('task')->in($taskIdList)
->andWhere('date')->ge($monday)
->andWhere('date')->lt($nextMonday)
->fetch('consumed');
}
@@ -51,14 +51,16 @@ $position[] = $this->lang->client->browse;
</tbody>
</table>
</div>
<?php if($this->config->edition == 'open'):?>
<script>
$(function()
{
$(document).on('click', '.deleter', function()
$('.deleter').on('click', function()
{
$deleter = $(this);
if(confirm('<?php echo $lang->confirmDelete?>'))
{
$.getJSON(deleter.attr('href'), function(data)
$.getJSON($deleter.attr('href'), function(data)
{
if(data.result != 'success') alert(data.message);
return location.reload();
@@ -66,7 +68,7 @@ $(function()
}
return false;
});
})
</script>
<?php endif;?>
<?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>