Merge branch 'master' of github.com:easysoft/zentaopms
This commit is contained in:
@@ -0,0 +1 @@
|
||||
ALTER TABLE `zt_doclib` ADD `order` tinyint(5) unsigned NOT NULL AFTER `main`;
|
||||
+2
-1
@@ -289,6 +289,7 @@ CREATE TABLE IF NOT EXISTS `zt_doclib` (
|
||||
`groups` varchar(255) NOT NULL,
|
||||
`users` text NOT NULL,
|
||||
`main` enum('0','1') NOT NULL default '0',
|
||||
`order` tinyint(5) unsigned NOT NULL,
|
||||
`deleted` enum('0','1') NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
@@ -805,7 +806,7 @@ CREATE TABLE IF NOT EXISTS `zt_usertpl` (
|
||||
INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`, `lastTime`) VALUES
|
||||
('*', '*', '*', '*', '*', '', '监控定时任务', 'zentao', 1, 'normal', '0000-00-00 00:00:00'),
|
||||
('30', '23', '*', '*', '*', 'moduleName=project&methodName=computeburn', '更新燃尽图', 'zentao', 1, 'normal', '0000-00-00 00:00:00'),
|
||||
('0', '1', '*', '*', '*', 'moduleName=report&methodName=remind', '每日任务提醒', 'zentao', 1, 'normal', '0000-00-00 00:00:00'),
|
||||
('0', '8', '*', '*', '*', 'moduleName=report&methodName=remind', '每日任务提醒', 'zentao', 1, 'normal', '0000-00-00 00:00:00'),
|
||||
('*/5', '*', '*', '*', '*', 'moduleName=svn&methodName=run', '同步SVN', 'zentao', 1, 'stop', '0000-00-00 00:00:00'),
|
||||
('*/5', '*', '*', '*', '*', 'moduleName=git&methodName=run', '同步GIT', 'zentao', 1, 'stop', '0000-00-00 00:00:00'),
|
||||
('30', '0', '*', '*', '*', 'moduleName=backup&methodName=backup', '备份数据和附件', 'zentao', 1, 'normal', '0000-00-00 00:00:00'),
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<?php foreach($todos as $id => $todo):?>
|
||||
<?php
|
||||
$appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : '';
|
||||
$viewLink = $this->createLink('todo', 'view', "todoID={$todo->id}");
|
||||
$viewLink = $this->createLink('todo', 'view', "todoID={$todo->id}&from=my");
|
||||
?>
|
||||
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
|
||||
<td><?php echo $todo->date == '2030-01-01' ? $lang->todo->periods['future'] : $todo->date;?></td>
|
||||
|
||||
@@ -43,7 +43,7 @@ $config->bug->list->customBatchEditFields = 'type,severity,pri,productplan,ass
|
||||
$config->bug->custom = new stdclass();
|
||||
$config->bug->custom->createFields = $config->bug->list->customCreateFields;
|
||||
$config->bug->custom->batchCreateFields = 'module,project,steps,type,severity,os,browser';
|
||||
$config->bug->custom->batchEditFields = 'type,severity,pri,assignedTo,deadline,status,resolvedBy,resolution';
|
||||
$config->bug->custom->batchEditFields = 'type,severity,pri,branch,assignedTo,deadline,status,resolvedBy,resolution';
|
||||
|
||||
$config->bug->editor = new stdclass();
|
||||
$config->bug->editor->create = array('id' => 'steps', 'tools' => 'bugTools');
|
||||
|
||||
+18
-2
@@ -615,11 +615,14 @@ class bug extends control
|
||||
}
|
||||
|
||||
$bugIDList = $this->post->bugIDList ? $this->post->bugIDList : die(js::locate($this->session->bugList, 'parent'));
|
||||
/* Initialize vars.*/
|
||||
$bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($bugIDList)->fetchAll('id');
|
||||
|
||||
/* The bugs of a product. */
|
||||
if($productID)
|
||||
{
|
||||
$product = $this->product->getByID($productID);
|
||||
$branchProduct = $product->type == 'normal' ? false : true;
|
||||
|
||||
/* Set plans. */
|
||||
$plans = $this->loadModel('productplan')->getPairs($productID, $branch);
|
||||
@@ -630,10 +633,24 @@ class bug extends control
|
||||
$this->view->title = $product->name . $this->lang->colon . "BUG" . $this->lang->bug->batchEdit;
|
||||
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
|
||||
$this->view->plans = $plans;
|
||||
$this->view->branches = $product->type == 'normal' ? array() : array('' => '', 'ditto' => $this->lang->bug->ditto) + $this->loadModel('branch')->getPairs($product->id);
|
||||
}
|
||||
/* The bugs of my. */
|
||||
else
|
||||
{
|
||||
$branchProduct = false;
|
||||
$productIdList = array();
|
||||
foreach($bugs as $bug) $productIdList[$bug->product] = $bug->product;
|
||||
$products = $this->product->getByIdList($productIdList);
|
||||
foreach($products as $product)
|
||||
{
|
||||
if($product->type != 'normal')
|
||||
{
|
||||
$branchProduct = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$this->lang->bug->menu = $this->lang->my->menu;
|
||||
$this->lang->set('menugroup.bug', 'my');
|
||||
$this->lang->bug->menuOrder = $this->lang->my->menuOrder;
|
||||
@@ -641,8 +658,6 @@ class bug extends control
|
||||
$this->view->position[] = html::a($this->createLink('my', 'bug'), $this->lang->my->bug);
|
||||
$this->view->title = "BUG" . $this->lang->bug->batchEdit;
|
||||
}
|
||||
/* Initialize vars.*/
|
||||
$bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($bugIDList)->fetchAll('id');
|
||||
|
||||
/* Judge whether the editedTasks is too large and set session. */
|
||||
$countInputVars = count($bugs) * (count(explode(',', $this->config->bug->custom->batchEditFields)) + 2);
|
||||
@@ -663,6 +678,7 @@ class bug extends control
|
||||
$this->view->position[] = $this->lang->bug->batchEdit;
|
||||
$this->view->bugIDList = $bugIDList;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->branchProduct = $branchProduct;
|
||||
$this->view->severityList = array('ditto' => $this->lang->bug->ditto) + $this->lang->bug->severityList;
|
||||
$this->view->typeList = array('' => '', 'ditto' => $this->lang->bug->ditto) + $this->lang->bug->typeList;
|
||||
$this->view->priList = array('0' => '', 'ditto' => $this->lang->bug->ditto) + $this->lang->bug->priList;
|
||||
|
||||
@@ -191,7 +191,7 @@ function loadProductModules(productID)
|
||||
{
|
||||
branch = $('#branch').val();
|
||||
if(typeof(branch) == 'undefined') branch = 0;
|
||||
link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=bug&branch=' + branch + '&rootModuleID=0&returnType=html&needManage=true');
|
||||
link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=bug&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true');
|
||||
$('#moduleIdBox').load(link, function()
|
||||
{
|
||||
$(this).find('select').chosen(defaultChosenOptions)
|
||||
|
||||
@@ -79,21 +79,21 @@ $lang->bug->batchChangeModule = 'Batch Modify';
|
||||
$lang->bug->batchClose = 'Batch Close';
|
||||
$lang->bug->assignTo = 'Assign';
|
||||
$lang->bug->batchAssignTo = 'Batch Assign';
|
||||
$lang->bug->browse = 'Bug List';
|
||||
$lang->bug->browse = 'Bugs';
|
||||
$lang->bug->view = 'Bug Details';
|
||||
$lang->bug->resolve = 'Resolve';
|
||||
$lang->bug->batchResolve = 'Batch Resolve';
|
||||
$lang->bug->close = 'Close';
|
||||
$lang->bug->activate = 'Activate';
|
||||
$lang->bug->reportChart = 'Report';
|
||||
$lang->bug->export = 'Export Data';
|
||||
$lang->bug->delete = 'Delete Bug';
|
||||
$lang->bug->export = 'Export';
|
||||
$lang->bug->delete = 'Delete';
|
||||
$lang->bug->deleted = 'Deleted';
|
||||
$lang->bug->saveTemplate = 'Save as Template';
|
||||
$lang->bug->setPublic = 'Set as Public';
|
||||
$lang->bug->deleteTemplate = 'Delete Template';
|
||||
$lang->bug->confirmStoryChange = 'Story Change Confirmation';
|
||||
$lang->bug->copy = 'Duplicate a Bug';
|
||||
$lang->bug->copy = 'Duplicate';
|
||||
|
||||
/* 查询条件列表。*/
|
||||
$lang->bug->assignToMe = 'Assigned to Me';
|
||||
@@ -113,7 +113,7 @@ $lang->bug->needConfirm = 'Story Change';
|
||||
$lang->bug->allProduct = 'All' . $lang->productCommon;
|
||||
|
||||
$lang->bug->ditto = 'Ditto';
|
||||
$lang->bug->dittoNotice = 'This bug does not affiliate to the same product as the last one!';
|
||||
$lang->bug->dittoNotice = 'This bug does not relate to the same product as the last one!';
|
||||
|
||||
/* 页面标签。*/
|
||||
$lang->bug->lblAssignedTo = 'Assignee';
|
||||
@@ -140,7 +140,7 @@ $lang->bug->legendRelated = 'Related Info';
|
||||
$lang->bug->buttonConfirm = 'Confirm';
|
||||
|
||||
/* 交互提示。*/
|
||||
$lang->bug->confirmChangeProduct = "Modification on {$lang->productCommon} will cause linked {$lang->projectCommon},Story and Task change. Do you want to do this?";
|
||||
$lang->bug->confirmChangeProduct = "Change {$lang->productCommon} will cause linked {$lang->projectCommon},Story and Task change. Do you want to do this?";
|
||||
$lang->bug->confirmDelete = 'Do you want to delete this bug?';
|
||||
$lang->bug->setTemplateTitle = 'Please enter the title of template.';
|
||||
$lang->bug->remindTask = 'This Bug has been converted to Task. Do you want to update Status of Task(ID %s)?';
|
||||
|
||||
@@ -548,6 +548,7 @@ class bugModel extends model
|
||||
if($data->types[$bugID] == 'ditto') $data->types[$bugID] = isset($prev['type']) ? $prev['type'] : '';
|
||||
if($data->severities[$bugID] == 'ditto') $data->severities[$bugID] = isset($prev['severity']) ? $prev['severity'] : 3;
|
||||
if($data->pris[$bugID] == 'ditto') $data->pris[$bugID] = isset($prev['pri']) ? $prev['pri'] : 0;
|
||||
if($data->branches[$bugID] == 'ditto') $data->branches[$bugID] = isset($prev['branch']) ? $prev['branch'] : 0;
|
||||
if($data->plans[$bugID] == 'ditto') $data->plans[$bugID] = isset($prev['plan']) ? $prev['plan'] : '';
|
||||
if($data->assignedTos[$bugID] == 'ditto') $data->assignedTos[$bugID] = isset($prev['assignedTo']) ? $prev['assignedTo'] : '';
|
||||
if($data->resolvedBys[$bugID] == 'ditto') $data->resolvedBys[$bugID] = isset($prev['resolvedBy']) ? $prev['resolvedBy'] : '';
|
||||
@@ -558,6 +559,7 @@ class bugModel extends model
|
||||
$prev['type'] = $data->types[$bugID];
|
||||
$prev['severity'] = $data->severities[$bugID];
|
||||
$prev['pri'] = $data->pris[$bugID];
|
||||
$prev['branch'] = $data->branches[$bugID];
|
||||
$prev['plan'] = $data->plans[$bugID];
|
||||
$prev['assignedTo'] = $data->assignedTos[$bugID];
|
||||
$prev['resolvedBy'] = $data->resolvedBys[$bugID];
|
||||
@@ -581,6 +583,7 @@ class bugModel extends model
|
||||
$bug->color = $data->colors[$bugID];
|
||||
$bug->title = $data->titles[$bugID];
|
||||
$bug->plan = empty($data->plans[$bugID]) ? 0 : $data->plans[$bugID];
|
||||
$bug->branch = empty($data->branches[$bugID]) ? 0 : $data->branches[$bugID];
|
||||
$bug->assignedTo = $data->assignedTos[$bugID];
|
||||
$bug->deadline = $data->deadlines[$bugID];
|
||||
$bug->resolvedBy = $data->resolvedBys[$bugID];
|
||||
|
||||
@@ -42,6 +42,9 @@ $columns = count($visibleFields) + 2;
|
||||
<th class='w-70px<?php echo zget($visibleFields, 'severity', ' hidden')?>'><?php echo $lang->bug->severityAB;?></th>
|
||||
<th class='w-70px<?php echo zget($visibleFields, 'pri', ' hidden')?>'><?php echo $lang->bug->pri;?></th>
|
||||
<th <?php if(count($visibleFields) >= 10) echo "class='w-150px'"?>><?php echo $lang->bug->title;?> <span class='required'></span></th>
|
||||
<?php if($branchProduct):?>
|
||||
<th class='w-150px<?php echo zget($visibleFields, 'branch', ' hidden')?>'><?php echo $lang->bug->branch;?></th>
|
||||
<?php endif;?>
|
||||
<th class='w-150px<?php echo zget($visibleFields, 'productplan', ' hidden')?>'><?php echo $lang->bug->productplan;?></th>
|
||||
<th class='w-150px<?php echo zget($visibleFields, 'assignedTo', ' hidden')?>'><?php echo $lang->bug->assignedTo;?></th>
|
||||
<th class='w-100px<?php echo zget($visibleFields, 'deadline', ' hidden')?>'><?php echo $lang->bug->deadline;?></th>
|
||||
@@ -49,8 +52,8 @@ $columns = count($visibleFields) + 2;
|
||||
<th class='w-100px<?php echo zget($visibleFields, 'os', ' hidden')?>'><?php echo $lang->bug->os;?></th>
|
||||
<th class='w-100px<?php echo zget($visibleFields, 'browser', ' hidden')?>'><?php echo $lang->bug->browser;?></th>
|
||||
<th class='w-100px<?php echo zget($visibleFields, 'keywords', ' hidden')?>'><?php echo $lang->bug->keywords;?></th>
|
||||
<th class='w-150px<?php echo zget($visibleFields, 'resolvedBy', ' hidden')?>'><?php echo $lang->bug->resolvedByAB;?></th>
|
||||
<th class='w-180px<?php echo zget($visibleFields, 'resolution', ' hidden')?>'><?php echo $lang->bug->resolutionAB;?></th>
|
||||
<th class='w-120px<?php echo zget($visibleFields, 'resolvedBy', ' hidden')?>'><?php echo $lang->bug->resolvedByAB;?></th>
|
||||
<th class='w-120px<?php echo zget($visibleFields, 'resolution', ' hidden')?>'><?php echo $lang->bug->resolutionAB;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -58,8 +61,17 @@ $columns = count($visibleFields) + 2;
|
||||
<?php
|
||||
if(!$productID)
|
||||
{
|
||||
$product = $this->product->getByID($bugs[$bugID]->product);
|
||||
|
||||
$plans = $this->loadModel('productplan')->getPairs($bugs[$bugID]->product, $branch);
|
||||
$plans = array('' => '', 'ditto' => $this->lang->bug->ditto) + $plans;
|
||||
|
||||
$branches = $product->type == 'normal' ? array('' => '') : $this->loadModel('branch')->getPairs($product->id);
|
||||
if($product->type != 'normal')
|
||||
{
|
||||
foreach($branches as $branchID => $branchName) $branches[$branchID] = '/' . $product->name . '/' . $branchName;
|
||||
$branches = array('ditto' => $this->lang->story->ditto) + $branches;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Remove designchange, newfeature, trackings from the typeList, because should be tracked in story or task.
|
||||
@@ -80,6 +92,13 @@ $columns = count($visibleFields) + 2;
|
||||
<?php echo html::input("titles[$bugID]", $bugs[$bugID]->title, 'class=form-control');?>
|
||||
<div>
|
||||
</td>
|
||||
<?php if($branchProduct):?>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'branch', ' hidden')?>' style='overflow:visible'>
|
||||
<?php $branchProductID = $productID ? $productID : $product->id;?>
|
||||
<?php $disabled = (isset($product) and $product->type == 'normal') ? "disabled='disabled'" : '';?>
|
||||
<?php echo html::select("branches[$bugID]", $branches, $bugs[$bugID]->branch, "class='form-control chosen' $disabled");?>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'productplan', ' hidden')?>' style='overflow:visible'><?php echo html::select("plans[$bugID]", $plans, $bugs[$bugID]->plan, "class='form-control chosen'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'assignedTo', ' hidden')?>' style='overflow:visible'><?php echo html::select("assignedTos[$bugID]", $users, $bugs[$bugID]->assignedTo, "class='form-control chosen'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'deadline', ' hidden')?>' style='overflow:visible'><?php echo html::input("deadlines[$bugID]", $bugs[$bugID]->deadline, "class='form-control form-date'");?></td>
|
||||
@@ -104,7 +123,7 @@ $columns = count($visibleFields) + 2;
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr><td colspan='<?php echo $columns;?>' class='text-center'><?php echo html::submitButton();?></td></tr>
|
||||
<tr><td colspan='<?php echo $branchProduct ? $columns : ($columns - 1);?>' class='text-center'><?php echo html::submitButton();?></td></tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
@@ -534,6 +534,25 @@ class doc extends control
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort doc lib.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function sort()
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
foreach($_POST as $id => $order)
|
||||
{
|
||||
$this->dao->update(TABLE_DOCLIB)->set('order')->eq($order)->where('id')->eq($id)->exec();
|
||||
}
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$this->send(array('result' => 'success'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax get modules by libID.
|
||||
*
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
.lib .file-icon{margin-bottom:5px;}
|
||||
.lib .lib-name{overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
|
||||
.lib:hover, .lib:focus, .lib:active {border-color: #2e6dad; background-color: #EBF2F9; color: #2e6dad}
|
||||
.lib .icon-move{display: none; position: relative; top: -10px; right : -70px;}
|
||||
.lib:hover .icon-move{display: inline-block; cursor: move;}
|
||||
.w-lib-p100{width:100%;}
|
||||
.w-lib-p50{width:45%;}
|
||||
.w-lib-p33{width:30%;}
|
||||
|
||||
@@ -225,4 +225,34 @@ $(document).ready(function()
|
||||
$('[data-id="create"] a').modalTrigger({type: 'iframe', width: 800});
|
||||
$('#modulemenu .nav li').removeClass('active');
|
||||
if(typeof(type) != 'undefined') $('#modulemenu .nav li[data-id="' + type + '"]').addClass('active');
|
||||
|
||||
$('.libs-group').sortable(
|
||||
{
|
||||
trigger: '.icon-move',
|
||||
selector: '.lib',
|
||||
finish: function()
|
||||
{
|
||||
var orders = {};
|
||||
var orderNext = 1;
|
||||
|
||||
$('.libs-group .lib').not('.files').not('.addbtn').each(function()
|
||||
{
|
||||
orders[$(this).data('id')] = orderNext ++;
|
||||
})
|
||||
|
||||
$.post(createLink('doc', 'sort'), orders, function(data)
|
||||
{
|
||||
if(data.result == 'success')
|
||||
{
|
||||
return location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(data.message);
|
||||
return location.reload();
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@@ -35,6 +35,7 @@ $lang->doc->fileObject = 'The Object';
|
||||
$lang->doc->whiteList = 'White List';
|
||||
$lang->doc->contentType = 'Document Format';
|
||||
$lang->doc->separator = "<i class='icon-angle-right'></i>";
|
||||
$lang->doc->fileTitle = 'File Title';
|
||||
|
||||
$lang->doc->moduleDoc = 'By Module';
|
||||
$lang->doc->searchDoc = 'By Search';
|
||||
@@ -68,6 +69,7 @@ $lang->doc->editLib = 'Edit';
|
||||
$lang->doc->deleteLib = 'Delete';
|
||||
$lang->doc->fixedMenu = 'Fixed In Menu';
|
||||
$lang->doc->removeMenu = 'Remove From Menu';
|
||||
$lang->doc->search = 'Search';
|
||||
|
||||
/* 查询条件列表 */
|
||||
$lang->doc->allProduct = 'All' . $lang->productCommon;
|
||||
|
||||
@@ -35,6 +35,7 @@ $lang->doc->fileObject = '所属对象';
|
||||
$lang->doc->whiteList = '白名单';
|
||||
$lang->doc->contentType = '文档格式';
|
||||
$lang->doc->separator = "<i class='icon-angle-right'></i>";
|
||||
$lang->doc->fileTitle = '附件名';
|
||||
|
||||
$lang->doc->moduleDoc = '按模块浏览';
|
||||
$lang->doc->searchDoc = '搜索';
|
||||
@@ -68,6 +69,7 @@ $lang->doc->editLib = '编辑文档库';
|
||||
$lang->doc->deleteLib = '删除文档库';
|
||||
$lang->doc->fixedMenu = '固定到菜单栏';
|
||||
$lang->doc->removeMenu = '从菜单栏移除';
|
||||
$lang->doc->search = '搜索';
|
||||
|
||||
/* 查询条件列表 */
|
||||
$lang->doc->allProduct = '所有' . $lang->productCommon;
|
||||
|
||||
+33
-18
@@ -118,12 +118,12 @@ class docModel extends model
|
||||
->leftJoin($table)->alias('t2')->on("t1.$type=t2.id")
|
||||
->where("t1.$type")->ne(0)
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->orderBy("t2.order desc, t1.id")
|
||||
->orderBy("t2.order desc, t1.order, t1.id")
|
||||
->query();
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere('product')->eq('0')->andWhere('project')->eq(0)->orderBy('id desc')->query();
|
||||
$stmt = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere('product')->eq('0')->andWhere('project')->eq(0)->orderBy('`order`, id desc')->query();
|
||||
}
|
||||
|
||||
$libPairs = array();
|
||||
@@ -149,16 +149,13 @@ class docModel extends model
|
||||
->join('users', ',')
|
||||
->remove('libType')
|
||||
->get();
|
||||
|
||||
if($lib->acl == 'private') $lib->users = $this->app->user->account;
|
||||
$this->dao->insert(TABLE_DOCLIB)->data($lib)->autoCheck()
|
||||
->batchCheck('name', 'notempty')
|
||||
->exec();
|
||||
$libID = $this->dao->lastInsertID();
|
||||
|
||||
$libType = $this->post->libType;
|
||||
if($lib->acl != 'private' and ($libType == 'project' or $libType == 'product')) $this->setLibUsers($libType, $lib->$libType);
|
||||
|
||||
return $libID;
|
||||
return $this->dao->lastInsertID();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -616,6 +613,19 @@ class docModel extends model
|
||||
if(strpos(",$object->groups,", ",$groupID,") !== false) return true;
|
||||
}
|
||||
}
|
||||
|
||||
if($object->product)
|
||||
{
|
||||
$product = $this->dao->findById($object->product)->from(TABLE_PRODUCT)->fetch();
|
||||
return $this->loadModel('product')->checkPriv($product);
|
||||
}
|
||||
|
||||
if($object->project)
|
||||
{
|
||||
$project = $this->dao->findById($object->project)->from(TABLE_PROJECT)->fetch();
|
||||
return $this->loadModel('project')->checkPriv($project);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -654,7 +664,7 @@ class docModel extends model
|
||||
}
|
||||
else
|
||||
{
|
||||
$libs = $this->dao->select('id,name')->from(TABLE_DOCLIB)->where('id')->in($idList)->orderBy('id desc')->fetchAll('id');
|
||||
$libs = $this->dao->select('id,name')->from(TABLE_DOCLIB)->where('id')->in($idList)->orderBy('`order`, id desc')->fetchAll('id');
|
||||
}
|
||||
|
||||
return $libs;
|
||||
@@ -672,7 +682,7 @@ class docModel extends model
|
||||
$stmt = $this->dao->select("id,product,project,name")->from(TABLE_DOCLIB)
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF($condition)->andWhere("($condition)")->fi()
|
||||
->orderBy("product desc,project desc, id asc")
|
||||
->orderBy("product desc,project desc, `order` asc, id asc")
|
||||
->query();
|
||||
|
||||
$customLibs = array();
|
||||
@@ -753,12 +763,12 @@ class docModel extends model
|
||||
$stmt = $this->dao->select('t1.*')->from(TABLE_DOCLIB)->alias('t1')
|
||||
->leftJoin($table)->alias('t2')->on("t1.$type=t2.id")
|
||||
->where('t1.deleted')->eq(0)->andWhere("t1.$type")->ne(0)
|
||||
->orderBy("t2.`order` desc, id desc")
|
||||
->orderBy("t2.`order` desc, t1.`order` asc, id desc")
|
||||
->query();
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere('project')->eq(0)->andWhere('product')->eq(0)->orderBy('id desc')->query();
|
||||
$stmt = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere('project')->eq(0)->andWhere('product')->eq(0)->orderBy('`order`, id desc')->query();
|
||||
}
|
||||
|
||||
$i = 1;
|
||||
@@ -791,7 +801,7 @@ class docModel extends model
|
||||
public function getSubLibGroups($type, $idList)
|
||||
{
|
||||
if($type != 'product' and $type != 'project') return false;
|
||||
$libGroups = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere($type)->in($idList)->orderBy('id')->fetchGroup($type, 'id');
|
||||
$libGroups = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere($type)->in($idList)->orderBy('`order`, id')->fetchGroup($type, 'id');
|
||||
if($type == 'product')
|
||||
{
|
||||
$hasProject = $this->dao->select('DISTINCT product')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
@@ -826,7 +836,7 @@ class docModel extends model
|
||||
public function getLibsByObject($type, $objectID, $mode = '')
|
||||
{
|
||||
if($type != 'product' and $type != 'project') return false;
|
||||
$objectLibs = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere($type)->eq($objectID)->orderBy('id')->fetchAll('id');
|
||||
$objectLibs = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere($type)->eq($objectID)->orderBy('`order`, id')->fetchAll('id');
|
||||
if($type == 'product')
|
||||
{
|
||||
$hasProject = $this->dao->select('DISTINCT product')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
@@ -862,7 +872,8 @@ class docModel extends model
|
||||
{
|
||||
if($type != 'project' and $type != 'product') return true;
|
||||
$this->loadModel('file');
|
||||
$docIdList = $this->dao->select('id')->from(TABLE_DOC)->where($type)->eq($objectID)->get();
|
||||
$docIdList = $this->dao->select('id')->from(TABLE_DOC)->where($type)->eq($objectID)->get();
|
||||
$searchTitle = $this->get->title;
|
||||
if($type == 'product')
|
||||
{
|
||||
$storyIdList = $this->dao->select('id')->from(TABLE_STORY)->where('product')->eq($objectID)->andWhere('deleted')->eq('0')->get();
|
||||
@@ -870,13 +881,15 @@ class docModel extends model
|
||||
$releaseIdList = $this->dao->select('id')->from(TABLE_RELEASE)->where('product')->eq($objectID)->andWhere('deleted')->eq('0')->get();
|
||||
$planIdList = $this->dao->select('id')->from(TABLE_PRODUCTPLAN)->where('product')->eq($objectID)->andWhere('deleted')->eq('0')->get();
|
||||
$files = $this->dao->select('*')->from(TABLE_FILE)->alias('t1')
|
||||
->where("(objectType = 'product' and objectID = $objectID)")
|
||||
->where('size')->gt('0')
|
||||
->andWhere("(objectType = 'product' and objectID = $objectID)", true)
|
||||
->orWhere("(objectType = 'doc' and objectID in ($docIdList))")
|
||||
->orWhere("(objectType = 'story' and objectID in ($storyIdList))")
|
||||
->orWhere("(objectType = 'bug' and objectID in ($bugIdList))")
|
||||
->orWhere("(objectType = 'release' and objectID in ($releaseIdList))")
|
||||
->orWhere("(objectType = 'productplan' and objectID in ($planIdList))")
|
||||
->andWhere('size')->gt('0')
|
||||
->markRight(1)
|
||||
->beginIF($searchTitle)->andWhere('title')->like("%{$searchTitle}%")->fi()
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
}
|
||||
@@ -885,11 +898,13 @@ class docModel extends model
|
||||
$taskIdList = $this->dao->select('id')->from(TABLE_TASK)->where('project')->eq($objectID)->andWhere('deleted')->eq('0')->get();
|
||||
$buildIdList = $this->dao->select('id')->from(TABLE_BUILD)->where('project')->eq($objectID)->andWhere('deleted')->eq('0')->get();
|
||||
$files = $this->dao->select('*')->from(TABLE_FILE)->alias('t1')
|
||||
->where("(objectType = 'project' and objectID = $objectID)")
|
||||
->where('size')->gt('0')
|
||||
->andWhere("(objectType = 'project' and objectID = $objectID)", true)
|
||||
->orWhere("(objectType = 'doc' and objectID in ($docIdList))")
|
||||
->orWhere("(objectType = 'task' and objectID in ($taskIdList))")
|
||||
->orWhere("(objectType = 'build' and objectID in ($buildIdList))")
|
||||
->andWhere('size')->gt('0')
|
||||
->markRight(1)
|
||||
->beginIF($searchTitle)->andWhere('title')->like("%{$searchTitle}%")->fi()
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
}
|
||||
|
||||
@@ -52,9 +52,10 @@
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class='clearfix'>
|
||||
<div class='clearfix libs-group'>
|
||||
<?php foreach($libs as $lib):?>
|
||||
<a class='lib lib-custom' title='<?php echo $lib->name?>' href='<?php echo inlink('browse', "libID=$lib->id") ?>'>
|
||||
<a class='lib lib-custom' title='<?php echo $lib->name?>' href='<?php echo inlink('browse', "libID=$lib->id") ?>' data-id='<?php echo $lib->id;?>'>
|
||||
<i class='icon icon-move'></i>
|
||||
<img src='<?php echo $config->webRoot . 'theme/default/images/main/doc-lib.png'?>' class='file-icon' />
|
||||
<div class='lib-name' title='<?php echo $lib->name?>'><?php echo $lib->name?></div>
|
||||
</a>
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
if($libID == 'project') $libLink = inlink('allLibs', "type=project&product=$object->id");
|
||||
if($libID == 'files') $libLink = inlink('showFiles', "type=$type&objectID=$object->id");
|
||||
?>
|
||||
<a class='lib' title='<?php echo $libName?>' href='<?php echo $libLink?>'>
|
||||
<a class='lib <?php echo $libID == 'files' ? 'files' : '';?>' title='<?php echo $libName?>' href='<?php echo $libLink?>' data-id='<?php echo $libID;?>'>
|
||||
<?php if($libID != 'files'):?><i class='icon icon-move'></i><?php endif;?>
|
||||
<img src='<?php echo $config->webRoot . 'theme/default/images/main/doc-lib.png'?>' class='file-icon' />
|
||||
<div class='lib-name' title='<?php echo $libName?>'><?php echo $libName?></div>
|
||||
</a>
|
||||
|
||||
@@ -13,7 +13,29 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='featurebar'>
|
||||
<strong><?php echo $lang->doclib->files?></strong>
|
||||
<div class='actions'><?php echo html::backButton();?></div>
|
||||
<div class='actions'>
|
||||
<form class='pull-left' method='get'>
|
||||
<?php
|
||||
if($this->config->requestType == 'GET')
|
||||
{
|
||||
echo html::hidden('m', 'doc');
|
||||
echo html::hidden('f', 'showFiles');
|
||||
echo html::hidden('type', $type);
|
||||
echo html::hidden('objectID', $object->id);
|
||||
echo html::hidden('recTotal', isset($this->get->recTotal) ? $this->get->recTotal : 0);
|
||||
echo html::hidden('recPerPage', isset($this->get->recPerPage) ? $this->get->recPerPage : 0);
|
||||
echo html::hidden('pageID', isset($this->get->pageID) ? $this->get->pageID : 0);
|
||||
}
|
||||
?>
|
||||
<div class='input-group input-group-sm'>
|
||||
<?php echo html::input('title', $this->get->title, "class='form-control search-query' placeholder='{$lang->doc->fileTitle}'");?>
|
||||
<span class='input-group-btn'>
|
||||
<?php echo html::submitButton($lang->doc->search);?>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
<?php echo html::backButton();?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='lib-files cards'>
|
||||
<?php foreach($files as $file):?>
|
||||
|
||||
@@ -360,18 +360,20 @@ $lang->project->methodOrder[190] = 'all';
|
||||
/* Task. */
|
||||
$lang->resource->task = new stdclass();
|
||||
$lang->resource->task->create = 'create';
|
||||
$lang->resource->task->batchCreate = 'batchCreate';
|
||||
$lang->resource->task->batchEdit = 'batchEdit';
|
||||
$lang->resource->task->edit = 'edit';
|
||||
$lang->resource->task->assignTo = 'assign';
|
||||
$lang->resource->task->batchAssignTo = 'batchAssignTo';
|
||||
$lang->resource->task->start = 'start';
|
||||
$lang->resource->task->pause = 'pause';
|
||||
$lang->resource->task->restart = 'restart';
|
||||
$lang->resource->task->finish = 'finish';
|
||||
$lang->resource->task->cancel = 'cancel';
|
||||
$lang->resource->task->close = 'close';
|
||||
$lang->resource->task->batchCreate = 'batchCreate';
|
||||
$lang->resource->task->batchEdit = 'batchEdit';
|
||||
$lang->resource->task->batchClose = 'batchClose';
|
||||
$lang->resource->task->batchCancel = 'batchCancel';
|
||||
$lang->resource->task->batchAssignTo = 'batchAssignTo';
|
||||
$lang->resource->task->batchChangeModule = 'batchChangeModule';
|
||||
$lang->resource->task->activate = 'activate';
|
||||
$lang->resource->task->delete = 'delete';
|
||||
$lang->resource->task->view = 'view';
|
||||
@@ -381,7 +383,6 @@ $lang->resource->task->recordEstimate = 'recordEstimate';
|
||||
$lang->resource->task->editEstimate = 'editEstimate';
|
||||
$lang->resource->task->deleteEstimate = 'deleteEstimate';
|
||||
$lang->resource->task->report = 'reportChart';
|
||||
$lang->resource->task->batchChangeModule = 'batchChangeModule';
|
||||
|
||||
$lang->task->methodOrder[5] = 'create';
|
||||
$lang->task->methodOrder[10] = 'batchCreate';
|
||||
|
||||
@@ -20,7 +20,7 @@ $lang->mail->turnon = '是否打开';
|
||||
$lang->mail->async = '异步发送';
|
||||
$lang->mail->fromAddress = '发信邮箱';
|
||||
$lang->mail->fromName = '发信人';
|
||||
$lang->mail->domain = '发信域名';
|
||||
$lang->mail->domain = '禅道域名';
|
||||
$lang->mail->host = 'smtp服务器';
|
||||
$lang->mail->port = 'smtp端口号';
|
||||
$lang->mail->auth = '是否需要验证';
|
||||
|
||||
@@ -531,10 +531,11 @@ class product extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxGetPlans($productID, $branch = 0, $planID = 0, $needCreate = false)
|
||||
public function ajaxGetPlans($productID, $branch = 0, $planID = 0, $fieldID = '', $needCreate = false)
|
||||
{
|
||||
$plans = $this->loadModel('productplan')->getPairs($productID, $branch);
|
||||
$output = html::select('plan', $plans, $planID, "class='form-control chosen'");
|
||||
$field = $fieldID ? "plans[$fieldID]" : 'plan';
|
||||
$output = html::select($field, $plans, $planID, "class='form-control chosen'");
|
||||
if(count($plans) == 1 and $needCreate)
|
||||
{
|
||||
$output .= "<span class='input-group-addon'>";
|
||||
|
||||
@@ -80,6 +80,10 @@ $lang->product->typeList['normal'] = 'Normal';
|
||||
$lang->product->typeList['branch'] = 'Multi Branch';
|
||||
$lang->product->typeList['platform'] = 'Multi Platform';
|
||||
|
||||
$lang->product->typeTips = array();
|
||||
$lang->product->typeTips['branch'] = '(Generally used to divide the custom content of different users)';
|
||||
$lang->product->typeTips['platform'] = '(Generally used to divide ios, Andrews, pc side, server and so on)';
|
||||
|
||||
$lang->product->branchName['normal'] = '';
|
||||
$lang->product->branchName['branch'] = 'Branch';
|
||||
$lang->product->branchName['platform'] = 'Platform';
|
||||
|
||||
@@ -80,6 +80,10 @@ $lang->product->typeList['normal'] = '正常';
|
||||
$lang->product->typeList['branch'] = '多分支';
|
||||
$lang->product->typeList['platform'] = '多平台';
|
||||
|
||||
$lang->product->typeTips = array();
|
||||
$lang->product->typeTips['branch'] = '(一般用于划分不同用户的定制内容)';
|
||||
$lang->product->typeTips['platform'] = '(一般用于划分ios、安卓、pc端、服务器端等)';
|
||||
|
||||
$lang->product->branchName['normal'] = '';
|
||||
$lang->product->branchName['branch'] = '分支';
|
||||
$lang->product->branchName['platform'] = '平台';
|
||||
|
||||
@@ -37,7 +37,11 @@ class productModel extends model
|
||||
$currentMethod = $this->app->getMethodName();
|
||||
|
||||
/* init currentModule and currentMethod for report and story. */
|
||||
if($currentModule == 'story' and $currentMethod != 'create' and $currentMethod != 'batchcreate') $currentModule = 'product';
|
||||
if($currentModule == 'story')
|
||||
{
|
||||
if($currentMethod != 'create' and $currentMethod != 'batchcreate') $currentModule = 'product';
|
||||
if($currentMethod == 'view') $currentMethod = 'browse';
|
||||
}
|
||||
if($currentMethod == 'report') $currentMethod = 'browse';
|
||||
|
||||
$selectHtml = $this->select($products, $productID, $currentModule, $currentMethod, $extra, $branch);
|
||||
@@ -283,9 +287,7 @@ class productModel extends model
|
||||
$lib->product = $productID;
|
||||
$lib->name = $this->lang->doclib->main['product'];
|
||||
$lib->main = '1';
|
||||
$lib->acl = $product->acl == 'open' ? 'open' : 'custom';
|
||||
$lib->users = $this->app->user->account;
|
||||
if($product->acl == 'custom') $lib->groups = $product->whitelist;
|
||||
$lib->acl = 'private';
|
||||
$this->dao->insert(TABLE_DOCLIB)->data($lib)->exec();
|
||||
|
||||
return $productID;
|
||||
@@ -317,14 +319,6 @@ class productModel extends model
|
||||
->exec();
|
||||
if(!dao::isError())
|
||||
{
|
||||
if($product->acl != $oldProduct->acl)
|
||||
{
|
||||
$this->dao->update(TABLE_DOCLIB)->set('acl')->eq($product->acl == 'open' ? 'open' : 'custom')->where('product')->eq($productID)->exec();
|
||||
if($product->acl == 'open') $this->dao->update(TABLE_DOCLIB)->set('groups')->eq('')->where('product')->eq($productID)->exec();
|
||||
if($product->acl == 'custom') $this->dao->update(TABLE_DOCLIB)->set('groups')->eq($product->whitelist)->where('product')->eq($productID)->exec();
|
||||
if($product->acl == 'private') $this->dao->update(TABLE_DOCLIB)->set('groups')->eq('')->where('product')->eq($productID)->exec();
|
||||
if($product->acl != 'open') $this->loadModel('doc')->setLibUsers('product', $productID);
|
||||
}
|
||||
$this->file->updateObjectID($this->post->uid, $productID, 'product');
|
||||
return common::createChanges($oldProduct, $product);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,13 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->type;?></th>
|
||||
<td><?php echo html::select('type', $lang->product->typeList, 'normal', "class='form-control'");?></td><td></td>
|
||||
<td>
|
||||
<?php
|
||||
$proudctTypeList = array();
|
||||
foreach($lang->product->typeList as $key => $type) $productTypeList[$key] = $type . zget($lang->product->typeTips, $key, '');
|
||||
?>
|
||||
<?php echo html::select('type', $productTypeList, 'normal', "class='form-control'");?>
|
||||
</td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->desc;?></th>
|
||||
|
||||
@@ -44,7 +44,7 @@ include '../../common/view/tablesorter.html.php';
|
||||
<td><span class='<?php echo 'pri' . zget($lang->story->priList, $story->pri, $story->pri);?>'><?php echo zget($lang->story->priList, $story->pri, $story->pri)?></span></td>
|
||||
<td><?php echo $story->planTitle;?></td>
|
||||
<td title='<?php echo $modules[$story->module]?>'><?php echo $modules[$story->module];?></td>
|
||||
<td class='text-left nobr' title='<?php echo $story->title?>'><?php echo html::a($this->createLink('story', 'view', "storyID=$story->id"), $story->title);?></td>
|
||||
<td class='text-left nobr' title='<?php echo $story->title?>'><?php echo html::a($this->createLink('story', 'view', "storyID=$story->id", '', true), $story->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");?></td>
|
||||
<td><?php echo zget($users, $story->openedBy);?></td>
|
||||
<td><?php echo zget($users, $story->assignedTo);?></td>
|
||||
<td><?php echo $story->estimate;?></td>
|
||||
@@ -70,4 +70,9 @@ include '../../common/view/tablesorter.html.php';
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<script>$(function(){ajaxGetSearchForm('#stories .linkBox #querybox');})</script>
|
||||
<script>
|
||||
$(function(){
|
||||
ajaxGetSearchForm('#stories .linkBox #querybox');
|
||||
setModal();
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -514,6 +514,7 @@ class project extends control
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->param = $param;
|
||||
$this->view->users = $users;
|
||||
$this->view->project = $this->project->getByID($projectID);
|
||||
$this->view->projectID = $projectID;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -289,25 +289,9 @@ class projectModel extends model
|
||||
$lib->project = $projectID;
|
||||
$lib->name = $this->lang->doclib->main['project'];
|
||||
$lib->main = '1';
|
||||
$lib->acl = $project->acl == 'open' ? 'open' : 'custom';
|
||||
|
||||
$teams = $this->dao->select('account')->from(TABLE_TEAM)->where('project')->eq($projectID)->fetchPairs('account', 'account');
|
||||
$lib->users = join(',', $teams);
|
||||
if($project->acl == 'custom') $lib->groups = $project->whitelist;
|
||||
$lib->acl = 'private';
|
||||
$this->dao->insert(TABLE_DOCLIB)->data($lib)->exec();
|
||||
|
||||
$docLibs = $this->dao->select('id,users')->from(TABLE_DOCLIB)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.product=t2.product')
|
||||
->where('t2.project')->eq($projectID)
|
||||
->andWhere('t1.acl')->eq('custom')
|
||||
->fetchAll('id');
|
||||
foreach($docLibs as $lib)
|
||||
{
|
||||
$docUsers = $teams + explode(',', $lib->users);
|
||||
$docUsers = array_unique($docUsers);
|
||||
$this->dao->update(TABLE_DOCLIB)->set('users')->eq(join(',', $docUsers))->where('id')->eq($lib->id)->exec();
|
||||
}
|
||||
|
||||
return $projectID;
|
||||
}
|
||||
}
|
||||
@@ -364,21 +348,6 @@ class projectModel extends model
|
||||
}
|
||||
if(!dao::isError())
|
||||
{
|
||||
if($project->acl != $oldProject->acl)
|
||||
{
|
||||
$this->dao->update(TABLE_DOCLIB)->set('acl')->eq($project->acl == 'open' ? 'open' : 'custom')->where('project')->eq($projectID)->exec();
|
||||
if($project->acl == 'open') $this->dao->update(TABLE_DOCLIB)->set('groups')->eq('')->where('project')->eq($projectID)->exec();
|
||||
if($project->acl == 'custom')
|
||||
{
|
||||
$teams = $this->dao->select('account')->from(TABLE_TEAM)->where('project')->eq($projectID)->fetchPairs('account', 'account');
|
||||
$this->dao->update(TABLE_DOCLIB)->set('groups')->eq($project->whitelist)->set('users')->eq(join(',', $teams))->where('project')->eq($projectID)->exec();
|
||||
}
|
||||
if($project->acl == 'private')
|
||||
{
|
||||
$teams = $this->dao->select('account')->from(TABLE_TEAM)->where('project')->eq($projectID)->fetchPairs('account', 'account');
|
||||
$this->dao->update(TABLE_DOCLIB)->set('users')->eq(join(',', $teams))->set('groups')->eq('')->where('project')->eq($projectID)->exec();
|
||||
}
|
||||
}
|
||||
$this->file->updateObjectID($this->post->uid, $projectID, 'project');
|
||||
return common::createChanges($oldProject, $project);
|
||||
}
|
||||
@@ -1083,7 +1052,7 @@ class projectModel extends model
|
||||
$this->dao->delete()->from(TABLE_PROJECTPRODUCT)->where('project')->eq((int)$projectID)->exec();
|
||||
if(!isset($_POST['products'])) return;
|
||||
$products = $_POST['products'];
|
||||
$branches = $_POST['branch'];
|
||||
$branches = isset($_POST['branch']) ? $_POST['branch'] : array();
|
||||
|
||||
$existedProducts = array();
|
||||
$addedProducts = array();
|
||||
@@ -1107,10 +1076,6 @@ class projectModel extends model
|
||||
$this->dao->insert(TABLE_PROJECTPRODUCT)->data($data)->exec();
|
||||
$existedProducts[$productID] = true;
|
||||
}
|
||||
|
||||
$this->loadModel('doc');
|
||||
foreach($deletedProducts as $productID) $this->doc->setLibUsers('product', $productID);
|
||||
foreach($addedProducts as $productID) $this->doc->setLibUsers('product', $productID);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1254,6 +1219,7 @@ class projectModel extends model
|
||||
$task->name = $bug->title;
|
||||
$task->type = 'devel';
|
||||
$task->pri = $bugToTasks->pri[$key];
|
||||
$task->deadline = $bugToTasks->deadline[$key];
|
||||
$task->consumed = 0;
|
||||
$task->status = 'wait';
|
||||
$task->openedDate = $now;
|
||||
@@ -1531,21 +1497,6 @@ class projectModel extends model
|
||||
$this->dao->insert(TABLE_TEAM)->data($member)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
$acl = $this->dao->select('acl')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch('acl');
|
||||
if($acl != 'open') $this->loadModel('doc')->setLibUsers('project', $projectID);
|
||||
|
||||
$docLibs = $this->dao->select('id,users')->from(TABLE_DOCLIB)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.product=t2.product')
|
||||
->where('t2.project')->eq($projectID)
|
||||
->andWhere('t1.acl')->eq('custom')
|
||||
->fetchAll('id');
|
||||
foreach($docLibs as $lib)
|
||||
{
|
||||
$docUsers = $accounts + explode(',', $lib->users);
|
||||
$docUsers = array_unique($docUsers);
|
||||
$this->dao->update(TABLE_DOCLIB)->set('users')->eq(join(',', $docUsers))->where('id')->eq($lib->id)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1559,20 +1510,6 @@ class projectModel extends model
|
||||
public function unlinkMember($projectID, $account)
|
||||
{
|
||||
$this->dao->delete()->from(TABLE_TEAM)->where('project')->eq((int)$projectID)->andWhere('account')->eq($account)->exec();
|
||||
|
||||
$acl = $this->dao->select('acl')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch('acl');
|
||||
if($acl != 'open') $this->loadModel('doc')->setLibUsers('project', $projectID);
|
||||
|
||||
$docLibs = $this->dao->select('id,users')->from(TABLE_DOCLIB)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.product=t2.product')
|
||||
->where('t2.project')->eq($projectID)
|
||||
->andWhere('t1.acl')->eq('custom')
|
||||
->fetchAll('id');
|
||||
foreach($docLibs as $lib)
|
||||
{
|
||||
$docUsers = str_replace(",$account,", '', ",{$lib->users},");
|
||||
$this->dao->update(TABLE_DOCLIB)->set('users')->eq($docUsers)->where('id')->eq($lib->id)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/datepicker.html.php';?>
|
||||
<?php include '../../common/view/tablesorter.html.php';?>
|
||||
<script>
|
||||
$(function(){$(".preview").modalTrigger({width:1000, type:'iframe'});});
|
||||
@@ -35,6 +36,7 @@ var browseType = '<?php echo $browseType;?>';
|
||||
<th class='w-80px'><?php echo $lang->task->pri;?></th>
|
||||
<th class='w-150px'><?php echo $lang->task->assignedTo;?></th>
|
||||
<th class='w-80px nobr {sorter:false}'><?php echo $lang->task->estimate;?></th>
|
||||
<th class='w-120px {sorter:false}'><?php echo $lang->task->deadline;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -51,12 +53,14 @@ var browseType = '<?php echo $browseType;?>';
|
||||
<td class='td-has-control'><?php echo html::select("pri[$bug->id]", $lang->task->priList, 3, "class='input-sm form-control'");?></td>
|
||||
<td class='td-has-control text-left' style='overflow:visible'><?php echo html::select("assignedTo[$bug->id]", $users, zget($users, $bug->assignedTo, '', $bug->assignedTo), "class='input-sm form-control chosen'");?></td>
|
||||
<td class='td-has-control'><?php echo html::input("estimate[$bug->id]", '', 'size=4 class="input-sm form-control" autocomplete="off"');?></td>
|
||||
<?php $deadline = ($bug->deadline > helper::today() and $bug->deadline > $project->begin) ? $bug->deadline : '0000-00-00';?>
|
||||
<td class='td-has-control'><?php echo html::input("deadline[$bug->id]", $deadline, 'size=4 class="input-sm form-control form-date" autocomplete="off"');?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan='8'>
|
||||
<td colspan='9'>
|
||||
<div class='table-actions clearfix'><?php echo html::selectButton() . html::submitButton($lang->import) . html::backButton();?>
|
||||
</div>
|
||||
<?php $pager->show();?>
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
<th><?php echo $lang->story->module;?></th>
|
||||
<th><?php echo $lang->story->title;?></th>
|
||||
<th><?php echo $lang->story->plan;?></th>
|
||||
<th class='w-80px'><?php echo $lang->story->stage;?></th>
|
||||
<?php if($productType != 'normal'):?>
|
||||
<th><?php echo $lang->product->branchName[$productType];?></th>
|
||||
<?php endif;?>
|
||||
@@ -56,6 +57,7 @@
|
||||
<?php if($productType != 'normal'):?>
|
||||
<td><?php if(isset($branchGroups[$story->product][$story->branch])) echo $branchGroups[$story->product][$story->branch];?></td>
|
||||
<?php endif;?>
|
||||
<td><?php echo zget($lang->story->stageList, $story->stage);?></td>
|
||||
<td><?php echo $users[$story->openedBy];?></td>
|
||||
<td><?php echo $story->estimate;?></td>
|
||||
</tr>
|
||||
|
||||
@@ -56,6 +56,7 @@ js::set('browseType', $browseType);
|
||||
<?php
|
||||
$canBatchEdit = common::hasPriv('task', 'batchEdit');
|
||||
$canBatchClose = (common::hasPriv('task', 'batchClose') && strtolower($browseType) != 'closedBy');
|
||||
$canBatchCancel = common::hasPriv('task', 'batchCancel');
|
||||
$canBatchChangeModule = common::hasPriv('task', 'batchChangeModule');
|
||||
$canBatchAssignTo = common::hasPriv('task', 'batchAssignTo');
|
||||
if(count($tasks))
|
||||
@@ -69,10 +70,15 @@ js::set('browseType', $browseType);
|
||||
echo html::commonButton($lang->edit, $misc);
|
||||
echo "<button id='moreAction' type='button' class='btn dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>";
|
||||
echo "<ul class='dropdown-menu' id='moreActionMenu'>";
|
||||
|
||||
$actionLink = $this->createLink('task', 'batchClose');
|
||||
$misc = $canBatchClose ? "onclick=\"setFormAction('$actionLink','hiddenwin')\"" : "class='disabled'";
|
||||
echo "<li>" . html::a('#', $lang->close, '', $misc) . "</li>";
|
||||
|
||||
$actionLink = $this->createLink('task', 'batchCancel');
|
||||
$misc = $canBatchCancel ? "onclick=\"setFormAction('$actionLink','hiddenwin')\"" : "class='disabled'";
|
||||
echo "<li>" . html::a('#', $lang->task->cancel, '', $misc) . "</li>";
|
||||
|
||||
if($canBatchChangeModule)
|
||||
{
|
||||
$withSearch = count($modules) > 10;
|
||||
|
||||
@@ -53,6 +53,10 @@ include '../../common/view/chosen.html.php';
|
||||
#groupAndOr {display: inline-block;}
|
||||
|
||||
.outer > #querybox {margin: -20px -20px 20px; border-top: none; border-bottom: 1px solid #ddd}
|
||||
|
||||
#searchform input.date::-webkit-input-placeholder{color: #000000; opacity: 1;}
|
||||
#searchform input.date::-moz-placeholder{color: #000000; opacity: 1;}
|
||||
#searchform input.date:-ms-input-placeholder{color: #000000; opacity: 1;}
|
||||
</style>
|
||||
<script language='Javascript'>
|
||||
var dtOptions =
|
||||
@@ -107,7 +111,16 @@ function setDateField(query, fieldNO)
|
||||
var target = $(query).closest('form').find('#' + $period.data('target'));
|
||||
if(target.length)
|
||||
{
|
||||
target.val($(this).attr('href').replace('#', '$'));
|
||||
if(target.next('input[type=hidden]').length)
|
||||
{
|
||||
target.next('input[type=hidden]').val($(this).attr('href').replace('#', '$'));
|
||||
target.attr('placeholder', $(this).attr('href').replace('#', '$'));
|
||||
}
|
||||
else
|
||||
{
|
||||
target.val($(this).attr('href').replace('#', '$'));
|
||||
}
|
||||
|
||||
$(query).closest('form').find('#operator' + $period.data('fieldNO')).val('between');
|
||||
$period.hide();
|
||||
}
|
||||
@@ -120,10 +133,25 @@ function setDateField(query, fieldNO)
|
||||
var $e = $(e.target);
|
||||
var ePos = $e.offset();
|
||||
$period.css({'left': ePos.left + 175, 'top': ePos.top + 29, 'min-height': $('.datetimepicker').outerHeight()}).show().data('target', $e.attr('id')).data('fieldNO', fieldNO).find('li.active').removeClass('active');
|
||||
$period.find("li > a[href='" + $e.val().replace('$', '#') + "']").closest('li').addClass('active');
|
||||
if($e.attr('placeholder'))
|
||||
{
|
||||
$period.find("li > a[href='" + $e.attr('placeholder').replace('$', '#') + "']").closest('li').addClass('active');
|
||||
}
|
||||
else
|
||||
{
|
||||
$period.find("li > a[href='" + $e.val().replace('$', '#') + "']").closest('li').addClass('active');
|
||||
}
|
||||
}).on('changeDate', function()
|
||||
{
|
||||
var opt = $(query).closest('form').find('#operator' + $period.data('fieldNO'));
|
||||
var target = $('#' + $period.data('target'));
|
||||
if(target.length)
|
||||
{
|
||||
if(target.next('input[type=hidden]').length)
|
||||
{
|
||||
target.next('input[type=hidden]').val(target.val());
|
||||
}
|
||||
}
|
||||
if(opt.val() == 'between') opt.val('<=');
|
||||
$period.hide();
|
||||
}).on('hide', function(){setTimeout(function(){$period.hide();}, 200);});
|
||||
@@ -357,8 +385,18 @@ foreach($fieldParams as $fieldName => $param)
|
||||
if($param['control'] == 'input')
|
||||
{
|
||||
$fieldName = $formSession["field$fieldNO"];
|
||||
$fieldValue = $formSession["value$fieldNO"];
|
||||
$extraClass = isset($param['class']) ? $param['class'] : '';
|
||||
echo html::input("value$fieldNO", $formSession["value$fieldNO"], "class='form-control $extraClass searchInput' autocomplete='off'");
|
||||
|
||||
if($fieldValue && strpos('$lastWeek,$thisWeek,$today,$yesterday,$thisMonth,$lastMonth',$fieldValue) !== false)
|
||||
{
|
||||
echo html::input("dateValue$fieldNO", '', "class='form-control $extraClass searchInput' placeholder='{$fieldValue}'");
|
||||
echo html::hidden("value$fieldNO", $fieldValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo html::input("value$fieldNO", $fieldValue, "class='form-control $extraClass searchInput' autocomplete='off'");
|
||||
}
|
||||
}
|
||||
echo '</td>';
|
||||
|
||||
@@ -407,8 +445,18 @@ foreach($fieldParams as $fieldName => $param)
|
||||
if($param['control'] == 'input')
|
||||
{
|
||||
$fieldName = $formSession["field$fieldNO"];
|
||||
$fieldValue = $formSession["value$fieldNO"];
|
||||
$extraClass = isset($param['class']) ? $param['class'] : '';
|
||||
echo html::input("value$fieldNO", $formSession["value$fieldNO"], "class='form-control $extraClass searchInput' autocomplete='off'");
|
||||
|
||||
if($fieldValue && strpos('$lastWeek,$thisWeek,$today,$yesterday,$thisMonth,$lastMonth',$fieldValue) !== false)
|
||||
{
|
||||
echo html::input("dateValue$fieldNO", '', "class='form-control $extraClass searchInput' placeholder='{$fieldValue}'");
|
||||
echo html::hidden("value$fieldNO", $fieldValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo html::input("value$fieldNO", $fieldValue, "class='form-control $extraClass searchInput' autocomplete='off'");
|
||||
}
|
||||
}
|
||||
echo '</td>';
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ $config->story->list->customBatchEditFields = 'module,plan,estimate,pri,assign
|
||||
$config->story->custom = new stdclass();
|
||||
$config->story->custom->createFields = $config->story->list->customCreateFields;
|
||||
$config->story->custom->batchCreateFields = 'module,plan,spec,pri,estimate,review';
|
||||
$config->story->custom->batchEditFields = 'module,plan,estimate,pri,source,stage,closedBy,closedReason';
|
||||
$config->story->custom->batchEditFields = 'branch,module,plan,estimate,pri,source,stage,closedBy,closedReason';
|
||||
|
||||
$config->story->datatable = new stdclass();
|
||||
$config->story->datatable->defaultField = array('id', 'pri', 'title', 'plan', 'source', 'openedBy', 'assignedTo', 'estimate', 'status', 'stage', 'taskCount', 'bugCount', 'caseCount', 'actions');
|
||||
|
||||
@@ -405,6 +405,7 @@ class story extends control
|
||||
{
|
||||
$this->product->setMenu($this->product->getPairs('nodeleted'), $productID, $branch);
|
||||
$product = $this->product->getByID($productID);
|
||||
$branchProduct = $product->type == 'normal' ? false : true;
|
||||
|
||||
/* Set modules and productPlans. */
|
||||
$modules = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch);
|
||||
@@ -412,7 +413,9 @@ class story extends control
|
||||
$productPlans = $this->productplan->getPairs($productID, $branch);
|
||||
$productPlans = array('' => '', 'ditto' => $this->lang->story->ditto) + $productPlans;
|
||||
|
||||
|
||||
$this->view->modules = $modules;
|
||||
$this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id);
|
||||
$this->view->productPlans = $productPlans;
|
||||
$this->view->position[] = html::a($this->createLink('product', 'browse', "product=$product->id&branch=$branch"), $product->name);
|
||||
$this->view->title = $product->name . $this->lang->colon . $this->lang->story->batchEdit;
|
||||
@@ -425,7 +428,20 @@ class story extends control
|
||||
$this->project->setMenu($this->project->getPairs('nodeleted'), $projectID);
|
||||
$this->lang->set('menugroup.story', 'project');
|
||||
$this->lang->story->menuOrder = $this->lang->project->menuOrder;
|
||||
|
||||
$project = $this->project->getByID($projectID);
|
||||
|
||||
$branchProduct = false;
|
||||
$linkedProducts = $this->project->getProducts($projectID);
|
||||
foreach($linkedProducts as $linkedProduct)
|
||||
{
|
||||
if($linkedProduct->type != 'normal')
|
||||
{
|
||||
$branchProduct = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->position[] = html::a($this->createLink('project', 'story', "project=$project->id"), $project->name);
|
||||
$this->view->title = $project->name . $this->lang->colon . $this->lang->story->batchEdit;
|
||||
}
|
||||
@@ -436,6 +452,20 @@ class story extends control
|
||||
$this->lang->set('menugroup.story', 'my');
|
||||
$this->lang->story->menuOrder = $this->lang->my->menuOrder;
|
||||
$this->loadModel('my')->setMenu();
|
||||
|
||||
$branchProduct = false;
|
||||
$productIdList = array();
|
||||
foreach($stories as $story) $productIdList[$story->product] = $story->product;
|
||||
$products = $this->product->getByIdList($productIdList);
|
||||
foreach($products as $storyProduct)
|
||||
{
|
||||
if($storyProduct->type != 'normal')
|
||||
{
|
||||
$branchProduct = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->position[] = html::a($this->createLink('my', 'story'), $this->lang->my->story);
|
||||
$this->view->title = $this->lang->story->batchEdit;
|
||||
}
|
||||
@@ -462,6 +492,7 @@ class story extends control
|
||||
$this->view->reasonList = array('' => '', 'ditto' => $this->lang->story->ditto) + $this->lang->story->reasonList;
|
||||
$this->view->stageList = array('' => '', 'ditto' => $this->lang->story->ditto) + $this->lang->story->stageList;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->branchProduct = $branchProduct;
|
||||
$this->view->storyIDList = $storyIDList;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->stories = $stories;
|
||||
|
||||
@@ -73,3 +73,10 @@ function setModuleAndPlan(branchID, productID, num)
|
||||
$("#plan" + num).chosen(defaultChosenOptions);
|
||||
});
|
||||
}
|
||||
|
||||
/* Copy story title as story spec. */
|
||||
function copyTitle(num)
|
||||
{
|
||||
var title = $('#title\\[' + num + '\\]').val();
|
||||
$('#spec\\[' + num + '\\]').val(title);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,19 @@ function setDuplicateAndChild(resolution, storyID)
|
||||
}
|
||||
}
|
||||
|
||||
function loadBranches(product, branch, storyID)
|
||||
{
|
||||
if(typeof(branch) == 'undefined') branch = 0;
|
||||
if(!branch) branch = 0;
|
||||
|
||||
moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + product + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + storyID + '&needManage=true');
|
||||
$('#modules' + storyID).parent('td').load(moduleLink, function(){$('#modules' + storyID).chosen(defaultChosenOptions);})
|
||||
|
||||
planID = $('#plans' + storyID).val();
|
||||
planLink = createLink('product', 'ajaxGetPlans', 'productID=' + product + '&branch=' + branch + '&planID=' + planID + '&fieldID=' + storyID + '&needCreate=true');
|
||||
$('#plans' + storyID).parent('td').load(planLink, function(){$('#plans' + storyID).chosen(defaultChosenOptions);});
|
||||
}
|
||||
|
||||
$(document).ready(removeDitto());//Remove 'ditto' in first row.
|
||||
|
||||
$(document).on('click', '.chosen-with-drop', function(){oldValue = $(this).prev('select').val();})//Save old value.
|
||||
|
||||
@@ -38,6 +38,7 @@ $lang->story->export = "Export Data";
|
||||
$lang->story->zeroCase = "Zero Case";
|
||||
$lang->story->zeroTask = "Zero Task";
|
||||
$lang->story->reportChart = "Report";
|
||||
$lang->story->copyTitle = "Copy Title";
|
||||
$lang->story->batchChangePlan = "Batch Change Plans";
|
||||
$lang->story->batchChangeBranch = "Batch Change Branches";
|
||||
$lang->story->batchChangeStage = "Batch Change Stages";
|
||||
|
||||
@@ -38,6 +38,7 @@ $lang->story->export = "导出数据";
|
||||
$lang->story->zeroCase = "零用例需求";
|
||||
$lang->story->zeroTask = "只列零任务需求";
|
||||
$lang->story->reportChart = "统计报表";
|
||||
$lang->story->copyTitle = "同需求名称";
|
||||
$lang->story->batchChangePlan = "批量修改计划";
|
||||
$lang->story->batchChangeBranch = "批量修改分支";
|
||||
$lang->story->batchChangeStage = "批量修改阶段";
|
||||
|
||||
@@ -448,7 +448,7 @@ class storyModel extends model
|
||||
->add('lastEditedDate', $now)
|
||||
->setDefault('status', $oldStory->status)
|
||||
->setDefault('product', $oldStory->product)
|
||||
->setDefault('plan', $oldStory->plan)
|
||||
->setDefault('plan', 0)
|
||||
->setDefault('branch', 0)
|
||||
->setIF($this->post->assignedTo != $oldStory->assignedTo, 'assignedDate', $now)
|
||||
->setIF($this->post->closedBy != false and $oldStory->closedDate == '', 'closedDate', $now)
|
||||
@@ -503,6 +503,7 @@ class storyModel extends model
|
||||
$allChanges = array();
|
||||
$now = helper::now();
|
||||
$data = fixer::input('post')->get();
|
||||
a($data);exit;
|
||||
$storyIDList = $this->post->storyIDList ? $this->post->storyIDList : array();
|
||||
|
||||
/* Init $stories. */
|
||||
@@ -513,15 +514,17 @@ class storyModel extends model
|
||||
/* Process the data if the value is 'ditto'. */
|
||||
foreach($storyIDList as $storyID)
|
||||
{
|
||||
if($data->pris[$storyID] == 'ditto') $data->pris[$storyID] = isset($prev['pri']) ? $prev['pri'] : 0;
|
||||
if($data->modules[$storyID] == 'ditto') $data->modules[$storyID] = isset($prev['module']) ? $prev['module'] : 0;
|
||||
if($data->plans[$storyID] == 'ditto') $data->plans[$storyID] = isset($prev['plan']) ? $prev['plan'] : 0;
|
||||
if($data->sources[$storyID] == 'ditto') $data->sources[$storyID] = isset($prev['source']) ? $prev['source'] : '';
|
||||
if($data->pris[$storyID] == 'ditto') $data->pris[$storyID] = isset($prev['pri']) ? $prev['pri'] : 0;
|
||||
if($data->branches[$storyID] == 'ditto') $data->branches[$storyID] = isset($prev['branch']) ? $prev['branch'] : 0;
|
||||
if($data->modules[$storyID] == 'ditto') $data->modules[$storyID] = isset($prev['module']) ? $prev['module'] : 0;
|
||||
if($data->plans[$storyID] == 'ditto') $data->plans[$storyID] = isset($prev['plan']) ? $prev['plan'] : 0;
|
||||
if($data->sources[$storyID] == 'ditto') $data->sources[$storyID] = isset($prev['source']) ? $prev['source'] : '';
|
||||
if(isset($data->stages[$storyID]) and ($data->stages[$storyID] == 'ditto')) $data->stages[$storyID] = isset($prev['stage']) ? $prev['stage'] : '';
|
||||
if(isset($data->closedBys[$storyID]) and ($data->closedBys[$storyID] == 'ditto')) $data->closedBys[$storyID] = isset($prev['closedBy']) ? $prev['closedBy'] : '';
|
||||
if(isset($data->closedReasons[$storyID]) and ($data->closedReasons[$storyID] == 'ditto')) $data->closedReasons[$storyID] = isset($prev['closedReason']) ? $prev['closedReason'] : '';
|
||||
|
||||
$prev['pri'] = $data->pris[$storyID];
|
||||
$prev['branch'] = isset($data->branches[$storyID]) ? $data->branches[$storyID] : 0;
|
||||
$prev['module'] = $data->modules[$storyID];
|
||||
$prev['plan'] = $data->plans[$storyID];
|
||||
$prev['source'] = $data->sources[$storyID];
|
||||
@@ -544,6 +547,7 @@ class storyModel extends model
|
||||
$story->pri = $data->pris[$storyID];
|
||||
$story->assignedTo = $data->assignedTo[$storyID];
|
||||
$story->assignedDate = $oldStory == $data->assignedTo[$storyID] ? $oldStory->assignedDate : $now;
|
||||
$story->branch = isset($data->branches[$storyID]) ? $data->branches[$storyID] : 0;
|
||||
$story->module = $data->modules[$storyID];
|
||||
$story->plan = $data->plans[$storyID];
|
||||
$story->source = $data->sources[$storyID];
|
||||
|
||||
@@ -43,8 +43,8 @@ if($this->story->checkForceReview()) unset($visibleFields['review']);
|
||||
<th class='w-p15<?php echo zget($visibleFields, 'module', ' hidden')?>'><?php echo $lang->story->module;?></th>
|
||||
<th class='w-p15<?php echo zget($visibleFields, 'plan', ' hidden')?>'><?php echo $lang->story->plan;?></th>
|
||||
<th <?php if(count($visibleFields) >= 9) echo "class='w-150px'"?>><?php echo $lang->story->title;?> <span class='required'></span></th>
|
||||
<th class='w-80px<?php echo zget($visibleFields, 'source', ' hidden')?>'><?php echo $lang->story->source;?></th>
|
||||
<th class='w-p15<?php echo zget($visibleFields, 'spec', ' hidden')?>'><?php echo $lang->story->spec;?></th>
|
||||
<th class='w-80px<?php echo zget($visibleFields, 'source', ' hidden')?>'><?php echo $lang->story->source;?></th>
|
||||
<th class='w-p15<?php echo zget($visibleFields, 'verify', ' hidden')?>'><?php echo $lang->story->verify;?></th>
|
||||
<th class='w-80px<?php echo zget($visibleFields, 'pri', ' hidden')?>'><?php echo $lang->story->pri;?></th>
|
||||
<th class='w-80px<?php echo zget($visibleFields, 'estimate', ' hidden')?>'><?php echo $lang->story->estimate;?></th>
|
||||
@@ -66,12 +66,19 @@ if($this->story->checkForceReview()) unset($visibleFields['review']);
|
||||
<td class='text-left<?php echo zget($visibleFields, 'plan', ' hidden')?>' style='overflow:visible'><?php echo html::select("plan[$i]", $plans, $planID, "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->story->colorTag}' data-update-text='#title\\[{$i}\\]'");?>
|
||||
<?php echo html::input("title[$i]", $storyTitle, "class='form-control' autocomplete='off'") . html::hidden("uploadImage[$i]", $fileName);?>
|
||||
<?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->story->colorTag}' data-update-text='#title\\[{$i}\\]'");?>
|
||||
<?php echo html::input("title[$i]", $storyTitle, "class='form-control' autocomplete='off'") . html::hidden("uploadImage[$i]", $fileName);?>
|
||||
</div>
|
||||
</td>
|
||||
<td class='<?php echo zget($visibleFields, 'spec', 'hidden')?>'>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-btn'>
|
||||
<a href='javascript:copyTitle(<?php echo $i;?>)' class='btn' title='<?php echo $lang->story->copyTitle; ?>'><i class='icon-angle-right'></i></a>
|
||||
</span>
|
||||
<?php echo html::textarea("spec[$i]", $spec, "rows='1' class='form-control autosize'");?>
|
||||
</div>
|
||||
</td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'source', ' hidden')?>'><?php echo html::select("source[$i]", $sourceList, $source, "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'spec', 'hidden')?>'><?php echo html::textarea("spec[$i]", $spec, "rows='1' class='form-control autosize'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'verify', 'hidden')?>'><?php echo html::textarea("verify[$i]", '', "rows='1' class='form-control autosize'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'pri', ' hidden')?>' style='overflow:visible'><?php echo html::select("pri[$i]", $priList, $pri, "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'estimate', 'hidden')?>'><?php echo html::input("estimate[$i]", $estimate, "class='form-control' autocomplete='off'");?></td>
|
||||
@@ -95,12 +102,19 @@ if($this->story->checkForceReview()) unset($visibleFields['review']);
|
||||
<td class='text-left<?php echo zget($visibleFields, 'plan', ' hidden')?>' style='overflow:visible'><?php echo html::select("plan[$i]", $plans, $planID, "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->story->colorTag}' data-update-text='#title\\[{$i}\\]'");?>
|
||||
<?php echo html::input("title[$i]", $storyTitle, "class='form-control' autocomplete='off'");?>
|
||||
<?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->story->colorTag}' data-update-text='#title\\[{$i}\\]'");?>
|
||||
<?php echo html::input("title[$i]", $storyTitle, "class='form-control' autocomplete='off'");?>
|
||||
</div>
|
||||
</td>
|
||||
<td class='<?php echo zget($visibleFields, 'spec', 'hidden')?>'>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-btn'>
|
||||
<a href='javascript:copyTitle(<?php echo $i;?>)' class='btn' title='<?php echo $lang->story->copyTitle; ?>'><i class='icon-angle-right'></i></a>
|
||||
</span>
|
||||
<?php echo html::textarea("spec[$i]", $spec, "rows='1' class='form-control autosize'");?>
|
||||
</div>
|
||||
</td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'source', ' hidden')?>'><?php echo html::select("source[$i]", $sourceList, $source, "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'spec', 'hidden')?>'><?php echo html::textarea("spec[$i]", $spec, "rows='1' class='form-control autosize'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'verify', 'hidden')?>'><?php echo html::textarea("verify[$i]", '', "rows='1' class='form-control autosize'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'pri', ' hidden')?>' style='overflow:visible'><?php echo html::select("pri[$i]", $priList, $pri, "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'estimate', 'hidden')?>'><?php echo html::input("estimate[$i]", $estimate, "class='form-control' autocomplete='off'");?></td>
|
||||
@@ -124,8 +138,14 @@ if($this->story->checkForceReview()) unset($visibleFields['review']);
|
||||
<?php echo html::input("title[%s]", $storyTitle, "class='form-control' autocomplete='off'");?>
|
||||
</div>
|
||||
</td>
|
||||
<td class='<?php echo zget($visibleFields, 'spec', ' hidden')?>'>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-btn'>
|
||||
<a href='javascript:copyTitle(%s)' class='btn' title='<?php echo $lang->story->copyTitle; ?>'><i class='icon-angle-right'></i></a>
|
||||
</span>
|
||||
<?php echo html::textarea("spec[%s]", $spec, "rows='1' class='form-control autosize'");?>
|
||||
</div>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'source', ' hidden')?>'><?php echo html::select("source[%s]", $sourceList, $source, "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'spec', ' hidden')?>'><?php echo html::textarea("spec[%s]", $spec, "rows='1' class='form-control autosize'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'verify', ' hidden')?>'><?php echo html::textarea("verify[%s]", '', "rows='1' class='form-control autosize'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'pri', ' hidden')?>' style='overflow:visible'><?php echo html::select("pri[%s]", $priList, $pri, "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'estimate', ' hidden')?>'><?php echo html::input("estimate[%s]", $estimate, "class='form-control autocomplete='off''");?></td>
|
||||
|
||||
@@ -39,6 +39,9 @@ foreach(explode(',', $showFields) as $field)
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
<th class='w-40px'> <?php echo $lang->idAB;?></th>
|
||||
<?php if($branchProduct):?>
|
||||
<th class='w-150px<?php echo zget($visibleFields, 'branch', ' hidden')?>'><?php echo $lang->story->branch;?></th>
|
||||
<?php endif;?>
|
||||
<th class='w-150px<?php echo zget($visibleFields, 'module', ' hidden')?>'><?php echo $lang->story->module;?></th>
|
||||
<th class='w-150px<?php echo zget($visibleFields, 'plan', ' hidden')?>'><?php echo $lang->story->planAB;?></th>
|
||||
<th> <?php echo $lang->story->title;?> <span class='required'></span></th>
|
||||
@@ -60,7 +63,15 @@ foreach(explode(',', $showFields) as $field)
|
||||
if(!$productID)
|
||||
{
|
||||
$product = $this->product->getByID($stories[$storyID]->product);
|
||||
$modules = $this->tree->getOptionMenu($stories[$storyID]->product, $viewType = 'story', 0, $branch);
|
||||
|
||||
$branches = $product->type == 'normal' ? array('' => '') : $this->loadModel('branch')->getPairs($product->id);
|
||||
if($product->type != 'normal')
|
||||
{
|
||||
foreach($branches as $branchID => $branchName) $branches[$branchID] = '/' . $product->name . '/' . $branchName;
|
||||
$branches = array('ditto' => $this->lang->story->ditto) + $branches;
|
||||
}
|
||||
|
||||
$modules = $this->tree->getOptionMenu($stories[$storyID]->product, $viewType = 'story', 0, $stories[$storyID]->branch);
|
||||
foreach($modules as $moduleID => $moduleName) $modules[$moduleID] = '/' . $product->name . $moduleName;
|
||||
$modules = array('ditto' => $this->lang->story->ditto) + $modules;
|
||||
|
||||
@@ -70,6 +81,13 @@ foreach(explode(',', $showFields) as $field)
|
||||
?>
|
||||
<tr class='text-center'>
|
||||
<td><?php echo $storyID . html::hidden("storyIDList[$storyID]", $storyID);?></td>
|
||||
<?php if($branchProduct):?>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'branch', ' hidden')?>' style='overflow:visible'>
|
||||
<?php $branchProductID = $productID ? $productID : $product->id;?>
|
||||
<?php $disabled = (isset($product) and $product->type == 'normal') ? "disabled='disabled'" : '';?>
|
||||
<?php echo html::select("branches[$storyID]", $branches, $stories[$storyID]->branch, "class='form-control chosen' onchange='loadBranches($branchProductID, this.value, $storyID);' $disabled");?>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'> <?php echo html::select("modules[$storyID]", $modules, $stories[$storyID]->module, "class='form-control chosen'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'plan', ' hidden')?>' style='overflow:visible'> <?php echo html::select("plans[$storyID]", $productPlans, $stories[$storyID]->plan, "class='form-control chosen'");?></td>
|
||||
<td style='overflow:visible' title='<?php echo $stories[$storyID]->title?>'>
|
||||
|
||||
@@ -33,7 +33,7 @@ function loadProductModules(productID, branch)
|
||||
{
|
||||
if(typeof(branch) == 'undefined') branch = 0;
|
||||
if(!branch) branch = 0;
|
||||
moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&needManage=true');
|
||||
moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true');
|
||||
$('#moduleIdBox').load(moduleLink, function()
|
||||
{
|
||||
$('#moduleIdBox #module').chosen(defaultChosenOptions);
|
||||
@@ -45,7 +45,7 @@ function loadProductPlans(productID, branch)
|
||||
{
|
||||
if(typeof(branch) == 'undefined') branch = 0;
|
||||
if(!branch) branch = 0;
|
||||
planLink = createLink('product', 'ajaxGetPlans', 'productID=' + productID + '&branch=' + branch + '&planID=' + $('#plan').val() + '&needCreate=true');
|
||||
planLink = createLink('product', 'ajaxGetPlans', 'productID=' + productID + '&branch=' + branch + '&planID=' + $('#plan').val() + '&fieldID=&needCreate=true');
|
||||
$('#planIdBox').load(planLink, function(){$('#planIdBox #plan').chosen(defaultChosenOptions);});
|
||||
}
|
||||
|
||||
|
||||
@@ -850,6 +850,40 @@ class task extends control
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch cancel tasks.
|
||||
*
|
||||
* @param string $skipTaskIdList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchCancel()
|
||||
{
|
||||
if($this->post->taskIDList)
|
||||
{
|
||||
$taskIDList = $this->post->taskIDList;
|
||||
unset($_POST['taskIDList']);
|
||||
unset($_POST['assignedTo']);
|
||||
$this->loadModel('action');
|
||||
|
||||
$tasks = $this->task->getByList($taskIDList);
|
||||
foreach($tasks as $taskID => $task)
|
||||
{
|
||||
if($task->status == 'done' or $task->status == 'closed' or $task->status == 'cancel') continue;
|
||||
|
||||
$changes = $this->task->cancel($taskID);
|
||||
if($changes)
|
||||
{
|
||||
$actionID = $this->action->create('task', $taskID, 'Canceled', '');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->task->sendmail($taskID, $actionID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch close tasks.
|
||||
*
|
||||
|
||||
@@ -14,6 +14,8 @@ $lang->task->create = "Create";
|
||||
$lang->task->batchCreate = "Batch Create";
|
||||
$lang->task->batchEdit = "Batch Edit";
|
||||
$lang->task->batchChangeModule = "Batch Change Module";
|
||||
$lang->task->batchClose = "Batch Close";
|
||||
$lang->task->batchCancel = "Batch Cancel";
|
||||
$lang->task->edit = "Update";
|
||||
$lang->task->delete = "Delete";
|
||||
$lang->task->deleted = "Deleted";
|
||||
@@ -26,7 +28,6 @@ $lang->task->restart = "Continue";
|
||||
$lang->task->finish = "Finish";
|
||||
$lang->task->pause = "Pause";
|
||||
$lang->task->close = "Close";
|
||||
$lang->task->batchClose = "Batch Close";
|
||||
$lang->task->cancel = "Cancel";
|
||||
$lang->task->activate = "Activate";
|
||||
$lang->task->export = "Export Data";
|
||||
|
||||
@@ -14,6 +14,8 @@ $lang->task->create = "建任务";
|
||||
$lang->task->batchCreate = "批量添加";
|
||||
$lang->task->batchEdit = "批量编辑";
|
||||
$lang->task->batchChangeModule = "批量修改模块";
|
||||
$lang->task->batchClose = "批量关闭";
|
||||
$lang->task->batchCancel = "批量取消";
|
||||
$lang->task->edit = "编辑";
|
||||
$lang->task->delete = "删除";
|
||||
$lang->task->deleted = "已删除";
|
||||
@@ -26,7 +28,6 @@ $lang->task->restart = "继续";
|
||||
$lang->task->finish = "完成";
|
||||
$lang->task->pause = "暂停";
|
||||
$lang->task->close = "关闭";
|
||||
$lang->task->batchClose = "批量关闭";
|
||||
$lang->task->cancel = "取消";
|
||||
$lang->task->activate = "激活";
|
||||
$lang->task->export = "导出数据";
|
||||
|
||||
@@ -30,7 +30,7 @@ $config->testcase->customBatchEditFields = 'module,story,stage,precondition,st
|
||||
$config->testcase->custom = new stdclass();
|
||||
$config->testcase->custom->createFields = $config->testcase->customCreateFields;
|
||||
$config->testcase->custom->batchCreateFields = 'module,story';
|
||||
$config->testcase->custom->batchEditFields = 'module,stage,status,pri,story';
|
||||
$config->testcase->custom->batchEditFields = 'branch,module,stage,status,pri,story';
|
||||
|
||||
global $lang;
|
||||
$config->testcase->search['module'] = 'testcase';
|
||||
|
||||
+18
-11
@@ -646,6 +646,7 @@ class testcase extends control
|
||||
|
||||
/* Get the edited cases. */
|
||||
$cases = $this->testcase->getByList($caseIDList);
|
||||
$branchProduct = false;
|
||||
|
||||
/* The cases of a product. */
|
||||
if($productID)
|
||||
@@ -670,10 +671,13 @@ class testcase extends control
|
||||
$product = $this->product->getByID($productID);
|
||||
$this->testcase->setMenu($this->products, $productID, $branch);
|
||||
|
||||
if($product->type != 'normal') $branchProduct = true;
|
||||
|
||||
/* Set modules. */
|
||||
$modules = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch);
|
||||
$modules = array('ditto' => $this->lang->testcase->ditto) + $modules;
|
||||
|
||||
$this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id);
|
||||
$this->view->modules = $modules;
|
||||
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
$this->view->title = $product->name . $this->lang->colon . $this->lang->testcase->batchEdit;
|
||||
@@ -686,6 +690,7 @@ class testcase extends control
|
||||
$this->lang->set('menugroup.testcase', 'my');
|
||||
$this->lang->testcase->menuOrder = $this->lang->my->menuOrder;
|
||||
$this->loadModel('my')->setMenu();
|
||||
|
||||
$this->view->position[] = html::a($this->server->http_referer, $this->lang->my->testCase);
|
||||
$this->view->title = $this->lang->testcase->batchEdit;
|
||||
|
||||
@@ -694,13 +699,14 @@ class testcase extends control
|
||||
foreach($cases as $case) $productIdList[$case->product] = $case->product;
|
||||
|
||||
$products = $this->product->getByIdList($productIdList);
|
||||
$modules = array();
|
||||
foreach($products as $product)
|
||||
{
|
||||
$productModules = $this->tree->getOptionMenu($product->id, $viewType = 'case', $startModuleID = 0);
|
||||
foreach($productModules as $moduleID => $moduleName) $modules[$moduleID] = '/' . $product->name . $moduleName;
|
||||
if($product->type != 'normal')
|
||||
{
|
||||
$branchProduct = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->view->modules = array('ditto' => $this->lang->testcase->ditto) + $modules;
|
||||
}
|
||||
|
||||
if(!$this->config->testcase->needReview) unset($this->lang->testcase->statusList['wait']);
|
||||
@@ -719,13 +725,14 @@ class testcase extends control
|
||||
$this->view->showFields = $this->config->testcase->custom->batchEditFields;
|
||||
|
||||
/* Assign. */
|
||||
$this->view->position[] = $this->lang->testcase->common;
|
||||
$this->view->position[] = $this->lang->testcase->batchEdit;
|
||||
$this->view->caseIDList = $caseIDList;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->priList = array('ditto' => $this->lang->testcase->ditto) + $this->lang->testcase->priList;
|
||||
$this->view->typeList = array('' => '', 'ditto' => $this->lang->testcase->ditto) + $this->lang->testcase->typeList;
|
||||
$this->view->cases = $cases;
|
||||
$this->view->position[] = $this->lang->testcase->common;
|
||||
$this->view->position[] = $this->lang->testcase->batchEdit;
|
||||
$this->view->caseIDList = $caseIDList;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->branchProduct = $branchProduct;
|
||||
$this->view->priList = array('ditto' => $this->lang->testcase->ditto) + $this->lang->testcase->priList;
|
||||
$this->view->typeList = array('' => '', 'ditto' => $this->lang->testcase->ditto) + $this->lang->testcase->typeList;
|
||||
$this->view->cases = $cases;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -25,6 +25,15 @@ function setDuplicateAndChild(resolution, storyID)
|
||||
}
|
||||
}
|
||||
|
||||
function loadBranches(product, branch, caseID)
|
||||
{
|
||||
if(typeof(branch) == 'undefined') branch = 0;
|
||||
if(!branch) branch = 0;
|
||||
|
||||
moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + product + '&viewtype=case&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + caseID + '&needManage=true');
|
||||
$('#modules' + caseID).parent('td').load(moduleLink, function(){$('#modules' + caseID).chosen(defaultChosenOptions);})
|
||||
}
|
||||
|
||||
$(document).ready(removeDitto());//Remove 'ditto' in first row.
|
||||
|
||||
$(document).on('click', '.chosen-with-drop', function(){oldValue = $(this).prev('select').val();})//Save old value.
|
||||
|
||||
@@ -69,7 +69,7 @@ function loadProductModules(productID, branch)
|
||||
{
|
||||
if(typeof(branch) == 'undefined') branch = 0;
|
||||
if(!branch) branch = 0;
|
||||
link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=case&branch=' + branch + '&rootModuleID=0&returnType=html&needManage=true');
|
||||
link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=case&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true');
|
||||
$('#moduleIdBox').load(link, function()
|
||||
{
|
||||
$(this).find('select').chosen(defaultChosenOptions)
|
||||
@@ -78,6 +78,25 @@ function loadProductModules(productID, branch)
|
||||
setStories();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load module.
|
||||
*
|
||||
* @param int $libID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function loadLibModules(libID, branch)
|
||||
{
|
||||
if(typeof(branch) == 'undefined') branch = 0;
|
||||
if(!branch) branch = 0;
|
||||
link = createLink('tree', 'ajaxGetOptionMenu', 'rootID=' + libID + '&viewtype=caselib&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true');
|
||||
$('#moduleIdBox').load(link, function()
|
||||
{
|
||||
$(this).find('select').chosen(defaultChosenOptions)
|
||||
if(typeof(caseModule) == 'string') $('#moduleIdBox').prepend("<span class='input-group-addon'>" + caseModule + "</span>")
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Set story field.
|
||||
*
|
||||
|
||||
@@ -60,7 +60,7 @@ function loadLinkCases(caseID)
|
||||
*/
|
||||
function loadLibModules(libID)
|
||||
{
|
||||
link = createLink('tree', 'ajaxGetOptionMenu', 'libID=' + libID + '&viewtype=caselib&branch=0&rootModuleID=0&returnType=html&needManage=true');
|
||||
link = createLink('tree', 'ajaxGetOptionMenu', 'libID=' + libID + '&viewtype=caselib&branch=0&rootModuleID=0&returnType=html&fieldID=&needManage=true');
|
||||
$('#moduleIdBox').load(link, function()
|
||||
{
|
||||
$(this).find('select').chosen(defaultChosenOptions)
|
||||
|
||||
@@ -3,6 +3,21 @@ function reload(libID)
|
||||
link = createLink('testcase','importFromLib','productID='+ productID + '&branch=' + branch + '&libID='+libID);
|
||||
location.href = link;
|
||||
}
|
||||
|
||||
function setModule(moduleID, obj)
|
||||
{
|
||||
var index = $(obj).closest('tr').index() + 1;
|
||||
var $tr = $(obj).closest('tbody').find('tr');
|
||||
|
||||
while($tr.eq(index).length > 0)
|
||||
{
|
||||
$module = $tr.eq(index).find(obj).find("select[name*='module']");
|
||||
$module.val(moduleID);
|
||||
$module.trigger("chosen:updated");
|
||||
index ++;
|
||||
}
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
setTimeout(function(){fixedTfootAction('#importFromLib')}, 500);
|
||||
|
||||
@@ -717,12 +717,14 @@ class testcaseModel extends model
|
||||
/* Process data if the value is 'ditto'. */
|
||||
foreach($caseIDList as $caseID)
|
||||
{
|
||||
if($data->pris[$caseID] == 'ditto') $data->pris[$caseID] = isset($prev['pri']) ? $prev['pri'] : 3;
|
||||
if($data->modules[$caseID] == 'ditto') $data->modules[$caseID] = isset($prev['module']) ? $prev['module'] : 0;
|
||||
if($data->types[$caseID] == 'ditto') $data->types[$caseID] = isset($prev['type']) ? $prev['type'] : '';
|
||||
if($data->stories[$caseID] == '') $data->stories[$caseID] = 0;
|
||||
if($data->pris[$caseID] == 'ditto') $data->pris[$caseID] = isset($prev['pri']) ? $prev['pri'] : 3;
|
||||
if($data->branches[$caseID] == 'ditto') $data->branches[$caseID] = isset($prev['branch']) ? $prev['branch'] : 0;
|
||||
if($data->modules[$caseID] == 'ditto') $data->modules[$caseID] = isset($prev['module']) ? $prev['module'] : 0;
|
||||
if($data->types[$caseID] == 'ditto') $data->types[$caseID] = isset($prev['type']) ? $prev['type'] : '';
|
||||
if($data->stories[$caseID] == '') $data->stories[$caseID] = 0;
|
||||
|
||||
$prev['pri'] = $data->pris[$caseID];
|
||||
$prev['branch'] = $data->branches[$caseID];
|
||||
$prev['module'] = $data->modules[$caseID];
|
||||
$prev['type'] = $data->types[$caseID];
|
||||
}
|
||||
@@ -735,6 +737,7 @@ class testcaseModel extends model
|
||||
$case->lastEditedDate = $now;
|
||||
$case->pri = $data->pris[$caseID];
|
||||
$case->status = $data->statuses[$caseID];
|
||||
$case->branch = $data->branches[$caseID];
|
||||
$case->module = $data->modules[$caseID];
|
||||
$case->story = $data->stories[$caseID];
|
||||
$case->color = $data->colors[$caseID];
|
||||
|
||||
@@ -38,6 +38,9 @@ foreach(explode(',', $showFields) as $field)
|
||||
<th class='w-50px'><?php echo $lang->idAB;?></th>
|
||||
<th class='w-70px<?php echo zget($visibleFields, 'pri', ' hidden')?>'> <?php echo $lang->priAB;?></th>
|
||||
<th class='w-100px<?php echo zget($visibleFields, 'status', ' hidden')?>'><?php echo $lang->statusAB;?></th>
|
||||
<?php if($branchProduct):?>
|
||||
<th class='w-150px<?php echo zget($visibleFields, 'branch', ' hidden')?>'><?php echo $lang->testcase->branch;?></th>
|
||||
<?php endif;?>
|
||||
<th class='w-150px<?php echo zget($visibleFields, 'module', ' hidden')?>'><?php echo $lang->testcase->module;?></th>
|
||||
<th class='w-150px<?php echo zget($visibleFields, 'story', ' hidden')?>'><?php echo $lang->testcase->story;?></th>
|
||||
<th><?php echo $lang->testcase->title;?></th>
|
||||
@@ -49,10 +52,34 @@ foreach(explode(',', $showFields) as $field)
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($caseIDList as $caseID):?>
|
||||
<?php
|
||||
if(!isset($cases[$caseID])) continue;
|
||||
if(!$productID and $branchProduct)
|
||||
{
|
||||
$product = $this->product->getByID($cases[$caseID]->product);
|
||||
|
||||
$branches = $product->type == 'normal' ? array('' => '') : $this->loadModel('branch')->getPairs($product->id);
|
||||
if($product->type != 'normal')
|
||||
{
|
||||
foreach($branches as $branchID => $branchName) $branches[$branchID] = '/' . $product->name . '/' . $branchName;
|
||||
$branches = array('ditto' => $this->lang->story->ditto) + $branches;
|
||||
}
|
||||
|
||||
$modules = $this->tree->getOptionMenu($cases[$caseID]->product, $viewType = 'case', 0, $cases[$caseID]->branch);
|
||||
$modules = array('ditto' => $this->lang->story->ditto) + $modules;
|
||||
}
|
||||
?>
|
||||
<tr class='text-center'>
|
||||
<td><?php echo $caseID . html::hidden("caseIDList[$caseID]", $caseID);?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'pri', 'hidden')?>'> <?php echo html::select("pris[$caseID]", $priList, $cases[$caseID]->pri, 'class=form-control');?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'status', 'hidden')?>'><?php echo html::select("statuses[$caseID]", (array)$lang->testcase->statusList, $cases[$caseID]->status, 'class=form-control');?></td>
|
||||
<?php if($branchProduct):?>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'branch', ' hidden')?>' style='overflow:visible'>
|
||||
<?php $branchProductID = $productID ? $productID : $product->id;?>
|
||||
<?php $disabled = (isset($product) and $product->type == 'normal') ? "disabled='disabled'" : '';?>
|
||||
<?php echo html::select("branches[$caseID]", $branches, $cases[$caseID]->branch, "class='form-control chosen' onchange='loadBranches($branchProductID, this.value, $caseID)', $disabled");?>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("modules[$caseID]", $modules, $cases[$caseID]->module, "class='form-control chosen'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'story', ' hidden')?>' style='overflow:visible'><?php echo html::select("stories[$caseID]", $stories, $cases[$caseID]->story, "class='form-control chosen'");?></td>
|
||||
<td style='overflow:visible' title='<?php echo $cases[$caseID]->title?>'>
|
||||
@@ -69,7 +96,7 @@ foreach(explode(',', $showFields) as $field)
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr><td colspan='<?php echo count($visibleFields) + 3;?>' class='text-center'><?php echo html::submitButton();?></td></tr>
|
||||
<tr><td colspan='<?php echo $branchProduct ? (count($visibleFields) + 3) : (count($visibleFields) + 2);?>' class='text-center'><?php echo html::submitButton();?></td></tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
@@ -145,6 +145,24 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->testcase->module;?></th>
|
||||
<td>
|
||||
<div class='input-group' id='moduleIdBox'>
|
||||
<?php
|
||||
echo html::select('module', $moduleOptionMenu, $currentModuleID, "onchange='loadModuleRelated()' class='form-control chosen'");
|
||||
if(count($moduleOptionMenu) == 1)
|
||||
{
|
||||
echo "<span class='input-group-addon'>";
|
||||
echo html::a($this->createLink('tree', 'browse', "rootID=$libID&view=caselib¤tModuleID=0&branch=$case->branch"), $lang->tree->manage, '_blank');
|
||||
echo ' ';
|
||||
echo html::a("javascript:loadLibModules($libID)", $lang->refresh);
|
||||
echo '</span>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php else:?>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->testcase->product;?></th>
|
||||
@@ -155,7 +173,6 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->testcase->module;?></th>
|
||||
<td>
|
||||
@@ -174,6 +191,7 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php if(!$isLibCase):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->testcase->story;?></th>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<td><span class='<?php echo 'pri' . zget($lang->testcase->priList, $case->pri, $case->pri)?>'><?php echo $case->pri == '0' ? '' : zget($lang->testcase->priList, $case->pri, $case->pri);?></span></td>
|
||||
<td class='text-left nobr'><?php if(!common::printLink('testcase', 'view', "caseID=$case->id", $case->title)) echo $case->title;?></td>
|
||||
<td class='text-left'><?php echo zget($libModules, $case->module, '');?></th>
|
||||
<td class='text-left' style='overflow:visible'><?php echo html::select("module[{$case->id}]", $modules, 0, "class='from-control chosen'");?></th>
|
||||
<td class='text-left module-<?php echo $case->module?>' style='overflow:visible'><?php echo html::select("module[{$case->id}]", $modules, 0, "class='from-control chosen' onchange='setModule(this.value, \".module-{$case->module}\")'");?></th>
|
||||
<td><?php echo zget($lang->testcase->typeList, $case->type);?></th>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<tr>
|
||||
<td><?php echo $bug->id . html::hidden('bugs[]', $bug->id)?></td>
|
||||
<td><span class='pri<?php echo $bug->pri?>'><?php echo zget($lang->bug->priList, $bug->pri);?></span></td>
|
||||
<td class='text-left' title='<?php echo $bug->title?>'><?php echo $bug->title?></td>
|
||||
<td class='text-left' title='<?php echo $bug->title?>'><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id", '', true), $bug->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");?></td>
|
||||
<td><?php echo zget($users, $bug->openedBy);?></td>
|
||||
<td><?php echo zget($users, $bug->resolvedBy);?></td>
|
||||
<td><?php if($bug->resolvedDate != '0000-00-00 00:00:00') echo substr($bug->resolvedDate, 2);?></td>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<?php foreach($builds as $build):?>
|
||||
<tr>
|
||||
<td><?php echo $build->id . html::hidden('builds[]', $build->id)?></td>
|
||||
<td class='text-left' title='<?php echo $build->name?>'><?php echo $build->name?></td>
|
||||
<td class='text-left' title='<?php echo $build->name?>'><?php echo html::a($this->createLink('build', 'view', "buildID=$build->id", '', true), $build->name, '', "data-toggle='modal' data-type='iframe' data-width='90%'");?></td>
|
||||
<td><?php echo zget($users, $build->builder);?></td>
|
||||
<td><?php echo $build->date;?></td>
|
||||
</tr>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<tr>
|
||||
<td><?php echo $case->id . html::hidden('cases[]', $case->id)?></td>
|
||||
<td><span class='pri<?php echo $case->pri?>'><?php echo zget($lang->testcase->priList, $case->pri);?></span></td>
|
||||
<td class='text-left' title='<?php echo $case->title?>'><?php echo $case->title?></td>
|
||||
<td class='text-left' title='<?php echo $case->title?>'><?php echo html::a($this->createLink('testcase', 'view', "caseID=$case->id", '', true), $case->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");?></td>
|
||||
<td><?php echo zget($lang->testcase->typeList, $case->type);?></td>
|
||||
<td><?php echo zget($users, $case->assignedTo);?></td>
|
||||
<td><?php echo zget($users, $case->lastRunner);?></td>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<tr>
|
||||
<td><?php echo $bug->id?></td>
|
||||
<td><span class='pri<?php echo $bug->pri?>'><?php echo zget($lang->bug->priList, $bug->pri);?></span></td>
|
||||
<td class='text-left' title='<?php echo $bug->title?>'><?php echo $bug->title?></td>
|
||||
<td class='text-left' title='<?php echo $bug->title?>'><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id", '', true), $bug->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");?></td>
|
||||
<td><?php echo zget($users, $bug->openedBy);?></td>
|
||||
<td><?php echo zget($users, $bug->resolvedBy);?></td>
|
||||
<td><?php if($bug->resolvedDate != '0000-00-00 00:00:00') echo substr($bug->resolvedDate, 2);?></td>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<tr>
|
||||
<td><?php echo $story->id . html::hidden('stories[]', $story->id)?></td>
|
||||
<td><span class='pri<?php echo $story->pri?>'><?php echo zget($lang->story->priList, $story->pri);?></span></td>
|
||||
<td class='text-left' title='<?php echo $story->title?>'><?php echo $story->title?></td>
|
||||
<td class='text-left' title='<?php echo $story->title?>'><?php echo html::a($this->createLink('story', 'view', "storyID=$story->id", '', true), $story->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");?></td>
|
||||
<td><?php echo zget($users, $story->openedBy);?></td>
|
||||
<td><?php echo zget($users, $story->assignedTo);?></td>
|
||||
<td><?php echo $story->estimate?></td>
|
||||
|
||||
@@ -88,6 +88,10 @@
|
||||
<th><?php echo $lang->files?></th>
|
||||
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td><?php echo html::submitButton() . html::backButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
@@ -111,7 +115,6 @@
|
||||
<legend><?php echo $lang->testreport->legendReport?></legend>
|
||||
<?php include './blockbugreport.html.php'?>
|
||||
</fieldset>
|
||||
<div><?php echo html::submitButton() . html::backButton();?></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -76,6 +76,10 @@
|
||||
<th><?php echo $lang->files?></th>
|
||||
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td><?php echo html::submitButton() . html::backButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
@@ -99,7 +103,6 @@
|
||||
<legend><?php echo $lang->testreport->legendReport?></legend>
|
||||
<?php include './blockbugreport.html.php'?>
|
||||
</fieldset>
|
||||
<div><?php echo html::submitButton() . html::backButton();?></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
<?php
|
||||
$config->testsuite = new stdclass();
|
||||
$config->testsuite->create = new stdclass();
|
||||
$config->testsuite->edit = new stdclass();
|
||||
$config->testsuite->create->requiredFields = 'name';
|
||||
$config->testsuite->edit->requiredFields = 'name';
|
||||
$config->testsuite->create = new stdclass();
|
||||
$config->testsuite->edit = new stdclass();
|
||||
$config->testsuite->createlib = new stdclass();
|
||||
$config->testsuite->createcase = new stdclass();
|
||||
$config->testsuite->create->requiredFields = 'name';
|
||||
$config->testsuite->edit->requiredFields = 'name';
|
||||
$config->testsuite->createlib->requiredFields = 'name';
|
||||
$config->testsuite->createcase->requiredFields = 'title,type';
|
||||
|
||||
$config->testsuite->editor = new stdclass();
|
||||
$config->testsuite->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
|
||||
@@ -141,6 +141,7 @@ class testsuite extends control
|
||||
$this->view->cases = $this->testsuite->getLinkedCases($suiteID, $sort, $pager);
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->modules = $this->loadModel('tree')->getOptionMenu($suite->product, 'case');
|
||||
$this->view->branches = $this->loadModel('branch')->getPairs($suite->product, 'noempty');
|
||||
|
||||
$this->display();
|
||||
|
||||
@@ -2,7 +2,7 @@ var newRowID = 0;
|
||||
|
||||
function loadLibModules(libID)
|
||||
{
|
||||
link = createLink('tree', 'ajaxGetOptionMenu', 'libID=' + libID + '&viewtype=caselib&branch=0&rootModuleID=0&returnType=html&needManage=true');
|
||||
link = createLink('tree', 'ajaxGetOptionMenu', 'libID=' + libID + '&viewtype=caselib&branch=0&rootModuleID=0&returnType=html&fieldID=&needManage=true');
|
||||
$('#moduleIdBox').load(link, function()
|
||||
{
|
||||
$(this).find('select').chosen(defaultChosenOptions)
|
||||
|
||||
@@ -335,6 +335,7 @@ class testsuiteModel extends model
|
||||
$lib = $this->loadModel('file')->processEditor($lib, $this->config->testsuite->editor->create['id'], $this->post->uid);
|
||||
$this->dao->insert(TABLE_TESTSUITE)->data($lib)
|
||||
->batchcheck($this->config->testsuite->createlib->requiredFields, 'notempty')
|
||||
->check('name', 'unique', "deleted = '0'")
|
||||
->exec();
|
||||
if(!dao::isError())
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<?php
|
||||
foreach($libraries as $libID => $libName)
|
||||
{
|
||||
echo "<li data-id='{$libID}' data-key='{$librariesPinyin[$libName]}'>" . html::a(sprintf($link, $libID), "<i class='icon-cube'></i> " . $libName). "</li>";
|
||||
echo "<li data-id='{$libID}' data-key='{$librariesPinyin[$libName]}'>" . html::a(sprintf($link, $libID), "<i class='icon-database'></i> " . $libName). "</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
||||
@@ -64,13 +64,15 @@
|
||||
<tr class='colhead'>
|
||||
<th class='w-id {sorter: false}'><nobr><?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></nobr></th>
|
||||
<th class='w-pri {sorter: false}'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
|
||||
<th class='w-150px {sorter: false}'> <?php common::printOrderLink('module', $orderBy, $vars, $lang->testcase->module);?></th>
|
||||
<th class='{sorter: false}'> <?php common::printOrderLink('title', $orderBy, $vars, $lang->testcase->title);?></th>
|
||||
<th class='w-type {sorter: false}'> <?php common::printOrderLink('type', $orderBy, $vars, $lang->testcase->type);?></th>
|
||||
<th class='w-status {sorter: false}'> <?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
|
||||
<th class='w-80px {sorter:false}'> <?php common::printOrderLink('lastRunResult', $orderBy, $vars, $lang->testcase->lastRunResult);?></th>
|
||||
<th class='w-30px' title='<?php echo $lang->testcase->bugs?>'> <?php echo $lang->testcase->bugsAB;?></th>
|
||||
<th class='w-30px' title='<?php echo $lang->testcase->results?>'> <?php echo $lang->testcase->resultsAB;?></th>
|
||||
<th class='w-30px' title='<?php echo $lang->testcase->stepNumber?>'> <?php echo $lang->testcase->stepNumberAB;?></th>
|
||||
<th class='w-50px {sorter: false}'><?php echo $lang->actions;?></th>
|
||||
<th class='w-100px {sorter: false}'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
@@ -89,12 +91,14 @@
|
||||
<?php printf('%03d', $case->id);?>
|
||||
</td>
|
||||
<td><span class='<?php echo 'pri' . zget($lang->testcase->priList, $case->pri, $case->pri)?>'><?php echo zget($lang->testcase->priList, $case->pri, $case->pri)?></span></td>
|
||||
<td class='text-left' title='<?php echo $modules[$case->module]?>'><?php echo $modules[$case->module];?></td>
|
||||
<td class='text-left nobr'>
|
||||
<?php if($case->branch) echo "<span class='label label-info label-badge'>{$branches[$case->branch]}</span>"?>
|
||||
<?php echo html::a($this->createLink('testcase', 'view', "caseID=$case->id&version=$case->caseVersion"), $case->title);?>
|
||||
</td>
|
||||
<td><?php echo $lang->testcase->typeList[$case->type];?></td>
|
||||
<td class='<?php echo $case->status;?>'><?php echo ($case->version < $case->caseVersion) ? "<span class='warning'>{$lang->testcase->changed}</span>" : $lang->testcase->statusList[$case->status];?></td>
|
||||
<td class='<?php echo $case->lastRunResult;?>'><?php if($case->lastRunResult) echo $lang->testcase->resultList[$case->lastRunResult];?></td>
|
||||
<td><?php echo (common::hasPriv('testcase', 'bugs') and $case->bugs) ? html::a($this->createLink('testcase', 'bugs', "runID=0&caseID={$case->id}"), $case->bugs, '', "class='iframe'") : $case->bugs;?></td>
|
||||
<td><?php echo (common::hasPriv('testtask', 'results') and $case->results) ? html::a($this->createLink('testtask', 'results', "runID=0&caseID={$case->id}"), $case->results, '', "class='iframe'") : $case->results;?></td>
|
||||
<td><?php echo $case->stepNumber;?></td>
|
||||
@@ -105,6 +109,8 @@
|
||||
$unlinkURL = $this->createLink('testsuite', 'unlinkCase', "suiteID=$suite->id&caseID=$case->id&confirm=yes");
|
||||
echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"caseList\",confirmUnlink)", '<i class="icon-unlink"></i>', '', "title='{$lang->testsuite->unlinkCase}' class='btn-icon'");
|
||||
}
|
||||
common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", '', 'list', 'play', '', 'runCase iframe', false, "data-width='95%'");
|
||||
common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", '', 'list', 'list-alt', '', 'results iframe', false, "data-width='95%'");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -113,7 +119,7 @@
|
||||
<?php endif;?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan='9' style='padding-left:5px;'>
|
||||
<td colspan='11' style='padding-left:5px;'>
|
||||
<?php if($cases):?>
|
||||
<div class='table-actions clearfix'>
|
||||
<?php if($hasCheckbox) echo html::selectButton();?>
|
||||
@@ -129,6 +135,10 @@
|
||||
$actionLink = $this->createLink('testsuite', 'batchUnlinkCases', "suiteID=$suite->id");
|
||||
$misc = common::hasPriv('testsuite', 'batchUnlinkCases') ? "onclick=\"setFormAction('$actionLink')\"" : "class='disabled'";
|
||||
echo "<li>" . html::a('javascript:;', $lang->testsuite->unlinkCase, '', $misc) . "</li>";
|
||||
|
||||
$actionLink = $this->createLink('testtask', 'batchRun', "productID=$productID&orderBy=$orderBy");
|
||||
$misc = common::hasPriv('testtask', 'batchRun') ? "onclick=\"setFormAction('$actionLink')\"" : $class;
|
||||
echo "<li>" . html::a('#', $lang->testtask->runCase, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
<th class='w-id'> <?php echo $lang->idAB;?></th>
|
||||
<th class='w-pri'> <?php echo $lang->priAB;?></th>
|
||||
<th class='w-100px'><?php echo $lang->testcase->module;?></th>
|
||||
<th width='300'> <?php echo $lang->testcase->title;?></th>
|
||||
<th width='200'> <?php echo $lang->testcase->title;?></th>
|
||||
<th width='200'> <?php echo $lang->testcase->precondition;?></th>
|
||||
<th width='180'> <?php echo $lang->testcase->result?></th>
|
||||
<th> <?php echo $lang->testcase->stepDesc . '/' . $lang->testcase->stepExpect?></th>
|
||||
</tr>
|
||||
@@ -38,6 +39,7 @@
|
||||
<td><?php echo $lang->testcase->priList[$cases[$caseID]->pri]?></td>
|
||||
<td class='text-left'><?php echo "<span title='" . $moduleOptionMenu[$cases[$caseID]->module] . "'>" . $moduleOptionMenu[$cases[$caseID]->module] . "</span>"?></td>
|
||||
<td class='text-left'><?php echo "<span title='{$cases[$caseID]->title}'>{$cases[$caseID]->title}</span>"?></td>
|
||||
<td class='text-left'><?php echo "<span title='{$cases[$caseID]->precondition}'>{$cases[$caseID]->precondition}</span>"?></td>
|
||||
<td><?php echo html::radio("results[$caseID]", $this->lang->testcase->resultList, 'pass', "onclick='showAction(this.value,\".action$caseID\")'")?></td>
|
||||
<td>
|
||||
<?php if(!empty($steps[$caseID])):?>
|
||||
@@ -70,7 +72,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<tr><td colspan='6' class='text-center'><?php echo html::submitButton();?></td></tr>
|
||||
<tr><td colspan='7' class='text-center'><?php echo html::submitButton();?></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<script type='text/javascript'>
|
||||
@@ -79,18 +81,24 @@ function showAction(value, obj)
|
||||
if(value == 'pass')
|
||||
{
|
||||
$(obj).addClass('hidden');
|
||||
$(obj).closest('tbody').children('tr').each(function(){
|
||||
var $td = $(this).children('td:first');
|
||||
if($td.attr('colspan') != undefined) $td.attr('colspan', 2);
|
||||
});
|
||||
if($(obj).parent().prop('tagName') == 'TR')
|
||||
{
|
||||
$(obj).closest('tbody').children('tr').each(function(){
|
||||
var $td = $(this).children('td:first');
|
||||
if($td.attr('colspan') != undefined) $td.attr('colspan', 2);
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$(obj).removeClass('hidden');
|
||||
$(obj).closest('tbody').children('tr').each(function(){
|
||||
var $td = $(this).children('td:first');
|
||||
if($td.attr('colspan') != undefined) $td.attr('colspan', 4);
|
||||
});
|
||||
if($(obj).parent().prop('tagName') == 'TR')
|
||||
{
|
||||
$(obj).closest('tbody').children('tr').each(function(){
|
||||
var $td = $(this).children('td:first');
|
||||
if($td.attr('colspan') != undefined) $td.attr('colspan', 4);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -312,7 +312,7 @@ class tree extends control
|
||||
* @access public
|
||||
* @return string the html select string.
|
||||
*/
|
||||
public function ajaxGetOptionMenu($rootID, $viewType = 'story', $branch = 0, $rootModuleID = 0, $returnType = 'html', $needManage = false)
|
||||
public function ajaxGetOptionMenu($rootID, $viewType = 'story', $branch = 0, $rootModuleID = 0, $returnType = 'html', $fieldID = '', $needManage = false)
|
||||
{
|
||||
if($viewType == 'task')
|
||||
{
|
||||
@@ -326,7 +326,8 @@ class tree extends control
|
||||
{
|
||||
$changeFunc = '';
|
||||
if($viewType == 'task' or $viewType == 'bug' or $viewType == 'case') $changeFunc = "onchange='loadModuleRelated()'";
|
||||
$output = html::select("module", $optionMenu, '', "class='form-control' $changeFunc");
|
||||
$field = $fieldID ? "modules[$fieldID]" : 'module';
|
||||
$output = html::select("$field", $optionMenu, '', "class='form-control' $changeFunc");
|
||||
if(count($optionMenu) == 1 and $needManage)
|
||||
{
|
||||
$output .= "<span class='input-group-addon'>";
|
||||
@@ -341,7 +342,8 @@ class tree extends control
|
||||
{
|
||||
$changeFunc = '';
|
||||
if($viewType == 'task' or $viewType == 'bug' or $viewType == 'case') $changeFunc = "onchange='loadModuleRelated()'";
|
||||
$output = html::select("module", $optionMenu, '', "class='input' $changeFunc");
|
||||
$field = $fieldID ? "modules[$fieldID]" : 'module';
|
||||
$output = html::select("$field", $optionMenu, '', "class='input' $changeFunc");
|
||||
die($output);
|
||||
}
|
||||
if($returnType == 'json') die(json_encode($optionMenu));
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
.outer .row .col-md-8 .table-form {max-width: 600px}
|
||||
|
||||
#sonModule {max-width: 400px}
|
||||
#sonModule, #moduleBox > span > input, #moduleBox > table{max-width: 500px}
|
||||
#sonModule .row-table .input-group input {border-right: none}
|
||||
#moduleBox span > .form-control {margin-bottom: 5px;}
|
||||
|
||||
|
||||
@@ -58,18 +58,6 @@ function toggleCopy()
|
||||
$copy.toggle();
|
||||
}
|
||||
|
||||
function addItem(obj)
|
||||
{
|
||||
var $inputgroup = $(obj).closest('.row-table');
|
||||
$inputgroup.after($inputgroup.clone()).next('.row-table').find('input').val('');
|
||||
}
|
||||
|
||||
function deleteItem(obj)
|
||||
{
|
||||
if($(obj).closest('.row-table').parent().find('i.icon-remove').size() <= 1) return;
|
||||
$(obj).closest('.row-table').remove();
|
||||
}
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
toggleCopy();
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
function addItem(obj)
|
||||
{
|
||||
var $inputgroup = $(obj).closest('.row-table');
|
||||
$inputgroup.after($inputgroup.clone()).next('.row-table').find('input').val('');
|
||||
}
|
||||
|
||||
function insertItem(obj)
|
||||
{
|
||||
var $inputgroup = $(obj).closest('.row-table');
|
||||
var insertHtml = $('#insertItemBox').children('.row-table').clone();
|
||||
$inputgroup.after(insertHtml).next('.row-table').find('input').val('');
|
||||
|
||||
updateItemOrder();
|
||||
}
|
||||
|
||||
function updateItemOrder()
|
||||
{
|
||||
var order = 10;
|
||||
$('#sonModule').children('.row-table').each(function(){
|
||||
if($(this).find("input[name*='order']").length > 0)
|
||||
{
|
||||
console.log(order);
|
||||
$(this).find("input[name*='order']").val(order);
|
||||
order += 10;
|
||||
}
|
||||
});
|
||||
|
||||
$('#maxOrder').val(order - 10);
|
||||
}
|
||||
|
||||
function deleteItem(obj)
|
||||
{
|
||||
console.log($(obj).closest('.row-table').siblings('.row-table').find('i.icon-remove').size());
|
||||
if($(obj).closest('.row-table').siblings('.row-table.addedItem').find('i.icon-remove').size() <= 0) return;
|
||||
$(obj).closest('.row-table').remove();
|
||||
}
|
||||
+26
-5
@@ -312,13 +312,23 @@ class treeModel extends model
|
||||
*/
|
||||
public function getTreeMenu($rootID, $type = 'root', $startModule = 0, $userFunc, $extra = '', $branch = 0)
|
||||
{
|
||||
$branches = array($branch => '');
|
||||
if($branch)
|
||||
{
|
||||
$branchName = $this->loadModel('branch')->getById($branch);
|
||||
$branches = array($branch => $branchName);
|
||||
}
|
||||
else
|
||||
{
|
||||
$branches = array($branch => '');
|
||||
}
|
||||
|
||||
$manage = $userFunc[1] == 'createManageLink' ? true : false;
|
||||
$product = $this->loadModel('product')->getById($rootID);
|
||||
if(strpos('story|bug|case', $type) !== false and empty($branch))
|
||||
{
|
||||
if($product->type != 'normal') $branches = array('null' => '') + $this->loadModel('branch')->getPairs($rootID, 'noempty');
|
||||
if($product->type != 'normal') $branches = $this->loadModel('branch')->getPairs($rootID, 'noempty');
|
||||
}
|
||||
$branches = array('null' => '') + $branches;
|
||||
|
||||
/* Add for task #1945. check the module has case or no. */
|
||||
if($type == 'case' and !empty($extra)) $this->loadModel('testtask');
|
||||
@@ -1155,6 +1165,7 @@ class treeModel extends model
|
||||
|
||||
$data = fixer::input('post')->get();
|
||||
$branches = isset($data->branch) ? $data->branch : array();
|
||||
$orders = isset($data->order) ? $data->order : array();
|
||||
$shorts = $data->shorts;
|
||||
if($parentModule)
|
||||
{
|
||||
@@ -1174,6 +1185,16 @@ class treeModel extends model
|
||||
/* The new modules. */
|
||||
if(is_numeric($moduleID))
|
||||
{
|
||||
if(isset($orders[$moduleID]) and !empty($orders[$moduleID]))
|
||||
{
|
||||
$order = $orders[$moduleID];
|
||||
}
|
||||
else
|
||||
{
|
||||
$order = $this->post->maxOrder + $i * 10;
|
||||
$i ++;
|
||||
}
|
||||
|
||||
$module = new stdClass();
|
||||
$module->root = $rootID;
|
||||
$module->name = strip_tags(trim($moduleName));
|
||||
@@ -1182,18 +1203,18 @@ class treeModel extends model
|
||||
$module->short = $shorts[$moduleID];
|
||||
$module->grade = $grade;
|
||||
$module->type = $type;
|
||||
$module->order = $this->post->maxOrder + $i * 10;
|
||||
$module->order = $order;
|
||||
$this->dao->insert(TABLE_MODULE)->data($module)->exec();
|
||||
$moduleID = $this->dao->lastInsertID();
|
||||
$childPath = $parentPath . "$moduleID,";
|
||||
$this->dao->update(TABLE_MODULE)->set('path')->eq($childPath)->where('id')->eq($moduleID)->limit(1)->exec();
|
||||
$i ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$short = $shorts[$moduleID];
|
||||
$order = $orders[$moduleID];
|
||||
$moduleID = str_replace('id', '', $moduleID);
|
||||
$this->dao->update(TABLE_MODULE)->set('name')->eq(strip_tags(trim($moduleName)))->set('short')->eq($short)->where('id')->eq($moduleID)->limit(1)->exec();
|
||||
$this->dao->update(TABLE_MODULE)->set('name')->eq(strip_tags(trim($moduleName)))->set('short')->eq($short)->set('order')->eq($order)->where('id')->eq($moduleID)->limit(1)->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,22 +72,34 @@
|
||||
echo "<div class='row-table' style='margin-bottom:5px'>";
|
||||
echo "<div class='col-table'>" . html::input("modules[id$sonModule->id]", $sonModule->name, 'class="form-control" autocomplete="off"' . $disabled) . '</div>';
|
||||
if($hasBranch) echo "<div class='col-table'>" . html::select("branch[id$sonModule->id]", $branches, $sonModule->branch, 'class="form-control" disabled') . '</div>';
|
||||
echo "<div class='col-table' style='width:70px'>" . html::input("shorts[id$sonModule->id]", $sonModule->short, "class='form-control' placeholder='{$lang->tree->short}' $disabled autocomplete='off'") . '</div>';
|
||||
echo "<div class='col-table' style='width:120px'><div class='input-group'>" . html::input("shorts[id$sonModule->id]", $sonModule->short, "class='form-control' placeholder='{$lang->tree->short}' $disabled autocomplete='off'") . html::hidden("order[id$sonModule->id]", $sonModule->order);
|
||||
echo "<span class='input-group-btn' style='border-left:1px solid'><a href='javascript:;' onclick='insertItem(this)' class='btn btn-block'><i class='icon icon-plus'></i></a></span>";
|
||||
echo '</div></div>';
|
||||
echo '</div>';
|
||||
}
|
||||
for($i = 0; $i < TREE::NEW_CHILD_COUNT ; $i ++)
|
||||
{
|
||||
echo "<div class='row-table' style='margin-bottom:5px'>";
|
||||
echo "<div class='row-table addedItem' style='margin-bottom:5px'>";
|
||||
echo "<div class='col-table'>" . html::input("modules[]", '', "class='form-control' placeholder='{$lang->tree->name}' autocomplete='off'") . '</div>';
|
||||
if($hasBranch) echo '<div class="col-table">' . html::select("branch[]", $branches, $branch, 'class="form-control"') . '</div>';
|
||||
echo "<div class='col-table' style='width:120px'><div class='input-group'>" . html::input("shorts[]", '', "class='form-control' placeholder='{$lang->tree->short}' autocomplete='off'");
|
||||
echo "<span class='input-group-btn'><a href='javascript:;' onclick='addItem(this)' class='btn btn-block'><i class='icon-plus'></i></a></span>";
|
||||
echo "<span class='input-group-btn'><a href='javascript:;' onclick='deleteItem(this)' class='btn btn-block'><i class='icon-remove'></i></a></span>";
|
||||
echo "<span class='input-group-btn'><a href='javascript:;' onclick='addItem(this)' class='btn btn-block'><i class='icon icon-plus'></i></a></span>";
|
||||
echo "<span class='input-group-btn'><a href='javascript:;' onclick='deleteItem(this)' class='btn btn-block'><i class='icon icon-remove'></i></a></span>";
|
||||
echo '</div></div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo "<div id='insertItemBox' class='hidden'>";
|
||||
echo "<div class='row-table' style='margin-bottom:5px'>";
|
||||
echo "<div class='col-table'>" . html::input("modules[]", '', "class='form-control' placeholder='{$lang->tree->name}' autocomplete='off'") . '</div>';
|
||||
if($hasBranch) echo '<div class="col-table">' . html::select("branch[]", $branches, $branch, 'class="form-control" disabled') . '</div>';
|
||||
echo "<div class='col-table' style='width:120px'><div class='input-group'>" . html::input("shorts[]", '', "class='form-control' placeholder='{$lang->tree->short}' autocomplete='off'") . html::hidden("order[]");
|
||||
echo "<span class='input-group-btn' style='border-left:1px solid'><a href='javascript:;' onclick='deleteItem(this)' class='btn btn-block'><i class='icon icon-remove'></i></a></span>";
|
||||
echo '</div></div>';
|
||||
echo '</div></div>';
|
||||
|
||||
echo '</div>';
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -57,22 +57,39 @@
|
||||
echo '<span>' . html::input("products[id$product->id]", $product->name, 'class=form-control disabled="true" autocomplete="off"') . '</span>';
|
||||
}
|
||||
}
|
||||
echo '<div id="sonModule">';
|
||||
foreach($sons as $sonModule)
|
||||
{
|
||||
if($sonModule->order > $maxOrder) $maxOrder = $sonModule->order;
|
||||
$disabled = $sonModule->type == 'task' ? '' : 'disabled';
|
||||
echo "<div class='row-table' style='margin-bottom:5px;'>";
|
||||
echo "<div class='col-table'>" . html::input("modules[id$sonModule->id]", $sonModule->name, "class='form-control' autocomplete='off' placeholder='{$lang->tree->name}' " . $disabled) . '</div>';
|
||||
echo "<div class='col-table' style='width:70px'>" . html::input("shorts[id$sonModule->id]", $sonModule->short, "class='form-control' autocomplete='off' placeholder='{$lang->tree->short}' " . $disabled) . '</div>';
|
||||
echo "<div class='col-table' style='width:120px'><div class='input-group'>" . html::input("shorts[id$sonModule->id]", $sonModule->short, "class='form-control' autocomplete='off' placeholder='{$lang->tree->short}' " . $disabled) . html::hidden("order[id$sonModule->id]", $sonModule->order);
|
||||
echo "<span class='input-group-btn' style='border-left:1px solid'><a href='javascript:;' onclick='insertItem(this)' class='btn btn-block'><i class='icon icon-plus'></i></a></span>";
|
||||
echo "</div></div>";
|
||||
echo "</div>";
|
||||
}
|
||||
for($i = 0; $i < TREE::NEW_CHILD_COUNT ; $i ++)
|
||||
{
|
||||
echo "<div class='row-table' style='margin-bottom:5px;'>";
|
||||
echo "<div class='row-table addedItem' style='margin-bottom:5px;'>";
|
||||
echo "<div class='col-table'>" . html::input("modules[]", '', "class='form-control' autocomplete='off' placeholder='{$lang->tree->name}'") . '</div>';
|
||||
echo "<div class='col-table' style='width:70px'>" . html::input("shorts[]", '', "class='form-control' autocomplete='off' placeholder='{$lang->tree->short}'") . '</div>';
|
||||
echo "<div class='col-table' style='width:120px'><div class='input-group'>" . html::input("shorts[]", '', "class='form-control' autocomplete='off' placeholder='{$lang->tree->short}'");
|
||||
echo "<span class='input-group-btn'><a href='javascript:;' onclick='addItem(this)' class='btn btn-block'><i class='icon icon-plus'></i></a></span>";
|
||||
echo "<span class='input-group-btn'><a href='javascript:;' onclick='deleteItem(this)' class='btn btn-block'><i class='icon icon-remove'></i></a></span>";
|
||||
echo '</div></div>';
|
||||
echo html::hidden('branch[]', empty($module) ? 0 : $module->branch) . '</div>';
|
||||
}
|
||||
|
||||
echo "<div id='insertItemBox' class='hidden'>";
|
||||
echo "<div class='row-table' style='margin-bottom:5px;'>";
|
||||
echo "<div class='col-table'>" . html::input("modules[]", '', "class='form-control' autocomplete='off' placeholder='{$lang->tree->name}'") . '</div>';
|
||||
echo "<div class='col-table' style='width:120px'><div class='input-group'>" . html::input("shorts[]", '', "class='form-control' autocomplete='off' placeholder='{$lang->tree->short}'") . html::hidden("order[]");
|
||||
echo "<span class='input-group-btn' style='border-left:1px solid'><a href='javascript:;' onclick='deleteItem(this)' class='btn btn-block'><i class='icon icon-remove'></i></a></span>";
|
||||
echo '</div></div>';
|
||||
echo html::hidden('branch[]', empty($module) ? 0 : $module->branch) . '</div>';
|
||||
echo '</div>';
|
||||
|
||||
echo '</div>';
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -106,9 +106,9 @@ hr.small {margin: 10px 0}
|
||||
.tablesorter thead tr .header {cursor:pointer;}
|
||||
.tablesorter thead tr .header a,.tablesorter thead tr .headerSortUp a,.tablesorter thead tr .headerSortDown a{display: block; text-decoration:none}
|
||||
.tablesorter thead tr .header a {color:#333;}
|
||||
.tablesorter thead tr .header > a:after {font-family: NewZenIcon; font-weight: normal;content: " \e6bd";font-size: 14px;}
|
||||
.tablesorter thead tr .headerSortUp > a:after {font-family: NewZenIcon; font-weight: normal;content: " \e6b9";font-size: 14px;color:#03C;}
|
||||
.tablesorter thead tr .headerSortDown > a:after{font-family: NewZenIcon; font-weight: normal;content: " \e6b8";font-size: 14px;color:#03C;}
|
||||
.tablesorter thead tr .header > a:after {font-family: NewZenIcon; font-weight: normal;content: "\e6bd";font-size: 14px; margin-left: -2px;}
|
||||
.tablesorter thead tr .headerSortUp > a:after {font-family: NewZenIcon; font-weight: normal;content: "\e6b9";font-size: 14px;color:#03C; margin-left: -2px;}
|
||||
.tablesorter thead tr .headerSortDown > a:after{font-family: NewZenIcon; font-weight: normal;content: "\e6b8";font-size: 14px;color:#03C; margin-left: -2px;}
|
||||
.tablesorter-header-inner {display: inline;}
|
||||
.tablesorter thead tr .header.sorter-false:after {display: none}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user