* finish task #2878.

This commit is contained in:
wangyidong
2014-11-03 05:51:43 +00:00
parent 2db0df11e3
commit 7c96bd88ee
14 changed files with 305 additions and 38 deletions
+40 -4
View File
@@ -16,7 +16,10 @@
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['bug']);?></span>
<strong><small class='text-muted'><?php echo html::icon($lang->icons['batchCreate']);?></small> <?php echo $lang->bug->common . $lang->colon . $lang->bug->batchCreate;?></strong>
<div class='actions'><?php echo html::commonButton($lang->pasteText, "data-toggle='myModal'")?></div>
<div class='actions'>
<?php if(common::hasPriv('file', 'uploadImages')) echo html::a($this->createLink('file', 'uploadImages', 'module=bug&params=' . helper::safe64Encode("productID=$productID&projectID=$projectID&moduleID=$moduleID")), $lang->uploadImages, '', "data-toggle='modal' data-type='iframe' class='btn' data-width='600px'")?>
<?php echo html::commonButton($lang->pasteText, "data-toggle='myModal'")?>
</div>
</div>
</div>
@@ -44,14 +47,47 @@
$lang->bug->osList += array('ditto' => $lang->bug->ditto);
$lang->bug->browserList += array('ditto' => $lang->bug->ditto);
?>
<?php for($i = 0; $i < $config->bug->batchCreate; $i++):?>
<?php $i = 0; ?>
<?php if(!empty($titles)):?>
<?php foreach($titles as $fileName => $bugTitle):?>
<?php
$moduleID = $i == 0 ? 0 : 'ditto';
$projectID = $i == 0 ? 0 : 'ditto';
$moduleID = $i == 0 ? $moduleID : 'ditto';
$projectID = $i == 0 ? $projectID : 'ditto';
$type = $i == 0 ? '' : 'ditto';
$os = $i == 0 ? '' : 'ditto';
$browser = $i == 0 ? '' : 'ditto';
?>
<tr class='text-center'>
<td><?php echo $i+1;?></td>
<td class='text-left' style='overflow:visible'><?php echo html::select("modules[$i]", $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></td>
<td class='text-left' 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>
<td><?php echo html::input("title[$i]", $bugTitle, 'class=form-control');?></td>
<td>
<?php echo html::textarea("stepses[$i]", '', "rows='1' class='form-control'");?>
</td>
<td><?php echo html::select("types[$i]", $lang->bug->typeList, $type, "class='form-control'");?></td>
<td><?php echo html::select("severities[$i]", $lang->bug->severityList, '', "class='form-control'");?></td>
<td><?php echo html::select("oses[$i]", $lang->bug->osList, $os, "class='form-control'");?></td>
<td>
<?php
echo html::select("browsers[$i]", $lang->bug->browserList, $browser, "class='form-control'");
echo html::hidden("uploadImage[$i]", $fileName);
?>
</td>
</tr>
<?php $i++;?>
<?php endforeach;?>
<?php endif;?>
<?php $nextStart = $i;?>
<?php for($i = $nextStart; $i < $config->bug->batchCreate; $i++):?>
<?php
$moduleID = $i - $nextStart == 0 ? $moduleID : 'ditto';
$projectID = $i - $nextStart == 0 ? $projectID : 'ditto';
$type = $i - $nextStart == 0 ? '' : 'ditto';
$os = $i - $nextStart == 0 ? '' : 'ditto';
$browser = $i - $nextStart == 0 ? '' : 'ditto';
?>
<tr class='text-center'>
<td><?php echo $i+1;?></td>
<td class='text-left' style='overflow:visible'><?php echo html::select("modules[$i]", $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></td>