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

This commit is contained in:
wangyidong
2017-07-20 14:30:58 +08:00
18 changed files with 112 additions and 91 deletions
+1
View File
@@ -711,6 +711,7 @@ class actionModel extends model
{
list($objectLabel, $moduleName, $methodName, $vars) = explode('|', $action->objectLabel);
$action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID));
if($action->objectType == 'user') $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->actor));
$action->objectLabel = $objectLabel;
}
else
+2 -2
View File
@@ -914,8 +914,8 @@ class bug extends control
*/
public function batchResolve($resolution, $resolvedBuild = '')
{
$bugIDList = $this->post->bugIDList ? $this->post->bugIDList : die(js::locate($this->session->bugList, 'parent'));
$this->bug->batchResolve($bugIDList, $resolution, $resolvedBuild);
$bugIDList = $this->post->bugIDList ? $this->post->bugIDList : die(js::locate($this->session->bugList, 'parent'));
$bugIDList = $this->bug->batchResolve($bugIDList, $resolution, $resolvedBuild);
if(dao::isError()) die(js::error(dao::getError()));
foreach($bugIDList as $bugID)
{
+8 -1
View File
@@ -701,6 +701,7 @@ class bugModel extends model
->setDefault('confirmed', 1)
->setDefault('lastEditedBy', $this->app->user->account)
->setDefault('lastEditedDate', $now)
->setDefault('assignedDate', $now)
->remove('comment')
->join('mailto', ',')
->get();
@@ -853,7 +854,11 @@ class bugModel extends model
foreach($bugIDList as $i => $bugID)
{
$oldBug = $bugs[$bugID];
if($oldBug->resolution == 'fixed' and $oldBug->resolvedBuild != $resolvedBuild) unset($bugIDList[$i]);
if($oldBug->resolution == 'fixed')
{
unset($bugIDList[$i]);
continue;
}
if($oldBug->status != 'active') continue;
$assignedTo = $oldBug->openedBy;
@@ -890,6 +895,8 @@ class bugModel extends model
/* Link bug to build and release. */
$this->linkBugToBuild($bugIDList, $resolvedBuild);
return $bugIDList;
}
/**
+1 -1
View File
@@ -231,7 +231,7 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate);
</div>
</div>
</div>
<?php echo html::textarea('steps', $steps, "rows='12' class='form-control'");?>
<?php echo html::textarea('steps', $steps, "rows='10' class='form-control'");?>
</td>
</tr>
<?php
+1 -1
View File
@@ -39,7 +39,7 @@
</td>
<td></td>
<?php else:?>
<td colspan='2'><?php if(empty($products)) printf($lang->build->noProduct, $this->createLink('project', 'manageproducts', "projectID=$projectID"));?></td>
<td colspan='2'><?php if(empty($products)) printf($lang->build->noProduct, $this->createLink('project', 'manageproducts', "module=build&method=create&projectID=$projectID"));?></td>
<?php endif;?>
</tr>
<tr>
+1
View File
@@ -59,6 +59,7 @@ function initKindeditor(afterInit)
{
cssPath:[themeRoot + 'zui/css/min.css'],
width:'100%',
height:'200px',
items:editorTool,
filterMode: true,
bodyClass:'article-content',
+2 -2
View File
@@ -212,8 +212,8 @@ class productplan extends control
*/
public function view($planID = 0, $type = 'story', $orderBy = 'id_desc', $link = 'false', $param = '')
{
if($type == 'story')$this->session->set('storyList', $this->app->getURI(true));
if($type == 'bug') $this->session->set('bugList', $this->app->getURI(true));
$this->session->set('storyList', $this->app->getURI(true) . '&type=' . 'story');
$this->session->set('bugList', $this->app->getURI(true) . '&type=' . 'bug');
/* Append id for secend sort. */
$sort = $this->loadModel('common')->appendOrder($orderBy);
+1 -1
View File
@@ -55,7 +55,7 @@ include '../../common/view/tablesorter.html.php';
</tbody>
<tfoot>
<tr>
<td colspan='9' class='text-left'>
<td colspan='10' class='text-left'>
<?php if(count($allStories))
{
echo "<div class='table-actions clearfix'>";
+1 -1
View File
@@ -132,7 +132,7 @@
$actionLink = inlink('batchUnlinkStory', "planID=$plan->id&orderBy=$orderBy");
?>
<div class='btn-group dropup'>
<?php echo html::commonButton($lang->productplan->unlinkStory, ($canBatchUnlink ? '' : 'disabled') . "onclick=\"setFormAction('$actionLink', '', this)\"");?>
<?php echo html::commonButton($lang->productplan->unlinkStory, ($canBatchUnlink ? '' : 'disabled') . "onclick=\"setFormAction('$actionLink', 'hiddenwin', this)\"");?>
<button type='button' class='btn dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>
<ul class='dropdown-menu'>
<?php
+4 -3
View File
@@ -1430,12 +1430,12 @@ class project extends control
* @access public
* @return void
*/
public function manageProducts($projectID)
public function manageProducts($module,$method,$projectID)
{
/* use first project if projectID does not exist. */
if(!isset($this->projects[$projectID])) $projectID = key($this->projects);
$browseProjectLink = $this->createLink('project', 'browse', "projectID=$projectID");
$browseProjectLink = $this->createLink($module, $method, "projectID=$projectID");
if(!empty($_POST))
{
$this->project->updateProducts($projectID);
@@ -1625,7 +1625,8 @@ class project extends control
if(empty($products))
{
echo js::alert($this->lang->project->errorNoLinkedProducts);
die(js::locate($this->createLink('project', 'manageproducts', "projectID=$projectID")));
die(js::locate($this->createLink('project', 'manageproducts', "module=project&method=browse&projectID=$projectID")));
}
if(!empty($_POST))
+6
View File
@@ -6,3 +6,9 @@
.tabs .tab-content .tab-pane #querybox form{padding-left:0px;}
.table-actions {padding-left: 5px;}
#releaseInfo {border-top: 1px solid #ddd;}
#releaseInfo > div {padding-top: 15px;}
#querybox form {margin: 0px !important;}
#moreOrLite {right: 0px !important;}
+1 -1
View File
@@ -24,7 +24,7 @@ $formID = $type == 'leftBug' ? 'unlinkedLeftBugsForm' : 'unlinkedBugsForm';
<th class='w-id {sorter:"currency"}'><?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->bug->title;?></th>
<th class='w-user'> <?php echo $lang->openedByAB;?></th>
<th class='w-user text-left'> <?php echo $lang->openedByAB;?></th>
<th class='w-user'> <?php echo $lang->bug->resolvedBy;?></th>
<th class='w-80px'> <?php echo $lang->statusAB;?></th>
</tr>
+6 -6
View File
@@ -20,11 +20,11 @@
<th class='w-id {sorter:"currency"}'><?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->story->title;?></th>
<th class='w-user'> <?php echo $lang->openedByAB;?></th>
<th class='w-user'> <?php echo $lang->assignedToAB;?></th>
<th class='w-30px'> <?php echo $lang->story->estimateAB;?></th>
<th class='w-status'><?php echo $lang->statusAB;?></th>
<th class='w-60px'> <?php echo $lang->story->stageAB;?></th>
<th class='w-user text-left'> <?php echo $lang->openedByAB;?></th>
<th class='w-user text-left'> <?php echo $lang->assignedToAB;?></th>
<th class='w-50px text-left'> <?php echo $lang->story->estimateAB;?></th>
<th class='w-status text-left'><?php echo $lang->statusAB;?></th>
<th class='w-80px text-center'> <?php echo $lang->story->stageAB;?></th>
</tr>
</thead>
<tbody>
@@ -42,7 +42,7 @@
<td><?php echo $users[$story->assignedTo];?></td>
<td><?php echo $story->estimate;?></td>
<td class='story-<?php echo $story->status?>'><?php echo $lang->story->statusList[$story->status];?></td>
<td><?php echo $lang->story->stageList[$story->stage];?></td>
<td class='text-center'><?php echo $lang->story->stageList[$story->stage];?></td>
</tr>
<?php endforeach;?>
</tbody>
+64 -61
View File
@@ -69,6 +69,7 @@
<li <?php if($type == 'bug') echo "class='active'"?>><a href='#bugs' data-toggle='tab'><?php echo html::icon($lang->icons['bug'], 'green') . ' ' . $lang->release->bugs;?></a></li>
<li <?php if($type == 'leftBug') echo "class='active'"?>><a href='#leftBugs' data-toggle='tab'><?php echo html::icon($lang->icons['bug'], 'red') . ' ' . $lang->release->generatedBugs;?></a></li>
<?php endif;?>
<li <?php if($type == 'releaseInfo') echo "class='active'"?>><a href='#releaseInfo' data-toggle='tab'><?php echo html::icon($lang->icons['plan'], 'blue') . ' ' . $lang->release->view;?></a></li>
<?php if($countStories or ($this->config->global->flow != 'onlyStory' and ($countBugs or $countLeftBugs))):?>
<li class='pull-right'><div><?php common::printIcon('release', 'export', '', '', 'button', '', '', "export btn-sm");?></div></li>
<?php endif;?>
@@ -251,71 +252,73 @@
</table>
</form>
</div>
<div class='tab-pane <?php if($type == 'releaseInfo') echo 'active'?>' id='releaseInfo'>
<div>
<fieldset>
<legend><?php echo $lang->release->desc;?></legend>
<div class='article-content'><?php echo $release->desc;?></div>
</fieldset>
<fieldset>
<legend><?php echo $lang->release->basicInfo?></legend>
<table class='table table-data table-condensed table-borderless table-fixed'>
<tr>
<th class='w-80px'><?php echo $lang->release->product;?></th>
<td><?php echo $release->productName;?></td>
</tr>
<?php if($release->productType != 'normal'):?>
<tr>
<th><?php echo $lang->product->branch;?></th>
<td><?php echo $branchName;?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->release->name;?></th>
<td><?php echo $release->name;?></td>
</tr>
<tr>
<th><?php echo $lang->release->build;?></th>
<td title='<?php echo $release->buildName?>'>
<?php echo ($release->project) ? html::a($this->createLink('build', 'view', "buildID=$release->buildID"), $release->buildName, '_blank') : $release->buildName;?>
</td>
</tr>
<tr>
<th><?php echo $lang->release->status;?></th>
<td><?php echo $lang->release->statusList[$release->status];?></td>
</tr>
<tr>
<th><?php echo $lang->release->date;?></th>
<td><?php echo $release->date;?></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->files?></legend>
<div class='article-content'>
<?php
if($release->files)
{
echo $this->fetch('file', 'printFiles', array('files' => $release->files, 'fieldset' => 'false'));
}
elseif($release->filePath)
{
echo $lang->release->filePath . html::a($release->filePath, $release->filePath, '_blank');
}
elseif($release->scmPath)
{
echo $lang->release->scmPath . html::a($release->scmPath, $release->scmPath, '_blank');
}
?>
</div>
</fieldset>
<?php include '../../common/view/action.html.php';?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class='col-side'>
<div class='main-side main'>
<fieldset>
<legend><?php echo $lang->release->desc;?></legend>
<div class='article-content'><?php echo $release->desc;?></div>
</fieldset>
<fieldset>
<legend><?php echo $lang->release->basicInfo?></legend>
<table class='table table-data table-condensed table-borderless table-fixed'>
<tr>
<th class='w-80px'><?php echo $lang->release->product;?></th>
<td><?php echo $release->productName;?></td>
</tr>
<?php if($release->productType != 'normal'):?>
<tr>
<th><?php echo $lang->product->branch;?></th>
<td><?php echo $branchName;?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->release->name;?></th>
<td><?php echo $release->name;?></td>
</tr>
<tr>
<th><?php echo $lang->release->build;?></th>
<td title='<?php echo $release->buildName?>'>
<?php echo ($release->project) ? html::a($this->createLink('build', 'view', "buildID=$release->buildID"), $release->buildName, '_blank') : $release->buildName;?>
</td>
</tr>
<tr>
<th><?php echo $lang->release->status;?></th>
<td><?php echo $lang->release->statusList[$release->status];?></td>
</tr>
<tr>
<th><?php echo $lang->release->date;?></th>
<td><?php echo $release->date;?></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->files?></legend>
<div class='article-content'>
<?php
if($release->files)
{
echo $this->fetch('file', 'printFiles', array('files' => $release->files, 'fieldset' => 'false'));
}
elseif($release->filePath)
{
echo $lang->release->filePath . html::a($release->filePath, $release->filePath, '_blank');
}
elseif($release->scmPath)
{
echo $lang->release->scmPath . html::a($release->scmPath, $release->scmPath, '_blank');
}
?>
</div>
</fieldset>
<?php include '../../common/view/action.html.php';?>
</div>
</div>
</div>
<style>
.tabs .tab-content .tab-pane .action{position: absolute; right: <?php echo ($countStories or $countBugs or $countLeftBugs) ? '110px' : '-1px'?>; top: 0px;}
+12 -2
View File
@@ -522,7 +522,7 @@ class taskModel extends model
$estimate = fixer::input('post')
->setDefault('account', $this->app->user->account)
->setDefault('task', $taskID)
->setDefault('date', date(DT_DATE1))
->setDefault('date', $task->realStarted)
->remove('realStarted,comment')->get();
$estimate->consumed = $estimate->consumed - $oldTask->consumed;
$this->addTaskEstimate($estimate);
@@ -549,8 +549,18 @@ class taskModel extends model
$estimates = array();
$task = $this->getById($taskID);
$oldStatus = $task->status;
$earliestTime = '';
foreach(array_keys($record->id) as $id)
{
if($earliestTime == '')
{
$earliestTime = $record->dates[$id];
}
elseif(!empty($record->dates[$id]) && (strtotime($earliestTime) > strtotime($record->dates[$id])))
{
$earliestTime = $record->dates[$id];
}
if($record->dates[$id])
{
if(!$record->consumed[$id]) die(js::alert($this->lang->task->error->consumedThisTime));
@@ -609,7 +619,7 @@ class taskModel extends model
$data->status = $task->status;
$data->assignedTo = $this->app->user->account;
$data->assignedDate = $now;
$data->realStarted = date('Y-m-d');
$data->realStarted = $earliestTime;
}
else if($task->status == 'pause')
{
-1
View File
@@ -43,7 +43,6 @@
<td></td>
<td colspan='2'>
<?php echo html::submitButton();?>
<?php echo html::linkButton($lang->goback, $app->session->caseList ? $app->session->caseList : inlink('view', "caseID=$case->id"));?>
</td>
</tr>
</table>
-7
View File
@@ -21,13 +21,6 @@
</div>
<div class='actions'>
<?php
if(common::hasPriv('testreport', 'browse'))
{
$param = '';
if($objectType == 'project') $param = "objectID=$objectID&objectType=$objectType";
if($objectType == 'testtask') $param = "objectID=$productIdList&objectType=product&extra=$objectID";
echo html::a(inlink('browse', $param), $lang->testreport->all, '', "class='btn'");
}
echo html::backButton();
?>
</div>
+1 -1
View File
@@ -578,7 +578,7 @@ body {color:#141414; padding-bottom: 40px;}
.outer .table.table-data.table-borderless tbody > tr:last-child td, .outer .table.table-form tbody > tr:last-child td {border: none}
.outer .table tfoot td {border-top: 1px solid #ddd}
.outer .table tfoot .form-control {padding: 1px 8px; height: 30px}
.outer .table tfoot .btn {padding: 2px 6px; font-size: 13px; line-height: 20px; }
.outer .table tfoot .btn {padding: 2px 6px; font-size: 13px; line-height: 20px; border: none; }
.outer .table tfoot .btn:not(.btn-primary) {background-color: #FAFAFA; color: #036}
.outer .table tfoot .btn > i {display: inline-block; margin-right: 1px; opacity: 0.8}
.outer .table tfoot .datepicker-wrapper:before {top: 5px}