* Finish task #71905.
This commit is contained in:
@@ -1,5 +1,35 @@
|
||||
$(function()
|
||||
{
|
||||
$('#projectsForm').table(
|
||||
{
|
||||
replaceId: 'projectIdList',
|
||||
statisticCreator: function(table)
|
||||
{
|
||||
var $table = table.getTable();
|
||||
var $checkedRows = $table.find('tbody>tr.checked');
|
||||
var checkedTotal = $checkedRows.length;
|
||||
var statistics = summary;
|
||||
var checkedStatistics = checkedSummary.replace('%total%', checkedTotal);
|
||||
|
||||
if(browseType == 'all' || browseType == 'unclosed')
|
||||
{
|
||||
var checkedWait = $checkedRows.filter("[data-status=wait]").length;
|
||||
var checkedDoing = $checkedRows.filter("[data-status=doing]").length;
|
||||
var checkedSuspended = $checkedRows.filter("[data-status=suspended]").length;
|
||||
var checkedClosed = $checkedRows.filter("[data-status=closed]").length;
|
||||
|
||||
statistics = allSummary;
|
||||
checkedStatistics = checkedAllSummary.replace('%total%', checkedTotal)
|
||||
.replace('%wait%', checkedWait)
|
||||
.replace('%doing%', checkedDoing)
|
||||
.replace('%suspended%', checkedSuspended)
|
||||
.replace('%closed%', checkedClosed);
|
||||
}
|
||||
|
||||
return checkedTotal ? checkedStatistics : statistics;
|
||||
}
|
||||
});
|
||||
|
||||
$('input[name^="showEdit"]').click(function()
|
||||
{
|
||||
$.cookie('showProjectBatchEdit', $(this).is(':checked') ? 1 : 0, {expires: config.cookieLife, path: config.webRoot});
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
$originOrders[] = $program->order;
|
||||
?>
|
||||
|
||||
<tr <?php echo $trAttrs;?> data-type="<?php echo $program->type;?>">
|
||||
<tr <?php echo $trAttrs;?> data-type="<?php echo $program->type;?>" data-status="<?php echo $program->status?>">
|
||||
<td class='c-name text-left <?php if($canOrder) echo 'sort-handler';?> has-prefix has-suffix' title='<?php echo $program->name?>'>
|
||||
<?php
|
||||
$icon = '';
|
||||
|
||||
@@ -14,7 +14,11 @@
|
||||
<?php
|
||||
js::set('programID', $programID);
|
||||
js::set('browseType', $browseType);
|
||||
$canBatchEdit = common::hasPriv('project', 'batchEdit');
|
||||
$canBatchEdit = common::hasPriv('project', 'batchEdit');
|
||||
$waitCount = 0;
|
||||
$doingCount = 0;
|
||||
$suspendedCount = 0;
|
||||
$closedCount = 0;
|
||||
?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toolBar pull-left">
|
||||
@@ -42,7 +46,7 @@ $canBatchEdit = common::hasPriv('project', 'batchEdit');
|
||||
</p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<form class='main-table' id='projectsForm' method='post' data-ride="table">
|
||||
<form class='main-table' id='projectsForm' method='post'>
|
||||
<?php
|
||||
$vars = "programID=$programID&browseType=$browseType&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";
|
||||
$setting = $this->datatable->getSetting('program');
|
||||
@@ -62,8 +66,12 @@ $canBatchEdit = common::hasPriv('project', 'batchEdit');
|
||||
</thead>
|
||||
<tbody class="sortable" id='projectTableList'>
|
||||
<?php foreach($projectStats as $project):?>
|
||||
<tr data-id="<?php echo $project->id;?>">
|
||||
<tr data-id="<?php echo $project->id;?>" data-status="<?php echo $project->status;?>">
|
||||
<?php $project->from = 'pgmproject';?>
|
||||
<?php if($project->status == 'wait') $waitCount ++;?>
|
||||
<?php if($project->status == 'doing') $doingCount ++;?>
|
||||
<?php if($project->status == 'suspended') $suspendedCount ++;?>
|
||||
<?php if($project->status == 'closed') $closedCount ++;?>
|
||||
<?php foreach($setting as $value) $this->project->printCell($value, $project, $users, $programID);?>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
@@ -83,12 +91,19 @@ $canBatchEdit = common::hasPriv('project', 'batchEdit');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="table-statistic"><?php echo strpos(',all,unclosed,', ",$browseType,") !== false ? sprintf($lang->project->allSummary, count($projectStats), $waitCount, $doingCount, $suspendedCount, $closedCount) : sprintf($lang->project->summary, count($projectStats));?></div>
|
||||
<?php $pager->show('right', 'pagerjs');?>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
js::set('summary', sprintf($lang->project->summary, count($projectStats)));
|
||||
js::set('allSummary', sprintf($lang->project->allSummary, count($projectStats), $waitCount, $doingCount, $suspendedCount, $closedCount));
|
||||
js::set('checkedSummary', $lang->project->checkedSummary);
|
||||
js::set('checkedAllSummary', $lang->project->checkedAllSummary);
|
||||
?>
|
||||
<script>
|
||||
$('input[name^="involved"]').click(function()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user