Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
wangyidong
2018-05-03 09:54:01 +08:00
12 changed files with 300 additions and 163 deletions
+4 -1
View File
@@ -48,7 +48,10 @@
</tr>
<tr>
<th></th>
<td colspan='2'><?php echo html::submitButton();?></td>
<td colspan='2'>
<?php echo html::submitButton('', '', 'btn btn-wide btn-primary');?>
<?php echo html::backButton('', '', 'btn btn-wide');?>
</td>
</tr>
</table>
</form>
+4 -3
View File
@@ -41,9 +41,10 @@
<td><?php echo html::input('key', $key, "class='form-control' autocomplete='off'");?></td>
</tr>
<tr>
<td colspan='2' class='text-center'>
<?php echo html::submitButton(); ?>
</td>
<td colspan='2' class='text-center'>
<?php echo html::submitButton('', '', 'btn btn-wide btn-primary');?>
<?php echo html::backButton('', '', 'btn btn-wide');?>
</td>
</tr>
</table>
</form>
+1 -4
View File
@@ -304,10 +304,7 @@ $lang->caselib->menu->caselib = array('link' => '用例库|testsuite|library',
/* 文档视图菜单设置。*/
$lang->doc = new stdclass();
$lang->doc->menu = new stdclass();
//$lang->doc->menu->list = array('link' => '%s', 'fixed' => true);
//$lang->doc->menu->crumb = array('link' => '%s', 'fixed' => true);
//$lang->doc->menu->create = array('link' => '<i class="icon-plus"></i>&nbsp;添加文档库|doc|createLib', 'float' => 'right');
//$lang->doc->menu->createLib = array('link' => '<i class="icon icon-folder-plus"></i>&nbsp;添加文件夹|doc|createLib', 'float' => 'right');
/* 统计视图菜单设置。*/
$lang->report = new stdclass();
+35 -22
View File
@@ -37,6 +37,8 @@ class doc extends control
*/
public function index()
{
$this->doc->setMenu();
$products = $this->doc->getLimitLibs('product');
$projects = $this->doc->getLimitLibs('project');
$customLibs = $this->doc->getLimitLibs('custom');
@@ -90,20 +92,22 @@ class doc extends control
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
$moduleID = ($browseType == 'bymodule' or $browseType == 'bymenu') ? (int)$param : 0;
$type = 'custom';
$type = '';
$productID = 0;
$projectID = 0;
if($libID)
{
$lib = $this->doc->getLibByID($libID);
if($lib->product or $lib->project) $type = $lib->product ? 'product' : 'project';
$type = 'custom';
$lib = $this->doc->getLibByID($libID);
if($lib->product or $lib->project)
{
$type = $lib->product ? 'product' : 'project';
$productID = $lib->product;
$projectID = $lib->project;
}
}
if(empty($libID)) $type = 'product';
$this->libs = $this->doc->getLibs($type);
if(empty($libID))
{
$libID = key($this->libs);
$lib = $this->dao->select('*')->from(TABLE_DOCLIB)->where('id')->eq($libID)->orderBy('id')->fetch();
}
/* According the from, set menus. */
if($from == 'product')
@@ -122,20 +126,21 @@ class doc extends control
}
else
{
$this->doc->setMenu($libID, $moduleID);
$menuType = (!$type && in_array($browseType, array_keys($this->lang->doc->fastMenuList))) ? $browseType : $type;
$this->doc->setMenu($menuType, $libID, $moduleID, $productID, $projectID);
}
$this->session->set('docList', $this->app->getURI(true));
/* Set header and position. */
$this->view->title = $this->lang->doc->common . $this->lang->colon . $this->libs[$libID];
$this->view->position[] = $this->libs[$libID];
$this->view->title = $this->lang->doc->common . ($libID ? $this->lang->colon . $this->libs[$libID] : '');
$this->view->position[] = $libID ? $this->libs[$libID] : '';
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
/* Append id for secend sort. */
if($browseType == 'bymenu' and strpos('editeddate_desc,addeddate_desc,visiteddate_desc', strtolower($orderBy)) === false) $orderBy = 'title_asc';
if($browseType == 'bymenu' and strpos('editeddate_desc,addeddate_desc', strtolower($orderBy)) === false) $orderBy = 'title_asc';
$sort = $this->loadModel('common')->appendOrder($orderBy);
/* Get docs by browse type. */
@@ -166,7 +171,7 @@ class doc extends control
}
$this->view->libID = $libID;
$this->view->libName = $this->libs[$libID];
$this->view->libName = $libID ? $this->libs[$libID] : '';
$this->view->moduleID = $moduleID;
$this->view->docs = $docs;
$this->view->pager = $pager;
@@ -308,8 +313,8 @@ class doc extends control
die(js::locate($link, 'parent'));
}
$lib = $this->doc->getLibByID($libID);
$type = $lib->product ? 'product' : ($lib->project ? 'project' : 'custom');
$lib = $this->doc->getLibByID($libID);
$type = $lib->product ? 'product' : ($lib->project ? 'project' : 'custom');
/* According the from, set menus. */
if($this->from == 'product')
@@ -328,7 +333,7 @@ class doc extends control
}
else
{
$this->doc->setMenu($libID, $moduleID);
$this->doc->setMenu($type, $libID, $moduleID, $lib->product, $lib->project);
}
$this->view->title = $lib->name . $this->lang->colon . $this->lang->doc->create;
@@ -382,7 +387,7 @@ class doc extends control
$lib = $this->doc->getLibByID($libID);
$type = $lib->product ? 'product' : ($lib->project ? 'project' : 'custom');
$this->doc->setMenu($libID, $doc->module);
$this->doc->setMenu($type, $libID, $doc->module, $lib->product, $lib->project);
$this->view->title = $lib->name . $this->lang->colon . $this->lang->doc->edit;
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$libID"), $lib->name);
@@ -421,7 +426,7 @@ class doc extends control
$type = $lib->product ? 'product' : ($lib->project ? 'project' : 'custom');
/* Set menu. */
$this->doc->setMenu($doc->lib, $doc->module);
$this->doc->setMenu($type, $doc->lib, $doc->module, $lib->product, $lib->project);
/* Update visitedDate and views for current doc.*/
$this->doc->updateVisitData($docID);
@@ -527,6 +532,7 @@ class doc extends control
if(empty($customMenus))
{
if($type == 'remove') die(js::reload('parent'));
$customMenus = array();
$i = 0;
foreach($this->lang->doc->menu as $name => $item)
{
@@ -539,6 +545,7 @@ class doc extends control
}
}
$customMenus = (array)$customMenus;
foreach($customMenus as $i => $customMenu)
{
if(isset($customMenu->name) and $customMenu->name == "custom{$libID}") unset($customMenus[$i]);
@@ -587,7 +594,7 @@ class doc extends control
$this->view->title = $libName;
$this->view->position[] = $libName;
$this->doc->setMenu($libID = 0, $moduleID = 0, $crumb);
$this->doc->setMenu($type, $libID = 0, $moduleID = 0, $productID = 0, $projectID = 0, $crumb);
/* Load pager. */
$this->app->loadClass('pager', $static = true);
@@ -648,19 +655,23 @@ class doc extends control
$crumb .= html::a(inlink('objectLibs', "type=$type&objectID=$objectID"), $object->name);
$crumb .= $this->lang->doc->separator . ' ' . $this->lang->doclib->files;
$productID = 0;
$projectID = 0;
if($type == 'product')
{
$productID = $objectID;
$lib = $this->product->getById($objectID);
if(!$this->product->checkPriv($lib)) $this->accessDenied();
}
if($type == 'project')
{
$projectID = $objectID;
$lib = $this->project->getById($objectID);
if(!$this->project->checkPriv($lib)) $this->accessDenied();
}
$this->doc->setMenu($libID = 0, $moduleID = 0, $crumb);
$this->doc->setMenu($type, $libID = 0, $moduleID = 0, $productID, $projectID, $crumb);
}
/* Load pager. */
@@ -734,7 +745,9 @@ class doc extends control
$crumb = html::a(inlink('allLibs', "type=$type"), $type == 'product' ? $this->lang->productCommon : $this->lang->projectCommon) . $this->lang->doc->separator;
if($this->productID and $type == 'project') $crumb = $this->doc->getProductCrumb($this->productID, $objectID);
$crumb .= html::a(inlink('objectLibs', "type=$type&objectID=$objectID"), $object->name);
$this->doc->setMenu($libID = 0, $moduleID = 0, $crumb);
$productID = $type == 'product' ? $objectID : 0;
$projectID = $type == 'project' ? $objectID : 0;
$this->doc->setMenu($type, $libID = 0, $moduleID = 0, $productID, $projectID, $crumb);
}
$this->view->title = $object->name;
+3 -3
View File
@@ -58,7 +58,7 @@ $lang->doc->myDoc = '我的文档';
$lang->doc->myCollection = '我的收藏';
/* 方法列表。*/
$lang->doc->index = '首页';
$lang->doc->index = '文档主页';
$lang->doc->create = '创建文档';
$lang->doc->edit = '编辑文档';
$lang->doc->delete = '删除文档';
@@ -119,12 +119,12 @@ $lang->doc->browseTypeList['menu'] = '目录';
$lang->doc->browseTypeList['tree'] = '树状图';
$lang->doc->browseTypeList['card'] = '卡片';
$lang->doc->fastMenuList['editeddate'] = '最近更新';
$lang->doc->fastMenuList['byediteddate'] = '最近更新';
$lang->doc->fastMenuList['visiteddate'] = '最近访问';
$lang->doc->fastMenuList['openedbyme'] = '我的文档';
$lang->doc->fastMenuList['collectedbyme'] = '我的收藏';
$lang->doc->fastMenuIconList['editeddate'] = 'icon-folder-upload';
$lang->doc->fastMenuIconList['byediteddate'] = 'icon-folder-upload';
$lang->doc->fastMenuIconList['visiteddate'] = 'icon-folder-move';
$lang->doc->fastMenuIconList['openedbyme'] = 'icon-folder-account';
$lang->doc->fastMenuIconList['collectedbyme'] = 'icon-folder-star';
+154 -42
View File
@@ -22,60 +22,162 @@ class docModel extends model
* @access public
* @return void
*/
public function setMenu($libID = 0, $moduleID = 0, $crumb = '')
public function setMenu($type = '', $libID = 0, $moduleID = 0, $productID = 0, $projectID = 0, $crumb = '')
{
$customMenuKey = $this->config->global->flow . '_doc';
if(isset($this->config->customMenu->{$customMenuKey}))
$selectHtml = "<div class='btn-group angle-btn'>";
$selectHtml .= html::a(helper::createLink('doc', 'index'), $this->lang->doc->index, '', "class='btn'");
$selectHtml .= '</div>';
if($type)
{
$customMenu = json_decode($this->config->customMenu->{$customMenuKey}, true);
$menuLibIdList = array();
foreach($customMenu as $i => $menu)
$mainLib = in_array($type, array_keys($this->lang->doc->fastMenuList)) ? $this->lang->doc->fastMenuList[$type] : '';
if($libID)
{
if(strpos($menu['name'], 'custom') === 0)
$lib = $this->getLibById($libID);
if($this->checkPriv($lib))
{
$menuLibID = (int)substr($menu['name'], 6);
if($menuLibID) $menuLibIdList[$i] = $menuLibID;
$type = $lib->product ? 'product' : 'custom';
$type = $lib->project ? 'project' : $type;
}
}
$productIdList = array();
$projectIdList = array();
if($menuLibIdList)
$mainLib = $type == 'custom' ? $this->lang->doc->customAB : $mainLib;
$mainLib = $type == 'product' ? $this->lang->productCommon : $mainLib;
$mainLib = $type == 'project' ? $this->lang->projectCommon : $mainLib;
$selectHtml .= "<div class='btn-group angle-btn'>";
$selectHtml .= "<div class='btn-group'>";
$selectHtml .= "<a data-toggle='dropdown' class='btn'>" . $mainLib . " <span class='caret'></span></a>";
$selectHtml .= "<ul class='dropdown-menu'>";
foreach($this->lang->doc->fastMenuList as $key => $fastMenu)
{
$libs = $this->dao->select('id,name,product,project')->from(TABLE_DOCLIB)->where('id')->in($menuLibIdList)->fetchAll('id');
foreach($libs as $lib)
if($key == 'editedDate' or $key == 'visitedDate')
{
if($lib->product) $productIdList[] = $lib->product;
if($lib->project) $projectIdList[] = $lib->project;
$link = helper::createLink('doc', 'browse', "libID=0&browseTyp=bymenu&module=0&orderBy={$key}_desc");
}
else
{
$link = helper::createLink('doc', 'browse', "libID=0&browseTyp={$key}");
}
$selectHtml .= '<li>' . html::a($link, "<i class='icon {$this->lang->doc->fastMenuIconList[$key]}'></i> {$fastMenu}") . '</li>';
}
$products = $productIdList ? $this->dao->select('id,name')->from(TABLE_PRODUCT)->where('id')->in($productIdList)->fetchPairs('id', 'name') : array();
$projects = $projectIdList ? $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->in($projectIdList)->fetchPairs('id', 'name') : array();
foreach($menuLibIdList as $i => $menuLibID)
$selectHtml .= "<li class='divider'></li>";
$selectHtml .= '<li>' . html::a(helper::createLink('doc', 'allLibs', "type=product"), "<i class='icon icon-cube'></i> {$this->lang->productCommon}") . '</li>';
$selectHtml .= '<li>' . html::a(helper::createLink('doc', 'allLibs', "type=project"), "<i class='icon icon-stack'></i> {$this->lang->projectCommon}") . '</li>';
$selectHtml .= '<li>' . html::a(helper::createLink('doc', 'allLibs', "type=custom"), "<i class='icon icon-folder-o'></i> {$this->lang->doc->customAB}") . '</li>';
$selectHtml .='</ul></div></div>';
if(strpos('product,project,custom', $type) !== false)
{
$lib = $libs[$menuLibID];
$libName = '';
if($lib->product) $libName = isset($products[$lib->product]) ? '[' . $products[$lib->product] . ']' : '';
if($lib->project) $libName = isset($projects[$lib->project]) ? '[' . $projects[$lib->project] . ']' : '';
$libName .= $lib->name;
$customMenu[$i]['link'] = "{$libName}|doc|browse|libID={$menuLibID}";
$allLibGroups = $this->getAllLibGroups();
$currentGroups = $allLibGroups[$type];
if($type == 'custom') $currentLib = $libID ? $libID : key($currentGroups);
if($type == 'product') $currentLib = $productID ? $productID : key($currentGroups);
if($type == 'project') $currentLib = $projectID ? $projectID : key($currentGroups);
$selectHtml .= "<div class='btn-group angle-btn'>";
$selectHtml .= "<div class='btn-group'>";
$selectHtml .= '<a data-toggle="dropdown" class="btn">' . (is_array($currentGroups[$currentLib]) ? $currentGroups[$currentLib]['name'] : $currentGroups[$currentLib]) . ' <span class="caret"></span></a>';
$selectHtml .='<ul class="dropdown-menu">';
if($type == 'custom')
{
foreach($currentGroups as $groupID => $groupName)
{
if($type == 'custom')
{
$link = helper::createLink('doc', 'browse', "libID=$groupID");
$icon = 'icon-folder-o';
}
elseif($type == 'product')
{
$link = helper::createLink('doc', 'objectLibs', "type=product&objectID=$groupID");
$icon = 'icon-cube';
}
else
{
$link = helper::createLink('doc', 'objectLibs', "type=project&objectID=$groupID");
$icon = 'icon-stack';
}
$active = $currentLib == $groupID ? "class='active'" : '';
$selectHtml .= "<li $active>" . html::a(helper::createLink('doc', 'browse', "libID=$groupID"), "<i class='icon icon-folder-o'></i> {$groupName}") . '</li>';
}
}
else
{
foreach($currentGroups as $groupID => $libGroups)
{
$link = helper::createLink('doc', 'objectLibs', "type=$type&objectID=$groupID");
$icon = $type == 'product' ? 'icon-cube' : 'icon-stack';
$active = $currentLib == $groupID ? "class='active'" : '';
$selectHtml .= "<li $active>" . html::a($link, "<i class='icon {$icon}'></i> {$libGroups['name']}") . '</li>';
}
}
$selectHtml .= '</ul></div></div>';
}
$this->config->customMenu->{$customMenuKey} = json_encode($customMenu);
$actions = '';
$customMenuKey = $this->config->global->flow . '_doc';
if(isset($this->config->customMenu->{$customMenuKey}))
{
$customMenu = json_decode($this->config->customMenu->{$customMenuKey}, true);
$menuLibIdList = array();
foreach($customMenu as $i => $menu)
{
if(strpos($menu['name'], 'custom') === 0)
{
$menuLibID = (int)substr($menu['name'], 6);
if($menuLibID) $menuLibIdList[$i] = $menuLibID;
}
}
$productIdList = array();
$projectIdList = array();
if($menuLibIdList)
{
$libs = $this->dao->select('id,name,product,project')->from(TABLE_DOCLIB)->where('id')->in($menuLibIdList)->fetchAll('id');
foreach($libs as $lib)
{
if($lib->product) $productIdList[] = $lib->product;
if($lib->project) $projectIdList[] = $lib->project;
}
}
$products = $productIdList ? $this->dao->select('id,name')->from(TABLE_PRODUCT)->where('id')->in($productIdList)->fetchPairs('id', 'name') : array();
$projects = $projectIdList ? $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->in($projectIdList)->fetchPairs('id', 'name') : array();
foreach($menuLibIdList as $i => $menuLibID)
{
$lib = $libs[$menuLibID];
$libName = '';
if($lib->product) $libName = isset($products[$lib->product]) ? '[' . $products[$lib->product] . ']' : '';
if($lib->project) $libName = isset($projects[$lib->project]) ? '[' . $projects[$lib->project] . ']' : '';
$libName .= $lib->name;
$customMenu[$i]['link'] = "{$libName}|doc|browse|libID={$menuLibID}";
}
foreach($customMenu as $menu)
{
if(isset($menu['link']))
{
list($menuLabel, $module, $method, $vars) = explode('|', $menu['link']);
$actions .= html::a(helper::createLink($module, $method, $vars), $menuLabel, '', "class='btn btn-gray'");
}
}
}
$actions .= html::a(helper::createLink('doc', 'createLib'), "<i class='icon icon-folder-plus'></i> " . $this->lang->doc->createLib, '', "class='btn btn-secondary' data-toggle='modal'");
if($libID) $actions .= html::a(helper::createLink('doc', 'create', "libID=$libID"), "<i class='icon icon-plus'></i> " . $this->lang->doc->create, '', "class='btn btn-primary' data-toggle='modal'");
$this->lang->modulePageActions = $actions;
}
$this->app->loadLang('project');
$selectHtml = "<a id='currentItem' data-lib-id='$libID' href=\"javascript:showLibMenu()\">{$this->lang->doclib->all} <span class='icon-caret-down'></span></a>";
$selectHtml .= "<div id='dropMenu'>";
$selectHtml .= "<i class='icon icon-spin icon-spinner'></i>";
$selectHtml .= "<div id='libMenu'>";
$selectHtml .= "<div id='libMenuHeading'><input id='searchLib' type='search' placeholder='{$this->lang->doc->searchDoc}' class='form-control'></div>";
$selectHtml .= "<div id='libMenuGroups' class='clearfix'>";
if($this->config->global->flow != 'onlyTask' and isset($this->lang->doc->libTypeList['product'])) $selectHtml .= "<div class='lib-menu-group' id='libMenuProductGroup'><div class='lib-menu-list-heading' data-type='product'>{$this->lang->doc->libTypeList['product']}<i class='icon icon-remove'></i></div><div class='lib-menu-list clearfix'></div></div>";
if($this->config->global->flow != 'onlyStory' and $this->config->global->flow != 'onlyTest' and isset($this->lang->doc->libTypeList['project'])) $selectHtml .= "<div class='lib-menu-group' id='libMenuProjectGroup'><div class='lib-menu-list-heading' data-type='project'>{$this->lang->doc->libTypeList['project']}<i class='icon icon-remove'></i></div><div class='lib-menu-project-done'>{$this->lang->project->statusList['done']}<i class='icon icon-remove'></i></div><div class='lib-menu-list clearfix'></div></div>";
$selectHtml .= "<div class='lib-menu-group' id='libMenuCustomGroup'><div class='lib-menu-list-heading' data-type='custom'>{$this->lang->doc->libTypeList['custom']}<i class='icon icon-remove'></i></div><div class='lib-menu-list clearfix'></div></div>";
$selectHtml .= "</div></div></div>";
common::setMenuVars($this->lang->doc->menu, 'list', $selectHtml);
common::setMenuVars($this->lang->doc->menu, 'crumb', $crumb ? $crumb : $this->getCrumbs($libID, $moduleID));
//$selectHtml .= $crumb ? $crumb : $this->getCrumbs($libID, $moduleID);
$this->lang->modulePageNav = $selectHtml;
}
/**
@@ -209,7 +311,7 @@ class docModel extends model
$docs = $this->dao->select('*')->from(TABLE_DOC)
->where('deleted')->eq(0)
->andWhere('id')->in($docIdList)
->orderBy($sort)
->orderBy('editedDate_desc')
->page($pager)
->fetchAll('id');
@@ -246,6 +348,16 @@ class docModel extends model
}
}
}
elseif($browseType == 'visiteddate')
{
$docIdList = $this->getPrivDocs($libID, $moduleID);
$docs = $this->dao->select('*')->from(TABLE_DOC)
->where('deleted')->eq(0)
->andWhere('id')->in($docIdList)
->orderBy('visitedDate_desc')
->page($pager)
->fetchAll('id');
}
elseif($browseType == "collectedbyme")
{
$docs = $this->dao->select('*')->from(TABLE_DOC)
@@ -596,7 +708,7 @@ class docModel extends model
$this->config->doc->search['queryID'] = $queryID;
$this->config->doc->search['params']['product']['values'] = array(''=>'') + $this->loadModel('product')->getPairs('nocode') + array('all'=>$this->lang->doc->allProduct);
$this->config->doc->search['params']['project']['values'] = array(''=>'') + $this->loadModel('project')->getPairs('nocode') + array('all'=>$this->lang->doc->allProject);
$this->config->doc->search['params']['lib']['values'] = array(''=>'', $libID => $libs[$libID], 'all' => $this->lang->doclib->all);
$this->config->doc->search['params']['lib']['values'] = array(''=>'', $libID => ($libID ? $libs[$libID] : 0), 'all' => $this->lang->doclib->all);
/* Get the modules. */
$moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($libID, 'doc', $startModuleID = 0);
@@ -853,7 +965,7 @@ class docModel extends model
}
}
return array('product' => array_values($productOrderLibs), 'project' => array_values($projectOrderLibs), 'custom' => $customLibs);
return array('product' => $productOrderLibs, 'project' => $projectOrderLibs, 'custom' => $customLibs);
}
/**
+1 -11
View File
@@ -30,17 +30,7 @@
<a class="text-muted tree-toggle"><?php echo $lang->doc->fast;?></a>
<ul>
<?php foreach($lang->doc->fastMenuList as $type => $menu):?>
<?php
if($type == 'editedDate' or $type == 'visitedDate')
{
$link = $this->createLink('doc', 'browse', "libID=0&browseTyp=bymenu&module=0&orderBy={$type}_desc");
}
else
{
$link = $this->createLink('doc', 'browse', "libID=0&browseTyp={$type}");
}
?>
<li><?php echo html::a($link, "<i class='icon {$lang->doc->fastMenuIconList[$type]}'></i> {$menu}");?>
<li><?php echo html::a($this->createLink('doc', 'browse', "libID=0&browseType={$type}"), "<i class='icon {$lang->doc->fastMenuIconList[$type]}'></i> {$menu}");?>
<?php endforeach;?>
</ul>
</li>
+1 -1
View File
@@ -185,7 +185,7 @@
if(common::hasPriv('project', 'unlinkStory', $project))
{
$unlinkURL = $this->createLink('project', 'unlinkStory', "projectID=$project->id&storyID=$story->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"storyList\",confirmUnlinkStory)", '<i class="icon-unlink"></i>', '', "class='btn btn-link' title='{$lang->project->unlinkStory}'");
echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"storyList\",confirmUnlinkStory)", '<i class="icon-unlink"></i>', '', "class='btn' title='{$lang->project->unlinkStory}'");
}
?>
</td>
-1
View File
@@ -1,4 +1,3 @@
#batchCreateForm .col-id {width: 50px; text-align: center; color: #838A9D}
#batchCreateForm .col-module,
#batchCreateForm .col-plan {width: 180px;}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+86 -75
View File
@@ -14,84 +14,97 @@
<?php js::set('testcaseBatchCreateNum', $config->testcase->batchCreate);?>
<?php js::set('productID', $productID);?>
<?php js::set('branch', $branch);?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['testcase']);?></span>
<strong>
<small class='text-muted'><?php echo html::icon($lang->icons['batchCreate']);?></small>
<div id="mainContent" class="main-content">
<div class="main-header">
<h2>
<?php echo $lang->testcase->batchCreate;?>
<?php if($this->session->currentProductType !== 'normal') echo '<span class="label label-info">' . $branches[$branch] . '</span>';?>
</strong>
<?php if($story):?>
<small class='text-muted'><?php echo html::icon($lang->icons['story']) . ' ' . $story->title ?></small>
<?php endif;?>
<div class='actions'>
<?php echo html::commonButton($lang->pasteText, "data-toggle='myModal'", 'btn btn-primary')?>
<button type="button" class="btn btn-default" data-toggle="customModal"><i class='icon icon-cog'></i></button>
<?php if($story):?>
<small class='text'><?php echo $lang->arrow . $story->title ?></small>
<?php endif;?>
</h2>
<div class="pull-right btn-toolbar">
<?php $customLink = $this->createLink('custom', 'ajaxSaveCustomFields', 'module=testcase&section=custom&key=batchCreateFields')?>
<?php include '../../common/view/customfield.html.php';?>
</div>
</div>
<?php
$visibleFields = array();
foreach(explode(',', $showFields) as $field)
{
if($field) $visibleFields[$field] = '';
}
$colspan = count($visibleFields) + 3;
$hiddenStory = (isonlybody() and $story) ? ' hidden' : '';
if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
?>
<form method='post' class='load-indicator main-form' enctype='multipart/form-data' target='hiddenwin' id="batchCreateForm">
<table class="table table-form" id="tableBody">
<thead>
<tr class='text-center'>
<th class='w-50px'><?php echo $lang->idAB;?></th>
<th class='w-120px<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo $lang->product->branch;?></th>
<th class='w-180px<?php echo zget($visibleFields, 'module', ' hidden')?>'><?php echo $lang->testcase->module;?></th>
<th class='w-180px<?php echo zget($visibleFields, 'story', ' hidden'); echo $hiddenStory;?>'> <?php echo $lang->testcase->story;?></th>
<th class='text-left required has-btn'>
<?php echo $lang->testcase->title;?></span>
<button type='button' data-toggle="importLinesModal" class="btn btn-info"><?php echo $lang->pasteText;?></button>
</th>
<th class='w-120px text-left required'><?php echo $lang->testcase->type;?></th>
<th class='w-80px<?php echo zget($visibleFields, 'pri', ' hidden')?>'> <?php echo $lang->testcase->pri;?></th>
<th class='w-150px<?php echo zget($visibleFields, 'precondition', ' hidden')?>'><?php echo $lang->testcase->precondition;?></th>
<th class='w-100px<?php echo zget($visibleFields, 'keywords', ' hidden')?>'> <?php echo $lang->testcase->keywords;?></th>
<th class='w-140px<?php echo zget($visibleFields, 'stage', ' hidden')?>'> <?php echo $lang->testcase->stage;?></th>
<th class='w-70px<?php echo zget($visibleFields, 'review', ' hidden')?>'> <?php echo $lang->testcase->review;?></th>
</tr>
</thead>
<tbody>
<?php unset($lang->testcase->typeList['']);?>
<?php for($i = 0; $i < $config->testcase->batchCreate; $i++):?>
<?php
if($i != 0) $currentModuleID = 'ditto';
if($i != 0) $lang->testcase->typeList['ditto'] = $lang->testcase->ditto;
if($i != 0) $lang->testcase->priList['ditto'] = $lang->testcase->ditto;
$type = $i == 0 ? 'feature' : 'ditto';
$pri = $i == 0 ? 3 : 'ditto';
?>
<tr class='text-center'>
<td><?php echo $i+1;?></td>
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo html::select("branch[$i]", $branches, $branch, "class='form-control' onchange='setModules(this.value, $productID, $i)'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("module[$i]", $moduleOptionMenu, $currentModuleID, "class='form-control chosen'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'story', ' hidden'); echo $hiddenStory;?>' style='overflow:visible'> <?php echo html::select("story[$i]", $storyList, $story ? $story->id : '', 'class="form-control chosen"');?></td>
<td style='overflow:visible'>
<div class='input-group'>
<div class="input-control has-icon-right">
<?php echo html::input("title[$i]", '', "class='form-control' autocomplete='off'");?>
<div class="colorpicker">
<button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown"><span class="cp-title"></span><span class="color-bar"></span><i class="ic"></i></button>
<ul class="dropdown-menu clearfix">
<li class="heading"><?php echo $lang->testcase->colorTag;?><i class="icon icon-close"></i></li>
</ul>
<?php echo html::hidden("color[$i]", '', "data-provide='colorpicker' data-icon='color' data-wrapper='input-control-icon-right' data-update-color='#title\\[$i\\]'");?>
</div>
</div>
</div>
</td>
<td><?php echo html::select("type[$i]", $lang->testcase->typeList, $type, "class=form-control");?></td>
<td class='<?php echo zget($visibleFields, 'pri', 'hidden')?>'> <?php echo html::select("pri[$i]", $lang->testcase->priList, $pri, "class=form-control");?></td>
<td class='<?php echo zget($visibleFields, 'precondition', 'hidden')?>'><?php echo html::textarea("precondition[$i]", '', "rows='1' class='form-control autosize'")?></td>
<td class='<?php echo zget($visibleFields, 'keywords', 'hidden')?>'> <?php echo html::input("keywords[$i]", '', "class='form-control' autocomplete='off'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'stage', ' hidden')?>' style='overflow:visible'><?php echo html::select("stage[$i][]", $lang->testcase->stageList, '', "class='form-control chosen' multiple");?></td>
<td class='<?php echo zget($visibleFields, 'review', 'hidden')?>'><?php echo html::select("needReview[$i]", $lang->testcase->reviewList, $needReview, "class='form-control'");?></td>
</tr>
<?php endfor;?>
<tr>
<td colspan='<?php echo $colspan?>' class='text-center'>
<?php echo html::submitButton('', '', 'btn btn-wide btn-primary');?>
<?php echo html::backButton('', '', 'btn btn-wide btn-gray');?>
</td>
</tr>
</tbody>
</table>
</form>
</div>
<?php
$visibleFields = array();
foreach(explode(',', $showFields) as $field)
{
if($field) $visibleFields[$field] = '';
}
$colspan = count($visibleFields) + 3;
$hiddenStory = (isonlybody() and $story) ? ' hidden' : '';
if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
?>
<form class='form-condensed' method='post' enctype='multipart/form-data' target='hiddenwin'>
<table align='center' class='table table-form table-fixed'>
<thead>
<tr>
<th class='w-50px'><?php echo $lang->idAB;?></th>
<th class='w-120px<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo $lang->product->branch;?></th>
<th class='w-180px<?php echo zget($visibleFields, 'module', ' hidden')?>'><?php echo $lang->testcase->module;?></th>
<th class='w-180px<?php echo zget($visibleFields, 'story', ' hidden'); echo $hiddenStory;?>'> <?php echo $lang->testcase->story;?></th>
<th><?php echo $lang->testcase->title;?> <span class='required'></span></th>
<th class='w-100px'><?php echo $lang->testcase->type;?> <span class='required'></span></th>
<th class='w-80px<?php echo zget($visibleFields, 'pri', ' hidden')?>'> <?php echo $lang->testcase->pri;?></th>
<th class='w-150px<?php echo zget($visibleFields, 'precondition', ' hidden')?>'><?php echo $lang->testcase->precondition;?></th>
<th class='w-100px<?php echo zget($visibleFields, 'keywords', ' hidden')?>'> <?php echo $lang->testcase->keywords;?></th>
<th class='w-200px<?php echo zget($visibleFields, 'stage', ' hidden')?>'> <?php echo $lang->testcase->stage;?></th>
<th class='w-70px<?php echo zget($visibleFields, 'review', ' hidden')?>'> <?php echo $lang->testcase->review;?></th>
</tr>
</thead>
<?php unset($lang->testcase->typeList['']);?>
<?php for($i = 0; $i < $config->testcase->batchCreate; $i++):?>
<?php
if($i != 0) $currentModuleID = 'ditto';
if($i != 0) $lang->testcase->typeList['ditto'] = $lang->testcase->ditto;
if($i != 0) $lang->testcase->priList['ditto'] = $lang->testcase->ditto;
$type = $i == 0 ? 'feature' : 'ditto';
$pri = $i == 0 ? 3 : 'ditto';
?>
<tr class='text-center'>
<td><?php echo $i+1;?></td>
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo html::select("branch[$i]", $branches, $branch, "class='form-control' onchange='setModules(this.value, $productID, $i)'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("module[$i]", $moduleOptionMenu, $currentModuleID, "class='form-control chosen'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'story', ' hidden'); echo $hiddenStory;?>' style='overflow:visible'> <?php echo html::select("story[$i]", $storyList, $story ? $story->id : '', 'class="form-control chosen"');?></td>
<td style='overflow:visible'>
<div class='input-group'>
<?php echo html::hidden("color[$i]", '', "data-provide='colorpicker' data-wrapper='input-group-btn fix-border-right' data-pull-menu-right='false' data-btn-tip='{$lang->testcase->colorTag}' data-update-text='#title\\[{$i}\\]'");?>
<?php echo html::input("title[$i]", '', "class='form-control' autocomplete='off'");?>
</div>
</td>
<td><?php echo html::select("type[$i]", $lang->testcase->typeList, $type, "class=form-control");?></td>
<td class='<?php echo zget($visibleFields, 'pri', 'hidden')?>'> <?php echo html::select("pri[$i]", $lang->testcase->priList, $pri, "class=form-control");?></td>
<td class='<?php echo zget($visibleFields, 'precondition', 'hidden')?>'><?php echo html::textarea("precondition[$i]", '', "rows='1' class='form-control autosize'")?></td>
<td class='<?php echo zget($visibleFields, 'keywords', 'hidden')?>'> <?php echo html::input("keywords[$i]", '', "class='form-control' autocomplete='off'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'stage', ' hidden')?>' style='overflow:visible'><?php echo html::select("stage[$i][]", $lang->testcase->stageList, '', "class='form-control chosen' multiple");?></td>
<td class='<?php echo zget($visibleFields, 'review', 'hidden')?>'><?php echo html::select("needReview[$i]", $lang->testcase->reviewList, $needReview, "class='form-control'");?></td>
</tr>
<?php endfor;?>
<tfoot>
<tr><td colspan='<?php echo $colspan?>' class='text-center'><?php echo html::submitButton() . html::backButton();?></td></tr>
</tfoot>
</table>
</form>
<table class='hide' id='trTemp'>
<tbody>
<tr class='text-center'>
@@ -113,7 +126,5 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
</tr>
</tbody>
</table>
<?php $customLink = $this->createLink('custom', 'ajaxSaveCustomFields', 'module=testcase&section=custom&key=batchCreateFields')?>
<?php include '../../common/view/customfield.html.php';?>
<?php include '../../common/view/pastetext.html.php';?>
<?php include '../../common/view/footer.html.php';?>