This commit is contained in:
hufangzhou
2020-09-24 15:58:10 +08:00
27 changed files with 272 additions and 195 deletions
+1 -1
View File
@@ -731,7 +731,7 @@ CREATE TABLE `zt_project` (
KEY `status` (`status`),
KEY `acl` (`acl`),
KEY `order` (`order`)
) ENGINE=MyISAM AUTO_INCREMENT=25 DEFAULT CHARSET=utf8
) ENGINE=MyISAM AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_projectspec`;
CREATE TABLE `zt_projectspec` (
`project` mediumint(8) NOT NULL,
+2 -1
View File
@@ -14,8 +14,9 @@ class scm
{
$className = $repo->SCM;
if($className == 'Git') $className = 'GitRepo';
$client = strpos($repo->client, ' ') ? str_replace(' ', '" "', $repo->client) : $repo->client;
if(!class_exists($className)) require(strtolower($className) . '.class.php');
$this->engine = new $className($repo->client, $repo->path, $repo->account, $repo->password, $repo->encoding);
$this->engine = new $className($client, $repo->path, $repo->account, $repo->password, $repo->encoding);
}
/**
+118 -119
View File
@@ -1,126 +1,125 @@
<div class="panel-body">
<style>
.block-waterfallprogress .milestone-chart {box-shadow: none}
.block-waterfallprogress .milestone-chart.has-scrollbar {margin-bottom: -10px}
</style>
<div class='milestone-chart' id='milestoneChart'>
<div class='chart-canvas scrollbar-hover'>
<div class='chart-wrapper'>
<canvas width='400' height='120' data-responsive='true'></canvas>
<?php if(!isset($charts['labels']) || empty($charts['labels'])): ?>
<div class='empty-tip'><?php echo $lang->block->emptyTip;?></div>
<?php else:?>
<style>
.block-waterfallprogress .milestone-chart {box-shadow: none}
.block-waterfallprogress .milestone-chart.has-scrollbar {margin-bottom: -10px}
</style>
<div class='milestone-chart' id='milestoneChart'>
<div class='chart-canvas scrollbar-hover'>
<div class='chart-wrapper'>
<canvas width='400' height='120' data-responsive='true'></canvas>
</div>
</div>
<div class='chart-unit'><?php echo "({$lang->project->workHour})";?></div>
<div class='chart-legend'>
<span class="barline line-pv">PV</span>
<span class="barline line-ev">EV</span>
<span class="barline line-ac">AC</span>
</div>
</div>
<div class='chart-unit'><?php echo "({$lang->project->workHour})";?></div>
<div class='chart-legend'>
<span class="barline line-pv">PV</span>
<span class="barline line-ev">EV</span>
<span class="barline line-ac">AC</span>
</div>
</div>
<style>
.milestone-chart {position: relative}
.milestone-chart .chart-canvas {overflow: auto; max-width: 1002px}
.milestone-chart .chart-wrapper {background: none; padding: 15px 0 0 0}
.milestone-chart .chart-unit {position: absolute; left: 10px; top: 0;}
.milestone-chart .chart-legend {position: absolute; right: 5px; top: 0;}
.milestone-chart .barline {padding-left: 20px; position: relative; display: inline-block; line-height: 20px}
.milestone-chart .barline + .barline {margin-left: 5px}
.milestone-chart .barline:before {content: ' '; display: block; position: absolute; top: 8px; left: 0; width: 16px; height: 3px; background: #0c64eb}
.milestone-chart .barline.line-ev:before {background: rgb(0, 218, 136)}
.milestone-chart .barline.line-ac:before {background: rgb(255, 145, 0)}
</style>
<script>
function initMilestoneChart()
{
var testLabels = [];
for (var i = 1; i <= 30; ++i) {
testLabels.push('No' + (i < 9 ? `0${i}` : i) + 'Week');
}
<style>
.milestone-chart {position: relative}
.milestone-chart .chart-canvas {overflow: auto; max-width: 1002px}
.milestone-chart .chart-wrapper {background: none; padding: 15px 0 0 0}
.milestone-chart .chart-unit {position: absolute; left: 10px; top: 0;}
.milestone-chart .chart-legend {position: absolute; right: 5px; top: 0;}
.milestone-chart .barline {padding-left: 20px; position: relative; display: inline-block; line-height: 20px}
.milestone-chart .barline + .barline {margin-left: 5px}
.milestone-chart .barline:before {content: ' '; display: block; position: absolute; top: 8px; left: 0; width: 16px; height: 3px; background: #0c64eb}
.milestone-chart .barline.line-ev:before {background: rgb(0, 218, 136)}
.milestone-chart .barline.line-ac:before {background: rgb(255, 145, 0)}
</style>
<script>
function initMilestoneChart()
{
var data =
{
labels: <?php echo isset($charts['labels']) ? json_encode($charts['labels']) : '[]'?>,
datasets: [
{
label: 'PV',
color: '#0c64eb',
pointColor: '#0c64eb',
pointStrokeColor: '#0c64eb',
pointHighlightStroke: '#0c64eb',
fillColor: 'rgba(0,106,241, .07)',
pointHighlightFill: '#fff',
data: <?php echo $charts['PV']?>
},
{
label: 'EV',
color: 'rgb(0, 218, 136)',
pointColor: 'rgb(0, 218, 136)',
pointStrokeColor: 'rgb(0, 218, 136)',
pointHighlightStroke: 'rgb(0, 218, 136)',
fillColor: 'rgb(0, 218, 136, .07)',
pointHighlightFill: '#fff',
data: <?php echo $charts['EV']?>
},
{
label: 'AC',
color: 'rgb(255, 145, 0)',
pointColor: 'rgb(255, 145, 0)',
pointStrokeColor: 'rgb(255, 145, 0)',
pointHighlightStroke: 'rgb(255, 145, 0)',
fillColor: 'rgb(255, 145, 0, .07)',
pointHighlightFill: '#fff',
data: <?php echo $charts['AC']?>
}]
};
var data =
{
labels: <?php echo isset($charts['labels']) ? json_encode($charts['labels']) : '[]'?>,
datasets: [
{
label: 'PV',
color: '#0c64eb',
pointColor: '#0c64eb',
pointStrokeColor: '#0c64eb',
pointHighlightStroke: '#0c64eb',
fillColor: 'rgba(0,106,241, .07)',
pointHighlightFill: '#fff',
data: <?php echo $charts['PV']?>
},
{
label: 'EV',
color: 'rgb(0, 218, 136)',
pointColor: 'rgb(0, 218, 136)',
pointStrokeColor: 'rgb(0, 218, 136)',
pointHighlightStroke: 'rgb(0, 218, 136)',
fillColor: 'rgb(0, 218, 136, .07)',
pointHighlightFill: '#fff',
data: <?php echo $charts['EV']?>
},
{
label: 'AC',
color: 'rgb(255, 145, 0)',
pointColor: 'rgb(255, 145, 0)',
pointStrokeColor: 'rgb(255, 145, 0)',
pointHighlightStroke: 'rgb(255, 145, 0)',
fillColor: 'rgb(255, 145, 0, .07)',
pointHighlightFill: '#fff',
data: <?php echo $charts['AC']?>
}]
};
var betterWidth = data.labels.length ? data.labels.length * Math.min(100, Math.max(20, (config.clientLang.startsWith('zh') ? 11 : 9) * data.labels[data.labels.length - 1].length)) : 20;
var renderChart = function()
{
var $chart = $('#milestoneChart');
var $wrapper = $chart.find('.chart-wrapper');
var $canvas = $chart.find('canvas');
var $chartCanvas = $chart.find('.chart-canvas');
if (betterWidth > 400)
{
var updateWrapperSize = function()
{
$wrapper.hide();
$chartCanvas.css('max-width', 'initial');
var maxWidth = $chartCanvas.width();
$chartCanvas.css('max-width', maxWidth);
$chart.toggleClass('has-scrollbar', maxWidth < betterWidth);
$wrapper.show();
};
updateWrapperSize();
$(window).on('resize', updateWrapperSize);
var betterWidth = data.labels.length * Math.min(40, Math.max(20, 5 * data.labels[data.labels.length - 1].length));
var renderChart = function()
{
var $chart = $('#milestoneChart');
var $wrapper = $chart.find('.chart-wrapper');
var $canvas = $chart.find('canvas');
var $chartCanvas = $chart.find('.chart-canvas');
if (betterWidth > 400)
{
var updateWrapperSize = function()
{
$wrapper.hide();
$chartCanvas.css('max-width', 'initial');
var maxWidth = $chartCanvas.width();
$chartCanvas.css('max-width', maxWidth);
$chart.toggleClass('has-scrollbar', maxWidth < betterWidth);
$wrapper.show();
};
updateWrapperSize();
$(window).on('resize', updateWrapperSize);
$wrapper.css('min-width', betterWidth);
$canvas.attr(
{
width: betterWidth,
height: Math.min(200, Math.floor(betterWidth / 4))
});
}
$canvas.lineChart(data,
{
animation: betterWidth < 400,
pointDotStrokeWidth: 1,
pointDotRadius: 2,
datasetStrokeWidth: 2,
datasetFill: false,
datasetStroke: true,
scaleShowBeyondLine: true,
responsive: true,
bezierCurve: false,
scaleFontColor: '#838A9D',
tooltipXPadding: 10,
tooltipYPadding: 10,
multiTooltipTitleTemplate: '<%= label %> <?php echo $lang->project->workHour;?> /h',
multiTooltipTemplate: '<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>',
});
}
$wrapper.css('min-width', betterWidth);
$canvas.attr(
{
width: betterWidth,
height: Math.min(200, Math.floor(betterWidth / 4))
});
}
$canvas.lineChart(data,
{
animation: betterWidth < 400,
pointDotStrokeWidth: 1,
pointDotRadius: 2,
datasetStrokeWidth: 2,
datasetFill: false,
datasetStroke: true,
scaleShowBeyondLine: true,
responsive: true,
bezierCurve: false,
scaleFontColor: '#838A9D',
tooltipXPadding: 10,
tooltipYPadding: 10,
multiTooltipTitleTemplate: '<%= label %> <?php echo $lang->project->workHour;?> /h',
multiTooltipTemplate: '<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>',
});
}
setTimeout(renderChart, betterWidth > 200 ? 100 : 10);
}
initMilestoneChart();
</script>
setTimeout(renderChart, betterWidth > 200 ? 100 : 10);
}
initMilestoneChart();
</script>
<?php endif; ?>
</div>
+13 -5
View File
@@ -106,10 +106,18 @@ class bugModel extends model
*/
public function create($from = '')
{
/* Delete template HTML tags, line breaks and spaces and tags in the steps. */
$stepTemplate = strip_tags($this->lang->bug->tplStep . $this->lang->bug->tplResult . $this->lang->bug->tplExpect);
$steps = strip_tags(preg_replace("/\s/", "", $this->post->steps));
$steps = str_replace("&nbsp;", "", $steps);
/* Delete HTML tags, line breaks, and spaces in templates and steps. */
if($this->post->templateID)
{
$stepsTemplate = strip_tags($this->dao->select('content')->from(TABLE_USERTPL)->where('id')->eq($this->post->templateID)->fetch('content'));
$stepsTemplate = preg_replace("/\s/", "", $stepsTemplate);
}
else
{
$stepsTemplate = strip_tags($this->lang->bug->tplStep . $this->lang->bug->tplResult . $this->lang->bug->tplExpect);
}
$steps = strip_tags(preg_replace("/\s/", "", $this->post->steps));
$steps = str_replace("&nbsp;", "", $steps);
$now = helper::now();
$bug = fixer::input('post')
@@ -123,7 +131,7 @@ class bugModel extends model
->setIF($this->post->assignedTo != '', 'assignedDate', $now)
->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story))
->setIF(strpos($this->config->bug->create->requiredFields, 'project') !== false, 'project', $this->post->project)
->setIF($steps == $stepTemplate, 'steps', '')
->setIF($steps == $stepsTemplate, 'steps', '')
->stripTags($this->config->bug->editor->create['id'], $this->config->allowedTags)
->cleanInt('product,project,module,severity')
->join('openedBuild', ',')
+2 -1
View File
@@ -219,9 +219,10 @@ js::set('flow', $config->global->flow);
</tr>
<tr>
<th><?php echo $lang->bug->steps;?></th>
<td colspan='2'>
<td colspan='2' class='steps'>
<?php echo $this->fetch('user', 'ajaxPrintTemplates', 'type=bug&link=steps');?>
<?php echo html::textarea('steps', $steps, "rows='10' class='form-control'");?>
<?php echo html::hidden('templateID', '');?>
</td>
</tr>
<?php
+6 -3
View File
@@ -544,8 +544,8 @@ class commonModel extends model
echo '<li><hr></li>';
echo '<li><span><i class="icon icon-menu-doc"></i> ' . $this->lang->recent . '</span></li>';
$recentProjects = $this->dao->select('id,code')->from(TABLE_PROJECT)
->where('type')->eq('project')
$recentProjects = $this->dao->select('id,parent,name')->from(TABLE_PROJECT)
->where('type')->in('stage,sprint')
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
->andWhere('status')->ne('close')
->andWhere('deleted')->eq('0')
@@ -555,7 +555,10 @@ class commonModel extends model
if(!empty($recentProjects))
{
foreach($recentProjects as $project) echo '<li>' . html::a(helper::createLink('project', 'view', 'projectID=' . $project->id), $project->code) . '</li>';
foreach($recentProjects as $project)
{
echo '<li>' . html::a(helper::createLink('project', 'task', 'projectID=' . $project->id, '', false, $project->parent), $project->name, '', "class='text-ellipsis' title='$project->name'") . '</li>';
}
if(count($recentProjects) >= 5) echo '<li onclick="getMorePRJ();" class="text-center"><span>' . $this->lang->more . '</span></li>';
}
+6 -1
View File
@@ -80,6 +80,12 @@ $("#searchInput").mouseout(function()
$("#showSearchGo").show();
}
});
$("#menuToggle").bind('click', function()
{
$("#morePRJ").hide();
});
function getMorePRJ()
{
$("#morePRJ").toggle();
@@ -92,7 +98,6 @@ function getMorePRJ()
type: 'post',
success: function(data)
{
console.log(data);
$("#morePRJList").html(data);
}
})
+2
View File
@@ -159,6 +159,7 @@ $lang->todo->methodOrder[80] = 'batchClose';
/* Program. */
$lang->resource->program = new stdclass();
$lang->resource->program->createGuide = 'createGuide';
$lang->resource->program->PGMIndex = 'PGMIndex';
$lang->resource->program->PGMBrowse = 'PGMBrowse';
$lang->resource->program->PGMProduct = 'PGMProduct';
@@ -197,6 +198,7 @@ $lang->resource->program->PRJClose = 'PRJClose';
$lang->resource->program->PRJActivate = 'PRJActivate';
$lang->resource->program->PRJDelete = 'PRJDelete';
$lang->program->methodOrder[0] = 'createGuide';
$lang->program->methodOrder[5] = 'PGMIndex';
$lang->program->methodOrder[10] = 'PGMBrowse';
$lang->program->methodOrder[15] = 'PGMProduct';
+7
View File
@@ -371,6 +371,7 @@ class product extends control
*/
public function batchEdit($productID = 0)
{
$this->lang->product->switcherMenu = $this->product->getSwitcher();
if($this->post->names)
{
$allChanges = $this->product->batchUpdate();
@@ -384,6 +385,7 @@ class product extends control
$this->action->logHistory($actionID, $changes);
}
}
die(js::locate($this->session->productList, 'parent'));
}
@@ -493,6 +495,7 @@ class product extends control
$this->view->title = $product->name . $this->lang->colon . $this->lang->product->view;
$this->view->position[] = html::a($this->createLink($this->moduleName, 'browse'), $product->name);
$this->view->position[] = $this->lang->product->view;
$this->view->product = $product;
$this->view->actions = $this->loadModel('action')->getList('product', $productID);
$this->view->users = $this->user->getPairs('noletter');
@@ -759,12 +762,14 @@ class product extends control
{
$this->loadModel('program');
$this->lang->product->switcherMenu = $this->product->getSwitcher();
$this->session->set('productList', $this->app->getURI(true));
/* Load pager and get tasks. */
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$program = $programID ? $this->program->getPGMByID($programID) : 0;
$programName = empty($program) ? '' : $program->name;
$this->view->title = $this->lang->product->common;
$this->view->position[] = $this->lang->product->common;
@@ -775,7 +780,9 @@ class product extends control
$this->view->programTree = $this->program->getPGMTreeMenu($programID, 'product', '&browseType=' . $browseType);
$this->view->programID = $programID;
$this->view->program = $program;
$this->view->programName = $programName;
$this->view->browseType = $browseType;
$this->display();
}
+21 -8
View File
@@ -953,8 +953,9 @@ class productModel extends model
$products = $this->getList($programID, $status, $limit = 0, $line);
if(empty($products)) return array();
$productKeys = array_keys($products);
$products = $this->dao->select('*')->from(TABLE_PRODUCT)
->where('id')->in(array_keys($products))
->where('id')->in($productKeys)
->orderBy($orderBy)
->page($pager)
->fetchAll('id');
@@ -963,13 +964,13 @@ class productModel extends model
->from(TABLE_STORY)
->where('deleted')->eq(0)
->andWhere('type')->eq($storyType)
->andWhere('product')->in(array_keys($products))
->andWhere('product')->in($productKeys)
->groupBy('product, status')
->fetchGroup('product', 'status');
/* Padding the stories to sure all products have records. */
$emptyStory = array_keys($this->lang->story->statusList);
foreach(array_keys($products) as $productID)
foreach($productKeys as $productID)
{
if(!isset($stories[$productID])) $stories[$productID] = $emptyStory;
}
@@ -987,7 +988,7 @@ class productModel extends model
$plans = $this->dao->select('product, count(*) AS count')
->from(TABLE_PRODUCTPLAN)
->where('deleted')->eq(0)
->andWhere('product')->in(array_keys($products))
->andWhere('product')->in($productKeys)
->andWhere('end')->gt(helper::now())
->groupBy('product')
->fetchPairs();
@@ -995,14 +996,14 @@ class productModel extends model
$releases = $this->dao->select('product, count(*) AS count')
->from(TABLE_RELEASE)
->where('deleted')->eq(0)
->andWhere('product')->in(array_keys($products))
->andWhere('product')->in($productKeys)
->groupBy('product')
->fetchPairs();
$bugs = $this->dao->select('product,count(*) AS conut')
->from(TABLE_BUG)
->where('deleted')->eq(0)
->andWhere('product')->in(array_keys($products))
->andWhere('product')->in($productKeys)
->groupBy('product')
->fetchPairs();
@@ -1010,7 +1011,7 @@ class productModel extends model
->from(TABLE_BUG)
->where('deleted')->eq(0)
->andwhere('status')->eq('active')
->andWhere('product')->in(array_keys($products))
->andWhere('product')->in($productKeys)
->groupBy('product')
->fetchPairs();
@@ -1018,10 +1019,22 @@ class productModel extends model
->from(TABLE_BUG)
->where('deleted')->eq(0)
->andwhere('assignedTo')->eq('')
->andWhere('product')->in(array_keys($products))
->andWhere('product')->in($productKeys)
->groupBy('product')
->fetchPairs();
if(empty($programID))
{
$programKeys = array(0=>0);
foreach($products as $product) $programKeys[] = $product->program;
$programs = $this->dao->select('id,name')->from(TABLE_PROGRAM)
->where('id')->in(array_unique($programKeys))
->andWhere('deleted')->eq('0')
->fetchPairs();
foreach($products as $product) $product->programName = isset($programs[$product->program]) ? $programs[$product->program] : '';
}
$stats = array();
foreach($products as $key => $product)
{
+7 -5
View File
@@ -51,14 +51,15 @@
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
</th>
<th><?php common::printOrderLink('name', $orderBy, $vars, $lang->product->name);?></th>
<th class='w-80px' title='<?php echo $lang->product->activeStoriesTitle;?>'><?php echo $lang->product->activeStories;?></th>
<th class='w-90px' title='<?php echo $lang->product->changedStoriesTitle;?>'><?php echo $lang->product->changedStories;?></th>
<th class='w-70px' title='<?php echo $lang->product->draftStoriesTitle;?>'><?php echo $lang->product->draftStories;?></th>
<th class='w-90px' title='<?php echo $lang->product->closedStoriesTitle;?>'><?php echo $lang->product->closedStories;?></th>
<th class='w-100px' title='<?php echo $lang->program->PGMCommon;?>'><?php echo $lang->program->PGMCommon;?></th>
<th class='w-100px' title='<?php echo $lang->product->activeStoriesTitle;?>'><?php echo $lang->product->activeStories;?></th>
<th class='w-100px' title='<?php echo $lang->product->changedStoriesTitle;?>'><?php echo $lang->product->changedStories;?></th>
<th class='w-100px' title='<?php echo $lang->product->draftStoriesTitle;?>'><?php echo $lang->product->draftStories;?></th>
<th class='w-100px' title='<?php echo $lang->product->closedStoriesTitle;?>'><?php echo $lang->product->closedStories;?></th>
<th class='w-70px' title='<?php echo $lang->product->plans;?>'><?php echo $lang->product->plans;?></th>
<th class='w-70px' title='<?php echo $lang->product->releases;?>'><?php echo $lang->product->releases;?></th>
<th class='w-80px' title='<?php echo $lang->product->unResolvedBugsTitle;?>'><?php echo $lang->product->unResolvedBugs;?></th>
<th class='w-110px' title='<?php echo $lang->product->assignToNullBugsTitle;?>'><?php echo $lang->product->assignToNullBugs;?></th>
<th class='w-80px' title='<?php echo $lang->product->assignToNullBugsTitle;?>'><?php echo $lang->product->assignToNullBugs;?></th>
<?php if($canOrder):?>
<th class='w-70px sort-default'><?php common::printOrderLink('order', $orderBy, $vars, $lang->product->updateOrder);?></th>
<?php endif;?>
@@ -75,6 +76,7 @@
<?php endif;?>
</td>
<td class="c-name" title='<?php echo $product->name?>'><?php echo html::a($this->createLink('product', 'browse', 'product=' . $product->id), $product->name);?></td>
<td class='c-name' title='<?echo empty($programID) ? $product->programName : $programName;?>'><?php echo empty($programID) ? $product->programName : $programName;?></td>
<td class='text-center'><?php echo $product->stories['active'];?></td>
<td class='text-center'><?php echo $product->stories['changed'];?></td>
<td class='text-center'><?php echo $product->stories['draft'];?></td>
+14 -9
View File
@@ -609,6 +609,8 @@ class program extends control
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID);
$this->program->setPGMViewMenu($programID);
$this->app->session->set('PRJBrowse', $this->app->getURI(true));
/* Load pager and get tasks. */
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
@@ -752,10 +754,13 @@ class program extends control
*/
public function ajaxGetRecentProjects()
{
$recentProjects = $this->program->getPRJParams(0, 15);
$recentProjects = $this->program->getPRJRecent();
if(!empty($recentProjects))
{
foreach($recentProjects as $project) echo html::a(helper::createLink('project', 'view', 'projectID=' . $project->id), '<i class="icon icon-menu-doc"></i>' . $project->name);
foreach($recentProjects as $project)
{
echo html::a(helper::createLink('project', 'task', 'projectID=' . $project->id, '', false, $project->parent), '<i class="icon icon-menu-doc"></i>' . $project->name, '', "class='text-ellipsis' title='$project->name'");
}
}
}
@@ -964,7 +969,6 @@ class program extends control
public function PRJGroup($projectID = 0, $programID = 0)
{
$this->lang->navGroup->program = 'project';
$this->session->set('PRJ', $projectID);
$title = $this->lang->company->orgView . $this->lang->colon . $this->lang->group->browse;
$position[] = $this->lang->group->browse;
@@ -972,12 +976,15 @@ class program extends control
$groupUsers = array();
foreach($groups as $group) $groupUsers[$group->id] = $this->group->getUserPairs($group->id);
$goback = $this->session->PRJBrowse ? $this->session->PRJBrowse : inLink('PRJBrowse', "programID=$programID");
$this->view->title = $title;
$this->view->position = $position;
$this->view->groups = $groups;
$this->view->projectID = $projectID;
$this->view->programID = $programID;
$this->view->groupUsers = $groupUsers;
$this->view->goback = $goback;
$this->display();
}
@@ -993,7 +1000,6 @@ class program extends control
public function PRJCreateGroup($projectID = 0, $programID = 0)
{
$this->lang->navGroup->program = 'project';
$this->session->set('PRJ', $projectID);
if(!empty($_POST))
{
@@ -1020,7 +1026,6 @@ class program extends control
public function PRJManageView($groupID, $projectID, $programID)
{
$this->lang->navGroup->program = 'project';
$this->session->set('PRJ', $projectID);
if($_POST)
{
@@ -1120,7 +1125,6 @@ class program extends control
public function PRJManageMembers($projectID, $dept = '')
{
$this->lang->navGroup->program = 'project';
$this->session->set('PRJ', $projectID);
if(!empty($_POST))
{
@@ -1169,6 +1173,7 @@ class program extends control
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('group', 'browse'), 'parent'));
}
$group = $this->group->getById($groupID);
$groupUsers = $this->group->getUserPairs($groupID);
$allUsers = $this->loadModel('dept')->getDeptUserPairs($deptID);
@@ -1390,7 +1395,7 @@ class program extends control
* @access public
* @return void
*/
public function PRJDelete($projectID, $confirm = 'no', $from = 'PRJ', $programID = 0)
public function PRJDelete($projectID, $confirm = 'no')
{
if($confirm == 'no')
{
@@ -1405,8 +1410,8 @@ class program extends control
$this->project->updateUserView($projectID);
$this->session->set('project', '');
$link = $from == 'PRJ' ? inLink('PRJBrowse', 'programID=' . $programID) : inLink('PGMProject', 'programID=' . $programID);
die(js::locate($link, 'parent'));
$url = $this->session->PRJBrowse ? $this->session->PRJBrowse : inLink('PRJBrowse');
die(js::locate($url, 'parent'));
}
}
+1 -1
View File
@@ -1,9 +1,9 @@
<?php
/* Actions. */
$lang->program->createGuide = '选择项目模板';
$lang->program->PRJIndex = '项目仪表盘';
$lang->program->PRJHome = '项目主页';
$lang->program->PRJCreate = '创建项目';
$lang->program->PRJCreateGuide = '选择项目模板';
$lang->program->PRJEdit = '编辑项目';
$lang->program->PRJBatchEdit = '批量编辑';
$lang->program->PRJBrowse = '项目列表';
+25 -19
View File
@@ -393,7 +393,7 @@ class programModel extends model
*/
public function getPGMCommonAction($programID = 0)
{
$output = "<div class='btn-group header-angle-btn' id='pgmCommonAction'><button data-toggle='dropdown' type='button' class='btn' title='{$this->lang->program->PGMCommon}'>{$this->lang->program->PGMCommon} <i class='icon icon-sort-down'></i></button>";
$output = "<div class='btn-group header-angle-btn' id='pgmCommonAction'><button data-toggle='dropdown' type='button' class='btn' title='{$this->lang->program->PGMCommon}'>{$this->lang->program->PGMCommon} <span class='caret'></span></button>";
$output .= '<ul class="dropdown-menu">';
$output .= '<li>' . html::a(helper::createLink('program', 'pgmindex'), "<i class='icon icon-home'></i> " . $this->lang->program->PGMIndex) . '</li>';
$output .= '<li>' . html::a(helper::createLink('program', 'pgmbrowse'), "<i class='icon icon-cards-view'></i> " . $this->lang->program->PGMBrowse) . '</li>';
@@ -785,7 +785,7 @@ class programModel extends model
$programID = $programTitle == 'base' ? current($path) : end($path);
if(empty($path) || $programID == $id) continue;
$program = isset($programList[$programID]) ? $programList[$programID] : $this->getPRJParams($programID);
$program = isset($programList[$programID]) ? $programList[$programID] : $this->getPRJPairs($programID);
$programList[$programID] = $program;
$projectList[$id]->name = $program->name . '/' . $projectList[$id]->name;
@@ -817,23 +817,28 @@ class programModel extends model
* @access public
* @return object
*/
public function getPRJParams($projectID = 0, $limit = 0)
public function getPRJPairs($projectID = 0)
{
if($limit)
{
return $this->dao->select('id,name')->from(TABLE_PROJECT)
->where('type')->eq('project')
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
->andWhere('status')->ne('status')
->andWhere('deleted')->eq('0')
->orderBy('id_desc')
->limit('5,' . $limit)
->fetchAll();
}
else
{
return $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch();
}
return $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch();
}
/**
* Get recent projects.
*
* @param int $projectID
* @access public
* @return object
*/
public function getPRJRecent($limit = 15)
{
return $this->dao->select('id,parent,name')->from(TABLE_PROJECT)
->where('type')->in('stage,sprint')
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
->andWhere('status')->ne('status')
->andWhere('deleted')->eq('0')
->orderBy('id_desc')
->limit('5,' . $limit)
->fetchAll();
}
/**
@@ -852,6 +857,7 @@ class programModel extends model
return $this->dao->select('*')->from(TABLE_PROJECT)
->where('type')->in('project,program')
->andWhere('status')->ne('closed')
->andWhere('deleted')->eq('0')
->beginIF($projectID > 0)->andWhere('path')->like($path . '%')->fi()
->orderBy('grade desc, `order`')
->get();
@@ -871,7 +877,7 @@ class programModel extends model
->where('type')->eq('project')
->beginIF($programID)->andWhere('parent')->eq($programID)->fi()
->andWhere('model')->eq($model)
->andWhere('deleted')->eq(0)
->andWhere('deleted')->eq('0')
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->programs)->fi()
->orderBy('id_desc')
->fetchPairs();
+1 -1
View File
@@ -88,7 +88,7 @@ js::set('browseType', $browseType);
<?php common::printIcon('program', 'PRJSuspend', "programID=$project->id", $project, 'list', 'pause', '', 'iframe', true);?>
<?php common::printIcon('program', 'PRJClose', "programID=$project->id", $project, 'list', 'off', '', 'iframe', true);?>
<?php if(common::hasPriv('program', 'PRJEdit')) echo html::a($this->createLink("program", "PRJEdit", "programID=$project->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$lang->edit}'");?>
<?php common::printIcon('program', 'PRJDelete', "projectID=$project->id&confirm=no&from=PGM&programID=$programID", $project, 'list', 'trash', 'hiddenwin', '', true);?>
<?php common::printIcon('program', 'PRJDelete', "projectID=$project->id", $project, 'list', 'trash', 'hiddenwin', '', true);?>
</td>
</tr>
<?php endforeach;?>
+1 -1
View File
@@ -107,7 +107,7 @@ js::set('browseType', $browseType);
<?php common::printIcon('program', 'PRJSuspend', "programID=$project->id", $project, 'list', 'pause', '', 'iframe', true);?>
<?php common::printIcon('program', 'PRJClose', "programID=$project->id", $project, 'list', 'off', '', 'iframe', true);?>
<?php if(common::hasPriv('program', 'PRJEdit')) echo html::a($this->createLink("program", "PRJEdit", "programID=$project->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$lang->edit}'");?>
<?php common::printIcon('program', 'PRJDelete', "projectID=$project->id&confirm=no&from=PRJ&programID=$programID", $project, 'list', 'trash', 'hiddenwin', '', true);?>
<?php common::printIcon('program', 'PRJDelete', "projectID=$project->id", $project, 'list', 'trash', 'hiddenwin', '', true);?>
</td>
<?php if($canOrder):?>
<td class='c-actions sort-handler'><i class="icon icon-move"></i></td>
+1 -1
View File
@@ -53,7 +53,7 @@
<?php if($template == 'waterfall'):?>
<tr>
<th><?php echo $lang->program->PRJCategory;?></th>
<td><?php echo html::select('category', $lang->program->PRJCategoryList, '', "class='form-control'");?></td><td></td><td></td>
<td><?php echo html::select('product', $lang->program->PRJCategoryList, '', "class='form-control'");?></td><td></td><td></td>
</tr>
<?php endif;?>
<tr>
+1 -1
View File
@@ -15,7 +15,7 @@
<?php js::set('confirmDelete', $lang->group->confirmDelete);?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<?php echo html::a(inLink('PRJBrowse', "programID=$programID"), $lang->goback, '', 'class="btn btn-secondary"');?>
<?php echo html::a($goback, $lang->goback, '', 'class="btn btn-secondary"');?>
<span class='btn btn-link btn-active-text'><span class='text'><?php echo $lang->group->browse;?></span></span>
</div>
<div class='btn-toolbar pull-right'>
+10 -4
View File
@@ -7,6 +7,7 @@ $(function()
});
var taskTree = $taskTree.data('zui.tree');
if(!taskTree) return;
var sortItems = function($items)
{
@@ -101,6 +102,13 @@ $(function()
$.zui.store.set('project/tree/showItem', false);
return;
}
var adjustSidePosition = function()
{
var scrollTop = $(document).scrollTop() - 140;
if(scrollTop < 0) scrollTop = 0;
$itemContent.closest('.cell').css('margin-top', scrollTop);
};
adjustSidePosition();
if (lastAjaxRequest) lastAjaxRequest.abort();
$itemContent.empty().addClass('loading').attr('data-loading', loadingText || '');
isItemLoading = true;
@@ -117,10 +125,8 @@ $(function()
$itemContent.find('.histories').histories();
$itemContent.find('.iframe').modalTrigger();
$.zui.store.set('project/tree/showItem', url);
var scrollTop = $(document).scrollTop() - 140;
if(scrollTop < 0) scrollTop = 0;
$itemContent.closest('.cell').css('margin-top', scrollTop);
adjustSidePosition();
setTimeout(adjustSidePosition, 300);
},
error: function()
{
+20 -7
View File
@@ -287,6 +287,14 @@ class repo extends control
$this->app->loadClass('pager', $static = true);
$pager = new pager(0, 8, 1);
if($_POST)
{
$oldRevision = isset($this->post->revision[1]) ? $this->post->revision[1] : '';
$newRevision = isset($this->post->revision[0]) ? $this->post->revision[0] : '';
$this->locate( $this->repo->createLink('diff', "repoID=$repoID&entry=" . $this->repo->encodePath(urldecode($path)) . "&oldrevision=$oldRevision&newRevision=$newRevision"));
}
/* Cache infos. */
if($refresh or !$cacheFile or !file_exists($cacheFile) or (time() - filemtime($cacheFile)) / 60 > $this->config->repo->cacheTime)
{
@@ -371,6 +379,14 @@ class repo extends control
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
if($_POST)
{
$oldRevision = isset($this->post->revision[1]) ? $this->post->revision[1] : '';
$newRevision = isset($this->post->revision[0]) ? $this->post->revision[0] : '';
$this->locate( $this->repo->createLink('diff', "repoID=$repoID&entry=" . $this->repo->encodePath(urldecode($path)) . "&oldrevision=$oldRevision&newRevision=$newRevision"));
}
$this->scm->setEngine($repo);
$info = $this->scm->info($entry, $revision);
@@ -558,19 +574,16 @@ class repo extends control
$arrange = $this->cookie->arrange ? $this->cookie->arrange : 'inline';
if($this->server->request_method == 'POST')
{
$oldRevision = isset($this->post->revision[1]) ?$this->post->revision[1] : '';
$newRevision = isset($this->post->revision[0]) ?$this->post->revision[0] : '';
$oldRevision = isset($this->post->revision[1]) ? $this->post->revision[1] : '';
$newRevision = isset($this->post->revision[0]) ? $this->post->revision[0] : '';
if($this->post->arrange)
{
$arrange = $this->post->arrange;
setcookie('arrange', $arrange);
}
if($this->post->encoding) $encoding = $this->post->encoding;
if(!$oldRevision)
{
echo js::alert($this->lang->repo->error->diff);
die(js::locate('back'));
}
$this->locate( $this->repo->createLink('diff', "repoID=$repoID&entry=$entry&oldrevision=$oldRevision&newRevision=$newRevision&showBug=&encoding=$encoding"));
}
$this->scm->setEngine($repo);
+6
View File
@@ -1,3 +1,9 @@
$(document).ready(function()
{
$("#inline").click(function(){$('#arrange').val('inline');this.form.submit();});
$("#appose").click(function(){$('#arrange').val('appose');this.form.submit();});
$(".label-exchange").click(function(){ $('#exchange').submit();});
});
function changeEncoding(encoding)
{
$('#encoding').val(encoding);
+1 -1
View File
@@ -931,7 +931,7 @@ class repoModel extends model
{
if(empty($_POST)) return false;
$scm = $this->post->SCM;
$client = $this->post->client;
$client = str_replace(' ', '" "', $this->post->client);
$account = $this->post->account;
$password = $this->post->password;
$encoding = strtoupper($this->post->encoding);
+1 -1
View File
@@ -14,7 +14,7 @@
$pathInfo = '&root=' . $this->repo->encodePath(empty($path) ? '/' : $path);
if(isset($entry)) $pathInfo .= '&type=file';
?>
<form id='logForm' class='main-table' data-ride='table' action='<?php echo $this->repo->createLink('diff', "repoID=$repoID", "entry=" . $this->repo->encodePath($path))?>' method='post'>
<form id='logForm' class='main-table' data-ride='table' method='post'>
<table class='table table-fixed'>
<thead>
<tr>
+1 -1
View File
@@ -47,7 +47,7 @@
<?php endif;?>
</ul>
</nav>
<form id='logForm' class='main-table' data-ride='table' action='<?php echo $this->repo->createLink('diff', "repoID=$repoID", "entry=" . $this->repo->encodePath($entry))?>' method='post'>
<form id='logForm' class='main-table' data-ride='table' method='post'>
<table class='table table-fixed' id='logList'>
<thead>
<tr>
@@ -77,6 +77,7 @@ function setTemplate(templateID)
var cmd = editor['<?php echo $link;?>'].edit.cmd;
editor['<?php echo $link;?>'].html('');
cmd.inserthtml(content);
$("#mainContent #dataform .table.table-form .steps #templateID").attr("value", templateID);
}
function deleteTemplate(templateID)
+1 -2
View File
@@ -50,7 +50,6 @@ a.showMoreImage:hover {opacity: 1;}
#mainMenu .pull-right > .btn-group > .btn-icon {background: transparent;}
#mainMenu .pull-right > .btn-group > .btn-icon:hover {background: #fff;}
#menu {width: 96px;}
#menuNav> .nav > li > span {padding: 8px; line-height: 20px; cursor: pointer; color: #fff; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -khtml-user-select: none; user-select:none;}
#morePRJ {display:none; max-height: 420px; position: fixed; bottom: 0; left: 100px; z-index: 999; background: white; padding: 20px 10px; height: 420px; margin-bottom: 40px; border: 1px solid #efefef}
#morePRJ > .list-group {height: 400px; min-width: 150px; max-width:200px;}
#morePRJ > .list-group {height: 380px; min-width: 150px; max-width:200px;}
File diff suppressed because one or more lines are too long