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

This commit is contained in:
wangyidong
2016-11-23 16:01:59 +08:00
9 changed files with 52 additions and 19 deletions
+14 -2
View File
@@ -395,14 +395,26 @@ class bug extends control
}
/* Set custom. */
foreach(explode(',', $this->config->bug->list->customBatchCreateFields) as $field) $customFields[$field] = $this->lang->bug->$field;
$product = $this->product->getById($productID);
foreach(explode(',', $this->config->bug->list->customBatchCreateFields) as $field)
{
if($product->type != 'normal') $customFields[$product->type] = $this->lang->product->branchName[$product->type];
$customFields[$field] = $this->lang->bug->$field;
}
$showFields = $this->config->bug->custom->batchCreateFields;
if($product->type == 'normal')
{
$showFields = str_replace(array(0 => ",branch,", 1 => ",platform,"), '', ",$showFields,");
$showFields = trim($showFields, ',');
}
$this->view->customFields = $customFields;
$this->view->showFields = $this->config->bug->custom->batchCreateFields;
$this->view->showFields = $showFields;
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->batchCreate;
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
$this->view->position[] = $this->lang->bug->batchCreate;
$this->view->product = $product;
$this->view->productID = $productID;
$this->view->stories = $stories;
$this->view->builds = $builds;
+2 -2
View File
@@ -87,7 +87,7 @@ class bugModel extends model
$data = fixer::input('post')->get();
$batchNum = count(reset($data));
$result = $this->loadModel('common')->removeDuplicate('bug', $data, "product={$productID} and branch={$branch}");
$result = $this->loadModel('common')->removeDuplicate('bug', $data, "product={$productID}");
$data = $result['data'];
for($i = 0; $i < $batchNum; $i++)
@@ -132,7 +132,7 @@ class bugModel extends model
$bug->openedBy = $this->app->user->account;
$bug->openedDate = $now;
$bug->product = $productID;
$bug->branch = $branch;
$bug->branch = $data->branches[$i];
$bug->module = $data->modules[$i];
$bug->project = $data->projects[$i];
$bug->openedBuild = implode(',', $data->openedBuilds[$i]);
+4
View File
@@ -38,6 +38,7 @@ foreach(explode(',', $showFields) as $field)
<thead>
<tr>
<th class='w-50px'> <?php echo $lang->idAB;?></th>
<th class='w-120px<?php echo zget($visibleFields, $product->type, ' hidden')?>'> <?php echo $lang->product->branch;?></th>
<th class='w-120px<?php echo zget($visibleFields, 'module', ' hidden')?>'> <?php echo $lang->bug->module;?></th>
<th class='w-130px<?php echo zget($visibleFields, 'project', ' hidden')?>'><?php echo $lang->bug->project;?></th>
<th><?php echo $lang->bug->openedBuild;?> <span class='required'></span></th>
@@ -78,6 +79,7 @@ foreach(explode(',', $showFields) as $field)
?>
<tr class='text-center'>
<td><?php echo $i+1;?></td>
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo html::select("branches[$i]", $branches, $branch, "class='form-control'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("modules[$i]", $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'project', ' hidden')?>' style='overflow:visible'><?php echo html::select("projects[$i]", $projects, $projectID, "class='form-control chosen' onchange='loadProjectBuilds($productID, this.value, $i)'");?></td>
<td class='text-left' style='overflow:visible' id='buildBox<?php echo $i;?>'><?php echo html::select("openedBuilds[$i][]", $builds, 'trunk', "class='form-control chosen' multiple");?></td>
@@ -110,6 +112,7 @@ foreach(explode(',', $showFields) as $field)
?>
<tr class='text-center'>
<td><?php echo $i+1;?></td>
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo html::select("branches[$i]", $branches, $branch, "class='form-control'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("modules[$i]", $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'project', ' hidden')?>' style='overflow:visible'><?php echo html::select("projects[$i]", $projects, $projectID, "class='form-control chosen' onchange='loadProjectBuilds($productID, this.value, $i)'");?></td>
<td class='text-left' style='overflow:visible' id='buildBox<?php echo $i;?>'><?php echo html::select("openedBuilds[$i][]", $builds, '', "class='form-control chosen' multiple");?></td>
@@ -138,6 +141,7 @@ foreach(explode(',', $showFields) as $field)
<tbody>
<tr class='text-center'>
<td>%s</td>
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo html::select("branches[%s]", $branches, $branch, "class='form-control'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("modules[%s]", $moduleOptionMenu, $moduleID, "class='form-control'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'project', ' hidden')?>' style='overflow:visible'><?php echo html::select("projects[%s]", $projects, $projectID, "class='form-control' onchange='loadProjectBuilds($productID, this.value, \"%s\")'");?></td>
<td class='text-left' style='overflow:visible' id='buildBox%s'><?php echo html::select("openedBuilds[%s][]", $builds, '', "class='form-control' multiple");?></td>
+1 -3
View File
@@ -1,12 +1,10 @@
<?php if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>
<style>
tbody.sortable > tr {position: relative; z-index: 5}
tbody.sortable > tr.drag-shadow {display: none}
tbody.sortable > tr > td.sort-handler {cursor: move; color: #999;}
tbody.sortable > tr > td.sort-handler > i {position: relative; top: 2px}
tbody.sortable-sorting > tr {transition: all .2s;}
tbody.sortable-sorting > tr {transition: all .2s; position: relative; z-index: 5; opacity: .3;}
tbody.sortable-sorting {cursor: move;}
tbody.sortable-sorting > tr {opacity: .3;}
tbody.sortable-sorting > tr.drag-row {opacity: 1; z-index: 10; box-shadow: 0 2px 4px red}
tbody.sortable-sorting > tr.drag-row + tr > td {box-shadow: inset 0 4px 2px rgba(0,0,0,.2)}
tbody.sortable-sorting > tr.drag-row > td {background-color: #edf3fe!important}
+14 -2
View File
@@ -380,14 +380,26 @@ class testcase extends control
$moduleOptionMenu['ditto'] = $this->lang->testcase->ditto;
/* Set custom. */
foreach(explode(',', $this->config->testcase->customBatchCreateFields) as $field) $customFields[$field] = $this->lang->testcase->$field;
$product = $this->product->getById($productID);
foreach(explode(',', $this->config->testcase->customBatchCreateFields) as $field)
{
if($product->type != 'normal') $customFields[$product->type] = $this->lang->product->branchName[$product->type];
$customFields[$field] = $this->lang->testcase->$field;
}
$showFields = $this->config->testcase->custom->batchCreateFields;
if($product->type == 'normal')
{
str_replace(array(0 => ",branch,", 1 => ",platform,"), '', $showFields);
trim($showFields, ',');
}
$this->view->customFields = $customFields;
$this->view->showFields = $this->config->testcase->custom->batchCreateFields;
$this->view->showFields = $showFields;
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->batchCreate;
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
$this->view->position[] = $this->lang->testcase->common;
$this->view->position[] = $this->lang->testcase->batchCreate;
$this->view->product = $product;
$this->view->productID = $productID;
$this->view->story = $story;
$this->view->storyList = $storyList;
+2 -2
View File
@@ -93,7 +93,7 @@ class testcaseModel extends model
$cases = fixer::input('post')->get();
$batchNum = count(reset($cases));
$result = $this->loadModel('common')->removeDuplicate('case', $cases, "product={$productID} and branch={$branch}");
$result = $this->loadModel('common')->removeDuplicate('case', $cases, "product={$productID}");
$cases = $result['data'];
for($i = 0; $i < $batchNum; $i++)
@@ -125,7 +125,7 @@ class testcaseModel extends model
{
$data[$i] = new stdclass();
$data[$i]->product = $productID;
$data[$i]->branch = $branch;
$data[$i]->branch = $cases->branch[$i];
$data[$i]->module = $cases->module[$i];
$data[$i]->type = $cases->type[$i];
$data[$i]->pri = $cases->pri[$i];
@@ -43,6 +43,7 @@ foreach(explode(',', $showFields) as $field)
<thead>
<tr>
<th class='w-50px'><?php echo $lang->idAB;?></th>
<th class='w-120px<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo $lang->product->branch;?></th>
<th class='w-180px<?php echo zget($visibleFields, 'module', ' hidden')?>'><?php echo $lang->testcase->module;?></th>
<th class='w-180px<?php echo zget($visibleFields, 'story', ' hidden')?>'> <?php echo $lang->testcase->story;?></th>
<th><?php echo $lang->testcase->title;?> <span class='required'></span></th>
@@ -65,6 +66,7 @@ foreach(explode(',', $showFields) as $field)
?>
<tr class='text-center'>
<td><?php echo $i+1;?></td>
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo html::select("branch[$i]", $branches, $branch, "class='form-control'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("module[$i]", $moduleOptionMenu, $currentModuleID, "class='form-control chosen'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'story', ' hidden')?>' style='overflow:visible'> <?php echo html::select("story[$i]", $storyList, $story ? $story->id : '', 'class="form-control chosen"');?></td>
<td style='overflow:visible'>
@@ -89,6 +91,7 @@ foreach(explode(',', $showFields) as $field)
<tbody>
<tr class='text-center'>
<td>%s</td>
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo html::select("branch[%s]", $branches, $branch, "class='form-control'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("module[%s]", $moduleOptionMenu, $currentModuleID, "class='form-control'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'story', ' hidden')?>' style='overflow:visible'> <?php echo html::select("story[%s]", '', '', 'class="form-control"');?></td>
<td style='overflow:visible'>